From c7c6e34e7a0ab598865b9c6d8926e31788696270 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 21 Mar 2013 10:58:55 -0600 Subject: [PATCH 001/181] Committing current progress. --- CONTRIBUTING.md | 2 +- build/build.js | 3 +- docs/app-development.html | 986 ------------------ docs/js/f2.js | 2 +- docs/sdk/api.js | 1 + docs/sdk/assets/js/apidocs.js | 5 + docs/sdk/classes/F2.App.html | 4 + docs/sdk/classes/F2.AppConfig.html | 4 + docs/sdk/classes/F2.AppHandlers.html | 412 ++++++++ .../classes/F2.AppManifest.AppContent.html | 4 + docs/sdk/classes/F2.AppManifest.html | 4 + docs/sdk/classes/F2.Constants.Css.html | 4 + docs/sdk/classes/F2.Constants.Events.html | 4 + docs/sdk/classes/F2.Constants.Sockets.html | 4 + docs/sdk/classes/F2.Constants.Views.html | 4 + docs/sdk/classes/F2.Constants.html | 4 + .../classes/F2.ContainerConfig.UI.Mask.html | 4 + docs/sdk/classes/F2.ContainerConfig.UI.html | 4 + docs/sdk/classes/F2.ContainerConfig.html | 4 + docs/sdk/classes/F2.Events.html | 4 + docs/sdk/classes/F2.Rpc.html | 4 + docs/sdk/classes/F2.UI.Modals.html | 4 + docs/sdk/classes/F2.UI.Views.html | 4 + docs/sdk/classes/F2.UI.html | 4 + docs/sdk/classes/F2.html | 4 + docs/sdk/data.json | 35 + docs/sdk/files/sdk_src_F2.js.html | 4 + docs/sdk/files/sdk_src_app_handlers.js.html | 570 ++++++++++ docs/sdk/files/sdk_src_classes.js.html | 4 + docs/sdk/files/sdk_src_constants.js.html | 4 + docs/sdk/files/sdk_src_container.js.html | 4 + docs/sdk/files/sdk_src_events.js.html | 4 + docs/sdk/files/sdk_src_rpc.js.html | 4 + docs/sdk/files/sdk_src_ui.js.html | 4 + docs/sdk/index.html | 6 +- docs/sdk/modules/f2.html | 10 + docs/src/app-development.md | 2 +- docs/src/container-development.md | 2 +- docs/src/f2js-sdk.md | 4 +- docs/src/index.md | 4 +- docs/src/template/baseTemplate.html | 4 +- docs/src/template/footer.html | 8 +- docs/src/template/header.html | 4 +- docs/src/template/style.html | 4 +- sdk/src/app_handlers.js | 304 ++++++ tests/spec/container-spec.js | 2 +- 46 files changed, 1463 insertions(+), 1007 deletions(-) create mode 100644 docs/sdk/classes/F2.AppHandlers.html create mode 100644 docs/sdk/files/sdk_src_app_handlers.js.html create mode 100644 sdk/src/app_handlers.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 68d804e6..7e742f03 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,7 @@ Coding standards promote a common vocabulary and syntax so that our fellow devel Coding standards help an individual project, and also make it easier for one project to reuse components from another project. This, of course, is a core component of F2. -Read our [coding standards](https://github.com/OpenF2/F2/wiki/Contributing-to-F2) on the wiki. +Read our [coding standards](https://github.com/OpenF2/F2/wiki/Coding-Standards) on the wiki. ## Keep in Touch diff --git a/build/build.js b/build/build.js index 83a636fe..ad65529c 100755 --- a/build/build.js +++ b/build/build.js @@ -51,7 +51,8 @@ var CORE_FILES = [ { src: 'sdk/src/events.js', minify: true }, { src: 'sdk/src/rpc.js', minify: true }, { src: 'sdk/src/ui.js', minify: true }, - { src: 'sdk/src/container.js', minify: true } + { src: 'sdk/src/container.js', minify: true }, + { src: 'sdk/src/app_handlers.js', minify: true } ]; var ENCODING = 'utf-8'; var EOL = '\n'; diff --git a/docs/app-development.html b/docs/app-development.html index 19b42ecd..e69de29b 100644 --- a/docs/app-development.html +++ b/docs/app-development.html @@ -1,986 +0,0 @@ - - - - F2 - App Development - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
-
-

App Development

-
-

-You've come to the right place if you want to start building F2 apps. Before continuing, make sure you've cloned the F2 repository on GitHub or downloaded the latest framework build (v1.1.1). Secondly, read about the F2 Framework. There are a few important concepts to help you better understand apps, containers and context. -

- -

F2 apps are synonymous with modules, widgets and portlets. Think charts, portfolios, trade tickets, and screeners. F2 apps only need to be programmed once, no matter where they will be used. To start, F2 Apps are either:

-
-
-Display App -
-
-A display app presents information to users in the form of a visible widget (using HTML, CSS, and JavaScript). -
-
-Data App -
-
-A data app is a content feed available in industry-standard formats including JSON, JSONP, RSS or app developer-designed XML. -
-
- -

For the purposes of the documentation on this page, we'll focus on developing display apps. Browse to The Basics: Framework for more background information about F2 apps.

-

Interested in developing F2 containers? Browse to Container Development.

-
-
-

Get Started

-

To help you get started building an F2 app, browse through the resources below. To jump start your F2 app development, download the F2 app template (which now includes a basic container) or follow the instructions below.

-

-Download Basic F2 App Template -

- -
-

Basic Container

-

To begin, you do not need to build F2 as described in the readme on GitHub. Simply download Bootstrap and save a local copy of F2.js. Also ensure you're properly configured.

-

-Download F2.js Download Bootstrap -

- -

Create your basic container HTML template:

-
<!DOCTYPE html>
-<html>
-    <head>
-        <title>F2 Container</title>
-        <link rel="stylesheet" href="/path/to/your/bootstrap.css">
-    </head>
-    <body>
-        <div class="container">
-            <div class="hero-unit">
-                <h1>Hello F2</h1>
-            </div>
-            <div class="row"><!--apps go here--></div>
-        </div>
-        <!--include jQuery & Bootstrap-->
-        <script src="http://code.jquery.com/jquery-latest.js"></script>
-        <script src="/path/to/your/bootstrap.js"></script>
-        <!--include F2.js-->
-        <script src="/path/to/your/F2.js"></script>
-        <!--init & register-->
-        <script>
-            (function(){
-                //define AppConfigs
-                var _appConfigs = [{
-                    appId: "com_your_app_id",
-                    description: "F2 app description",
-                    name: "F2 App",
-                    manifestUrl: "/path/to/your/manifest.js" //note the path to your manifest! 
-                }];
-                //Setup ContainerConfig
-                F2.init({
-                    beforeAppRender: function(app){
-                        var appRoot = '<section class="well span12"></section>';
-                        return $(appRoot).appendTo('div.row');
-                    },
-                    afterAppRender: function (app, html) {
-                        //app.root is `appRoot` from beforeAppRender()
-                        return $(app.root).append(html);
-                    }
-                }); 
-                F2.registerApps(_appConfigs); //pass _appConfigs to initialize apps
-            })();
-        </script>
-    </body>
-</html>
-

In developing a more advanced container, the HTML document's body element would contain additional markup and allow for specific positioning or placement of apps. Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the F2 design guidelines.

-
-
-

Basic App

-

Create your basic F2 app manifest and save it as /path/to/your/manifest.js using this code below. Note the path to this file should be specified in the manifestUrl property within the _appConfigs array in your basic container (shown above).

-
F2_jsonpCallback_com_your_app_id({
-    "scripts": [],   
-    "styles": [],   
-    "apps": [{
-        "data": {},
-        "html": "<div><p>Hello, world. I'm an F2 app.</p></div>"
-    }]
-})
-

Note You can download the F2 app template instead of creating the basic app by hand.

-
-
-

Testing the Basics

-

Now with a basic container and a basic app, you can load your F2 container and expect to see:

-
-
-
-

In getting to this point, you've only scratched the surface of F2 containers and apps. Continue reading and understanding the F2 spec to build exactly the financial solutions that our customers want.

-
-
-

Sample Apps and Container

-

Good news! In the project repo on GitHub, you will find a basic container along with a number of sample apps which demonstrate functionality far beyond the basic app above. Once you clone or download the project repository, open the sample container by pointing your browser at:

-

http://localhost/F2/examples/container/

-
-
-

Configuration

-

It is assumed you will be developing F2 apps locally and have a localhost setup. The URLs mentioned in this specification also assume you have configured your F2 apps to run at http://localhost/F2/. The examples provided as part of the project repository demonstrate apps written in different languages (PHP, JavaScript, C#). While it is not a requirement you have a web server configured on your computer, it will certainly allow you to more deeply explore the sample apps.

-

To better understand F2 and the role of apps, you need to understand the role of the container. If you haven’t already, read more about containers in the Framework.

-

To get started working with or developing containers, browse to the documentation for developing the container.

-

Ready to start coding?

-

-Developing F2 Apps F2.js SDK Reference -

- -
-
-
-
-

App Design

-

Design considerations are an important first step when creating a new app. Content can range from news to research to multimedia, and content should be presented using Progressive Enhancement, Mobile First and Responsive Design methodologies. That is to say multimedia content, for example, should be shown plugin-free (using HTML5 video or audio elements) for capable browsers and fallback to Flash-based players for browsers that do not yet support HTML5 related technologies. (VideoJS is good example of open-source JavaScript and CSS "that makes it easier to work with and build on HTML5 video, today.")

-

If App Developers embed URLs back to their own websites or to third party sites, URLs must be opened in a new window as to not interrupt the experience of someone using the container. If authentication is required on an App Developer's site, this can be accomplished with pass-through authentication using encrypted URLs as discussed in Single Sign On.

-
-

Choices

-

In order to ensure that apps built using F2 are successful, they must be accessible. As such, F2 made choices for which open-source libraries and frameworks would be leveraged to reduce the level of effort across F2 adopters.

-

Read more about those choices in the Framework.

-

Ultimately, the responsibility of app design falls on either the Container or App Developer. In many cases, Container Developers will provide App Developers will visual designs, style guides or other assets required to ensure apps have the form and function for a given container. Container Developers may also provide CSS for App Developers to adhere to—which should be easy since F2 enforces a consistent HTML structure across all containers and apps.

-
-
-
-
-

Developing F2 Apps

-

Let's take a close look at how to build an F2 app. We'll explain how to get an F2 AppID, what the AppManifest is all about, what output format your app needs to support, how the contents of the AppContent.html property work, and the two hooks for adding form and function to your app: scripts and styles.

-

Before opening your editor, read the configuration assumptions.

-
-

F2 AppID

-

To develop an F2 app, you need a unique identifier called an AppID. This AppID will be unique to your app across the entire open financial framework ecosystem. The format of the AppID looks like this: com_companyName_appName, where the companyName "namespace" is your company name and appName is the name of your app.

-

As an example, your AppID could look like this:

-

com_acmecorp_watchlist

-

If you built more than one app while working at Acme Corporation, you could create more AppIDs. All of these are valid:

-
    -
  • com_acmecorp_watchlist2
  • -
  • com_acmecorp_watchlist_big_and_tall
  • -
  • com_acmecorp_static_charts
  • -
  • com_acmecorp_interactive_charts
  • -
-

To guarantee uniqueness, we have provided an AppID generation service that allows you to customize your AppID.

-

Get Your F2 AppID Now »

-
-
-

Setting Up Your Project

-

Once you have your AppID, start by setting up your project. You will need at least one file: the App Manifest. Create a new file called manifest.js. Also, chances are you'll want custom styling and functionality, so go ahead and create appclass.js (for your app logic) and app.css for your CSS. Your project folder should look like this:

-
-
-
-

Helper Download the F2 app starter zip or read about setting up a basic container and app in Getting Started.

-
-
-

App Manifest

-

For an app to be considered F2-capable, it must first have this basic structure—called the App Manifest—represented in JSON:

-
{
-    "inlineScripts":[],  
-    "scripts":[],    
-    "styles":[],     
-    "apps":[{
-            "data":{},
-            "html":"",
-            "status":""
-    }]
-}
-

The App Manifest can be generated by the server-side code of your choice or be written-by-hand in your favorite text editor. In the GitHub repository, there are apps written in JavaScript, PHP, and C# to serve as examples to get you started.

-

When it's complete (using the examples further below), the App Manifest looks like this:

-
F2_jsonpCallback_com_companyname_appname({
-    "inlineScripts":["(function(){ var foo = bar; doSomething(); })()"],
-    "scripts":[
-        "http://www.domain.com/js/appclass.js"
-    ],   
-    "styles":[
-        "http://www.domain.com/css/app.css"
-    ],   
-    "apps":[{
-            "data":{ 
-                foo: "bar",
-                value: 12345
-            },
-            "html":"<div class=\"sunrise\">Hello world.</div>",
-            "status":"good"
-    }]
-})
-

Let's break the App Manifest object down and look at each property (in reverse order to keep it fun).

-
-
-

Apps

-

The apps property is an array of AppContent objects. Each AppContent object contains three properties:

-
    -
  1. html
  2. -
  3. data
  4. -
  5. status
  6. -
-
-

html

-

The html property contains the view of your app represented in (optionally encoded) HTML. While you can modify the way your app appears or functions within the container, the html property is what the container will show when it registers your app and displays its contents for the first time.

-

Example:

-
"html": "<div class=\"sunrise\">Hello world.</div>"
-

The optionally encoded version of the html example above is:

-
"html": "%3Cdiv%20class%3D%22sunrise%22%3EHello%20world.%3C%2Fdiv%3E"
-
-
-

data

-

The data property exists to support the placement of arbitrary data needing to be passed along with the app. This field is optional.

-

Example:

-
"data": { 
-    foo: "bar",
-    value: 12345
-}
-
-
-

status

-

The status property allows app developers to communicate a server-side arbitrary status code to itself or to the container. This field is optional.

-

Example:

-
"status": "good"
-
-
-
-

Styles

-

The styles property is an array of URLs. The styles array refers to any CSS files needed by the app so it will be displayed properly on the container. The externally-referenced CSS files should be fully-qualified, including a protocol.

-

Example:

-
"styles": [
-    "http://www.domain.com/css/app.css"
-]
-

In the case when multiple stylesheetes are needed, simply add to the array as shown in this example:

-
"styles": [
-    "http://www.domain.com/css/app.css",
-    "http://www.domain.com/css/app-responsive.css"
-]
-

Read more about CSS and namespacing inside your app.

-

Note URLs referenced in the Scripts and Styles arrays are loaded synchronously by F2.js, so be sure to order your scripts properly.

-
-
-

Scripts

-

The scripts property is an array of URLs. The scripts array refers to any JavaScript files needed by the app so that it will function correctly on the container. The externally-referenced JS files should be fully-qualified.

-

Example:

-
"scripts": [
-    "http://www.domain.com/js/appclass.js"
-]
-

In the case when multiple scripts are needed, simply add to the array as shown in this example:

-
"scripts": [
-    "http://www.domain.com/js/lib.js",
-    "http://www.domain.com/js/appclass.js"
-]
-

Read more about JavaScript and namespacing inside your app.

-

Note URLs referenced in the Scripts and Styles arrays are loaded synchronously by F2.js, so be sure to order your scripts properly.

-
-
-

Inline Scripts

-

The inlineScripts property is an array of strings. The inlineScripts array can include any JavaScript code needed by the app that cannot be included in your App Class. The contents of the inlineScripts array will be evaluated as JavaScript (using eval()) when all scripts have finished loading.

-

Example:

-
"inlineScripts": [
-    "(function(){ var foo = bar; doSomething(); })()"
-]
-
-

-About Inline Scripts -

-

-While the use of inlineScripts is supported by F2's App Manifest, it is not recommended for use. There are many reasons for this, the main one is to avoid cluttering the global namespace. Developers should make every attempt to put their JavaScript code inside their App Class. -

-
- -

Read more about JavaScript and namespacing inside your app.

-

Note URLs referenced in the Scripts and Styles arrays are loaded synchronously by F2.js, so be sure to order your scripts properly.

-
-
-

Sample App Manifest

-

If we use the examples above, our AppManifest would look like this:

-
F2_jsonpCallback_com_companyname_appname({
-    "inlineScripts":["(function(){ var foo = bar; doSomething(); })()"],
-    "scripts":[
-        "http://www.domain.com/js/appclass.js"
-    ],   
-    "styles":[
-        "http://www.domain.com/css/app.css"
-    ],   
-    "apps":[{
-            "data":{ 
-                foo: "bar",
-                value: 12345
-            },
-            "html":"<div class=\"sunrise\">Hello world.</div>",
-            "status":"good"
-    }]
-})
-

Note You may have noticed the presence of the function name F2_jsonpCallback_com_companyname_appname on the first line of the example above. That function name is the callback and is explained in App Manifest Response.

-
-
-

App Manifest Response

-

OK, so you know about F2 apps and you're ready to write your own App Manifest. To go from zero to something, download the F2 app starter zip. Once you have your AppManifest defined (or at least stubbed out), there's one important detail you need to know now—the App Manifest response format.

-

As part of F2, containers register apps—typically hosted on different domains—using JSONP. This means F2 App Manifest files must provide a JSONP callback function. (If you don't know what JSONP is or how it works, we recommend reading what Remy Sharp has to say about it.)

-

For security reasons, the App Manifest JSONP callback function must be a specific, reliable, and testable format. F2 has defined that using a combination of a string and your unique F2 AppID. The JSONP callback function name looks like this:

-

F2_jsonpCallback_<AppID>

-

When applied, the final (bare bones) App Manifest file looks like this example (where com_companyname_appname is your AppID):

-
//manifest.js
-F2_jsonpCallback_com_companyname_appname({
-    "scripts":[
-        "http://www.domain.com/js/appclass.js"
-    ],   
-    "styles":[
-        "http://www.domain.com/css/app.css"
-    ],   
-    "apps":[{
-            "html":"<div class=\"sunrise\">Hello world.</div>"
-    }]
-})
-

Note the JSONP callback function name will not be passed from the container using a traditional querystring parameter (HTTP GET), so you must configure this correctly for your app to appear on a container. This means you have to hard-code it in your appmanifest.js.

-

Required Don't forget you need an AppID before you can run your app on a container. Get your AppID now »

-
-
-

App HTML

-

Every F2 app has HTML. The only catch is that the HTML isn't provided by the app itself but rather passed to the container via the app's AppManifest. But that's not a problem because F2 has provided examples to show you the way. Here are the steps for getting your app HTML into your AppContent.html property:

-
    -
  1. Develop the web page or module or widget or component or portlet that will be your app.
  2. -
  3. Take all the contents of it—that is, the HTML—and encode it. (This step is optional.)
  4. -
  5. Put the (optionally encoded) result in the html property of your AppContent object within your App Manifest file's App object.
  6. -
-

Huh? Check out this example:

-

Step 1.

-
<div class="sunrise">Hello world.</div>
-

Step 2. Encoded HTML. (Optional)

-
%3Cdiv%20class%3D%22sunrise%22%3EHello%20world.%3C%2Fdiv%3E
-

Step 3. App Manifest file.

-
{
-    ...
-    "apps":[{
-        "html": "<div class=\"sunrise\">Hello world.</div>"
-        ...
-    }]
-}
-

Note You are not required to encode the app HTML, so follow steps 2 and 3 above omitting the encoding step.

-
-

Automatic Consistency

-

F2 uses and recommends Twitter Bootstrap for Container and App Developers to benefit from a consistent HTML and CSS structure regardless of who developed the F2 component. This way, Container Developers can write CSS they know will style F2 apps without engaging with the app developer to ensure compatability.

-

This also means App Developers must adhere to Bootstrap's scaffolding guidelines as defined on their website.

-

An example two-column layout using Bootstrap-specifed markup:

-
<div class="row">
-  <div class="span4">...</div>
-  <div class="span8">...</div>
-</div>
-

The .span4 and .span8 provide two columns in the 12-column grid.

-

Note Read more about Creating a Common Look and Feel with F2.

-
-
-
-

Scripts & Styles

-

Once your app is on the container, chances are you'll want it to actually do something. As an app developer, it is entirely up to you to write your own stylesheets and javascript code to add form and function to your app. F2's standardized App Manifest provides hooks for your CSS and scripts to get onto the container—just use the scripts and styles arrays detailed above in the App Manifest.

-
-
-

Styles

-

Including your own CSS in the styles array of the App Manifest opens the door to the potential of unexpected display issues. Therefore, as an app developer, you are required to properly namespace your CSS selectors and declarations. For the details on writing correctly namespaced code, read the namespacing docs.

-

It is recommended you include your app styles in a file named app.css.

-
-
-

Scripts

-
-

App Class

-

While it isn't required, it's expected all F2 apps will ship with javascript. This code should be included in an appclass.js file as shown in Setting Up Your Project. The F2.Apps property is a namespace for app developers to place the javascript class that is used to initialize their app. The javascript classes should be namepaced with the F2.App.AppID. It is recommended that the code be placed in a closure to help keep the global namespace clean.

-

For more information on F2.Apps, browse over to the F2.js SDK docs.

-

To make it even easier to build F2 apps and for faster app loading by the container, the F2.js SDK provides automatic JavaScript method execution at appropriate times during F2.registerApps() (and the internal _loadApps() method). If the class has an init() function, it will be called automatically during execution of F2's registerApps() method.

-

We recommend—and have samples below for—two different patterns for writing your appclass.js code: prototypal inheritence or the module pattern.

-
-
-

Arguments

-

When F2's registerApps() method is called by the container, F2 passes three arguments to your App Class: appConfig, appContent and root. The SDK documentation details the contents of each arg and these should be familiar because appConfig contains your apps' meta, appContent contains your html, data and status properties, and root is the outermost DOM element in which your app exists on the container. The root argument provides your App Class code your apps' parent element for faster DOM traversal.

-

Example:

-
//appclass.js snippet
-...
-    var App_Class = function(appConfig, appContent, root) {
-...
-
-
-

Prototypal Inheritance Pattern

-

We won't even begin to talk about or describe this fantastic design pattern simply because Douglas Crockford has already written all about it.

-

An example of an App Class using prototypal inheritance inside a closure is below. Note the inclusion of the App_Class.prototype.init() function—which will be called automatically during app load—and the trailing parentheses, (), which are responsible for automatic function execution. Thanks to the closure, the App_Class is returned and assigned to F2.Apps["com_companyname_appname"].

-
F2.Apps["com_companyname_appname"] = (function() {
-    var App_Class = function(appConfig, appContent, root) {
-        // constructor
-    }
-
-    App_Class.prototype.init = function() {
-        // perform init actions
-    }
-
-    return App_Class;
-})();
-
-
-

Module Pattern

-

As an alternative to the prototypal inheritance pattern above, appclass.js code could be written following the module pattern shown in the example below. Note the inclusion of an init() function—which will be called automatically during app load—and the exclusion of the closure and trailing parentheses present in the example using prototypal inheritance above.

-
F2.Apps["com_companyname_appname"] = function(appConfig, appContent, root) {
-   return {
-       init:function() {
-           // perform init actions
-       }
-   };
-};
-
-
-

Patterns, Eh

-

Of course, you don't have to use either one of these patterns in your appclass.js file. What you do have to use is a function. That is to say the value assigned to F2.Apps["com_companyname_appname"] by your App Class code must be a function. Within F2's registerApps() method, the new operator is used which produces an object (check out the code).

-
-
-Important! -
-

-In the absence of a function in your appclass.js, F2 will be unable to load your app on a container. -

-
- -

If you don't want to think about any of this and would rather just start coding, download the F2 app starter zip.

-
-
-
-
-
-

Namespacing

-

F2 is a web integration framework which means apps are inherently insecure—at least those non-secure apps. Following this spec, App Developers must avoid CSS collisions and JavaScript namespace issues to provide users with the best possible experience.

-

Note Continue reading for more specifics about secure apps.

-
-

Namespacing CSS

-

As discussed in Developing F2 Apps: F2 AppID, to develop an F2 app, you need a unique identifier called an AppID. This AppID will be unique to your app across the entire open financial framework ecosystem. The format of the AppID looks like this: com_companyName_appName, where the companyName "namespace" is your company name and appName is the name of your app.

-

When Container Developers register apps, F2.js draws each app as defined by the ContainerConfig. Before the app is added to the container DOM, F2 automatically wraps an outer HTML element—with the AppID used as a class—around the rendered app.

-

This example shows app HTML after it has been drawn on the container. Note the com_companyName_appName classname.

-
<div class="f2-app-container com_companyName_appName">
-    ...
-</div>
-

To avoid styling conflicts or other display issues related to app-provided style sheets, App Developers must namespace their CSS selectors. Fortunately, this is quite easy.

-

Every selector in app-provided style sheets must look like this:

-
.com_companyName_appName p {
-    padding:5px;
-}
-
-.com_companyName_appName .alert {
-    color:red;
-}
-

Note .com_companyName_appName is prefixed on both p and .alert selectors.

-

While the CSS cascade will assign more points to IDs and prefixing F2 AppIDs on CSS selectors isn't required, it is recommended.

-
.com_companyName_appName #notice {
-    background-color:yellow;
-}
-
-
-

Keeping JavaScript Clean

-

Adhering to one of the OpenAjax Alliance goals, F2 also promotes the concept of an uncluttered global javascript namespace. For Container and App Developers alike, this means following this spec closely and ensuring javascript code is contained inside closures or is extended as a new namespace on F2.

-

To ensure javascript bundled with F2 apps executes in a javascript closure, follow the guidelines for the appclass.js file and one of the two patterns described (prototypal inheritance or module).

-

The F2.js SDK was designed with extensibility in mind and therefore custom logic can be added on the F2 namespace.

-

Example:

-
F2.extend('YourPluginName', (function(){
-    return {
-        doSomething: function(){
-            F2.log("Something has been done.");
-        }
-    };
-})());
-

For more information, read Extending F2.

-
-
-
-
-

Context

-
-

What is Context?

-

Apps are capable of sharing "context" with the container and other nearby apps. All apps have context which means the app "knows" who is using it and the content it contains. It is aware of an individual's data entitlements and user information that the container is requested to share (name, email, company, etc).

-

This means if a user wants to create a ticker-focused container so they can keep a close eye on shares of Proctor & Gamble, the container can send "symbol context" to any listening apps that are smart enough to refresh when ticker symbol PG is entered in the container's search box.

-

While apps can have context themselves, the responsibility for managing context switching or context passing falls on the container. The container assumes the role of a traffic cop—managing which data goes where. By using JavaScript events, the container can listen for events sent by apps and likewise apps can listen for events sent by the container. To provide a layer of security, this means apps cannot communicate directly with other apps on their own; apps must communicate via an F2 container to other apps since the container controls the F2.Events API.

-

Read more in the Framework.

-

Let's look at some code.

-
-
-

Container-to-App Context

-

In this example, the container broadcasts, or emits, a javascript event defined in F2.Events.Constants. The F2.Events.emit() method accepts two arguments: the event name and an optional data object.

-
F2.Events.emit(
-    F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, 
-    { 
-        symbol: "AAPL", 
-        name: "Apple, Inc." 
-    }
-);
-

To listen to the F2.Constants.Events.CONTAINER_SYMBOL_CHANGE event inside your F2 app, you can use this code to trigger an alert dialog with the symbol:

-
F2.Events.on(
-    F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, 
-    function(data){
-        F2.log("The symbol was changed to " + data.symbol);
-    }
-);
-

The F2.Events.on() method accepts the event name and listener function as arguments. Read the SDK for more information.

-

Note For a full list of support event types, browse to the SDK for F2.Constants.Events.

-
-
-

Container-to-App Context (Server)

-

Often times containers will want to send context to apps during app registration. This is possible through the AppConfig.context property. This property can contain any javascript object—a string, a number, an array or an object.

-
//define app config
-var _appConfigs = [
-    {
-        appId: "com_acmecorp_news",
-        description: "Acme Corp News",
-        manifestUrl: "http://www.acme.com/apps/news-manifest.js",
-        name: "Acme News App",
-        context: {
-            sessionId: myApp.sessionId,
-            someArray: [value1,value2]
-        }
-    }
-];
-

When F2.registerApps() is called, the appConfig is serialized and posted to the app's manifest URL. The serialized object converts to stringified JSON:

-
{"appId":"com_acmecorp_news","description":"Acme Corp News","manifestUrl":"http://www.acme.com/apps/news-manifest.js","name":"Acme News App","context":{"sessionId":"12345", "someArray":["value1","value2"]}}
-

The appConfig object is sent to the server using the params querystring name as shown in the example below. This is the complete app manifest request sent by F2.registerApps() with the appConfig URL-encoded, of course:

-
http://www.acme.com/apps/news-manifest.js?params=%7B%22appId%22%3A%22com_acmecorp_news%22%2C%22description%22%3A%22Acme%20Corp%20News%22%2C%22manifestUrl%22%3A%22http%3A%2F%2Fwww.acme.com%2Fapps%2Fnews-manifest.js%22%2C%22name%22%3A%22Acme%20News%20App%22%2C%22context%22%3A%7B%22sessionId%22%3A%2212345%22%2C%20%22someArray%22%3A%5B%22value1%22%2C%22value2%22%5D%7D%7D
-

This demonstrates complete flexibility of passing arbitrary context values from the container to any F2 app.

-

Important To receive context from a container during app initialization, F2 App Developers are required to build object deserialization for the params value into their app code.

-
-
-

App-to-Container Context

-

In this example, your app emits an event indicating a user is looking at a different stock ticker within your app. Using F2.Events.emit() in your code, your app broadcasts the new symbol. As with container-to-app context passing, the F2.Events.emit() method accepts two arguments: the event name and an optional data object.

-
F2.Events.emit(
-    F2.Constants.Events.APP_SYMBOL_CHANGE, 
-    { 
-        symbol: "MSFT", 
-        name: "Microsoft, Inc." 
-    }
-);
-

The container would need to listen to your apps' broadcasted F2.Constants.Events.APP_SYMBOL_CHANGE event using code like this:

-
F2.Events.on(
-    F2.Constants.Events.APP_SYMBOL_CHANGE, 
-    function(data){
-        F2.log("The symbol was changed to " + data.symbol);
-    }
-);
-

Note For a full list of support event types, browse to the SDK for F2.Constants.Events.

-
-
-

App-to-App Context

-

Apps can also pass context between apps. If there are two or more apps on a container with similar context and the ability to receive messages (yes, through event listeners, context receiving is opt-in), apps can communicate with each other. To communicate with another app, each app will have to know the event name along with the type of data being passed. Let's take a look.

-

Within "App 1", context is sent using F2.Events.emit():

-
F2.Events.emit(
-    "buy_stock", //custom event name
-    { 
-        symbol: "GOOG", 
-        name: "Google Inc",
-        price: 682.68,
-        isAvailableToPurchase: true,
-        orderType: "Market Order"
-    }
-);
-

Within "App 2", context is received using F2.Events.on():

-
F2.Events.on(
-    "buy_stock", 
-    function(data){
-        if (data.isAvailableToPurchase){
-            F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
-        } else {
-            F2.log("This stock is not available for purchase.")
-        }
-    }
-);
-
-
-

More Complex Context

-

The examples above demonstrate simple Context objects. In the event more complex data and/or data types are needed, F2 Context can support any JavaScript object—a string, a number, a function, an array or an object.

-

This is an example Context object demonstrating arbitrary JavaScript objects:

-
F2.Events.emit(
-    "example_event", //custom event name
-    { 
-        //number
-        price: 100,
-        //string
-        name: 'John Smith',
-        //function
-        callback: function(){
-            F2.log('Callback!');
-        },
-        //array
-        watchlist: ['AAPL','MSFT','GE'],
-        //object
-        userInfo: {
-            name: 'John Smith',
-            title: 'Managing Director',
-            groups: ['Alpha','Beta'],
-            sessionId: 1234567890
-        }
-    }
-);
-

If two apps want to communicate data for populating a trade ticket and execute a callback, appclass.js code might look like this:

-
F2.Events.emit(
-    "buy_stock", //custom event name
-    { 
-        symbol: "GOOG", 
-        name: "Google Inc",
-        price: 682.68,
-        isAvailableToPurchase: true,
-        orderType: "Market Order",
-        //define callback
-        callback: function(data){
-            alert('Trade ticket populated');
-        }
-    }
-);
-

The F2 app listening for the buy_stock event would fire the callback function.

-
F2.Events.on(
-    "buy_stock", 
-    function(data){
-        F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
-        //..populate the trade ticket...
-        //fire the callback
-        if (typeof data.callback === 'function'){
-            data.callback();
-        }
-    }
-);
-
-
-

Types of Context

-

Context is a term used to describe the state of an F2 container and its apps. At the same time, Context is also the information passed from Container-to-App or from App-to-App or from App-to-Container. In the examples shown above, two types of context were shown: symbol and trade ticket context. It is important to realize F2.js allows client-side messaging between third parties using a collection of arbitrary name-value pairs. This provides the utmost flexibility and affords Container Developers the option to define context within their container.

-
-

Universal F2 Instrument ID

-

Said another way, while { symbol:"AAPL", name: "Apple, Inc" } can be used to communicate symbol context, developers could also use { symbol: "123456789" } to identify Apple, Inc. The latter is more likely given not all apps would programmatically understand AAPL but—given symbol lookup services—would understand 123456789 as the universal F2 identifier for Apple, Inc. It is clear Container and App Developers alike would prefer to communicate with a guaranteed-to-never-change universal ID for all instrument types across all asset classes.

-

F2 will be providing lookup web services in future releases that provide universal F2 identifiers for container and app providers. These lookup services will not just be limited to symbols. Further details will be forthcoming as the F2 specification evolves.

-
-
-
-
-
-

Secure Apps

-

F2 fully supports secure apps. A secure app is one that exists inside an iframe on a container and is hosted on a different domain. The F2.js SDK provides developers with seamless handling of Context, UI and the other F2 APIs whether or not an app is secure. This means app developers do not have to code apps any differently if an app is secure.

-

An app is defined as "secure" in the AppConfig. Creating the AppConfig is something that is done when apps are registered on the Developer Center.

-

Noting the isSecure property, the AppConfig looks like this:

-
{
-    "appId": "com_f2_demo",
-    "description": "A demo F2 app.",
-    "height":250,
-    "minGridSize": 4,
-    "manifestUrl": "manifest.js",
-    "name": "F2 App",
-    "isSecure": true //secure boolean
-}
-

To see examples of secure apps, fork F2 on GitHub and point your browser at:

-

http://localhost/F2/examples/container/

-

The example container runs sample apps—defined in sampleApps.js—and that's where you'll find the isSecure flag defined in some of the AppConfig objects.

-
-
-
-

Container Integration

-

Good news! The container is responsible for loading its apps, and as long as you've followed F2's standard for App Manifests and have a working—and tested—app, you're pretty much done.

-

If you're curious about how containers load apps, browse to the F2.js SDK registerApps() method or read Container Development.

-
-

Testing Your App

-

When you cloned the F2 GitHub repo you also got an example F2 container for your app development and testing. Open the project repository and navigate to ~/F2/examples/container to find them or to jump-start your testing, point your browser at:

-

http://localhost/F2/examples/container/

-

If you open ~/F2/examples/container/js/sampleApps.js in your text editor, you'll find a list of sample F2 apps broken down by programming language. Simply modify this file to your liking and add your app anywhere in the appropriate array (JavaScript, PHP or C#). The configuration is comprised of F2.AppConfig properties, and the following are the minimum required properties.

-
{
-    appId: "com_companyName_appName",
-    manifestUrl: "http://www.domain.com/manifest.js",
-    name: "App name"
-}
-

For full details on these F2.AppConfig properties and all the others, browse the F2.js SDK documentation.

-
-
-
-
-

F2 UI

-

There are some utility methods provided within F2.js in the UI namespace. These helpers are for controlling layout, showing (or hiding) loading spinners, modals, managing views within your app, and more.

-
-

Basics

-

While there are numerous utility methods in F2.UI, we will focus on a couple important ones here such as updateHeight() and showMask(). The F2.UI methods are passed as an instance to each F2 apps' App Class on the appConfig argument. The instance of F2.UI gets added to the appConfig object at runtime, and is available in appclass.js as appConfig.ui.

-

Example:

-
//appclass.js snippet
-var App_Class = function (appConfig, appContent, root) {
-    this.appConfig = appConfig;
-    this.appContent = appContent;
-    this.ui = appConfig.ui; //F2.UI instance
-    this.$root = $(root);
-}
-
-

Adding or Removing DOM Elements in Your App

-

As the layout inside your app changes, your app should update or refresh its height on the container. This is particularly important for those secure apps inside iframes. To handle this, F2.js provides a updateHeight() method you should call anytime a DOM element is added or removed from within an app.

-

Assuming the example above is used, the this.ui property holds the instance of appConfig.ui.

-
//appclass.js snippet
-...
-    //user deletes row
-    $(".row").remove();
-
-    //call updateHeight method
-    this.ui.updateHeight();
-...
-
-
-

Showing or Hiding Loading Spinners

-

Apps can show loading spinners—or "masks"—when they are being loaded by a container or afterwards when making data requests. Container Developers configure the UI.Mask as discussed in the SDK F2.ContainerConfig.UI.Mask docs, therefore it is simple for app developers to call showMask().

-

To show a loading spinner when making an ajax request within an app:

-
//appclass.js snippet
-...
-    //show loading
-    this.ui.showMask(this.root,true);
-
-    //app makes data request
-    $.ajax({
-        url: "../data.json"
-    }).done(function(jqxhr){
-        F2.log(jqxhr);
-        //hide loading
-        this.ui.hideMask(this.root);
-    });
-...
-

The showMask() method takes two arguments: a DOM element where to show the mask and a boolean indicating whether or not to show a spinning graphic.

-

If you do not want to show a spinning graphic, simply pass false to the showMask() method. A mask without a spinner is useful in the case when you want to "lock" the view from user interaction.

-
//appclass.js snippet
-...
-    //show mask, no spinner
-    this.ui.showMask(this.root,false);
-...
-

For full details, read about F2.UI in the SDK.

-
-
-

Changing the App Title

-

To update the title of an app in the app's chrome (as defined by the container in F2.ContainerConfig.appRender), very simply pass a string to the setTitle() method.

-
//appclass.js snippet
-...
-    this.ui.setTitle("Chart for MSFT");
-...
-
-
-
-

F2.UI.Modals

-

F2.js provides two methods in F2.UI for modal dialogs. F2 uses and recommends Twitter Bootstrap for many reasons, and taking advantage of Bootstrap's modals was an easy choice.

-

For full details on F2.UI.Modals and the two types of modals (alert and confirm), read the SDK docs.

-

Usage is simple:

-
//appclass.js snippet
-...
-    this.ui.Modals.alert("A message to display in a modal.");
-...
-

You can optionally provide a callback to be fired when the user closes the modal.

-
//appclass.js snippet
-...
-    this.ui.Modals.alert("A message to display in a modal.", function(){
-        F2.log("Modal closed!");
-    });
-...
-

Additionally, there is a confirm modal.

-
//appclass.js snippet
-...
-    this.ui.Modals.confirm(
-        "A message to display in a confirmation modal.", 
-        function(){
-            F2.log("OK clicked");
-        },
-        function(){
-            F2.log("Cancel clicked");
-        }
-    );
-...
-
-
-

F2.UI.Views

-

Adding and managing views within an F2 app is considered an advanced topic. If your app only needs a single view, you don't have to worry about reading this part of the F2 spec.

-

F2 apps can have one or more views. Every app will have at least one "home" view, while others will include views for settings, help or about. Inside the F2.js SDK, we've included support for views and the list can be extended by the container provider.

-

Note If the container doesn't support all the views you need inside your app, you will need to coordinate those additions with the container provider.

-
-

Setting Up Views

-

Once you've determined the views you'd like to include in your app, the view should be specified by applying the F2.Constants.Css.APPVIEW classname to the containing DOM Element. A data- attribute should be added to the element as well which defines what view type is represented. Twitter Bootstrap's hide class should be applied to views that are hidden on startup.

-

To setup a single view in your app, use this HTML on your app's outermost element noting the use of the f2-app-view classname and the data-f2-view attribute.

-
<div class='f2-app-view' data-f2-view='home'>
-    ...
-</div>
-

To setup multiple views in your app, write HTML like this noting the use the f2-app-view and hide classnames as well as the data-f2-view attributes.

-
<div class='f2-app-view' data-f2-view='home'>
-    ...
-</div>
-<div class='f2-app-view hide' data-f2-view='about'>
-    ...
-</div>
-

For details on F2.Constants.Css.APPVIEW, browse to the SDK docs.

-
-
-

Controlling View State

-

The F2.UI namespace provides an API for developers to manage F2 app View state.

-

To programmatically change a View in javascript:

-
appConfig.ui.Views.change(F2.Constants.Views.HOME);
-

Note When appConfig.ui.Views.change() is called, the hide classname is automatically added or removed by F2.js depending on the visibility of the view. Read more in the SDK docs.

-

In F2 app HTML, you can use a combination of CSS classnames and data- attributes to provide UI elements making it easy for users to navigate between Views.

-

For example, an app has two views: "home" and "about". On the "home" View, a button allows the user to navigate to the "about" view. In the presence of the classname f2-app-view-trigger and the data-f2-view data attribute, F2.js automatically adds a javascript event to the button.

-
<div class="f2-app-view" data-f2-view="home">
-    <!--use 'data-f2-view' to switch to the "about" View-->
-    <button class="btn f2-app-view-trigger" data-f2-view="about">Show About View</button>
-</div>
-

To get back to the "home" View from the "about" View:

-
<div class="f2-app-view" data-f2-view="about">
-    ...
-    <button class="btn f2-app-view-trigger" data-f2-view="home">&laquo; Back Home</button>
-    ...
-</div>
-
-
-

Listening to App View Changes

-

You shouldn't be surprised to know F2.js contains event triggers for handling app View changes. To listen for View changes inside F2 app javascript code:

-
appConfig.ui.Views.change(function(view){
-    F2.log("View changed to ", view);
-});
-

For details on F2.UI.Views, browse to the SDK docs and for details on F2.Constants.Views, head over to the F2.Constants docs.

-
-
-
-
-
-

Entitlements

-

User or content entitlements are the responsibility of the App Developer. Many apps will need to be decoupled from the content that they need. This could include apps like research aggregation, news filtering, streaming market data, etc. Similarly to how companies build their own websites today with their own authentication and access (or content) entitlements, F2 apps are no different.

-

Further details around app entitlements will be forthcoming as the F2 specification evolves.

-
-
-
-

Single Sign-On

-

Single sign-on (SSO) is a shared responsibility between the Container and App Developer. In some cases, containers will want all of its apps to be authenticated seamlessly for users;that will be negotiated between Container and App Developers. For the purposes of this documentation, it is assumed Container Developers will build and host their container access authentication.

-

Once a user is authenticated on the container, how is the user then authenticated with all of the apps? Encrypted URLs.*

-

Note The Container Developer is free to utilize any app authentication method they deem fit. Container Developers and app developers will need to work together to finalize the authentication details.

-
-

Using Encrypted URLs

-

Implementing SSO using encrypted URLs is a simple and straight-forward authentication mechanism for securing cross-domain multi-provider apps. To guarantee security between the Container and App Developer, secure API contracts must be negotiated. This includes, but is not limited to, the choice of cryptographic algorithm (such as AES) and the exchange of public keys.

-

When the container provider calls F2.registerApps(), custom logic should be added to append encrypted user credentials—on a need-to-know basis—to each app requiring authentication.

-

Read more in Developing F2 Containers.

-
-
-

Considerations

-

Authentication is a critical part of any container-app relationship. There are a plethora of SSO implementations and there are many considerations for both Container and App Developers alike.

-

Further details around container and app single sign-on will be forthcoming as the F2 specification evolves.

-
-
-
-
-
-
- -
- - - -
- - - - - - - - - \ No newline at end of file diff --git a/docs/js/f2.js b/docs/js/f2.js index 78bb3ace..121000a6 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -120,7 +120,7 @@ F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAIN F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'",""].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,IAmFromAli:function(){},registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); exports.F2 = F2; diff --git a/docs/sdk/api.js b/docs/sdk/api.js index 86ca014d..dede5733 100644 --- a/docs/sdk/api.js +++ b/docs/sdk/api.js @@ -4,6 +4,7 @@ YUI.add("yuidoc-meta", function(Y) { "F2", "F2.App", "F2.AppConfig", + "F2.AppHandlers", "F2.AppManifest", "F2.AppManifest.AppContent", "F2.Constants", diff --git a/docs/sdk/assets/js/apidocs.js b/docs/sdk/assets/js/apidocs.js index c080d16a..c64bb463 100644 --- a/docs/sdk/assets/js/apidocs.js +++ b/docs/sdk/assets/js/apidocs.js @@ -247,6 +247,11 @@ pjax.updateTabState = function (src) { } else { tab = Y.one('#classdocs .api-class-tab.' + defaultTab); + // When the `defaultTab` node isn't found, `localStorage` is stale. + if (!tab && defaultTab !== 'index') { + tab = Y.one('#classdocs .api-class-tab.index'); + } + if (classTabView.get('rendered')) { Y.Widget.getByNode(tab).set('selected', 1); } else { diff --git a/docs/sdk/classes/F2.App.html b/docs/sdk/classes/F2.App.html index 7115dcbb..a9162181 100644 --- a/docs/sdk/classes/F2.App.html +++ b/docs/sdk/classes/F2.App.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.AppConfig.html b/docs/sdk/classes/F2.AppConfig.html index 4eeec7a4..610f6645 100644 --- a/docs/sdk/classes/F2.AppConfig.html +++ b/docs/sdk/classes/F2.AppConfig.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html new file mode 100644 index 00000000..7f8f089e --- /dev/null +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -0,0 +1,412 @@ + + + + + F2 - F2.AppHandlers + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    +
    + +
    +
    +

    F2.AppHandlers

    + +

    +

    Allows container developers more flexibility when it comes to handling app interaction.

    +

    + +
    +
    + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:1
    + + + +
    +
    + + + + + +
    + +
    + + + +
    +

    Methods

    + + + + + + + + + + + + + + + +
    NameDescription
    + + __f2GetToken + ( + + ) + +

    Allows F2 to get a token internally

    +
    + + + + + + + +
    + + + + +
    + +
    +

    + __f2GetToken + ( + + ) + + + + + private + + + + + + + + + +

    + +

    +

    Allows F2 to get a token internally

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:220
    + + + + + +
    +
    + + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + +
    +
    +
    + +
    + + +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/docs/sdk/classes/F2.AppManifest.AppContent.html b/docs/sdk/classes/F2.AppManifest.AppContent.html index ed5d2d90..a4de9a09 100644 --- a/docs/sdk/classes/F2.AppManifest.AppContent.html +++ b/docs/sdk/classes/F2.AppManifest.AppContent.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.AppManifest.html b/docs/sdk/classes/F2.AppManifest.html index e1d140dc..14520e23 100644 --- a/docs/sdk/classes/F2.AppManifest.html +++ b/docs/sdk/classes/F2.AppManifest.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.Constants.Css.html b/docs/sdk/classes/F2.Constants.Css.html index 14481934..70007c7b 100644 --- a/docs/sdk/classes/F2.Constants.Css.html +++ b/docs/sdk/classes/F2.Constants.Css.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.Constants.Events.html b/docs/sdk/classes/F2.Constants.Events.html index ff3ed144..bb1bd2c2 100644 --- a/docs/sdk/classes/F2.Constants.Events.html +++ b/docs/sdk/classes/F2.Constants.Events.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.Constants.Sockets.html b/docs/sdk/classes/F2.Constants.Sockets.html index af59754b..55ca82d0 100644 --- a/docs/sdk/classes/F2.Constants.Sockets.html +++ b/docs/sdk/classes/F2.Constants.Sockets.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.Constants.Views.html b/docs/sdk/classes/F2.Constants.Views.html index b7a83e3f..acc9d871 100644 --- a/docs/sdk/classes/F2.Constants.Views.html +++ b/docs/sdk/classes/F2.Constants.Views.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.Constants.html b/docs/sdk/classes/F2.Constants.html index 224b3ed8..f8a0b07d 100644 --- a/docs/sdk/classes/F2.Constants.html +++ b/docs/sdk/classes/F2.Constants.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html b/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html index 411bec73..f1b22b7f 100644 --- a/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html +++ b/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.ContainerConfig.UI.html b/docs/sdk/classes/F2.ContainerConfig.UI.html index f379890f..0a53e210 100644 --- a/docs/sdk/classes/F2.ContainerConfig.UI.html +++ b/docs/sdk/classes/F2.ContainerConfig.UI.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.ContainerConfig.html b/docs/sdk/classes/F2.ContainerConfig.html index 6db1fa3d..407c8a41 100644 --- a/docs/sdk/classes/F2.ContainerConfig.html +++ b/docs/sdk/classes/F2.ContainerConfig.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.Events.html b/docs/sdk/classes/F2.Events.html index eb666323..896e7ac1 100644 --- a/docs/sdk/classes/F2.Events.html +++ b/docs/sdk/classes/F2.Events.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.Rpc.html b/docs/sdk/classes/F2.Rpc.html index 2a60850d..00a562cb 100644 --- a/docs/sdk/classes/F2.Rpc.html +++ b/docs/sdk/classes/F2.Rpc.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.UI.Modals.html b/docs/sdk/classes/F2.UI.Modals.html index 35e37c12..28658b8b 100644 --- a/docs/sdk/classes/F2.UI.Modals.html +++ b/docs/sdk/classes/F2.UI.Modals.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.UI.Views.html b/docs/sdk/classes/F2.UI.Views.html index 8c74c6f7..77beea16 100644 --- a/docs/sdk/classes/F2.UI.Views.html +++ b/docs/sdk/classes/F2.UI.Views.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.UI.html b/docs/sdk/classes/F2.UI.html index b5b8949e..845c781b 100644 --- a/docs/sdk/classes/F2.UI.html +++ b/docs/sdk/classes/F2.UI.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/classes/F2.html b/docs/sdk/classes/F2.html index 3ef61ea0..488a90f8 100644 --- a/docs/sdk/classes/F2.html +++ b/docs/sdk/classes/F2.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/data.json b/docs/sdk/data.json index 62c8a2a3..5c39020f 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -12,6 +12,15 @@ }, "namespaces": {} }, + "sdk\\src\\app_handlers.js": { + "name": "sdk\\src\\app_handlers.js", + "modules": {}, + "classes": { + "F2.AppHandlers": 1 + }, + "fors": {}, + "namespaces": {} + }, "sdk\\src\\classes.js": { "name": "sdk\\src\\classes.js", "modules": {}, @@ -91,6 +100,7 @@ "submodules": {}, "classes": { "F2": 1, + "F2.AppHandlers": 1, "F2.App": 1, "F2.AppConfig": 1, "F2.AppManifest": 1, @@ -139,6 +149,20 @@ "line": 1, "description": "Root namespace of the F2 SDK" }, + "F2.AppHandlers": { + "name": "F2.AppHandlers", + "shortname": "F2.AppHandlers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "f2", + "namespace": "", + "file": "sdk\\src\\app_handlers.js", + "line": 1, + "description": "Allows container developers more flexibility when it comes to handling app interaction." + }, "F2.App": { "name": "F2.App", "shortname": "F2.App", @@ -585,6 +609,17 @@ "class": "F2", "module": "f2" }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 220, + "description": "Allows F2 to get a token internally", + "itemtype": "method", + "name": "__f2GetToken", + "access": "private", + "tagname": "", + "class": "F2.AppHandlers", + "module": "f2" + }, { "file": "sdk\\src\\classes.js", "line": 1, diff --git a/docs/sdk/files/sdk_src_F2.js.html b/docs/sdk/files/sdk_src_F2.js.html index 4330be7b..1f880531 100644 --- a/docs/sdk/files/sdk_src_F2.js.html +++ b/docs/sdk/files/sdk_src_F2.js.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html new file mode 100644 index 00000000..33e69e79 --- /dev/null +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -0,0 +1,570 @@ + + + + + F2 - sdk\src\app_handlers.js + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    +
    +
    + +
    +
    +

    File: sdk\src\app_handlers.js

    + +
    +
    +/**
    + * Allows container developers more flexibility when it comes to handling app interaction.
    + * @class F2.AppHandlers
    + */
    +F2.extend('AppHandlers', (function() {
    +	
    +	// the hidden token that we will check against every time someone tries to add, remove, fire handler
    +	var _ct = F2.guid();
    +	var _f2t = F2.guid();
    +	
    +	var _handlerCollection = {		
    +		beforeApp:
    +		{
    +			render: [],
    +			remove: [],
    +			reload: [],
    +			destroy: []
    +		},
    +		afterApp:
    +		{
    +			render: [],
    +			remove: [],
    +			reload: [],
    +			destroy: []
    +		},
    +		app:
    +		{
    +			render: [],
    +			remove: [],
    +			reload: [],
    +			destroy: []
    +		}			
    +	};
    +	
    +	//Returns true if it is a DOM node
    +	function _isNode(o){
    +		return (
    +			typeof Node === "object" ? o instanceof Node : 
    +			o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string"
    +		);
    +	}
    +
    +	//Returns true if it is a DOM element    
    +	function _isElement(o){
    +		return (
    +			typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2
    +			o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string"
    +		);
    +	}
    +	
    +	var _createHandler = function(arOriginalArgs, bDomNodeAppropriate)
    +	{
    +		if(!arOriginalArgs || !arOriginalArgs.length) { throw "Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again." }
    +		
    +		// will throw an exception and stop execution if the token is invalid
    +		_validateToken(arOriginalArgs[0]);
    +		
    +		var iArgCount = arOriginalArgs.length;
    +		
    +		// TODO: pop off first arg
    +		
    +		// create handler structure. Not all arguments properties will be populated/used.
    +		var handler = {
    +			func: null,
    +			namespace: null,
    +			app_id: null,
    +			domNode: null
    +		};
    +		
    +		// based on the argument count try to create a handler.
    +		switch(iArgCount)
    +		{
    +			case 1:
    +				// method signature(oDomNode)
    +				if(arOriginalArgs[0] && bDomNodeAppropriate && (_isNode(arOriginalArgs[0]) || _isElement(arOriginalArgs[0]))
    +				{
    +					handler.domNode = arOriginalArgs[0];
    +				}
    +				// method signature (function(){})
    +				else if(arOriginalArgs[0] && typeof(arOriginalArgs[0]) == "function")
    +				{
    +					handler.func = arOriginalArgs[0];
    +				}
    +				// error
    +				else
    +				{
    +					throw "Invalid or null argument passed. Argument must be of type function or a native dom node";
    +				}
    +				break;
    +			case 2:
    +				// method signature ("APP_ID" ,oDomNode)
    +				if(
    +					arOriginalArgs[0] &&
    +					arOriginalArgs[1] &&				
    +					typeof(arOriginalArgs[0]) == "string" &&
    +					bDomNodeAppropriate	&&
    +					(_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1]))
    +				{
    +					handler.app_id = arOriginalArgs[0];
    +					handler.domNode = arOriginalArgs[1];
    +				}
    +				// method signature ("APP_ID" ,function(){})
    +				else if(
    +					arOriginalArgs[0] &&
    +					arOriginalArgs[1] &&					
    +					typeof(arOriginalArgs[0]) == "string" &&
    +					typeof(arOriginalArgs[1]) == "function"
    +				)
    +				{
    +					handler.app_id = arOriginalArgs[0];
    +					handler.func = arOriginalArgs[1];
    +				}
    +				// method signature (function(){} ,"NAMESPACE")
    +				else if(
    +					arOriginalArgs[0] &&
    +					arOriginalArgs[1] &&					
    +					typeof(arOriginalArgs[0]) == "function" &&
    +					typeof(arOriginalArgs[1]) == "string"					
    +				)
    +				{
    +					handler.func = arOriginalArgs[0];
    +					handler.namespace = arOriginalArgs[1];					
    +				}
    +				// error
    +				else
    +				{
    +					throw "Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)";
    +				}			
    +				break;			
    +			case 3:
    +				// method signature ("APP_ID", oDomNode, "NAMESPACE")
    +				if(
    +					arOriginalArgs[0] &&
    +					arOriginalArgs[1] &&					
    +					typeof(arOriginalArgs[0]) == "string" &&
    +					bDomNodeAppropriate	&&
    +					(_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) &&
    +					typeof(arOriginalArgs[2]) == "string"
    +				{
    +					handler.app_id = arOriginalArgs[0];
    +					handler.domNode = arOriginalArgs[1];
    +					handler.namespace = arOriginalArgs[2];
    +				}
    +				// method signature ("APP_ID", function(){}, "NAMESPACE")
    +				else if(
    +					arOriginalArgs[0] &&
    +					arOriginalArgs[1] &&					
    +					typeof(arOriginalArgs[0]) == "string" &&
    +					typeof(arOriginalArgs[1]) == "function" &&
    +					typeof(arOriginalArgs[2]) == "string"
    +				)
    +				{
    +					handler.app_id = arOriginalArgs[0];
    +					handler.func = arOriginalArgs[1];
    +					handler.namespace = arOriginalArgs[2];
    +				}
    +				else
    +				{
    +					throw "Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace.";
    +				}
    +				break;
    +				// throw exception if there are 0 or 4+ arguments
    +			default:
    +				throw "Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."
    +		}
    +		
    +		return handler;
    +	};
    +	
    +	var _validateToken = function(sToken)
    +	{
    +		// check token against F2 and Container
    +		if(_ct != sToken && _f2t != sToken) { throw "Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."; }
    +	};
    +	
    +	var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken)
    +	{
    +		// will throw an exception and stop execution if the token is invalid
    +		_validateToken(sToken);
    +		
    +		if(!sNamespaceOrApp_ID && !arHandleCollection)
    +		{			
    +			return;
    +		}
    +		else if(!sNamespaceOrApp_ID && arHandleCollection)
    +		{
    +			arHandleCollection = [];
    +		}
    +		else if(sNamespaceOrApp_ID && arHandleCollection)
    +		{
    +			sNamespaceOrApp_ID = sNamespaceOrApp_ID.toLowerCase();		
    +		
    +			var newEvents = [];
    +			
    +			for(var i = 0, j = arHandleCollection.length; i < j; i++)
    +			{
    +				var currentHandler = arHandleCollection[i];
    +				if(currentHandler)
    +				{
    +					if(currentHandler.app_id != sNamespaceOrApp_ID) && currentHandler.namespace != sNamespaceOrApp_ID)
    +					{
    +						newEvents.push(currentHandler);
    +					}
    +				}
    +			}
    +			
    +			arHandleCollection = newEvents;
    +		}
    +	};
    +	
    +	return {
    +		getToken: function()
    +		{
    +			// delete this method for security that way only the container has access to the token 1 time.
    +			// kind of James Bond-ish, this message will self destruct immediately.
    +			delete this.getToken;
    +			// return the token, which we validate against.
    +			return _ct;
    +		},
    +		/**
    +		 * Allows F2 to get a token internally
    +		 * @method __f2GetToken
    +		 * @private
    +		 */
    +		__f2GetToken: function()
    +		{
    +			// delete this method for security that way only the F2 internally has access to the token 1 time.
    +			// kind of James Bond-ish, this message will self destruct immediately.
    +			delete this.__f2GetToken;
    +			// return the token, which we validate against.
    +			return _f2t;
    +		},
    +		__f2Trigger:
    +		{
    +			beforeApp:
    +				{
    +					render: function(sToken) { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); },
    +					remove: function(sToken) { _handlerCollection.beforeApp.remove.push(_createHandler(arguments)); },
    +					reload: function(sToken) { _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); },
    +					destroy: function(sToken) { _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); }
    +				},
    +				afterApp:
    +				{
    +					render: function(sToken) { _handlerCollection.afterApp.render.push(_createHandler(arguments)); },
    +					remove: function(sToken) { _handlerCollection.afterApp.remove.push(_createHandler(arguments)); },
    +					reload: function(sToken) { _handlerCollection.afterApp.reload.push(_createHandler(arguments)); },
    +					destroy: function(sToken) { _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); }
    +				},
    +				app:
    +				{
    +					render: function(sToken) { _handlerCollection.app.render.push(_createHandler(arguments), true); },
    +					remove: function(sToken) { _handlerCollection.app.remove.push(_createHandler(arguments)); },
    +					reload: function(sToken) { _handlerCollection.app.reload.push(_createHandler(arguments)); },
    +					destroy: function(sToken) { _handlerCollection.app.destroy.push(_createHandler(arguments)); }
    +				}
    +		},
    +		on: {
    +				beforeApp:
    +				{
    +					render: function() { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); },
    +					remove: function(){ _handlerCollection.beforeApp.remove.push(_createHandler(arguments)); },
    +					reload: function(){ _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); },
    +					destroy: function(){ _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); }
    +				},
    +				afterApp:
    +				{
    +					render: function() { _handlerCollection.afterApp.render.push(_createHandler(arguments)); },
    +					remove: function(){ _handlerCollection.afterApp.remove.push(_createHandler(arguments)); },
    +					reload: function(){ _handlerCollection.afterApp.reload.push(_createHandler(arguments)); },
    +					destroy: function(){ _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); }
    +				},
    +				app:
    +				{
    +					render: function() { _handlerCollection.app.render.push(_createHandler(arguments), true); },
    +					remove: function(){ _handlerCollection.app.remove.push(_createHandler(arguments)); },
    +					reload: function(){ _handlerCollection.app.reload.push(_createHandler(arguments)); },
    +					destroy: function(){ _handlerCollection.app.destroy.push(_createHandler(arguments)); }
    +				}
    +		},
    +		off: {
    +				beforeApp:
    +				{
    +					render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); },
    +					remove: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.remove, sNamespaceOrApp_ID, sToken); },
    +					reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); },
    +					destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }
    +				},
    +				afterApp:
    +				{
    +					render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); },
    +					remove: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.remove, sNamespaceOrApp_ID, sToken); },
    +					reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); },
    +					destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); }
    +				},
    +				app:
    +				{
    +					render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); },
    +					remove: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.remove, sNamespaceOrApp_ID, sToken); },
    +					reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); },
    +					destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }
    +				}
    +		}
    +	};
    +})());
    +    
    +
    + +
    +
    + +
    + + +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/docs/sdk/files/sdk_src_classes.js.html b/docs/sdk/files/sdk_src_classes.js.html index 5b3d3550..906efe24 100644 --- a/docs/sdk/files/sdk_src_classes.js.html +++ b/docs/sdk/files/sdk_src_classes.js.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/files/sdk_src_constants.js.html b/docs/sdk/files/sdk_src_constants.js.html index 3c886827..33ccdb31 100644 --- a/docs/sdk/files/sdk_src_constants.js.html +++ b/docs/sdk/files/sdk_src_constants.js.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index 31b824e4..f71676b9 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/files/sdk_src_events.js.html b/docs/sdk/files/sdk_src_events.js.html index db53ed35..8203eda5 100644 --- a/docs/sdk/files/sdk_src_events.js.html +++ b/docs/sdk/files/sdk_src_events.js.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/files/sdk_src_rpc.js.html b/docs/sdk/files/sdk_src_rpc.js.html index 6544a417..789b4623 100644 --- a/docs/sdk/files/sdk_src_rpc.js.html +++ b/docs/sdk/files/sdk_src_rpc.js.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/files/sdk_src_ui.js.html b/docs/sdk/files/sdk_src_ui.js.html index b822508a..7514b498 100644 --- a/docs/sdk/files/sdk_src_ui.js.html +++ b/docs/sdk/files/sdk_src_ui.js.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 00bb3318..3018d1a3 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -243,7 +247,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/docs/sdk/modules/f2.html b/docs/sdk/modules/f2.html index 8fdc63b7..1bd0d462 100644 --- a/docs/sdk/modules/f2.html +++ b/docs/sdk/modules/f2.html @@ -110,6 +110,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -160,6 +162,8 @@
  • F2.AppConfig
  • +
  • F2.AppHandlers
  • +
  • F2.AppManifest
  • F2.AppManifest.AppContent
  • @@ -261,6 +265,12 @@

    f2 Module

    +
  • + + F2.AppHandlers + +
  • +
  • F2.AppManifest diff --git a/docs/src/app-development.md b/docs/src/app-development.md index 6fec8db4..bd56a336 100644 --- a/docs/src/app-development.md +++ b/docs/src/app-development.md @@ -1,6 +1,6 @@ % App Development -

    You've come to the right place if you want to start building F2 apps. Before continuing, make sure you've [cloned the F2 repository on GitHub](https://github.com/OpenF2/F2#quick-start) or [downloaded the latest framework build](index.html#get-started) (v{{sdk.version}}). Secondly, [read about the F2 Framework](index.html#framework). There are a few important concepts to help you better understand apps, containers and context.

    +

    You've come to the right place if you want to start building F2 apps. Before continuing, make sure you've [cloned the F2 repository on GitHub](https://github.com/OpenF2/F2#quick-start) or [downloaded the latest framework build](index.html#get-started) (v1.1.1). Secondly, [read about the F2 Framework](index.html#framework). There are a few important concepts to help you better understand apps, containers and context.

    F2 apps are synonymous with modules, widgets and portlets. Think charts, portfolios, trade tickets, and screeners. F2 apps only need to be programmed once, no matter where they will be used. To start, F2 Apps are either: diff --git a/docs/src/container-development.md b/docs/src/container-development.md index 4e1be6b1..ffdff9d2 100644 --- a/docs/src/container-development.md +++ b/docs/src/container-development.md @@ -1,6 +1,6 @@ % Container Development -

    You've come to the right place if you want to start building F2 containers. Before continuing, make sure you've [cloned the F2 repository on GitHub](https://github.com/OpenF2/F2#quick-start) or [downloaded the latest framework build](index.html#get-started) (v{{sdk.version}}). Secondly, [read about the F2 Framework](index.html#framework). There are a few important concepts to help you better understand apps, containers and context.

    +

    You've come to the right place if you want to start building F2 containers. Before continuing, make sure you've [cloned the F2 repository on GitHub](https://github.com/OpenF2/F2#quick-start) or [downloaded the latest framework build](index.html#get-started) (v1.1.1). Secondly, [read about the F2 Framework](index.html#framework). There are a few important concepts to help you better understand apps, containers and context.

    * * * * diff --git a/docs/src/f2js-sdk.md b/docs/src/f2js-sdk.md index 653552de..9bff36f3 100644 --- a/docs/src/f2js-sdk.md +++ b/docs/src/f2js-sdk.md @@ -20,9 +20,9 @@ Anyone is free to download F2.js from the [F2 project repository on GitHub](http ``` -The latest version of F2.js is **{{sdk.version}}**. +The latest version of F2.js is **1.1.1**. -

    Download F2.js {{sdk.version}} View on GitHub

    +

    Download F2.js 1.1.1 View on GitHub

    * * * * diff --git a/docs/src/index.md b/docs/src/index.md index 48fb7bb5..1207f3bc 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -77,9 +77,9 @@ To achieve steady growth and stable release cycles, F2 will be maintained under ### Track -F2 v1.0 was released on October 15, 2012. The latest version of the F2 specification is {{docs.version}} released on {{docs.lastUpdateDateFormatted}}. To provide transparency into the future of F2, a roadmap wiki will be available on GitHub. A [changelog](https://github.com/OpenF2/F2/wiki/Docs-Changelog) that tracks version-to-version changes, upgrades and deprecated features will offer a historical look at F2's evolution. +F2 v1.0 was released on October 15, 2012. The latest version of the F2 specification is 1.1.0 released on 21 March 2013. To provide transparency into the future of F2, a roadmap wiki will be available on GitHub. A [changelog](https://github.com/OpenF2/F2/wiki/Docs-Changelog) that tracks version-to-version changes, upgrades and deprecated features will offer a historical look at F2's evolution. -Note There is a [separate changelog](https://github.com/OpenF2/F2/wiki/SDK-Changelog) for the [F2.js SDK](f2js-sdk.html) which is currently version {{sdk.version}}. +Note There is a [separate changelog](https://github.com/OpenF2/F2/wiki/SDK-Changelog) for the [F2.js SDK](f2js-sdk.html) which is currently version 1.1.1. ### Collaborate diff --git a/docs/src/template/baseTemplate.html b/docs/src/template/baseTemplate.html index bd9a2885..315fba25 100644 --- a/docs/src/template/baseTemplate.html +++ b/docs/src/template/baseTemplate.html @@ -6,8 +6,8 @@ $for(author-meta)$ $endfor$ - - + + diff --git a/docs/src/template/footer.html b/docs/src/template/footer.html index 6211f7d6..308af2db 100644 --- a/docs/src/template/footer.html +++ b/docs/src/template/footer.html @@ -5,7 +5,7 @@
    @@ -14,6 +14,6 @@ - - - \ No newline at end of file + + + \ No newline at end of file diff --git a/docs/src/template/header.html b/docs/src/template/header.html index 979751c0..62fb78ae 100644 --- a/docs/src/template/header.html +++ b/docs/src/template/header.html @@ -30,8 +30,8 @@
  • Blog
  • -
  • VIEW ON GITHUBv {{sdk.version}}
  • -
  • View on GitHub (v {{sdk.version}})
  • +
  • VIEW ON GITHUBv 1.1.1
  • +
  • View on GitHub (v 1.1.1)
  • diff --git a/docs/src/template/style.html b/docs/src/template/style.html index ed48ab0a..57e4858d 100644 --- a/docs/src/template/style.html +++ b/docs/src/template/style.html @@ -3,7 +3,7 @@ - + @@ -12,7 +12,7 @@ - + + + + @@ -33,6 +36,13 @@ jasmineEnv.specFilter = function(spec) { return htmlReporter.specFilter(spec); }; + + // standard Jasmine init code + jasmine.getEnv().addReporter(new jasmine.TrivialReporter()); + + // what you need to add + var console_reporter = new jasmine.ConsoleReporter() + jasmine.getEnv().addReporter(console_reporter); var currentWindowOnload = window.onload; diff --git a/tests/js/console-runner.js b/tests/js/console-runner.js new file mode 100644 index 00000000..e1975959 --- /dev/null +++ b/tests/js/console-runner.js @@ -0,0 +1,104 @@ +/** + Jasmine Reporter that outputs test results to the browser console. + Useful for running in a headless environment such as PhantomJs, ZombieJs etc. + + Usage: + // From your html file that loads jasmine: + jasmine.getEnv().addReporter(new jasmine.ConsoleReporter()); + jasmine.getEnv().execute(); +*/ + +(function(jasmine, console) { + if (!jasmine) { + throw "jasmine library isn't loaded!"; + } + + var ANSI = {} + ANSI.color_map = { + "green" : 32, + "red" : 31 + } + + ANSI.colorize_text = function(text, color) { + var color_code = this.color_map[color]; + return "\033[" + color_code + "m" + text + "\033[0m"; + } + + var ConsoleReporter = function() { + if (!console || !console.log) { throw "console isn't present!"; } + this.status = this.statuses.stopped; + }; + + var proto = ConsoleReporter.prototype; + proto.statuses = { + stopped : "stopped", + running : "running", + fail : "fail", + success : "success" + }; + + proto.reportRunnerStarting = function(runner) { + this.status = this.statuses.running; + this.start_time = (new Date()).getTime(); + this.executed_specs = 0; + this.passed_specs = 0; + this.log("Starting..."); + }; + + proto.reportRunnerResults = function(runner) { + var failed = this.executed_specs - this.passed_specs; + var spec_str = this.executed_specs + (this.executed_specs === 1 ? " spec, " : " specs, "); + var fail_str = failed + (failed === 1 ? " failure in " : " failures in "); + var color = (failed > 0)? "red" : "green"; + var dur = (new Date()).getTime() - this.start_time; + + this.log(""); + this.log("Finished"); + this.log("-----------------"); + this.log(spec_str + fail_str + (dur/1000) + "s.", color); + + this.status = (failed > 0)? this.statuses.fail : this.statuses.success; + + /* Print something that signals that testing is over so that headless browsers + like PhantomJs know when to terminate. */ + this.log(""); + this.log("ConsoleReporter finished"); + }; + + + proto.reportSpecStarting = function(spec) { + this.executed_specs++; + }; + + proto.reportSpecResults = function(spec) { + if (spec.results().passed()) { + this.passed_specs++; + return; + } + + var resultText = spec.suite.description + " : " + spec.description; + this.log(resultText, "red"); + + var items = spec.results().getItems() + for (var i = 0; i < items.length; i++) { + var trace = items[i].trace.stack || items[i].trace; + this.log(trace, "red"); + } + }; + + proto.reportSuiteResults = function(suite) { + if (!suite.parentSuite) { return; } + var results = suite.results(); + var failed = results.totalCount - results.passedCount; + var color = (failed > 0)? "red" : "green"; + this.log(suite.getFullName() + ": " + results.passedCount + " of " + results.totalCount + " passed.", color); + }; + + proto.log = function(str, color) { + var text = (color != undefined)? ANSI.colorize_text(str, color) : str; + console.log(text) + }; + + jasmine.ConsoleReporter = ConsoleReporter; +})(jasmine, console); + From cf3a8221ab0c1b0a1780b40170fd79ff3bd9ac92 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 21 Mar 2013 16:04:06 -0600 Subject: [PATCH 007/181] Trying things.. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 683a331f..b774b05a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ node_js: - "0.10" - "0.8" before_install: npm install phantom-jasmine -g -script: phantom-jasmine tests/index.html \ No newline at end of file +script: phantom-jasmine /tests/index.html \ No newline at end of file From 022b104e678f4aa4479c15bb0ddeaba31485d9ec Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 21 Mar 2013 16:23:26 -0600 Subject: [PATCH 008/181] Adding some test files/changes to test integration. --- .travis.yml | 2 +- tests/index-console.html | 28 ++++++++++++++++++++++++++++ tests/spec/console-test.js | 9 +++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 tests/index-console.html create mode 100644 tests/spec/console-test.js diff --git a/.travis.yml b/.travis.yml index b774b05a..07a92f65 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,4 @@ node_js: - "0.10" - "0.8" before_install: npm install phantom-jasmine -g -script: phantom-jasmine /tests/index.html \ No newline at end of file +script: phantom-jasmine tests/index-console.html \ No newline at end of file diff --git a/tests/index-console.html b/tests/index-console.html new file mode 100644 index 00000000..250c8f92 --- /dev/null +++ b/tests/index-console.html @@ -0,0 +1,28 @@ + + + + Jasmine Console Spec Runner + + + + + + + + + + + + + + + + + + diff --git a/tests/spec/console-test.js b/tests/spec/console-test.js new file mode 100644 index 00000000..62bd471e --- /dev/null +++ b/tests/spec/console-test.js @@ -0,0 +1,9 @@ +describe("Console", function() { + it ("should fail", function() { + expect(false).toBeTruthy(); + }); + + it ("should succeed", function() { + expect(true).toBeTruthy(); + }); +}); \ No newline at end of file From 808b60fa5ceefdd3f7549fcf0964b131810fd167 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 21 Mar 2013 16:32:50 -0600 Subject: [PATCH 009/181] trying another version... --- .travis.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07a92f65..6f968670 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,23 @@ -language: node_js -node_js: - - "0.10" - - "0.8" -before_install: npm install phantom-jasmine -g -script: phantom-jasmine tests/index-console.html \ No newline at end of file +# This version of .travis.yml always downloads the stable version of +# phantom-qunit.js before running the tests, so you don't have to check +# phantom-xxx.js into your repository. Make sure to change qunit to jasmine or +# mocha if necessary. If you aren't sure which version of .travis.yml to use, +# pick this one. + +# We aren't actually using any particular language here, so let's use Ruby +# since that's probably the most likely Travis worker to be available +language: ruby +rvm: + - 1.9.3 +notifications: + email: false +before_script: + # Travis needs this stuff to start Phantom1.4... + # When they get Phantom1.5 this section can go away + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" +script: + # Change these to jasmine or mocha if necessary + - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-qunit.js" + # Make sure to change test/test.html to the path to your test page + - "phantomjs phantom-qunit.js tests/index.html" From c55c8d42710495ac619aec4e6c1d0eae879b5673 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 21 Mar 2013 16:35:27 -0600 Subject: [PATCH 010/181] changed quint to jasmine. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6f968670..99b82c9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,6 @@ before_script: - "sh -e /etc/init.d/xvfb start" script: # Change these to jasmine or mocha if necessary - - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-qunit.js" + - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" # Make sure to change test/test.html to the path to your test page - "phantomjs phantom-qunit.js tests/index.html" From fe0fe936e5eade29e05edc7c83fa4338711c2179 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 21 Mar 2013 16:48:52 -0600 Subject: [PATCH 011/181] changed quint to jasmine --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 99b82c9c..b85e0827 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,4 @@ script: # Change these to jasmine or mocha if necessary - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" # Make sure to change test/test.html to the path to your test page - - "phantomjs phantom-qunit.js tests/index.html" + - "phantomjs phantom-jasmine.js tests/index.html" From 1865fe5d5760f4436a83723b2902befc6b619a2a Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 21 Mar 2013 23:14:27 -0600 Subject: [PATCH 012/181] Rebuilt. Fixed js errors in app_handlers.js and doing some more testing with travis ci --- .travis.yml | 2 +- docs/js/f2.js | 287 ++++++++++++++++++++++++++++++++++++++- sdk/f2.debug.js | 287 +++++++++++++++++++++++++++++++++++++++ sdk/f2.min.js | 1 + sdk/f2.no-third-party.js | 287 +++++++++++++++++++++++++++++++++++++++ sdk/src/app_handlers.js | 73 ++++------ 6 files changed, 890 insertions(+), 47 deletions(-) diff --git a/.travis.yml b/.travis.yml index b85e0827..58a29891 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,4 @@ script: # Change these to jasmine or mocha if necessary - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" # Make sure to change test/test.html to the path to your test page - - "phantomjs phantom-jasmine.js tests/index.html" + - "phantomjs phantom-jasmine.js tests/index-console.html" diff --git a/docs/js/f2.js b/docs/js/f2.js index 121000a6..43070c7d 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -120,7 +120,292 @@ F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAIN F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'",""].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,IAmFromAli:function(){},registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +/** + * Allows container developers more flexibility when it comes to handling app interaction. + * @class F2.AppHandlers + */ +F2.extend('AppHandlers', (function() { + + // the hidden token that we will check against every time someone tries to add, remove, fire handler + var _ct = F2.guid(); + var _f2t = F2.guid(); + + var _handlerCollection = { + beforeApp: + { + render: [], + reload: [], + destroy: [] + }, + afterApp: + { + render: [], + reload: [], + destroy: [] + }, + app: + { + render: [], + reload: [], + destroy: [] + } + }; + + //Returns true if it is a DOM node + function _isNode(o){ + return ( + typeof Node === "object" ? o instanceof Node : + o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" + ); + } + + //Returns true if it is a DOM element + function _isElement(o){ + return ( + typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 + o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string" + ); + } + + var _createHandler = function(arOriginalArgs, bDomNodeAppropriate) + { + if(!arOriginalArgs || !arOriginalArgs.length) { throw "Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again." } + + // will throw an exception and stop execution if the token is invalid + _validateToken(arOriginalArgs[0]); + + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); + + var iArgCount = arOriginalArgs.length; + + // create handler structure. Not all arguments properties will be populated/used. + var handler = { + func: null, + namespace: null, + app_id: null, + domNode: null + }; + + // based on the argument count try to create a handler. + switch(iArgCount) + { + case 1: + // method signature(oDomNode) + if(arOriginalArgs[0] && bDomNodeAppropriate && (_isNode(arOriginalArgs[0]) || _isElement(arOriginalArgs[0])) + { + handler.domNode = arOriginalArgs[0]; + } + // method signature (function(){}) + else if(arOriginalArgs[0] && typeof(arOriginalArgs[0]) == "function") + { + handler.func = arOriginalArgs[0]; + } + // error + else + { + throw "Invalid or null argument passed. Argument must be of type function or a native dom node"; + } + break; + case 2: + // method signature ("APP_ID" ,oDomNode) + if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "string" && + bDomNodeAppropriate && + (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) + { + handler.app_id = arOriginalArgs[0]; + handler.domNode = arOriginalArgs[1]; + } + // method signature ("APP_ID" ,function(){}) + else if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "string" && + typeof(arOriginalArgs[1]) == "function" + ) + { + handler.app_id = arOriginalArgs[0]; + handler.func = arOriginalArgs[1]; + } + // method signature (function(){} ,"NAMESPACE") + else if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "function" && + typeof(arOriginalArgs[1]) == "string" + ) + { + handler.func = arOriginalArgs[0]; + handler.namespace = arOriginalArgs[1]; + } + // error + else + { + throw "Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)"; + } + break; + case 3: + // method signature ("APP_ID", oDomNode, "NAMESPACE") + if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "string" && + bDomNodeAppropriate && + (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) && + typeof(arOriginalArgs[2]) == "string" + { + handler.app_id = arOriginalArgs[0]; + handler.domNode = arOriginalArgs[1]; + handler.namespace = arOriginalArgs[2]; + } + // method signature ("APP_ID", function(){}, "NAMESPACE") + else if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "string" && + typeof(arOriginalArgs[1]) == "function" && + typeof(arOriginalArgs[2]) == "string" + ) + { + handler.app_id = arOriginalArgs[0]; + handler.func = arOriginalArgs[1]; + handler.namespace = arOriginalArgs[2]; + } + else + { + throw "Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace."; + } + break; + // throw exception if there are 0 or 4+ arguments + default: + throw "Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."; + } + + return handler; + }; + + var _validateToken = function(sToken) + { + // check token against F2 and Container + if(_ct != sToken && _f2t != sToken) { throw "Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."; } + }; + + var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken) + { + // will throw an exception and stop execution if the token is invalid + _validateToken(sToken); + + if(!sNamespaceOrApp_ID && !arHandleCollection) + { + return; + } + else if(!sNamespaceOrApp_ID && arHandleCollection) + { + arHandleCollection = []; + } + else if(sNamespaceOrApp_ID && arHandleCollection) + { + sNamespaceOrApp_ID = sNamespaceOrApp_ID.toLowerCase(); + + var newEvents = []; + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + var currentHandler = arHandleCollection[i]; + if(currentHandler) + { + if(currentHandler.app_id != sNamespaceOrApp_ID) && currentHandler.namespace != sNamespaceOrApp_ID) + { + newEvents.push(currentHandler); + } + } + } + + arHandleCollection = newEvents; + } + }; + + return { + /** + * Allows container developer to retrieve a special token which must be passed to + * all On and Off methods. This function will self destruct so be sure to keep the response + * inside of a closure somewhere. + * @method getToken + */ + getToken: function() + { + // delete this method for security that way only the container has access to the token 1 time. + // kind of James Bond-ish, this message will self destruct immediately. + delete this.getToken; + // return the token, which we validate against. + return _ct; + }, + /** + * Allows F2 to get a token internally + * @method __f2GetToken + * @private + */ + __f2GetToken: function() + { + // delete this method for security that way only the F2 internally has access to the token 1 time. + // kind of James Bond-ish, this message will self destruct immediately. + delete this.__f2GetToken; + // return the token, which we validate against. + return _f2t; + }, + /** + * Allows F2 to trigger events internally + * @method __f2Trigger + * @private + */ + __f2Trigger: { + }, + on: { + beforeApp: + { + render: function() { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); }, + reload: function(){ _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); }, + destroy: function(){ _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); } + }, + afterApp: + { + render: function() { _handlerCollection.afterApp.render.push(_createHandler(arguments)); }, + reload: function(){ _handlerCollection.afterApp.reload.push(_createHandler(arguments)); }, + destroy: function(){ _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); } + }, + app: + { + render: function() { _handlerCollection.app.render.push(_createHandler(arguments), true); }, + reload: function(){ _handlerCollection.app.reload.push(_createHandler(arguments)); }, + destroy: function(){ _handlerCollection.app.destroy.push(_createHandler(arguments)); } + } + }, + off: { + beforeApp: + { + render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, + reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, + destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); } + }, + afterApp: + { + render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, + reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, + destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } + }, + app: + { + render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, + reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, + destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); } + } + } + }; +})());; exports.F2 = F2; diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index e38cabdb..7dde48d2 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -3484,6 +3484,293 @@ F2.extend('', (function(){ } }; })()); +/** + * Allows container developers more flexibility when it comes to handling app interaction. + * @class F2.AppHandlers + */ +F2.extend('AppHandlers', (function() { + + // the hidden token that we will check against every time someone tries to add, remove, fire handler + var _ct = F2.guid(); + var _f2t = F2.guid(); + + var _handlerCollection = { + beforeApp: + { + render: [], + reload: [], + destroy: [] + }, + afterApp: + { + render: [], + reload: [], + destroy: [] + }, + app: + { + render: [], + reload: [], + destroy: [] + } + }; + + //Returns true if it is a DOM node + function _isNode(o){ + return ( + typeof Node === "object" ? o instanceof Node : + o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" + ); + } + + //Returns true if it is a DOM element + function _isElement(o){ + return ( + typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 + o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string" + ); + } + + var _createHandler = function(arOriginalArgs, bDomNodeAppropriate) + { + if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } + + // will throw an exception and stop execution if the token is invalid + _validateToken(arOriginalArgs[0]); + + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); + + var iArgCount = arOriginalArgs.length; + + // create handler structure. Not all arguments properties will be populated/used. + var handler = { + func: null, + namespace: null, + app_id: null, + domNode: null + }; + + // based on the argument count try to create a handler. + switch(iArgCount) + { + case 1: + // method signature(oDomNode) + if(arOriginalArgs[0] && bDomNodeAppropriate && (_isNode(arOriginalArgs[0]) || _isElement(arOriginalArgs[0]))) + { + handler.domNode = arOriginalArgs[0]; + } + // method signature (function(){}) + else if(arOriginalArgs[0] && typeof(arOriginalArgs[0]) == "function") + { + handler.func = arOriginalArgs[0]; + } + // error + else + { + throw ("Invalid or null argument passed. Argument must be of type function or a native dom node"); + } + break; + case 2: + // method signature ("APP_ID" ,oDomNode) + if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "string" && + bDomNodeAppropriate && + (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) + ) + { + handler.app_id = arOriginalArgs[0]; + handler.domNode = arOriginalArgs[1]; + } + // method signature ("APP_ID" ,function(){}) + else if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "string" && + typeof(arOriginalArgs[1]) == "function" + ) + { + handler.app_id = arOriginalArgs[0]; + handler.func = arOriginalArgs[1]; + } + // method signature (function(){} ,"NAMESPACE") + else if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "function" && + typeof(arOriginalArgs[1]) == "string" + ) + { + handler.func = arOriginalArgs[0]; + handler.namespace = arOriginalArgs[1]; + } + // error + else + { + throw ("Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)"); + } + break; + case 3: + // method signature ("APP_ID", oDomNode, "NAMESPACE") + if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "string" && + bDomNodeAppropriate && + (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) && + typeof(arOriginalArgs[2]) == "string" + ) + { + handler.app_id = arOriginalArgs[0]; + handler.domNode = arOriginalArgs[1]; + handler.namespace = arOriginalArgs[2]; + } + // method signature ("APP_ID", function(){}, "NAMESPACE") + else if( + arOriginalArgs[0] && + arOriginalArgs[1] && + typeof(arOriginalArgs[0]) == "string" && + typeof(arOriginalArgs[1]) == "function" && + typeof(arOriginalArgs[2]) == "string" + ) + { + handler.app_id = arOriginalArgs[0]; + handler.func = arOriginalArgs[1]; + handler.namespace = arOriginalArgs[2]; + } + else + { + throw ("Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace."); + } + break; + // throw exception if there are 0 or 4+ arguments + default: + throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); + } + + return handler; + }; + + var _validateToken = function(sToken) + { + // check token against F2 and Container + if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } + }; + + var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken) + { + // will throw an exception and stop execution if the token is invalid + _validateToken(sToken); + + if(!sNamespaceOrApp_ID && !arHandleCollection) + { + return; + } + else if(!sNamespaceOrApp_ID && arHandleCollection) + { + arHandleCollection = []; + } + else if(sNamespaceOrApp_ID && arHandleCollection) + { + sNamespaceOrApp_ID = sNamespaceOrApp_ID.toLowerCase(); + + var newEvents = []; + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + var currentHandler = arHandleCollection[i]; + if(currentHandler) + { + if(currentHandler.app_id != sNamespaceOrApp_ID && currentHandler.namespace != sNamespaceOrApp_ID) + { + newEvents.push(currentHandler); + } + } + } + + arHandleCollection = newEvents; + } + }; + + return { + /** + * Allows container developer to retrieve a special token which must be passed to + * all On and Off methods. This function will self destruct so be sure to keep the response + * inside of a closure somewhere. + * @method getToken + */ + getToken: function() + { + // delete this method for security that way only the container has access to the token 1 time. + // kind of James Bond-ish, this message will self destruct immediately. + delete this.getToken; + // return the token, which we validate against. + return _ct; + }, + /** + * Allows F2 to get a token internally + * @method __f2GetToken + * @private + */ + __f2GetToken: function() + { + // delete this method for security that way only the F2 internally has access to the token 1 time. + // kind of James Bond-ish, this message will self destruct immediately. + delete this.__f2GetToken; + // return the token, which we validate against. + return _f2t; + }, + /** + * Allows F2 to trigger events internally + * @method __f2Trigger + * @private + */ + __f2Trigger: { + }, + on: { + beforeApp: + { + render: function() { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); }, + reload: function(){ _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); }, + destroy: function(){ _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); } + }, + afterApp: + { + render: function() { _handlerCollection.afterApp.render.push(_createHandler(arguments)); }, + reload: function(){ _handlerCollection.afterApp.reload.push(_createHandler(arguments)); }, + destroy: function(){ _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); } + }, + app: + { + render: function() { _handlerCollection.app.render.push(_createHandler(arguments), true); }, + reload: function(){ _handlerCollection.app.reload.push(_createHandler(arguments)); }, + destroy: function(){ _handlerCollection.app.destroy.push(_createHandler(arguments)); } + } + }, + off: { + beforeApp: + { + render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, + reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, + destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); } + }, + afterApp: + { + render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, + reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, + destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } + }, + app: + { + render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, + reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, + destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); } + } + } + }; +})()); exports.F2 = F2; diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 78bb3ace..88c73abf 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -121,6 +121,7 @@ F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.se F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("AppHandlers",function(){function r(e){return typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function i(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}var e=F2.guid(),t=F2.guid(),n={beforeApp:{render:[],reload:[],destroy:[]},afterApp:{render:[],reload:[],destroy:[]},app:{render:[],reload:[],destroy:[]}},s=function(e,t){if(!e||!e.length)throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again.";o(e[0]),e.shift();var n=e.length,s={func:null,namespace:null,app_id:null,domNode:null};switch(n){case 1:if(e[0]&&t&&(r(e[0])||i(e[0])))s.domNode=e[0];else{if(!e[0]||typeof e[0]!="function")throw"Invalid or null argument passed. Argument must be of type function or a native dom node";s.func=e[0]}break;case 2:if(e[0]&&e[1]&&typeof e[0]=="string"&&t&&(r(e[1])||i(e[1])))s.app_id=e[0],s.domNode=e[1];else if(e[0]&&e[1]&&typeof e[0]=="string"&&typeof e[1]=="function")s.app_id=e[0],s.func=e[1];else{if(!e[0]||!e[1]||typeof e[0]!="function"||typeof e[1]!="string")throw"Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)";s.func=e[0],s.namespace=e[1]}break;case 3:if(e[0]&&e[1]&&typeof e[0]=="string"&&t&&(r(e[1])||i(e[1]))&&typeof e[2]=="string")s.app_id=e[0],s.domNode=e[1],s.namespace=e[2];else{if(!e[0]||!e[1]||typeof e[0]!="string"||typeof e[1]!="function"||typeof e[2]!="string")throw"Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace.";s.app_id=e[0],s.func=e[1],s.namespace=e[2]}break;default:throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."}return s},o=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},u=function(e,t,n){o(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,s=e.length;i
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); -/** - * Allows container developers more flexibility when it comes to handling app interaction. - * @class F2.AppHandlers - */ -F2.extend('AppHandlers', (function() { - - // the hidden token that we will check against every time someone tries to add, remove, fire handler - var _ct = F2.guid(); - var _f2t = F2.guid(); - - var _handlerCollection = { - beforeApp: - { - render: [], - reload: [], - destroy: [] - }, - afterApp: - { - render: [], - reload: [], - destroy: [] - }, - app: - { - render: [], - reload: [], - destroy: [] - } - }; - - //Returns true if it is a DOM node - function _isNode(o){ - return ( - typeof Node === "object" ? o instanceof Node : - o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" - ); - } - - //Returns true if it is a DOM element - function _isElement(o){ - return ( - typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 - o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string" - ); - } - - var _createHandler = function(arOriginalArgs, bDomNodeAppropriate) - { - if(!arOriginalArgs || !arOriginalArgs.length) { throw "Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again." } - - // will throw an exception and stop execution if the token is invalid - _validateToken(arOriginalArgs[0]); - - // remove the token from the arguments since we have validated it and no longer need it - arOriginalArgs.shift(); - - var iArgCount = arOriginalArgs.length; - - // create handler structure. Not all arguments properties will be populated/used. - var handler = { - func: null, - namespace: null, - app_id: null, - domNode: null - }; - - // based on the argument count try to create a handler. - switch(iArgCount) - { - case 1: - // method signature(oDomNode) - if(arOriginalArgs[0] && bDomNodeAppropriate && (_isNode(arOriginalArgs[0]) || _isElement(arOriginalArgs[0])) - { - handler.domNode = arOriginalArgs[0]; - } - // method signature (function(){}) - else if(arOriginalArgs[0] && typeof(arOriginalArgs[0]) == "function") - { - handler.func = arOriginalArgs[0]; - } - // error - else - { - throw "Invalid or null argument passed. Argument must be of type function or a native dom node"; - } - break; - case 2: - // method signature ("APP_ID" ,oDomNode) - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - } - // method signature ("APP_ID" ,function(){}) - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - } - // method signature (function(){} ,"NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "function" && - typeof(arOriginalArgs[1]) == "string" - ) - { - handler.func = arOriginalArgs[0]; - handler.namespace = arOriginalArgs[1]; - } - // error - else - { - throw "Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)"; - } - break; - case 3: - // method signature ("APP_ID", oDomNode, "NAMESPACE") - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) && - typeof(arOriginalArgs[2]) == "string" - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - // method signature ("APP_ID", function(){}, "NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" && - typeof(arOriginalArgs[2]) == "string" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - else - { - throw "Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace."; - } - break; - // throw exception if there are 0 or 4+ arguments - default: - throw "Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."; - } - - return handler; - }; - - var _validateToken = function(sToken) - { - // check token against F2 and Container - if(_ct != sToken && _f2t != sToken) { throw "Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."; } - }; - - var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken) - { - // will throw an exception and stop execution if the token is invalid - _validateToken(sToken); - - if(!sNamespaceOrApp_ID && !arHandleCollection) - { - return; - } - else if(!sNamespaceOrApp_ID && arHandleCollection) - { - arHandleCollection = []; - } - else if(sNamespaceOrApp_ID && arHandleCollection) - { - sNamespaceOrApp_ID = sNamespaceOrApp_ID.toLowerCase(); - - var newEvents = []; - - for(var i = 0, j = arHandleCollection.length; i < j; i++) - { - var currentHandler = arHandleCollection[i]; - if(currentHandler) - { - if(currentHandler.app_id != sNamespaceOrApp_ID) && currentHandler.namespace != sNamespaceOrApp_ID) - { - newEvents.push(currentHandler); - } - } - } - - arHandleCollection = newEvents; - } - }; - - return { - /** - * Allows container developer to retrieve a special token which must be passed to - * all On and Off methods. This function will self destruct so be sure to keep the response - * inside of a closure somewhere. - * @method getToken - */ - getToken: function() - { - // delete this method for security that way only the container has access to the token 1 time. - // kind of James Bond-ish, this message will self destruct immediately. - delete this.getToken; - // return the token, which we validate against. - return _ct; - }, - /** - * Allows F2 to get a token internally - * @method __f2GetToken - * @private - */ - __f2GetToken: function() - { - // delete this method for security that way only the F2 internally has access to the token 1 time. - // kind of James Bond-ish, this message will self destruct immediately. - delete this.__f2GetToken; - // return the token, which we validate against. - return _f2t; - }, - /** - * Allows F2 to trigger events internally - * @method __f2Trigger - * @private - */ - __f2Trigger: { - }, - on: { - beforeApp: - { - render: function() { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); } - }, - afterApp: - { - render: function() { _handlerCollection.afterApp.render.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.afterApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); } - }, - app: - { - render: function() { _handlerCollection.app.render.push(_createHandler(arguments), true); }, - reload: function(){ _handlerCollection.app.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.app.destroy.push(_createHandler(arguments)); } - } - }, - off: { - beforeApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - afterApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - app: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); } - } - } - }; -})());; +F2.extend("AppHandlers",function(){function r(e){return typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function i(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}var e=F2.guid(),t=F2.guid(),n={beforeApp:{render:[],reload:[],destroy:[]},afterApp:{render:[],reload:[],destroy:[]},app:{render:[],reload:[],destroy:[]}},s=function(e,t){if(!e||!e.length)throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again.";o(e[0]),e.shift();var n=e.length,s={func:null,namespace:null,app_id:null,domNode:null};switch(n){case 1:if(e[0]&&t&&(r(e[0])||i(e[0])))s.domNode=e[0];else{if(!e[0]||typeof e[0]!="function")throw"Invalid or null argument passed. Argument must be of type function or a native dom node";s.func=e[0]}break;case 2:if(e[0]&&e[1]&&typeof e[0]=="string"&&t&&(r(e[1])||i(e[1])))s.app_id=e[0],s.domNode=e[1];else if(e[0]&&e[1]&&typeof e[0]=="string"&&typeof e[1]=="function")s.app_id=e[0],s.func=e[1];else{if(!e[0]||!e[1]||typeof e[0]!="function"||typeof e[1]!="string")throw"Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)";s.func=e[0],s.namespace=e[1]}break;case 3:if(e[0]&&e[1]&&typeof e[0]=="string"&&t&&(r(e[1])||i(e[1]))&&typeof e[2]=="string")s.app_id=e[0],s.domNode=e[1],s.namespace=e[2];else{if(!e[0]||!e[1]||typeof e[0]!="string"||typeof e[1]!="function"||typeof e[2]!="string")throw"Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace.";s.app_id=e[0],s.func=e[1],s.namespace=e[2]}break;default:throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."}return s},o=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},u=function(e,t,n){o(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,s=e.length;i Date: Thu, 21 Mar 2013 23:36:47 -0600 Subject: [PATCH 016/181] Trying to figure out $.ajax failures in Travis CI. --- .travis.yml | 2 +- tests/index-console.html | 28 ---------------------------- tests/index.html | 3 ++- tests/spec/console-test.js | 5 +++++ 4 files changed, 8 insertions(+), 30 deletions(-) delete mode 100644 tests/index-console.html diff --git a/.travis.yml b/.travis.yml index 58a29891..b85e0827 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,4 @@ script: # Change these to jasmine or mocha if necessary - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" # Make sure to change test/test.html to the path to your test page - - "phantomjs phantom-jasmine.js tests/index-console.html" + - "phantomjs phantom-jasmine.js tests/index.html" diff --git a/tests/index-console.html b/tests/index-console.html deleted file mode 100644 index 250c8f92..00000000 --- a/tests/index-console.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - Jasmine Console Spec Runner - - - - - - - - - - - - - - - - - - diff --git a/tests/index.html b/tests/index.html index 4d106845..4cc579db 100644 --- a/tests/index.html +++ b/tests/index.html @@ -19,10 +19,11 @@ + - + - + From 5bbc5f087478fb82bc9536d4c3ce711fecbf043d Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 21 Mar 2013 23:49:07 -0600 Subject: [PATCH 020/181] Looks like that was it! jQuery wasn't being loaded because of the // trick. Forced it to https:// and life is good! --- tests/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/index.html b/tests/index.html index 2897a13f..4c31d7f8 100644 --- a/tests/index.html +++ b/tests/index.html @@ -18,8 +18,7 @@ - - + From 78388ab6cb99e85887ce6198b312e03c73d27180 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Fri, 22 Mar 2013 23:10:39 -0600 Subject: [PATCH 021/181] Testing addition script in Travis CI. Also made some updates to the docs. --- .travis.yml | 1 + docs/container-development.html | 786 -------------------- docs/extending-f2.html | 199 ----- docs/js/f2.js | 2 +- docs/sdk/classes/F2.AppHandlers.html | 714 +++++++++++++++++- docs/sdk/data.json | 125 +++- docs/sdk/files/sdk_src_app_handlers.js.html | 375 +++++----- docs/sdk/index.html | 6 +- sdk/f2.debug.js | 342 +++++---- sdk/f2.min.js | 2 +- sdk/f2.no-third-party.js | 342 +++++---- sdk/src/app_handlers.js | 342 +++++---- 12 files changed, 1612 insertions(+), 1624 deletions(-) diff --git a/.travis.yml b/.travis.yml index b85e0827..bbcdcf8a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,3 +21,4 @@ script: - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" # Make sure to change test/test.html to the path to your test page - "phantomjs phantom-jasmine.js tests/index.html" + - "phantomjs phantom-jasmine.js tests/index-amd.html" diff --git a/docs/container-development.html b/docs/container-development.html index 7b178214..e69de29b 100644 --- a/docs/container-development.html +++ b/docs/container-development.html @@ -1,786 +0,0 @@ - - - - F2 - Container Development - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    - -
    -
    -
    -

    Container Development

    -
    -

    -You've come to the right place if you want to start building F2 containers. Before continuing, make sure you've cloned the F2 repository on GitHub or downloaded the latest framework build (v1.1.1). Secondly, read about the F2 Framework. There are a few important concepts to help you better understand apps, containers and context. -

    - -
    -
    -

    Get Started

    -

    To help you get started building an F2 container, browse through the resources below. To jump start your F2 container and app development, download the F2 template (which now includes a basic container) or follow the instructions below.

    -

    -Download Basic F2 Container Template -

    - -
    -

    Basic Container

    -

    To begin, you do not need to build F2 as described in the readme on GitHub. Simply download Bootstrap and save a local copy of F2.js. Also ensure you're properly configured.

    -

    -Download F2.js Download Bootstrap -

    - -

    Create your basic container HTML template:

    -
    <!DOCTYPE html>
    -<html>
    -    <head>
    -        <title>F2 Container</title>
    -        <link rel="stylesheet" href="/path/to/your/bootstrap.css">
    -    </head>
    -    <body>
    -        <div class="container">
    -            <div class="hero-unit">
    -                <h1>Hello F2</h1>
    -            </div>
    -            <div class="row"><!--apps go here--></div>
    -        </div>
    -        <!--include jQuery & Bootstrap-->
    -        <script src="http://code.jquery.com/jquery-latest.js"></script>
    -        <script src="/path/to/your/bootstrap.js"></script>
    -        <!--include F2.js-->
    -        <script src="/path/to/your/F2.js"></script>
    -        <!--init & register-->
    -        <script>
    -            (function(){
    -                //define AppConfigs
    -                var _appConfigs = [{
    -                    appId: "com_your_app_id",
    -                    description: "F2 app description",
    -                    name: "F2 App",
    -                    manifestUrl: "/path/to/your/manifest.js" //note the path to your manifest! 
    -                }];
    -                //Setup ContainerConfig
    -                F2.init({
    -                    beforeAppRender: function(app){
    -                        var appRoot = '<section class="well span12"></section>';
    -                        return $(appRoot).appendTo('div.row');
    -                    },
    -                    afterAppRender: function (app, html) {
    -                        //app.root is `appRoot` from beforeAppRender()
    -                        return $(app.root).append(html);
    -                    }
    -                }); 
    -                F2.registerApps(_appConfigs); //pass _appConfigs to initialize apps
    -            })();
    -        </script>
    -    </body>
    -</html>
    -

    In developing a more advanced container, the HTML document's body element would contain additional markup and allow for specific positioning or placement of apps. Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the F2 design guidelines.

    -
    -
    -

    Basic App

    -

    Create your basic F2 app manifest and save it as /path/to/your/manifest.js using this code below. Note the path to this file should be specified in the manifestUrl property within the _appConfigs array in your basic container (shown above).

    -
    F2_jsonpCallback_com_your_app_id({
    -    "scripts": [],   
    -    "styles": [],   
    -    "apps": [{
    -        "data": {},
    -        "html": "<div><p>Hello, world. I'm an F2 app.</p></div>"
    -    }]
    -})
    -

    Note You can download the F2 container/app template instead of creating the basic app by hand.

    -
    -
    -

    Testing the Basics

    -

    Now with a basic container and a basic app, you can load your F2 container and expect to see:

    -
    -
    -
    -

    In getting to this point, you've only scratched the surface of F2 containers and apps. Continue reading and understanding the F2 spec to build exactly the financial solutions that our customers want.

    -
    -
    -

    Sample Apps and Container

    -

    Good news! In the project repo on GitHub, you will find a basic container along with a number of sample apps which demonstrate functionality far beyond the basic app above. Once you clone or download the project repository, open the sample container by pointing your browser at:

    -

    http://localhost/F2/examples/container/

    -
    -
    -

    Configuration

    -

    It is assumed you will be developing an F2 container locally and have a localhost setup. The URLs mentioned in this specification also assume you have configured your F2 container to run at http://localhost/F2/. The examples provided as part of the project repository demonstrate apps written in different languages (PHP, JavaScript, C#). While it is not a requirement you have a web server configured on your computer, it will certainly allow you to more deeply explore the sample apps.

    -

    To better understand F2 and the role of containers, you need to understand the role of apps. If you haven’t already, read more about apps in the Framework.

    -

    To get started working with or developing apps, browse to the documentation for developing apps.

    -

    Ready to start coding?

    -

    -Developing F2 Containers F2.js SDK Reference -

    - -
    -
    -
    -
    -

    Container Design

    -

    Design considerations are an important first step when creating a new container. Content can range from news to research to multimedia, and content should be presented using Progressive Enhancement, Mobile First and Responsive Design methodologies. That is to say multimedia content, for example, should be shown plugin-free (using HTML5 video or audio elements) for capable browsers and fallback to Flash-based players for browsers that do not yet support HTML5 related technologies. (VideoJS is good example of open-source JavaScript and CSS "that makes it easier to work with and build on HTML5 video, today.")

    -

    If App Developers embed URLs back to their own websites or to third party sites, URLs must be opened in a new window as to not interrupt the experience of someone using the container. If authentication is required on an App Developer's site, this can be accomplished with pass-through authentication using encrypted URLs as discussed in Single Sign On.

    -
    -

    Choices

    -

    In order to ensure that apps built using F2 are successful, they must be accessible. As such, F2 made choices for which open-source libraries and frameworks would be leveraged to reduce the level of effort across F2 adopters.

    -

    Read more about those choices in the Framework.

    -

    Ultimately, the responsibility of app design falls on either the Container or App Developer. In many cases, Container Developers will provide App Developers will visual designs, style guides or other assets required to ensure apps have the form and function for a given container. Container Developers may also provide CSS for App Developers to adhere to—which should be easy since F2 enforces a consistent HTML structure across all containers and apps.

    -
    -
    -
    -
    -

    Developing F2 Containers

    -

    A container is a browser-based desktop-like application which brings F2 apps together onto a seamless user interface. It also can provide horsepower to its apps in the form of request-response web services or streaming data feeds.

    -
    -

    Including the F2 SDK

    -

    For a webpage to be considered an F2 container, it must first include the F2.js JavaScript SDK. This is as simple as downloading the F2 project from GitHub and adding a script tag to the page.

    -
    <script src="/path/to/your/container/f2.js"></script>
    -

    You will find a basic container in the project repo on GitHub along with a number of sample apps.

    -

    Once the script tag has been added, it is up to the Container Developer to configure and customize the container. The first step is getting a ContainerID.

    -
    -
    -

    F2 ContainerID

    -

    To develop a production F2 container, you need a unique identifier called a ContainerID. This ContainerID will be unique to your container across the entire open financial framework ecosystem. The format of the ContainerID looks like this: com_container_companyName_containerName, where the companyName "namespace" is your company name and containerName is the name of your container.

    -

    As an example, your ContainerID could look like this:

    -

    com_container_acmecorp_watchlist

    -

    If you built more than one container while working at Acme Corporation, you could create more ContainerIDs. All of these are valid:

    -
      -
    • com_container_acmecorp_activetrader
    • -
    • com_container_acmecorp_retail
    • -
    • com_container_acmecorp_mobilestreamer
    • -
    -

    To guarantee uniqueness, we will provide a ContainerID generation service that allows customization of your ContainerID in the Developer Center.

    -
    -
    -

    Setting Up Your Project

    -

    Once you have your ContainerID, start by setting up your container project. You will need at least one configuration in addition to an HTML page: the app configs. (In the GitHub repository, an example is found in /examples/container/js/sampleApps.js.) This doesn't need to be a static javascript file like sampleApps.js but the structure and format of the app configs is important.

    -
    -
    -

    App Configs

    -

    An F2 Container Provider must deliver the app configs to its container before calling F2.init(). The app configurations are represented quite simply as a list of AppConfig objects. These could be stored in a JavaScript array or in an enterprise-class database. AppConfig objects contain app meta data provided by the App Developer when he creates his app in the Developer Center.

    -

    Example AppConfig object from an individual app:

    -
    {
    -    appId: "com_companyName_appName",
    -    description: "App description",
    -    height: 500,
    -    manifestUrl: "http://www.domain.com/manifest.js",
    -    name: "App name"
    -}
    -

    Example array of AppConfig objects for a collection of apps:

    -
    var _appConfigs = [
    -    {
    -        appId: "com_companyName_appName",
    -        description: "App description",
    -        height:500,
    -        manifestUrl: "http://www.domain.com/manifest.js",
    -        name: "App name"
    -    },
    -    {
    -        appId: "com_companyName_appName2",
    -        description: "App2 description",
    -        height:100,
    -        manifestUrl: "http://www.domain2.com/manifest.js",
    -        name: "App2 name"
    -    },
    -    {
    -        appId: "com_companyName_appName3",
    -        description: "App3 description",
    -        height:200,
    -        manifestUrl: "http://www.domain3.com/manifest.js",
    -        name: "App3 name"
    -    }
    -];
    -
    -
    -

    Container Config

    -

    The F2.js JavaScript SDK provides an API for providers to configure their containers. Every container must be setup using ContainerConfig and the methods available.

    -

    In the container's $(document).ready(), add the F2.init():

    -
    $(document).ready(function(){
    -    F2.init({
    -        //define ContainerConfig properties
    -        appRender: function(appConfig, html){ ... },
    -        beforeAppRender: function(appConfig, html){ ... },
    -        afterAppRender: function(appConfig){ ... }
    -    });
    -});
    -

    To see an more detailed example of F2.init(), look at the sample container javascript file in the F2 repo on GitHub.

    -
    -

    AppRender

    -

    The appRender() method allows the container to wrap an app in extra HTML. The function should accept an F2.AppConfig object and also a string of HTML. The extra HTML can provide links to edit app settings and remove an app from the container. See F2.Constants.Css for CSS classes that should be applied to elements.

    -
    -
    -

    BeforeAppRender

    -

    The beforeAppRender() method allows the container to render HTML for an app before the AppManifest for an app has loaded. This can be useful if the design calls for loading spinners to appear for each app before each app is loaded and rendered to the page.

    -
    -
    -

    AfterAppRender

    -

    The afterAppRender() method allows the container to override how an app's HTML is inserted into the page. The function should accept an F2.AppConfig object and also a string of HTML.

    -

    For more information on F2.ContainerConfig, browse to the F2.js SDK docs.

    -
    -
    -

    F2 UI Mask

    -

    Container Developers have the opportunity to customize some user interface (UI) elements which propagate to the App Developers' toolkit in F2.js. One of those is F2.UI.Mask. The Mask object contains configuration defaults for the F2.UI.showMask() and F2.UI.hideMask() methods.

    -

    An example of setting the mask in F2.init():

    -
    $(document).ready(function(){
    -    F2.init({
    -        //define ContainerConfig properties
    -        appRender: function(appConfig, html){ ... },
    -        beforeAppRender: function(appConfig, html){ ... },
    -        afterAppRender: function(appConfig){ ... },
    -
    -        //setup UI
    -        UI:{
    -            Mask:{
    -                loadingIcon:'./img/spinner.gif',
    -                backgroundColor: '#fff',
    -                opacity: 0.5
    -            }
    -        }
    -    });
    -});
    -

    Included in the F2.UI.Mask configuration object are the following properties: backgroundColor, loadingIcon, opacity, useClasses, and zIndex. Each of these F2.UI.Mask properties is detailed in the F2.js SDK docs.

    -

    For more information on F2.UI, browse to the F2.js SDK docs.

    -
    -
    -

    Container Templates

    -

    If you're looking for sample container HTML template code, jump to the Get Started section. There is also a basic F2 container/app template available for download on GitHub.

    -
    -
    -
    -
    -
    -

    Namespacing

    -

    F2 is a web integration framework which means apps are inherently insecure—at least those non-secure apps. Following this spec, App Developers must avoid CSS collisions and JavaScript namespace issues to provide users with the best possible experience.

    -

    Note Continue reading for more specifics about secure apps.

    -
    -

    Namespacing CSS

    -

    As discussed in Developing F2 Containers: F2 ContainerID, to develop an F2 container, you need a unique identifier called an ContainerID. This ContainerID will be unique to your container across the entire open financial framework ecosystem. The format of the ContainerID looks like this: com_container_companyName_appName, where the companyName "namespace" is your company name and appName is the name of your app.

    -

    To avoid styling conflicts or other display issues related to app-provided style sheets, App Developers must namespace their CSS selectors. While there are strict rules for App Developers, the same rules apply to Container Developers. This is especially true when implementing mutliple containers.

    -

    In the event there are multiple containers, every CSS selector in container-provided style sheets must look like this:

    -
    .com_container_companyName_appName p {
    -    padding:5px;
    -}
    -
    -.com_container_companyName_appName .alert {
    -    color:red;
    -}
    -

    Note .com_container_companyName_appName is prefixed on both p and .alert selectors.

    -

    While the CSS cascade will assign more points to IDs and prefixing F2 ContainerIDs on CSS selectors isn't required, it is recommended.

    -
    .com_container_companyName_appName #notice {
    -    background-color:yellow;
    -}
    -
    -
    -

    Keeping JavaScript Clean

    -

    Adhering to one of the OpenAjax Alliance goals, F2 also promotes the concept of an uncluttered global javascript namespace. For Container and App Developers alike, this means following this spec closely and ensuring javascript code is contained inside closures or is extended as a new namespace on F2.

    -

    The F2.js SDK was designed with extensibility in mind and therefore custom logic can be added on the F2 namespace.

    -

    Example:

    -
    F2.extend('YourPluginName', (function(){
    -    return {
    -        doSomething: function(){
    -            F2.log("Something has been done.");
    -        }
    -    };
    -})());
    -

    For more information, read Extending F2.

    -
    -
    -
    -
    -

    Context

    -

    Apps are capable of sharing "context" with the container and other nearby apps. All apps have context which means the app "knows" who is using it and the content it contains. It is aware of an individual's data entitlements and user information that the container is requested to share (name, email, company, etc).

    -

    This means if a user wants to create a ticker-focused container so they can keep a close eye on shares of Proctor & Gamble, the container can send "symbol context" to any listening apps that are smart enough to refresh when ticker symbol PG is entered in the container's search box.

    -

    While apps can have context themselves, the responsibility for managing context switching or context passing falls on the container. The container assumes the role of a traffic cop—managing which data goes where. By using JavaScript events, the container can listen for events sent by apps and likewise apps can listen for events sent by the container. To provide a layer of security, this means apps cannot communicate directly with other apps on their own; apps must communicate via an F2 container to other apps since the container controls the F2.Events API.

    -

    Read more in the Framework.

    -
    -

    How to use Context

    -

    Each container will be responsible for hosting the F2.js JavaScript SDK. The F2 SDK not only provides the consistent mechanism app developers have come to expect for loading their apps on the container, but also contains an event API for handling context.

    -

    Important It is important to note that while apps can have context themselves, the responsibility for managing context switching or context passing falls on the container. The container assumes the role of a traffic cop—managing which data goes where. By using JavaScript events, the container can listen for events sent by apps and likewise apps can listen for events sent by the container. This means apps cannot communicate directly with other apps on their own; apps communicate via the container to other apps since the container controls the F2.Events API.

    -

    Let's look at some code.

    -
    -
    -

    Container-to-App Context

    -

    In this example, the container broadcasts, or emits, a javascript event defined in F2.Events.Constants. The F2.Events.emit() method accepts two arguments: the event name and an optional data object.

    -
    F2.Events.emit(
    -    F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, 
    -    { 
    -        symbol: "AAPL", 
    -        name: "Apple, Inc." 
    -    }
    -);
    -

    To listen to the F2.Constants.Events.CONTAINER_SYMBOL_CHANGE event inside your F2 app, you can use this code to trigger an alert dialog with the symbol:

    -
    F2.Events.on(
    -    F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, 
    -    function(data){
    -        F2.log("The symbol was changed to " + data.symbol);
    -    }
    -);
    -

    The F2.Events.on() method accepts the event name and listener function as arguments. Read the SDK for more information.

    -

    Note For a full list of support event types, browse to the SDK for F2.Constants.Events.

    -
    -
    -

    Container-to-App Context (Server)

    -

    Often times containers will want to send context to apps during app registration. This is possible through the AppConfig.context property. This property can contain any javascript object—a string, a number, an array or an object.

    -
    //define app config
    -var _appConfigs = [
    -    {
    -        appId: "com_acmecorp_news",
    -        description: "Acme Corp News",
    -        manifestUrl: "http://www.acme.com/apps/news-manifest.js",
    -        name: "Acme News App",
    -        context: {
    -            sessionId: myApp.sessionId,
    -            someArray: [value1,value2]
    -        }
    -    }
    -];
    -

    When F2.registerApps() is called, the appConfig is serialized and posted to the app's manifest URL. The serialized object converts to stringified JSON:

    -
    {"appId":"com_acmecorp_news","description":"Acme Corp News","manifestUrl":"http://www.acme.com/apps/news-manifest.js","name":"Acme News App","context":{"sessionId":"12345", "someArray":["value1","value2"]}}
    -

    The appConfig object is sent to the server using the params querystring name as shown in the example below. This is the complete app manifest request sent by F2.registerApps() with the appConfig URL-encoded, of course:

    -
    http://www.acme.com/apps/news-manifest.js?params=%7B%22appId%22%3A%22com_acmecorp_news%22%2C%22description%22%3A%22Acme%20Corp%20News%22%2C%22manifestUrl%22%3A%22http%3A%2F%2Fwww.acme.com%2Fapps%2Fnews-manifest.js%22%2C%22name%22%3A%22Acme%20News%20App%22%2C%22context%22%3A%7B%22sessionId%22%3A%2212345%22%2C%20%22someArray%22%3A%5B%22value1%22%2C%22value2%22%5D%7D%7D
    -

    This demonstrates complete flexibility of passing arbitrary context values from the container to any F2 app.

    -
    -
    -

    App-to-Container Context

    -

    In this example, your app emits an event indicating a user is looking at a different stock ticker within your app. Using F2.Events.emit() in your code, your app broadcasts the new symbol. As with container-to-app context passing, the F2.Events.emit() method accepts two arguments: the event name and an optional data object.

    -
    F2.Events.emit(
    -    F2.Constants.Events.APP_SYMBOL_CHANGE, 
    -    { 
    -        symbol: "MSFT", 
    -        name: "Microsoft, Inc." 
    -    }
    -);
    -

    The container would need to listen to your apps' broadcasted F2.Constants.Events.APP_SYMBOL_CHANGE event using code like this:

    -
    F2.Events.on(
    -    F2.Constants.Events.APP_SYMBOL_CHANGE, 
    -    function(data){
    -        F2.log("The symbol was changed to " + data.symbol);
    -    }
    -);
    -

    Note For a full list of support event types, browse to the SDK for F2.Constants.Events.

    -
    -
    -

    App-to-App Context

    -

    Apps can also pass context between apps. If there are two or more apps on a container with similar context and the ability to receive messages (yes, through event listeners, context receiving is opt-in), apps can communicate with each other. To communicate with another app, each app will have to know the event name along with the type of data being passed. Let's take a look.

    -

    Within "App 1", context is sent using F2.Events.emit():

    -
    F2.Events.emit(
    -    "buy_stock", //custom event name
    -    { 
    -        symbol: "GOOG", 
    -        name: "Google Inc",
    -        price: 682.68,
    -        isAvailableToPurchase: true,
    -        orderType: "Market Order"
    -    }
    -);
    -

    Within "App 2", context is received using F2.Events.on():

    -
    F2.Events.on(
    -    "buy_stock", 
    -    function(data){
    -        if (data.isAvailableToPurchase){
    -            F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
    -        } else {
    -            F2.log("This stock is not available for purchase.")
    -        }
    -    }
    -);
    -
    -
    -

    More Complex Context

    -

    The examples above demonstrate simple Context objects. In the event more complex data and/or data types are needed, F2 Context can support any JavaScript object—a string, a number, a function, an array or an object.

    -

    This is an example Context object demonstrating arbitrary JavaScript objects:

    -
    F2.Events.emit(
    -    "example_event", //custom event name
    -    { 
    -        //number
    -        price: 100,
    -        //string
    -        name: 'John Smith',
    -        //function
    -        callback: function(){
    -            F2.log('Callback!');
    -        },
    -        //array
    -        watchlist: ['AAPL','MSFT','GE'],
    -        //object
    -        userInfo: {
    -            name: 'John Smith',
    -            title: 'Managing Director',
    -            groups: ['Alpha','Beta'],
    -            sessionId: 1234567890
    -        }
    -    }
    -);
    -

    If two apps want to communicate data for populating a trade ticket and execute a callback, appclass.js code might look like this:

    -
    F2.Events.emit(
    -    "buy_stock", //custom event name
    -    { 
    -        symbol: "GOOG", 
    -        name: "Google Inc",
    -        price: 682.68,
    -        isAvailableToPurchase: true,
    -        orderType: "Market Order",
    -        //define callback
    -        callback: function(data){
    -            alert('Trade ticket populated');
    -        }
    -    }
    -);
    -

    The F2 app listening for the buy_stock event would fire the callback function.

    -
    F2.Events.on(
    -    "buy_stock", 
    -    function(data){
    -        F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
    -        //..populate the trade ticket...
    -        //fire the callback
    -        if (typeof data.callback === 'function'){
    -            data.callback();
    -        }
    -    }
    -);
    -
    -
    -

    Types of Context

    -

    Context is a term used to describe the state of an F2 container and its apps. At the same time, context is also the information passed from Container-to-App or from App-to-App or from App-to-Container. In the examples shown above, two types of context were shown: symbol and trade ticket context. It is important to realize F2.js allows client-side messaging between third parties using a collection of arbitrary name-value pairs. This provides the utmost flexibility and affords container providers the option to define context within their container.

    -
    -

    Universal F2 Instrument ID

    -

    Said another way, while { symbol:"AAPL", name: "Apple, Inc" } can be used to communicate symbol context, developers could also use { symbol: "123456789" } to identify Apple, Inc. The latter is more likely given not all apps would programmatically understand AAPL but—given symbol lookup services—would understand 123456789 as the universal F2 identifier for Apple, Inc. It is clear Container and App Developers alike would prefer to communicate with a guaranteed-to-never-change universal ID for all instrument types across all asset classes. Further details will be forthcoming as the F2 specification evolves.

    -
    -
    -
    -
    -
    -

    App Integration

    -

    The process of loading apps on a container happens through a method called F2.registerApps(). The Container Developer must call this method—which accepts two arguments, one required, one optional— after F2.init() is called. If this method isn't called, no apps can be loaded on the container.

    -

    The two arguments provided to registerApps() are an array of AppConfig objects and, optionally, an array of AppManifest objects. As F2.js parses each AppConfig, the apps are validated, hydrated with some additional properties, and saved in F2 memory on the container.

    -

    Regardless of where the container's AppConfig comes from, integrating apps is a simple process. For the purposes of this example, we will use an Acme Corp news app.

    -

    Let's look at some container code.

    -
    -

    Static App Configuration

    -

    First, we define the AppConfigs in a hard-coded _appConfigs array. Secondly, when the document is ready, we call F2.init() and subsequently F2.registerApps() with the single argument.

    -
    //define app config
    -var _appConfigs = [
    -    {
    -        appId: "com_acmecorp_news",
    -        description: "Acme Corp News",
    -        manifestUrl: "http://www.acme.com/apps/news-manifest.js",
    -        name: "Acme News App"
    -    }
    -];
    -
    -$(document).ready(function(){
    -
    -    //init F2 container
    -    F2.init({
    -        //define ContainerConfig properties
    -        appRender: function(appConfig, html){ ... },
    -        beforeAppRender: function(appConfig, html){ ... },
    -        afterAppRender: function(appConfig){ ... },
    -
    -        //setup UI
    -        UI:{
    -            Mask:{
    -                loadingIcon:'./img/spinner.gif',
    -                backgroundColor: '#fff',
    -                opacity: 0.5
    -            }
    -        }
    -    });
    -
    -    //load apps
    -    F2.registerApps(_appConfigs);
    -
    -});
    -

    This javascript code will insert the Acme Corp news app into the container's DOM, provided the appRender method is configured correctly.

    -
    -
    -

    Dynamic App Configuration

    -

    Alternatively, AppConfigs could live in a database—eventually the F2 Store—at which time container developers could provide their containers with AppManifests instead of relying on each AppConfig.manifestUrl property to be retrieved and parsed at run time.

    -

    Such an implementation would require the container developer to make a HTTP call to a Store web service to retrieve AppConfigs and AppManifests. You are already familiar with what the AppConfig looks like, but if you aren't sure what an AppManifest looks like, take note of this empty manifest.

    -
    {
    -    "inlineScripts":[],  
    -    "scripts":[],    
    -    "styles":[],     
    -    "apps":[{
    -            "data":{},
    -            "html":"",
    -            "status":""
    -    }]
    -}
    -

    Note Read more about the AppManifest.

    -

    An example of a container making a request to the F2 Store for AppConfigs and AppManifests:

    -
    (function(){
    -    
    -    var _appConfigs = [], _appManifests = [];
    -
    -    //make request to Store web service
    -    var $req = $.ajax({
    -        url: 'https://store.openf2.org/getApps',
    -        dataType: 'jsonp'
    -    });
    -
    -    //parse successful response
    -    $req.done(function(jqxhr,txtStatus){
    -        jqxhr = jqxhr || {};
    -        if (jqxhr.status == "good"){
    -            _appConfigs = jqxhr.appConfigs || [];
    -            _appManifests = jqxhr.appManifests || [];
    -            //load
    -            loadContainer();
    -        } else {
    -            F2.log("Store web service did not do something 'good'.", jqxhr, txtStatus);
    -        }
    -    });
    -
    -    //handle errors
    -    $req.fail(function(jqxhr,txtStatus){
    -        F2.log("Store web service failed.", jqxhr, txtStatus);
    -    });
    -
    -    //wrap this up so we can call it in $req.done()
    -    var loadContainer = function(){
    -        $(document).ready(function(){
    -            //init F2 container
    -            F2.init({
    -                //define ContainerConfig properties
    -                appRender: function(appConfig, html){ ... },
    -                beforeAppRender: function(appConfig, html){ ... },
    -                afterAppRender: function(appConfig){ ... },
    -
    -                //setup UI
    -                UI:{
    -                    Mask:{
    -                        loadingIcon:'./img/spinner.gif',
    -                        backgroundColor: '#fff',
    -                        opacity: 0.5
    -                    }
    -                }
    -            });
    -
    -            //load apps
    -            F2.registerApps(_appConfigs, _appManifests);
    -
    -        });
    -    }//loadContainer
    -    
    -})();
    -

    Important The _appConfigs and _appManifests arrays must be of equal length, and the object at each index must be a parallel reference. This means the AppConfig and AppManifest for Acme Corp's news app must be in _appConfigs[0] and _appManifests[0].

    -

    There are numerous benefits to dynamic app configuration, most notably performance and security. In the dynamic model, AppManifests have already been requested and loaded before a user opens the container reducing the overall number of outbound HTTP requests. Security is improved because Container Developers have the opportunity to parse and scrub AppManifest contents before F2.js injects markup in the AppManifest.html property into the container DOM.

    -
    -
    -
    -
    -

    Secure Apps

    -

    Security is a fundamental requirement of any F2 container and many F2 apps. With that in mind, the integration of secure apps on a container requires more attention and effort. The process of app integration remains largely the same for integrating secure apps with one significant addition: a second container.

    -

    To support a secured container environment, one of the choices made when writing this specification was the inclusion of an open-source cross-domain in-browser secure messaging library. For this, F2 relies on easyXDM. EasyXDM helps front-end developers safely work around the Same Origin Policy using browser-supported techniques without compromising the user experience. For all browsers, the easyXDM transport stack offers bi-directionality, reliability, queueing and sender-verification.

    -
    -

    Container Config

    -

    The process of configuring an F2 container to be secure is identical to that of an unsecure container. As such, every container must be setup using ContainerConfig and the methods available.

    -

    In the secure container's $(document).ready(), add the F2.init():

    -
    $(document).ready(function(){
    -    F2.init({
    -        //define ContainerConfig properties
    -        appRender: function(appConfig, html){ ... },
    -        beforeAppRender: function(appConfig, html){ ... },
    -        afterAppRender: function(appConfig){ ... }
    -    });
    -});
    -

    For secure containers, an additional property must be set on the ContainerConfig within F2.init(). Assuiming the container is hosted at https://www.domain.com/container, the following config would be appropriate:

    -
    $(document).ready(function(){
    -    F2.init({
    -        //define ContainerConfig properties
    -        appRender: function(appConfig, html){ ... },
    -        beforeAppRender: function(appConfig, html){ ... },
    -        afterAppRender: function(appConfig){ ... },
    -        secureAppPagePath: "https://secure.domain.com/container" //define secure page path
    -    });
    -});
    -

    This secureAppPagePath property allows the container to specify which page is used when loading secure apps. To guarantee security, the page must reside on a different domain than the parent container.

    -

    Important Therefore Container Developers need two containers: one non-secure (parent), one secure (child). The parent container can follow the basic template style and must call F2.init() and F2.registerApps() appropriately. Per the above, it must also define the secureAppPagePath property in its ContainerConfig. To see a working container, browse to the examples in the project repo on GitHub.

    -

    Since it will be loaded in an iframe and like its parent, the secure child container must also include a copy of the F2.js SDK. Additionally, it must also call F2.init() with a unique ContainerConfig.

    -
    F2.init({
    -    appRender:function(appConfig, html) {
    -        return [
    -            '<div class="span4">',
    -                html,
    -            '</div>'
    -        ].join('');
    -    },
    -    afterAppRender:function(appConfig, html) { ... },
    -
    -    //now set this property to true to tell F2 this is the secure child frame.
    -    isSecureAppPage:true
    -});
    -

    When the parent container calls registerApps(), F2 looks at each AppConfig for the isSecure bool. If the property is set to true, F2 inserts the secure app inside an iframe and instantiates the easyXDM transport stack. To see a working secure container, browse to the examples in the project repo on GitHub.

    -
    -
    -
    -
    -

    Utilities

    -

    The F2.js JavaScript SDK provides utility methods for Container Developers. These are available within the F2 namespace and complete details are in the Reference documentation.

    -
    -
    -
    -

    F2 UI

    -

    There are some utility methods provided within F2.js in the UI namespace. These helpers are for controlling layout, showing (or hiding) loading spinners, modals, managing views within apps, and more. To see which UI helpers are available to App Developers, read about F2.UI for apps.

    -

    For Container Developers, the use of F2's UI is more than likely limited to customizing the design aesthetic (CSS) and configuring the UI properties.

    -

    For complete details on F2.UI, browse to the SDK docs.

    -
    -
    -
    -

    Entitlements

    -

    User or content entitlements are the responsibility of the App developer. Many apps will need to be decoupled from the content that they need. This could include apps like research aggregation, news filtering, streaming market data, etc. Similarly to how companies build their own websites today with their own authentication and access (or content) entitlements, F2 apps are no different.

    -

    Further details around app entitlements will be forthcoming as the F2 specification evolves.

    -
    -
    -
    -

    Single Sign-On

    -

    Single sign-on (SSO) will be a shared responsibility between the Container and App Developer. In some cases, containers will want all its apps to be authenticated seamlessly for users, and that will have to be negotiated between Container and App Developers. For the purposes of this documentation, it is assumed Container Developers will build and host authentication for access to their container(s).

    -

    Once a user is authenticated on the container, how is the user then authenticated with all of the apps? Encrypted URLs.*

    -

    Note The Container Developer is free to utilize any app authentication method they deem fit. Container Developers and App Developers will need to work together to finalize the authentication details.

    -
    -

    Using Encrypted URLs

    -

    Implementing SSO using encrypted URLs is a simple and straight-forward authentication mechanism for securing cross-domain multi-provider apps. To guarantee security between the Container and App Developers, secure API contracts must be negotiated. This includes, but is not limited to, the choice of cryptographic algorithm (such as AES) and the exchange of public keys.

    -

    When the Container Developer calls F2.registerApps(), custom logic should be added to append encrypted user credentials—on a need-to-know basis—to each app requiring authentication.

    -
    -
    -

    Considerations

    -

    Authentication is a critical part of any container-app relationship. There are a plethora of SSO implementations and there are many considerations for both Container and App Developers alike.

    -

    Further details around container and app single sign-on will be forthcoming as the F2 specification evolves.

    -
    -
    -
    -
    -
    -
    - -
    - - - -
    - - - - - - - - - \ No newline at end of file diff --git a/docs/extending-f2.html b/docs/extending-f2.html index eddf81b9..e69de29b 100644 --- a/docs/extending-f2.html +++ b/docs/extending-f2.html @@ -1,199 +0,0 @@ - - - - F2 - Extending F2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    - -
    -
    -
    -

    Extending F2

    -
    -

    -At its core, F2 is an open framework. To create a truly open and flexible foundation with F2.js, F2 can be extended with custom plugins. Extending F2 with plugins provides direct access to F2.js SDK methods and can save your teams a lot of time. -

    - -
    -
    -

    Plugins

    -

    Now that you're comfortable with F2 and all the individual components of the framework, you are ready to extend F2 and add your own custom logic in the form of an F2 plugin.

    -

    There is a separate repository on GitHub dedicated to F2 plugin development. If you write a plugin you'd like to contribute back to the community, commit it to F2Plugins.

    -

    Download F2 Plugins View on GitHub

    -
    -
    -
    -

    Example Plugin

    -

    Plugins are encapsulated in JavaScript closures as demonstrated below. There are three arguments which can be passed into F2.extend(): namespace, object, and overwrite. For full details, read the F2.js SDK documentation.

    -
    F2.extend('YourPluginName', (function(){
    -    return {
    -        doSomething: function(){
    -            F2.log("Something has been done.");
    -        }
    -    };
    -})());
    -

    To call your custom method shown above:

    -
    ...
    -F2.YourPluginName.doSomething();
    -...
    -

    This method call writes Something has been done. to the Console.

    -
    -
    -
    -

    Best Practices

    -

    The purpose of developing a plugin is to encapsulate clever logic in a single javascript function to save time and effort performing repetitive tasks. Here are some best practices to keep in mind:

    -
      -
    • Always use F2.extend() and wrap your plugin in a closure.
    • -
    • Follow the module pattern as shown in the example above or the f2-storage.js example on GitHub.
    • -
    • Adhere to F2's guidelines when it comes to namespacing.
    • -
    • When passing options or data to the plugin, use data objects instead of n arguments. Cleanliness is key.
    • -
    • Don't overuse or clutter the F2 namespace with more custom plugins than you need.
    • -
    -
    -
    -
    -

    Forum

    -

    Have a question? Ask it on the F2 Google Group.

    -

    -
    -
    -
    -
    -
    - -
    - - - -
    - - - - - - - - - \ No newline at end of file diff --git a/docs/js/f2.js b/docs/js/f2.js index 88c73abf..64e5d37e 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -121,7 +121,7 @@ F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.se F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); -F2.extend("AppHandlers",function(){function r(e){return typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function i(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}var e=F2.guid(),t=F2.guid(),n={beforeApp:{render:[],reload:[],destroy:[]},afterApp:{render:[],reload:[],destroy:[]},app:{render:[],reload:[],destroy:[]}},s=function(e,t){if(!e||!e.length)throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again.";o(e[0]),e.shift();var n=e.length,s={func:null,namespace:null,app_id:null,domNode:null};switch(n){case 1:if(e[0]&&t&&(r(e[0])||i(e[0])))s.domNode=e[0];else{if(!e[0]||typeof e[0]!="function")throw"Invalid or null argument passed. Argument must be of type function or a native dom node";s.func=e[0]}break;case 2:if(e[0]&&e[1]&&typeof e[0]=="string"&&t&&(r(e[1])||i(e[1])))s.app_id=e[0],s.domNode=e[1];else if(e[0]&&e[1]&&typeof e[0]=="string"&&typeof e[1]=="function")s.app_id=e[0],s.func=e[1];else{if(!e[0]||!e[1]||typeof e[0]!="function"||typeof e[1]!="string")throw"Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)";s.func=e[0],s.namespace=e[1]}break;case 3:if(e[0]&&e[1]&&typeof e[0]=="string"&&t&&(r(e[1])||i(e[1]))&&typeof e[2]=="string")s.app_id=e[0],s.domNode=e[1],s.namespace=e[2];else{if(!e[0]||!e[1]||typeof e[0]!="string"||typeof e[1]!="function"||typeof e[2]!="string")throw"Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace.";s.app_id=e[0],s.func=e[1],s.namespace=e[2]}break;default:throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."}return s},o=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},u=function(e,t,n){o(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,s=e.length;i-1){var r=t.split(".");t=r[0],n=r[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";for(var s=0,o=i[t];s-1){var s=t.split(".");t=s[0],r=s[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";return i[t].apply(F2,[e,r,n]),this},off:function(e,t){var n=null;if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],n=i[1]}if(!r||!r[t])throw"Invalid EventKey passed. Check your inputs and try again.";return r[t].apply(F2,[e,n]),this},CONSTANTS:{APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_RELOAD_BEFORE:"appReloadBefore",APP_RELOAD:"appReload",APP_RELOAD_AFTER:"appReloadAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}()); exports.F2 = F2; diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html index 7f8f089e..56f7b28a 100644 --- a/docs/sdk/classes/F2.AppHandlers.html +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -246,6 +246,8 @@

    F2.AppHandlers

  • Methods
  • +
  • Properties
  • + @@ -279,12 +281,156 @@

    Methods

    Allows F2 to get a token internally

    + + + + __f2Trigger + ( + + ) + + +

    Allows F2 to trigger specific app events internally.

    + + + + + + getToken + ( + + ) + + +

    Allows container developer to retrieve a special token which must be passed to +all On and Off methods. This function will self destruct so be sure to keep the response +inside of a closure somewhere.

    + + + + + + off + ( + +
      + +
    • + + token + +
    • + +
    • + + eventKey{.namespace} + +
    • + +
    + + ) +
    + +

    Allows you to remove listener methods for specific events

    + + + + + + on + ( + +
      + +
    • + + token + +
    • + +
    • + + eventKey + +
    • + +
    • + + element + +
    • + +
    + + ) +
    + +

    Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.

    + + + + + + on + ( + +
      + +
    • + + token + +
    • + +
    • + + eventKey + +
    • + +
    • + + listener + +
    • + +
    + + ) +
    + +

    Allows you to add listener method that will be triggered when a specific event happens.

    + +
    +
    +

    Properties

    + + + + + + + + + + + + + + + +
    NameDescription
    + CONSTANTS +

    A collection of constants for the on/off method names. Basically just here to help you.

    +
    + @@ -332,7 +478,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:220
    +
    sdk\src\app_handlers.js:184
    @@ -348,6 +494,519 @@

    + + + + +
    +

    + __f2Trigger + ( + + ) + + + + + private + + + + + + + + + +

    + +

    +

    Allows F2 to trigger specific app events internally.

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:197
    + + + + + +
    +
    + + + + + + + + + + +
    + +
    +

    + getToken + ( + + ) + + + + + + + + + + + + +

    + +

    +

    Allows container developer to retrieve a special token which must be passed to +all On and Off methods. This function will self destruct so be sure to keep the response +inside of a closure somewhere.

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:170
    + + + + + +
    +
    + + + + + + + + + + +
    + +
    +

    + off + ( + +
      + +
    • + + token + +
    • + +
    • + + eventKey{.namespace} + +
    • + +
    + + ) + + + + + + + + + + + chainable + + + +

    + +

    +

    Allows you to remove listener methods for specific events

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:274
    + + + + + +
    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + token + String + + + + +

      +

      The token received from F2.AppHandlers/getToken:methods.

      +

      + + +
    • + +
    • + + eventKey{.namespace} + String + + + + +

      +

      The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed.

      +

      + + +
    • + +
    +
    + + + + + +

    Example:

    +
    +
        F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore');
    +
    +
    + + + + + +
    + +
    +

    + on + ( + +
      + +
    • + + token + +
    • + +
    • + + eventKey + +
    • + +
    • + + element + +
    • + +
    + + ) + + + + + + + + + + + chainable + + + +

    + +

    +

    Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:230
    + + + + + +
    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + token + String + + + + +

      +

      The token received from F2.AppHandlers/getToken:methods.

      +

      + + +
    • + +
    • + + eventKey + String + + + + +

      +

      The event key to remove handler from CONSTANTS.

      +

      + + +
    • + +
    • + + element + HTMLElement | Node + + + + +

      +

      Specific element to append your app to.

      +

      + + +
    • + +
    +
    + + + + + +

    Example:

    +
    +
        F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0));
    +    F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0));
    +
    +
    + + + + + +
    + +
    +

    + on + ( + +
      + +
    • + + token + +
    • + +
    • + + eventKey + +
    • + +
    • + + listener + +
    • + +
    + + ) + + + + + + + + + + + chainable + + + +

    + +

    +

    Allows you to add listener method that will be triggered when a specific event happens.

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:241
    + + + + + +
    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + token + String + + + + +

      +

      The token received from F2.AppHandlers/getToken:methods.

      +

      + + +
    • + +
    • + + eventKey + String + + + + +

      +

      The event key to remove handler from CONSTANTS.

      +

      + + +
    • + +
    • + + listener + Function + + + + +

      +

      A function that will be triggered when a specific event happens.

      +

      + + +
    • + +
    +
    + + + + + +

    Example:

    +
    +
        F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); });       
    +
    +
    + + + @@ -360,6 +1019,59 @@

    +
    + +
    +

    + CONSTANTS + + Object + + + + + + + + +

    + +

    +

    A collection of constants for the on/off method names. Basically just here to help you.

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:306
    + + + + + +
    +
    + + + + + + + + +
    + +
    + diff --git a/docs/sdk/data.json b/docs/sdk/data.json index 5c39020f..15be8a1f 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -611,7 +611,16 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 220, + "line": 170, + "description": "Allows container developer to retrieve a special token which must be passed to\nall On and Off methods. This function will self destruct so be sure to keep the response\ninside of a closure somewhere.", + "itemtype": "method", + "name": "getToken", + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 184, "description": "Allows F2 to get a token internally", "itemtype": "method", "name": "__f2GetToken", @@ -620,6 +629,112 @@ "class": "F2.AppHandlers", "module": "f2" }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 197, + "description": "Allows F2 to trigger specific app events internally.", + "itemtype": "method", + "name": "__f2Trigger", + "access": "private", + "tagname": "", + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 230, + "description": "Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.", + "itemtype": "method", + "name": "on", + "chainable": 1, + "params": [ + { + "name": "token", + "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:methods\"}}{{/crossLink}}.", + "type": "String" + }, + { + "name": "eventKey", + "description": "The event key to remove handler from {{#crossLink \"F2.AppHandlers/CONSTANTS:property\"}}{{/crossLink}}.", + "type": "String" + }, + { + "name": "element", + "description": "Specific element to append your app to.", + "type": "HTMLElement|Node" + } + ], + "example": [ + "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $(\"#my-container\").get(0));\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $(\"#my-container\").get(0));" + ], + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 241, + "description": "Allows you to add listener method that will be triggered when a specific event happens.", + "itemtype": "method", + "name": "on", + "chainable": 1, + "params": [ + { + "name": "token", + "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:methods\"}}{{/crossLink}}.", + "type": "String" + }, + { + "name": "eventKey", + "description": "The event key to remove handler from {{#crossLink \"F2.AppHandlers/CONSTANTS:property\"}}{{/crossLink}}.", + "type": "String" + }, + { + "name": "listener", + "description": "A function that will be triggered when a specific event happens.", + "type": "Function" + } + ], + "example": [ + "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log(\"before app rendered!\"); });\t\t" + ], + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 274, + "description": "Allows you to remove listener methods for specific events", + "itemtype": "method", + "name": "off", + "chainable": 1, + "params": [ + { + "name": "token", + "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:methods\"}}{{/crossLink}}.", + "type": "String" + }, + { + "name": "eventKey{.namespace}", + "description": "The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed.", + "type": "String" + } + ], + "example": [ + "\n\t\tF2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore');" + ], + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 306, + "description": "A collection of constants for the on/off method names. Basically just here to help you.", + "itemtype": "property", + "name": "CONSTANTS", + "type": "Object", + "class": "F2.AppHandlers", + "module": "f2" + }, { "file": "sdk\\src\\classes.js", "line": 1, @@ -2185,6 +2300,14 @@ } ], "warnings": [ + { + "message": "replacing incorrect tag: params with param", + "line": " sdk\\src\\app_handlers.js:230" + }, + { + "message": "replacing incorrect tag: params with param", + "line": " sdk\\src\\app_handlers.js:241" + }, { "message": "replacing incorrect tag: returns with return", "line": " sdk\\src\\container.js:270" diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html index 33e69e79..d2cafce9 100644 --- a/docs/sdk/files/sdk_src_app_handlers.js.html +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -226,7 +226,7 @@

    File: sdk\src\app_handlers.js

    * @class F2.AppHandlers */ F2.extend('AppHandlers', (function() { - + // the hidden token that we will check against every time someone tries to add, remove, fire handler var _ct = F2.guid(); var _f2t = F2.guid(); @@ -234,27 +234,52 @@

    File: sdk\src\app_handlers.js

    var _handlerCollection = { beforeApp: { - render: [], - remove: [], + render: [], reload: [], destroy: [] }, afterApp: { render: [], - remove: [], reload: [], destroy: [] }, app: { render: [], - remove: [], reload: [], destroy: [] } }; + var _offMethods = { + appRenderBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, + appRender: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, + appRenderAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, + + appReloadBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, + appReload: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, + appReloadAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, + + appDestroyBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }, + appDestroy: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }, + appDestroyAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } + }; + + var _onMethods = { + appRenderBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, + appRender: function(token, sNamespace, func_or_element) { _handlerCollection.app.render.push(_createHandler(token, sNamespace, func_or_element, true)); }, + appRenderAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, + + appReloadBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + appReload: function(token, sNamespace, func_or_element) { _handlerCollection.app.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + appReloadAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + + appDestroyBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, + appDestroy: function(token, sNamespace, func_or_element) { _handlerCollection.app.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, + appDestroyAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); } + }; + //Returns true if it is a DOM node function _isNode(o){ return ( @@ -271,120 +296,33 @@

    File: sdk\src\app_handlers.js

    ); } - var _createHandler = function(arOriginalArgs, bDomNodeAppropriate) + var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) { - if(!arOriginalArgs || !arOriginalArgs.length) { throw "Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again." } + if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } // will throw an exception and stop execution if the token is invalid _validateToken(arOriginalArgs[0]); - var iArgCount = arOriginalArgs.length; + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); - // TODO: pop off first arg + var iArgCount = arOriginalArgs.length; // create handler structure. Not all arguments properties will be populated/used. var handler = { - func: null, - namespace: null, - app_id: null, - domNode: null + func: (typeof(func_or_element)) ? func_or_element : null, + namespace: sNamespace, + domNode: (_isNode(func_or_element) || _isElement(func_or_element)) ? func_or_element : null }; - // based on the argument count try to create a handler. - switch(iArgCount) + if(!handler.func && !handler.domNode) { - case 1: - // method signature(oDomNode) - if(arOriginalArgs[0] && bDomNodeAppropriate && (_isNode(arOriginalArgs[0]) || _isElement(arOriginalArgs[0])) - { - handler.domNode = arOriginalArgs[0]; - } - // method signature (function(){}) - else if(arOriginalArgs[0] && typeof(arOriginalArgs[0]) == "function") - { - handler.func = arOriginalArgs[0]; - } - // error - else - { - throw "Invalid or null argument passed. Argument must be of type function or a native dom node"; - } - break; - case 2: - // method signature ("APP_ID" ,oDomNode) - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - } - // method signature ("APP_ID" ,function(){}) - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - } - // method signature (function(){} ,"NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "function" && - typeof(arOriginalArgs[1]) == "string" - ) - { - handler.func = arOriginalArgs[0]; - handler.namespace = arOriginalArgs[1]; - } - // error - else - { - throw "Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)"; - } - break; - case 3: - // method signature ("APP_ID", oDomNode, "NAMESPACE") - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) && - typeof(arOriginalArgs[2]) == "string" - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - // method signature ("APP_ID", function(){}, "NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" && - typeof(arOriginalArgs[2]) == "string" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - else - { - throw "Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace."; - } - break; - // throw exception if there are 0 or 4+ arguments - default: - throw "Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again." + throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + } + + if(handler.domNode && !bDomNodeAppropriate) + { + throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); } return handler; @@ -393,7 +331,7 @@

    File: sdk\src\app_handlers.js

    var _validateToken = function(sToken) { // check token against F2 and Container - if(_ct != sToken && _f2t != sToken) { throw "Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."; } + if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } }; var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken) @@ -420,7 +358,7 @@

    File: sdk\src\app_handlers.js

    var currentHandler = arHandleCollection[i]; if(currentHandler) { - if(currentHandler.app_id != sNamespaceOrApp_ID) && currentHandler.namespace != sNamespaceOrApp_ID) + if(currentHandler.app_id != sNamespaceOrApp_ID && currentHandler.namespace != sNamespaceOrApp_ID) { newEvents.push(currentHandler); } @@ -431,7 +369,33 @@

    File: sdk\src\app_handlers.js

    } }; + var _triggerEvent = function(arHandleCollection, arOriginalArgs) + { + // no errors here, basically there are no handlers to call + if(!arHandleCollection || !arHandleCollection.length) { return; } + + // there is always 1 argument required, the first arg should always be the token. + if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + + // will throw an exception and stop execution if the token is invalid + _validateToken(arOriginalArgs[0]); + + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + arHandleCollection[i].apply(F2, arguments); + } + }; + return { + /** + * Allows container developer to retrieve a special token which must be passed to + * all On and Off methods. This function will self destruct so be sure to keep the response + * inside of a closure somewhere. + * @method getToken + **/ getToken: function() { // delete this method for security that way only the container has access to the token 1 time. @@ -441,10 +405,10 @@

    File: sdk\src\app_handlers.js

    return _ct; }, /** - * Allows F2 to get a token internally - * @method __f2GetToken - * @private - */ + * Allows F2 to get a token internally + * @method __f2GetToken + * @private + **/ __f2GetToken: function() { // delete this method for security that way only the F2 internally has access to the token 1 time. @@ -453,75 +417,132 @@

    File: sdk\src\app_handlers.js

    // return the token, which we validate against. return _f2t; }, - __f2Trigger: + /** + * Allows F2 to trigger specific app events internally. + * @method __f2Trigger + * @private + **/ + __f2Trigger: function(token, eventKey) // additional arguments will likely be passed { - beforeApp: - { - render: function(sToken) { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); }, - remove: function(sToken) { _handlerCollection.beforeApp.remove.push(_createHandler(arguments)); }, - reload: function(sToken) { _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); }, - destroy: function(sToken) { _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); } - }, - afterApp: - { - render: function(sToken) { _handlerCollection.afterApp.render.push(_createHandler(arguments)); }, - remove: function(sToken) { _handlerCollection.afterApp.remove.push(_createHandler(arguments)); }, - reload: function(sToken) { _handlerCollection.afterApp.reload.push(_createHandler(arguments)); }, - destroy: function(sToken) { _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); } - }, - app: + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_onMethods && _onMethods[eventKey]) + { + for(var i = 0, j = _onMethods[eventKey]; i < j; i++) { - render: function(sToken) { _handlerCollection.app.render.push(_createHandler(arguments), true); }, - remove: function(sToken) { _handlerCollection.app.remove.push(_createHandler(arguments)); }, - reload: function(sToken) { _handlerCollection.app.reload.push(_createHandler(arguments)); }, - destroy: function(sToken) { _handlerCollection.app.destroy.push(_createHandler(arguments)); } + var handler = _onMethods[eventKey][i]; + + _onMethods[eventKey][i].apply(F2, [token, sNamespace, func_or_element]) } + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; }, - on: { - beforeApp: - { - render: function() { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); }, - remove: function(){ _handlerCollection.beforeApp.remove.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); } - }, - afterApp: - { - render: function() { _handlerCollection.afterApp.render.push(_createHandler(arguments)); }, - remove: function(){ _handlerCollection.afterApp.remove.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.afterApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); } - }, - app: - { - render: function() { _handlerCollection.app.render.push(_createHandler(arguments), true); }, - remove: function(){ _handlerCollection.app.remove.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.app.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.app.destroy.push(_createHandler(arguments)); } - } + /** + * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {HTMLElement|Node} element Specific element to append your app to. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + **/ + /** + * Allows you to add listener method that will be triggered when a specific event happens. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {Function} listener A function that will be triggered when a specific event happens. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + **/ + on: function(token, eventKey, func_or_element) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_onMethods && _onMethods[eventKey]) + { + _onMethods[eventKey].apply(F2, [token, sNamespace, func_or_element]) + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; }, - off: { - beforeApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - remove: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.remove, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - afterApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, - remove: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.remove, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - app: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - remove: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.remove, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); } - } + /** + * Allows you to remove listener methods for specific events + * @method off + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @example + * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + **/ + off: function(token, eventKey) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_offMethods && _offMethods[eventKey]) + { + _offMethods[eventKey].apply(F2, [token, sNamespace]) + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * A collection of constants for the on/off method names. Basically just here to help you. + * @property {Object} CONSTANTS + **/ + CONSTANTS: + { + APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER: "appRender", + APP_RENDER_AFTER: "appRenderAfter", + + APP_RELOAD_BEFORE: "appReloadBefore", + APP_RELOAD: "appReload", + APP_RELOAD_AFTER: "appReloadAfter", + + APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY: "appDestroy", + APP_DESTROY_AFTER: "appDestroyAfter" } }; })()); diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 3018d1a3..f61dc47e 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -217,7 +217,9 @@
    -

    An open framework for the financial services industry.

    +

    Build Status

    + +

    An open framework for the financial services industry.

    F2 is an open and free web integration framework designed to help you and other financial industry participants develop custom solutions that combine the best tools and content from multiple providers into one, privately-labeled, seamlessly integrated front-end. The essential components defined by the F2 specification are the Container, Apps, Context and Store—all supported under the hood by F2.js, a JavaScript SDK which provides an extensible foundation powering all F2-based web applications.

    @@ -247,7 +249,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 7dde48d2..096e8223 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -3515,6 +3515,34 @@ F2.extend('AppHandlers', (function() { } }; + var _offMethods = { + appRenderBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, + appRender: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, + appRenderAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, + + appReloadBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, + appReload: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, + appReloadAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, + + appDestroyBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }, + appDestroy: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }, + appDestroyAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } + }; + + var _onMethods = { + appRenderBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, + appRender: function(token, sNamespace, func_or_element) { _handlerCollection.app.render.push(_createHandler(token, sNamespace, func_or_element, true)); }, + appRenderAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, + + appReloadBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + appReload: function(token, sNamespace, func_or_element) { _handlerCollection.app.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + appReloadAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + + appDestroyBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, + appDestroy: function(token, sNamespace, func_or_element) { _handlerCollection.app.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, + appDestroyAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); } + }; + //Returns true if it is a DOM node function _isNode(o){ return ( @@ -3531,7 +3559,7 @@ F2.extend('AppHandlers', (function() { ); } - var _createHandler = function(arOriginalArgs, bDomNodeAppropriate) + var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) { if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } @@ -3545,109 +3573,19 @@ F2.extend('AppHandlers', (function() { // create handler structure. Not all arguments properties will be populated/used. var handler = { - func: null, - namespace: null, - app_id: null, - domNode: null + func: (typeof(func_or_element)) ? func_or_element : null, + namespace: sNamespace, + domNode: (_isNode(func_or_element) || _isElement(func_or_element)) ? func_or_element : null }; - // based on the argument count try to create a handler. - switch(iArgCount) + if(!handler.func && !handler.domNode) { - case 1: - // method signature(oDomNode) - if(arOriginalArgs[0] && bDomNodeAppropriate && (_isNode(arOriginalArgs[0]) || _isElement(arOriginalArgs[0]))) - { - handler.domNode = arOriginalArgs[0]; - } - // method signature (function(){}) - else if(arOriginalArgs[0] && typeof(arOriginalArgs[0]) == "function") - { - handler.func = arOriginalArgs[0]; - } - // error - else - { - throw ("Invalid or null argument passed. Argument must be of type function or a native dom node"); - } - break; - case 2: - // method signature ("APP_ID" ,oDomNode) - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) - ) - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - } - // method signature ("APP_ID" ,function(){}) - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - } - // method signature (function(){} ,"NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "function" && - typeof(arOriginalArgs[1]) == "string" - ) - { - handler.func = arOriginalArgs[0]; - handler.namespace = arOriginalArgs[1]; - } - // error - else - { - throw ("Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)"); - } - break; - case 3: - // method signature ("APP_ID", oDomNode, "NAMESPACE") - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) && - typeof(arOriginalArgs[2]) == "string" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - // method signature ("APP_ID", function(){}, "NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" && - typeof(arOriginalArgs[2]) == "string" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - else - { - throw ("Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace."); - } - break; - // throw exception if there are 0 or 4+ arguments - default: - throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); + throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + } + + if(handler.domNode && !bDomNodeAppropriate) + { + throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); } return handler; @@ -3694,13 +3632,33 @@ F2.extend('AppHandlers', (function() { } }; + var _triggerEvent = function(arHandleCollection, arOriginalArgs) + { + // no errors here, basically there are no handlers to call + if(!arHandleCollection || !arHandleCollection.length) { return; } + + // there is always 1 argument required, the first arg should always be the token. + if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + + // will throw an exception and stop execution if the token is invalid + _validateToken(arOriginalArgs[0]); + + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + arHandleCollection[i].apply(F2, arguments); + } + }; + return { /** - * Allows container developer to retrieve a special token which must be passed to - * all On and Off methods. This function will self destruct so be sure to keep the response - * inside of a closure somewhere. - * @method getToken - */ + * Allows container developer to retrieve a special token which must be passed to + * all On and Off methods. This function will self destruct so be sure to keep the response + * inside of a closure somewhere. + * @method getToken + **/ getToken: function() { // delete this method for security that way only the container has access to the token 1 time. @@ -3710,10 +3668,10 @@ F2.extend('AppHandlers', (function() { return _ct; }, /** - * Allows F2 to get a token internally - * @method __f2GetToken - * @private - */ + * Allows F2 to get a token internally + * @method __f2GetToken + * @private + **/ __f2GetToken: function() { // delete this method for security that way only the F2 internally has access to the token 1 time. @@ -3723,51 +3681,131 @@ F2.extend('AppHandlers', (function() { return _f2t; }, /** - * Allows F2 to trigger events internally - * @method __f2Trigger - * @private - */ - __f2Trigger: { - }, - on: { - beforeApp: - { - render: function() { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); } - }, - afterApp: - { - render: function() { _handlerCollection.afterApp.render.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.afterApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); } - }, - app: + * Allows F2 to trigger specific app events internally. + * @method __f2Trigger + * @private + **/ + __f2Trigger: function(token, eventKey) // additional arguments will likely be passed + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_onMethods && _onMethods[eventKey]) + { + for(var i = 0, j = _onMethods[eventKey]; i < j; i++) { - render: function() { _handlerCollection.app.render.push(_createHandler(arguments), true); }, - reload: function(){ _handlerCollection.app.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.app.destroy.push(_createHandler(arguments)); } + var handler = _onMethods[eventKey][i]; + + _onMethods[eventKey][i].apply(F2, [token, sNamespace, func_or_element]) } + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; }, - off: { - beforeApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - afterApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - app: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); } - } + /** + * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {HTMLElement|Node} element Specific element to append your app to. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + **/ + /** + * Allows you to add listener method that will be triggered when a specific event happens. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {Function} listener A function that will be triggered when a specific event happens. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + **/ + on: function(token, eventKey, func_or_element) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_onMethods && _onMethods[eventKey]) + { + _onMethods[eventKey].apply(F2, [token, sNamespace, func_or_element]) + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * Allows you to remove listener methods for specific events + * @method off + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @example + * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + **/ + off: function(token, eventKey) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_offMethods && _offMethods[eventKey]) + { + _offMethods[eventKey].apply(F2, [token, sNamespace]) + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * A collection of constants for the on/off method names. Basically just here to help you. + * @property {Object} CONSTANTS + **/ + CONSTANTS: + { + APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER: "appRender", + APP_RENDER_AFTER: "appRenderAfter", + + APP_RELOAD_BEFORE: "appReloadBefore", + APP_RELOAD: "appReload", + APP_RELOAD_AFTER: "appReloadAfter", + + APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY: "appDestroy", + APP_DESTROY_AFTER: "appDestroyAfter" } }; })()); diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 88c73abf..64e5d37e 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -121,7 +121,7 @@ F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.se F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); -F2.extend("AppHandlers",function(){function r(e){return typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function i(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}var e=F2.guid(),t=F2.guid(),n={beforeApp:{render:[],reload:[],destroy:[]},afterApp:{render:[],reload:[],destroy:[]},app:{render:[],reload:[],destroy:[]}},s=function(e,t){if(!e||!e.length)throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again.";o(e[0]),e.shift();var n=e.length,s={func:null,namespace:null,app_id:null,domNode:null};switch(n){case 1:if(e[0]&&t&&(r(e[0])||i(e[0])))s.domNode=e[0];else{if(!e[0]||typeof e[0]!="function")throw"Invalid or null argument passed. Argument must be of type function or a native dom node";s.func=e[0]}break;case 2:if(e[0]&&e[1]&&typeof e[0]=="string"&&t&&(r(e[1])||i(e[1])))s.app_id=e[0],s.domNode=e[1];else if(e[0]&&e[1]&&typeof e[0]=="string"&&typeof e[1]=="function")s.app_id=e[0],s.func=e[1];else{if(!e[0]||!e[1]||typeof e[0]!="function"||typeof e[1]!="string")throw"Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)";s.func=e[0],s.namespace=e[1]}break;case 3:if(e[0]&&e[1]&&typeof e[0]=="string"&&t&&(r(e[1])||i(e[1]))&&typeof e[2]=="string")s.app_id=e[0],s.domNode=e[1],s.namespace=e[2];else{if(!e[0]||!e[1]||typeof e[0]!="string"||typeof e[1]!="function"||typeof e[2]!="string")throw"Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace.";s.app_id=e[0],s.func=e[1],s.namespace=e[2]}break;default:throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."}return s},o=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},u=function(e,t,n){o(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,s=e.length;i-1){var r=t.split(".");t=r[0],n=r[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";for(var s=0,o=i[t];s-1){var s=t.split(".");t=s[0],r=s[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";return i[t].apply(F2,[e,r,n]),this},off:function(e,t){var n=null;if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],n=i[1]}if(!r||!r[t])throw"Invalid EventKey passed. Check your inputs and try again.";return r[t].apply(F2,[e,n]),this},CONSTANTS:{APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_RELOAD_BEFORE:"appReloadBefore",APP_RELOAD:"appReload",APP_RELOAD_AFTER:"appReloadAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}()); exports.F2 = F2; diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index 44943254..e359dfbf 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -2181,6 +2181,34 @@ F2.extend('AppHandlers', (function() { } }; + var _offMethods = { + appRenderBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, + appRender: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, + appRenderAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, + + appReloadBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, + appReload: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, + appReloadAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, + + appDestroyBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }, + appDestroy: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }, + appDestroyAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } + }; + + var _onMethods = { + appRenderBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, + appRender: function(token, sNamespace, func_or_element) { _handlerCollection.app.render.push(_createHandler(token, sNamespace, func_or_element, true)); }, + appRenderAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, + + appReloadBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + appReload: function(token, sNamespace, func_or_element) { _handlerCollection.app.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + appReloadAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + + appDestroyBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, + appDestroy: function(token, sNamespace, func_or_element) { _handlerCollection.app.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, + appDestroyAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); } + }; + //Returns true if it is a DOM node function _isNode(o){ return ( @@ -2197,7 +2225,7 @@ F2.extend('AppHandlers', (function() { ); } - var _createHandler = function(arOriginalArgs, bDomNodeAppropriate) + var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) { if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } @@ -2211,109 +2239,19 @@ F2.extend('AppHandlers', (function() { // create handler structure. Not all arguments properties will be populated/used. var handler = { - func: null, - namespace: null, - app_id: null, - domNode: null + func: (typeof(func_or_element)) ? func_or_element : null, + namespace: sNamespace, + domNode: (_isNode(func_or_element) || _isElement(func_or_element)) ? func_or_element : null }; - // based on the argument count try to create a handler. - switch(iArgCount) + if(!handler.func && !handler.domNode) { - case 1: - // method signature(oDomNode) - if(arOriginalArgs[0] && bDomNodeAppropriate && (_isNode(arOriginalArgs[0]) || _isElement(arOriginalArgs[0]))) - { - handler.domNode = arOriginalArgs[0]; - } - // method signature (function(){}) - else if(arOriginalArgs[0] && typeof(arOriginalArgs[0]) == "function") - { - handler.func = arOriginalArgs[0]; - } - // error - else - { - throw ("Invalid or null argument passed. Argument must be of type function or a native dom node"); - } - break; - case 2: - // method signature ("APP_ID" ,oDomNode) - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) - ) - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - } - // method signature ("APP_ID" ,function(){}) - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - } - // method signature (function(){} ,"NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "function" && - typeof(arOriginalArgs[1]) == "string" - ) - { - handler.func = arOriginalArgs[0]; - handler.namespace = arOriginalArgs[1]; - } - // error - else - { - throw ("Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)"); - } - break; - case 3: - // method signature ("APP_ID", oDomNode, "NAMESPACE") - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) && - typeof(arOriginalArgs[2]) == "string" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - // method signature ("APP_ID", function(){}, "NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" && - typeof(arOriginalArgs[2]) == "string" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - else - { - throw ("Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace."); - } - break; - // throw exception if there are 0 or 4+ arguments - default: - throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); + throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + } + + if(handler.domNode && !bDomNodeAppropriate) + { + throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); } return handler; @@ -2360,13 +2298,33 @@ F2.extend('AppHandlers', (function() { } }; + var _triggerEvent = function(arHandleCollection, arOriginalArgs) + { + // no errors here, basically there are no handlers to call + if(!arHandleCollection || !arHandleCollection.length) { return; } + + // there is always 1 argument required, the first arg should always be the token. + if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + + // will throw an exception and stop execution if the token is invalid + _validateToken(arOriginalArgs[0]); + + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + arHandleCollection[i].apply(F2, arguments); + } + }; + return { /** - * Allows container developer to retrieve a special token which must be passed to - * all On and Off methods. This function will self destruct so be sure to keep the response - * inside of a closure somewhere. - * @method getToken - */ + * Allows container developer to retrieve a special token which must be passed to + * all On and Off methods. This function will self destruct so be sure to keep the response + * inside of a closure somewhere. + * @method getToken + **/ getToken: function() { // delete this method for security that way only the container has access to the token 1 time. @@ -2376,10 +2334,10 @@ F2.extend('AppHandlers', (function() { return _ct; }, /** - * Allows F2 to get a token internally - * @method __f2GetToken - * @private - */ + * Allows F2 to get a token internally + * @method __f2GetToken + * @private + **/ __f2GetToken: function() { // delete this method for security that way only the F2 internally has access to the token 1 time. @@ -2389,51 +2347,131 @@ F2.extend('AppHandlers', (function() { return _f2t; }, /** - * Allows F2 to trigger events internally - * @method __f2Trigger - * @private - */ - __f2Trigger: { - }, - on: { - beforeApp: - { - render: function() { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); } - }, - afterApp: - { - render: function() { _handlerCollection.afterApp.render.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.afterApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); } - }, - app: + * Allows F2 to trigger specific app events internally. + * @method __f2Trigger + * @private + **/ + __f2Trigger: function(token, eventKey) // additional arguments will likely be passed + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_onMethods && _onMethods[eventKey]) + { + for(var i = 0, j = _onMethods[eventKey]; i < j; i++) { - render: function() { _handlerCollection.app.render.push(_createHandler(arguments), true); }, - reload: function(){ _handlerCollection.app.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.app.destroy.push(_createHandler(arguments)); } + var handler = _onMethods[eventKey][i]; + + _onMethods[eventKey][i].apply(F2, [token, sNamespace, func_or_element]) } + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; }, - off: { - beforeApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - afterApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - app: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); } - } + /** + * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {HTMLElement|Node} element Specific element to append your app to. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + **/ + /** + * Allows you to add listener method that will be triggered when a specific event happens. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {Function} listener A function that will be triggered when a specific event happens. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + **/ + on: function(token, eventKey, func_or_element) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_onMethods && _onMethods[eventKey]) + { + _onMethods[eventKey].apply(F2, [token, sNamespace, func_or_element]) + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * Allows you to remove listener methods for specific events + * @method off + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @example + * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + **/ + off: function(token, eventKey) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_offMethods && _offMethods[eventKey]) + { + _offMethods[eventKey].apply(F2, [token, sNamespace]) + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * A collection of constants for the on/off method names. Basically just here to help you. + * @property {Object} CONSTANTS + **/ + CONSTANTS: + { + APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER: "appRender", + APP_RENDER_AFTER: "appRenderAfter", + + APP_RELOAD_BEFORE: "appReloadBefore", + APP_RELOAD: "appReload", + APP_RELOAD_AFTER: "appReloadAfter", + + APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY: "appDestroy", + APP_DESTROY_AFTER: "appDestroyAfter" } }; })()); diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index fd73a398..2c6498f5 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -29,6 +29,34 @@ F2.extend('AppHandlers', (function() { } }; + var _offMethods = { + appRenderBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, + appRender: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, + appRenderAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, + + appReloadBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, + appReload: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, + appReloadAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, + + appDestroyBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }, + appDestroy: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }, + appDestroyAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } + }; + + var _onMethods = { + appRenderBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, + appRender: function(token, sNamespace, func_or_element) { _handlerCollection.app.render.push(_createHandler(token, sNamespace, func_or_element, true)); }, + appRenderAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, + + appReloadBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + appReload: function(token, sNamespace, func_or_element) { _handlerCollection.app.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + appReloadAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, + + appDestroyBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, + appDestroy: function(token, sNamespace, func_or_element) { _handlerCollection.app.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, + appDestroyAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); } + }; + //Returns true if it is a DOM node function _isNode(o){ return ( @@ -45,7 +73,7 @@ F2.extend('AppHandlers', (function() { ); } - var _createHandler = function(arOriginalArgs, bDomNodeAppropriate) + var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) { if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } @@ -59,109 +87,19 @@ F2.extend('AppHandlers', (function() { // create handler structure. Not all arguments properties will be populated/used. var handler = { - func: null, - namespace: null, - app_id: null, - domNode: null + func: (typeof(func_or_element)) ? func_or_element : null, + namespace: sNamespace, + domNode: (_isNode(func_or_element) || _isElement(func_or_element)) ? func_or_element : null }; - // based on the argument count try to create a handler. - switch(iArgCount) + if(!handler.func && !handler.domNode) { - case 1: - // method signature(oDomNode) - if(arOriginalArgs[0] && bDomNodeAppropriate && (_isNode(arOriginalArgs[0]) || _isElement(arOriginalArgs[0]))) - { - handler.domNode = arOriginalArgs[0]; - } - // method signature (function(){}) - else if(arOriginalArgs[0] && typeof(arOriginalArgs[0]) == "function") - { - handler.func = arOriginalArgs[0]; - } - // error - else - { - throw ("Invalid or null argument passed. Argument must be of type function or a native dom node"); - } - break; - case 2: - // method signature ("APP_ID" ,oDomNode) - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) - ) - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - } - // method signature ("APP_ID" ,function(){}) - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - } - // method signature (function(){} ,"NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "function" && - typeof(arOriginalArgs[1]) == "string" - ) - { - handler.func = arOriginalArgs[0]; - handler.namespace = arOriginalArgs[1]; - } - // error - else - { - throw ("Invalid or null argument(s) passed. Argument[0] must be of type function or string (to represent app_id). Argument[1] must be native domnode, function, or string (to represent namespace)"); - } - break; - case 3: - // method signature ("APP_ID", oDomNode, "NAMESPACE") - if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - bDomNodeAppropriate && - (_isNode(arOriginalArgs[1]) || _isElement(arOriginalArgs[1])) && - typeof(arOriginalArgs[2]) == "string" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.domNode = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - // method signature ("APP_ID", function(){}, "NAMESPACE") - else if( - arOriginalArgs[0] && - arOriginalArgs[1] && - typeof(arOriginalArgs[0]) == "string" && - typeof(arOriginalArgs[1]) == "function" && - typeof(arOriginalArgs[2]) == "string" - ) - { - handler.app_id = arOriginalArgs[0]; - handler.func = arOriginalArgs[1]; - handler.namespace = arOriginalArgs[2]; - } - else - { - throw ("Invalid or null argument(s) passed. Argument[0] must be of type string that represents the app_id. Argument[1] must be native domnode or function. Argument[2] must be of type string to represent a namespace."); - } - break; - // throw exception if there are 0 or 4+ arguments - default: - throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); + throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + } + + if(handler.domNode && !bDomNodeAppropriate) + { + throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); } return handler; @@ -208,13 +146,33 @@ F2.extend('AppHandlers', (function() { } }; + var _triggerEvent = function(arHandleCollection, arOriginalArgs) + { + // no errors here, basically there are no handlers to call + if(!arHandleCollection || !arHandleCollection.length) { return; } + + // there is always 1 argument required, the first arg should always be the token. + if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + + // will throw an exception and stop execution if the token is invalid + _validateToken(arOriginalArgs[0]); + + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + arHandleCollection[i].apply(F2, arguments); + } + }; + return { /** - * Allows container developer to retrieve a special token which must be passed to - * all On and Off methods. This function will self destruct so be sure to keep the response - * inside of a closure somewhere. - * @method getToken - */ + * Allows container developer to retrieve a special token which must be passed to + * all On and Off methods. This function will self destruct so be sure to keep the response + * inside of a closure somewhere. + * @method getToken + **/ getToken: function() { // delete this method for security that way only the container has access to the token 1 time. @@ -224,10 +182,10 @@ F2.extend('AppHandlers', (function() { return _ct; }, /** - * Allows F2 to get a token internally - * @method __f2GetToken - * @private - */ + * Allows F2 to get a token internally + * @method __f2GetToken + * @private + **/ __f2GetToken: function() { // delete this method for security that way only the F2 internally has access to the token 1 time. @@ -237,51 +195,131 @@ F2.extend('AppHandlers', (function() { return _f2t; }, /** - * Allows F2 to trigger events internally - * @method __f2Trigger - * @private - */ - __f2Trigger: { - }, - on: { - beforeApp: - { - render: function() { _handlerCollection.beforeApp.render.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.beforeApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.beforeApp.destroy.push(_createHandler(arguments)); } - }, - afterApp: - { - render: function() { _handlerCollection.afterApp.render.push(_createHandler(arguments)); }, - reload: function(){ _handlerCollection.afterApp.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.afterApp.destroy.push(_createHandler(arguments)); } - }, - app: + * Allows F2 to trigger specific app events internally. + * @method __f2Trigger + * @private + **/ + __f2Trigger: function(token, eventKey) // additional arguments will likely be passed + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_onMethods && _onMethods[eventKey]) + { + for(var i = 0, j = _onMethods[eventKey]; i < j; i++) { - render: function() { _handlerCollection.app.render.push(_createHandler(arguments), true); }, - reload: function(){ _handlerCollection.app.reload.push(_createHandler(arguments)); }, - destroy: function(){ _handlerCollection.app.destroy.push(_createHandler(arguments)); } + var handler = _onMethods[eventKey][i]; + + _onMethods[eventKey][i].apply(F2, [token, sNamespace, func_or_element]) } + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; }, - off: { - beforeApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - afterApp: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } - }, - app: - { - render: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - reload: function(sNamespaceOrApp_ID, sToken) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - destroy: function(sNamespaceOrApp_ID, sToken){ _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); } - } + /** + * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {HTMLElement|Node} element Specific element to append your app to. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + **/ + /** + * Allows you to add listener method that will be triggered when a specific event happens. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {Function} listener A function that will be triggered when a specific event happens. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + **/ + on: function(token, eventKey, func_or_element) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_onMethods && _onMethods[eventKey]) + { + _onMethods[eventKey].apply(F2, [token, sNamespace, func_or_element]) + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * Allows you to remove listener methods for specific events + * @method off + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @example + * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + **/ + off: function(token, eventKey) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_offMethods && _offMethods[eventKey]) + { + _offMethods[eventKey].apply(F2, [token, sNamespace]) + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * A collection of constants for the on/off method names. Basically just here to help you. + * @property {Object} CONSTANTS + **/ + CONSTANTS: + { + APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER: "appRender", + APP_RENDER_AFTER: "appRenderAfter", + + APP_RELOAD_BEFORE: "appReloadBefore", + APP_RELOAD: "appReload", + APP_RELOAD_AFTER: "appReloadAfter", + + APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY: "appDestroy", + APP_DESTROY_AFTER: "appDestroyAfter" } }; })()); \ No newline at end of file From f20205e2e9a32cc8f6d48d32c73a3f6e2d30be63 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Fri, 22 Mar 2013 23:13:06 -0600 Subject: [PATCH 022/181] More travis testing. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index bbcdcf8a..a6cbc524 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,4 +21,5 @@ script: - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" # Make sure to change test/test.html to the path to your test page - "phantomjs phantom-jasmine.js tests/index.html" + - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" - "phantomjs phantom-jasmine.js tests/index-amd.html" From 264e73e5dc0e3946a683fa8b481e9feb1e288cc1 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Fri, 22 Mar 2013 23:18:56 -0600 Subject: [PATCH 023/181] Think I fixed the issue for travis... --- tests/index-amd.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/index-amd.html b/tests/index-amd.html index bc4a429d..d32fff9a 100644 --- a/tests/index-amd.html +++ b/tests/index-amd.html @@ -9,9 +9,12 @@ + + + - - + + @@ -33,6 +36,10 @@ jasmineEnv.specFilter = function(spec) { return htmlReporter.specFilter(spec); }; + + // what you need to add + var console_reporter = new jasmine.ConsoleReporter() + jasmine.getEnv().addReporter(console_reporter); var currentWindowOnload = window.onload; From 4953c515339eb942a0391aecac37be7696c7e53a Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Fri, 22 Mar 2013 23:20:54 -0600 Subject: [PATCH 024/181] Hoping we don't need that script twice. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a6cbc524..bbcdcf8a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,5 +21,4 @@ script: - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" # Make sure to change test/test.html to the path to your test page - "phantomjs phantom-jasmine.js tests/index.html" - - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" - "phantomjs phantom-jasmine.js tests/index-amd.html" From 92516d8ce196b167329cf0eb1183b85961e8e5e9 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Tue, 26 Mar 2013 17:14:07 -0600 Subject: [PATCH 025/181] Have a solid saving point. Still a lot of work to do here. --- build/build.js | 4 +- docs/js/f2.js | 118 +-- docs/js/f2.min.js | 3 +- docs/sdk/classes/F2.AppHandlers.html | 22 +- docs/sdk/classes/F2.html | 191 +++- docs/sdk/data.json | 88 +- docs/sdk/files/sdk_src_F2.js.html | 19 + docs/sdk/files/sdk_src_app_handlers.js.html | 192 ++-- docs/sdk/files/sdk_src_container.js.html | 134 ++- docs/sdk/index.html | 2 +- examples/container/js/container.js | 78 +- f2.js | 19 +- sdk/f2.debug.js | 963 ++++++++++++-------- sdk/f2.min.js | 6 +- sdk/f2.no-third-party.js | 963 ++++++++++++-------- sdk/src/F2.js | 19 + sdk/src/app_handlers.js | 192 ++-- sdk/src/container.js | 134 ++- 18 files changed, 1892 insertions(+), 1255 deletions(-) diff --git a/build/build.js b/build/build.js index ad65529c..0d7e4c30 100755 --- a/build/build.js +++ b/build/build.js @@ -46,13 +46,13 @@ var JS_FOOTER = { src: 'sdk/src/template/footer.js.tmpl', minify: false }; // only the files that represent f2 var CORE_FILES = [ { src: 'sdk/src/F2.js', minify: true }, + { src: 'sdk/src/app_handlers.js', minify: true }, { src: 'sdk/src/classes.js', minify: true }, { src: 'sdk/src/constants.js', minify: true }, { src: 'sdk/src/events.js', minify: true }, { src: 'sdk/src/rpc.js', minify: true }, { src: 'sdk/src/ui.js', minify: true }, - { src: 'sdk/src/container.js', minify: true }, - { src: 'sdk/src/app_handlers.js', minify: true } + { src: 'sdk/src/container.js', minify: true } ]; var ENCODING = 'utf-8'; var EOL = '\n'; diff --git a/docs/js/f2.js b/docs/js/f2.js index 64e5d37e..b7a5c6d2 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -17,120 +17,4 @@ */ ;typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); -; - -/*! ========================================================= - * bootstrap-modal.js v2.2.2 - * http://twitter.github.com/bootstrap/javascript.html#modals - * ========================================================= - * Copyright 2012 Twitter, 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(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('"].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); -F2.extend("AppHandlers",function(){function s(e){return typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function o(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}var e=F2.guid(),t=F2.guid(),n={beforeApp:{render:[],reload:[],destroy:[]},afterApp:{render:[],reload:[],destroy:[]},app:{render:[],reload:[],destroy:[]}},r={appRenderBefore:function(e,t){f(n.beforeApp.render,t,e)},appRender:function(e,t){f(n.app.render,t,e)},appRenderAfter:function(e,t){f(n.afterApp.render,t,e)},appReloadBefore:function(e,t){f(n.beforeApp.reload,t,e)},appReload:function(e,t){f(n.app.reload,t,e)},appReloadAfter:function(e,t){f(n.afterApp.reload,t,e)},appDestroyBefore:function(e,t){f(n.beforeApp.destroy,t,e)},appDestroy:function(e,t){f(n.app.destroy,t,e)},appDestroyAfter:function(e,t){f(n.afterApp.destroy,t,e)}},i={appRenderBefore:function(e,t,r){n.beforeApp.render.push(u(e,t,r))},appRender:function(e,t,r){n.app.render.push(u(e,t,r,!0))},appRenderAfter:function(e,t,r){n.afterApp.render.push(u(e,t,r))},appReloadBefore:function(e,t,r){n.beforeApp.reload.push(u(e,t,r))},appReload:function(e,t,r){n.app.reload.push(u(e,t,r))},appReloadAfter:function(e,t,r){n.afterApp.reload.push(u(e,t,r))},appDestroyBefore:function(e,t,r){n.beforeApp.destroy.push(u(e,t,r))},appDestroy:function(e,t,r){n.app.destroy.push(u(e,t,r))},appDestroyAfter:function(e,t,r){n.afterApp.destroy.push(u(e,t,r))}},u=function(e,t,n,r){if(!arOriginalArgs||!arOriginalArgs.length)throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again.";a(arOriginalArgs[0]),arOriginalArgs.shift();var i=arOriginalArgs.length,u={func:typeof n?n:null,namespace:t,domNode:s(n)||o(n)?n:null};if(!u.func&&!u.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(u.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return u},a=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},f=function(e,t,n){a(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,s=e.length;i-1){var r=t.split(".");t=r[0],n=r[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";for(var s=0,o=i[t];s-1){var s=t.split(".");t=s[0],r=s[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";return i[t].apply(F2,[e,r,n]),this},off:function(e,t){var n=null;if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],n=i[1]}if(!r||!r[t])throw"Invalid EventKey passed. Check your inputs and try again.";return r[t].apply(F2,[e,n]),this},CONSTANTS:{APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_RELOAD_BEFORE:"appReloadBefore",APP_RELOAD:"appReload",APP_RELOAD_AFTER:"appReloadAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}()); - - exports.F2 = F2; - - if (typeof define !== 'undefined' && define.amd) { - - define(function() { - return F2; - }); - - } - -})(typeof exports !== 'undefined' ? exports : window); \ No newline at end of file +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length \ No newline at end of file diff --git a/docs/js/f2.min.js b/docs/js/f2.min.js index 78bb3ace..97f03f7d 100644 --- a/docs/js/f2.min.js +++ b/docs/js/f2.min.js @@ -115,12 +115,13 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * THE SOFTWARE. */ ;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; +F2.extend("AppHandlers",function(){function o(e){return typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function u(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}var e=F2.guid(),t=F2.guid(),n={appRenderBefore:[],appReloadBefore:[],appDestroyBefore:[],appRenderAfter:[],appReloadAfter:[],appDestroyAfter:[],appRender:[],appReload:[],appDestroy:[]},r={appRenderBefore:function(e,t){},appRender:function(){},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(){},appDestroyAfter:function(){}},i={appRenderBefore:function(e,t){l(n.appRenderBefore,t,e)},appRender:function(e,t){l(n.appRender,t,e)},appRenderAfter:function(e,t){l(n.appRenderAfter,t,e)},appReloadBefore:function(e,t){l(n.appReloadBefore,t,e)},appReload:function(e,t){l(n.appReload,t,e)},appReloadAfter:function(e,t){l(n.appReloadAfter,t,e)},appDestroyBefore:function(e,t){l(n.appDestroyBefore,t,e)},appDestroy:function(e,t){l(n.appDestroy,t,e)},appDestroyAfter:function(e,t){l(n.appDestroyAfter,t,e)}},s={appRenderBefore:function(e,t,r){n.appRenderBefore.push(a(e,t,r))},appRender:function(e,t,r){n.appRender.push(a(e,t,r,!0))},appRenderAfter:function(e,t,r){n.appRenderAfter.push(a(e,t,r))},appReloadBefore:function(e,t,r){n.appReloadBefore.push(a(e,t,r))},appReload:function(e,t,r){n.appReload.push(a(e,t,r))},appReloadAfter:function(e,t,r){n.appReloadAfter.push(a(e,t,r))},appDestroyBefore:function(e,t,r){n.appDestroyBefore.push(a(e,t,r))},appDestroy:function(e,t,r){n.appDestroy.push(a(e,t,r))},appDestroyAfter:function(e,t,r){n.appDestroyAfter.push(a(e,t,r))}},a=function(e,t,n,r){f(e);var i={func:typeof n?n:null,namespace:t,domNode:o(n)||u(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},f=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},l=function(e,t,n){f(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,s=e.length;i-1){var i=t.split(".");t=i[0],r=i[1]}if(!s||!s[t])throw"Invalid EventKey passed. Check your inputs and try again.";return s[t].apply(F2,[e,r,n]),this},off:function(e,t){var n=null;if(t.indexOf(".")>-1){var r=t.split(".");t=r[0],n=r[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";return i[t].apply(F2,[e,n]),this},CONSTANTS:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_RELOAD_BEFORE:"appReloadBefore",APP_RELOAD:"appReload",APP_RELOAD_AFTER:"appReloadAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}()); F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},secureAppPagePath:"",supportedViews:[]}}); F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=_config.beforeAppRender||_config.appRender||_config.afterAppRender?!0:!1,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=jQuery("
    ").get(0),_bUsesAppHandlers?F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.Constants.APP_CREATE_ROOT,i,i.root):i.root=_beforeAppRender(i),F2.log(i.root),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); exports.F2 = F2; diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html index 56f7b28a..97c66a6b 100644 --- a/docs/sdk/classes/F2.AppHandlers.html +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -283,8 +283,8 @@

    Methods

    - - __f2Trigger + + __trigger ( ) @@ -478,7 +478,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:184
    +
    sdk\src\app_handlers.js:168
    @@ -500,9 +500,9 @@

    -
    +

    - __f2Trigger + __trigger ( ) @@ -536,7 +536,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:197
    +
    sdk\src\app_handlers.js:181
    @@ -594,7 +594,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:170
    +
    sdk\src\app_handlers.js:154
    @@ -668,7 +668,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:274
    +
    sdk\src\app_handlers.js:286
    @@ -792,7 +792,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:230
    +
    sdk\src\app_handlers.js:235
    @@ -932,7 +932,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:241
    +
    sdk\src\app_handlers.js:246
    @@ -1050,7 +1050,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:306
    +
    sdk\src\app_handlers.js:322
    diff --git a/docs/sdk/classes/F2.html b/docs/sdk/classes/F2.html index 488a90f8..d0d3cb60 100644 --- a/docs/sdk/classes/F2.html +++ b/docs/sdk/classes/F2.html @@ -269,7 +269,7 @@

    Methods

    - + _afterAppRender @@ -297,7 +297,7 @@

    Methods

    Appends the app's html to the DOM

    - +
    _appRender @@ -325,7 +325,7 @@

    Methods

    Renders the html for an app.

    - +
    _beforeAppRender @@ -563,6 +563,28 @@

    Methods

    Has the container been init?

    + + +
    + isNativeDOMNode + ( + +
      + +
    • + + testObject + +
    • + +
    + + ) +
    + +

    Utility method to determine whether or not the argument passed in is or is not a native dom node.

    + + @@ -831,7 +853,7 @@

    Properties

    -
    +

    _afterAppRender ( @@ -855,6 +877,8 @@

    ) + deprecated + private @@ -883,10 +907,13 @@

    Defined in
    -
    sdk\src\container.js:11
    +
    sdk\src\container.js:13
    +
    Deprecated
    +
    This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0
    + @@ -956,7 +983,7 @@

    Returns:

    -
    +

    _appRender ( @@ -980,6 +1007,8 @@

    ) + deprecated + private @@ -1008,10 +1037,13 @@

    Defined in
    -
    sdk\src\container.js:36
    +
    sdk\src\container.js:39
    +
    Deprecated
    +
    This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0
    + @@ -1068,7 +1100,7 @@

    Parameters:

    -
    +

    _beforeAppRender ( @@ -1086,6 +1118,8 @@

    ) + deprecated + private @@ -1115,10 +1149,13 @@

    Defined in
    -
    sdk\src\container.js:61
    +
    sdk\src\container.js:65
    +
    Deprecated
    +
    This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0
    + @@ -1219,7 +1256,7 @@

    Defined in
    -
    sdk\src\container.js:74
    +
    sdk\src\container.js:79
    @@ -1300,7 +1337,7 @@

    Defined in
    -
    sdk\src\container.js:92
    +
    sdk\src\container.js:97
    @@ -1358,7 +1395,7 @@

    Defined in
    -
    sdk\src\container.js:114
    +
    sdk\src\container.js:119
    @@ -1416,7 +1453,7 @@

    Defined in
    -
    sdk\src\container.js:132
    +
    sdk\src\container.js:137
    @@ -1497,7 +1534,7 @@

    Defined in
    -
    sdk\src\container.js:270
    +
    sdk\src\container.js:361
    @@ -1792,7 +1829,7 @@

    Defined in
    -
    sdk\src\container.js:292
    +
    sdk\src\container.js:383
    @@ -2064,7 +2101,7 @@

    Defined in
    -
    sdk\src\container.js:307
    +
    sdk\src\container.js:398
    @@ -2143,7 +2180,7 @@

    Defined in
    -
    sdk\src\container.js:327
    +
    sdk\src\container.js:422
    @@ -2172,6 +2209,108 @@

    Returns:

    + + +
    + +
    +

    + isNativeDOMNode + ( + +
      + +
    • + + testObject + +
    • + +
    + + ) + + + + + + + + + + + + +

    + +

    +

    Utility method to determine whether or not the argument passed in is or is not a native dom node.

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\F2.js:142
    + + + + + +
    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + testObject + Object + + + + +

      +

      The object you want to check as native dom node.

      +

      + + +
    • + +
    +
    + + + +
    +

    Returns:

    + +
    + + + Bool: + + Returns true if the object passed is a native dom node. + +
    +
    + + + + + @@ -2230,7 +2369,7 @@

    Defined in
    -
    sdk\src\container.js:142
    +
    sdk\src\container.js:147
    @@ -2344,7 +2483,7 @@

    Defined in
    -
    sdk\src\container.js:245
    +
    sdk\src\container.js:298
    @@ -2455,7 +2594,7 @@

    Defined in
    -
    sdk\src\F2.js:142
    +
    sdk\src\F2.js:161
    @@ -2562,7 +2701,7 @@

    Defined in
    -
    sdk\src\F2.js:153
    +
    sdk\src\F2.js:172
    @@ -2674,7 +2813,7 @@

    Defined in
    -
    sdk\src\container.js:333
    +
    sdk\src\container.js:428
    @@ -2775,7 +2914,7 @@

    Defined in
    -
    sdk\src\container.js:470
    +
    sdk\src\container.js:586
    @@ -2841,7 +2980,7 @@

    Defined in
    -
    sdk\src\container.js:485
    +
    sdk\src\container.js:601
    @@ -2946,7 +3085,7 @@

    Defined in
    -
    sdk\src\F2.js:162
    +
    sdk\src\F2.js:181
    @@ -3074,7 +3213,7 @@

    Defined in
    -
    sdk\src\F2.js:183
    +
    sdk\src\F2.js:202
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index 15be8a1f..ca03ba6b 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -526,6 +526,26 @@ { "file": "sdk\\src\\F2.js", "line": 142, + "description": "Utility method to determine whether or not the argument passed in is or is not a native dom node.", + "itemtype": "method", + "name": "isNativeDOMNode", + "params": [ + { + "name": "testObject", + "description": "The object you want to check as native dom node.", + "type": "Object" + } + ], + "return": { + "description": "Returns true if the object passed is a native dom node.", + "type": "Bool" + }, + "class": "F2", + "module": "f2" + }, + { + "file": "sdk\\src\\F2.js", + "line": 161, "description": "Wrapper logging function.", "itemtype": "method", "name": "log", @@ -548,7 +568,7 @@ }, { "file": "sdk\\src\\F2.js", - "line": 153, + "line": 172, "description": "Wrapper to convert a JSON string to an object", "itemtype": "method", "name": "parse", @@ -568,7 +588,7 @@ }, { "file": "sdk\\src\\F2.js", - "line": 162, + "line": 181, "description": "Wrapper to convert an object to JSON\n\n**Note: When using F2.stringify on an F2.AppConfig object, it is\nrecommended to pass F2.appConfigReplacer as the replacer function in\norder to prevent circular serialization errors.**", "itemtype": "method", "name": "stringify", @@ -598,7 +618,7 @@ }, { "file": "sdk\\src\\F2.js", - "line": 183, + "line": 202, "description": "Function to get the F2 version number", "itemtype": "method", "name": "version", @@ -611,7 +631,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 170, + "line": 154, "description": "Allows container developer to retrieve a special token which must be passed to\nall On and Off methods. This function will self destruct so be sure to keep the response\ninside of a closure somewhere.", "itemtype": "method", "name": "getToken", @@ -620,7 +640,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 184, + "line": 168, "description": "Allows F2 to get a token internally", "itemtype": "method", "name": "__f2GetToken", @@ -631,10 +651,10 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 197, + "line": 181, "description": "Allows F2 to trigger specific app events internally.", "itemtype": "method", - "name": "__f2Trigger", + "name": "__trigger", "access": "private", "tagname": "", "class": "F2.AppHandlers", @@ -642,7 +662,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 230, + "line": 235, "description": "Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.", "itemtype": "method", "name": "on", @@ -672,7 +692,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 241, + "line": 246, "description": "Allows you to add listener method that will be triggered when a specific event happens.", "itemtype": "method", "name": "on", @@ -702,7 +722,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 274, + "line": 286, "description": "Allows you to remove listener methods for specific events", "itemtype": "method", "name": "off", @@ -727,7 +747,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 306, + "line": 322, "description": "A collection of constants for the on/off method names. Basically just here to help you.", "itemtype": "property", "name": "CONSTANTS", @@ -1415,10 +1435,12 @@ }, { "file": "sdk\\src\\container.js", - "line": 11, + "line": 13, "description": "Appends the app's html to the DOM", "itemtype": "method", "name": "_afterAppRender", + "deprecated": true, + "deprecationMessage": "This has been replaced with {{#crossLink \"F2.AppHandlers\"}}{{/crossLink}} and will be removed in v2.0", "access": "private", "tagname": "", "params": [ @@ -1442,10 +1464,12 @@ }, { "file": "sdk\\src\\container.js", - "line": 36, + "line": 39, "description": "Renders the html for an app.", "itemtype": "method", "name": "_appRender", + "deprecated": true, + "deprecationMessage": "This has been replaced with {{#crossLink \"F2.AppHandlers\"}}{{/crossLink}} and will be removed in v2.0", "access": "private", "tagname": "", "params": [ @@ -1465,10 +1489,12 @@ }, { "file": "sdk\\src\\container.js", - "line": 61, + "line": 65, "description": "Rendering hook to allow containers to render some html prior to an app\nloading", "itemtype": "method", "name": "_beforeAppRender", + "deprecated": true, + "deprecationMessage": "This has been replaced with {{#crossLink \"F2.AppHandlers\"}}{{/crossLink}} and will be removed in v2.0", "access": "private", "tagname": "", "params": [ @@ -1487,7 +1513,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 74, + "line": 79, "description": "Adds properties to the AppConfig object", "itemtype": "method", "name": "_hydrateAppConfig", @@ -1505,7 +1531,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 92, + "line": 97, "description": "Attach app events", "itemtype": "method", "name": "_initAppEvents", @@ -1516,7 +1542,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 114, + "line": 119, "description": "Attach container Events", "itemtype": "method", "name": "_initContainerEvents", @@ -1527,7 +1553,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 132, + "line": 137, "description": "Has the container been init?", "itemtype": "method", "name": "_isInit", @@ -1542,7 +1568,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 142, + "line": 147, "description": "Loads the app's html/css/javascript", "itemtype": "method", "name": "loadApp", @@ -1566,7 +1592,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 245, + "line": 298, "description": "Loads the app's html/css/javascript into an iframe", "itemtype": "method", "name": "loadSecureApp", @@ -1589,7 +1615,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 270, + "line": 361, "description": "Checks if the app is valid", "itemtype": "method", "name": "_validateApp", @@ -1611,7 +1637,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 292, + "line": 383, "description": "Gets the current list of apps in the container", "itemtype": "method", "name": "getContainerState", @@ -1624,7 +1650,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 307, + "line": 398, "description": "Initializes the container. This method must be called before performing\nany other actions in the container.", "itemtype": "method", "name": "init", @@ -1640,7 +1666,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 327, + "line": 422, "description": "Has the container been init?", "itemtype": "method", "name": "isInit", @@ -1653,7 +1679,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 333, + "line": 428, "description": "Begins the loading process for all apps. The app will\nbe passed the {{#crossLink \"F2.AppConfig\"}}{{/crossLink}} object which will\ncontain the app's unique instanceId within the container. Optionally, the\n{{#crossLink \"F2.AppManifest\"}}{{/crossLink}} can be passed in and those\nassets will be used instead of making a request.", "itemtype": "method", "name": "registerApps", @@ -1675,7 +1701,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 470, + "line": 586, "description": "Removes all apps from the container", "itemtype": "method", "name": "removeAllApps", @@ -1684,7 +1710,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 485, + "line": 601, "description": "Removes an app from the container", "itemtype": "method", "name": "removeApp", @@ -2302,19 +2328,19 @@ "warnings": [ { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:230" + "line": " sdk\\src\\app_handlers.js:235" }, { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:241" + "line": " sdk\\src\\app_handlers.js:246" }, { "message": "replacing incorrect tag: returns with return", - "line": " sdk\\src\\container.js:270" + "line": " sdk\\src\\container.js:361" }, { "message": "replacing incorrect tag: returns with return", - "line": " sdk\\src\\container.js:292" + "line": " sdk\\src\\container.js:383" }, { "message": "replacing incorrect tag: params with param", diff --git a/docs/sdk/files/sdk_src_F2.js.html b/docs/sdk/files/sdk_src_F2.js.html index 1f880531..e2bc9878 100644 --- a/docs/sdk/files/sdk_src_F2.js.html +++ b/docs/sdk/files/sdk_src_F2.js.html @@ -362,6 +362,25 @@

    File: sdk\src\F2.js

    inArray: function(value, array) { return jQuery.inArray(value, array) > -1; }, + /** + * Utility method to determine whether or not the argument passed in is or is not a native dom node. + * @method isNativeDOMNode + * @param {object} testObject The object you want to check as native dom node. + * @return {bool} Returns true if the object passed is a native dom node. + */ + isNativeDOMNode: function(testObject) { + var bIsNode = ( + typeof Node === "object" ? testObject instanceof Node : + testObject && typeof testObject === "object" && typeof testObject.nodeType === "number" && typeof testObject.nodeName ==="string" + ); + + var bIsElement = ( + typeof HTMLElement === "object" ? testObject instanceof HTMLElement : //DOM2 + testObject && typeof testObject === "object" && testObject.nodeType === 1 && typeof testObject.nodeName ==="string" + ); + + return (bIsNode || bIsElement); + }, /** * Wrapper logging function. * @method log diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html index d2cafce9..25f8bd30 100644 --- a/docs/sdk/files/sdk_src_app_handlers.js.html +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -231,88 +231,72 @@

    File: sdk\src\app_handlers.js

    var _ct = F2.guid(); var _f2t = F2.guid(); - var _handlerCollection = { - beforeApp: + var _handlerCollection = { + appCreateRoot: [], + appRenderBefore: [], + appReloadBefore: [], + appDestroyBefore: [], + appRenderAfter: [], + appReloadAfter: [], + appDestroyAfter: [], + appRender: [], + appReload: [], + appDestroy: [] + }; + + var _defaultMethods = { + appRenderBefore: function(appConfig, html) { - render: [], - reload: [], - destroy: [] + // do nothing before an app is rendered }, - afterApp: + appRender: function() { - render: [], - reload: [], - destroy: [] + // do something }, - app: + appRenderAfter: function() { - render: [], - reload: [], - destroy: [] - } - }; - - var _offMethods = { - appRenderBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - appRender: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - appRenderAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, + // do nothing after an app is rendered + }, - appReloadBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - appReload: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - appReloadAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, + appReloadBefore: function() + { + // do nothing before an app reloads + }, + appReload: function() + { + // re-request the app? + // re-add files? + // re init js ? + }, + appReloadAfter: function() + { + // do nothing after an app reloads + }, - appDestroyBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }, - appDestroy: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }, - appDestroyAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } + appDestroyBefore: function() + { + // do nothing before destroying app + }, + appDestroy: function() + { + // remove the app from the dom + }, + appDestroyAfter: function() + { + // do nothing after an app is destroyed + } }; - var _onMethods = { - appRenderBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, - appRender: function(token, sNamespace, func_or_element) { _handlerCollection.app.render.push(_createHandler(token, sNamespace, func_or_element, true)); }, - appRenderAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, - - appReloadBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - appReload: function(token, sNamespace, func_or_element) { _handlerCollection.app.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - appReloadAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - - appDestroyBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, - appDestroy: function(token, sNamespace, func_or_element) { _handlerCollection.app.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, - appDestroyAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); } - }; - - //Returns true if it is a DOM node - function _isNode(o){ - return ( - typeof Node === "object" ? o instanceof Node : - o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" - ); - } - - //Returns true if it is a DOM element - function _isElement(o){ - return ( - typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 - o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string" - ); - } - var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) - { - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } - + { // will throw an exception and stop execution if the token is invalid - _validateToken(arOriginalArgs[0]); - - // remove the token from the arguments since we have validated it and no longer need it - arOriginalArgs.shift(); - - var iArgCount = arOriginalArgs.length; + _validateToken(token); // create handler structure. Not all arguments properties will be populated/used. var handler = { func: (typeof(func_or_element)) ? func_or_element : null, namespace: sNamespace, - domNode: (_isNode(func_or_element) || _isElement(func_or_element)) ? func_or_element : null + domNode: (F2.isNativeDOMNode(func_or_element)) ? func_or_element : null }; if(!handler.func && !handler.domNode) @@ -419,28 +403,49 @@

    File: sdk\src\app_handlers.js

    }, /** * Allows F2 to trigger specific app events internally. - * @method __f2Trigger + * @method __trigger * @private **/ - __f2Trigger: function(token, eventKey) // additional arguments will likely be passed - { - var sNamespace = null; - - // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) - { - var arData = eventKey.split("."); - eventKey = arData[0]; - sNamespace = arData[1]; - } + __trigger: function(token, eventKey, appConfig, html) // additional arguments will likely be passed + { + // will throw an exception and stop execution if the token is invalid + _validateToken(token); - if(_onMethods && _onMethods[eventKey]) + if(_handlerCollection && _handlerCollection[eventKey]) { - for(var i = 0, j = _onMethods[eventKey]; i < j; i++) + // create a collection of arguments that are safe to pass to the callback. + var passableArgs = []; + + // populate that collection with all arguments except token and eventKey + for(var i = 2, j = arguments.length; i < j; i++) { - var handler = _onMethods[eventKey][i]; + passableArgs.push(arguments[i]); + } + + if(_handlerCollection[eventKey].length == 0 && _defaultMethods[eventKey]) + { + _defaultMethods[eventKey].apply(F2, passableArgs); + return this; + } + else if(_handlerCollection[eventKey].length == 0 && !_handlerCollection[eventKey]) + { + return this; + } + + // fire all event listeners in the order that they were added. + for(var i = 0, j = _handlerCollection[eventKey].length; i < j; i++) + { + var handler = _handlerCollection[eventKey][i]; - _onMethods[eventKey][i].apply(F2, [token, sNamespace, func_or_element]) + if (handler.domNode) + { + var $appRoot = jQuery(appConfig.root).append(html); + jQuery(handler.domNode).append($appRoot); + } + else + { + handler.func.apply(F2, passableArgs); + } } } else @@ -483,9 +488,16 @@

    File: sdk\src\app_handlers.js

    sNamespace = arData[1]; } - if(_onMethods && _onMethods[eventKey]) - { - _onMethods[eventKey].apply(F2, [token, sNamespace, func_or_element]) + if(_handlerCollection && _handlerCollection[eventKey]) + { + _handlerCollection[eventKey].push( + _createHandler( + token, + sNamespace, + func_or_element, + (eventKey == "appRender") + ) + ); } else { @@ -515,9 +527,13 @@

    File: sdk\src\app_handlers.js

    sNamespace = arData[1]; } - if(_offMethods && _offMethods[eventKey]) + if(_handlerCollection && _handlerCollection[eventKey]) { - _offMethods[eventKey].apply(F2, [token, sNamespace]) + _removeHandler( + _handlerCollection[eventKey], + sNamespace, + token + ); } else { @@ -532,6 +548,8 @@

    File: sdk\src\app_handlers.js

    **/ CONSTANTS: { + APP_CREATE_ROOT: "appCreateRoot", + APP_RENDER_BEFORE: "appRenderBefore", APP_RENDER: "appRender", APP_RENDER_AFTER: "appRenderAfter", diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index f71676b9..41dcbf16 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -230,10 +230,13 @@

    File: sdk\src\container.js

    var _apps = {}; var _config = false; + var _bUsesAppHandlers = false; + var _sAppHandlerToken = F2.AppHandlers.__f2GetToken(); /** * Appends the app's html to the DOM * @method _afterAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html @@ -259,6 +262,7 @@

    File: sdk\src\container.js

    /** * Renders the html for an app. * @method _appRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html @@ -285,6 +289,7 @@

    File: sdk\src\container.js

    * Rendering hook to allow containers to render some html prior to an app * loading * @method _beforeAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @return {Element} The DOM Element surrounding the app @@ -424,8 +429,56 @@

    File: sdk\src\container.js

    // load html jQuery.each(appManifest.apps, function(i, a) { - // load html and save the root node - appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); + if(!_bUsesAppHandlers) + { + // load html and save the root node + appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); + } + else + { + // if no app root is defined use the apps outter most node + if(!F2.isNativeDOMNode(appConfigs[i].root)) + { + appConfigs[i].root = jQuery(outerHtml(a.html)).get(0); + } + + var $root = jQuery(appConfigs[i].root); + + function outerHtml(html) { + return jQuery('<div></div>').append(html).html(); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + appConfigs[i], // the app config + outerHtml(a.html) + ); + + if($root.parents("body:first").length == 0) + { + throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + appConfigs[i] // the app config + ); + + if(!appConfigs[i].root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + if(!F2.isNativeDOMNode(appConfigs[i].root)) + { + throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + jQuery(appConfigs[i].root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); + } + // init events _initAppEvents(appConfigs[i]); }); @@ -477,8 +530,46 @@

    File: sdk\src\container.js

    // make sure the container is configured for secure apps if (_config.secureAppPagePath) { - // create the html container for the iframe - appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '<div></div>')); + if(!_bUsesAppHandlers) + { + // create the html container for the iframe + appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '<div></div>')); + } + else + { + var $root = jQuery(appConfig.root); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + appConfig, // the app config + appManifest.html + ); + + if($root.parents("body:first").length == 0) + { + throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + appConfig // the app config + ); + + if(!appConfig.root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + if(!F2.isNativeDOMNode(appConfig.root)) + { + throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + jQuery(appConfig.root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId); + } + // instantiate F2.UI appConfig.ui = new F2.UI(appConfig); // init events @@ -535,7 +626,11 @@

    File: sdk\src\container.js

    */ init: function(config) { _config = config || {}; - + + // dictates whether we use the old logic or the new logic. + // TODO: Remove in v2.0 + _bUsesAppHandlers = (!_config.beforeAppRender && !_config.appRender && !_config.afterAppRender); + // only establish RPC connection if the container supports the secure app page if (!!_config.secureAppPagePath || _config.isSecureAppPage) { F2.Rpc.init(!!_config.secureAppPagePath ? _config.secureAppPagePath : false); @@ -607,10 +702,31 @@

    File: sdk\src\container.js

    // add properties and methods _hydrateAppConfig(a); - - // fire beforeAppRender - a.root = _beforeAppRender(a); - + + // create just a generic div. To squash the jQuery dependency we will turn + // app.root will only be a dom node + a.root = null; + + if(!_bUsesAppHandlers) + { + // fire beforeAppRender + a.root = _beforeAppRender(a); + } + else + { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + a // the app config + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + a // the app config + ); + } + // save app _apps[a.instanceId] = { config:a }; diff --git a/docs/sdk/index.html b/docs/sdk/index.html index f61dc47e..6ea8af2d 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -249,7 +249,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/examples/container/js/container.js b/examples/container/js/container.js index bd206355..171692b2 100644 --- a/examples/container/js/container.js +++ b/examples/container/js/container.js @@ -1,59 +1,51 @@ $(function() { - + + var containerAppHandlerToken = F2.AppHandlers.getToken(); + /** * Init Container */ F2.init({ - - afterAppRender: function (app, html) { - var el = $(app.root).append(html); - F2.UI.hideMask(app.instanceId, el); - return el; - }, - - beforeAppRender: function(app) { - - var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, app.views); - var hasHelp = F2.inArray(F2.Constants.Views.HELP, app.views); - var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, app.views); - var showDivider = hasSettings || hasHelp || hasAbout; - var gridWidth = app.minGridSize || 3; - - var appRoot = $([ - '
    ', - '
    ', - '

    ', app.name.toUpperCase(), '

    ', - '
    ', - '', - '', - '
    ', - '
    ', - '
    ' - ].join('')).appendTo($('#mainContent div.row')); - - // show loader - F2.UI.showMask(app.instanceId, appRoot, true); - - return appRoot; - }, - UI:{ Mask:{ loadingIcon:'./img/ajax-loader.gif' } }, - supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE], secureAppPagePath: "secure.html" // this should go on a separate domain from index.html }); + + // Define these prior to init + F2.AppHandlers + .on( + containerAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + function(appConfig) + { + appConfig.root = $("
    ").get(0); + } + ) + .on( + containerAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + function(appConfig){ + F2.UI.hideMask(appConfig.instanceId, appConfig.root); + $(appConfig.root).addClass("render-before-testing"); + } + ) + .on( + containerAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + $("body").get(0) + ) + .on( + containerAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + function(appConfig){ + $(appConfig.root).addClass("render-after-testing"); + F2.UI.hideMask(appConfig.instanceId, appConfig.root); + } + ); //listen for app symbol change events and re-broadcast F2.Events.on( diff --git a/f2.js b/f2.js index 78bb3ace..9147587a 100644 --- a/f2.js +++ b/f2.js @@ -115,21 +115,4 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * THE SOFTWARE. */ ;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; -F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},secureAppPagePath:"",supportedViews:[]}}); -F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); -F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); -F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); - - exports.F2 = F2; - - if (typeof define !== 'undefined' && define.amd) { - - define(function() { - return F2; - }); - - } - -})(typeof exports !== 'undefined' ? exports : window); \ No newline at end of file +F2.extend("AppHandlers",function(){function o(e){return typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName==" \ No newline at end of file diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 096e8223..58fc3693 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -1479,6 +1479,25 @@ F2 = { inArray: function(value, array) { return jQuery.inArray(value, array) > -1; }, + /** + * Utility method to determine whether or not the argument passed in is or is not a native dom node. + * @method isNativeDOMNode + * @param {object} testObject The object you want to check as native dom node. + * @return {bool} Returns true if the object passed is a native dom node. + */ + isNativeDOMNode: function(testObject) { + var bIsNode = ( + typeof Node === "object" ? testObject instanceof Node : + testObject && typeof testObject === "object" && typeof testObject.nodeType === "number" && typeof testObject.nodeName ==="string" + ); + + var bIsElement = ( + typeof HTMLElement === "object" ? testObject instanceof HTMLElement : //DOM2 + testObject && typeof testObject === "object" && testObject.nodeType === 1 && typeof testObject.nodeName ==="string" + ); + + return (bIsNode || bIsElement); + }, /** * Wrapper logging function. * @method log @@ -1530,84 +1549,427 @@ F2 = { /** - * Class stubs for documentation purposes - * @main F2 + * Allows container developers more flexibility when it comes to handling app interaction. + * @class F2.AppHandlers */ -F2.extend("", { - /** - * The App Class is an optional class that can be namespaced onto the - * {{#crossLink "F2\Apps"}}{{/crossLink}} namespace. The - * [F2 Docs](../../app-development.html#app-class) - * has more information on the usage of the App Class. - * @class F2.App - * @constructor - * @param {F2.AppConfig} appConfig The F2.AppConfig object for the app - * @param {F2.AppManifest.AppContent} appContent The F2.AppManifest.AppContent - * object - * @param {Element} root The root DOM Element for the app - */ - App: function(appConfig, appContent, root) { - return { - /** - * An optional init function that will automatically be called when - * F2.{{#crossLink "F2\registerApps"}}{{/crossLink}} is called. - * @method init - * @optional - */ - init:function() {} +F2.extend('AppHandlers', (function() { + + // the hidden token that we will check against every time someone tries to add, remove, fire handler + var _ct = F2.guid(); + var _f2t = F2.guid(); + + var _handlerCollection = { + appCreateRoot: [], + appRenderBefore: [], + appReloadBefore: [], + appDestroyBefore: [], + appRenderAfter: [], + appReloadAfter: [], + appDestroyAfter: [], + appRender: [], + appReload: [], + appDestroy: [] + }; + + var _defaultMethods = { + appRenderBefore: function(appConfig, html) + { + // do nothing before an app is rendered + }, + appRender: function() + { + // do something + }, + appRenderAfter: function() + { + // do nothing after an app is rendered + }, + + appReloadBefore: function() + { + // do nothing before an app reloads + }, + appReload: function() + { + // re-request the app? + // re-add files? + // re init js ? + }, + appReloadAfter: function() + { + // do nothing after an app reloads + }, + + appDestroyBefore: function() + { + // do nothing before destroying app + }, + appDestroy: function() + { + // remove the app from the dom + }, + appDestroyAfter: function() + { + // do nothing after an app is destroyed + } + }; + + var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) + { + // will throw an exception and stop execution if the token is invalid + _validateToken(token); + + // create handler structure. Not all arguments properties will be populated/used. + var handler = { + func: (typeof(func_or_element)) ? func_or_element : null, + namespace: sNamespace, + domNode: (F2.isNativeDOMNode(func_or_element)) ? func_or_element : null }; - }, - /** - * The AppConfig object represents an app's meta data - * @class F2.AppConfig - */ - AppConfig: { - /** - * The unique ID of the app. More information can be found - * [here](../../app-development.html#f2-appid) - * @property appId - * @type string - * @required - */ - appId: "", + + if(!handler.func && !handler.domNode) + { + throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + } + + if(handler.domNode && !bDomNodeAppropriate) + { + throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); + } + + return handler; + }; + + var _validateToken = function(sToken) + { + // check token against F2 and Container + if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } + }; + + var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken) + { + // will throw an exception and stop execution if the token is invalid + _validateToken(sToken); + + if(!sNamespaceOrApp_ID && !arHandleCollection) + { + return; + } + else if(!sNamespaceOrApp_ID && arHandleCollection) + { + arHandleCollection = []; + } + else if(sNamespaceOrApp_ID && arHandleCollection) + { + sNamespaceOrApp_ID = sNamespaceOrApp_ID.toLowerCase(); + + var newEvents = []; + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + var currentHandler = arHandleCollection[i]; + if(currentHandler) + { + if(currentHandler.app_id != sNamespaceOrApp_ID && currentHandler.namespace != sNamespaceOrApp_ID) + { + newEvents.push(currentHandler); + } + } + } + + arHandleCollection = newEvents; + } + }; + + var _triggerEvent = function(arHandleCollection, arOriginalArgs) + { + // no errors here, basically there are no handlers to call + if(!arHandleCollection || !arHandleCollection.length) { return; } + + // there is always 1 argument required, the first arg should always be the token. + if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + + // will throw an exception and stop execution if the token is invalid + _validateToken(arOriginalArgs[0]); + + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + arHandleCollection[i].apply(F2, arguments); + } + }; + + return { /** - * An object that represents the context of an app - * @property context - * @type object - */ - context: {}, + * Allows container developer to retrieve a special token which must be passed to + * all On and Off methods. This function will self destruct so be sure to keep the response + * inside of a closure somewhere. + * @method getToken + **/ + getToken: function() + { + // delete this method for security that way only the container has access to the token 1 time. + // kind of James Bond-ish, this message will self destruct immediately. + delete this.getToken; + // return the token, which we validate against. + return _ct; + }, /** - * True if the app should be requested in a single request with other apps. - * @property enableBatchRequests - * @type bool - * @default false - */ - enableBatchRequests: false, + * Allows F2 to get a token internally + * @method __f2GetToken + * @private + **/ + __f2GetToken: function() + { + // delete this method for security that way only the F2 internally has access to the token 1 time. + // kind of James Bond-ish, this message will self destruct immediately. + delete this.__f2GetToken; + // return the token, which we validate against. + return _f2t; + }, /** - * The height of the app. The initial height will be pulled from - * the {{#crossLink "F2.AppConfig"}}{{/crossLink}} object, but later - * modified by calling - * F2.UI.{{#crossLink "F2.UI/updateHeight"}}{{/crossLink}}. This is used - * for secure apps to be able to set the initial height of the iframe. - * @property height - * @type int - */ - height: 0, + * Allows F2 to trigger specific app events internally. + * @method __trigger + * @private + **/ + __trigger: function(token, eventKey, appConfig, html) // additional arguments will likely be passed + { + // will throw an exception and stop execution if the token is invalid + _validateToken(token); + + if(_handlerCollection && _handlerCollection[eventKey]) + { + // create a collection of arguments that are safe to pass to the callback. + var passableArgs = []; + + // populate that collection with all arguments except token and eventKey + for(var i = 2, j = arguments.length; i < j; i++) + { + passableArgs.push(arguments[i]); + } + + if(_handlerCollection[eventKey].length == 0 && _defaultMethods[eventKey]) + { + _defaultMethods[eventKey].apply(F2, passableArgs); + return this; + } + else if(_handlerCollection[eventKey].length == 0 && !_handlerCollection[eventKey]) + { + return this; + } + + // fire all event listeners in the order that they were added. + for(var i = 0, j = _handlerCollection[eventKey].length; i < j; i++) + { + var handler = _handlerCollection[eventKey][i]; + + if (handler.domNode) + { + var $appRoot = jQuery(appConfig.root).append(html); + jQuery(handler.domNode).append($appRoot); + } + else + { + handler.func.apply(F2, passableArgs); + } + } + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, /** - * The unique runtime ID of the app. - * - * **This property is populated during the - * F2.{{#crossLink "F2/registerApps"}}{{/crossLink}} process** - * @property instanceId - * @type string - */ - instanceId: "", + * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {HTMLElement|Node} element Specific element to append your app to. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + **/ /** - * True if the app will be loaded in an iframe. This property - * will be true if the {{#crossLink "F2.AppConfig"}}{{/crossLink}} object - * sets isSecure = true. It will also be true if the - * [container](../../container-development.html) has made the decision to - * run apps in iframes. + * Allows you to add listener method that will be triggered when a specific event happens. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {Function} listener A function that will be triggered when a specific event happens. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + **/ + on: function(token, eventKey, func_or_element) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_handlerCollection && _handlerCollection[eventKey]) + { + _handlerCollection[eventKey].push( + _createHandler( + token, + sNamespace, + func_or_element, + (eventKey == "appRender") + ) + ); + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * Allows you to remove listener methods for specific events + * @method off + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @example + * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + **/ + off: function(token, eventKey) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_handlerCollection && _handlerCollection[eventKey]) + { + _removeHandler( + _handlerCollection[eventKey], + sNamespace, + token + ); + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * A collection of constants for the on/off method names. Basically just here to help you. + * @property {Object} CONSTANTS + **/ + CONSTANTS: + { + APP_CREATE_ROOT: "appCreateRoot", + + APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER: "appRender", + APP_RENDER_AFTER: "appRenderAfter", + + APP_RELOAD_BEFORE: "appReloadBefore", + APP_RELOAD: "appReload", + APP_RELOAD_AFTER: "appReloadAfter", + + APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY: "appDestroy", + APP_DESTROY_AFTER: "appDestroyAfter" + } + }; +})()); +/** + * Class stubs for documentation purposes + * @main F2 + */ +F2.extend("", { + /** + * The App Class is an optional class that can be namespaced onto the + * {{#crossLink "F2\Apps"}}{{/crossLink}} namespace. The + * [F2 Docs](../../app-development.html#app-class) + * has more information on the usage of the App Class. + * @class F2.App + * @constructor + * @param {F2.AppConfig} appConfig The F2.AppConfig object for the app + * @param {F2.AppManifest.AppContent} appContent The F2.AppManifest.AppContent + * object + * @param {Element} root The root DOM Element for the app + */ + App: function(appConfig, appContent, root) { + return { + /** + * An optional init function that will automatically be called when + * F2.{{#crossLink "F2\registerApps"}}{{/crossLink}} is called. + * @method init + * @optional + */ + init:function() {} + }; + }, + /** + * The AppConfig object represents an app's meta data + * @class F2.AppConfig + */ + AppConfig: { + /** + * The unique ID of the app. More information can be found + * [here](../../app-development.html#f2-appid) + * @property appId + * @type string + * @required + */ + appId: "", + /** + * An object that represents the context of an app + * @property context + * @type object + */ + context: {}, + /** + * True if the app should be requested in a single request with other apps. + * @property enableBatchRequests + * @type bool + * @default false + */ + enableBatchRequests: false, + /** + * The height of the app. The initial height will be pulled from + * the {{#crossLink "F2.AppConfig"}}{{/crossLink}} object, but later + * modified by calling + * F2.UI.{{#crossLink "F2.UI/updateHeight"}}{{/crossLink}}. This is used + * for secure apps to be able to set the initial height of the iframe. + * @property height + * @type int + */ + height: 0, + /** + * The unique runtime ID of the app. + * + * **This property is populated during the + * F2.{{#crossLink "F2/registerApps"}}{{/crossLink}} process** + * @property instanceId + * @type string + */ + instanceId: "", + /** + * True if the app will be loaded in an iframe. This property + * will be true if the {{#crossLink "F2.AppConfig"}}{{/crossLink}} object + * sets isSecure = true. It will also be true if the + * [container](../../container-development.html) has made the decision to + * run apps in iframes. * @property isSecure * @type bool * @default false @@ -2987,10 +3349,13 @@ F2.extend('', (function(){ var _apps = {}; var _config = false; + var _bUsesAppHandlers = false; + var _sAppHandlerToken = F2.AppHandlers.__f2GetToken(); /** * Appends the app's html to the DOM * @method _afterAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html @@ -3016,6 +3381,7 @@ F2.extend('', (function(){ /** * Renders the html for an app. * @method _appRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html @@ -3042,6 +3408,7 @@ F2.extend('', (function(){ * Rendering hook to allow containers to render some html prior to an app * loading * @method _beforeAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @return {Element} The DOM Element surrounding the app @@ -3181,8 +3548,56 @@ F2.extend('', (function(){ // load html jQuery.each(appManifest.apps, function(i, a) { - // load html and save the root node - appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); + if(!_bUsesAppHandlers) + { + // load html and save the root node + appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); + } + else + { + // if no app root is defined use the apps outter most node + if(!F2.isNativeDOMNode(appConfigs[i].root)) + { + appConfigs[i].root = jQuery(outerHtml(a.html)).get(0); + } + + var $root = jQuery(appConfigs[i].root); + + function outerHtml(html) { + return jQuery('
    ').append(html).html(); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + appConfigs[i], // the app config + outerHtml(a.html) + ); + + if($root.parents("body:first").length == 0) + { + throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + appConfigs[i] // the app config + ); + + if(!appConfigs[i].root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + if(!F2.isNativeDOMNode(appConfigs[i].root)) + { + throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + jQuery(appConfigs[i].root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); + } + // init events _initAppEvents(appConfigs[i]); }); @@ -3234,8 +3649,46 @@ F2.extend('', (function(){ // make sure the container is configured for secure apps if (_config.secureAppPagePath) { - // create the html container for the iframe - appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '
    ')); + if(!_bUsesAppHandlers) + { + // create the html container for the iframe + appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '
    ')); + } + else + { + var $root = jQuery(appConfig.root); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + appConfig, // the app config + appManifest.html + ); + + if($root.parents("body:first").length == 0) + { + throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + appConfig // the app config + ); + + if(!appConfig.root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + if(!F2.isNativeDOMNode(appConfig.root)) + { + throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + jQuery(appConfig.root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId); + } + // instantiate F2.UI appConfig.ui = new F2.UI(appConfig); // init events @@ -3292,7 +3745,11 @@ F2.extend('', (function(){ */ init: function(config) { _config = config || {}; - + + // dictates whether we use the old logic or the new logic. + // TODO: Remove in v2.0 + _bUsesAppHandlers = (!_config.beforeAppRender && !_config.appRender && !_config.afterAppRender); + // only establish RPC connection if the container supports the secure app page if (!!_config.secureAppPagePath || _config.isSecureAppPage) { F2.Rpc.init(!!_config.secureAppPagePath ? _config.secureAppPagePath : false); @@ -3364,10 +3821,31 @@ F2.extend('', (function(){ // add properties and methods _hydrateAppConfig(a); - - // fire beforeAppRender - a.root = _beforeAppRender(a); - + + // create just a generic div. To squash the jQuery dependency we will turn + // app.root will only be a dom node + a.root = null; + + if(!_bUsesAppHandlers) + { + // fire beforeAppRender + a.root = _beforeAppRender(a); + } + else + { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + a // the app config + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + a // the app config + ); + } + // save app _apps[a.instanceId] = { config:a }; @@ -3484,331 +3962,6 @@ F2.extend('', (function(){ } }; })()); -/** - * Allows container developers more flexibility when it comes to handling app interaction. - * @class F2.AppHandlers - */ -F2.extend('AppHandlers', (function() { - - // the hidden token that we will check against every time someone tries to add, remove, fire handler - var _ct = F2.guid(); - var _f2t = F2.guid(); - - var _handlerCollection = { - beforeApp: - { - render: [], - reload: [], - destroy: [] - }, - afterApp: - { - render: [], - reload: [], - destroy: [] - }, - app: - { - render: [], - reload: [], - destroy: [] - } - }; - - var _offMethods = { - appRenderBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - appRender: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - appRenderAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, - - appReloadBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - appReload: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - appReloadAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, - - appDestroyBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }, - appDestroy: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }, - appDestroyAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } - }; - - var _onMethods = { - appRenderBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, - appRender: function(token, sNamespace, func_or_element) { _handlerCollection.app.render.push(_createHandler(token, sNamespace, func_or_element, true)); }, - appRenderAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, - - appReloadBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - appReload: function(token, sNamespace, func_or_element) { _handlerCollection.app.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - appReloadAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - - appDestroyBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, - appDestroy: function(token, sNamespace, func_or_element) { _handlerCollection.app.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, - appDestroyAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); } - }; - - //Returns true if it is a DOM node - function _isNode(o){ - return ( - typeof Node === "object" ? o instanceof Node : - o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" - ); - } - - //Returns true if it is a DOM element - function _isElement(o){ - return ( - typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 - o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string" - ); - } - - var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) - { - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } - - // will throw an exception and stop execution if the token is invalid - _validateToken(arOriginalArgs[0]); - - // remove the token from the arguments since we have validated it and no longer need it - arOriginalArgs.shift(); - - var iArgCount = arOriginalArgs.length; - - // create handler structure. Not all arguments properties will be populated/used. - var handler = { - func: (typeof(func_or_element)) ? func_or_element : null, - namespace: sNamespace, - domNode: (_isNode(func_or_element) || _isElement(func_or_element)) ? func_or_element : null - }; - - if(!handler.func && !handler.domNode) - { - throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); - } - - if(handler.domNode && !bDomNodeAppropriate) - { - throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); - } - - return handler; - }; - - var _validateToken = function(sToken) - { - // check token against F2 and Container - if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } - }; - - var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken) - { - // will throw an exception and stop execution if the token is invalid - _validateToken(sToken); - - if(!sNamespaceOrApp_ID && !arHandleCollection) - { - return; - } - else if(!sNamespaceOrApp_ID && arHandleCollection) - { - arHandleCollection = []; - } - else if(sNamespaceOrApp_ID && arHandleCollection) - { - sNamespaceOrApp_ID = sNamespaceOrApp_ID.toLowerCase(); - - var newEvents = []; - - for(var i = 0, j = arHandleCollection.length; i < j; i++) - { - var currentHandler = arHandleCollection[i]; - if(currentHandler) - { - if(currentHandler.app_id != sNamespaceOrApp_ID && currentHandler.namespace != sNamespaceOrApp_ID) - { - newEvents.push(currentHandler); - } - } - } - - arHandleCollection = newEvents; - } - }; - - var _triggerEvent = function(arHandleCollection, arOriginalArgs) - { - // no errors here, basically there are no handlers to call - if(!arHandleCollection || !arHandleCollection.length) { return; } - - // there is always 1 argument required, the first arg should always be the token. - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } - - // will throw an exception and stop execution if the token is invalid - _validateToken(arOriginalArgs[0]); - - // remove the token from the arguments since we have validated it and no longer need it - arOriginalArgs.shift(); - - for(var i = 0, j = arHandleCollection.length; i < j; i++) - { - arHandleCollection[i].apply(F2, arguments); - } - }; - - return { - /** - * Allows container developer to retrieve a special token which must be passed to - * all On and Off methods. This function will self destruct so be sure to keep the response - * inside of a closure somewhere. - * @method getToken - **/ - getToken: function() - { - // delete this method for security that way only the container has access to the token 1 time. - // kind of James Bond-ish, this message will self destruct immediately. - delete this.getToken; - // return the token, which we validate against. - return _ct; - }, - /** - * Allows F2 to get a token internally - * @method __f2GetToken - * @private - **/ - __f2GetToken: function() - { - // delete this method for security that way only the F2 internally has access to the token 1 time. - // kind of James Bond-ish, this message will self destruct immediately. - delete this.__f2GetToken; - // return the token, which we validate against. - return _f2t; - }, - /** - * Allows F2 to trigger specific app events internally. - * @method __f2Trigger - * @private - **/ - __f2Trigger: function(token, eventKey) // additional arguments will likely be passed - { - var sNamespace = null; - - // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) - { - var arData = eventKey.split("."); - eventKey = arData[0]; - sNamespace = arData[1]; - } - - if(_onMethods && _onMethods[eventKey]) - { - for(var i = 0, j = _onMethods[eventKey]; i < j; i++) - { - var handler = _onMethods[eventKey][i]; - - _onMethods[eventKey][i].apply(F2, [token, sNamespace, func_or_element]) - } - } - else - { - throw ("Invalid EventKey passed. Check your inputs and try again.") - } - - return this; - }, - /** - * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. - * @method on - * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. - * @params {HTMLElement|Node} element Specific element to append your app to. - * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); - **/ - /** - * Allows you to add listener method that will be triggered when a specific event happens. - * @method on - * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. - * @params {Function} listener A function that will be triggered when a specific event happens. - * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); - **/ - on: function(token, eventKey, func_or_element) - { - var sNamespace = null; - - // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) - { - var arData = eventKey.split("."); - eventKey = arData[0]; - sNamespace = arData[1]; - } - - if(_onMethods && _onMethods[eventKey]) - { - _onMethods[eventKey].apply(F2, [token, sNamespace, func_or_element]) - } - else - { - throw ("Invalid EventKey passed. Check your inputs and try again.") - } - - return this; - }, - /** - * Allows you to remove listener methods for specific events - * @method off - * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. - * @example - * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); - **/ - off: function(token, eventKey) - { - var sNamespace = null; - - // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) - { - var arData = eventKey.split("."); - eventKey = arData[0]; - sNamespace = arData[1]; - } - - if(_offMethods && _offMethods[eventKey]) - { - _offMethods[eventKey].apply(F2, [token, sNamespace]) - } - else - { - throw ("Invalid EventKey passed. Check your inputs and try again.") - } - - return this; - }, - /** - * A collection of constants for the on/off method names. Basically just here to help you. - * @property {Object} CONSTANTS - **/ - CONSTANTS: - { - APP_RENDER_BEFORE: "appRenderBefore", - APP_RENDER: "appRender", - APP_RENDER_AFTER: "appRenderAfter", - - APP_RELOAD_BEFORE: "appReloadBefore", - APP_RELOAD: "appReload", - APP_RELOAD_AFTER: "appReloadAfter", - - APP_DESTROY_BEFORE: "appDestroyBefore", - APP_DESTROY: "appDestroy", - APP_DESTROY_AFTER: "appDestroyAfter" - } - }; -})()); exports.F2 = F2; diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 64e5d37e..0ab3ad6a 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -114,14 +114,14 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; +;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},isNativeDOMNode:function(e){var t=typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",n=typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string";return t||n},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; +F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appReloadBefore:[],appDestroyBefore:[],appRenderAfter:[],appReloadAfter:[],appDestroyAfter:[],appRender:[],appReload:[],appDestroy:[]},r={appRenderBefore:function(e,t){},appRender:function(){},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(){},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,n){s(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,o=e.length;i-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(n[t],r,e),this},CONSTANTS:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_RELOAD_BEFORE:"appReloadBefore",APP_RELOAD:"appReload",APP_RELOAD_AFTER:"appReloadAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}()); F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},secureAppPagePath:"",supportedViews:[]}}); F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); -F2.extend("AppHandlers",function(){function s(e){return typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function o(e){return typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string"}var e=F2.guid(),t=F2.guid(),n={beforeApp:{render:[],reload:[],destroy:[]},afterApp:{render:[],reload:[],destroy:[]},app:{render:[],reload:[],destroy:[]}},r={appRenderBefore:function(e,t){f(n.beforeApp.render,t,e)},appRender:function(e,t){f(n.app.render,t,e)},appRenderAfter:function(e,t){f(n.afterApp.render,t,e)},appReloadBefore:function(e,t){f(n.beforeApp.reload,t,e)},appReload:function(e,t){f(n.app.reload,t,e)},appReloadAfter:function(e,t){f(n.afterApp.reload,t,e)},appDestroyBefore:function(e,t){f(n.beforeApp.destroy,t,e)},appDestroy:function(e,t){f(n.app.destroy,t,e)},appDestroyAfter:function(e,t){f(n.afterApp.destroy,t,e)}},i={appRenderBefore:function(e,t,r){n.beforeApp.render.push(u(e,t,r))},appRender:function(e,t,r){n.app.render.push(u(e,t,r,!0))},appRenderAfter:function(e,t,r){n.afterApp.render.push(u(e,t,r))},appReloadBefore:function(e,t,r){n.beforeApp.reload.push(u(e,t,r))},appReload:function(e,t,r){n.app.reload.push(u(e,t,r))},appReloadAfter:function(e,t,r){n.afterApp.reload.push(u(e,t,r))},appDestroyBefore:function(e,t,r){n.beforeApp.destroy.push(u(e,t,r))},appDestroy:function(e,t,r){n.app.destroy.push(u(e,t,r))},appDestroyAfter:function(e,t,r){n.afterApp.destroy.push(u(e,t,r))}},u=function(e,t,n,r){if(!arOriginalArgs||!arOriginalArgs.length)throw"Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again.";a(arOriginalArgs[0]),arOriginalArgs.shift();var i=arOriginalArgs.length,u={func:typeof n?n:null,namespace:t,domNode:s(n)||o(n)?n:null};if(!u.func&&!u.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(u.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return u},a=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},f=function(e,t,n){a(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,s=e.length;i-1){var r=t.split(".");t=r[0],n=r[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";for(var s=0,o=i[t];s-1){var s=t.split(".");t=s[0],r=s[1]}if(!i||!i[t])throw"Invalid EventKey passed. Check your inputs and try again.";return i[t].apply(F2,[e,r,n]),this},off:function(e,t){var n=null;if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],n=i[1]}if(!r||!r[t])throw"Invalid EventKey passed. Check your inputs and try again.";return r[t].apply(F2,[e,n]),this},CONSTANTS:{APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_RELOAD_BEFORE:"appReloadBefore",APP_RELOAD:"appReload",APP_RELOAD_AFTER:"appReloadAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}()); +F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{F2.isNativeDOMNode(appConfigs[e].root)||(appConfigs[e].root=jQuery(r(t.html)).get(0));var n=jQuery(appConfigs[e].root);function r(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER,appConfigs[e],r(t.html));if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER,appConfigs[e]);if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(appConfigs[e].root).addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); exports.F2 = F2; diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index e359dfbf..09dd011c 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -145,6 +145,25 @@ F2 = { inArray: function(value, array) { return jQuery.inArray(value, array) > -1; }, + /** + * Utility method to determine whether or not the argument passed in is or is not a native dom node. + * @method isNativeDOMNode + * @param {object} testObject The object you want to check as native dom node. + * @return {bool} Returns true if the object passed is a native dom node. + */ + isNativeDOMNode: function(testObject) { + var bIsNode = ( + typeof Node === "object" ? testObject instanceof Node : + testObject && typeof testObject === "object" && typeof testObject.nodeType === "number" && typeof testObject.nodeName ==="string" + ); + + var bIsElement = ( + typeof HTMLElement === "object" ? testObject instanceof HTMLElement : //DOM2 + testObject && typeof testObject === "object" && testObject.nodeType === 1 && typeof testObject.nodeName ==="string" + ); + + return (bIsNode || bIsElement); + }, /** * Wrapper logging function. * @method log @@ -196,84 +215,427 @@ F2 = { /** - * Class stubs for documentation purposes - * @main F2 + * Allows container developers more flexibility when it comes to handling app interaction. + * @class F2.AppHandlers */ -F2.extend("", { - /** - * The App Class is an optional class that can be namespaced onto the - * {{#crossLink "F2\Apps"}}{{/crossLink}} namespace. The - * [F2 Docs](../../app-development.html#app-class) - * has more information on the usage of the App Class. - * @class F2.App - * @constructor - * @param {F2.AppConfig} appConfig The F2.AppConfig object for the app - * @param {F2.AppManifest.AppContent} appContent The F2.AppManifest.AppContent - * object - * @param {Element} root The root DOM Element for the app - */ - App: function(appConfig, appContent, root) { - return { - /** - * An optional init function that will automatically be called when - * F2.{{#crossLink "F2\registerApps"}}{{/crossLink}} is called. - * @method init - * @optional - */ - init:function() {} +F2.extend('AppHandlers', (function() { + + // the hidden token that we will check against every time someone tries to add, remove, fire handler + var _ct = F2.guid(); + var _f2t = F2.guid(); + + var _handlerCollection = { + appCreateRoot: [], + appRenderBefore: [], + appReloadBefore: [], + appDestroyBefore: [], + appRenderAfter: [], + appReloadAfter: [], + appDestroyAfter: [], + appRender: [], + appReload: [], + appDestroy: [] + }; + + var _defaultMethods = { + appRenderBefore: function(appConfig, html) + { + // do nothing before an app is rendered + }, + appRender: function() + { + // do something + }, + appRenderAfter: function() + { + // do nothing after an app is rendered + }, + + appReloadBefore: function() + { + // do nothing before an app reloads + }, + appReload: function() + { + // re-request the app? + // re-add files? + // re init js ? + }, + appReloadAfter: function() + { + // do nothing after an app reloads + }, + + appDestroyBefore: function() + { + // do nothing before destroying app + }, + appDestroy: function() + { + // remove the app from the dom + }, + appDestroyAfter: function() + { + // do nothing after an app is destroyed + } + }; + + var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) + { + // will throw an exception and stop execution if the token is invalid + _validateToken(token); + + // create handler structure. Not all arguments properties will be populated/used. + var handler = { + func: (typeof(func_or_element)) ? func_or_element : null, + namespace: sNamespace, + domNode: (F2.isNativeDOMNode(func_or_element)) ? func_or_element : null }; - }, - /** - * The AppConfig object represents an app's meta data - * @class F2.AppConfig - */ - AppConfig: { - /** - * The unique ID of the app. More information can be found - * [here](../../app-development.html#f2-appid) - * @property appId - * @type string - * @required - */ - appId: "", + + if(!handler.func && !handler.domNode) + { + throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + } + + if(handler.domNode && !bDomNodeAppropriate) + { + throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); + } + + return handler; + }; + + var _validateToken = function(sToken) + { + // check token against F2 and Container + if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } + }; + + var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken) + { + // will throw an exception and stop execution if the token is invalid + _validateToken(sToken); + + if(!sNamespaceOrApp_ID && !arHandleCollection) + { + return; + } + else if(!sNamespaceOrApp_ID && arHandleCollection) + { + arHandleCollection = []; + } + else if(sNamespaceOrApp_ID && arHandleCollection) + { + sNamespaceOrApp_ID = sNamespaceOrApp_ID.toLowerCase(); + + var newEvents = []; + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + var currentHandler = arHandleCollection[i]; + if(currentHandler) + { + if(currentHandler.app_id != sNamespaceOrApp_ID && currentHandler.namespace != sNamespaceOrApp_ID) + { + newEvents.push(currentHandler); + } + } + } + + arHandleCollection = newEvents; + } + }; + + var _triggerEvent = function(arHandleCollection, arOriginalArgs) + { + // no errors here, basically there are no handlers to call + if(!arHandleCollection || !arHandleCollection.length) { return; } + + // there is always 1 argument required, the first arg should always be the token. + if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + + // will throw an exception and stop execution if the token is invalid + _validateToken(arOriginalArgs[0]); + + // remove the token from the arguments since we have validated it and no longer need it + arOriginalArgs.shift(); + + for(var i = 0, j = arHandleCollection.length; i < j; i++) + { + arHandleCollection[i].apply(F2, arguments); + } + }; + + return { /** - * An object that represents the context of an app - * @property context - * @type object - */ - context: {}, + * Allows container developer to retrieve a special token which must be passed to + * all On and Off methods. This function will self destruct so be sure to keep the response + * inside of a closure somewhere. + * @method getToken + **/ + getToken: function() + { + // delete this method for security that way only the container has access to the token 1 time. + // kind of James Bond-ish, this message will self destruct immediately. + delete this.getToken; + // return the token, which we validate against. + return _ct; + }, /** - * True if the app should be requested in a single request with other apps. - * @property enableBatchRequests - * @type bool - * @default false - */ - enableBatchRequests: false, + * Allows F2 to get a token internally + * @method __f2GetToken + * @private + **/ + __f2GetToken: function() + { + // delete this method for security that way only the F2 internally has access to the token 1 time. + // kind of James Bond-ish, this message will self destruct immediately. + delete this.__f2GetToken; + // return the token, which we validate against. + return _f2t; + }, /** - * The height of the app. The initial height will be pulled from - * the {{#crossLink "F2.AppConfig"}}{{/crossLink}} object, but later - * modified by calling - * F2.UI.{{#crossLink "F2.UI/updateHeight"}}{{/crossLink}}. This is used - * for secure apps to be able to set the initial height of the iframe. - * @property height - * @type int - */ - height: 0, + * Allows F2 to trigger specific app events internally. + * @method __trigger + * @private + **/ + __trigger: function(token, eventKey, appConfig, html) // additional arguments will likely be passed + { + // will throw an exception and stop execution if the token is invalid + _validateToken(token); + + if(_handlerCollection && _handlerCollection[eventKey]) + { + // create a collection of arguments that are safe to pass to the callback. + var passableArgs = []; + + // populate that collection with all arguments except token and eventKey + for(var i = 2, j = arguments.length; i < j; i++) + { + passableArgs.push(arguments[i]); + } + + if(_handlerCollection[eventKey].length == 0 && _defaultMethods[eventKey]) + { + _defaultMethods[eventKey].apply(F2, passableArgs); + return this; + } + else if(_handlerCollection[eventKey].length == 0 && !_handlerCollection[eventKey]) + { + return this; + } + + // fire all event listeners in the order that they were added. + for(var i = 0, j = _handlerCollection[eventKey].length; i < j; i++) + { + var handler = _handlerCollection[eventKey][i]; + + if (handler.domNode) + { + var $appRoot = jQuery(appConfig.root).append(html); + jQuery(handler.domNode).append($appRoot); + } + else + { + handler.func.apply(F2, passableArgs); + } + } + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, /** - * The unique runtime ID of the app. - * - * **This property is populated during the - * F2.{{#crossLink "F2/registerApps"}}{{/crossLink}} process** - * @property instanceId - * @type string - */ - instanceId: "", + * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {HTMLElement|Node} element Specific element to append your app to. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + **/ /** - * True if the app will be loaded in an iframe. This property - * will be true if the {{#crossLink "F2.AppConfig"}}{{/crossLink}} object - * sets isSecure = true. It will also be true if the - * [container](../../container-development.html) has made the decision to - * run apps in iframes. + * Allows you to add listener method that will be triggered when a specific event happens. + * @method on + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @params {Function} listener A function that will be triggered when a specific event happens. + * @example + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + **/ + on: function(token, eventKey, func_or_element) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_handlerCollection && _handlerCollection[eventKey]) + { + _handlerCollection[eventKey].push( + _createHandler( + token, + sNamespace, + func_or_element, + (eventKey == "appRender") + ) + ); + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * Allows you to remove listener methods for specific events + * @method off + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @example + * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + **/ + off: function(token, eventKey) + { + var sNamespace = null; + + // we need to check the key for a namespace + if(eventKey.indexOf(".") > -1) + { + var arData = eventKey.split("."); + eventKey = arData[0]; + sNamespace = arData[1]; + } + + if(_handlerCollection && _handlerCollection[eventKey]) + { + _removeHandler( + _handlerCollection[eventKey], + sNamespace, + token + ); + } + else + { + throw ("Invalid EventKey passed. Check your inputs and try again.") + } + + return this; + }, + /** + * A collection of constants for the on/off method names. Basically just here to help you. + * @property {Object} CONSTANTS + **/ + CONSTANTS: + { + APP_CREATE_ROOT: "appCreateRoot", + + APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER: "appRender", + APP_RENDER_AFTER: "appRenderAfter", + + APP_RELOAD_BEFORE: "appReloadBefore", + APP_RELOAD: "appReload", + APP_RELOAD_AFTER: "appReloadAfter", + + APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY: "appDestroy", + APP_DESTROY_AFTER: "appDestroyAfter" + } + }; +})()); +/** + * Class stubs for documentation purposes + * @main F2 + */ +F2.extend("", { + /** + * The App Class is an optional class that can be namespaced onto the + * {{#crossLink "F2\Apps"}}{{/crossLink}} namespace. The + * [F2 Docs](../../app-development.html#app-class) + * has more information on the usage of the App Class. + * @class F2.App + * @constructor + * @param {F2.AppConfig} appConfig The F2.AppConfig object for the app + * @param {F2.AppManifest.AppContent} appContent The F2.AppManifest.AppContent + * object + * @param {Element} root The root DOM Element for the app + */ + App: function(appConfig, appContent, root) { + return { + /** + * An optional init function that will automatically be called when + * F2.{{#crossLink "F2\registerApps"}}{{/crossLink}} is called. + * @method init + * @optional + */ + init:function() {} + }; + }, + /** + * The AppConfig object represents an app's meta data + * @class F2.AppConfig + */ + AppConfig: { + /** + * The unique ID of the app. More information can be found + * [here](../../app-development.html#f2-appid) + * @property appId + * @type string + * @required + */ + appId: "", + /** + * An object that represents the context of an app + * @property context + * @type object + */ + context: {}, + /** + * True if the app should be requested in a single request with other apps. + * @property enableBatchRequests + * @type bool + * @default false + */ + enableBatchRequests: false, + /** + * The height of the app. The initial height will be pulled from + * the {{#crossLink "F2.AppConfig"}}{{/crossLink}} object, but later + * modified by calling + * F2.UI.{{#crossLink "F2.UI/updateHeight"}}{{/crossLink}}. This is used + * for secure apps to be able to set the initial height of the iframe. + * @property height + * @type int + */ + height: 0, + /** + * The unique runtime ID of the app. + * + * **This property is populated during the + * F2.{{#crossLink "F2/registerApps"}}{{/crossLink}} process** + * @property instanceId + * @type string + */ + instanceId: "", + /** + * True if the app will be loaded in an iframe. This property + * will be true if the {{#crossLink "F2.AppConfig"}}{{/crossLink}} object + * sets isSecure = true. It will also be true if the + * [container](../../container-development.html) has made the decision to + * run apps in iframes. * @property isSecure * @type bool * @default false @@ -1653,10 +2015,13 @@ F2.extend('', (function(){ var _apps = {}; var _config = false; + var _bUsesAppHandlers = false; + var _sAppHandlerToken = F2.AppHandlers.__f2GetToken(); /** * Appends the app's html to the DOM * @method _afterAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html @@ -1682,6 +2047,7 @@ F2.extend('', (function(){ /** * Renders the html for an app. * @method _appRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html @@ -1708,6 +2074,7 @@ F2.extend('', (function(){ * Rendering hook to allow containers to render some html prior to an app * loading * @method _beforeAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @return {Element} The DOM Element surrounding the app @@ -1847,8 +2214,56 @@ F2.extend('', (function(){ // load html jQuery.each(appManifest.apps, function(i, a) { - // load html and save the root node - appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); + if(!_bUsesAppHandlers) + { + // load html and save the root node + appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); + } + else + { + // if no app root is defined use the apps outter most node + if(!F2.isNativeDOMNode(appConfigs[i].root)) + { + appConfigs[i].root = jQuery(outerHtml(a.html)).get(0); + } + + var $root = jQuery(appConfigs[i].root); + + function outerHtml(html) { + return jQuery('
    ').append(html).html(); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + appConfigs[i], // the app config + outerHtml(a.html) + ); + + if($root.parents("body:first").length == 0) + { + throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + appConfigs[i] // the app config + ); + + if(!appConfigs[i].root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + if(!F2.isNativeDOMNode(appConfigs[i].root)) + { + throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + jQuery(appConfigs[i].root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); + } + // init events _initAppEvents(appConfigs[i]); }); @@ -1900,8 +2315,46 @@ F2.extend('', (function(){ // make sure the container is configured for secure apps if (_config.secureAppPagePath) { - // create the html container for the iframe - appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '
    ')); + if(!_bUsesAppHandlers) + { + // create the html container for the iframe + appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '
    ')); + } + else + { + var $root = jQuery(appConfig.root); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + appConfig, // the app config + appManifest.html + ); + + if($root.parents("body:first").length == 0) + { + throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + appConfig // the app config + ); + + if(!appConfig.root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + if(!F2.isNativeDOMNode(appConfig.root)) + { + throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + jQuery(appConfig.root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId); + } + // instantiate F2.UI appConfig.ui = new F2.UI(appConfig); // init events @@ -1958,7 +2411,11 @@ F2.extend('', (function(){ */ init: function(config) { _config = config || {}; - + + // dictates whether we use the old logic or the new logic. + // TODO: Remove in v2.0 + _bUsesAppHandlers = (!_config.beforeAppRender && !_config.appRender && !_config.afterAppRender); + // only establish RPC connection if the container supports the secure app page if (!!_config.secureAppPagePath || _config.isSecureAppPage) { F2.Rpc.init(!!_config.secureAppPagePath ? _config.secureAppPagePath : false); @@ -2030,10 +2487,31 @@ F2.extend('', (function(){ // add properties and methods _hydrateAppConfig(a); - - // fire beforeAppRender - a.root = _beforeAppRender(a); - + + // create just a generic div. To squash the jQuery dependency we will turn + // app.root will only be a dom node + a.root = null; + + if(!_bUsesAppHandlers) + { + // fire beforeAppRender + a.root = _beforeAppRender(a); + } + else + { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + a // the app config + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + a // the app config + ); + } + // save app _apps[a.instanceId] = { config:a }; @@ -2150,331 +2628,6 @@ F2.extend('', (function(){ } }; })()); -/** - * Allows container developers more flexibility when it comes to handling app interaction. - * @class F2.AppHandlers - */ -F2.extend('AppHandlers', (function() { - - // the hidden token that we will check against every time someone tries to add, remove, fire handler - var _ct = F2.guid(); - var _f2t = F2.guid(); - - var _handlerCollection = { - beforeApp: - { - render: [], - reload: [], - destroy: [] - }, - afterApp: - { - render: [], - reload: [], - destroy: [] - }, - app: - { - render: [], - reload: [], - destroy: [] - } - }; - - var _offMethods = { - appRenderBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - appRender: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - appRenderAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, - - appReloadBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - appReload: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - appReloadAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, - - appDestroyBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }, - appDestroy: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }, - appDestroyAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } - }; - - var _onMethods = { - appRenderBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, - appRender: function(token, sNamespace, func_or_element) { _handlerCollection.app.render.push(_createHandler(token, sNamespace, func_or_element, true)); }, - appRenderAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, - - appReloadBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - appReload: function(token, sNamespace, func_or_element) { _handlerCollection.app.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - appReloadAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - - appDestroyBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, - appDestroy: function(token, sNamespace, func_or_element) { _handlerCollection.app.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, - appDestroyAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); } - }; - - //Returns true if it is a DOM node - function _isNode(o){ - return ( - typeof Node === "object" ? o instanceof Node : - o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" - ); - } - - //Returns true if it is a DOM element - function _isElement(o){ - return ( - typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 - o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string" - ); - } - - var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) - { - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } - - // will throw an exception and stop execution if the token is invalid - _validateToken(arOriginalArgs[0]); - - // remove the token from the arguments since we have validated it and no longer need it - arOriginalArgs.shift(); - - var iArgCount = arOriginalArgs.length; - - // create handler structure. Not all arguments properties will be populated/used. - var handler = { - func: (typeof(func_or_element)) ? func_or_element : null, - namespace: sNamespace, - domNode: (_isNode(func_or_element) || _isElement(func_or_element)) ? func_or_element : null - }; - - if(!handler.func && !handler.domNode) - { - throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); - } - - if(handler.domNode && !bDomNodeAppropriate) - { - throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); - } - - return handler; - }; - - var _validateToken = function(sToken) - { - // check token against F2 and Container - if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } - }; - - var _removeHandler = function(arHandleCollection, sNamespaceOrApp_ID, sToken) - { - // will throw an exception and stop execution if the token is invalid - _validateToken(sToken); - - if(!sNamespaceOrApp_ID && !arHandleCollection) - { - return; - } - else if(!sNamespaceOrApp_ID && arHandleCollection) - { - arHandleCollection = []; - } - else if(sNamespaceOrApp_ID && arHandleCollection) - { - sNamespaceOrApp_ID = sNamespaceOrApp_ID.toLowerCase(); - - var newEvents = []; - - for(var i = 0, j = arHandleCollection.length; i < j; i++) - { - var currentHandler = arHandleCollection[i]; - if(currentHandler) - { - if(currentHandler.app_id != sNamespaceOrApp_ID && currentHandler.namespace != sNamespaceOrApp_ID) - { - newEvents.push(currentHandler); - } - } - } - - arHandleCollection = newEvents; - } - }; - - var _triggerEvent = function(arHandleCollection, arOriginalArgs) - { - // no errors here, basically there are no handlers to call - if(!arHandleCollection || !arHandleCollection.length) { return; } - - // there is always 1 argument required, the first arg should always be the token. - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } - - // will throw an exception and stop execution if the token is invalid - _validateToken(arOriginalArgs[0]); - - // remove the token from the arguments since we have validated it and no longer need it - arOriginalArgs.shift(); - - for(var i = 0, j = arHandleCollection.length; i < j; i++) - { - arHandleCollection[i].apply(F2, arguments); - } - }; - - return { - /** - * Allows container developer to retrieve a special token which must be passed to - * all On and Off methods. This function will self destruct so be sure to keep the response - * inside of a closure somewhere. - * @method getToken - **/ - getToken: function() - { - // delete this method for security that way only the container has access to the token 1 time. - // kind of James Bond-ish, this message will self destruct immediately. - delete this.getToken; - // return the token, which we validate against. - return _ct; - }, - /** - * Allows F2 to get a token internally - * @method __f2GetToken - * @private - **/ - __f2GetToken: function() - { - // delete this method for security that way only the F2 internally has access to the token 1 time. - // kind of James Bond-ish, this message will self destruct immediately. - delete this.__f2GetToken; - // return the token, which we validate against. - return _f2t; - }, - /** - * Allows F2 to trigger specific app events internally. - * @method __f2Trigger - * @private - **/ - __f2Trigger: function(token, eventKey) // additional arguments will likely be passed - { - var sNamespace = null; - - // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) - { - var arData = eventKey.split("."); - eventKey = arData[0]; - sNamespace = arData[1]; - } - - if(_onMethods && _onMethods[eventKey]) - { - for(var i = 0, j = _onMethods[eventKey]; i < j; i++) - { - var handler = _onMethods[eventKey][i]; - - _onMethods[eventKey][i].apply(F2, [token, sNamespace, func_or_element]) - } - } - else - { - throw ("Invalid EventKey passed. Check your inputs and try again.") - } - - return this; - }, - /** - * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. - * @method on - * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. - * @params {HTMLElement|Node} element Specific element to append your app to. - * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); - **/ - /** - * Allows you to add listener method that will be triggered when a specific event happens. - * @method on - * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. - * @params {Function} listener A function that will be triggered when a specific event happens. - * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); - **/ - on: function(token, eventKey, func_or_element) - { - var sNamespace = null; - - // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) - { - var arData = eventKey.split("."); - eventKey = arData[0]; - sNamespace = arData[1]; - } - - if(_onMethods && _onMethods[eventKey]) - { - _onMethods[eventKey].apply(F2, [token, sNamespace, func_or_element]) - } - else - { - throw ("Invalid EventKey passed. Check your inputs and try again.") - } - - return this; - }, - /** - * Allows you to remove listener methods for specific events - * @method off - * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. - * @example - * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); - **/ - off: function(token, eventKey) - { - var sNamespace = null; - - // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) - { - var arData = eventKey.split("."); - eventKey = arData[0]; - sNamespace = arData[1]; - } - - if(_offMethods && _offMethods[eventKey]) - { - _offMethods[eventKey].apply(F2, [token, sNamespace]) - } - else - { - throw ("Invalid EventKey passed. Check your inputs and try again.") - } - - return this; - }, - /** - * A collection of constants for the on/off method names. Basically just here to help you. - * @property {Object} CONSTANTS - **/ - CONSTANTS: - { - APP_RENDER_BEFORE: "appRenderBefore", - APP_RENDER: "appRender", - APP_RENDER_AFTER: "appRenderAfter", - - APP_RELOAD_BEFORE: "appReloadBefore", - APP_RELOAD: "appReload", - APP_RELOAD_AFTER: "appReloadAfter", - - APP_DESTROY_BEFORE: "appDestroyBefore", - APP_DESTROY: "appDestroy", - APP_DESTROY_AFTER: "appDestroyAfter" - } - }; -})()); exports.F2 = F2; diff --git a/sdk/src/F2.js b/sdk/src/F2.js index c37405a3..2bf04bae 100644 --- a/sdk/src/F2.js +++ b/sdk/src/F2.js @@ -139,6 +139,25 @@ F2 = { inArray: function(value, array) { return jQuery.inArray(value, array) > -1; }, + /** + * Utility method to determine whether or not the argument passed in is or is not a native dom node. + * @method isNativeDOMNode + * @param {object} testObject The object you want to check as native dom node. + * @return {bool} Returns true if the object passed is a native dom node. + */ + isNativeDOMNode: function(testObject) { + var bIsNode = ( + typeof Node === "object" ? testObject instanceof Node : + testObject && typeof testObject === "object" && typeof testObject.nodeType === "number" && typeof testObject.nodeName ==="string" + ); + + var bIsElement = ( + typeof HTMLElement === "object" ? testObject instanceof HTMLElement : //DOM2 + testObject && typeof testObject === "object" && testObject.nodeType === 1 && typeof testObject.nodeName ==="string" + ); + + return (bIsNode || bIsElement); + }, /** * Wrapper logging function. * @method log diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index 2c6498f5..fbec8f05 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -8,88 +8,72 @@ F2.extend('AppHandlers', (function() { var _ct = F2.guid(); var _f2t = F2.guid(); - var _handlerCollection = { - beforeApp: + var _handlerCollection = { + appCreateRoot: [], + appRenderBefore: [], + appReloadBefore: [], + appDestroyBefore: [], + appRenderAfter: [], + appReloadAfter: [], + appDestroyAfter: [], + appRender: [], + appReload: [], + appDestroy: [] + }; + + var _defaultMethods = { + appRenderBefore: function(appConfig, html) { - render: [], - reload: [], - destroy: [] + // do nothing before an app is rendered }, - afterApp: + appRender: function() { - render: [], - reload: [], - destroy: [] + // do something }, - app: + appRenderAfter: function() { - render: [], - reload: [], - destroy: [] - } - }; - - var _offMethods = { - appRenderBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.render, sNamespaceOrApp_ID, sToken); }, - appRender: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.render, sNamespaceOrApp_ID, sToken); }, - appRenderAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.render, sNamespaceOrApp_ID, sToken); }, + // do nothing after an app is rendered + }, - appReloadBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.reload, sNamespaceOrApp_ID, sToken); }, - appReload: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.reload, sNamespaceOrApp_ID, sToken); }, - appReloadAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.reload, sNamespaceOrApp_ID, sToken); }, + appReloadBefore: function() + { + // do nothing before an app reloads + }, + appReload: function() + { + // re-request the app? + // re-add files? + // re init js ? + }, + appReloadAfter: function() + { + // do nothing after an app reloads + }, - appDestroyBefore: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.beforeApp.destroy, sNamespaceOrApp_ID, sToken); }, - appDestroy: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.app.destroy, sNamespaceOrApp_ID, sToken); }, - appDestroyAfter: function(sToken, sNamespaceOrApp_ID) { _removeHandler(_handlerCollection.afterApp.destroy, sNamespaceOrApp_ID, sToken); } + appDestroyBefore: function() + { + // do nothing before destroying app + }, + appDestroy: function() + { + // remove the app from the dom + }, + appDestroyAfter: function() + { + // do nothing after an app is destroyed + } }; - var _onMethods = { - appRenderBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, - appRender: function(token, sNamespace, func_or_element) { _handlerCollection.app.render.push(_createHandler(token, sNamespace, func_or_element, true)); }, - appRenderAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.render.push(_createHandler(token, sNamespace, func_or_element)); }, - - appReloadBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - appReload: function(token, sNamespace, func_or_element) { _handlerCollection.app.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - appReloadAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.reload.push(_createHandler(token, sNamespace, func_or_element)); }, - - appDestroyBefore: function(token, sNamespace, func_or_element) { _handlerCollection.beforeApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, - appDestroy: function(token, sNamespace, func_or_element) { _handlerCollection.app.destroy.push(_createHandler(token, sNamespace, func_or_element)); }, - appDestroyAfter: function(token, sNamespace, func_or_element) { _handlerCollection.afterApp.destroy.push(_createHandler(token, sNamespace, func_or_element)); } - }; - - //Returns true if it is a DOM node - function _isNode(o){ - return ( - typeof Node === "object" ? o instanceof Node : - o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" - ); - } - - //Returns true if it is a DOM element - function _isElement(o){ - return ( - typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2 - o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string" - ); - } - var _createHandler = function(token, sNamespace, func_or_element, bDomNodeAppropriate) - { - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Handler will not be added to collection. Please check your inputs and try again."); } - + { // will throw an exception and stop execution if the token is invalid - _validateToken(arOriginalArgs[0]); - - // remove the token from the arguments since we have validated it and no longer need it - arOriginalArgs.shift(); - - var iArgCount = arOriginalArgs.length; + _validateToken(token); // create handler structure. Not all arguments properties will be populated/used. var handler = { func: (typeof(func_or_element)) ? func_or_element : null, namespace: sNamespace, - domNode: (_isNode(func_or_element) || _isElement(func_or_element)) ? func_or_element : null + domNode: (F2.isNativeDOMNode(func_or_element)) ? func_or_element : null }; if(!handler.func && !handler.domNode) @@ -196,28 +180,49 @@ F2.extend('AppHandlers', (function() { }, /** * Allows F2 to trigger specific app events internally. - * @method __f2Trigger + * @method __trigger * @private **/ - __f2Trigger: function(token, eventKey) // additional arguments will likely be passed - { - var sNamespace = null; - - // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) - { - var arData = eventKey.split("."); - eventKey = arData[0]; - sNamespace = arData[1]; - } + __trigger: function(token, eventKey, appConfig, html) // additional arguments will likely be passed + { + // will throw an exception and stop execution if the token is invalid + _validateToken(token); - if(_onMethods && _onMethods[eventKey]) + if(_handlerCollection && _handlerCollection[eventKey]) { - for(var i = 0, j = _onMethods[eventKey]; i < j; i++) + // create a collection of arguments that are safe to pass to the callback. + var passableArgs = []; + + // populate that collection with all arguments except token and eventKey + for(var i = 2, j = arguments.length; i < j; i++) { - var handler = _onMethods[eventKey][i]; + passableArgs.push(arguments[i]); + } + + if(_handlerCollection[eventKey].length == 0 && _defaultMethods[eventKey]) + { + _defaultMethods[eventKey].apply(F2, passableArgs); + return this; + } + else if(_handlerCollection[eventKey].length == 0 && !_handlerCollection[eventKey]) + { + return this; + } + + // fire all event listeners in the order that they were added. + for(var i = 0, j = _handlerCollection[eventKey].length; i < j; i++) + { + var handler = _handlerCollection[eventKey][i]; - _onMethods[eventKey][i].apply(F2, [token, sNamespace, func_or_element]) + if (handler.domNode) + { + var $appRoot = jQuery(appConfig.root).append(html); + jQuery(handler.domNode).append($appRoot); + } + else + { + handler.func.apply(F2, passableArgs); + } } } else @@ -260,9 +265,16 @@ F2.extend('AppHandlers', (function() { sNamespace = arData[1]; } - if(_onMethods && _onMethods[eventKey]) - { - _onMethods[eventKey].apply(F2, [token, sNamespace, func_or_element]) + if(_handlerCollection && _handlerCollection[eventKey]) + { + _handlerCollection[eventKey].push( + _createHandler( + token, + sNamespace, + func_or_element, + (eventKey == "appRender") + ) + ); } else { @@ -292,9 +304,13 @@ F2.extend('AppHandlers', (function() { sNamespace = arData[1]; } - if(_offMethods && _offMethods[eventKey]) + if(_handlerCollection && _handlerCollection[eventKey]) { - _offMethods[eventKey].apply(F2, [token, sNamespace]) + _removeHandler( + _handlerCollection[eventKey], + sNamespace, + token + ); } else { @@ -309,6 +325,8 @@ F2.extend('AppHandlers', (function() { **/ CONSTANTS: { + APP_CREATE_ROOT: "appCreateRoot", + APP_RENDER_BEFORE: "appRenderBefore", APP_RENDER: "appRender", APP_RENDER_AFTER: "appRenderAfter", diff --git a/sdk/src/container.js b/sdk/src/container.js index 9d631a55..e3d0a7d7 100644 --- a/sdk/src/container.js +++ b/sdk/src/container.js @@ -7,10 +7,13 @@ F2.extend('', (function(){ var _apps = {}; var _config = false; + var _bUsesAppHandlers = false; + var _sAppHandlerToken = F2.AppHandlers.__f2GetToken(); /** * Appends the app's html to the DOM * @method _afterAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html @@ -36,6 +39,7 @@ F2.extend('', (function(){ /** * Renders the html for an app. * @method _appRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html @@ -62,6 +66,7 @@ F2.extend('', (function(){ * Rendering hook to allow containers to render some html prior to an app * loading * @method _beforeAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @private * @param {F2.AppConfig} appConfig The F2.AppConfig object * @return {Element} The DOM Element surrounding the app @@ -201,8 +206,56 @@ F2.extend('', (function(){ // load html jQuery.each(appManifest.apps, function(i, a) { - // load html and save the root node - appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); + if(!_bUsesAppHandlers) + { + // load html and save the root node + appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); + } + else + { + // if no app root is defined use the apps outter most node + if(!F2.isNativeDOMNode(appConfigs[i].root)) + { + appConfigs[i].root = jQuery(outerHtml(a.html)).get(0); + } + + var $root = jQuery(appConfigs[i].root); + + function outerHtml(html) { + return jQuery('
    ').append(html).html(); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + appConfigs[i], // the app config + outerHtml(a.html) + ); + + if($root.parents("body:first").length == 0) + { + throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + appConfigs[i] // the app config + ); + + if(!appConfigs[i].root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + if(!F2.isNativeDOMNode(appConfigs[i].root)) + { + throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + jQuery(appConfigs[i].root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); + } + // init events _initAppEvents(appConfigs[i]); }); @@ -254,8 +307,46 @@ F2.extend('', (function(){ // make sure the container is configured for secure apps if (_config.secureAppPagePath) { - // create the html container for the iframe - appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '
    ')); + if(!_bUsesAppHandlers) + { + // create the html container for the iframe + appConfig.root = _afterAppRender(appConfig, _appRender(appConfig, '
    ')); + } + else + { + var $root = jQuery(appConfig.root); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER, + appConfig, // the app config + appManifest.html + ); + + if($root.parents("body:first").length == 0) + { + throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + } + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + appConfig // the app config + ); + + if(!appConfig.root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + if(!F2.isNativeDOMNode(appConfig.root)) + { + throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + jQuery(appConfig.root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId); + } + // instantiate F2.UI appConfig.ui = new F2.UI(appConfig); // init events @@ -312,7 +403,11 @@ F2.extend('', (function(){ */ init: function(config) { _config = config || {}; - + + // dictates whether we use the old logic or the new logic. + // TODO: Remove in v2.0 + _bUsesAppHandlers = (!_config.beforeAppRender && !_config.appRender && !_config.afterAppRender); + // only establish RPC connection if the container supports the secure app page if (!!_config.secureAppPagePath || _config.isSecureAppPage) { F2.Rpc.init(!!_config.secureAppPagePath ? _config.secureAppPagePath : false); @@ -384,10 +479,31 @@ F2.extend('', (function(){ // add properties and methods _hydrateAppConfig(a); - - // fire beforeAppRender - a.root = _beforeAppRender(a); - + + // create just a generic div. To squash the jQuery dependency we will turn + // app.root will only be a dom node + a.root = null; + + if(!_bUsesAppHandlers) + { + // fire beforeAppRender + a.root = _beforeAppRender(a); + } + else + { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + a // the app config + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + a // the app config + ); + } + // save app _apps[a.instanceId] = { config:a }; From d418bf13620f37677465f093bc84f9eda38a3247 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Tue, 26 Mar 2013 19:46:37 -0600 Subject: [PATCH 026/181] More stability. Plugged in initial version of App Destroy logic. Still need to write Unit tests, document the code, and add a new example container. --- docs/js/f2.js | 118 ++++- docs/sdk/classes/F2.AppHandlers.html | 460 +++++++++++++++++++- docs/sdk/data.json | 112 ++++- docs/sdk/files/sdk_src_app_handlers.js.html | 137 ++++-- docs/sdk/files/sdk_src_container.js.html | 46 +- docs/sdk/index.html | 2 +- examples/container/js/container.js | 57 ++- sdk/f2.debug.js | 183 ++++++-- sdk/f2.min.js | 4 +- sdk/f2.no-third-party.js | 183 ++++++-- sdk/src/app_handlers.js | 139 ++++-- sdk/src/container.js | 46 +- 12 files changed, 1276 insertions(+), 211 deletions(-) diff --git a/docs/js/f2.js b/docs/js/f2.js index b7a5c6d2..fed0ecf5 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -17,4 +17,120 @@ */ ;typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length \ No newline at end of file +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); +; + +/*! ========================================================= + * bootstrap-modal.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#modals + * ========================================================= + * Copyright 2012 Twitter, 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(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('"].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); +F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{F2.isNativeDOMNode(appConfigs[e].root)||(appConfigs[e].root=jQuery(r(t.html)).get(0));var n=jQuery(appConfigs[e].root);function r(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],r(t.html));if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(appConfigs[e].root).addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e])):jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}))}}}()); + + exports.F2 = F2; + + if (typeof define !== 'undefined' && define.amd) { + + define(function() { + return F2; + }); + + } + +})(typeof exports !== 'undefined' ? exports : window); \ No newline at end of file diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html index 97c66a6b..39013253 100644 --- a/docs/sdk/classes/F2.AppHandlers.html +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -385,7 +385,7 @@

    Methods

  • - eventKey + eventKey{.namespace}
  • @@ -422,9 +422,58 @@

    Properties

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + @@ -478,7 +527,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:168
    +
    sdk\src\app_handlers.js:183
    @@ -536,7 +585,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:181
    +
    sdk\src\app_handlers.js:196
    @@ -594,7 +643,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:154
    +
    sdk\src\app_handlers.js:169
    @@ -668,7 +717,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:286
    +
    sdk\src\app_handlers.js:308
    @@ -707,7 +756,9 @@

    Parameters:

    -

    The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed.

    +

    The event key to determine what listeners need to be removed. If no namespace is provided all + listeners for the specified event type will be removed. + Complete list available in F2.Constants/AppHandlers:property.

    @@ -792,7 +843,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:235
    +
    sdk\src\app_handlers.js:250
    @@ -831,7 +882,7 @@

    Parameters:

    -

    The event key to remove handler from CONSTANTS.

    +

    The event key to remove handler from F2.AppHandlers/CONSTANTS:property.

    @@ -889,7 +940,7 @@

  • - eventKey + eventKey{.namespace}
  • @@ -932,7 +983,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:246
    +
    sdk\src\app_handlers.js:261
    @@ -964,14 +1015,16 @@

    Parameters:

  • - eventKey + eventKey{.namespace} String

    -

    The event key to remove handler from CONSTANTS.

    +

    The event key to determine what listeners need to be removed. If no namespace is provided all + listeners for the specified event type will be removed. + Complete list available in F2.Constants/AppHandlers:property.

    @@ -1021,9 +1074,380 @@

    Example:

    -
    +
    +

    + APP_CREATE_ROOT + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the create root method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:361
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_DESTROY + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the app destroy method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:401
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_DESTROY_AFTER + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:409
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_DESTROY_BEFORE + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:393
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_RENDER + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the app render method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:377
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_RENDER_AFTER + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the after app render method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:385
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_RENDER_BEFORE + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the before app render method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:369
    + + + + + +
    +
    + + + + + + + + +
    + +

    - CONSTANTS + AppHandlers Object @@ -1037,7 +1461,7 @@

    -

    A collection of constants for the on/off method names. Basically just here to help you.

    +

    A collection of constants for the on/off method names in F2.AppHandlers.

    @@ -1050,7 +1474,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:322
    +
    sdk\src\app_handlers.js:355
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index ca03ba6b..b071c555 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -631,7 +631,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 154, + "line": 169, "description": "Allows container developer to retrieve a special token which must be passed to\nall On and Off methods. This function will self destruct so be sure to keep the response\ninside of a closure somewhere.", "itemtype": "method", "name": "getToken", @@ -640,7 +640,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 168, + "line": 183, "description": "Allows F2 to get a token internally", "itemtype": "method", "name": "__f2GetToken", @@ -651,7 +651,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 181, + "line": 196, "description": "Allows F2 to trigger specific app events internally.", "itemtype": "method", "name": "__trigger", @@ -662,7 +662,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 235, + "line": 250, "description": "Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.", "itemtype": "method", "name": "on", @@ -692,7 +692,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 246, + "line": 261, "description": "Allows you to add listener method that will be triggered when a specific event happens.", "itemtype": "method", "name": "on", @@ -704,8 +704,8 @@ "type": "String" }, { - "name": "eventKey", - "description": "The event key to remove handler from {{#crossLink \"F2.AppHandlers/CONSTANTS:property\"}}{{/crossLink}}.", + "name": "eventKey{.namespace}", + "description": "The event key to determine what listeners need to be removed. If no namespace is provided all\n listeners for the specified event type will be removed.\n Complete list available in {{#crossLink \"F2.Constants/AppHandlers:property\"}}{{/crossLink}}.", "type": "String" }, { @@ -722,7 +722,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 286, + "line": 308, "description": "Allows you to remove listener methods for specific events", "itemtype": "method", "name": "off", @@ -735,7 +735,7 @@ }, { "name": "eventKey{.namespace}", - "description": "The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed.", + "description": "The event key to determine what listeners need to be removed. If no namespace is provided all\n listeners for the specified event type will be removed.\n Complete list available in {{#crossLink \"F2.Constants/AppHandlers:property\"}}{{/crossLink}}.", "type": "String" } ], @@ -747,14 +747,98 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 322, - "description": "A collection of constants for the on/off method names. Basically just here to help you.", + "line": 355, + "description": "A collection of constants for the on/off method names in F2.AppHandlers.", "itemtype": "property", - "name": "CONSTANTS", + "name": "AppHandlers", "type": "Object", "class": "F2.AppHandlers", "module": "f2" }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 361, + "description": "Identifies the create root method for use in AppHandlers.on/off/__trigger().", + "itemtype": "property", + "name": "APP_CREATE_ROOT", + "type": "string", + "static": 1, + "final": 1, + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 369, + "description": "Identifies the before app render method for use in AppHandlers.on/off/__trigger().", + "itemtype": "property", + "name": "APP_RENDER_BEFORE", + "type": "string", + "static": 1, + "final": 1, + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 377, + "description": "Identifies the app render method for use in AppHandlers.on/off/__trigger().", + "itemtype": "property", + "name": "APP_RENDER", + "type": "string", + "static": 1, + "final": 1, + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 385, + "description": "Identifies the after app render method for use in AppHandlers.on/off/__trigger().", + "itemtype": "property", + "name": "APP_RENDER_AFTER", + "type": "string", + "static": 1, + "final": 1, + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 393, + "description": "Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().", + "itemtype": "property", + "name": "APP_DESTROY_BEFORE", + "type": "string", + "static": 1, + "final": 1, + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 401, + "description": "Identifies the app destroy method for use in AppHandlers.on/off/__trigger().", + "itemtype": "property", + "name": "APP_DESTROY", + "type": "string", + "static": 1, + "final": 1, + "class": "F2.AppHandlers", + "module": "f2" + }, + { + "file": "sdk\\src\\app_handlers.js", + "line": 409, + "description": "Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().", + "itemtype": "property", + "name": "APP_DESTROY_AFTER", + "type": "string", + "static": 1, + "final": 1, + "class": "F2.AppHandlers", + "module": "f2" + }, { "file": "sdk\\src\\classes.js", "line": 1, @@ -2328,11 +2412,11 @@ "warnings": [ { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:235" + "line": " sdk\\src\\app_handlers.js:250" }, { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:246" + "line": " sdk\\src\\app_handlers.js:261" }, { "message": "replacing incorrect tag: returns with return", diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html index 25f8bd30..f92cc2d1 100644 --- a/docs/sdk/files/sdk_src_app_handlers.js.html +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -225,6 +225,7 @@

    File: sdk\src\app_handlers.js

    * Allows container developers more flexibility when it comes to handling app interaction. * @class F2.AppHandlers */ + F2.extend('AppHandlers', (function() { // the hidden token that we will check against every time someone tries to add, remove, fire handler @@ -234,13 +235,13 @@

    File: sdk\src\app_handlers.js

    var _handlerCollection = { appCreateRoot: [], appRenderBefore: [], - appReloadBefore: [], + //appReloadBefore: [], appDestroyBefore: [], appRenderAfter: [], - appReloadAfter: [], + //appReloadAfter: [], appDestroyAfter: [], appRender: [], - appReload: [], + //appReload: [], appDestroy: [] }; @@ -277,9 +278,23 @@

    File: sdk\src\app_handlers.js

    { // do nothing before destroying app }, - appDestroy: function() - { - // remove the app from the dom + appDestroy: function(appInstance) + { + // call the apps destroy method, if it has one + if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + { + appInstance.app.Destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been + else if(appInstance.app.Destroy) + { + F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); + } + + // fade out and remove the root + jQuery(appInstance.config.root).fadeOut(function() { + jQuery(this).remove(); + }); }, appDestroyAfter: function() { @@ -406,7 +421,7 @@

    File: sdk\src\app_handlers.js

    * @method __trigger * @private **/ - __trigger: function(token, eventKey, appConfig, html) // additional arguments will likely be passed + __trigger: function(token, eventKey) // additional arguments will likely be passed { // will throw an exception and stop execution if the token is invalid _validateToken(token); @@ -437,9 +452,9 @@

    File: sdk\src\app_handlers.js

    { var handler = _handlerCollection[eventKey][i]; - if (handler.domNode) + if (handler.domNode && arguments[2] && arguments[2].root && arguments[3]) { - var $appRoot = jQuery(appConfig.root).append(html); + var $appRoot = jQuery(arguments[2].root).append(arguments[3]); jQuery(handler.domNode).append($appRoot); } else @@ -471,7 +486,9 @@

    File: sdk\src\app_handlers.js

    * @method on * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * listeners for the specified event type will be removed. + * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); @@ -480,6 +497,11 @@

    File: sdk\src\app_handlers.js

    { var sNamespace = null; + if(!eventKey) + { + throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + } + // we need to check the key for a namespace if(eventKey.indexOf(".") > -1) { @@ -511,7 +533,9 @@

    File: sdk\src\app_handlers.js

    * @method off * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * listeners for the specified event type will be removed. + * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @example * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); **/ @@ -519,6 +543,11 @@

    File: sdk\src\app_handlers.js

    { var sNamespace = null; + if(!eventKey) + { + throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + } + // we need to check the key for a namespace if(eventKey.indexOf(".") > -1) { @@ -541,29 +570,75 @@

    File: sdk\src\app_handlers.js

    } return this; - }, - /** - * A collection of constants for the on/off method names. Basically just here to help you. - * @property {Object} CONSTANTS - **/ - CONSTANTS: - { - APP_CREATE_ROOT: "appCreateRoot", - - APP_RENDER_BEFORE: "appRenderBefore", - APP_RENDER: "appRender", - APP_RENDER_AFTER: "appRenderAfter", - - APP_RELOAD_BEFORE: "appReloadBefore", - APP_RELOAD: "appReload", - APP_RELOAD_AFTER: "appReloadAfter", - - APP_DESTROY_BEFORE: "appDestroyBefore", - APP_DESTROY: "appDestroy", - APP_DESTROY_AFTER: "appDestroyAfter" } }; })()); + +F2.extend('Constants', { + /** + * A collection of constants for the on/off method names in F2.AppHandlers. + * @property {Object} AppHandlers + **/ + AppHandlers: + { + /** + * Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * @property APP_CREATE_ROOT + * @type string + * @static + * @final + */ + APP_CREATE_ROOT: "appCreateRoot", + /** + * Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER_BEFORE + * @type string + * @static + * @final + */ + APP_RENDER_BEFORE: "appRenderBefore", + /** + * Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER + * @type string + * @static + * @final + */ + APP_RENDER: "appRender", + /** + * Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER_AFTER + * @type string + * @static + * @final + */ + APP_RENDER_AFTER: "appRenderAfter", + /** + * Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY_BEFORE + * @type string + * @static + * @final + */ + APP_DESTROY_BEFORE: "appDestroyBefore", + /** + * Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY + * @type string + * @static + * @final + */ + APP_DESTROY: "appDestroy", + /** + * Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY_AFTER + * @type string + * @static + * @final + */ + APP_DESTROY_AFTER: "appDestroyAfter" + } +});
    diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index 41dcbf16..3ea211d2 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -450,7 +450,7 @@

    File: sdk\src\container.js

    F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, appConfigs[i], // the app config outerHtml(a.html) ); @@ -462,7 +462,7 @@

    File: sdk\src\container.js

    F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, appConfigs[i] // the app config ); @@ -541,7 +541,7 @@

    File: sdk\src\container.js

    F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, appConfig, // the app config appManifest.html ); @@ -553,7 +553,7 @@

    File: sdk\src\container.js

    F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, appConfig // the app config ); @@ -716,13 +716,13 @@

    File: sdk\src\container.js

    { F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + F2.Constants.AppHandlers.APP_CREATE_ROOT, a // the app config ); F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + F2.Constants.AppHandlers.APP_RENDER_BEFORE, a // the app config ); } @@ -834,11 +834,35 @@

    File: sdk\src\container.js

    } if (_apps[instanceId]) { - jQuery(_apps[instanceId].config.root).fadeOut(function() { - jQuery(this).remove(); - }); - - delete _apps[instanceId]; + + if(!_bUsesAppHandlers) + { + jQuery(_apps[instanceId].config.root).fadeOut(function() { + jQuery(this).remove(); + }); + } + else + { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_AFTER, + _apps[instanceId] // the app instance + ); + } + + //delete _apps[instanceId]; } } }; diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 6ea8af2d..90d6246f 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -249,7 +249,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/examples/container/js/container.js b/examples/container/js/container.js index 171692b2..8695b5be 100644 --- a/examples/container/js/container.js +++ b/examples/container/js/container.js @@ -19,15 +19,39 @@ $(function() { F2.AppHandlers .on( containerAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + F2.Constants.AppHandlers.APP_CREATE_ROOT, function(appConfig) - { - appConfig.root = $("
    ").get(0); + { + var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, appConfig.views); + var hasHelp = F2.inArray(F2.Constants.Views.HELP, appConfig.views); + var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, appConfig.views); + var showDivider = hasSettings || hasHelp || hasAbout; + var gridWidth = appConfig.minGridSize || 3; + + appConfig.root = $([ + '
    ', + '
    ', + '

    ', appConfig.name.toUpperCase(), '

    ', + '
    ', + '', + '', + '
    ', + '
    ', + '
    ' + ].join('')).get(0); } ) .on( containerAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + F2.Constants.AppHandlers.APP_RENDER_BEFORE, function(appConfig){ F2.UI.hideMask(appConfig.instanceId, appConfig.root); $(appConfig.root).addClass("render-before-testing"); @@ -35,16 +59,37 @@ $(function() { ) .on( containerAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, $("body").get(0) ) .on( containerAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, function(appConfig){ $(appConfig.root).addClass("render-after-testing"); F2.UI.hideMask(appConfig.instanceId, appConfig.root); } + ) + .on( + containerAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + function(appInstance) { + // call the apps destroy method, if it has one + if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + { + appInstance.app.Destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been + else if(appInstance.app.Destroy) + { + F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); + } + + // fade out and remove the root + jQuery(appInstance.config.root).slideUp(100, function() { + jQuery(this).remove(); + }); + } ); //listen for app symbol change events and re-broadcast diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 58fc3693..2c790c64 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -1552,6 +1552,7 @@ F2 = { * Allows container developers more flexibility when it comes to handling app interaction. * @class F2.AppHandlers */ + F2.extend('AppHandlers', (function() { // the hidden token that we will check against every time someone tries to add, remove, fire handler @@ -1561,13 +1562,13 @@ F2.extend('AppHandlers', (function() { var _handlerCollection = { appCreateRoot: [], appRenderBefore: [], - appReloadBefore: [], + //appReloadBefore: [], appDestroyBefore: [], appRenderAfter: [], - appReloadAfter: [], + //appReloadAfter: [], appDestroyAfter: [], appRender: [], - appReload: [], + //appReload: [], appDestroy: [] }; @@ -1604,9 +1605,23 @@ F2.extend('AppHandlers', (function() { { // do nothing before destroying app }, - appDestroy: function() - { - // remove the app from the dom + appDestroy: function(appInstance) + { + // call the apps destroy method, if it has one + if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + { + appInstance.app.Destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been + else if(appInstance.app.Destroy) + { + F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); + } + + // fade out and remove the root + jQuery(appInstance.config.root).fadeOut(function() { + jQuery(this).remove(); + }); }, appDestroyAfter: function() { @@ -1733,7 +1748,7 @@ F2.extend('AppHandlers', (function() { * @method __trigger * @private **/ - __trigger: function(token, eventKey, appConfig, html) // additional arguments will likely be passed + __trigger: function(token, eventKey) // additional arguments will likely be passed { // will throw an exception and stop execution if the token is invalid _validateToken(token); @@ -1764,9 +1779,9 @@ F2.extend('AppHandlers', (function() { { var handler = _handlerCollection[eventKey][i]; - if (handler.domNode) + if (handler.domNode && arguments[2] && arguments[2].root && arguments[3]) { - var $appRoot = jQuery(appConfig.root).append(html); + var $appRoot = jQuery(arguments[2].root).append(arguments[3]); jQuery(handler.domNode).append($appRoot); } else @@ -1798,7 +1813,9 @@ F2.extend('AppHandlers', (function() { * @method on * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * listeners for the specified event type will be removed. + * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); @@ -1807,6 +1824,11 @@ F2.extend('AppHandlers', (function() { { var sNamespace = null; + if(!eventKey) + { + throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + } + // we need to check the key for a namespace if(eventKey.indexOf(".") > -1) { @@ -1838,7 +1860,9 @@ F2.extend('AppHandlers', (function() { * @method off * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * listeners for the specified event type will be removed. + * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @example * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); **/ @@ -1846,6 +1870,11 @@ F2.extend('AppHandlers', (function() { { var sNamespace = null; + if(!eventKey) + { + throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + } + // we need to check the key for a namespace if(eventKey.indexOf(".") > -1) { @@ -1868,29 +1897,75 @@ F2.extend('AppHandlers', (function() { } return this; - }, - /** - * A collection of constants for the on/off method names. Basically just here to help you. - * @property {Object} CONSTANTS - **/ - CONSTANTS: - { - APP_CREATE_ROOT: "appCreateRoot", - - APP_RENDER_BEFORE: "appRenderBefore", - APP_RENDER: "appRender", - APP_RENDER_AFTER: "appRenderAfter", - - APP_RELOAD_BEFORE: "appReloadBefore", - APP_RELOAD: "appReload", - APP_RELOAD_AFTER: "appReloadAfter", - - APP_DESTROY_BEFORE: "appDestroyBefore", - APP_DESTROY: "appDestroy", - APP_DESTROY_AFTER: "appDestroyAfter" } }; })()); + +F2.extend('Constants', { + /** + * A collection of constants for the on/off method names in F2.AppHandlers. + * @property {Object} AppHandlers + **/ + AppHandlers: + { + /** + * Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * @property APP_CREATE_ROOT + * @type string + * @static + * @final + */ + APP_CREATE_ROOT: "appCreateRoot", + /** + * Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER_BEFORE + * @type string + * @static + * @final + */ + APP_RENDER_BEFORE: "appRenderBefore", + /** + * Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER + * @type string + * @static + * @final + */ + APP_RENDER: "appRender", + /** + * Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER_AFTER + * @type string + * @static + * @final + */ + APP_RENDER_AFTER: "appRenderAfter", + /** + * Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY_BEFORE + * @type string + * @static + * @final + */ + APP_DESTROY_BEFORE: "appDestroyBefore", + /** + * Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY + * @type string + * @static + * @final + */ + APP_DESTROY: "appDestroy", + /** + * Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY_AFTER + * @type string + * @static + * @final + */ + APP_DESTROY_AFTER: "appDestroyAfter" + } +}); /** * Class stubs for documentation purposes * @main F2 @@ -3569,7 +3644,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, appConfigs[i], // the app config outerHtml(a.html) ); @@ -3581,7 +3656,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, appConfigs[i] // the app config ); @@ -3660,7 +3735,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, appConfig, // the app config appManifest.html ); @@ -3672,7 +3747,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, appConfig // the app config ); @@ -3835,13 +3910,13 @@ F2.extend('', (function(){ { F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + F2.Constants.AppHandlers.APP_CREATE_ROOT, a // the app config ); F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + F2.Constants.AppHandlers.APP_RENDER_BEFORE, a // the app config ); } @@ -3953,11 +4028,35 @@ F2.extend('', (function(){ } if (_apps[instanceId]) { - jQuery(_apps[instanceId].config.root).fadeOut(function() { - jQuery(this).remove(); - }); - - delete _apps[instanceId]; + + if(!_bUsesAppHandlers) + { + jQuery(_apps[instanceId].config.root).fadeOut(function() { + jQuery(this).remove(); + }); + } + else + { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_AFTER, + _apps[instanceId] // the app instance + ); + } + + //delete _apps[instanceId]; } } }; diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 0ab3ad6a..fed0ecf5 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -115,13 +115,13 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * THE SOFTWARE. */ ;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},isNativeDOMNode:function(e){var t=typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",n=typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string";return t||n},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; -F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appReloadBefore:[],appDestroyBefore:[],appRenderAfter:[],appReloadAfter:[],appDestroyAfter:[],appRender:[],appReload:[],appDestroy:[]},r={appRenderBefore:function(e,t){},appRender:function(){},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(){},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,n){s(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,o=e.length;i-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(n[t],r,e),this},CONSTANTS:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_RELOAD_BEFORE:"appReloadBefore",APP_RELOAD:"appReload",APP_RELOAD_AFTER:"appReloadAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}()); +F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appRenderBefore:function(e,t){},appRender:function(){},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e.app.Destroy&&typeof e.app.Destroy=="function"?e.app.Destroy():e.app.Destroy&&F2.log(app.config.appId+" has a Destroy property, but Destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,n){s(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,o=e.length;i-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(n[t],r,e),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},secureAppPagePath:"",supportedViews:[]}}); F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{F2.isNativeDOMNode(appConfigs[e].root)||(appConfigs[e].root=jQuery(r(t.html)).get(0));var n=jQuery(appConfigs[e].root);function r(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER,appConfigs[e],r(t.html));if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER,appConfigs[e]);if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(appConfigs[e].root).addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{F2.isNativeDOMNode(appConfigs[e].root)||(appConfigs[e].root=jQuery(r(t.html)).get(0));var n=jQuery(appConfigs[e].root);function r(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],r(t.html));if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(appConfigs[e].root).addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e])):jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}))}}}()); exports.F2 = F2; diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index 09dd011c..673482d6 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -218,6 +218,7 @@ F2 = { * Allows container developers more flexibility when it comes to handling app interaction. * @class F2.AppHandlers */ + F2.extend('AppHandlers', (function() { // the hidden token that we will check against every time someone tries to add, remove, fire handler @@ -227,13 +228,13 @@ F2.extend('AppHandlers', (function() { var _handlerCollection = { appCreateRoot: [], appRenderBefore: [], - appReloadBefore: [], + //appReloadBefore: [], appDestroyBefore: [], appRenderAfter: [], - appReloadAfter: [], + //appReloadAfter: [], appDestroyAfter: [], appRender: [], - appReload: [], + //appReload: [], appDestroy: [] }; @@ -270,9 +271,23 @@ F2.extend('AppHandlers', (function() { { // do nothing before destroying app }, - appDestroy: function() - { - // remove the app from the dom + appDestroy: function(appInstance) + { + // call the apps destroy method, if it has one + if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + { + appInstance.app.Destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been + else if(appInstance.app.Destroy) + { + F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); + } + + // fade out and remove the root + jQuery(appInstance.config.root).fadeOut(function() { + jQuery(this).remove(); + }); }, appDestroyAfter: function() { @@ -399,7 +414,7 @@ F2.extend('AppHandlers', (function() { * @method __trigger * @private **/ - __trigger: function(token, eventKey, appConfig, html) // additional arguments will likely be passed + __trigger: function(token, eventKey) // additional arguments will likely be passed { // will throw an exception and stop execution if the token is invalid _validateToken(token); @@ -430,9 +445,9 @@ F2.extend('AppHandlers', (function() { { var handler = _handlerCollection[eventKey][i]; - if (handler.domNode) + if (handler.domNode && arguments[2] && arguments[2].root && arguments[3]) { - var $appRoot = jQuery(appConfig.root).append(html); + var $appRoot = jQuery(arguments[2].root).append(arguments[3]); jQuery(handler.domNode).append($appRoot); } else @@ -464,7 +479,9 @@ F2.extend('AppHandlers', (function() { * @method on * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * listeners for the specified event type will be removed. + * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); @@ -473,6 +490,11 @@ F2.extend('AppHandlers', (function() { { var sNamespace = null; + if(!eventKey) + { + throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + } + // we need to check the key for a namespace if(eventKey.indexOf(".") > -1) { @@ -504,7 +526,9 @@ F2.extend('AppHandlers', (function() { * @method off * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * listeners for the specified event type will be removed. + * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @example * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); **/ @@ -512,6 +536,11 @@ F2.extend('AppHandlers', (function() { { var sNamespace = null; + if(!eventKey) + { + throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + } + // we need to check the key for a namespace if(eventKey.indexOf(".") > -1) { @@ -534,29 +563,75 @@ F2.extend('AppHandlers', (function() { } return this; - }, - /** - * A collection of constants for the on/off method names. Basically just here to help you. - * @property {Object} CONSTANTS - **/ - CONSTANTS: - { - APP_CREATE_ROOT: "appCreateRoot", - - APP_RENDER_BEFORE: "appRenderBefore", - APP_RENDER: "appRender", - APP_RENDER_AFTER: "appRenderAfter", - - APP_RELOAD_BEFORE: "appReloadBefore", - APP_RELOAD: "appReload", - APP_RELOAD_AFTER: "appReloadAfter", - - APP_DESTROY_BEFORE: "appDestroyBefore", - APP_DESTROY: "appDestroy", - APP_DESTROY_AFTER: "appDestroyAfter" } }; })()); + +F2.extend('Constants', { + /** + * A collection of constants for the on/off method names in F2.AppHandlers. + * @property {Object} AppHandlers + **/ + AppHandlers: + { + /** + * Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * @property APP_CREATE_ROOT + * @type string + * @static + * @final + */ + APP_CREATE_ROOT: "appCreateRoot", + /** + * Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER_BEFORE + * @type string + * @static + * @final + */ + APP_RENDER_BEFORE: "appRenderBefore", + /** + * Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER + * @type string + * @static + * @final + */ + APP_RENDER: "appRender", + /** + * Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER_AFTER + * @type string + * @static + * @final + */ + APP_RENDER_AFTER: "appRenderAfter", + /** + * Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY_BEFORE + * @type string + * @static + * @final + */ + APP_DESTROY_BEFORE: "appDestroyBefore", + /** + * Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY + * @type string + * @static + * @final + */ + APP_DESTROY: "appDestroy", + /** + * Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY_AFTER + * @type string + * @static + * @final + */ + APP_DESTROY_AFTER: "appDestroyAfter" + } +}); /** * Class stubs for documentation purposes * @main F2 @@ -2235,7 +2310,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, appConfigs[i], // the app config outerHtml(a.html) ); @@ -2247,7 +2322,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, appConfigs[i] // the app config ); @@ -2326,7 +2401,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, appConfig, // the app config appManifest.html ); @@ -2338,7 +2413,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, appConfig // the app config ); @@ -2501,13 +2576,13 @@ F2.extend('', (function(){ { F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + F2.Constants.AppHandlers.APP_CREATE_ROOT, a // the app config ); F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + F2.Constants.AppHandlers.APP_RENDER_BEFORE, a // the app config ); } @@ -2619,11 +2694,35 @@ F2.extend('', (function(){ } if (_apps[instanceId]) { - jQuery(_apps[instanceId].config.root).fadeOut(function() { - jQuery(this).remove(); - }); - - delete _apps[instanceId]; + + if(!_bUsesAppHandlers) + { + jQuery(_apps[instanceId].config.root).fadeOut(function() { + jQuery(this).remove(); + }); + } + else + { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_AFTER, + _apps[instanceId] // the app instance + ); + } + + //delete _apps[instanceId]; } } }; diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index fbec8f05..0a05f804 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -2,6 +2,7 @@ * Allows container developers more flexibility when it comes to handling app interaction. * @class F2.AppHandlers */ + F2.extend('AppHandlers', (function() { // the hidden token that we will check against every time someone tries to add, remove, fire handler @@ -11,13 +12,13 @@ F2.extend('AppHandlers', (function() { var _handlerCollection = { appCreateRoot: [], appRenderBefore: [], - appReloadBefore: [], + //appReloadBefore: [], appDestroyBefore: [], appRenderAfter: [], - appReloadAfter: [], + //appReloadAfter: [], appDestroyAfter: [], appRender: [], - appReload: [], + //appReload: [], appDestroy: [] }; @@ -54,9 +55,23 @@ F2.extend('AppHandlers', (function() { { // do nothing before destroying app }, - appDestroy: function() - { - // remove the app from the dom + appDestroy: function(appInstance) + { + // call the apps destroy method, if it has one + if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + { + appInstance.app.Destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been + else if(appInstance.app.Destroy) + { + F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); + } + + // fade out and remove the root + jQuery(appInstance.config.root).fadeOut(function() { + jQuery(this).remove(); + }); }, appDestroyAfter: function() { @@ -183,7 +198,7 @@ F2.extend('AppHandlers', (function() { * @method __trigger * @private **/ - __trigger: function(token, eventKey, appConfig, html) // additional arguments will likely be passed + __trigger: function(token, eventKey) // additional arguments will likely be passed { // will throw an exception and stop execution if the token is invalid _validateToken(token); @@ -214,9 +229,9 @@ F2.extend('AppHandlers', (function() { { var handler = _handlerCollection[eventKey][i]; - if (handler.domNode) + if (handler.domNode && arguments[2] && arguments[2].root && arguments[3]) { - var $appRoot = jQuery(appConfig.root).append(html); + var $appRoot = jQuery(arguments[2].root).append(arguments[3]); jQuery(handler.domNode).append($appRoot); } else @@ -248,7 +263,9 @@ F2.extend('AppHandlers', (function() { * @method on * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * listeners for the specified event type will be removed. + * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); @@ -257,6 +274,11 @@ F2.extend('AppHandlers', (function() { { var sNamespace = null; + if(!eventKey) + { + throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + } + // we need to check the key for a namespace if(eventKey.indexOf(".") > -1) { @@ -288,7 +310,9 @@ F2.extend('AppHandlers', (function() { * @method off * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all listeners for the specified event type will be removed. + * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * listeners for the specified event type will be removed. + * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @example * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); **/ @@ -296,6 +320,11 @@ F2.extend('AppHandlers', (function() { { var sNamespace = null; + if(!eventKey) + { + throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + } + // we need to check the key for a namespace if(eventKey.indexOf(".") > -1) { @@ -318,26 +347,72 @@ F2.extend('AppHandlers', (function() { } return this; - }, - /** - * A collection of constants for the on/off method names. Basically just here to help you. - * @property {Object} CONSTANTS - **/ - CONSTANTS: - { - APP_CREATE_ROOT: "appCreateRoot", - - APP_RENDER_BEFORE: "appRenderBefore", - APP_RENDER: "appRender", - APP_RENDER_AFTER: "appRenderAfter", - - APP_RELOAD_BEFORE: "appReloadBefore", - APP_RELOAD: "appReload", - APP_RELOAD_AFTER: "appReloadAfter", - - APP_DESTROY_BEFORE: "appDestroyBefore", - APP_DESTROY: "appDestroy", - APP_DESTROY_AFTER: "appDestroyAfter" } }; -})()); \ No newline at end of file +})()); + +F2.extend('Constants', { + /** + * A collection of constants for the on/off method names in F2.AppHandlers. + * @property {Object} AppHandlers + **/ + AppHandlers: + { + /** + * Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * @property APP_CREATE_ROOT + * @type string + * @static + * @final + */ + APP_CREATE_ROOT: "appCreateRoot", + /** + * Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER_BEFORE + * @type string + * @static + * @final + */ + APP_RENDER_BEFORE: "appRenderBefore", + /** + * Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER + * @type string + * @static + * @final + */ + APP_RENDER: "appRender", + /** + * Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * @property APP_RENDER_AFTER + * @type string + * @static + * @final + */ + APP_RENDER_AFTER: "appRenderAfter", + /** + * Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY_BEFORE + * @type string + * @static + * @final + */ + APP_DESTROY_BEFORE: "appDestroyBefore", + /** + * Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY + * @type string + * @static + * @final + */ + APP_DESTROY: "appDestroy", + /** + * Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * @property APP_DESTROY_AFTER + * @type string + * @static + * @final + */ + APP_DESTROY_AFTER: "appDestroyAfter" + } +}); \ No newline at end of file diff --git a/sdk/src/container.js b/sdk/src/container.js index e3d0a7d7..80431577 100644 --- a/sdk/src/container.js +++ b/sdk/src/container.js @@ -227,7 +227,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, appConfigs[i], // the app config outerHtml(a.html) ); @@ -239,7 +239,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, appConfigs[i] // the app config ); @@ -318,7 +318,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER, + F2.Constants.AppHandlers.APP_RENDER, appConfig, // the app config appManifest.html ); @@ -330,7 +330,7 @@ F2.extend('', (function(){ F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_AFTER, + F2.Constants.AppHandlers.APP_RENDER_AFTER, appConfig // the app config ); @@ -493,13 +493,13 @@ F2.extend('', (function(){ { F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_CREATE_ROOT, + F2.Constants.AppHandlers.APP_CREATE_ROOT, a // the app config ); F2.AppHandlers.__trigger( _sAppHandlerToken, - F2.AppHandlers.CONSTANTS.APP_RENDER_BEFORE, + F2.Constants.AppHandlers.APP_RENDER_BEFORE, a // the app config ); } @@ -611,11 +611,35 @@ F2.extend('', (function(){ } if (_apps[instanceId]) { - jQuery(_apps[instanceId].config.root).fadeOut(function() { - jQuery(this).remove(); - }); - - delete _apps[instanceId]; + + if(!_bUsesAppHandlers) + { + jQuery(_apps[instanceId].config.root).fadeOut(function() { + jQuery(this).remove(); + }); + } + else + { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_AFTER, + _apps[instanceId] // the app instance + ); + } + + //delete _apps[instanceId]; } } }; From 8c36b9c4d8322d8366fb61d4ee6cdc24e1e2c220 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Wed, 27 Mar 2013 09:32:22 -0600 Subject: [PATCH 027/181] Updated docs to latest version via node build -y also built project via node build --- docs/js/f2.js | 118 +---- docs/sdk/classes/F2.html | 16 +- docs/sdk/data.json | 20 +- docs/sdk/files/sdk_src_container.js.html | 21 +- docs/sdk/index.html | 8 +- sdk/f2.min.js | 239 +-------- sdk/f2.no-third-party.js | 609 ++++++++++++++++++++++- 7 files changed, 639 insertions(+), 392 deletions(-) diff --git a/docs/js/f2.js b/docs/js/f2.js index fed0ecf5..b7a5c6d2 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -17,120 +17,4 @@ */ ;typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
  • - CONSTANTS + APP_CREATE_ROOT +

    Identifies the create root method for use in AppHandlers.on/off/__trigger().

    + APP_DESTROY +

    Identifies the app destroy method for use in AppHandlers.on/off/__trigger().

    + APP_DESTROY_AFTER +

    Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().

    + APP_DESTROY_BEFORE +

    Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().

    + APP_RENDER +

    Identifies the app render method for use in AppHandlers.on/off/__trigger().

    + APP_RENDER_AFTER +

    Identifies the after app render method for use in AppHandlers.on/off/__trigger().

    + APP_RENDER_BEFORE

    A collection of constants for the on/off method names. Basically just here to help you.

    Identifies the before app render method for use in AppHandlers.on/off/__trigger().

    + AppHandlers +

    A collection of constants for the on/off method names in F2.AppHandlers.

    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); -; - -/*! ========================================================= - * bootstrap-modal.js v2.2.2 - * http://twitter.github.com/bootstrap/javascript.html#modals - * ========================================================= - * Copyright 2012 Twitter, 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(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('"].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{F2.isNativeDOMNode(appConfigs[e].root)||(appConfigs[e].root=jQuery(r(t.html)).get(0));var n=jQuery(appConfigs[e].root);function r(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],r(t.html));if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(appConfigs[e].root).addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e])):jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}))}}}()); - - exports.F2 = F2; - - if (typeof define !== 'undefined' && define.amd) { - - define(function() { - return F2; - }); - - } - -})(typeof exports !== 'undefined' ? exports : window); \ No newline at end of file +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length \ No newline at end of file diff --git a/docs/sdk/classes/F2.html b/docs/sdk/classes/F2.html index d0d3cb60..f26d741f 100644 --- a/docs/sdk/classes/F2.html +++ b/docs/sdk/classes/F2.html @@ -1534,7 +1534,7 @@

    Defined in
    -
    sdk\src\container.js:361
    +
    sdk\src\container.js:366
    @@ -1829,7 +1829,7 @@

    Defined in
    -
    sdk\src\container.js:383
    +
    sdk\src\container.js:388
    @@ -2101,7 +2101,7 @@

    Defined in
    -
    sdk\src\container.js:398
    +
    sdk\src\container.js:403
    @@ -2180,7 +2180,7 @@

    Defined in
    -
    sdk\src\container.js:422
    +
    sdk\src\container.js:427
    @@ -2483,7 +2483,7 @@

    Defined in
    -
    sdk\src\container.js:298
    +
    sdk\src\container.js:303
    @@ -2813,7 +2813,7 @@

    Defined in
    -
    sdk\src\container.js:428
    +
    sdk\src\container.js:433
    @@ -2914,7 +2914,7 @@

    Defined in
    -
    sdk\src\container.js:586
    +
    sdk\src\container.js:591
    @@ -2980,7 +2980,7 @@

    Defined in
    -
    sdk\src\container.js:601
    +
    sdk\src\container.js:606
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index b071c555..a1d091d7 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -1676,7 +1676,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 298, + "line": 303, "description": "Loads the app's html/css/javascript into an iframe", "itemtype": "method", "name": "loadSecureApp", @@ -1699,7 +1699,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 361, + "line": 366, "description": "Checks if the app is valid", "itemtype": "method", "name": "_validateApp", @@ -1721,7 +1721,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 383, + "line": 388, "description": "Gets the current list of apps in the container", "itemtype": "method", "name": "getContainerState", @@ -1734,7 +1734,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 398, + "line": 403, "description": "Initializes the container. This method must be called before performing\nany other actions in the container.", "itemtype": "method", "name": "init", @@ -1750,7 +1750,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 422, + "line": 427, "description": "Has the container been init?", "itemtype": "method", "name": "isInit", @@ -1763,7 +1763,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 428, + "line": 433, "description": "Begins the loading process for all apps. The app will\nbe passed the {{#crossLink \"F2.AppConfig\"}}{{/crossLink}} object which will\ncontain the app's unique instanceId within the container. Optionally, the\n{{#crossLink \"F2.AppManifest\"}}{{/crossLink}} can be passed in and those\nassets will be used instead of making a request.", "itemtype": "method", "name": "registerApps", @@ -1785,7 +1785,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 586, + "line": 591, "description": "Removes all apps from the container", "itemtype": "method", "name": "removeAllApps", @@ -1794,7 +1794,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 601, + "line": 606, "description": "Removes an app from the container", "itemtype": "method", "name": "removeApp", @@ -2420,11 +2420,11 @@ }, { "message": "replacing incorrect tag: returns with return", - "line": " sdk\\src\\container.js:361" + "line": " sdk\\src\\container.js:366" }, { "message": "replacing incorrect tag: returns with return", - "line": " sdk\\src\\container.js:383" + "line": " sdk\\src\\container.js:388" }, { "message": "replacing incorrect tag: params with param", diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index 3ea211d2..dca0624a 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -419,6 +419,16 @@

    File: sdk\src\container.js

    } }); }; + //eval inlines + var evalInlines = function(){ + jQuery.each(inlines, function(i, e) { + try { + eval(e); + } catch (exception) { + F2.log('Error loading inline script: ' + exception + '\n\n' + e); + } + }); + }; // load styles var stylesFragment = []; @@ -495,13 +505,7 @@

    File: sdk\src\container.js

    type:'GET', success:function() { if (++scriptsLoaded == scriptCount) { - jQuery.each(inlines, function(i, e) { - try { - eval(e); - } catch (exception) { - F2.log('Error loading inline script: ' + exception + '\n\n' + e); - } - }); + evalInlines(); // fire the load event to tell the app it can proceed appInit(); } @@ -514,6 +518,7 @@

    File: sdk\src\container.js

    // if no scripts were to be processed, fire the appLoad event if (!scriptCount) { + evalInlines(); appInit(); } }; @@ -679,7 +684,7 @@

    File: sdk\src\container.js

    var callbackStack = {}; var haveManifests = false; appConfigs = [].concat(appConfigs); - appManifests = appManifests || []; + appManifests = [].concat(appManifests || []); haveManifests = !!appManifests.length; // appConfigs must have a length diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 90d6246f..b46961b4 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -249,7 +249,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    @@ -279,6 +279,12 @@

    Build F2

    We are using markitdown, a lightweight pandoc wrapper, for converting markdown files to HTML for the docs.

    +NuGet Package + +

    Good news if you're using C#! We have an F2 NuGet package available. In the Package Manager Console run:

    + +

    PM> Install-Package F2

    +

    Collaboration

    Join our team and help contribute to F2 on GitHub. Begin by reading our contribution guidelines, and then start by forking the repo, sending pull requests, or submitting issues.

    diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 1ffd215e..d93e6433 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -19,7 +19,8 @@ /*! jQuery v1.8.3 jquery.com | jquery.org/license */ (function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); ; -/* ========================================================= + +/*! ========================================================= * bootstrap-modal.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= @@ -37,234 +38,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ========================================================= */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* MODAL CLASS DEFINITION - * ====================== */ - - var Modal = function (element, options) { - this.options = options - this.$element = $(element) - .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) - this.options.remote && this.$element.find('.modal-body').load(this.options.remote) - } - - Modal.prototype = { - - constructor: Modal - - , toggle: function () { - return this[!this.isShown ? 'show' : 'hide']() - } - - , show: function () { - var that = this - , e = $.Event('show') - - this.$element.trigger(e) - - if (this.isShown || e.isDefaultPrevented()) return - - this.isShown = true - - this.escape() - - this.backdrop(function () { - var transition = $.support.transition && that.$element.hasClass('fade') - - if (!that.$element.parent().length) { - that.$element.appendTo(document.body) //don't move modals dom position - } - - that.$element - .show() - - if (transition) { - that.$element[0].offsetWidth // force reflow - } - - that.$element - .addClass('in') - .attr('aria-hidden', false) - - that.enforceFocus() - - transition ? - that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : - that.$element.focus().trigger('shown') - - }) - } - - , hide: function (e) { - e && e.preventDefault() - - var that = this - - e = $.Event('hide') - - this.$element.trigger(e) - - if (!this.isShown || e.isDefaultPrevented()) return - - this.isShown = false - - this.escape() - - $(document).off('focusin.modal') - - this.$element - .removeClass('in') - .attr('aria-hidden', true) - - $.support.transition && this.$element.hasClass('fade') ? - this.hideWithTransition() : - this.hideModal() - } - - , enforceFocus: function () { - var that = this - $(document).on('focusin.modal', function (e) { - if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { - that.$element.focus() - } - }) - } - - , escape: function () { - var that = this - if (this.isShown && this.options.keyboard) { - this.$element.on('keyup.dismiss.modal', function ( e ) { - e.which == 27 && that.hide() - }) - } else if (!this.isShown) { - this.$element.off('keyup.dismiss.modal') - } - } - - , hideWithTransition: function () { - var that = this - , timeout = setTimeout(function () { - that.$element.off($.support.transition.end) - that.hideModal() - }, 500) - - this.$element.one($.support.transition.end, function () { - clearTimeout(timeout) - that.hideModal() - }) - } - - , hideModal: function (that) { - this.$element - .hide() - .trigger('hidden') - - this.backdrop() - } - - , removeBackdrop: function () { - this.$backdrop.remove() - this.$backdrop = null - } - - , backdrop: function (callback) { - var that = this - , animate = this.$element.hasClass('fade') ? 'fade' : '' - - if (this.isShown && this.options.backdrop) { - var doAnimate = $.support.transition && animate - - this.$backdrop = $('
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length \ No newline at end of file +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); +; + +/*! ========================================================= + * bootstrap-modal.js v2.2.2 + * http://twitter.github.com/bootstrap/javascript.html#modals + * ========================================================= + * Copyright 2012 Twitter, 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(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('"].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); +F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{function n(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],n(t.html));if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var r=jQuery(appConfigs[e].root);if(r.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";r.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e])):jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}))}}}()); + + exports.F2 = F2; + + if (typeof define !== 'undefined' && define.amd) { + + define(function() { + return F2; + }); + + } + +})(typeof exports !== 'undefined' ? exports : window); \ No newline at end of file diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html index 39013253..fe8f6f5f 100644 --- a/docs/sdk/classes/F2.AppHandlers.html +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -527,7 +527,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:183
    +
    sdk\src\app_handlers.js:194
    @@ -585,7 +585,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:196
    +
    sdk\src\app_handlers.js:207
    @@ -643,7 +643,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:169
    +
    sdk\src\app_handlers.js:180
    @@ -717,7 +717,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:308
    +
    sdk\src\app_handlers.js:319
    @@ -843,7 +843,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:250
    +
    sdk\src\app_handlers.js:261
    @@ -983,7 +983,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:261
    +
    sdk\src\app_handlers.js:272
    @@ -1107,7 +1107,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:361
    +
    sdk\src\app_handlers.js:372
    @@ -1160,7 +1160,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:401
    +
    sdk\src\app_handlers.js:412
    @@ -1213,7 +1213,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:409
    +
    sdk\src\app_handlers.js:420
    @@ -1266,7 +1266,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:393
    +
    sdk\src\app_handlers.js:404
    @@ -1319,7 +1319,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:377
    +
    sdk\src\app_handlers.js:388
    @@ -1372,7 +1372,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:385
    +
    sdk\src\app_handlers.js:396
    @@ -1425,7 +1425,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:369
    +
    sdk\src\app_handlers.js:380
    @@ -1474,7 +1474,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:355
    +
    sdk\src\app_handlers.js:366
    diff --git a/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html b/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html index f1b22b7f..f120c06a 100644 --- a/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html +++ b/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html @@ -233,7 +233,7 @@

    F2.ContainerConfig.UI.Mask

    Defined in
    -
    sdk\src\classes.js:274
    +
    sdk\src\classes.js:292
    @@ -356,7 +356,7 @@

    Defined in
    -
    sdk\src\classes.js:281
    +
    sdk\src\classes.js:299
    @@ -407,7 +407,7 @@

    Defined in
    -
    sdk\src\classes.js:288
    +
    sdk\src\classes.js:306
    @@ -456,7 +456,7 @@

    Defined in
    -
    sdk\src\classes.js:294
    +
    sdk\src\classes.js:312
    @@ -509,7 +509,7 @@

    Defined in
    -
    sdk\src\classes.js:301
    +
    sdk\src\classes.js:319
    @@ -560,7 +560,7 @@

    Defined in
    -
    sdk\src\classes.js:310
    +
    sdk\src\classes.js:328
    diff --git a/docs/sdk/classes/F2.ContainerConfig.UI.html b/docs/sdk/classes/F2.ContainerConfig.UI.html index 0a53e210..7e4a74f5 100644 --- a/docs/sdk/classes/F2.ContainerConfig.UI.html +++ b/docs/sdk/classes/F2.ContainerConfig.UI.html @@ -231,7 +231,7 @@

    F2.ContainerConfig.UI

    Defined in
    -
    sdk\src\classes.js:269
    +
    sdk\src\classes.js:287
    diff --git a/docs/sdk/classes/F2.ContainerConfig.html b/docs/sdk/classes/F2.ContainerConfig.html index 407c8a41..cfa1751c 100644 --- a/docs/sdk/classes/F2.ContainerConfig.html +++ b/docs/sdk/classes/F2.ContainerConfig.html @@ -854,7 +854,7 @@

    Defined in
    -
    sdk\src\classes.js:319
    +
    sdk\src\classes.js:269
    @@ -905,7 +905,7 @@

    Defined in
    -
    sdk\src\classes.js:328
    +
    sdk\src\classes.js:278
    diff --git a/docs/sdk/classes/F2.html b/docs/sdk/classes/F2.html index f26d741f..506adaae 100644 --- a/docs/sdk/classes/F2.html +++ b/docs/sdk/classes/F2.html @@ -1534,7 +1534,7 @@

    Defined in
    -
    sdk\src\container.js:366
    +
    sdk\src\container.js:360
    @@ -1829,7 +1829,7 @@

    Defined in
    -
    sdk\src\container.js:388
    +
    sdk\src\container.js:382
    @@ -2101,7 +2101,7 @@

    Defined in
    -
    sdk\src\container.js:403
    +
    sdk\src\container.js:397
    @@ -2180,7 +2180,7 @@

    Defined in
    -
    sdk\src\container.js:427
    +
    sdk\src\container.js:421
    @@ -2483,7 +2483,7 @@

    Defined in
    -
    sdk\src\container.js:303
    +
    sdk\src\container.js:297
    @@ -2813,7 +2813,7 @@

    Defined in
    -
    sdk\src\container.js:433
    +
    sdk\src\container.js:427
    @@ -2914,7 +2914,7 @@

    Defined in
    -
    sdk\src\container.js:591
    +
    sdk\src\container.js:585
    @@ -2980,7 +2980,7 @@

    Defined in
    -
    sdk\src\container.js:606
    +
    sdk\src\container.js:600
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index a1d091d7..ee4bf62a 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -262,7 +262,7 @@ "module": "f2", "namespace": "", "file": "sdk\\src\\classes.js", - "line": 269, + "line": 287, "description": "An object containing configuration defaults for F2.UI" }, "F2.ContainerConfig.UI.Mask": { @@ -276,7 +276,7 @@ "module": "f2", "namespace": "", "file": "sdk\\src\\classes.js", - "line": 274, + "line": 292, "description": "An object containing configuration defaults for the \nF2.UI.{{#crossLink \"F2.UI/showMask\"}}{{/crossLink}} and\nF2.UI.{{#crossLink \"F2.UI/hideMask\"}}{{/crossLink}} methods." }, "F2.Constants": { @@ -631,7 +631,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 169, + "line": 180, "description": "Allows container developer to retrieve a special token which must be passed to\nall On and Off methods. This function will self destruct so be sure to keep the response\ninside of a closure somewhere.", "itemtype": "method", "name": "getToken", @@ -640,7 +640,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 183, + "line": 194, "description": "Allows F2 to get a token internally", "itemtype": "method", "name": "__f2GetToken", @@ -651,7 +651,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 196, + "line": 207, "description": "Allows F2 to trigger specific app events internally.", "itemtype": "method", "name": "__trigger", @@ -662,7 +662,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 250, + "line": 261, "description": "Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.", "itemtype": "method", "name": "on", @@ -692,7 +692,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 261, + "line": 272, "description": "Allows you to add listener method that will be triggered when a specific event happens.", "itemtype": "method", "name": "on", @@ -722,7 +722,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 308, + "line": 319, "description": "Allows you to remove listener methods for specific events", "itemtype": "method", "name": "off", @@ -747,7 +747,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 355, + "line": 366, "description": "A collection of constants for the on/off method names in F2.AppHandlers.", "itemtype": "property", "name": "AppHandlers", @@ -757,7 +757,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 361, + "line": 372, "description": "Identifies the create root method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_CREATE_ROOT", @@ -769,7 +769,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 369, + "line": 380, "description": "Identifies the before app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER_BEFORE", @@ -781,7 +781,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 377, + "line": 388, "description": "Identifies the app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER", @@ -793,7 +793,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 385, + "line": 396, "description": "Identifies the after app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER_AFTER", @@ -805,7 +805,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 393, + "line": 404, "description": "Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY_BEFORE", @@ -817,7 +817,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 401, + "line": 412, "description": "Identifies the app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY", @@ -829,7 +829,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 409, + "line": 420, "description": "Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY_AFTER", @@ -1162,7 +1162,28 @@ }, { "file": "sdk\\src\\classes.js", - "line": 281, + "line": 269, + "description": "Allows the container to specify which page is used when\nloading a secure app. The page must reside on a different domain than the\ncontainer", + "itemtype": "property", + "name": "secureAppPagePath", + "type": "string", + "class": "F2.ContainerConfig", + "module": "f2" + }, + { + "file": "sdk\\src\\classes.js", + "line": 278, + "description": "Specifies what views a container will provide buttons\nor links to. Generally, the views will be switched via buttons or links\nin the app's header.", + "itemtype": "property", + "name": "supportedViews", + "type": "Array", + "required": 1, + "class": "F2.ContainerConfig", + "module": "f2" + }, + { + "file": "sdk\\src\\classes.js", + "line": 299, "description": "The backround color of the overlay", "itemtype": "property", "name": "backgroundColor", @@ -1173,7 +1194,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 288, + "line": 306, "description": "The path to the loading icon", "itemtype": "property", "name": "loadingIcon", @@ -1183,7 +1204,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 294, + "line": 312, "description": "The opacity of the background overlay", "itemtype": "property", "name": "opacity", @@ -1194,7 +1215,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 301, + "line": 319, "description": "Do not use inline styles for mask functinality. Instead classes will\nbe applied to the elements and it is up to the container provider to\nimplement the class definitions.", "itemtype": "property", "name": "useClasses", @@ -1205,7 +1226,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 310, + "line": 328, "description": "The z-index to use for the overlay", "itemtype": "property", "name": "zIndex", @@ -1214,27 +1235,6 @@ "class": "F2.ContainerConfig.UI.Mask", "module": "f2" }, - { - "file": "sdk\\src\\classes.js", - "line": 319, - "description": "Allows the container to specify which page is used when\nloading a secure app. The page must reside on a different domain than the\ncontainer", - "itemtype": "property", - "name": "secureAppPagePath", - "type": "string", - "class": "F2.ContainerConfig", - "module": "f2" - }, - { - "file": "sdk\\src\\classes.js", - "line": 328, - "description": "Specifies what views a container will provide buttons\nor links to. Generally, the views will be switched via buttons or links\nin the app's header.", - "itemtype": "property", - "name": "supportedViews", - "type": "Array", - "required": 1, - "class": "F2.ContainerConfig", - "module": "f2" - }, { "file": "sdk\\src\\constants.js", "line": 13, @@ -1676,7 +1676,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 303, + "line": 297, "description": "Loads the app's html/css/javascript into an iframe", "itemtype": "method", "name": "loadSecureApp", @@ -1699,7 +1699,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 366, + "line": 360, "description": "Checks if the app is valid", "itemtype": "method", "name": "_validateApp", @@ -1721,7 +1721,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 388, + "line": 382, "description": "Gets the current list of apps in the container", "itemtype": "method", "name": "getContainerState", @@ -1734,7 +1734,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 403, + "line": 397, "description": "Initializes the container. This method must be called before performing\nany other actions in the container.", "itemtype": "method", "name": "init", @@ -1750,7 +1750,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 427, + "line": 421, "description": "Has the container been init?", "itemtype": "method", "name": "isInit", @@ -1763,7 +1763,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 433, + "line": 427, "description": "Begins the loading process for all apps. The app will\nbe passed the {{#crossLink \"F2.AppConfig\"}}{{/crossLink}} object which will\ncontain the app's unique instanceId within the container. Optionally, the\n{{#crossLink \"F2.AppManifest\"}}{{/crossLink}} can be passed in and those\nassets will be used instead of making a request.", "itemtype": "method", "name": "registerApps", @@ -1785,7 +1785,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 591, + "line": 585, "description": "Removes all apps from the container", "itemtype": "method", "name": "removeAllApps", @@ -1794,7 +1794,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 606, + "line": 600, "description": "Removes an app from the container", "itemtype": "method", "name": "removeApp", @@ -2412,19 +2412,19 @@ "warnings": [ { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:250" + "line": " sdk\\src\\app_handlers.js:261" }, { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:261" + "line": " sdk\\src\\app_handlers.js:272" }, { "message": "replacing incorrect tag: returns with return", - "line": " sdk\\src\\container.js:366" + "line": " sdk\\src\\container.js:360" }, { "message": "replacing incorrect tag: returns with return", - "line": " sdk\\src\\container.js:388" + "line": " sdk\\src\\container.js:382" }, { "message": "replacing incorrect tag: params with param", diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html index f92cc2d1..cb7447ae 100644 --- a/docs/sdk/files/sdk_src_app_handlers.js.html +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -246,13 +246,24 @@

    File: sdk\src\app_handlers.js

    }; var _defaultMethods = { - appRenderBefore: function(appConfig, html) + appCreateRoot: function() + { + // do nothing to create root. F2.Container will automatically create the root in the default appRender + }, + appRenderBefore: function(appConfig) { // do nothing before an app is rendered }, - appRender: function() + appRender: function(appConfig, html) { - // do something + // if no app root is defined use the apps outter most node + if(!F2.isNativeDOMNode(appConfig.root)) + { + appConfig.root = jQuery(html).get(0); + } + + // append the root to the body by default. + jQuery("body").append(appConfig.root); }, appRenderAfter: function() { diff --git a/docs/sdk/files/sdk_src_classes.js.html b/docs/sdk/files/sdk_src_classes.js.html index 906efe24..dfea6a60 100644 --- a/docs/sdk/files/sdk_src_classes.js.html +++ b/docs/sdk/files/sdk_src_classes.js.html @@ -489,6 +489,24 @@

    File: sdk\src\classes.js

    * @type bool */ isSecureAppPage: false, + /** + * Allows the container to specify which page is used when + * loading a secure app. The page must reside on a different domain than the + * container + * @property secureAppPagePath + * @type string + * @for F2.ContainerConfig + */ + secureAppPagePath: '', + /** + * Specifies what views a container will provide buttons + * or links to. Generally, the views will be switched via buttons or links + * in the app's header. + * @property supportedViews + * @type Array + * @required + */ + supportedViews: [], /** * An object containing configuration defaults for F2.UI * @class F2.ContainerConfig.UI @@ -538,25 +556,7 @@

    File: sdk\src\classes.js

    */ zIndex: 2 } - }, - /** - * Allows the container to specify which page is used when - * loading a secure app. The page must reside on a different domain than the - * container - * @property secureAppPagePath - * @type string - * @for F2.ContainerConfig - */ - secureAppPagePath: '', - /** - * Specifies what views a container will provide buttons - * or links to. Generally, the views will be switched via buttons or links - * in the app's header. - * @property supportedViews - * @type Array - * @required - */ - supportedViews: [] + } } }); diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index dca0624a..6d48b1ea 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -445,15 +445,7 @@

    File: sdk\src\container.js

    appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); } else - { - // if no app root is defined use the apps outter most node - if(!F2.isNativeDOMNode(appConfigs[i].root)) - { - appConfigs[i].root = jQuery(outerHtml(a.html)).get(0); - } - - var $root = jQuery(appConfigs[i].root); - + { function outerHtml(html) { return jQuery('<div></div>').append(html).html(); } @@ -465,6 +457,13 @@

    File: sdk\src\container.js

    outerHtml(a.html) ); + if(!appConfigs[i].root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + var $root = jQuery(appConfigs[i].root); + if($root.parents("body:first").length == 0) { throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); @@ -476,17 +475,12 @@

    File: sdk\src\container.js

    appConfigs[i] // the app config ); - if(!appConfigs[i].root) - { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); - } - if(!F2.isNativeDOMNode(appConfigs[i].root)) { throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); } - jQuery(appConfigs[i].root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); + $root.addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); } // init events diff --git a/docs/sdk/index.html b/docs/sdk/index.html index b46961b4..bda388b3 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -249,7 +249,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/examples/container/js/container.js b/examples/container/js/container.js index 8695b5be..3cfcf007 100644 --- a/examples/container/js/container.js +++ b/examples/container/js/container.js @@ -16,7 +16,8 @@ $(function() { }); // Define these prior to init - F2.AppHandlers + /* + F2.AppHandlers .on( containerAppHandlerToken, F2.Constants.AppHandlers.APP_CREATE_ROOT, @@ -91,7 +92,8 @@ $(function() { }); } ); - + */ + //listen for app symbol change events and re-broadcast F2.Events.on( F2.Constants.Events.APP_SYMBOL_CHANGE, diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 52bfebfd..95702604 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -1573,13 +1573,24 @@ F2.extend('AppHandlers', (function() { }; var _defaultMethods = { - appRenderBefore: function(appConfig, html) + appCreateRoot: function() + { + // do nothing to create root. F2.Container will automatically create the root in the default appRender + }, + appRenderBefore: function(appConfig) { // do nothing before an app is rendered }, - appRender: function() + appRender: function(appConfig, html) { - // do something + // if no app root is defined use the apps outter most node + if(!F2.isNativeDOMNode(appConfig.root)) + { + appConfig.root = jQuery(html).get(0); + } + + // append the root to the body by default. + jQuery("body").append(appConfig.root); }, appRenderAfter: function() { @@ -2234,6 +2245,24 @@ F2.extend("", { * @type bool */ isSecureAppPage: false, + /** + * Allows the container to specify which page is used when + * loading a secure app. The page must reside on a different domain than the + * container + * @property secureAppPagePath + * @type string + * @for F2.ContainerConfig + */ + secureAppPagePath: '', + /** + * Specifies what views a container will provide buttons + * or links to. Generally, the views will be switched via buttons or links + * in the app's header. + * @property supportedViews + * @type Array + * @required + */ + supportedViews: [], /** * An object containing configuration defaults for F2.UI * @class F2.ContainerConfig.UI @@ -2283,25 +2312,7 @@ F2.extend("", { */ zIndex: 2 } - }, - /** - * Allows the container to specify which page is used when - * loading a secure app. The page must reside on a different domain than the - * container - * @property secureAppPagePath - * @type string - * @for F2.ContainerConfig - */ - secureAppPagePath: '', - /** - * Specifies what views a container will provide buttons - * or links to. Generally, the views will be switched via buttons or links - * in the app's header. - * @property supportedViews - * @type Array - * @required - */ - supportedViews: [] + } } }); /** @@ -3639,15 +3650,7 @@ F2.extend('', (function(){ appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); } else - { - // if no app root is defined use the apps outter most node - if(!F2.isNativeDOMNode(appConfigs[i].root)) - { - appConfigs[i].root = jQuery(outerHtml(a.html)).get(0); - } - - var $root = jQuery(appConfigs[i].root); - + { function outerHtml(html) { return jQuery('
    ').append(html).html(); } @@ -3659,6 +3662,13 @@ F2.extend('', (function(){ outerHtml(a.html) ); + if(!appConfigs[i].root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + var $root = jQuery(appConfigs[i].root); + if($root.parents("body:first").length == 0) { throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); @@ -3670,17 +3680,12 @@ F2.extend('', (function(){ appConfigs[i] // the app config ); - if(!appConfigs[i].root) - { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); - } - if(!F2.isNativeDOMNode(appConfigs[i].root)) { throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); } - jQuery(appConfigs[i].root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); + $root.addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); } // init events diff --git a/sdk/f2.min.js b/sdk/f2.min.js index d93e6433..8c11b7cf 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -115,13 +115,13 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * THE SOFTWARE. */ ;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},isNativeDOMNode:function(e){var t=typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",n=typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string";return t||n},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; -F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appRenderBefore:function(e,t){},appRender:function(){},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e.app.Destroy&&typeof e.app.Destroy=="function"?e.app.Destroy():e.app.Destroy&&F2.log(app.config.appId+" has a Destroy property, but Destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,n){s(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,o=e.length;i-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(n[t],r,e),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); -F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},secureAppPagePath:"",supportedViews:[]}}); +F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appCreateRoot:function(){},appRenderBefore:function(e){},appRender:function(e,t){F2.isNativeDOMNode(e.root)||(e.root=jQuery(t).get(0)),jQuery("body").append(e.root)},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e.app.Destroy&&typeof e.app.Destroy=="function"?e.app.Destroy():e.app.Destroy&&F2.log(app.config.appId+" has a Destroy property, but Destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,n){s(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,o=e.length;i-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(n[t],r,e),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); +F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}}}}); F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{F2.isNativeDOMNode(appConfigs[e].root)||(appConfigs[e].root=jQuery(r(t.html)).get(0));var n=jQuery(appConfigs[e].root);function r(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],r(t.html));if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(appConfigs[e].root).addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e])):jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}))}}}()); +F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{function n(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],n(t.html));if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var r=jQuery(appConfigs[e].root);if(r.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";r.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e])):jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}))}}}()); exports.F2 = F2; diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index d7da017b..527de6ed 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -239,13 +239,24 @@ F2.extend('AppHandlers', (function() { }; var _defaultMethods = { - appRenderBefore: function(appConfig, html) + appCreateRoot: function() + { + // do nothing to create root. F2.Container will automatically create the root in the default appRender + }, + appRenderBefore: function(appConfig) { // do nothing before an app is rendered }, - appRender: function() + appRender: function(appConfig, html) { - // do something + // if no app root is defined use the apps outter most node + if(!F2.isNativeDOMNode(appConfig.root)) + { + appConfig.root = jQuery(html).get(0); + } + + // append the root to the body by default. + jQuery("body").append(appConfig.root); }, appRenderAfter: function() { @@ -900,6 +911,24 @@ F2.extend("", { * @type bool */ isSecureAppPage: false, + /** + * Allows the container to specify which page is used when + * loading a secure app. The page must reside on a different domain than the + * container + * @property secureAppPagePath + * @type string + * @for F2.ContainerConfig + */ + secureAppPagePath: '', + /** + * Specifies what views a container will provide buttons + * or links to. Generally, the views will be switched via buttons or links + * in the app's header. + * @property supportedViews + * @type Array + * @required + */ + supportedViews: [], /** * An object containing configuration defaults for F2.UI * @class F2.ContainerConfig.UI @@ -949,25 +978,7 @@ F2.extend("", { */ zIndex: 2 } - }, - /** - * Allows the container to specify which page is used when - * loading a secure app. The page must reside on a different domain than the - * container - * @property secureAppPagePath - * @type string - * @for F2.ContainerConfig - */ - secureAppPagePath: '', - /** - * Specifies what views a container will provide buttons - * or links to. Generally, the views will be switched via buttons or links - * in the app's header. - * @property supportedViews - * @type Array - * @required - */ - supportedViews: [] + } } }); /** @@ -2305,15 +2316,7 @@ F2.extend('', (function(){ appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); } else - { - // if no app root is defined use the apps outter most node - if(!F2.isNativeDOMNode(appConfigs[i].root)) - { - appConfigs[i].root = jQuery(outerHtml(a.html)).get(0); - } - - var $root = jQuery(appConfigs[i].root); - + { function outerHtml(html) { return jQuery('
    ').append(html).html(); } @@ -2325,6 +2328,13 @@ F2.extend('', (function(){ outerHtml(a.html) ); + if(!appConfigs[i].root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + var $root = jQuery(appConfigs[i].root); + if($root.parents("body:first").length == 0) { throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); @@ -2336,17 +2346,12 @@ F2.extend('', (function(){ appConfigs[i] // the app config ); - if(!appConfigs[i].root) - { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); - } - if(!F2.isNativeDOMNode(appConfigs[i].root)) { throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); } - jQuery(appConfigs[i].root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); + $root.addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); } // init events diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index 0a05f804..8d9c7e7f 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -23,13 +23,24 @@ F2.extend('AppHandlers', (function() { }; var _defaultMethods = { - appRenderBefore: function(appConfig, html) + appCreateRoot: function() + { + // do nothing to create root. F2.Container will automatically create the root in the default appRender + }, + appRenderBefore: function(appConfig) { // do nothing before an app is rendered }, - appRender: function() + appRender: function(appConfig, html) { - // do something + // if no app root is defined use the apps outter most node + if(!F2.isNativeDOMNode(appConfig.root)) + { + appConfig.root = jQuery(html).get(0); + } + + // append the root to the body by default. + jQuery("body").append(appConfig.root); }, appRenderAfter: function() { diff --git a/sdk/src/classes.js b/sdk/src/classes.js index 92dbebec..34e6d685 100644 --- a/sdk/src/classes.js +++ b/sdk/src/classes.js @@ -266,6 +266,24 @@ F2.extend("", { * @type bool */ isSecureAppPage: false, + /** + * Allows the container to specify which page is used when + * loading a secure app. The page must reside on a different domain than the + * container + * @property secureAppPagePath + * @type string + * @for F2.ContainerConfig + */ + secureAppPagePath: '', + /** + * Specifies what views a container will provide buttons + * or links to. Generally, the views will be switched via buttons or links + * in the app's header. + * @property supportedViews + * @type Array + * @required + */ + supportedViews: [], /** * An object containing configuration defaults for F2.UI * @class F2.ContainerConfig.UI @@ -315,24 +333,6 @@ F2.extend("", { */ zIndex: 2 } - }, - /** - * Allows the container to specify which page is used when - * loading a secure app. The page must reside on a different domain than the - * container - * @property secureAppPagePath - * @type string - * @for F2.ContainerConfig - */ - secureAppPagePath: '', - /** - * Specifies what views a container will provide buttons - * or links to. Generally, the views will be switched via buttons or links - * in the app's header. - * @property supportedViews - * @type Array - * @required - */ - supportedViews: [] + } } }); \ No newline at end of file diff --git a/sdk/src/container.js b/sdk/src/container.js index 85098add..ecb8ca3e 100644 --- a/sdk/src/container.js +++ b/sdk/src/container.js @@ -222,15 +222,7 @@ F2.extend('', (function(){ appConfigs[i].root = _afterAppRender(appConfigs[i], _appRender(appConfigs[i], a.html)); } else - { - // if no app root is defined use the apps outter most node - if(!F2.isNativeDOMNode(appConfigs[i].root)) - { - appConfigs[i].root = jQuery(outerHtml(a.html)).get(0); - } - - var $root = jQuery(appConfigs[i].root); - + { function outerHtml(html) { return jQuery('
    ').append(html).html(); } @@ -242,6 +234,13 @@ F2.extend('', (function(){ outerHtml(a.html) ); + if(!appConfigs[i].root) + { + throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + } + + var $root = jQuery(appConfigs[i].root); + if($root.parents("body:first").length == 0) { throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); @@ -253,17 +252,12 @@ F2.extend('', (function(){ appConfigs[i] // the app config ); - if(!appConfigs[i].root) - { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); - } - if(!F2.isNativeDOMNode(appConfigs[i].root)) { throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); } - jQuery(appConfigs[i].root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); + $root.addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); } // init events diff --git a/tests/spec/container-spec.js b/tests/spec/container-spec.js index ff0f7d55..410009f0 100644 --- a/tests/spec/container-spec.js +++ b/tests/spec/container-spec.js @@ -146,7 +146,7 @@ describe('F2.registerApps - rendering', function() { */ it('should eval AppManifest.inlineScripts when AppManifest.scripts are not defined', function(){ F2.init(); - F2.registerApps([{appId:'com_openf2_tests_helloworld', manifestUrl:'/'}], [{"inlineScripts": ["(function(){F2.inlineScriptsEvaluated=true;})()"],"apps":[{}]}]); + F2.registerApps([{appId:'com_openf2_tests_helloworld', manifestUrl:'/'}], [{"inlineScripts": ["(function(){F2.inlineScriptsEvaluated=true;})()"],"apps":[{ html: '
    Testing
    ' }]}]); expect(F2.inlineScriptsEvaluated).not.toBeUndefined(); }); }); \ No newline at end of file From bafb84c396ee1bf8a30b42c31a30ea8a0e968ab8 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Wed, 27 Mar 2013 16:42:40 -0600 Subject: [PATCH 029/181] Fixed the styling of the test page. Added lots of unit tests for appHandlers. Push to test with travis ci. --- docs/js/f2.js | 118 +- docs/sdk/classes/F2.AppHandlers.html | 28 +- docs/sdk/data.json | 32 +- docs/sdk/files/sdk_src_app_handlers.js.html | 23 +- docs/sdk/files/sdk_src_container.js.html | 46 +- docs/sdk/index.html | 2 +- examples/container/js/container.js | 15 +- sdk/f2.debug.js | 69 +- sdk/f2.min.js | 4 +- sdk/f2.no-third-party.js | 69 +- sdk/src/app_handlers.js | 23 +- sdk/src/container.js | 46 +- tests/css/override.css | 9 + tests/css/page.css | 9 + tests/index.html | 10 +- tests/spec/app-handlers-spec.js | 1689 +++++++++++++++++++ 16 files changed, 1903 insertions(+), 289 deletions(-) create mode 100644 tests/css/override.css create mode 100644 tests/css/page.css create mode 100644 tests/spec/app-handlers-spec.js diff --git a/docs/js/f2.js b/docs/js/f2.js index 8c11b7cf..b7a5c6d2 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -17,120 +17,4 @@ */ ;typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); -; - -/*! ========================================================= - * bootstrap-modal.js v2.2.2 - * http://twitter.github.com/bootstrap/javascript.html#modals - * ========================================================= - * Copyright 2012 Twitter, 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(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('"].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{function n(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],n(t.html));if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var r=jQuery(appConfigs[e].root);if(r.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";r.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e])):jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}))}}}()); - - exports.F2 = F2; - - if (typeof define !== 'undefined' && define.amd) { - - define(function() { - return F2; - }); - - } - -})(typeof exports !== 'undefined' ? exports : window); \ No newline at end of file +(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length \ No newline at end of file diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html index fe8f6f5f..8b6d6b53 100644 --- a/docs/sdk/classes/F2.AppHandlers.html +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -527,7 +527,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:194
    +
    sdk\src\app_handlers.js:206
    @@ -585,7 +585,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:207
    +
    sdk\src\app_handlers.js:219
    @@ -643,7 +643,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:180
    +
    sdk\src\app_handlers.js:192
    @@ -717,7 +717,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:319
    +
    sdk\src\app_handlers.js:334
    @@ -843,7 +843,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:261
    +
    sdk\src\app_handlers.js:276
    @@ -983,7 +983,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:272
    +
    sdk\src\app_handlers.js:287
    @@ -1107,7 +1107,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:372
    +
    sdk\src\app_handlers.js:387
    @@ -1160,7 +1160,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:412
    +
    sdk\src\app_handlers.js:427
    @@ -1213,7 +1213,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:420
    +
    sdk\src\app_handlers.js:435
    @@ -1266,7 +1266,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:404
    +
    sdk\src\app_handlers.js:419
    @@ -1319,7 +1319,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:388
    +
    sdk\src\app_handlers.js:403
    @@ -1372,7 +1372,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:396
    +
    sdk\src\app_handlers.js:411
    @@ -1425,7 +1425,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:380
    +
    sdk\src\app_handlers.js:395
    @@ -1474,7 +1474,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:366
    +
    sdk\src\app_handlers.js:381
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index ee4bf62a..6c340fed 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -631,7 +631,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 180, + "line": 192, "description": "Allows container developer to retrieve a special token which must be passed to\nall On and Off methods. This function will self destruct so be sure to keep the response\ninside of a closure somewhere.", "itemtype": "method", "name": "getToken", @@ -640,7 +640,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 194, + "line": 206, "description": "Allows F2 to get a token internally", "itemtype": "method", "name": "__f2GetToken", @@ -651,7 +651,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 207, + "line": 219, "description": "Allows F2 to trigger specific app events internally.", "itemtype": "method", "name": "__trigger", @@ -662,7 +662,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 261, + "line": 276, "description": "Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.", "itemtype": "method", "name": "on", @@ -692,7 +692,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 272, + "line": 287, "description": "Allows you to add listener method that will be triggered when a specific event happens.", "itemtype": "method", "name": "on", @@ -722,7 +722,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 319, + "line": 334, "description": "Allows you to remove listener methods for specific events", "itemtype": "method", "name": "off", @@ -747,7 +747,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 366, + "line": 381, "description": "A collection of constants for the on/off method names in F2.AppHandlers.", "itemtype": "property", "name": "AppHandlers", @@ -757,7 +757,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 372, + "line": 387, "description": "Identifies the create root method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_CREATE_ROOT", @@ -769,7 +769,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 380, + "line": 395, "description": "Identifies the before app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER_BEFORE", @@ -781,7 +781,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 388, + "line": 403, "description": "Identifies the app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER", @@ -793,7 +793,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 396, + "line": 411, "description": "Identifies the after app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER_AFTER", @@ -805,7 +805,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 404, + "line": 419, "description": "Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY_BEFORE", @@ -817,7 +817,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 412, + "line": 427, "description": "Identifies the app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY", @@ -829,7 +829,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 420, + "line": 435, "description": "Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY_AFTER", @@ -2412,11 +2412,11 @@ "warnings": [ { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:261" + "line": " sdk\\src\\app_handlers.js:276" }, { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:272" + "line": " sdk\\src\\app_handlers.js:287" }, { "message": "replacing incorrect tag: returns with return", diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html index cb7447ae..ea94d2ad 100644 --- a/docs/sdk/files/sdk_src_app_handlers.js.html +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -256,14 +256,26 @@

    File: sdk\src\app_handlers.js

    }, appRender: function(appConfig, html) { + var $root = null; + // if no app root is defined use the apps outter most node if(!F2.isNativeDOMNode(appConfig.root)) { appConfig.root = jQuery(html).get(0); + // get a handle on the root in jQuery + $root = jQuery(appConfig.root); } + else + { + // get a handle on the root in jQuery + $root = jQuery(appConfig.root); + + // append the app html to the root + $root.append(html); + } // append the root to the body by default. - jQuery("body").append(appConfig.root); + jQuery("body").append($root); }, appRenderAfter: function() { @@ -292,12 +304,12 @@

    File: sdk\src\app_handlers.js

    appDestroy: function(appInstance) { // call the apps destroy method, if it has one - if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + if(appInstance && appInstance.app && appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") { appInstance.app.Destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been - else if(appInstance.app.Destroy) + else if(appInstance && appInstance.app && appInstance.app.Destroy) { F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); } @@ -435,7 +447,10 @@

    File: sdk\src\app_handlers.js

    __trigger: function(token, eventKey) // additional arguments will likely be passed { // will throw an exception and stop execution if the token is invalid - _validateToken(token); + if(token != _f2t) + { + throw ("Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().") + } if(_handlerCollection && _handlerCollection[eventKey]) { diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index 6d48b1ea..8081079c 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -832,36 +832,26 @@

    File: sdk\src\container.js

    return; } - if (_apps[instanceId]) { + if (_apps[instanceId]) { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + _apps[instanceId] // the app instance + ); - if(!_bUsesAppHandlers) - { - jQuery(_apps[instanceId].config.root).fadeOut(function() { - jQuery(this).remove(); - }); - } - else - { - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY_BEFORE, - _apps[instanceId] // the app instance - ); - - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY, - _apps[instanceId] // the app instance - ); - - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY_AFTER, - _apps[instanceId] // the app instance - ); - } + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_AFTER, + _apps[instanceId] // the app instance + ); - //delete _apps[instanceId]; + delete _apps[instanceId]; } } }; diff --git a/docs/sdk/index.html b/docs/sdk/index.html index bda388b3..3770c611 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -249,7 +249,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/examples/container/js/container.js b/examples/container/js/container.js index 3cfcf007..ab217d3c 100644 --- a/examples/container/js/container.js +++ b/examples/container/js/container.js @@ -14,10 +14,9 @@ $(function() { supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE], secureAppPagePath: "secure.html" // this should go on a separate domain from index.html }); - + // Define these prior to init - /* - F2.AppHandlers + F2.AppHandlers .on( containerAppHandlerToken, F2.Constants.AppHandlers.APP_CREATE_ROOT, @@ -53,7 +52,7 @@ $(function() { .on( containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER_BEFORE, - function(appConfig){ + function(appConfig){ F2.UI.hideMask(appConfig.instanceId, appConfig.root); $(appConfig.root).addClass("render-before-testing"); } @@ -75,13 +74,15 @@ $(function() { containerAppHandlerToken, F2.Constants.AppHandlers.APP_DESTROY, function(appInstance) { + if(!appInstance) { return; } + // call the apps destroy method, if it has one - if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + if(appInstance.app && appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") { appInstance.app.Destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been - else if(appInstance.app.Destroy) + else if(appInstance.app && appInstance.app.Destroy) { F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); } @@ -92,7 +93,7 @@ $(function() { }); } ); - */ + //listen for app symbol change events and re-broadcast F2.Events.on( diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 95702604..6bda05c1 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -1583,14 +1583,26 @@ F2.extend('AppHandlers', (function() { }, appRender: function(appConfig, html) { + var $root = null; + // if no app root is defined use the apps outter most node if(!F2.isNativeDOMNode(appConfig.root)) { appConfig.root = jQuery(html).get(0); + // get a handle on the root in jQuery + $root = jQuery(appConfig.root); } + else + { + // get a handle on the root in jQuery + $root = jQuery(appConfig.root); + + // append the app html to the root + $root.append(html); + } // append the root to the body by default. - jQuery("body").append(appConfig.root); + jQuery("body").append($root); }, appRenderAfter: function() { @@ -1619,12 +1631,12 @@ F2.extend('AppHandlers', (function() { appDestroy: function(appInstance) { // call the apps destroy method, if it has one - if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + if(appInstance && appInstance.app && appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") { appInstance.app.Destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been - else if(appInstance.app.Destroy) + else if(appInstance && appInstance.app && appInstance.app.Destroy) { F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); } @@ -1762,7 +1774,10 @@ F2.extend('AppHandlers', (function() { __trigger: function(token, eventKey) // additional arguments will likely be passed { // will throw an exception and stop execution if the token is invalid - _validateToken(token); + if(token != _f2t) + { + throw ("Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().") + } if(_handlerCollection && _handlerCollection[eventKey]) { @@ -4037,36 +4052,26 @@ F2.extend('', (function(){ return; } - if (_apps[instanceId]) { + if (_apps[instanceId]) { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + _apps[instanceId] // the app instance + ); - if(!_bUsesAppHandlers) - { - jQuery(_apps[instanceId].config.root).fadeOut(function() { - jQuery(this).remove(); - }); - } - else - { - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY_BEFORE, - _apps[instanceId] // the app instance - ); - - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY, - _apps[instanceId] // the app instance - ); - - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY_AFTER, - _apps[instanceId] // the app instance - ); - } + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_AFTER, + _apps[instanceId] // the app instance + ); - //delete _apps[instanceId]; + delete _apps[instanceId]; } } }; diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 8c11b7cf..5cc76ec6 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -115,13 +115,13 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * THE SOFTWARE. */ ;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},isNativeDOMNode:function(e){var t=typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",n=typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string";return t||n},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; -F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appCreateRoot:function(){},appRenderBefore:function(e){},appRender:function(e,t){F2.isNativeDOMNode(e.root)||(e.root=jQuery(t).get(0)),jQuery("body").append(e.root)},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e.app.Destroy&&typeof e.app.Destroy=="function"?e.app.Destroy():e.app.Destroy&&F2.log(app.config.appId+" has a Destroy property, but Destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,n){s(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,o=e.length;i-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(n[t],r,e),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); +F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appCreateRoot:function(){},appRenderBefore:function(e){},appRender:function(e,t){var n=null;F2.isNativeDOMNode(e.root)?(n=jQuery(e.root),n.append(t)):(e.root=jQuery(t).get(0),n=jQuery(e.root)),jQuery("body").append(n)},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e&&e.app&&e.app.Destroy&&typeof e.app.Destroy=="function"?e.app.Destroy():e&&e.app&&e.app.Destroy&&F2.log(app.config.appId+" has a Destroy property, but Destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,n){s(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,o=e.length;i-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(n[t],r,e),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}}}}); F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{function n(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],n(t.html));if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var r=jQuery(appConfigs[e].root);if(r.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";r.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e])):jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}))}}}()); +F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{function n(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],n(t.html));if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var r=jQuery(appConfigs[e].root);if(r.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";r.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e]),delete _apps[e])}}}()); exports.F2 = F2; diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index 527de6ed..f70c6340 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -249,14 +249,26 @@ F2.extend('AppHandlers', (function() { }, appRender: function(appConfig, html) { + var $root = null; + // if no app root is defined use the apps outter most node if(!F2.isNativeDOMNode(appConfig.root)) { appConfig.root = jQuery(html).get(0); + // get a handle on the root in jQuery + $root = jQuery(appConfig.root); } + else + { + // get a handle on the root in jQuery + $root = jQuery(appConfig.root); + + // append the app html to the root + $root.append(html); + } // append the root to the body by default. - jQuery("body").append(appConfig.root); + jQuery("body").append($root); }, appRenderAfter: function() { @@ -285,12 +297,12 @@ F2.extend('AppHandlers', (function() { appDestroy: function(appInstance) { // call the apps destroy method, if it has one - if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + if(appInstance && appInstance.app && appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") { appInstance.app.Destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been - else if(appInstance.app.Destroy) + else if(appInstance && appInstance.app && appInstance.app.Destroy) { F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); } @@ -428,7 +440,10 @@ F2.extend('AppHandlers', (function() { __trigger: function(token, eventKey) // additional arguments will likely be passed { // will throw an exception and stop execution if the token is invalid - _validateToken(token); + if(token != _f2t) + { + throw ("Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().") + } if(_handlerCollection && _handlerCollection[eventKey]) { @@ -2703,36 +2718,26 @@ F2.extend('', (function(){ return; } - if (_apps[instanceId]) { + if (_apps[instanceId]) { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + _apps[instanceId] // the app instance + ); - if(!_bUsesAppHandlers) - { - jQuery(_apps[instanceId].config.root).fadeOut(function() { - jQuery(this).remove(); - }); - } - else - { - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY_BEFORE, - _apps[instanceId] // the app instance - ); - - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY, - _apps[instanceId] // the app instance - ); - - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY_AFTER, - _apps[instanceId] // the app instance - ); - } + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_AFTER, + _apps[instanceId] // the app instance + ); - //delete _apps[instanceId]; + delete _apps[instanceId]; } } }; diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index 8d9c7e7f..dd3bee28 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -33,14 +33,26 @@ F2.extend('AppHandlers', (function() { }, appRender: function(appConfig, html) { + var $root = null; + // if no app root is defined use the apps outter most node if(!F2.isNativeDOMNode(appConfig.root)) { appConfig.root = jQuery(html).get(0); + // get a handle on the root in jQuery + $root = jQuery(appConfig.root); } + else + { + // get a handle on the root in jQuery + $root = jQuery(appConfig.root); + + // append the app html to the root + $root.append(html); + } // append the root to the body by default. - jQuery("body").append(appConfig.root); + jQuery("body").append($root); }, appRenderAfter: function() { @@ -69,12 +81,12 @@ F2.extend('AppHandlers', (function() { appDestroy: function(appInstance) { // call the apps destroy method, if it has one - if(appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + if(appInstance && appInstance.app && appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") { appInstance.app.Destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been - else if(appInstance.app.Destroy) + else if(appInstance && appInstance.app && appInstance.app.Destroy) { F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); } @@ -212,7 +224,10 @@ F2.extend('AppHandlers', (function() { __trigger: function(token, eventKey) // additional arguments will likely be passed { // will throw an exception and stop execution if the token is invalid - _validateToken(token); + if(token != _f2t) + { + throw ("Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().") + } if(_handlerCollection && _handlerCollection[eventKey]) { diff --git a/sdk/src/container.js b/sdk/src/container.js index ecb8ca3e..4a15543e 100644 --- a/sdk/src/container.js +++ b/sdk/src/container.js @@ -609,36 +609,26 @@ F2.extend('', (function(){ return; } - if (_apps[instanceId]) { + if (_apps[instanceId]) { + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + _apps[instanceId] // the app instance + ); - if(!_bUsesAppHandlers) - { - jQuery(_apps[instanceId].config.root).fadeOut(function() { - jQuery(this).remove(); - }); - } - else - { - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY_BEFORE, - _apps[instanceId] // the app instance - ); - - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY, - _apps[instanceId] // the app instance - ); - - F2.AppHandlers.__trigger( - _sAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY_AFTER, - _apps[instanceId] // the app instance - ); - } + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + _apps[instanceId] // the app instance + ); + + F2.AppHandlers.__trigger( + _sAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY_AFTER, + _apps[instanceId] // the app instance + ); - //delete _apps[instanceId]; + delete _apps[instanceId]; } } }; diff --git a/tests/css/override.css b/tests/css/override.css new file mode 100644 index 00000000..98bfa4a5 --- /dev/null +++ b/tests/css/override.css @@ -0,0 +1,9 @@ +#TrivialReporter +{ + display: none; +} + +.f2-app-container +{ + display: none; +} \ No newline at end of file diff --git a/tests/css/page.css b/tests/css/page.css new file mode 100644 index 00000000..98bfa4a5 --- /dev/null +++ b/tests/css/page.css @@ -0,0 +1,9 @@ +#TrivialReporter +{ + display: none; +} + +.f2-app-container +{ + display: none; +} \ No newline at end of file diff --git a/tests/index.html b/tests/index.html index ac4d825e..46b19f5f 100644 --- a/tests/index.html +++ b/tests/index.html @@ -2,10 +2,11 @@ "http://www.w3.org/TR/html4/loose.dtd"> - Jasmine Spec Runner + F2 Jasmine - Unit Tests + @@ -23,6 +24,7 @@ + + + + + + + + + + + + + + + +
    + + +
    +
    +
    + +
    +
    +

    F2.Constants.AppHandlers

    + +

    +

    A convenient collection of all available appHandler events.

    +

    + +
    +
    + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:389
    + + + +
    +
    + + + + + +
    + +
    + + + + + +
    +

    Properties

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescription
    + APP_CREATE_ROOT +

    Identifies the create root method for use in AppHandlers.on/off/__trigger().

    + APP_DESTROY +

    Identifies the app destroy method for use in AppHandlers.on/off/__trigger().

    + APP_DESTROY_AFTER +

    Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().

    + APP_DESTROY_BEFORE +

    Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().

    + APP_RENDER +

    Identifies the app render method for use in AppHandlers.on/off/__trigger().

    + APP_RENDER_AFTER +

    Identifies the after app render method for use in AppHandlers.on/off/__trigger().

    + APP_RENDER_BEFORE +

    Identifies the before app render method for use in AppHandlers.on/off/__trigger().

    + AppHandlers +

    A collection of constants for the on/off method names in F2.AppHandlers.

    +
    + + + + + +
    + + + + + + + + +
    + +
    +

    + APP_CREATE_ROOT + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the create root method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:400
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_DESTROY + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the app destroy method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:440
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_DESTROY_AFTER + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:448
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_DESTROY_BEFORE + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:432
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_RENDER + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the app render method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:416
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_RENDER_AFTER + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the after app render method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:424
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + APP_RENDER_BEFORE + + String + + + + + + + final + + + + static + +

    + +

    +

    Identifies the before app render method for use in AppHandlers.on/off/__trigger().

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:408
    + + + + + +
    +
    + + + + + + + + +
    + +
    +

    + AppHandlers + + Object + + + + + + + + +

    + +

    +

    A collection of constants for the on/off method names in F2.AppHandlers.

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\app_handlers.js:394
    + + + + + +
    +
    + + + + + + + + +
    + +
    + + + + + + + + + + +
    +
    +
    + +
    + + +
    +
    + + + + + + + + + + \ No newline at end of file diff --git a/docs/sdk/classes/F2.Constants.Css.html b/docs/sdk/classes/F2.Constants.Css.html index 70007c7b..5c3f44e7 100644 --- a/docs/sdk/classes/F2.Constants.Css.html +++ b/docs/sdk/classes/F2.Constants.Css.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.Constants.Events.html b/docs/sdk/classes/F2.Constants.Events.html index bb1bd2c2..ba2251be 100644 --- a/docs/sdk/classes/F2.Constants.Events.html +++ b/docs/sdk/classes/F2.Constants.Events.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.Constants.Sockets.html b/docs/sdk/classes/F2.Constants.Sockets.html index 55ca82d0..cd8fe48d 100644 --- a/docs/sdk/classes/F2.Constants.Sockets.html +++ b/docs/sdk/classes/F2.Constants.Sockets.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.Constants.Views.html b/docs/sdk/classes/F2.Constants.Views.html index acc9d871..69058dff 100644 --- a/docs/sdk/classes/F2.Constants.Views.html +++ b/docs/sdk/classes/F2.Constants.Views.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.Constants.html b/docs/sdk/classes/F2.Constants.html index f8a0b07d..ae2c048f 100644 --- a/docs/sdk/classes/F2.Constants.html +++ b/docs/sdk/classes/F2.Constants.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html b/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html index f120c06a..463b0eb0 100644 --- a/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html +++ b/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.ContainerConfig.UI.html b/docs/sdk/classes/F2.ContainerConfig.UI.html index 7e4a74f5..afe769c3 100644 --- a/docs/sdk/classes/F2.ContainerConfig.UI.html +++ b/docs/sdk/classes/F2.ContainerConfig.UI.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.ContainerConfig.html b/docs/sdk/classes/F2.ContainerConfig.html index cfa1751c..fc94c263 100644 --- a/docs/sdk/classes/F2.ContainerConfig.html +++ b/docs/sdk/classes/F2.ContainerConfig.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.Events.html b/docs/sdk/classes/F2.Events.html index 896e7ac1..ddd231c5 100644 --- a/docs/sdk/classes/F2.Events.html +++ b/docs/sdk/classes/F2.Events.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.Rpc.html b/docs/sdk/classes/F2.Rpc.html index 00a562cb..abf6d22e 100644 --- a/docs/sdk/classes/F2.Rpc.html +++ b/docs/sdk/classes/F2.Rpc.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.UI.Modals.html b/docs/sdk/classes/F2.UI.Modals.html index 28658b8b..038a8c54 100644 --- a/docs/sdk/classes/F2.UI.Modals.html +++ b/docs/sdk/classes/F2.UI.Modals.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.UI.Views.html b/docs/sdk/classes/F2.UI.Views.html index 77beea16..09729fa5 100644 --- a/docs/sdk/classes/F2.UI.Views.html +++ b/docs/sdk/classes/F2.UI.Views.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.UI.html b/docs/sdk/classes/F2.UI.html index 845c781b..fb4ce9f8 100644 --- a/docs/sdk/classes/F2.UI.html +++ b/docs/sdk/classes/F2.UI.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/classes/F2.html b/docs/sdk/classes/F2.html index 506adaae..307b4540 100644 --- a/docs/sdk/classes/F2.html +++ b/docs/sdk/classes/F2.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/data.json b/docs/sdk/data.json index 6c340fed..7985e5e2 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -16,7 +16,8 @@ "name": "sdk\\src\\app_handlers.js", "modules": {}, "classes": { - "F2.AppHandlers": 1 + "F2.AppHandlers": 1, + "F2.Constants.AppHandlers": 1 }, "fors": {}, "namespaces": {} @@ -101,6 +102,7 @@ "classes": { "F2": 1, "F2.AppHandlers": 1, + "F2.Constants.AppHandlers": 1, "F2.App": 1, "F2.AppConfig": 1, "F2.AppManifest": 1, @@ -161,7 +163,21 @@ "namespace": "", "file": "sdk\\src\\app_handlers.js", "line": 1, - "description": "Allows container developers more flexibility when it comes to handling app interaction." + "description": "Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.3 this is the preferred method\nfor choosing how app rendering/interaction happens. This replaces the config versions of beforeAppRender, appRender, and afterAppRender. It also\nadds hooks into an app being removed/destroyed. As F2 evolves more hooks will be added to aid in container development." + }, + "F2.Constants.AppHandlers": { + "name": "F2.Constants.AppHandlers", + "shortname": "F2.Constants.AppHandlers", + "classitems": [], + "plugins": [], + "extensions": [], + "plugin_for": [], + "extension_for": [], + "module": "f2", + "namespace": "", + "file": "sdk\\src\\app_handlers.js", + "line": 389, + "description": "A convenient collection of all available appHandler events." }, "F2.App": { "name": "F2.App", @@ -631,7 +647,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 192, + "line": 193, "description": "Allows container developer to retrieve a special token which must be passed to\nall On and Off methods. This function will self destruct so be sure to keep the response\ninside of a closure somewhere.", "itemtype": "method", "name": "getToken", @@ -640,8 +656,8 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 206, - "description": "Allows F2 to get a token internally", + "line": 207, + "description": "Allows F2 to get a token internally. Token is required to call {{#crossLink \"F2.AppHandlers/\\_\\_trigger:method\"}}{{/crossLink}}.\nThis function will self destruct to eliminate other sources from using the {{#crossLink \"F2.AppHandlers/\\_\\_trigger:method\"}}{{/crossLink}}\nand other internal methods.", "itemtype": "method", "name": "__f2GetToken", "access": "private", @@ -651,18 +667,31 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 219, + "line": 222, "description": "Allows F2 to trigger specific app events internally.", "itemtype": "method", "name": "__trigger", "access": "private", "tagname": "", + "chainable": 1, + "params": [ + { + "name": "token", + "description": "The token received from {{#crossLink \"F2.AppHandlers/\\_\\_f2GetToken:method\"}}{{/crossLink}}.", + "type": "String" + }, + { + "name": "eventKey", + "description": "The event you want to fire. Complete list of event keys available in {{#crossLink \"F2.Constants/AppHandlers:property\"}}{{/crossLink}}.", + "type": "String" + } + ], "class": "F2.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 276, + "line": 282, "description": "Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.", "itemtype": "method", "name": "on", @@ -670,12 +699,12 @@ "params": [ { "name": "token", - "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:methods\"}}{{/crossLink}}.", + "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:methods\"}}{{/crossLink}} or {{#crossLink \"F2.AppHandlers/\\_\\_trigger:method\"}}{{/crossLink}}.", "type": "String" }, { - "name": "eventKey", - "description": "The event key to remove handler from {{#crossLink \"F2.AppHandlers/CONSTANTS:property\"}}{{/crossLink}}.", + "name": "eventKey{.namespace}", + "description": "The event key to determine what event you want to bind to. The namespace is useful for removal \npurposes. At this time it does not affect when an event is fired. Complete list of event keys available in \n{{#crossLink \"F2.Constants/AppHandlers:property\"}}{{/crossLink}}.", "type": "String" }, { @@ -685,14 +714,14 @@ } ], "example": [ - "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $(\"#my-container\").get(0));\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $(\"#my-container\").get(0));" + "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $(\"#my-container\").get(0));\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $(\"#my-container\").get(0));" ], "class": "F2.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 287, + "line": 295, "description": "Allows you to add listener method that will be triggered when a specific event happens.", "itemtype": "method", "name": "on", @@ -700,12 +729,12 @@ "params": [ { "name": "token", - "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:methods\"}}{{/crossLink}}.", + "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:method\"}}{{/crossLink}} or {{#crossLink \"F2.AppHandlers/\\_\\_trigger:method\"}}{{/crossLink}}.", "type": "String" }, { "name": "eventKey{.namespace}", - "description": "The event key to determine what listeners need to be removed. If no namespace is provided all\n listeners for the specified event type will be removed.\n Complete list available in {{#crossLink \"F2.Constants/AppHandlers:property\"}}{{/crossLink}}.", + "description": "The event key to determine what event you want to bind to. The namespace is useful for removal \npurposes. At this time it does not affect when an event is fired. Complete list of event keys available in \n{{#crossLink \"F2.Constants/AppHandlers:property\"}}{{/crossLink}}.", "type": "String" }, { @@ -715,14 +744,14 @@ } ], "example": [ - "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log(\"before app rendered!\"); });\t\t" + "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log(\"before app rendered!\"); });\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log(\"before app rendered!\"); });" ], "class": "F2.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 334, + "line": 343, "description": "Allows you to remove listener methods for specific events", "itemtype": "method", "name": "off", @@ -730,7 +759,7 @@ "params": [ { "name": "token", - "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:methods\"}}{{/crossLink}}.", + "description": "The token received from {{#crossLink \"F2.AppHandlers/getToken:method\"}}{{/crossLink}}.", "type": "String" }, { @@ -747,96 +776,96 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 381, + "line": 394, "description": "A collection of constants for the on/off method names in F2.AppHandlers.", "itemtype": "property", "name": "AppHandlers", "type": "Object", - "class": "F2.AppHandlers", + "class": "F2.Constants.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 387, + "line": 400, "description": "Identifies the create root method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_CREATE_ROOT", "type": "string", "static": 1, "final": 1, - "class": "F2.AppHandlers", + "class": "F2.Constants.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 395, + "line": 408, "description": "Identifies the before app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER_BEFORE", "type": "string", "static": 1, "final": 1, - "class": "F2.AppHandlers", + "class": "F2.Constants.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 403, + "line": 416, "description": "Identifies the app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER", "type": "string", "static": 1, "final": 1, - "class": "F2.AppHandlers", + "class": "F2.Constants.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 411, + "line": 424, "description": "Identifies the after app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER_AFTER", "type": "string", "static": 1, "final": 1, - "class": "F2.AppHandlers", + "class": "F2.Constants.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 419, + "line": 432, "description": "Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY_BEFORE", "type": "string", "static": 1, "final": 1, - "class": "F2.AppHandlers", + "class": "F2.Constants.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 427, + "line": 440, "description": "Identifies the app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY", "type": "string", "static": 1, "final": 1, - "class": "F2.AppHandlers", + "class": "F2.Constants.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 435, + "line": 448, "description": "Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY_AFTER", "type": "string", "static": 1, "final": 1, - "class": "F2.AppHandlers", + "class": "F2.Constants.AppHandlers", "module": "f2" }, { @@ -2412,11 +2441,11 @@ "warnings": [ { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:276" + "line": " sdk\\src\\app_handlers.js:282" }, { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:287" + "line": " sdk\\src\\app_handlers.js:295" }, { "message": "replacing incorrect tag: returns with return", diff --git a/docs/sdk/files/sdk_src_F2.js.html b/docs/sdk/files/sdk_src_F2.js.html index e2bc9878..d6a4c51b 100644 --- a/docs/sdk/files/sdk_src_F2.js.html +++ b/docs/sdk/files/sdk_src_F2.js.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html index ea94d2ad..692b52c6 100644 --- a/docs/sdk/files/sdk_src_app_handlers.js.html +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -222,10 +226,11 @@

    File: sdk\src\app_handlers.js

     /**
    - * Allows container developers more flexibility when it comes to handling app interaction.
    + * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.3 this is the preferred method
    + * for choosing how app rendering/interaction happens. This replaces the config versions of beforeAppRender, appRender, and afterAppRender. It also
    + * adds hooks into an app being removed/destroyed. As F2 evolves more hooks will be added to aid in container development.
      * @class F2.AppHandlers
      */
    -
     F2.extend('AppHandlers', (function() {
     
     	// the hidden token that we will check against every time someone tries to add, remove, fire handler
    @@ -427,7 +432,9 @@ 

    File: sdk\src\app_handlers.js

    return _ct; }, /** - * Allows F2 to get a token internally + * Allows F2 to get a token internally. Token is required to call {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * This function will self destruct to eliminate other sources from using the {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}} + * and other internal methods. * @method __f2GetToken * @private **/ @@ -443,6 +450,9 @@

    File: sdk\src\app_handlers.js

    * Allows F2 to trigger specific app events internally. * @method __trigger * @private + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/\_\_f2GetToken:method"}}{{/crossLink}}. + * @param {String} eventKey The event you want to fire. Complete list of event keys available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. **/ __trigger: function(token, eventKey) // additional arguments will likely be passed { @@ -500,24 +510,27 @@

    File: sdk\src\app_handlers.js

    * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in + * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0)); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all - * listeners for the specified event type will be removed. - * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in + * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); }); **/ on: function(token, eventKey, func_or_element) { @@ -558,7 +571,7 @@

    File: sdk\src\app_handlers.js

    * Allows you to remove listener methods for specific events * @method off * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}}. * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all * listeners for the specified event type will be removed. * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. @@ -600,6 +613,10 @@

    File: sdk\src\app_handlers.js

    }; })()); +/** + * A convenient collection of all available appHandler events. + * @class F2.Constants.AppHandlers + */ F2.extend('Constants', { /** * A collection of constants for the on/off method names in F2.AppHandlers. diff --git a/docs/sdk/files/sdk_src_classes.js.html b/docs/sdk/files/sdk_src_classes.js.html index dfea6a60..bdc2be12 100644 --- a/docs/sdk/files/sdk_src_classes.js.html +++ b/docs/sdk/files/sdk_src_classes.js.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/files/sdk_src_constants.js.html b/docs/sdk/files/sdk_src_constants.js.html index 33ccdb31..6a2949f0 100644 --- a/docs/sdk/files/sdk_src_constants.js.html +++ b/docs/sdk/files/sdk_src_constants.js.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index 8081079c..d005f72d 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/files/sdk_src_events.js.html b/docs/sdk/files/sdk_src_events.js.html index 8203eda5..ad66995f 100644 --- a/docs/sdk/files/sdk_src_events.js.html +++ b/docs/sdk/files/sdk_src_events.js.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/files/sdk_src_rpc.js.html b/docs/sdk/files/sdk_src_rpc.js.html index 789b4623..3ac1df06 100644 --- a/docs/sdk/files/sdk_src_rpc.js.html +++ b/docs/sdk/files/sdk_src_rpc.js.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/files/sdk_src_ui.js.html b/docs/sdk/files/sdk_src_ui.js.html index 7514b498..53469f20 100644 --- a/docs/sdk/files/sdk_src_ui.js.html +++ b/docs/sdk/files/sdk_src_ui.js.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 3770c611..b1ef7d4f 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -249,7 +253,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/docs/sdk/modules/f2.html b/docs/sdk/modules/f2.html index 1bd0d462..bf3c5a5b 100644 --- a/docs/sdk/modules/f2.html +++ b/docs/sdk/modules/f2.html @@ -118,6 +118,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -170,6 +172,8 @@
  • F2.Constants
  • +
  • F2.Constants.AppHandlers
  • +
  • F2.Constants.Css
  • F2.Constants.Events
  • @@ -289,6 +293,12 @@

    f2 Module

    +
  • + + F2.Constants.AppHandlers + +
  • +
  • F2.Constants.Css diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 6bda05c1..5432d92f 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -1549,10 +1549,11 @@ F2 = { /** - * Allows container developers more flexibility when it comes to handling app interaction. + * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.3 this is the preferred method + * for choosing how app rendering/interaction happens. This replaces the config versions of beforeAppRender, appRender, and afterAppRender. It also + * adds hooks into an app being removed/destroyed. As F2 evolves more hooks will be added to aid in container development. * @class F2.AppHandlers */ - F2.extend('AppHandlers', (function() { // the hidden token that we will check against every time someone tries to add, remove, fire handler @@ -1754,7 +1755,9 @@ F2.extend('AppHandlers', (function() { return _ct; }, /** - * Allows F2 to get a token internally + * Allows F2 to get a token internally. Token is required to call {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * This function will self destruct to eliminate other sources from using the {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}} + * and other internal methods. * @method __f2GetToken * @private **/ @@ -1770,6 +1773,9 @@ F2.extend('AppHandlers', (function() { * Allows F2 to trigger specific app events internally. * @method __trigger * @private + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/\_\_f2GetToken:method"}}{{/crossLink}}. + * @param {String} eventKey The event you want to fire. Complete list of event keys available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. **/ __trigger: function(token, eventKey) // additional arguments will likely be passed { @@ -1827,24 +1833,27 @@ F2.extend('AppHandlers', (function() { * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in + * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0)); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all - * listeners for the specified event type will be removed. - * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in + * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); }); **/ on: function(token, eventKey, func_or_element) { @@ -1885,7 +1894,7 @@ F2.extend('AppHandlers', (function() { * Allows you to remove listener methods for specific events * @method off * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}}. * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all * listeners for the specified event type will be removed. * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. @@ -1927,6 +1936,10 @@ F2.extend('AppHandlers', (function() { }; })()); +/** + * A convenient collection of all available appHandler events. + * @class F2.Constants.AppHandlers + */ F2.extend('Constants', { /** * A collection of constants for the on/off method names in F2.AppHandlers. diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index f70c6340..976e1ef9 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -215,10 +215,11 @@ F2 = { /** - * Allows container developers more flexibility when it comes to handling app interaction. + * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.3 this is the preferred method + * for choosing how app rendering/interaction happens. This replaces the config versions of beforeAppRender, appRender, and afterAppRender. It also + * adds hooks into an app being removed/destroyed. As F2 evolves more hooks will be added to aid in container development. * @class F2.AppHandlers */ - F2.extend('AppHandlers', (function() { // the hidden token that we will check against every time someone tries to add, remove, fire handler @@ -420,7 +421,9 @@ F2.extend('AppHandlers', (function() { return _ct; }, /** - * Allows F2 to get a token internally + * Allows F2 to get a token internally. Token is required to call {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * This function will self destruct to eliminate other sources from using the {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}} + * and other internal methods. * @method __f2GetToken * @private **/ @@ -436,6 +439,9 @@ F2.extend('AppHandlers', (function() { * Allows F2 to trigger specific app events internally. * @method __trigger * @private + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/\_\_f2GetToken:method"}}{{/crossLink}}. + * @param {String} eventKey The event you want to fire. Complete list of event keys available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. **/ __trigger: function(token, eventKey) // additional arguments will likely be passed { @@ -493,24 +499,27 @@ F2.extend('AppHandlers', (function() { * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in + * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0)); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all - * listeners for the specified event type will be removed. - * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in + * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); }); **/ on: function(token, eventKey, func_or_element) { @@ -551,7 +560,7 @@ F2.extend('AppHandlers', (function() { * Allows you to remove listener methods for specific events * @method off * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}}. * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all * listeners for the specified event type will be removed. * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. @@ -593,6 +602,10 @@ F2.extend('AppHandlers', (function() { }; })()); +/** + * A convenient collection of all available appHandler events. + * @class F2.Constants.AppHandlers + */ F2.extend('Constants', { /** * A collection of constants for the on/off method names in F2.AppHandlers. diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index dd3bee28..a355f159 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -1,8 +1,9 @@ /** - * Allows container developers more flexibility when it comes to handling app interaction. + * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.3 this is the preferred method + * for choosing how app rendering/interaction happens. This replaces the config versions of beforeAppRender, appRender, and afterAppRender. It also + * adds hooks into an app being removed/destroyed. As F2 evolves more hooks will be added to aid in container development. * @class F2.AppHandlers */ - F2.extend('AppHandlers', (function() { // the hidden token that we will check against every time someone tries to add, remove, fire handler @@ -204,7 +205,9 @@ F2.extend('AppHandlers', (function() { return _ct; }, /** - * Allows F2 to get a token internally + * Allows F2 to get a token internally. Token is required to call {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * This function will self destruct to eliminate other sources from using the {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}} + * and other internal methods. * @method __f2GetToken * @private **/ @@ -220,6 +223,9 @@ F2.extend('AppHandlers', (function() { * Allows F2 to trigger specific app events internally. * @method __trigger * @private + * @chainable + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/\_\_f2GetToken:method"}}{{/crossLink}}. + * @param {String} eventKey The event you want to fire. Complete list of event keys available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. **/ __trigger: function(token, eventKey) // additional arguments will likely be passed { @@ -277,24 +283,27 @@ F2.extend('AppHandlers', (function() { * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey The event key to remove handler from {{#crossLink "F2.AppHandlers/CONSTANTS:property"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in + * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.my_app_id', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0)); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all - * listeners for the specified event type will be removed. - * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in + * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); }); **/ on: function(token, eventKey, func_or_element) { @@ -335,7 +344,7 @@ F2.extend('AppHandlers', (function() { * Allows you to remove listener methods for specific events * @method off * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}}. * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all * listeners for the specified event type will be removed. * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. @@ -377,6 +386,10 @@ F2.extend('AppHandlers', (function() { }; })()); +/** + * A convenient collection of all available appHandler events. + * @class F2.Constants.AppHandlers + */ F2.extend('Constants', { /** * A collection of constants for the on/off method names in F2.AppHandlers. diff --git a/tests/index-amd.html b/tests/index-amd.html index b7af233e..28f66c44 100644 --- a/tests/index-amd.html +++ b/tests/index-amd.html @@ -1,10 +1,11 @@ - Jasmine Spec Runner + F2 (AMD) - Jasmine Unit Tests + @@ -22,6 +23,7 @@ + - + + + diff --git a/examples/container/js/container.js b/examples/container/js/container.js index ab217d3c..bd206355 100644 --- a/examples/container/js/container.js +++ b/examples/container/js/container.js @@ -1,37 +1,28 @@ $(function() { - - var containerAppHandlerToken = F2.AppHandlers.getToken(); - + /** * Init Container */ F2.init({ - UI:{ - Mask:{ - loadingIcon:'./img/ajax-loader.gif' - } + + afterAppRender: function (app, html) { + var el = $(app.root).append(html); + F2.UI.hideMask(app.instanceId, el); + return el; }, - supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE], - secureAppPagePath: "secure.html" // this should go on a separate domain from index.html - }); - - // Define these prior to init - F2.AppHandlers - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_CREATE_ROOT, - function(appConfig) - { - var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, appConfig.views); - var hasHelp = F2.inArray(F2.Constants.Views.HELP, appConfig.views); - var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, appConfig.views); + + beforeAppRender: function(app) { + + var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, app.views); + var hasHelp = F2.inArray(F2.Constants.Views.HELP, app.views); + var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, app.views); var showDivider = hasSettings || hasHelp || hasAbout; - var gridWidth = appConfig.minGridSize || 3; + var gridWidth = app.minGridSize || 3; - appConfig.root = $([ + var appRoot = $([ '
    ', '
    ', - '

    ', appConfig.name.toUpperCase(), '

    ', + '

    ', app.name.toUpperCase(), '

    ', '
    ', '
    ', '
    ', '
    ' - ].join('')).get(0); - } - ) - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_RENDER_BEFORE, - function(appConfig){ - F2.UI.hideMask(appConfig.instanceId, appConfig.root); - $(appConfig.root).addClass("render-before-testing"); - } - ) - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_RENDER, - $("body").get(0) - ) - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_RENDER_AFTER, - function(appConfig){ - $(appConfig.root).addClass("render-after-testing"); - F2.UI.hideMask(appConfig.instanceId, appConfig.root); - } - ) - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY, - function(appInstance) { - if(!appInstance) { return; } - - // call the apps destroy method, if it has one - if(appInstance.app && appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") - { - appInstance.app.Destroy(); - } - // warn the container developer/app developer that even though they have a destroy method it hasn't been - else if(appInstance.app && appInstance.app.Destroy) - { - F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); + ].join('')).appendTo($('#mainContent div.row')); + + // show loader + F2.UI.showMask(app.instanceId, appRoot, true); + + return appRoot; + }, + + UI:{ + Mask:{ + loadingIcon:'./img/ajax-loader.gif' } - - // fade out and remove the root - jQuery(appInstance.config.root).slideUp(100, function() { - jQuery(this).remove(); - }); - } - ); - - + }, + + supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE], + secureAppPagePath: "secure.html" // this should go on a separate domain from index.html + }); + //listen for app symbol change events and re-broadcast F2.Events.on( F2.Constants.Events.APP_SYMBOL_CHANGE, From 52ff9e60722988625124321425af4001c2704d1f Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Wed, 27 Mar 2013 22:44:43 -0600 Subject: [PATCH 032/181] Adding container-app-handlers.js as apparently it didn't go through in my last commit. --- .../container/js/container-app-handlers.js | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 examples/container/js/container-app-handlers.js diff --git a/examples/container/js/container-app-handlers.js b/examples/container/js/container-app-handlers.js new file mode 100644 index 00000000..3ac86af2 --- /dev/null +++ b/examples/container/js/container-app-handlers.js @@ -0,0 +1,138 @@ +$(function() { + + var containerAppHandlerToken = F2.AppHandlers.getToken(); + + /** + * Init Container + */ + F2.init({ + UI:{ + Mask:{ + loadingIcon:'./img/ajax-loader.gif' + } + }, + supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE], + secureAppPagePath: "secure.html" // this should go on a separate domain from index.html + }); + + // Define these prior to init + F2.AppHandlers + .on( + containerAppHandlerToken, + F2.Constants.AppHandlers.APP_CREATE_ROOT, + function(appConfig) + { + var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, appConfig.views); + var hasHelp = F2.inArray(F2.Constants.Views.HELP, appConfig.views); + var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, appConfig.views); + var showDivider = hasSettings || hasHelp || hasAbout; + var gridWidth = appConfig.minGridSize || 3; + + appConfig.root = $([ + '
    ', + '
    ', + '

    ', appConfig.name.toUpperCase(), '

    ', + '
    ', + '', + '', + '
    ', + '
    ', + '
    ' + ].join('')).get(0); + } + ) + .on( + containerAppHandlerToken, + F2.Constants.AppHandlers.APP_RENDER, + $("body").get(0) + ) + .on( + containerAppHandlerToken, + F2.Constants.AppHandlers.APP_RENDER_AFTER, + function(appConfig){ + F2.UI.hideMask(appConfig.instanceId, appConfig.root); + } + ) + .on( + containerAppHandlerToken, + F2.Constants.AppHandlers.APP_DESTROY, + function(appInstance) { + if(!appInstance) { return; } + + // call the apps destroy method, if it has one + if(appInstance.app && appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + { + appInstance.app.Destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been + else if(appInstance.app && appInstance.app.Destroy) + { + F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); + } + + // fade out and remove the root + jQuery(appInstance.config.root).fadeOut(250, function() { + jQuery(this).remove(); + }); + } + ); + + + //listen for app symbol change events and re-broadcast + F2.Events.on( + F2.Constants.Events.APP_SYMBOL_CHANGE, + function(data){ + F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: data.symbol, name: data.name || "" }); + } + ); + + /** + * init symbol lookup in navbar + */ + $("#symbolLookup") + .on('keypress', function(event) { + if (event.keyCode == 13) { + event.preventDefault(); + } + }) + .autocomplete({ + autoFocus:true, + minLength: 0, + select: function (event, ui) { + F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: ui.item.value, name: ui.item.label }); + }, + source: function (request, response) { + + $.ajax({ + url: "http://dev.markitondemand.com/api/Lookup/jsonp", + dataType: "jsonp", + data: { + input: request.term + }, + success: function (data) { + response($.map(data, function (item) { + return { + label: item.Name + " (" + item.Exchange + ")", + value: item.Symbol + } + })); + }, + open: function() { + $(this).removeClass("ui-corner-all").addClass("ui-corner-top"); + }, + close: function() { + $(this).removeClass("ui-corner-top").addClass("ui-corner-all"); + } + }); + } + }); + +}); \ No newline at end of file From e7202fa9b856707ef1af4c335e6863ae5a6aa3e9 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 28 Mar 2013 16:52:44 -0600 Subject: [PATCH 033/181] Initial commit. From 9c355a182f2c8b6573ed00c5e7c8d9fb8a97c74a Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 28 Mar 2013 17:55:23 -0600 Subject: [PATCH 034/181] Merge remote-tracking branch 'remotes/origin/1.2-wip-travis-ci' into HEAD Conflicts: build/F2.json docs/app-development.html docs/container-development.html docs/extending-f2.html docs/f2js-sdk.html docs/index.html docs/sdk/classes/F2.App.html docs/sdk/classes/F2.AppConfig.html docs/sdk/classes/F2.AppManifest.AppContent.html docs/sdk/classes/F2.AppManifest.html docs/sdk/classes/F2.Constants.Css.html docs/sdk/classes/F2.Constants.Events.html docs/sdk/classes/F2.Constants.Sockets.html docs/sdk/classes/F2.Constants.Views.html docs/sdk/classes/F2.Constants.html docs/sdk/classes/F2.ContainerConfig.UI.Mask.html docs/sdk/classes/F2.ContainerConfig.UI.html docs/sdk/classes/F2.ContainerConfig.html docs/sdk/classes/F2.Events.html docs/sdk/classes/F2.Rpc.html docs/sdk/classes/F2.UI.Modals.html docs/sdk/classes/F2.UI.Views.html docs/sdk/classes/F2.UI.html docs/sdk/classes/F2.html docs/sdk/files/sdk_src_classes.js.html docs/sdk/files/sdk_src_constants.js.html docs/sdk/files/sdk_src_container.js.html docs/sdk/files/sdk_src_events.js.html docs/sdk/files/sdk_src_rpc.js.html docs/sdk/files/sdk_src_ui.js.html docs/sdk/index.html docs/sdk/modules/f2.html sdk/f2.no-third-party.js --- .travis.yml | 12 ++ README.md | 6 + build/F2.json | 20 +-- build/README.md | 6 + docs/app-development.html | 36 ++-- docs/container-development.html | 32 ++-- docs/extending-f2.html | 20 +-- docs/f2js-sdk.html | 24 +-- docs/index.html | 24 +-- docs/js/f2.js | 2 +- docs/js/f2.min.js | 2 +- docs/sdk/classes/F2.App.html | 26 +-- docs/sdk/classes/F2.AppConfig.html | 86 +++++----- .../classes/F2.AppManifest.AppContent.html | 24 +-- docs/sdk/classes/F2.AppManifest.html | 30 ++-- docs/sdk/classes/F2.Constants.Css.html | 68 ++++---- docs/sdk/classes/F2.Constants.Events.html | 32 ++-- docs/sdk/classes/F2.Constants.Sockets.html | 34 ++-- docs/sdk/classes/F2.Constants.Views.html | 32 ++-- docs/sdk/classes/F2.Constants.html | 18 +- .../classes/F2.ContainerConfig.UI.Mask.html | 32 ++-- docs/sdk/classes/F2.ContainerConfig.UI.html | 18 +- docs/sdk/classes/F2.ContainerConfig.html | 48 +++--- docs/sdk/classes/F2.Events.html | 30 ++-- docs/sdk/classes/F2.Rpc.html | 52 +++--- docs/sdk/classes/F2.UI.Modals.html | 22 +-- docs/sdk/classes/F2.UI.Views.html | 24 +-- docs/sdk/classes/F2.UI.html | 38 ++--- docs/sdk/classes/F2.html | 108 ++++++------ docs/sdk/files/sdk_src_classes.js.html | 20 +-- docs/sdk/files/sdk_src_constants.js.html | 20 +-- docs/sdk/files/sdk_src_container.js.html | 20 +-- docs/sdk/files/sdk_src_events.js.html | 20 +-- docs/sdk/files/sdk_src_rpc.js.html | 20 +-- docs/sdk/files/sdk_src_ui.js.html | 20 +-- docs/sdk/index.html | 18 +- docs/sdk/modules/f2.html | 18 +- examples/apps/JavaScript/Chart/app.css | 2 +- .../apps/JavaScript/CompareTool/appclass.js | 20 +++ .../JavaScript/CompareTool/css/compare.css | 58 +++++++ .../CompareTool/img/ajax_spinner.gif | Bin 0 -> 1456 bytes .../CompareTool/js/angular-resource.min.js | 10 ++ .../JavaScript/CompareTool/js/angular.min.js | 161 ++++++++++++++++++ .../apps/JavaScript/CompareTool/js/compare.js | 161 ++++++++++++++++++ .../JavaScript/CompareTool/js/moment.min.js | 6 + .../apps/JavaScript/CompareTool/manifest.js | 52 ++++++ .../apps/JavaScript/HelloWorld/appclass.js | 14 +- .../apps/JavaScript/Watchlist/appclass.js | 2 +- examples/apps/PHP/F2wits/manifest.js | 2 +- examples/container/js/sampleApps.js | 34 ++-- f2.js | 2 +- sdk/f2.debug.js | 21 ++- sdk/f2.min.js | 2 +- sdk/f2.no-third-party.js | 25 +-- sdk/f2.nuspec | 2 +- sdk/src/container.js | 21 ++- tests/index-amd.html | 13 +- tests/index.html | 13 +- tests/js/console-runner.js | 104 +++++++++++ tests/js/test.js | 0 tests/spec/container-spec.js | 82 ++++++++- tests/spec/spec-helpers.js | 9 +- 62 files changed, 1300 insertions(+), 578 deletions(-) create mode 100644 .travis.yml create mode 100644 examples/apps/JavaScript/CompareTool/appclass.js create mode 100644 examples/apps/JavaScript/CompareTool/css/compare.css create mode 100644 examples/apps/JavaScript/CompareTool/img/ajax_spinner.gif create mode 100644 examples/apps/JavaScript/CompareTool/js/angular-resource.min.js create mode 100644 examples/apps/JavaScript/CompareTool/js/angular.min.js create mode 100644 examples/apps/JavaScript/CompareTool/js/compare.js create mode 100644 examples/apps/JavaScript/CompareTool/js/moment.min.js create mode 100644 examples/apps/JavaScript/CompareTool/manifest.js create mode 100644 tests/js/console-runner.js create mode 100644 tests/js/test.js diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..774fb676 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: ruby +rvm: + - 1.9.3 +notifications: + email: false +before_script: + - "export DISPLAY=:99.0" + - "sh -e /etc/init.d/xvfb start" +script: + - "wget https://raw.github.com/mark-rushakoff/OpenPhantomScripts/master/phantom-jasmine.js" + - "phantomjs phantom-jasmine.js tests/index.html" + - "phantomjs phantom-jasmine.js tests/index-amd.html" \ No newline at end of file diff --git a/README.md b/README.md index 86c7cbe8..9aa90aa7 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,12 @@ For help, run: We are using [markitdown](https://github.com/markitondemand/markitdown), a lightweight pandoc wrapper, for converting markdown files to HTML for the [docs](http://docs.openf2.org). +#### NuGet Package + +Good news if you're using C#! We have an [F2 NuGet package available](https://nuget.org/packages/F2/). In the Package Manager Console run: + +`PM> Install-Package F2` + ### Collaboration Join our team and help contribute to F2 on GitHub. Begin by reading our [contribution guidelines](CONTRIBUTING.md), and then start by [forking the repo](https://github.com/OpenF2/F2/fork_select), sending [pull requests](https://help.github.com/articles/using-pull-requests), or [submitting issues](https://github.com/OpenF2/F2/issues). diff --git a/build/F2.json b/build/F2.json index 6c7e040c..11936443 100644 --- a/build/F2.json +++ b/build/F2.json @@ -1,16 +1,16 @@ { "docs": { - "version": "1.1.0", - "shortVersion": "1.1", - "releaseDate": "2013-03-18T14:42:52.515Z", - "lastUpdateDate": "2013-03-18T14:42:54.875Z", - "lastUpdateDateFormatted": "18 March 2013" + "version": "1.2.0", + "shortVersion": "1.2", + "releaseDate": "2013-03-07T19:10:50.102Z", + "lastUpdateDate": "2013-03-14T04:11:25.360Z", + "lastUpdateDateFormatted": "13 March 2013" }, "sdk": { - "version": "1.1.1", - "shortVersion": "1.1", - "releaseDate": "2013-03-18T14:42:52.515Z", - "lastUpdateDate": "2013-03-18T14:42:53.243Z" + "version": "1.2.0", + "shortVersion": "1.2", + "releaseDate": "2013-03-07T19:10:50.102Z", + "lastUpdateDate": "2013-03-17T16:11:54.929Z" }, - "branch": "master" + "branch": "1.2-wip" } \ No newline at end of file diff --git a/build/README.md b/build/README.md index 164c3b90..8e1bd13d 100644 --- a/build/README.md +++ b/build/README.md @@ -18,6 +18,12 @@ For help, run: Before you begin coding, familiarize yourself with our [contribution guidelines](CONTRIBUTING.md), and then start by [forking the repo](https://github.com/OpenF2/F2/fork_select), sending [pull requests](https://help.github.com/articles/using-pull-requests), or [submitting issues](https://github.com/OpenF2/F2/issues). +## NuGet Package + +Good news if you're using C#! We have an [F2 NuGet package available](https://nuget.org/packages/F2/). In the Package Manager Console run: + +`PM> Install-Package F2` + ## Versioning To adhere to industry standards, F2 will be maintained under the Semantic Versioning guidelines as much as possible. diff --git a/docs/app-development.html b/docs/app-development.html index 19b42ecd..2f78e8ce 100644 --- a/docs/app-development.html +++ b/docs/app-development.html @@ -3,8 +3,8 @@ F2 - App Development - - + + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - - - + + + \ No newline at end of file diff --git a/docs/container-development.html b/docs/container-development.html index 7b178214..451202a6 100644 --- a/docs/container-development.html +++ b/docs/container-development.html @@ -3,8 +3,8 @@ F2 - Container Development - - + + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - - - + + + \ No newline at end of file diff --git a/docs/extending-f2.html b/docs/extending-f2.html index eddf81b9..33d3a16e 100644 --- a/docs/extending-f2.html +++ b/docs/extending-f2.html @@ -3,8 +3,8 @@ F2 - Extending F2 - - + + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - - - + + + \ No newline at end of file diff --git a/docs/f2js-sdk.html b/docs/f2js-sdk.html index 173d1068..5e1fa5f4 100644 --- a/docs/f2js-sdk.html +++ b/docs/f2js-sdk.html @@ -3,8 +3,8 @@ F2 - F2.js SDK - - + + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - - - + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index acd1565a..e7426c1d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,8 +6,8 @@ - - + + @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - - - + + + \ No newline at end of file diff --git a/docs/js/f2.js b/docs/js/f2.js index 78bb3ace..3248f5b6 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -120,7 +120,7 @@ F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAIN F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
  • "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); exports.F2 = F2; diff --git a/docs/js/f2.min.js b/docs/js/f2.min.js index 78bb3ace..3248f5b6 100644 --- a/docs/js/f2.min.js +++ b/docs/js/f2.min.js @@ -120,7 +120,7 @@ F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAIN F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); exports.F2 = F2; diff --git a/docs/sdk/classes/F2.App.html b/docs/sdk/classes/F2.App.html index 7115dcbb..3a01ab11 100644 --- a/docs/sdk/classes/F2.App.html +++ b/docs/sdk/classes/F2.App.html @@ -3,8 +3,8 @@ F2 - F2.App - - + + @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ + + + - - + + @@ -33,6 +36,11 @@ jasmineEnv.specFilter = function(spec) { return htmlReporter.specFilter(spec); }; + + jasmine.getEnv().addReporter(new jasmine.TrivialReporter()); + + var console_reporter = new jasmine.ConsoleReporter() + jasmine.getEnv().addReporter(console_reporter); var currentWindowOnload = window.onload; @@ -55,5 +63,6 @@ + diff --git a/tests/index.html b/tests/index.html index bef41483..ac4d825e 100644 --- a/tests/index.html +++ b/tests/index.html @@ -9,9 +9,12 @@ - + + + + - + @@ -33,6 +36,11 @@ jasmineEnv.specFilter = function(spec) { return htmlReporter.specFilter(spec); }; + + jasmine.getEnv().addReporter(new jasmine.TrivialReporter()); + + var console_reporter = new jasmine.ConsoleReporter() + jasmine.getEnv().addReporter(console_reporter); var currentWindowOnload = window.onload; @@ -54,5 +62,6 @@ + diff --git a/tests/js/console-runner.js b/tests/js/console-runner.js new file mode 100644 index 00000000..e1975959 --- /dev/null +++ b/tests/js/console-runner.js @@ -0,0 +1,104 @@ +/** + Jasmine Reporter that outputs test results to the browser console. + Useful for running in a headless environment such as PhantomJs, ZombieJs etc. + + Usage: + // From your html file that loads jasmine: + jasmine.getEnv().addReporter(new jasmine.ConsoleReporter()); + jasmine.getEnv().execute(); +*/ + +(function(jasmine, console) { + if (!jasmine) { + throw "jasmine library isn't loaded!"; + } + + var ANSI = {} + ANSI.color_map = { + "green" : 32, + "red" : 31 + } + + ANSI.colorize_text = function(text, color) { + var color_code = this.color_map[color]; + return "\033[" + color_code + "m" + text + "\033[0m"; + } + + var ConsoleReporter = function() { + if (!console || !console.log) { throw "console isn't present!"; } + this.status = this.statuses.stopped; + }; + + var proto = ConsoleReporter.prototype; + proto.statuses = { + stopped : "stopped", + running : "running", + fail : "fail", + success : "success" + }; + + proto.reportRunnerStarting = function(runner) { + this.status = this.statuses.running; + this.start_time = (new Date()).getTime(); + this.executed_specs = 0; + this.passed_specs = 0; + this.log("Starting..."); + }; + + proto.reportRunnerResults = function(runner) { + var failed = this.executed_specs - this.passed_specs; + var spec_str = this.executed_specs + (this.executed_specs === 1 ? " spec, " : " specs, "); + var fail_str = failed + (failed === 1 ? " failure in " : " failures in "); + var color = (failed > 0)? "red" : "green"; + var dur = (new Date()).getTime() - this.start_time; + + this.log(""); + this.log("Finished"); + this.log("-----------------"); + this.log(spec_str + fail_str + (dur/1000) + "s.", color); + + this.status = (failed > 0)? this.statuses.fail : this.statuses.success; + + /* Print something that signals that testing is over so that headless browsers + like PhantomJs know when to terminate. */ + this.log(""); + this.log("ConsoleReporter finished"); + }; + + + proto.reportSpecStarting = function(spec) { + this.executed_specs++; + }; + + proto.reportSpecResults = function(spec) { + if (spec.results().passed()) { + this.passed_specs++; + return; + } + + var resultText = spec.suite.description + " : " + spec.description; + this.log(resultText, "red"); + + var items = spec.results().getItems() + for (var i = 0; i < items.length; i++) { + var trace = items[i].trace.stack || items[i].trace; + this.log(trace, "red"); + } + }; + + proto.reportSuiteResults = function(suite) { + if (!suite.parentSuite) { return; } + var results = suite.results(); + var failed = results.totalCount - results.passedCount; + var color = (failed > 0)? "red" : "green"; + this.log(suite.getFullName() + ": " + results.passedCount + " of " + results.totalCount + " passed.", color); + }; + + proto.log = function(str, color) { + var text = (color != undefined)? ANSI.colorize_text(str, color) : str; + console.log(text) + }; + + jasmine.ConsoleReporter = ConsoleReporter; +})(jasmine, console); + diff --git a/tests/js/test.js b/tests/js/test.js new file mode 100644 index 00000000..e69de29b diff --git a/tests/spec/container-spec.js b/tests/spec/container-spec.js index ce3fd5f2..8db5a19f 100644 --- a/tests/spec/container-spec.js +++ b/tests/spec/container-spec.js @@ -28,7 +28,7 @@ describe('F2.isInit', function() { }); }); -describe('F2.registerApps', function() { +describe('F2.registerApps - basic', function() { var async = new AsyncSpec(this); async.beforeEachReloadF2(function() { @@ -69,4 +69,84 @@ describe('F2.registerApps', function() { }).toLog('The length of "apps" does not equal the length of "appManifests"'); }); + it('should not fail when a single appManifest is passed (#55)', function() { + + var passedMessage = false; + F2.log = function(message) { + passedMessage = true; + }; + + runs(function() { + F2.registerApps({appId:'com_openf2_tests_helloworld', manifestUrl:'http://www.openf2.org'}, {apps:[{html:'
    '}]}); + }) + + // wait long enough for registerApps to have failed + waits(1000); + + // F2.log should not have run + runs(function() { + expect(passedMessage).toBeFalsy(); + }) + }); +}); + +describe('F2.registerApps - rendering', function() { + + var async = new AsyncSpec(this); + async.beforeEachReloadF2(function() { + // nothing to do after reload + }); + + var appConfig = { + appId: 'com_openf2_tests_helloworld', + manifestUrl: 'http://www.openf2.org' + }; + var appManifest = { + scripts:[], + styles:[], + inlineScripts:[], + apps:[ + { + html: '
    Testing
    ' + } + ] + }; + + it('should fire beforeAppRender when it is defined', function() { + var isFired = false; + F2.init({ + beforeAppRender: function() { + isFired = true; + } + }); + F2.registerApps(appConfig, [appManifest]); + waitsFor(function() { + return isFired; + }, 'beforeAppRender was never fired', 10000); + runs(function() { + expect(isFired).toBeTruthy(); + }) + }); + + it('should allow beforeAppRender to return null', function() { + F2.init({ + beforeAppRender: function() { + return null; + } + }); + + F2.registerApps(appConfig, [appManifest]); + }); + /* + it('should eval AppManifest.inlineScripts when AppManifest.scripts are defined', function(){ + F2.init(); + F2.registerApps([{appId:'com_openf2_tests_helloworld', manifestUrl:'/'}], [{"inlineScripts": ["(function(){F2.inlineScriptsEvaluated=true;})()"], "scripts":["http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"],"apps":[{}]}]); + expect(F2.inlineScriptsEvaluated).not.toBeUndefined(); + }); + */ + it('should eval AppManifest.inlineScripts when AppManifest.scripts are not defined', function(){ + F2.init(); + F2.registerApps([{appId:'com_openf2_tests_helloworld', manifestUrl:'/'}], [{"inlineScripts": ["(function(){F2.inlineScriptsEvaluated=true;})()"],"apps":[{}]}]); + expect(F2.inlineScriptsEvaluated).not.toBeUndefined(); + }); }); \ No newline at end of file diff --git a/tests/spec/spec-helpers.js b/tests/spec/spec-helpers.js index f0bab3dc..ac4e7855 100644 --- a/tests/spec/spec-helpers.js +++ b/tests/spec/spec-helpers.js @@ -15,7 +15,14 @@ AsyncSpec.prototype.beforeEachReloadF2 = function(callback) { }; /** - * Adds a .toLog matcher for checking for F2.log messages + * Clean out the test fixture before each spec + */ +beforeEach(function() { + document.getElementById('test-fixture').innerHTML = ''; +}); + +/** + * Adds .toLog matcher for checking for F2.log messages */ beforeEach(function() { From 33e3cb726fcef845fcbc4ceb5e49b259cf7c79d4 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Thu, 28 Mar 2013 18:00:05 -0600 Subject: [PATCH 035/181] Updated all of the docs --- docs/js/f2.js | 9 +- docs/js/f2.min.js | 135 ------------------ docs/sdk/classes/F2.App.html | 10 +- docs/sdk/classes/F2.AppConfig.html | 70 ++++----- docs/sdk/classes/F2.AppHandlers.html | 16 +-- .../classes/F2.AppManifest.AppContent.html | 8 +- docs/sdk/classes/F2.AppManifest.html | 14 +- .../sdk/classes/F2.Constants.AppHandlers.html | 16 +-- docs/sdk/classes/F2.Constants.Css.html | 52 +++---- docs/sdk/classes/F2.Constants.Events.html | 16 +-- docs/sdk/classes/F2.Constants.Sockets.html | 18 +-- docs/sdk/classes/F2.Constants.Views.html | 16 +-- docs/sdk/classes/F2.Constants.html | 2 +- .../classes/F2.ContainerConfig.UI.Mask.html | 24 ++-- docs/sdk/classes/F2.ContainerConfig.UI.html | 10 +- docs/sdk/classes/F2.ContainerConfig.html | 40 +++--- docs/sdk/classes/F2.Events.html | 14 +- docs/sdk/classes/F2.Rpc.html | 36 ++--- docs/sdk/classes/F2.UI.Modals.html | 6 +- docs/sdk/classes/F2.UI.Views.html | 8 +- docs/sdk/classes/F2.UI.html | 22 +-- docs/sdk/classes/F2.html | 16 +-- docs/sdk/files/sdk_src_F2.js.html | 16 +-- docs/sdk/files/sdk_src_app_handlers.js.html | 16 +-- docs/sdk/files/sdk_src_classes.js.html | 4 +- docs/sdk/files/sdk_src_constants.js.html | 4 +- docs/sdk/files/sdk_src_container.js.html | 4 +- docs/sdk/files/sdk_src_events.js.html | 4 +- docs/sdk/files/sdk_src_rpc.js.html | 4 +- docs/sdk/files/sdk_src_ui.js.html | 4 +- docs/sdk/index.html | 18 +-- docs/sdk/modules/f2.html | 2 +- sdk/f2.debug.js | 4 +- sdk/f2.min.js | 4 +- 34 files changed, 266 insertions(+), 376 deletions(-) diff --git a/docs/js/f2.js b/docs/js/f2.js index 3248f5b6..0187f8eb 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -93,7 +93,7 @@ var $, jQuery = $ = window.jQuery.noConflict(true); (function(N,d,p,K,k,H){var b=this;var n=Math.floor(Math.random()*10000);var q=Function.prototype;var Q=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/;var R=/[\-\w]+\/\.\.\//;var F=/([^:])\/\//g;var I="";var o={};var M=N.easyXDM;var U="easyXDM_";var E;var y=false;var i;var h;function C(X,Z){var Y=typeof X[Z];return Y=="function"||(!!(Y=="object"&&X[Z]))||Y=="unknown"}function u(X,Y){return !!(typeof(X[Y])=="object"&&X[Y])}function r(X){return Object.prototype.toString.call(X)==="[object Array]"}function c(){try{var X=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");i=Array.prototype.slice.call(X.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/),1);h=parseInt(i[0],10)>9&&parseInt(i[1],10)>0;X=null;return true}catch(Y){return false}}var v,x;if(C(N,"addEventListener")){v=function(Z,X,Y){Z.addEventListener(X,Y,false)};x=function(Z,X,Y){Z.removeEventListener(X,Y,false)}}else{if(C(N,"attachEvent")){v=function(X,Z,Y){X.attachEvent("on"+Z,Y)};x=function(X,Z,Y){X.detachEvent("on"+Z,Y)}}else{throw new Error("Browser not supported")}}var W=false,J=[],L;if("readyState" in d){L=d.readyState;W=L=="complete"||(~navigator.userAgent.indexOf("AppleWebKit/")&&(L=="loaded"||L=="interactive"))}else{W=!!d.body}function s(){if(W){return}W=true;for(var X=0;X')}else{Z=d.createElement("IFRAME");Z.name=X.props.name}Z.id=Z.name=X.props.name;delete X.props.name;if(X.onLoad){v(Z,"load",X.onLoad)}if(typeof X.container=="string"){X.container=d.getElementById(X.container)}if(!X.container){T(Z.style,{position:"absolute",top:"-2000px"});X.container=d.body}var Y=X.props.src;delete X.props.src;T(Z,X.props);Z.border=Z.frameBorder=0;Z.allowTransparency=true;X.container.appendChild(Z);Z.src=Y;X.props.src=Y;return Z}function V(aa,Z){if(typeof aa=="string"){aa=[aa]}var Y,X=aa.length;while(X--){Y=aa[X];Y=new RegExp(Y.substr(0,1)=="^"?Y:("^"+Y.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$"));if(Y.test(Z)){return true}}return false}function l(Z){var ae=Z.protocol,Y;Z.isHost=Z.isHost||t(S.xdm_p);y=Z.hash||false;if(!Z.props){Z.props={}}if(!Z.isHost){Z.channel=S.xdm_c;Z.secret=S.xdm_s;Z.remote=S.xdm_e;ae=S.xdm_p;if(Z.acl&&!V(Z.acl,Z.remote)){throw new Error("Access denied for "+Z.remote)}}else{Z.remote=B(Z.remote);Z.channel=Z.channel||"default"+n++;Z.secret=Math.random().toString(16).substring(2);if(t(ae)){if(j(p.href)==j(Z.remote)){ae="4"}else{if(C(N,"postMessage")||C(d,"postMessage")){ae="1"}else{if(Z.swf&&C(N,"ActiveXObject")&&c()){ae="6"}else{if(navigator.product==="Gecko"&&"frameElement" in N&&navigator.userAgent.indexOf("WebKit")==-1){ae="5"}else{if(Z.remoteHelper){Z.remoteHelper=B(Z.remoteHelper);ae="2"}else{ae="0"}}}}}}}Z.protocol=ae;switch(ae){case"0":T(Z,{interval:100,delay:2000,useResize:true,useParent:false,usePolling:false},true);if(Z.isHost){if(!Z.local){var ac=p.protocol+"//"+p.host,X=d.body.getElementsByTagName("img"),ad;var aa=X.length;while(aa--){ad=X[aa];if(ad.src.substring(0,ac.length)===ac){Z.local=ad.src;break}}if(!Z.local){Z.local=N}}var ab={xdm_c:Z.channel,xdm_p:0};if(Z.local===N){Z.usePolling=true;Z.useParent=true;Z.local=p.protocol+"//"+p.host+p.pathname+p.search;ab.xdm_e=Z.local;ab.xdm_pa=1}else{ab.xdm_e=B(Z.local)}if(Z.container){Z.useResize=false;ab.xdm_po=1}Z.remote=P(Z.remote,ab)}else{T(Z,{channel:S.xdm_c,remote:S.xdm_e,useParent:!t(S.xdm_pa),usePolling:!t(S.xdm_po),useResize:Z.useParent?false:Z.useResize})}Y=[new o.stack.HashTransport(Z),new o.stack.ReliableBehavior({}),new o.stack.QueueBehavior({encode:true,maxLength:4000-Z.remote.length}),new o.stack.VerifyBehavior({initiate:Z.isHost})];break;case"1":Y=[new o.stack.PostMessageTransport(Z)];break;case"2":Y=[new o.stack.NameTransport(Z),new o.stack.QueueBehavior(),new o.stack.VerifyBehavior({initiate:Z.isHost})];break;case"3":Y=[new o.stack.NixTransport(Z)];break;case"4":Y=[new o.stack.SameOriginTransport(Z)];break;case"5":Y=[new o.stack.FrameElementTransport(Z)];break;case"6":if(!i){c()}Y=[new o.stack.FlashTransport(Z)];break}Y.push(new o.stack.QueueBehavior({lazy:Z.lazy,remove:true}));return Y}function D(aa){var ab,Z={incoming:function(ad,ac){this.up.incoming(ad,ac)},outgoing:function(ac,ad){this.down.outgoing(ac,ad)},callback:function(ac){this.up.callback(ac)},init:function(){this.down.init()},destroy:function(){this.down.destroy()}};for(var Y=0,X=aa.length;Y<\/script>')}}};(function(){var X={};o.Fn={set:function(Y,Z){X[Y]=Z},get:function(Z,Y){var aa=X[Z];if(Y){delete X[Z]}return aa}}}());o.Socket=function(Y){var X=D(l(Y).concat([{incoming:function(ab,aa){Y.onMessage(ab,aa)},callback:function(aa){if(Y.onReady){Y.onReady(aa)}}}])),Z=j(Y.remote);this.origin=j(Y.remote);this.destroy=function(){X.destroy()};this.postMessage=function(aa){X.outgoing(aa,Z)};X.init()};o.Rpc=function(Z,Y){if(Y.local){for(var ab in Y.local){if(Y.local.hasOwnProperty(ab)){var aa=Y.local[ab];if(typeof aa==="function"){Y.local[ab]={method:aa}}}}}var X=D(l(Z).concat([new o.stack.RpcBehavior(this,Y),{callback:function(ac){if(Z.onReady){Z.onReady(ac)}}}]));this.origin=j(Z.remote);this.destroy=function(){X.destroy()};X.init()};o.stack.SameOriginTransport=function(Y){var Z,ab,aa,X;return(Z={outgoing:function(ad,ae,ac){aa(ad);if(ac){ac()}},destroy:function(){if(ab){ab.parentNode.removeChild(ab);ab=null}},onDOMReady:function(){X=j(Y.remote);if(Y.isHost){T(Y.props,{src:P(Y.remote,{xdm_e:p.protocol+"//"+p.host+p.pathname,xdm_c:Y.channel,xdm_p:4}),name:U+Y.channel+"_provider"});ab=A(Y);o.Fn.set(Y.channel,function(ac){aa=ac;K(function(){Z.up.callback(true)},0);return function(ad){Z.up.incoming(ad,X)}})}else{aa=m().Fn.get(Y.channel,true)(function(ac){Z.up.incoming(ac,X)});K(function(){Z.up.callback(true)},0)}},init:function(){G(Z.onDOMReady,Z)}})};o.stack.FlashTransport=function(aa){var ac,X,ab,ad,Y,ae;function af(ah,ag){K(function(){ac.up.incoming(ah,ad)},0)}function Z(ah){var ag=aa.swf+"?host="+aa.isHost;var aj="easyXDM_swf_"+Math.floor(Math.random()*10000);o.Fn.set("flash_loaded"+ah.replace(/[\-.]/g,"_"),function(){o.stack.FlashTransport[ah].swf=Y=ae.firstChild;var ak=o.stack.FlashTransport[ah].queue;for(var al=0;al"}return(ac={outgoing:function(ah,ai,ag){Y.postMessage(aa.channel,ah.toString());if(ag){ag()}},destroy:function(){try{Y.destroyChannel(aa.channel)}catch(ag){}Y=null;if(X){X.parentNode.removeChild(X);X=null}},onDOMReady:function(){ad=aa.remote;o.Fn.set("flash_"+aa.channel+"_init",function(){K(function(){ac.up.callback(true)})});o.Fn.set("flash_"+aa.channel+"_onMessage",af);aa.swf=B(aa.swf);var ah=z(aa.swf);var ag=function(){o.stack.FlashTransport[ah].init=true;Y=o.stack.FlashTransport[ah].swf;Y.createChannel(aa.channel,aa.secret,j(aa.remote),aa.isHost);if(aa.isHost){if(h&&aa.swfNoThrottle){T(aa.props,{position:"fixed",right:0,top:0,height:"20px",width:"20px"})}T(aa.props,{src:P(aa.remote,{xdm_e:j(p.href),xdm_c:aa.channel,xdm_p:6,xdm_s:aa.secret}),name:U+aa.channel+"_provider"});X=A(aa)}};if(o.stack.FlashTransport[ah]&&o.stack.FlashTransport[ah].init){ag()}else{if(!o.stack.FlashTransport[ah]){o.stack.FlashTransport[ah]={queue:[ag]};Z(ah)}else{o.stack.FlashTransport[ah].queue.push(ag)}}},init:function(){G(ac.onDOMReady,ac)}})};o.stack.PostMessageTransport=function(aa){var ac,ad,Y,Z;function X(ae){if(ae.origin){return j(ae.origin)}if(ae.uri){return j(ae.uri)}if(ae.domain){return p.protocol+"//"+ae.domain}throw"Unable to retrieve the origin of the event"}function ab(af){var ae=X(af);if(ae==Z&&af.data.substring(0,aa.channel.length+1)==aa.channel+" "){ac.up.incoming(af.data.substring(aa.channel.length+1),ae)}}return(ac={outgoing:function(af,ag,ae){Y.postMessage(aa.channel+" "+af,ag||Z);if(ae){ae()}},destroy:function(){x(N,"message",ab);if(ad){Y=null;ad.parentNode.removeChild(ad);ad=null}},onDOMReady:function(){Z=j(aa.remote);if(aa.isHost){var ae=function(af){if(af.data==aa.channel+"-ready"){Y=("postMessage" in ad.contentWindow)?ad.contentWindow:ad.contentWindow.document;x(N,"message",ae);v(N,"message",ab);K(function(){ac.up.callback(true)},0)}};v(N,"message",ae);T(aa.props,{src:P(aa.remote,{xdm_e:j(p.href),xdm_c:aa.channel,xdm_p:1}),name:U+aa.channel+"_provider"});ad=A(aa)}else{v(N,"message",ab);Y=("postMessage" in N.parent)?N.parent:N.parent.document;Y.postMessage(aa.channel+"-ready",Z);K(function(){ac.up.callback(true)},0)}},init:function(){G(ac.onDOMReady,ac)}})};o.stack.FrameElementTransport=function(Y){var Z,ab,aa,X;return(Z={outgoing:function(ad,ae,ac){aa.call(this,ad);if(ac){ac()}},destroy:function(){if(ab){ab.parentNode.removeChild(ab);ab=null}},onDOMReady:function(){X=j(Y.remote);if(Y.isHost){T(Y.props,{src:P(Y.remote,{xdm_e:j(p.href),xdm_c:Y.channel,xdm_p:5}),name:U+Y.channel+"_provider"});ab=A(Y);ab.fn=function(ac){delete ab.fn;aa=ac;K(function(){Z.up.callback(true)},0);return function(ad){Z.up.incoming(ad,X)}}}else{if(d.referrer&&j(d.referrer)!=S.xdm_e){N.top.location=S.xdm_e}aa=N.frameElement.fn(function(ac){Z.up.incoming(ac,X)});Z.up.callback(true)}},init:function(){G(Z.onDOMReady,Z)}})};o.stack.NameTransport=function(ab){var ac;var ae,ai,aa,ag,ah,Y,X;function af(al){var ak=ab.remoteHelper+(ae?"#_3":"#_2")+ab.channel;ai.contentWindow.sendMessage(al,ak)}function ad(){if(ae){if(++ag===2||!ae){ac.up.callback(true)}}else{af("ready");ac.up.callback(true)}}function aj(ak){ac.up.incoming(ak,Y)}function Z(){if(ah){K(function(){ah(true)},0)}}return(ac={outgoing:function(al,am,ak){ah=ak;af(al)},destroy:function(){ai.parentNode.removeChild(ai);ai=null;if(ae){aa.parentNode.removeChild(aa);aa=null}},onDOMReady:function(){ae=ab.isHost;ag=0;Y=j(ab.remote);ab.local=B(ab.local);if(ae){o.Fn.set(ab.channel,function(al){if(ae&&al==="ready"){o.Fn.set(ab.channel,aj);ad()}});X=P(ab.remote,{xdm_e:ab.local,xdm_c:ab.channel,xdm_p:2});T(ab.props,{src:X+"#"+ab.channel,name:U+ab.channel+"_provider"});aa=A(ab)}else{ab.remoteHelper=ab.remote;o.Fn.set(ab.channel,aj)}ai=A({props:{src:ab.local+"#_4"+ab.channel},onLoad:function ak(){var al=ai||this;x(al,"load",ak);o.Fn.set(ab.channel+"_load",Z);(function am(){if(typeof al.contentWindow.sendMessage=="function"){ad()}else{K(am,50)}}())}})},init:function(){G(ac.onDOMReady,ac)}})};o.stack.HashTransport=function(Z){var ac;var ah=this,af,aa,X,ad,am,ab,al;var ag,Y;function ak(ao){if(!al){return}var an=Z.remote+"#"+(am++)+"_"+ao;((af||!ag)?al.contentWindow:al).location=an}function ae(an){ad=an;ac.up.incoming(ad.substring(ad.indexOf("_")+1),Y)}function aj(){if(!ab){return}var an=ab.location.href,ap="",ao=an.indexOf("#");if(ao!=-1){ap=an.substring(ao)}if(ap&&ap!=ad){ae(ap)}}function ai(){aa=setInterval(aj,X)}return(ac={outgoing:function(an,ao){ak(an)},destroy:function(){N.clearInterval(aa);if(af||!ag){al.parentNode.removeChild(al)}al=null},onDOMReady:function(){af=Z.isHost;X=Z.interval;ad="#"+Z.channel;am=0;ag=Z.useParent;Y=j(Z.remote);if(af){Z.props={src:Z.remote,name:U+Z.channel+"_provider"};if(ag){Z.onLoad=function(){ab=N;ai();ac.up.callback(true)}}else{var ap=0,an=Z.delay/50;(function ao(){if(++ap>an){throw new Error("Unable to reference listenerwindow")}try{ab=al.contentWindow.frames[U+Z.channel+"_consumer"]}catch(aq){}if(ab){ai();ac.up.callback(true)}else{K(ao,50)}}())}al=A(Z)}else{ab=N;ai();if(ag){al=parent;ac.up.callback(true)}else{T(Z,{props:{src:Z.remote+"#"+Z.channel+new Date(),name:U+Z.channel+"_consumer"},onLoad:function(){ac.up.callback(true)}});al=A(Z)}}},init:function(){G(ac.onDOMReady,ac)}})};o.stack.ReliableBehavior=function(Y){var aa,ac;var ab=0,X=0,Z="";return(aa={incoming:function(af,ad){var ae=af.indexOf("_"),ag=af.substring(0,ae).split(",");af=af.substring(ae+1);if(ag[0]==ab){Z="";if(ac){ac(true)}}if(af.length>0){aa.down.outgoing(ag[1]+","+ab+"_"+Z,ad);if(X!=ag[1]){X=ag[1];aa.up.incoming(af,ad)}}},outgoing:function(af,ad,ae){Z=af;ac=ae;aa.down.outgoing(X+","+(++ab)+"_"+af,ad)}})};o.stack.QueueBehavior=function(Z){var ac,ad=[],ag=true,aa="",af,X=0,Y=false,ab=false;function ae(){if(Z.remove&&ad.length===0){w(ac);return}if(ag||ad.length===0||af){return}ag=true;var ah=ad.shift();ac.down.outgoing(ah.data,ah.origin,function(ai){ag=false;if(ah.callback){K(function(){ah.callback(ai)},0)}ae()})}return(ac={init:function(){if(t(Z)){Z={}}if(Z.maxLength){X=Z.maxLength;ab=true}if(Z.lazy){Y=true}else{ac.down.init()}},callback:function(ai){ag=false;var ah=ac.up;ae();ah.callback(ai)},incoming:function(ak,ai){if(ab){var aj=ak.indexOf("_"),ah=parseInt(ak.substring(0,aj),10);aa+=ak.substring(aj+1);if(ah===0){if(Z.encode){aa=k(aa)}ac.up.incoming(aa,ai);aa=""}}else{ac.up.incoming(ak,ai)}},outgoing:function(al,ai,ak){if(Z.encode){al=H(al)}var ah=[],aj;if(ab){while(al.length!==0){aj=al.substring(0,X);al=al.substring(aj.length);ah.push(aj)}while((aj=ah.shift())){ad.push({data:ah.length+"_"+aj,origin:ai,callback:ah.length===0?ak:null})}}else{ad.push({data:al,origin:ai,callback:ak})}if(Y){ac.down.init()}else{ae()}},destroy:function(){af=true;ac.down.destroy()}})};o.stack.VerifyBehavior=function(ab){var ac,aa,Y,Z=false;function X(){aa=Math.random().toString(16).substring(2);ac.down.outgoing(aa)}return(ac={incoming:function(af,ad){var ae=af.indexOf("_");if(ae===-1){if(af===aa){ac.up.callback(true)}else{if(!Y){Y=af;if(!ab.initiate){X()}ac.down.outgoing(af)}}}else{if(af.substring(0,ae)===Y){ac.up.incoming(af.substring(ae+1),ad)}}},outgoing:function(af,ad,ae){ac.down.outgoing(aa+"_"+af,ad,ae)},callback:function(ad){if(ab.initiate){X()}}})};o.stack.RpcBehavior=function(ad,Y){var aa,af=Y.serializer||O();var ae=0,ac={};function X(ag){ag.jsonrpc="2.0";aa.down.outgoing(af.stringify(ag))}function ab(ag,ai){var ah=Array.prototype.slice;return function(){var aj=arguments.length,al,ak={method:ai};if(aj>0&&typeof arguments[aj-1]==="function"){if(aj>1&&typeof arguments[aj-2]==="function"){al={success:arguments[aj-2],error:arguments[aj-1]};ak.params=ah.call(arguments,0,aj-2)}else{al={success:arguments[aj-1]};ak.params=ah.call(arguments,0,aj-1)}ac[""+(++ae)]=al;ak.id=ae}else{ak.params=ah.call(arguments,0)}if(ag.namedParams&&ak.params.length===1){ak.params=ak.params[0]}X(ak)}}function Z(an,am,ai,al){if(!ai){if(am){X({id:am,error:{code:-32601,message:"Procedure not found."}})}return}var ak,ah;if(am){ak=function(ao){ak=q;X({id:am,result:ao})};ah=function(ao,ap){ah=q;var aq={id:am,error:{code:-32099,message:ao}};if(ap){aq.error.data=ap}X(aq)}}else{ak=ah=q}if(!r(al)){al=[al]}try{var ag=ai.method.apply(ai.scope,al.concat([ak,ah]));if(!t(ag)){ak(ag)}}catch(aj){ah(aj.message)}}return(aa={incoming:function(ah,ag){var ai=af.parse(ah);if(ai.method){if(Y.handle){Y.handle(ai,X)}else{Z(ai.method,ai.id,Y.local[ai.method],ai.params)}}else{var aj=ac[ai.id];if(ai.error){if(aj.error){aj.error(ai.error)}}else{if(aj.success){aj.success(ai.result)}}delete ac[ai.id]}},init:function(){if(Y.remote){for(var ag in Y.remote){if(Y.remote.hasOwnProperty(ag)){ad[ag]=ab(Y.remote[ag],ag)}}}aa.down.init()},destroy:function(){for(var ag in Y.remote){if(Y.remote.hasOwnProperty(ag)&&ad.hasOwnProperty(ag)){delete ad[ag]}}aa.down.destroy()}})};b.easyXDM=o})(window,document,location,window.setTimeout,decodeURIComponent,encodeURIComponent);; /*! - * F2 v1.1.1 + * F2 v1.2.0 * Copyright (c) 2013 Markit On Demand, Inc. http://www.openf2.org * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -114,13 +114,14 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; -F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},secureAppPagePath:"",supportedViews:[]}}); +;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},isNativeDOMNode:function(e){var t=typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",n=typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string";return t||n},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.2.0"}}; +F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appCreateRoot:function(){},appRenderBefore:function(e){},appRender:function(e,t){var n=null;F2.isNativeDOMNode(e.root)?(n=jQuery(e.root),n.append(t)):(e.root=jQuery(t).get(0),n=jQuery(e.root)),jQuery("body").append(n)},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e&&e.app&&e.app.Destroy&&typeof e.app.Destroy=="function"?e.app.Destroy():e&&e.app&&e.app.Destroy&&F2.log(app.config.appId+" has a Destroy property, but Destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,n){s(n);if(!t&&!e)return;if(!t&&e)e=[];else if(t&&e){t=t.toLowerCase();var r=[];for(var i=0,o=e.length;i-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(n[t],r,e),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); +F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}}}}); F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){if(!_bUsesAppHandlers)appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html));else{function n(e){return jQuery("
    ").append(e).html()}F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[e],n(t.html));if(!appConfigs[e].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var r=jQuery(appConfigs[e].root);if(r.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[e]);if(!F2.isNativeDOMNode(appConfigs[e].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";r.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[e].appId)}_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){if(_config.secureAppPagePath){if(!_bUsesAppHandlers)e.root=_afterAppRender(e,_appRender(e,"
    "));else{var n=jQuery(e.root);F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,e,t.html);if(n.parents("body:first").length==0)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,e);if(!e.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(e.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(e.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)}e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=null,_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,i),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,i)):i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[e]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[e]),delete _apps[e])}}}()); exports.F2 = F2; diff --git a/docs/js/f2.min.js b/docs/js/f2.min.js index 3248f5b6..e69de29b 100644 --- a/docs/js/f2.min.js +++ b/docs/js/f2.min.js @@ -1,135 +0,0 @@ -;(function(exports) { - - if (exports.F2 && !exports.F2_TESTING_MODE) { - return; - } -; - -/*! - json2.js - 2012-10-08 - - Public Domain. - - NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. - - See http://www.JSON.org/js.html -*/ -;typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); -; - -/*! ========================================================= - * bootstrap-modal.js v2.2.2 - * http://twitter.github.com/bootstrap/javascript.html#modals - * ========================================================= - * Copyright 2012 Twitter, 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(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('"].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(e,t){jQuery.ajax({url:t,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(e,n,r){F2.log(["Failed to load script ("+t+")",r.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=[].concat(t||[]),s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); - - exports.F2 = F2; - - if (typeof define !== 'undefined' && define.amd) { - - define(function() { - return F2; - }); - - } - -})(typeof exports !== 'undefined' ? exports : window); \ No newline at end of file diff --git a/docs/sdk/classes/F2.App.html b/docs/sdk/classes/F2.App.html index d3392bc9..96f6a9db 100644 --- a/docs/sdk/classes/F2.App.html +++ b/docs/sdk/classes/F2.App.html @@ -238,7 +238,7 @@

    F2.App

    Defined in
    -
    sdk/src/classes.js:6
    +
    sdk\src\classes.js:6
    @@ -318,7 +318,7 @@

    Defined in
    -
    sdk/src/classes.js:6
    +
    sdk\src\classes.js:6
    @@ -336,7 +336,7 @@

    Parameters:

  • appConfig - F2.AppConfig + F2.AppConfig @@ -351,7 +351,7 @@

    Parameters:

  • appContent - F2.AppManifest.AppContent + F2.AppManifest.AppContent @@ -468,7 +468,7 @@

    Defined in
    -
    sdk/src/classes.js:20
    +
    sdk\src\classes.js:20
    diff --git a/docs/sdk/classes/F2.AppConfig.html b/docs/sdk/classes/F2.AppConfig.html index 1e3205ba..ded2727c 100644 --- a/docs/sdk/classes/F2.AppConfig.html +++ b/docs/sdk/classes/F2.AppConfig.html @@ -235,7 +235,7 @@

    F2.AppConfig

    Defined in
    -
    sdk/src/classes.js:29
    +
    sdk\src\classes.js:29
    @@ -300,9 +300,9 @@

    Properties

    height
  • @@ -313,7 +313,7 @@

    Properties

    +F2.registerApps process

    @@ -321,7 +321,7 @@

    Properties

    isSecure @@ -331,7 +331,7 @@

    Properties

    - @@ -379,7 +379,7 @@

    Properties

    +F2.registerApps process

    @@ -389,7 +389,7 @@

    Properties

    +F2.registerApps process

    @@ -397,9 +397,9 @@

    Properties

    views @@ -454,7 +454,7 @@

    Defined in
    -
    sdk/src/classes.js:34
    +
    sdk\src\classes.js:34
    @@ -503,7 +503,7 @@

    Defined in
    -
    sdk/src/classes.js:42
    +
    sdk\src\classes.js:42
    @@ -552,7 +552,7 @@

    Defined in
    -
    sdk/src/classes.js:48
    +
    sdk\src\classes.js:48
    @@ -591,9 +591,9 @@

    The height of the app. The initial height will be pulled from -the F2.AppConfig object, but later +the F2.AppConfig object, but later modified by calling -F2.UI.updateHeight. This is used +F2.UI.updateHeight. This is used for secure apps to be able to set the initial height of the iframe.

    @@ -607,7 +607,7 @@

    Defined in
    -
    sdk/src/classes.js:55
    +
    sdk\src\classes.js:55
    @@ -646,7 +646,7 @@

    The unique runtime ID of the app.

    This property is populated during the -F2.registerApps process

    +F2.registerApps process

    @@ -659,7 +659,7 @@

    Defined in
    -
    sdk/src/classes.js:65
    +
    sdk\src\classes.js:65
    @@ -696,7 +696,7 @@

    True if the app will be loaded in an iframe. This property -will be true if the F2.AppConfig object +will be true if the F2.AppConfig object sets isSecure = true. It will also be true if the container has made the decision to run apps in iframes.

    @@ -712,7 +712,7 @@

    Defined in
    -
    sdk/src/classes.js:74
    +
    sdk\src\classes.js:74
    @@ -750,7 +750,7 @@

    -

    The url to retrieve the F2.AppManifest +

    The url to retrieve the F2.AppManifest object.

    @@ -764,7 +764,7 @@

    Defined in
    -
    sdk/src/classes.js:85
    +
    sdk\src\classes.js:85
    @@ -816,7 +816,7 @@

    Defined in
    -
    sdk/src/classes.js:93
    +
    sdk\src\classes.js:93
    @@ -868,7 +868,7 @@

    Defined in
    -
    sdk/src/classes.js:102
    +
    sdk\src\classes.js:102
    @@ -922,7 +922,7 @@

    Defined in
    -
    sdk/src/classes.js:112
    +
    sdk\src\classes.js:112
    @@ -973,7 +973,7 @@

    Defined in
    -
    sdk/src/classes.js:122
    +
    sdk\src\classes.js:122
    @@ -1012,7 +1012,7 @@

    The root DOM element that contains the app

    This property is populated during the -F2.registerApps process

    +F2.registerApps process

    @@ -1025,7 +1025,7 @@

    Defined in
    -
    sdk/src/classes.js:129
    +
    sdk\src\classes.js:129
    @@ -1049,7 +1049,7 @@

    ui - F2.UI + F2.UI @@ -1064,7 +1064,7 @@

    The instance of F2.UI providing easy access to F2.UI methods

    This property is populated during the -F2.registerApps process

    +F2.registerApps process

    @@ -1077,7 +1077,7 @@

    Defined in
    -
    sdk/src/classes.js:138
    +
    sdk\src\classes.js:138
    @@ -1114,11 +1114,11 @@

    The views that this app supports. Available views -are defined in F2.Constants.Views. The +are defined in F2.Constants.Views. The presence of a view can be checked via -F2.inArray:

    +F2.inArray:

    -
    F2.inArray(F2.Constants.Views.SETTINGS, app.views)
    +
    F2.inArray(F2.Constants.Views.SETTINGS, app.views)
     

    @@ -1132,7 +1132,7 @@

    Defined in
    -
    sdk/src/classes.js:147
    +
    sdk\src\classes.js:147
    diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html index 93c024aa..80d26d4e 100644 --- a/docs/sdk/classes/F2.AppHandlers.html +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -3,8 +3,8 @@ F2 - F2.AppHandlers - - + + @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -25,7 +25,7 @@ - + + + @@ -54,5 +56,8 @@ + + + diff --git a/tests/js/preloadedTest.js b/tests/js/preloadedTest.js new file mode 100644 index 00000000..964f4337 --- /dev/null +++ b/tests/js/preloadedTest.js @@ -0,0 +1,27 @@ +F2.Apps["com_alikhatami_preloaded_test"] = (function() { + + var App_Class = function (appConfig, appContent, root) { + this.appConfig = appConfig; + this.appContent = appContent; + this.ui = appConfig.ui; + this.$root = $(root); + this.doNotCallAgain = false; + }; + + App_Class.prototype.init = function () { + F2.PreloadAppInitializedCounter++; + var context = this; + F2.Events.on("PreloadAppCommuncation", function(){ if(!context.doNotCallAgain) { context._handleEmit(); } }); + F2.PreloadAppInitialized = true; + }; + + App_Class.prototype._handleEmit = function (bArg) { + F2.PreloadRetrievedEmit = true; + F2.PreloadRetrievedEmitCounter++; + F2.PreloadTestCompleteCounter++; + F2.PreloadTestComplete = true; + this.doNotCallAgain = true; + }; + + return App_Class; +})(); \ No newline at end of file diff --git a/tests/spec/container-spec.js b/tests/spec/container-spec.js index ce3fd5f2..4ca61d89 100644 --- a/tests/spec/container-spec.js +++ b/tests/spec/container-spec.js @@ -1,3 +1,134 @@ +describe('F2.registerPreLoadedApps', function() { + + it('should throw exception if F2.init() is not called prior.', function() { + expect(function(){ + + var appConfig = { + appId:'com_alikhatami_preloaded_test', + manifestUrl:'http://www.openf2.org', + root: $("body").find("div.com_alikhatami_preloaded_test:first").get(0) + }; + + F2.registerPreLoadedApps([appConfig]); + }).toThrow(); + }); + + it('should throw exception if no appConfigs are passed.', function() { + expect(function(){ + F2.init(); + F2.registerPreLoadedApps(); + }).toThrow(); + }); + + it('should allow you to pass single appConfig as object to F2.registerPreLoadedApps.', function() { + expect(function(){ + F2.init(); + var appConfig = { + appId:'com_alikhatami_preloaded_test', + manifestUrl:'http://www.openf2.org', + root: $("body").find("div.com_alikhatami_preloaded_test:first").get(0) + }; + F2.registerPreLoadedApps(appConfig); + }).not.toThrow(); + }); + + it('should throw exception if you pass an invalid appConfig to F2.registerPreLoadedApps.', function() { + expect(function(){ + F2.init(); + F2.registerPreLoadedApps({}); + }).toThrow(); + }); + + it('should throw exception if you pass a valid appConfig without a valid root property to F2.registerPreLoadedApps.', function() { + expect(function(){ + F2.init(); + var appConfig = { + appId:'com_alikhatami_preloaded_test', + manifestUrl:'http://www.openf2.org', + root: "" + }; + F2.registerPreLoadedApps(appConfig); + }).toThrow(); + }); + + it('should allow you to init/register apps that are already on the page.', function() { + + F2.init(); + F2.PreloadTestComplete = false; + F2.PreloadAppInitialized = false; + F2.PreloadRetrievedEmit = false; + + var appConfig = { + appId:'com_alikhatami_preloaded_test', + manifestUrl:'http://www.openf2.org', + root: $("body").find("div.com_alikhatami_preloaded_test:first").get(0) + }; + + // init is called above + F2.registerPreLoadedApps([appConfig]); + + waitsFor( + function() + { + return F2.PreloadAppInitialized; + }, + 'Emit retrieve was never fired', + 10000 + ); + + runs(function() { + // fires the emit to make sure the app is actually listening + F2.Events.emit("PreloadAppCommuncation", [true]); + expect(F2.PreloadTestComplete).toBe(true); + expect(F2.PreloadRetrievedEmit).toBe(true); + F2.removeApp(appConfig.removeApp); + }); + }); + + it('should allow you to init/register multiple of the same app that are already on the page.', function() { + + F2.PreloadTestComplete = false; + F2.PreloadAppInitialized = false; + F2.PreloadRetrievedEmit = false; + F2.PreloadTestCompleteCounter = 0; + F2.PreloadAppInitializedCounter = 0; + F2.PreloadRetrievedEmitCounter = 0; + + var $appsOnPage = $("body").find("div.com_alikhatami_preloaded_test"); + var appConfigs = [ + { + appId:'com_alikhatami_preloaded_test', + manifestUrl:'http://www.openf2.org', + root: $appsOnPage.get(0) + }, + { + appId:'com_alikhatami_preloaded_test', + manifestUrl:'http://www.openf2.org', + root: $appsOnPage.get(1) + } + ]; + + // init is called above + F2.registerPreLoadedApps(appConfigs); + + waitsFor( + function() + { + return (F2.PreloadAppInitializedCounter == 2); + }, + 'Emit retrieve was never fired', + 10000 + ); + + runs(function() { + // fires the emit to make sure the app is actually listening + F2.Events.emit("PreloadAppCommuncation", [true]); + expect(F2.PreloadTestCompleteCounter).toBe(2); + expect(F2.PreloadRetrievedEmitCounter).toBe(2); + }); + }); +}); + describe('F2.init', function() { var async = new AsyncSpec(this); From f325c1ce8d79bd5c43522bf4243d58f4247e7e73 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Tue, 2 Apr 2013 09:14:20 -0600 Subject: [PATCH 055/181] Updated the docs and F2. --- docs/sdk/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 30692e60..936cc25d 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -253,7 +253,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    From 12d6755f577a645664b4abe622d9fc720d67e275 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Tue, 2 Apr 2013 09:17:54 -0600 Subject: [PATCH 056/181] Removed travis build Icon from README.md. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index e0553a8c..9aa90aa7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -[![Build Status](https://travis-ci.org/Ali-Khatami/F2.png?branch=1.3-wip-app-handlers)](https://travis-ci.org/Ali-Khatami/F2) - # An open framework for the financial services industry. F2 is an open and free web integration framework designed to help you and other financial industry participants develop custom solutions that combine the best tools and content from multiple providers into one, privately-labeled, seamlessly integrated front-end. The [essential components](http://docs.openf2.org/index.html#framework) defined by the F2 specification are the Container, Apps, Context and Store—all supported under the hood by **[F2.js](http://docs.openf2.org/f2js-sdk.html)**, a JavaScript SDK which provides an extensible foundation powering all F2-based web applications. From 3d8e8a901f3e139ff770277776237ab6a4c24d0a Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Fri, 5 Apr 2013 18:04:59 -0600 Subject: [PATCH 057/181] Updated docs and rebuilt. --- docs/sdk/classes/F2.html | 7 +++---- docs/sdk/data.json | 6 +++--- docs/sdk/files/sdk_src_container.js.html | 26 +++++++++++++++++++----- docs/sdk/index.html | 2 +- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/docs/sdk/classes/F2.html b/docs/sdk/classes/F2.html index 72ebf495..910b7c94 100644 --- a/docs/sdk/classes/F2.html +++ b/docs/sdk/classes/F2.html @@ -2829,8 +2829,7 @@

    Parameters:

    -

    An array of F2.AppConfig -objects

    +

    An array of F2.AppConfig objects

    @@ -2885,7 +2884,7 @@

    Defined in
    -
    sdk\src\container.js:513
    +
    sdk\src\container.js:529
    @@ -2951,7 +2950,7 @@

    Defined in
    -
    sdk\src\container.js:528
    +
    sdk\src\container.js:544
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index f95fba55..af1264ce 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -1532,7 +1532,7 @@ "params": [ { "name": "appConfigs", - "description": "An array of {{#crossLink \"F2.AppConfig\"}}{{/crossLink}}\nobjects", + "description": "An array of {{#crossLink \"F2.AppConfig\"}}{{/crossLink}} objects", "type": "Array" } ], @@ -1541,7 +1541,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 513, + "line": 529, "description": "Removes all apps from the container", "itemtype": "method", "name": "removeAllApps", @@ -1550,7 +1550,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 528, + "line": 544, "description": "Removes an app from the container", "itemtype": "method", "name": "removeApp", diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index e28601f5..b572374a 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -690,17 +690,32 @@

    File: sdk\src\container.js

    * Allows registering/initializing apps that you have already loaded on the page from the server. This gives greater flexibility * if you are the container developer and app developer or want to request apps via serverside and render them as a single page. * @method registerPreLoadedApps - * @param {Array} appConfigs An array of {{#crossLink "F2.AppConfig"}}{{/crossLink}} - * objects + * @param {Array} appConfigs An array of {{#crossLink "F2.AppConfig"}}{{/crossLink}} objects */ - registerPreLoadedApps: function(appConfigs) { + registerPreLoadedApps: function(appConfigs) { + if (!_isInit()) { + throw('F2.init() must be called before F2.registerApps()'); + } else if (!appConfigs) { + throw('At least one AppConfig must be passed when calling F2.registerPreLoadedApps()'); + } + + // could just pass an object that is an appConfig appConfigs = [].concat(appConfigs); + // appConfigs must have a length + if (!appConfigs.length) { + throw('At least one appConfig must be passed.'); + } + jQuery.each(appConfigs, function(i, a) { if (!_validateApp(a)) { - return; // move to the next app + throw("Invalid appConfig at position " + i + ". Please check your inputs and try again."); + } + else if(!a.root || jQuery(a.root).parents("body:first").length == 0) + { + throw('Preloaded app must have an appConfig that has property root. appConfig.root must be a native domNode that is appended to the body.'); } // add properties and methods @@ -709,6 +724,7 @@

    File: sdk\src\container.js

    // instantiate F2.UI a.ui = new F2.UI(a); + // place unique instance of app in _apps collection using its instanceId _apps[a.instanceId] = { config:a }; // instantiate F2.App @@ -717,7 +733,7 @@

    File: sdk\src\container.js

    // setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, appManifest.apps[i], a.root); + _apps[a.instanceId].app = new F2.Apps[a.appId](a, jQuery(a.root).html(), a.root); if (_apps[a.instanceId].app['init'] !== undefined) { _apps[a.instanceId].app.init(); } diff --git a/docs/sdk/index.html b/docs/sdk/index.html index cd7926c8..3ae64f84 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -243,7 +243,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    From e822f2421113a3250a3dfbfe7c7847517dd3d902 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Fri, 5 Apr 2013 18:27:58 -0600 Subject: [PATCH 058/181] Updated docs to use more standardized JS conventions. Updated docs as well. Rebuilt. --- docs/js/f2.js | 2 +- docs/sdk/classes/F2.AppHandlers.html | 20 +-- .../sdk/classes/F2.Constants.AppHandlers.html | 46 +++---- .../classes/F2.ContainerConfig.UI.Mask.html | 12 +- docs/sdk/classes/F2.ContainerConfig.UI.html | 2 +- docs/sdk/classes/F2.ContainerConfig.html | 37 ++++-- docs/sdk/data.json | 82 ++++++------ docs/sdk/files/sdk_src_app_handlers.js.html | 98 +++++++++------ docs/sdk/files/sdk_src_classes.js.html | 3 + docs/sdk/files/sdk_src_container.js.html | 18 +-- docs/sdk/index.html | 6 +- sdk/f2.debug.js | 119 +++++++++++------- sdk/f2.min.js | 2 +- sdk/f2.no-third-party.js | 119 +++++++++++------- sdk/src/app_handlers.js | 98 +++++++++------ sdk/src/classes.js | 3 + sdk/src/container.js | 18 +-- 17 files changed, 410 insertions(+), 275 deletions(-) diff --git a/docs/js/f2.js b/docs/js/f2.js index a72ee38a..acecabb4 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -115,7 +115,7 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * THE SOFTWARE. */ ;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},isNativeDOMNode:function(e){var t=typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",n=typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string";return t||n},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.3.0"}}; -F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appCreateRoot:function(){},appRenderBefore:function(e){},appRender:function(e,t){var n=null;F2.isNativeDOMNode(e.root)?(n=jQuery(e.root),n.append(t)):(e.root=jQuery(t).get(0),n=jQuery(e.root)),jQuery("body").append(n)},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e&&e.app&&e.app.destroy&&typeof e.app.destroy=="function"?e.app.destroy():e&&e.app&&e.app.destroy&&F2.log(app.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(500,function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,r){s(e);if(!r&&!t)return;if(!r&&t)n[t]=[];else if(r&&n[t]){r=r.toLowerCase();var i=[];for(var o=0,u=n[t].length;o-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(e,t,r),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); +F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appCreateRoot:function(){},appRenderBefore:function(e){},appRender:function(e,t){var n=null;F2.isNativeDOMNode(e.root)?(n=jQuery(e.root),n.append(t)):(e.root=jQuery(t).get(0),n=jQuery(e.root)),jQuery("body").append(n)},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e&&e.app&&e.app.destroy&&typeof e.app.destroy=="function"?e.app.destroy():e&&e.app&&e.app.destroy&&F2.log(app.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(500,function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,r){s(e);if(!r&&!t)return;if(!r&&t)n[t]=[];else if(r&&!t){r=r.toLowerCase();for(var t in n){var i=n[t],o=[];for(var u=0,a=i.length;u-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(e,t,r),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}}}}); F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html index db0b1eb4..411a2bc3 100644 --- a/docs/sdk/classes/F2.AppHandlers.html +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -480,7 +480,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:207
    +
    sdk\src\app_handlers.js:233
    @@ -556,7 +556,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:222
    +
    sdk\src\app_handlers.js:248
    @@ -652,7 +652,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:193
    +
    sdk\src\app_handlers.js:219
    @@ -726,7 +726,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:343
    +
    sdk\src\app_handlers.js:369
    @@ -852,7 +852,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:282
    +
    sdk\src\app_handlers.js:308
    @@ -923,8 +923,8 @@

    Parameters:

    Example:

    -
        F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0));
    -    F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0));
    +			
        F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container'));
    +    F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container'));
     
    @@ -994,7 +994,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:295
    +
    sdk\src\app_handlers.js:321
    @@ -1065,8 +1065,8 @@

    Parameters:

    Example:

    -
        F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); });
    -    F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); });
    +			
        F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); });
    +    F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); });
     
    diff --git a/docs/sdk/classes/F2.Constants.AppHandlers.html b/docs/sdk/classes/F2.Constants.AppHandlers.html index 971d3302..abcb173d 100644 --- a/docs/sdk/classes/F2.Constants.AppHandlers.html +++ b/docs/sdk/classes/F2.Constants.AppHandlers.html @@ -235,7 +235,7 @@

    F2.Constants.AppHandlers

    Defined in
    -
    sdk\src\app_handlers.js:389
    +
    sdk\src\app_handlers.js:415
    @@ -277,49 +277,49 @@

    Properties

    - + - + - + - + - + - + - + @@ -368,7 +368,7 @@

    -

    Identifies the create root method for use in AppHandlers.on/off/__trigger().

    +

    Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger().

    @@ -381,7 +381,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:400
    +
    sdk\src\app_handlers.js:426
    @@ -421,7 +421,7 @@

    -

    Identifies the app destroy method for use in AppHandlers.on/off/__trigger().

    +

    Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger().

    @@ -434,7 +434,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:440
    +
    sdk\src\app_handlers.js:466
    @@ -474,7 +474,7 @@

    -

    Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().

    +

    Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().

    @@ -487,7 +487,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:448
    +
    sdk\src\app_handlers.js:474
    @@ -527,7 +527,7 @@

    -

    Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().

    +

    Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().

    @@ -540,7 +540,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:432
    +
    sdk\src\app_handlers.js:458
    @@ -580,7 +580,7 @@

    -

    Identifies the app render method for use in AppHandlers.on/off/__trigger().

    +

    Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger().

    @@ -593,7 +593,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:416
    +
    sdk\src\app_handlers.js:442
    @@ -633,7 +633,7 @@

    -

    Identifies the after app render method for use in AppHandlers.on/off/__trigger().

    +

    Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger().

    @@ -646,7 +646,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:424
    +
    sdk\src\app_handlers.js:450
    @@ -686,7 +686,7 @@

    -

    Identifies the before app render method for use in AppHandlers.on/off/__trigger().

    +

    Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger().

    @@ -699,7 +699,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:408
    +
    sdk\src\app_handlers.js:434
    @@ -748,7 +748,7 @@

    Defined in
    -
    sdk\src\app_handlers.js:394
    +
    sdk\src\app_handlers.js:420
    diff --git a/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html b/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html index c98eebef..67bf2d3a 100644 --- a/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html +++ b/docs/sdk/classes/F2.ContainerConfig.UI.Mask.html @@ -237,7 +237,7 @@

    F2.ContainerConfig.UI.Mask

    Defined in
    -
    sdk\src\classes.js:292
    +
    sdk\src\classes.js:295
    @@ -360,7 +360,7 @@

    Defined in
    -
    sdk\src\classes.js:299
    +
    sdk\src\classes.js:302
    @@ -411,7 +411,7 @@

    Defined in
    -
    sdk\src\classes.js:306
    +
    sdk\src\classes.js:309
    @@ -460,7 +460,7 @@

    Defined in
    -
    sdk\src\classes.js:312
    +
    sdk\src\classes.js:315
    @@ -513,7 +513,7 @@

    Defined in
    -
    sdk\src\classes.js:319
    +
    sdk\src\classes.js:322
    @@ -564,7 +564,7 @@

    Defined in
    -
    sdk\src\classes.js:328
    +
    sdk\src\classes.js:331
    diff --git a/docs/sdk/classes/F2.ContainerConfig.UI.html b/docs/sdk/classes/F2.ContainerConfig.UI.html index c8557f76..8f1bf0a9 100644 --- a/docs/sdk/classes/F2.ContainerConfig.UI.html +++ b/docs/sdk/classes/F2.ContainerConfig.UI.html @@ -235,7 +235,7 @@

    F2.ContainerConfig.UI

    Defined in
    -
    sdk\src\classes.js:287
    +
    sdk\src\classes.js:290
    diff --git a/docs/sdk/classes/F2.ContainerConfig.html b/docs/sdk/classes/F2.ContainerConfig.html index c867e7e1..e5242155 100644 --- a/docs/sdk/classes/F2.ContainerConfig.html +++ b/docs/sdk/classes/F2.ContainerConfig.html @@ -274,7 +274,7 @@

    Methods

    - + - + - + + + + + + ]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"

    The height of the app. The initial height will be pulled from -the F2.AppConfig object, but later +the F2.AppConfig object, but later modified by calling -F2.UI.updateHeight. This is used +F2.UI.updateHeight. This is used for secure apps to be able to set the initial height of the iframe.

    The unique runtime ID of the app.

    This property is populated during the -F2.registerApps process

    True if the app will be loaded in an iframe. This property -will be true if the F2.AppConfig object +will be true if the F2.AppConfig object sets isSecure = true. It will also be true if the container has made the decision to run apps in iframes.

    manifestUrl

    The url to retrieve the F2.AppManifest +

    The url to retrieve the F2.AppManifest object.

    The root DOM element that contains the app

    This property is populated during the -F2.registerApps process

    The instance of F2.UI providing easy access to F2.UI methods

    This property is populated during the -F2.registerApps process

    The views that this app supports. Available views -are defined in F2.Constants.Views. The +are defined in F2.Constants.Views. The presence of a view can be checked via -F2.inArray:

    +F2.inArray:

    F2.inArray(F2.Constants.Views.SETTINGS, app.views)
     
    APP_CREATE_ROOT

    Identifies the create root method for use in AppHandlers.on/off/__trigger().

    Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger().

    APP_DESTROY

    Identifies the app destroy method for use in AppHandlers.on/off/__trigger().

    Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger().

    APP_DESTROY_AFTER

    Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().

    Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().

    APP_DESTROY_BEFORE

    Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().

    Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().

    APP_RENDER

    Identifies the app render method for use in AppHandlers.on/off/__trigger().

    Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger().

    APP_RENDER_AFTER

    Identifies the after app render method for use in AppHandlers.on/off/__trigger().

    Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger().

    APP_RENDER_BEFORE

    Identifies the before app render method for use in AppHandlers.on/off/__trigger().

    Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger().

    afterAppRender @@ -305,7 +305,7 @@

    Methods

    html

    appRender @@ -339,7 +339,7 @@

    Methods

    should be applied to elements.

    beforeAppRender @@ -422,7 +422,7 @@

    Properties

    -
    +

    afterAppRender ( @@ -446,6 +446,8 @@

    ) + deprecated + @@ -479,6 +481,9 @@

    +
    Deprecated
    +
    This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0
    + @@ -548,7 +553,7 @@

    Returns:

    -
    +

    appRender ( @@ -572,6 +577,8 @@

    ) + deprecated + @@ -604,10 +611,13 @@

    Defined in
    -
    sdk\src\classes.js:239
    +
    sdk\src\classes.js:240
    +
    Deprecated
    +
    This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0
    + @@ -664,7 +674,7 @@

    Parameters:

    -
    +

    beforeAppRender ( @@ -682,6 +692,8 @@

    ) + deprecated + @@ -711,10 +723,13 @@

    Defined in
    -
    sdk\src\classes.js:252
    +
    sdk\src\classes.js:254
    +
    Deprecated
    +
    This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0
    + @@ -807,7 +822,7 @@

    Defined in
    -
    sdk\src\classes.js:262
    +
    sdk\src\classes.js:265
    @@ -858,7 +873,7 @@

    Defined in
    -
    sdk\src\classes.js:269
    +
    sdk\src\classes.js:272
    @@ -909,7 +924,7 @@

    Defined in
    -
    sdk\src\classes.js:278
    +
    sdk\src\classes.js:281
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index 7985e5e2..6915bda2 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -176,7 +176,7 @@ "module": "f2", "namespace": "", "file": "sdk\\src\\app_handlers.js", - "line": 389, + "line": 415, "description": "A convenient collection of all available appHandler events." }, "F2.App": { @@ -278,7 +278,7 @@ "module": "f2", "namespace": "", "file": "sdk\\src\\classes.js", - "line": 287, + "line": 290, "description": "An object containing configuration defaults for F2.UI" }, "F2.ContainerConfig.UI.Mask": { @@ -292,7 +292,7 @@ "module": "f2", "namespace": "", "file": "sdk\\src\\classes.js", - "line": 292, + "line": 295, "description": "An object containing configuration defaults for the \nF2.UI.{{#crossLink \"F2.UI/showMask\"}}{{/crossLink}} and\nF2.UI.{{#crossLink \"F2.UI/hideMask\"}}{{/crossLink}} methods." }, "F2.Constants": { @@ -647,7 +647,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 193, + "line": 219, "description": "Allows container developer to retrieve a special token which must be passed to\nall On and Off methods. This function will self destruct so be sure to keep the response\ninside of a closure somewhere.", "itemtype": "method", "name": "getToken", @@ -656,7 +656,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 207, + "line": 233, "description": "Allows F2 to get a token internally. Token is required to call {{#crossLink \"F2.AppHandlers/\\_\\_trigger:method\"}}{{/crossLink}}.\nThis function will self destruct to eliminate other sources from using the {{#crossLink \"F2.AppHandlers/\\_\\_trigger:method\"}}{{/crossLink}}\nand other internal methods.", "itemtype": "method", "name": "__f2GetToken", @@ -667,7 +667,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 222, + "line": 248, "description": "Allows F2 to trigger specific app events internally.", "itemtype": "method", "name": "__trigger", @@ -691,7 +691,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 282, + "line": 308, "description": "Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'.", "itemtype": "method", "name": "on", @@ -714,14 +714,14 @@ } ], "example": [ - "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $(\"#my-container\").get(0));\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $(\"#my-container\").get(0));" + "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container'));\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container'));" ], "class": "F2.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 295, + "line": 321, "description": "Allows you to add listener method that will be triggered when a specific event happens.", "itemtype": "method", "name": "on", @@ -744,14 +744,14 @@ } ], "example": [ - "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log(\"before app rendered!\"); });\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log(\"before app rendered!\"); });" + "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); });\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); });" ], "class": "F2.AppHandlers", "module": "f2" }, { "file": "sdk\\src\\app_handlers.js", - "line": 343, + "line": 369, "description": "Allows you to remove listener methods for specific events", "itemtype": "method", "name": "off", @@ -776,7 +776,7 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 394, + "line": 420, "description": "A collection of constants for the on/off method names in F2.AppHandlers.", "itemtype": "property", "name": "AppHandlers", @@ -786,8 +786,8 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 400, - "description": "Identifies the create root method for use in AppHandlers.on/off/__trigger().", + "line": 426, + "description": "Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_CREATE_ROOT", "type": "string", @@ -798,8 +798,8 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 408, - "description": "Identifies the before app render method for use in AppHandlers.on/off/__trigger().", + "line": 434, + "description": "Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER_BEFORE", "type": "string", @@ -810,8 +810,8 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 416, - "description": "Identifies the app render method for use in AppHandlers.on/off/__trigger().", + "line": 442, + "description": "Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER", "type": "string", @@ -822,8 +822,8 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 424, - "description": "Identifies the after app render method for use in AppHandlers.on/off/__trigger().", + "line": 450, + "description": "Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_RENDER_AFTER", "type": "string", @@ -834,8 +834,8 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 432, - "description": "Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().", + "line": 458, + "description": "Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY_BEFORE", "type": "string", @@ -846,8 +846,8 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 440, - "description": "Identifies the app destroy method for use in AppHandlers.on/off/__trigger().", + "line": 466, + "description": "Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY", "type": "string", @@ -858,8 +858,8 @@ }, { "file": "sdk\\src\\app_handlers.js", - "line": 448, - "description": "Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().", + "line": 474, + "description": "Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger().", "itemtype": "property", "name": "APP_DESTROY_AFTER", "type": "string", @@ -1119,6 +1119,8 @@ "description": "Allows the [container](../../container-development.html) to override how\nan app's html is inserted into the page. The function should accept an\n{{#crossLink \"F2.AppConfig\"}}{{/crossLink}} object and also a string of\nhtml", "itemtype": "method", "name": "afterAppRender", + "deprecated": true, + "deprecationMessage": "This has been replaced with {{#crossLink \"F2.AppHandlers\"}}{{/crossLink}} and will be removed in v2.0", "params": [ { "name": "appConfig", @@ -1140,10 +1142,12 @@ }, { "file": "sdk\\src\\classes.js", - "line": 239, + "line": 240, "description": "Allows the [container](../../container-development.html) to wrap an app\nin extra html. The function should accept an\n{{#crossLink \"F2.AppConfig\"}}{{/crossLink}} object and also a string of\nhtml. The extra html can provide links to edit app settings and remove an\napp from the container. See\n{{#crossLink \"F2.Constants.Css\"}}{{/crossLink}} for CSS classes that\nshould be applied to elements.", "itemtype": "method", "name": "appRender", + "deprecated": true, + "deprecationMessage": "This has been replaced with {{#crossLink \"F2.AppHandlers\"}}{{/crossLink}} and will be removed in v2.0", "params": [ { "name": "appConfig", @@ -1161,10 +1165,12 @@ }, { "file": "sdk\\src\\classes.js", - "line": 252, + "line": 254, "description": "Allows the container to render html for an app before the AppManifest for\nan app has loaded. This can be useful if the design calls for loading\nicons to appear for each app before each app is loaded and rendered to\nthe page.", "itemtype": "method", "name": "beforeAppRender", + "deprecated": true, + "deprecationMessage": "This has been replaced with {{#crossLink \"F2.AppHandlers\"}}{{/crossLink}} and will be removed in v2.0", "params": [ { "name": "appConfig", @@ -1181,7 +1187,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 262, + "line": 265, "description": "Tells the container that it is currently running within\na secure app page", "itemtype": "property", "name": "isSecureAppPage", @@ -1191,7 +1197,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 269, + "line": 272, "description": "Allows the container to specify which page is used when\nloading a secure app. The page must reside on a different domain than the\ncontainer", "itemtype": "property", "name": "secureAppPagePath", @@ -1201,7 +1207,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 278, + "line": 281, "description": "Specifies what views a container will provide buttons\nor links to. Generally, the views will be switched via buttons or links\nin the app's header.", "itemtype": "property", "name": "supportedViews", @@ -1212,7 +1218,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 299, + "line": 302, "description": "The backround color of the overlay", "itemtype": "property", "name": "backgroundColor", @@ -1223,7 +1229,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 306, + "line": 309, "description": "The path to the loading icon", "itemtype": "property", "name": "loadingIcon", @@ -1233,7 +1239,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 312, + "line": 315, "description": "The opacity of the background overlay", "itemtype": "property", "name": "opacity", @@ -1244,7 +1250,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 319, + "line": 322, "description": "Do not use inline styles for mask functinality. Instead classes will\nbe applied to the elements and it is up to the container provider to\nimplement the class definitions.", "itemtype": "property", "name": "useClasses", @@ -1255,7 +1261,7 @@ }, { "file": "sdk\\src\\classes.js", - "line": 328, + "line": 331, "description": "The z-index to use for the overlay", "itemtype": "property", "name": "zIndex", @@ -2441,11 +2447,11 @@ "warnings": [ { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:282" + "line": " sdk\\src\\app_handlers.js:308" }, { "message": "replacing incorrect tag: params with param", - "line": " sdk\\src\\app_handlers.js:295" + "line": " sdk\\src\\app_handlers.js:321" }, { "message": "replacing incorrect tag: returns with return", diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html index 34732db0..89c2e2b8 100644 --- a/docs/sdk/files/sdk_src_app_handlers.js.html +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -280,7 +280,7 @@

    File: sdk\src\app_handlers.js

    } // append the root to the body by default. - jQuery("body").append($root); + jQuery('body').append($root); }, appRenderAfter: function() { @@ -309,14 +309,14 @@

    File: sdk\src\app_handlers.js

    appDestroy: function(appInstance) { // call the apps destroy method, if it has one - if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == "function") + if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') { appInstance.app.destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been else if(appInstance && appInstance.app && appInstance.app.destroy) { - F2.log(app.config.appId + " has a destroy property, but destroy is not of type function and as such will not be executed."); + F2.log(app.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); } // fade out and remove the root @@ -344,12 +344,12 @@

    File: sdk\src\app_handlers.js

    if(!handler.func && !handler.domNode) { - throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + throw ('Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.'); } if(handler.domNode && !bDomNodeAppropriate) { - throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); + throw ('Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.'); } return handler; @@ -358,7 +358,7 @@

    File: sdk\src\app_handlers.js

    var _validateToken = function(sToken) { // check token against F2 and Container - if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } + if(_ct != sToken && _f2t != sToken) { throw ('Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken().'); } }; var _removeHandler = function(sToken, eventKey, sNamespace) @@ -370,10 +370,36 @@

    File: sdk\src\app_handlers.js

    { return; } + // remove by event key else if(!sNamespace && eventKey) { _handlerCollection[eventKey] = []; } + // remove by namespace only + else if(sNamespace && !eventKey) + { + sNamespace = sNamespace.toLowerCase(); + + for(var eventKey in _handlerCollection) + { + var eventCollection = _handlerCollection[eventKey]; + var newEvents = []; + + for(var i = 0, j = eventCollection.length; i < j; i++) + { + var currentHandler = eventCollection[i]; + if(currentHandler) + { + if(!currentHandler.namespace || currentHandler.namespace.toLowerCase() != sNamespace) + { + newEvents.push(currentHandler); + } + } + } + + eventCollection = newEvents; + } + } else if(sNamespace && _handlerCollection[eventKey]) { sNamespace = sNamespace.toLowerCase(); @@ -402,7 +428,7 @@

    File: sdk\src\app_handlers.js

    if(!arHandleCollection || !arHandleCollection.length) { return; } // there is always 1 argument required, the first arg should always be the token. - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + if(!arOriginalArgs || !arOriginalArgs.length) { throw ('Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again.'); } // will throw an exception and stop execution if the token is invalid _validateToken(arOriginalArgs[0]); @@ -459,7 +485,7 @@

    File: sdk\src\app_handlers.js

    // will throw an exception and stop execution if the token is invalid if(token != _f2t) { - throw ("Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().") + throw ('Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().') } if(_handlerCollection && _handlerCollection[eventKey]) @@ -501,7 +527,7 @@

    File: sdk\src\app_handlers.js

    } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -516,8 +542,8 @@

    File: sdk\src\app_handlers.js

    * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container')); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. @@ -529,8 +555,8 @@

    File: sdk\src\app_handlers.js

    * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); }); **/ on: function(token, eventKey, func_or_element) { @@ -538,13 +564,13 @@

    File: sdk\src\app_handlers.js

    if(!eventKey) { - throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + throw ('eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.'); } // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) + if(eventKey.indexOf('.') > -1) { - var arData = eventKey.split("."); + var arData = eventKey.split('.'); eventKey = arData[0]; sNamespace = arData[1]; } @@ -556,13 +582,13 @@

    File: sdk\src\app_handlers.js

    token, sNamespace, func_or_element, - (eventKey == "appRender") + (eventKey == 'appRender') ) ); } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -584,13 +610,13 @@

    File: sdk\src\app_handlers.js

    if(!eventKey) { - throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + throw ('eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.'); } // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) + if(eventKey.indexOf('.') > -1) { - var arData = eventKey.split("."); + var arData = eventKey.split('.'); eventKey = arData[0]; sNamespace = arData[1]; } @@ -605,7 +631,7 @@

    File: sdk\src\app_handlers.js

    } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -625,61 +651,61 @@

    File: sdk\src\app_handlers.js

    AppHandlers: { /** - * Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). * @property APP_CREATE_ROOT * @type string * @static * @final */ - APP_CREATE_ROOT: "appCreateRoot", + APP_CREATE_ROOT: 'appCreateRoot', /** - * Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER_BEFORE * @type string * @static * @final */ - APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER_BEFORE: 'appRenderBefore', /** - * Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER * @type string * @static * @final */ - APP_RENDER: "appRender", + APP_RENDER: 'appRender', /** - * Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER_AFTER * @type string * @static * @final */ - APP_RENDER_AFTER: "appRenderAfter", + APP_RENDER_AFTER: 'appRenderAfter', /** - * Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY_BEFORE * @type string * @static * @final */ - APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY_BEFORE: 'appDestroyBefore', /** - * Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY * @type string * @static * @final */ - APP_DESTROY: "appDestroy", + APP_DESTROY: 'appDestroy', /** - * Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY_AFTER * @type string * @static * @final */ - APP_DESTROY_AFTER: "appDestroyAfter" + APP_DESTROY_AFTER: 'appDestroyAfter' } }); diff --git a/docs/sdk/files/sdk_src_classes.js.html b/docs/sdk/files/sdk_src_classes.js.html index 53215cae..c7b2075b 100644 --- a/docs/sdk/files/sdk_src_classes.js.html +++ b/docs/sdk/files/sdk_src_classes.js.html @@ -458,6 +458,7 @@

    File: sdk\src\classes.js

    * {{#crossLink "F2.AppConfig"}}{{/crossLink}} object and also a string of * html * @method afterAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html representing the app * @return {Element} The DOM Element surrounding the app @@ -472,6 +473,7 @@

    File: sdk\src\classes.js

    * {{#crossLink "F2.Constants.Css"}}{{/crossLink}} for CSS classes that * should be applied to elements. * @method appRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html representing the app */ @@ -482,6 +484,7 @@

    File: sdk\src\classes.js

    * icons to appear for each app before each app is loaded and rendered to * the page. * @method beforeAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @return {Element} The DOM Element surrounding the app */ diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index b5463934..bd993eaf 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -463,14 +463,14 @@

    File: sdk\src\container.js

    if(!appConfigs[i].root) { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } var $root = jQuery(appConfigs[i].root); - if($root.parents("body:first").length == 0) + if($root.parents('body:first').length == 0) { - throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + throw('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.'); } F2.AppHandlers.__trigger( @@ -481,7 +481,7 @@

    File: sdk\src\container.js

    if(!F2.isNativeDOMNode(appConfigs[i].root)) { - throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } $root.addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); @@ -549,9 +549,9 @@

    File: sdk\src\container.js

    appManifest.html ); - if($root.parents("body:first").length == 0) + if($root.parents('body:first').length == 0) { - throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + throw('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.'); } F2.AppHandlers.__trigger( @@ -562,12 +562,12 @@

    File: sdk\src\container.js

    if(!appConfig.root) { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } if(!F2.isNativeDOMNode(appConfig.root)) { - throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } jQuery(appConfig.root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId); @@ -580,7 +580,7 @@

    File: sdk\src\container.js

    // create RPC socket F2.Rpc.register(appConfig, appManifest); } else { - F2.log('Unable to load secure app: \"secureAppPagePath\" is not defined in F2.ContainerConfig.'); + F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.'); } }; diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 936cc25d..9ae2c05b 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -221,9 +221,7 @@
    -

    Build Status

    - -

    An open framework for the financial services industry.

    +

    An open framework for the financial services industry.

    F2 is an open and free web integration framework designed to help you and other financial industry participants develop custom solutions that combine the best tools and content from multiple providers into one, privately-labeled, seamlessly integrated front-end. The essential components defined by the F2 specification are the Container, Apps, Context and Store—all supported under the hood by F2.js, a JavaScript SDK which provides an extensible foundation powering all F2-based web applications.

    @@ -253,7 +251,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index e2812dbc..7d63b71b 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -1603,7 +1603,7 @@ F2.extend('AppHandlers', (function() { } // append the root to the body by default. - jQuery("body").append($root); + jQuery('body').append($root); }, appRenderAfter: function() { @@ -1632,14 +1632,14 @@ F2.extend('AppHandlers', (function() { appDestroy: function(appInstance) { // call the apps destroy method, if it has one - if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == "function") + if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') { appInstance.app.destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been else if(appInstance && appInstance.app && appInstance.app.destroy) { - F2.log(app.config.appId + " has a destroy property, but destroy is not of type function and as such will not be executed."); + F2.log(app.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); } // fade out and remove the root @@ -1667,12 +1667,12 @@ F2.extend('AppHandlers', (function() { if(!handler.func && !handler.domNode) { - throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + throw ('Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.'); } if(handler.domNode && !bDomNodeAppropriate) { - throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); + throw ('Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.'); } return handler; @@ -1681,7 +1681,7 @@ F2.extend('AppHandlers', (function() { var _validateToken = function(sToken) { // check token against F2 and Container - if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } + if(_ct != sToken && _f2t != sToken) { throw ('Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken().'); } }; var _removeHandler = function(sToken, eventKey, sNamespace) @@ -1693,10 +1693,36 @@ F2.extend('AppHandlers', (function() { { return; } + // remove by event key else if(!sNamespace && eventKey) { _handlerCollection[eventKey] = []; } + // remove by namespace only + else if(sNamespace && !eventKey) + { + sNamespace = sNamespace.toLowerCase(); + + for(var eventKey in _handlerCollection) + { + var eventCollection = _handlerCollection[eventKey]; + var newEvents = []; + + for(var i = 0, j = eventCollection.length; i < j; i++) + { + var currentHandler = eventCollection[i]; + if(currentHandler) + { + if(!currentHandler.namespace || currentHandler.namespace.toLowerCase() != sNamespace) + { + newEvents.push(currentHandler); + } + } + } + + eventCollection = newEvents; + } + } else if(sNamespace && _handlerCollection[eventKey]) { sNamespace = sNamespace.toLowerCase(); @@ -1725,7 +1751,7 @@ F2.extend('AppHandlers', (function() { if(!arHandleCollection || !arHandleCollection.length) { return; } // there is always 1 argument required, the first arg should always be the token. - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + if(!arOriginalArgs || !arOriginalArgs.length) { throw ('Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again.'); } // will throw an exception and stop execution if the token is invalid _validateToken(arOriginalArgs[0]); @@ -1782,7 +1808,7 @@ F2.extend('AppHandlers', (function() { // will throw an exception and stop execution if the token is invalid if(token != _f2t) { - throw ("Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().") + throw ('Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().') } if(_handlerCollection && _handlerCollection[eventKey]) @@ -1824,7 +1850,7 @@ F2.extend('AppHandlers', (function() { } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -1839,8 +1865,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container')); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. @@ -1852,8 +1878,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); }); **/ on: function(token, eventKey, func_or_element) { @@ -1861,13 +1887,13 @@ F2.extend('AppHandlers', (function() { if(!eventKey) { - throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + throw ('eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.'); } // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) + if(eventKey.indexOf('.') > -1) { - var arData = eventKey.split("."); + var arData = eventKey.split('.'); eventKey = arData[0]; sNamespace = arData[1]; } @@ -1879,13 +1905,13 @@ F2.extend('AppHandlers', (function() { token, sNamespace, func_or_element, - (eventKey == "appRender") + (eventKey == 'appRender') ) ); } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -1907,13 +1933,13 @@ F2.extend('AppHandlers', (function() { if(!eventKey) { - throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + throw ('eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.'); } // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) + if(eventKey.indexOf('.') > -1) { - var arData = eventKey.split("."); + var arData = eventKey.split('.'); eventKey = arData[0]; sNamespace = arData[1]; } @@ -1928,7 +1954,7 @@ F2.extend('AppHandlers', (function() { } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -1948,61 +1974,61 @@ F2.extend('Constants', { AppHandlers: { /** - * Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). * @property APP_CREATE_ROOT * @type string * @static * @final */ - APP_CREATE_ROOT: "appCreateRoot", + APP_CREATE_ROOT: 'appCreateRoot', /** - * Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER_BEFORE * @type string * @static * @final */ - APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER_BEFORE: 'appRenderBefore', /** - * Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER * @type string * @static * @final */ - APP_RENDER: "appRender", + APP_RENDER: 'appRender', /** - * Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER_AFTER * @type string * @static * @final */ - APP_RENDER_AFTER: "appRenderAfter", + APP_RENDER_AFTER: 'appRenderAfter', /** - * Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY_BEFORE * @type string * @static * @final */ - APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY_BEFORE: 'appDestroyBefore', /** - * Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY * @type string * @static * @final */ - APP_DESTROY: "appDestroy", + APP_DESTROY: 'appDestroy', /** - * Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY_AFTER * @type string * @static * @final */ - APP_DESTROY_AFTER: "appDestroyAfter" + APP_DESTROY_AFTER: 'appDestroyAfter' } }); /** @@ -2238,6 +2264,7 @@ F2.extend("", { * {{#crossLink "F2.AppConfig"}}{{/crossLink}} object and also a string of * html * @method afterAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html representing the app * @return {Element} The DOM Element surrounding the app @@ -2252,6 +2279,7 @@ F2.extend("", { * {{#crossLink "F2.Constants.Css"}}{{/crossLink}} for CSS classes that * should be applied to elements. * @method appRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html representing the app */ @@ -2262,6 +2290,7 @@ F2.extend("", { * icons to appear for each app before each app is loaded and rendered to * the page. * @method beforeAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @return {Element} The DOM Element surrounding the app */ @@ -3692,14 +3721,14 @@ F2.extend('', (function(){ if(!appConfigs[i].root) { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } var $root = jQuery(appConfigs[i].root); - if($root.parents("body:first").length == 0) + if($root.parents('body:first').length == 0) { - throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + throw('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.'); } F2.AppHandlers.__trigger( @@ -3710,7 +3739,7 @@ F2.extend('', (function(){ if(!F2.isNativeDOMNode(appConfigs[i].root)) { - throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } $root.addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); @@ -3778,9 +3807,9 @@ F2.extend('', (function(){ appManifest.html ); - if($root.parents("body:first").length == 0) + if($root.parents('body:first').length == 0) { - throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + throw('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.'); } F2.AppHandlers.__trigger( @@ -3791,12 +3820,12 @@ F2.extend('', (function(){ if(!appConfig.root) { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } if(!F2.isNativeDOMNode(appConfig.root)) { - throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } jQuery(appConfig.root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId); @@ -3809,7 +3838,7 @@ F2.extend('', (function(){ // create RPC socket F2.Rpc.register(appConfig, appManifest); } else { - F2.log('Unable to load secure app: \"secureAppPagePath\" is not defined in F2.ContainerConfig.'); + F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.'); } }; diff --git a/sdk/f2.min.js b/sdk/f2.min.js index a72ee38a..acecabb4 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -115,7 +115,7 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * THE SOFTWARE. */ ;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},isNativeDOMNode:function(e){var t=typeof Node=="object"?e instanceof Node:e&&typeof e=="object"&&typeof e.nodeType=="number"&&typeof e.nodeName=="string",n=typeof HTMLElement=="object"?e instanceof HTMLElement:e&&typeof e=="object"&&e.nodeType===1&&typeof e.nodeName=="string";return t||n},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.3.0"}}; -F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appCreateRoot:function(){},appRenderBefore:function(e){},appRender:function(e,t){var n=null;F2.isNativeDOMNode(e.root)?(n=jQuery(e.root),n.append(t)):(e.root=jQuery(t).get(0),n=jQuery(e.root)),jQuery("body").append(n)},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e&&e.app&&e.app.destroy&&typeof e.app.destroy=="function"?e.app.destroy():e&&e.app&&e.app.destroy&&F2.log(app.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(500,function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,r){s(e);if(!r&&!t)return;if(!r&&t)n[t]=[];else if(r&&n[t]){r=r.toLowerCase();var i=[];for(var o=0,u=n[t].length;o-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(e,t,r),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); +F2.extend("AppHandlers",function(){var e=F2.guid(),t=F2.guid(),n={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},r={appCreateRoot:function(){},appRenderBefore:function(e){},appRender:function(e,t){var n=null;F2.isNativeDOMNode(e.root)?(n=jQuery(e.root),n.append(t)):(e.root=jQuery(t).get(0),n=jQuery(e.root)),jQuery("body").append(n)},appRenderAfter:function(){},appReloadBefore:function(){},appReload:function(){},appReloadAfter:function(){},appDestroyBefore:function(){},appDestroy:function(e){e&&e.app&&e.app.destroy&&typeof e.app.destroy=="function"?e.app.destroy():e&&e.app&&e.app.destroy&&F2.log(app.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(e.config.root).fadeOut(500,function(){jQuery(this).remove()})},appDestroyAfter:function(){}},i=function(e,t,n,r){s(e);var i={func:typeof n?n:null,namespace:t,domNode:F2.isNativeDOMNode(n)?n:null};if(!i.func&&!i.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(i.domNode&&!r)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return i},s=function(n){if(e!=n&&t!=n)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},o=function(e,t,r){s(e);if(!r&&!t)return;if(!r&&t)n[t]=[];else if(r&&!t){r=r.toLowerCase();for(var t in n){var i=n[t],o=[];for(var u=0,a=i.length;u-1){var o=t.split(".");t=o[0],s=o[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return n[t].push(i(e,s,r,t=="appRender")),this},off:function(e,t){var r=null;if(!t)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(t.indexOf(".")>-1){var i=t.split(".");t=i[0],r=i[1]}if(!n||!n[t])throw"Invalid EventKey passed. Check your inputs and try again.";return o(e,t,r),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}); F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}}}}); F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index 7d3ee6a5..49f34f48 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -269,7 +269,7 @@ F2.extend('AppHandlers', (function() { } // append the root to the body by default. - jQuery("body").append($root); + jQuery('body').append($root); }, appRenderAfter: function() { @@ -298,14 +298,14 @@ F2.extend('AppHandlers', (function() { appDestroy: function(appInstance) { // call the apps destroy method, if it has one - if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == "function") + if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') { appInstance.app.destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been else if(appInstance && appInstance.app && appInstance.app.destroy) { - F2.log(app.config.appId + " has a destroy property, but destroy is not of type function and as such will not be executed."); + F2.log(app.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); } // fade out and remove the root @@ -333,12 +333,12 @@ F2.extend('AppHandlers', (function() { if(!handler.func && !handler.domNode) { - throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + throw ('Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.'); } if(handler.domNode && !bDomNodeAppropriate) { - throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); + throw ('Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.'); } return handler; @@ -347,7 +347,7 @@ F2.extend('AppHandlers', (function() { var _validateToken = function(sToken) { // check token against F2 and Container - if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } + if(_ct != sToken && _f2t != sToken) { throw ('Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken().'); } }; var _removeHandler = function(sToken, eventKey, sNamespace) @@ -359,10 +359,36 @@ F2.extend('AppHandlers', (function() { { return; } + // remove by event key else if(!sNamespace && eventKey) { _handlerCollection[eventKey] = []; } + // remove by namespace only + else if(sNamespace && !eventKey) + { + sNamespace = sNamespace.toLowerCase(); + + for(var eventKey in _handlerCollection) + { + var eventCollection = _handlerCollection[eventKey]; + var newEvents = []; + + for(var i = 0, j = eventCollection.length; i < j; i++) + { + var currentHandler = eventCollection[i]; + if(currentHandler) + { + if(!currentHandler.namespace || currentHandler.namespace.toLowerCase() != sNamespace) + { + newEvents.push(currentHandler); + } + } + } + + eventCollection = newEvents; + } + } else if(sNamespace && _handlerCollection[eventKey]) { sNamespace = sNamespace.toLowerCase(); @@ -391,7 +417,7 @@ F2.extend('AppHandlers', (function() { if(!arHandleCollection || !arHandleCollection.length) { return; } // there is always 1 argument required, the first arg should always be the token. - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + if(!arOriginalArgs || !arOriginalArgs.length) { throw ('Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again.'); } // will throw an exception and stop execution if the token is invalid _validateToken(arOriginalArgs[0]); @@ -448,7 +474,7 @@ F2.extend('AppHandlers', (function() { // will throw an exception and stop execution if the token is invalid if(token != _f2t) { - throw ("Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().") + throw ('Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().') } if(_handlerCollection && _handlerCollection[eventKey]) @@ -490,7 +516,7 @@ F2.extend('AppHandlers', (function() { } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -505,8 +531,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container')); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. @@ -518,8 +544,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); }); **/ on: function(token, eventKey, func_or_element) { @@ -527,13 +553,13 @@ F2.extend('AppHandlers', (function() { if(!eventKey) { - throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + throw ('eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.'); } // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) + if(eventKey.indexOf('.') > -1) { - var arData = eventKey.split("."); + var arData = eventKey.split('.'); eventKey = arData[0]; sNamespace = arData[1]; } @@ -545,13 +571,13 @@ F2.extend('AppHandlers', (function() { token, sNamespace, func_or_element, - (eventKey == "appRender") + (eventKey == 'appRender') ) ); } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -573,13 +599,13 @@ F2.extend('AppHandlers', (function() { if(!eventKey) { - throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + throw ('eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.'); } // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) + if(eventKey.indexOf('.') > -1) { - var arData = eventKey.split("."); + var arData = eventKey.split('.'); eventKey = arData[0]; sNamespace = arData[1]; } @@ -594,7 +620,7 @@ F2.extend('AppHandlers', (function() { } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -614,61 +640,61 @@ F2.extend('Constants', { AppHandlers: { /** - * Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). * @property APP_CREATE_ROOT * @type string * @static * @final */ - APP_CREATE_ROOT: "appCreateRoot", + APP_CREATE_ROOT: 'appCreateRoot', /** - * Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER_BEFORE * @type string * @static * @final */ - APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER_BEFORE: 'appRenderBefore', /** - * Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER * @type string * @static * @final */ - APP_RENDER: "appRender", + APP_RENDER: 'appRender', /** - * Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER_AFTER * @type string * @static * @final */ - APP_RENDER_AFTER: "appRenderAfter", + APP_RENDER_AFTER: 'appRenderAfter', /** - * Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY_BEFORE * @type string * @static * @final */ - APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY_BEFORE: 'appDestroyBefore', /** - * Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY * @type string * @static * @final */ - APP_DESTROY: "appDestroy", + APP_DESTROY: 'appDestroy', /** - * Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY_AFTER * @type string * @static * @final */ - APP_DESTROY_AFTER: "appDestroyAfter" + APP_DESTROY_AFTER: 'appDestroyAfter' } }); /** @@ -904,6 +930,7 @@ F2.extend("", { * {{#crossLink "F2.AppConfig"}}{{/crossLink}} object and also a string of * html * @method afterAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html representing the app * @return {Element} The DOM Element surrounding the app @@ -918,6 +945,7 @@ F2.extend("", { * {{#crossLink "F2.Constants.Css"}}{{/crossLink}} for CSS classes that * should be applied to elements. * @method appRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html representing the app */ @@ -928,6 +956,7 @@ F2.extend("", { * icons to appear for each app before each app is loaded and rendered to * the page. * @method beforeAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @return {Element} The DOM Element surrounding the app */ @@ -2358,14 +2387,14 @@ F2.extend('', (function(){ if(!appConfigs[i].root) { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } var $root = jQuery(appConfigs[i].root); - if($root.parents("body:first").length == 0) + if($root.parents('body:first').length == 0) { - throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + throw('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.'); } F2.AppHandlers.__trigger( @@ -2376,7 +2405,7 @@ F2.extend('', (function(){ if(!F2.isNativeDOMNode(appConfigs[i].root)) { - throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } $root.addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); @@ -2444,9 +2473,9 @@ F2.extend('', (function(){ appManifest.html ); - if($root.parents("body:first").length == 0) + if($root.parents('body:first').length == 0) { - throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + throw('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.'); } F2.AppHandlers.__trigger( @@ -2457,12 +2486,12 @@ F2.extend('', (function(){ if(!appConfig.root) { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } if(!F2.isNativeDOMNode(appConfig.root)) { - throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } jQuery(appConfig.root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId); @@ -2475,7 +2504,7 @@ F2.extend('', (function(){ // create RPC socket F2.Rpc.register(appConfig, appManifest); } else { - F2.log('Unable to load secure app: \"secureAppPagePath\" is not defined in F2.ContainerConfig.'); + F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.'); } }; diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index 8cb00463..4e29e8d6 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -53,7 +53,7 @@ F2.extend('AppHandlers', (function() { } // append the root to the body by default. - jQuery("body").append($root); + jQuery('body').append($root); }, appRenderAfter: function() { @@ -82,14 +82,14 @@ F2.extend('AppHandlers', (function() { appDestroy: function(appInstance) { // call the apps destroy method, if it has one - if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == "function") + if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') { appInstance.app.destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been else if(appInstance && appInstance.app && appInstance.app.destroy) { - F2.log(app.config.appId + " has a destroy property, but destroy is not of type function and as such will not be executed."); + F2.log(app.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); } // fade out and remove the root @@ -117,12 +117,12 @@ F2.extend('AppHandlers', (function() { if(!handler.func && !handler.domNode) { - throw ("Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required."); + throw ('Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.'); } if(handler.domNode && !bDomNodeAppropriate) { - throw ("Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type."); + throw ('Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.'); } return handler; @@ -131,7 +131,7 @@ F2.extend('AppHandlers', (function() { var _validateToken = function(sToken) { // check token against F2 and Container - if(_ct != sToken && _f2t != sToken) { throw ("Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."); } + if(_ct != sToken && _f2t != sToken) { throw ('Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken().'); } }; var _removeHandler = function(sToken, eventKey, sNamespace) @@ -143,10 +143,36 @@ F2.extend('AppHandlers', (function() { { return; } + // remove by event key else if(!sNamespace && eventKey) { _handlerCollection[eventKey] = []; } + // remove by namespace only + else if(sNamespace && !eventKey) + { + sNamespace = sNamespace.toLowerCase(); + + for(var eventKey in _handlerCollection) + { + var eventCollection = _handlerCollection[eventKey]; + var newEvents = []; + + for(var i = 0, j = eventCollection.length; i < j; i++) + { + var currentHandler = eventCollection[i]; + if(currentHandler) + { + if(!currentHandler.namespace || currentHandler.namespace.toLowerCase() != sNamespace) + { + newEvents.push(currentHandler); + } + } + } + + eventCollection = newEvents; + } + } else if(sNamespace && _handlerCollection[eventKey]) { sNamespace = sNamespace.toLowerCase(); @@ -175,7 +201,7 @@ F2.extend('AppHandlers', (function() { if(!arHandleCollection || !arHandleCollection.length) { return; } // there is always 1 argument required, the first arg should always be the token. - if(!arOriginalArgs || !arOriginalArgs.length) { throw ("Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again."); } + if(!arOriginalArgs || !arOriginalArgs.length) { throw ('Invalid or null argument(s) passed. Token is required for all triggers. Please check your inputs and try again.'); } // will throw an exception and stop execution if the token is invalid _validateToken(arOriginalArgs[0]); @@ -232,7 +258,7 @@ F2.extend('AppHandlers', (function() { // will throw an exception and stop execution if the token is invalid if(token != _f2t) { - throw ("Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().") + throw ('Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().') } if(_handlerCollection && _handlerCollection[eventKey]) @@ -274,7 +300,7 @@ F2.extend('AppHandlers', (function() { } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -289,8 +315,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', $("#my-container").get(0)); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', $("#my-container").get(0)); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container')); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. @@ -302,8 +328,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event happens. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log("before app rendered!"); }); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log("before app rendered!"); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); }); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); }); **/ on: function(token, eventKey, func_or_element) { @@ -311,13 +337,13 @@ F2.extend('AppHandlers', (function() { if(!eventKey) { - throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + throw ('eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.'); } // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) + if(eventKey.indexOf('.') > -1) { - var arData = eventKey.split("."); + var arData = eventKey.split('.'); eventKey = arData[0]; sNamespace = arData[1]; } @@ -329,13 +355,13 @@ F2.extend('AppHandlers', (function() { token, sNamespace, func_or_element, - (eventKey == "appRender") + (eventKey == 'appRender') ) ); } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -357,13 +383,13 @@ F2.extend('AppHandlers', (function() { if(!eventKey) { - throw ("eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers."); + throw ('eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.'); } // we need to check the key for a namespace - if(eventKey.indexOf(".") > -1) + if(eventKey.indexOf('.') > -1) { - var arData = eventKey.split("."); + var arData = eventKey.split('.'); eventKey = arData[0]; sNamespace = arData[1]; } @@ -378,7 +404,7 @@ F2.extend('AppHandlers', (function() { } else { - throw ("Invalid EventKey passed. Check your inputs and try again.") + throw ('Invalid EventKey passed. Check your inputs and try again.') } return this; @@ -398,60 +424,60 @@ F2.extend('Constants', { AppHandlers: { /** - * Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). * @property APP_CREATE_ROOT * @type string * @static * @final */ - APP_CREATE_ROOT: "appCreateRoot", + APP_CREATE_ROOT: 'appCreateRoot', /** - * Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER_BEFORE * @type string * @static * @final */ - APP_RENDER_BEFORE: "appRenderBefore", + APP_RENDER_BEFORE: 'appRenderBefore', /** - * Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER * @type string * @static * @final */ - APP_RENDER: "appRender", + APP_RENDER: 'appRender', /** - * Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). * @property APP_RENDER_AFTER * @type string * @static * @final */ - APP_RENDER_AFTER: "appRenderAfter", + APP_RENDER_AFTER: 'appRenderAfter', /** - * Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY_BEFORE * @type string * @static * @final */ - APP_DESTROY_BEFORE: "appDestroyBefore", + APP_DESTROY_BEFORE: 'appDestroyBefore', /** - * Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY * @type string * @static * @final */ - APP_DESTROY: "appDestroy", + APP_DESTROY: 'appDestroy', /** - * Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). * @property APP_DESTROY_AFTER * @type string * @static * @final */ - APP_DESTROY_AFTER: "appDestroyAfter" + APP_DESTROY_AFTER: 'appDestroyAfter' } }); \ No newline at end of file diff --git a/sdk/src/classes.js b/sdk/src/classes.js index 34e6d685..dcbbb421 100644 --- a/sdk/src/classes.js +++ b/sdk/src/classes.js @@ -231,6 +231,7 @@ F2.extend("", { * {{#crossLink "F2.AppConfig"}}{{/crossLink}} object and also a string of * html * @method afterAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html representing the app * @return {Element} The DOM Element surrounding the app @@ -245,6 +246,7 @@ F2.extend("", { * {{#crossLink "F2.Constants.Css"}}{{/crossLink}} for CSS classes that * should be applied to elements. * @method appRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @param {string} html The string of html representing the app */ @@ -255,6 +257,7 @@ F2.extend("", { * icons to appear for each app before each app is loaded and rendered to * the page. * @method beforeAppRender + * @deprecated This has been replaced with {{#crossLink "F2.AppHandlers"}}{{/crossLink}} and will be removed in v2.0 * @param {F2.AppConfig} appConfig The F2.AppConfig object * @return {Element} The DOM Element surrounding the app */ diff --git a/sdk/src/container.js b/sdk/src/container.js index 4a15543e..0ef7f3e9 100644 --- a/sdk/src/container.js +++ b/sdk/src/container.js @@ -236,14 +236,14 @@ F2.extend('', (function(){ if(!appConfigs[i].root) { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } var $root = jQuery(appConfigs[i].root); - if($root.parents("body:first").length == 0) + if($root.parents('body:first').length == 0) { - throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + throw('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.'); } F2.AppHandlers.__trigger( @@ -254,7 +254,7 @@ F2.extend('', (function(){ if(!F2.isNativeDOMNode(appConfigs[i].root)) { - throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } $root.addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfigs[i].appId); @@ -322,9 +322,9 @@ F2.extend('', (function(){ appManifest.html ); - if($root.parents("body:first").length == 0) + if($root.parents('body:first').length == 0) { - throw("App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM."); + throw('App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.'); } F2.AppHandlers.__trigger( @@ -335,12 +335,12 @@ F2.extend('', (function(){ if(!appConfig.root) { - throw("App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } if(!F2.isNativeDOMNode(appConfig.root)) { - throw("App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."); + throw('App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.'); } jQuery(appConfig.root).addClass(F2.Constants.Css.APP_CONTAINER + ' ' + appConfig.appId); @@ -353,7 +353,7 @@ F2.extend('', (function(){ // create RPC socket F2.Rpc.register(appConfig, appManifest); } else { - F2.log('Unable to load secure app: \"secureAppPagePath\" is not defined in F2.ContainerConfig.'); + F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.'); } }; From ce55f97e398523bec68c1a0168e7c8e47c3dca10 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Fri, 5 Apr 2013 18:31:21 -0600 Subject: [PATCH 059/181] Fixed docs referencing appRenderBefore for .on() overload, only appRender is valid. --- docs/sdk/classes/F2.AppHandlers.html | 4 ++-- docs/sdk/data.json | 2 +- docs/sdk/files/sdk_src_app_handlers.js.html | 4 ++-- docs/sdk/index.html | 2 +- sdk/f2.debug.js | 4 ++-- sdk/f2.no-third-party.js | 4 ++-- sdk/src/app_handlers.js | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/sdk/classes/F2.AppHandlers.html b/docs/sdk/classes/F2.AppHandlers.html index 411a2bc3..20b8b1f1 100644 --- a/docs/sdk/classes/F2.AppHandlers.html +++ b/docs/sdk/classes/F2.AppHandlers.html @@ -923,8 +923,8 @@

    Parameters:

    Example:

    -
        F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container'));
    -    F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container'));
    +			
        F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container'));
    +    F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container'));
     
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index 6915bda2..62a1f1dc 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -714,7 +714,7 @@ } ], "example": [ - "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container'));\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container'));" + "\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container'));\n\t\tF2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container'));" ], "class": "F2.AppHandlers", "module": "f2" diff --git a/docs/sdk/files/sdk_src_app_handlers.js.html b/docs/sdk/files/sdk_src_app_handlers.js.html index 89c2e2b8..0e77c6fb 100644 --- a/docs/sdk/files/sdk_src_app_handlers.js.html +++ b/docs/sdk/files/sdk_src_app_handlers.js.html @@ -542,8 +542,8 @@

    File: sdk\src\app_handlers.js

    * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container')); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container')); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 9ae2c05b..ee6c8693 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -251,7 +251,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 7d63b71b..419b10a7 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -1865,8 +1865,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container')); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container')); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index 49f34f48..2f251c8b 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -531,8 +531,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container')); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container')); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index 4e29e8d6..8e1b4408 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -315,8 +315,8 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', document.getElementById('my_container')); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container')); + * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container')); **/ /** * Allows you to add listener method that will be triggered when a specific event happens. From 9109091836c8adad39bdf3c26b94c026e56ce1b5 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Sat, 6 Apr 2013 09:32:20 -0600 Subject: [PATCH 060/181] Reorganized a bit to get some more code reuse. Updated docs. Rebuilt. --- docs/js/f2.js | 19 +--- docs/sdk/classes/F2.html | 133 +++++++++++++++++++++-- docs/sdk/data.json | 40 +++++-- docs/sdk/files/sdk_src_container.js.html | 76 ++++++------- docs/sdk/index.html | 2 +- sdk/f2.debug.js | 76 ++++++------- sdk/f2.min.js | 2 +- sdk/f2.no-third-party.js | 76 ++++++------- sdk/src/container.js | 76 ++++++------- 9 files changed, 299 insertions(+), 201 deletions(-) diff --git a/docs/js/f2.js b/docs/js/f2.js index 1f26cad0..6d276f24 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -115,21 +115,4 @@ var $, jQuery = $ = window.jQuery.noConflict(true); * THE SOFTWARE. */ ;var F2;F2={appConfigReplacer:function(e,t){return e=="root"||e=="ui"||e=="height"?undefined:t},Apps:{},extend:function(e,t,n){var r=typeof t=="function",i=e?e.split("."):[],s=this;t=t||{},i[0]==="F2"&&(i=i.slice(1));for(var o=0,u=i.length;o-1},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(e){return JSON.parse(e)},stringify:function(e,t,n){return JSON.stringify(e,t,n)},version:function(){return"1.1.1"}}; -F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:undefined,ui:undefined,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(e,t){},appRender:function(e,t){},beforeAppRender:function(e){},isSecureAppPage:!1,UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},secureAppPagePath:"",supportedViews:[]}}); -F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAINER:e+"app-container",APP_TITLE:e+"app-title",APP_VIEW:e+"app-view",APP_VIEW_TRIGGER:e+"app-view-trigger",MASK:e+"mask",MASK_CONTAINER:e+"mask-container"}}(),Events:function(){var e="App.",t="Container.";return{APP_SYMBOL_CHANGE:e+"symbolChange",APP_WIDTH_CHANGE:e+"widthChange.",CONTAINER_SYMBOL_CHANGE:t+"symbolChange",CONTAINER_WIDTH_CHANGE:t+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}); -F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); -F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'","
    "].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},registerPreLoadedApps:function(e){if(!_isInit())throw"F2.init() must be called before F2.registerApps()";if(!e)throw"At least one AppConfig must be passed when calling F2.registerPreLoadedApps()";e=[].concat(e);if(!e.length)throw"At least one appConfig must be passed.";jQuery.each(e,function(e,t){if(!_validateApp(t))throw"Invalid appConfig at position "+e+". Please check your inputs and try again.";if(!t.root||jQuery(t.root).parents("body:first").length==0)throw"Preloaded app must have an appConfig that has property root. appConfig.root must be a native domNode that is appended to the body.";_hydrateAppConfig(t),t.ui=new F2.UI(t),_apps[t.instanceId]={config:t},F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,jQuery(t.root).html(),t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); - - exports.F2 = F2; - - if (typeof define !== 'undefined' && define.amd) { - - define(function() { - return F2; - }); - - } - -})(typeof exports !== 'undefined' ? exports : window); \ No newline at end of file +F2.extend("",{App:function(e,t,n){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",max \ No newline at end of file diff --git a/docs/sdk/classes/F2.html b/docs/sdk/classes/F2.html index 910b7c94..6a0ad170 100644 --- a/docs/sdk/classes/F2.html +++ b/docs/sdk/classes/F2.html @@ -344,6 +344,28 @@

    Methods

    loading

    + + _createAppInstance + ( + +
      + +
    • + + appConfigs + +
    • + +
    + + ) +
    +

    Instantiates each app from it's appConfig and stores that in a local private collection

    @@ -1186,6 +1208,97 @@

    Returns:

    +
    + + + +
    +

    + _createAppInstance + ( + +
      + +
    • + + appConfigs + +
    • + +
    + + ) + + + + + private + + + + + + + + + +

    + +

    +

    Instantiates each app from it's appConfig and stores that in a local private collection

    +

    + +
    +
    + + + + + + + +
    Defined in
    +
    sdk\src\container.js:142
    + + + + + +
    +
    + + +
    +

    Parameters:

    + +
      + +
    • + + appConfigs + Array + + + + +

      +

      An array of F2.AppConfig objects

      +

      + + +
    • + +
    +
    + + + + + + + @@ -1516,7 +1629,7 @@

    Defined in
    -
    sdk\src\container.js:270
    +
    sdk\src\container.js:280
    @@ -1811,7 +1924,7 @@

    Defined in
    -
    sdk\src\container.js:292
    +
    sdk\src\container.js:302
    @@ -2083,7 +2196,7 @@

    Defined in
    -
    sdk\src\container.js:307
    +
    sdk\src\container.js:317
    @@ -2162,7 +2275,7 @@

    Defined in
    -
    sdk\src\container.js:327
    +
    sdk\src\container.js:337
    @@ -2249,7 +2362,7 @@

    Defined in
    -
    sdk\src\container.js:142
    +
    sdk\src\container.js:170
    @@ -2363,7 +2476,7 @@

    Defined in
    -
    sdk\src\container.js:245
    +
    sdk\src\container.js:255
    @@ -2693,7 +2806,7 @@

    Defined in
    -
    sdk\src\container.js:333
    +
    sdk\src\container.js:343
    @@ -2805,7 +2918,7 @@

    Defined in
    -
    sdk\src\container.js:470
    +
    sdk\src\container.js:480
    @@ -2884,7 +2997,7 @@

    Defined in
    -
    sdk\src\container.js:529
    +
    sdk\src\container.js:525
    @@ -2950,7 +3063,7 @@

    Defined in
    -
    sdk\src\container.js:544
    +
    sdk\src\container.js:540
    diff --git a/docs/sdk/data.json b/docs/sdk/data.json index af1264ce..f901c53c 100644 --- a/docs/sdk/data.json +++ b/docs/sdk/data.json @@ -1393,6 +1393,24 @@ { "file": "sdk\\src\\container.js", "line": 142, + "description": "Instantiates each app from it's appConfig and stores that in a local private collection", + "itemtype": "method", + "name": "_createAppInstance", + "access": "private", + "tagname": "", + "params": [ + { + "name": "appConfigs", + "description": "An array of {{#crossLink \"F2.AppConfig\"}}{{/crossLink}} objects", + "type": "Array" + } + ], + "class": "F2", + "module": "f2" + }, + { + "file": "sdk\\src\\container.js", + "line": 170, "description": "Loads the app's html/css/javascript", "itemtype": "method", "name": "loadApp", @@ -1416,7 +1434,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 245, + "line": 255, "description": "Loads the app's html/css/javascript into an iframe", "itemtype": "method", "name": "loadSecureApp", @@ -1439,7 +1457,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 270, + "line": 280, "description": "Checks if the app is valid", "itemtype": "method", "name": "_validateApp", @@ -1461,7 +1479,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 292, + "line": 302, "description": "Gets the current list of apps in the container", "itemtype": "method", "name": "getContainerState", @@ -1474,7 +1492,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 307, + "line": 317, "description": "Initializes the container. This method must be called before performing\nany other actions in the container.", "itemtype": "method", "name": "init", @@ -1490,7 +1508,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 327, + "line": 337, "description": "Has the container been init?", "itemtype": "method", "name": "isInit", @@ -1503,7 +1521,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 333, + "line": 343, "description": "Begins the loading process for all apps. The app will\nbe passed the {{#crossLink \"F2.AppConfig\"}}{{/crossLink}} object which will\ncontain the app's unique instanceId within the container. Optionally, the\n{{#crossLink \"F2.AppManifest\"}}{{/crossLink}} can be passed in and those\nassets will be used instead of making a request.", "itemtype": "method", "name": "registerApps", @@ -1525,7 +1543,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 470, + "line": 480, "description": "Allows registering/initializing apps that you have already loaded on the page from the server. This gives greater flexibility\nif you are the container developer and app developer or want to request apps via serverside and render them as a single page.", "itemtype": "method", "name": "registerPreLoadedApps", @@ -1541,7 +1559,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 529, + "line": 525, "description": "Removes all apps from the container", "itemtype": "method", "name": "removeAllApps", @@ -1550,7 +1568,7 @@ }, { "file": "sdk\\src\\container.js", - "line": 544, + "line": 540, "description": "Removes an app from the container", "itemtype": "method", "name": "removeApp", @@ -2168,11 +2186,11 @@ "warnings": [ { "message": "replacing incorrect tag: returns with return", - "line": " sdk\\src\\container.js:270" + "line": " sdk\\src\\container.js:280" }, { "message": "replacing incorrect tag: returns with return", - "line": " sdk\\src\\container.js:292" + "line": " sdk\\src\\container.js:302" }, { "message": "replacing incorrect tag: params with param", diff --git a/docs/sdk/files/sdk_src_container.js.html b/docs/sdk/files/sdk_src_container.js.html index b572374a..0b586b0b 100644 --- a/docs/sdk/files/sdk_src_container.js.html +++ b/docs/sdk/files/sdk_src_container.js.html @@ -358,6 +358,34 @@

    File: sdk\src\container.js

    return !!_config; }; + /** + * Instantiates each app from it's appConfig and stores that in a local private collection + * @method _createAppInstance + * @private + * @param {Array} appConfigs An array of {{#crossLink "F2.AppConfig"}}{{/crossLink}} objects + */ + var _createAppInstance = function(appConfig){ + // instantiate F2.UI + appConfig.ui = new F2.UI(appConfig); + + // instantiate F2.App + if (F2.Apps[appConfig.appId] !== undefined) { + if (typeof F2.Apps[appConfig.appId] === 'function') { + + // + setTimeout(function() { + _apps[appConfig.instanceId].app = new F2.Apps[appConfig.appId](appConfig, jQuery(appConfig.root).html(), appConfig.root); + if (_apps[appConfig.instanceId].app['init'] !== undefined) { + _apps[appConfig.instanceId].app.init(); + } + }, 0); + + } else { + F2.log('app initialization class is defined but not a function. (' + appConfig.appId + ')'); + } + } + }; + /** * Loads the app's html/css/javascript * @method loadApp @@ -389,25 +417,7 @@

    File: sdk\src\container.js

    var scriptsLoaded = 0; var appInit = function() { jQuery.each(appConfigs, function(i, a) { - // instantiate F2.UI - a.ui = new F2.UI(a); - - // instantiate F2.App - if (F2.Apps[a.appId] !== undefined) { - if (typeof F2.Apps[a.appId] === 'function') { - - // - setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, appManifest.apps[i], a.root); - if (_apps[a.instanceId].app['init'] !== undefined) { - _apps[a.instanceId].app.init(); - } - }, 0); - - } else { - F2.log('app initialization class is defined but not a function. (' + a.appId + ')'); - } - } + _createAppInstance(a); }); }; @@ -500,7 +510,7 @@

    File: sdk\src\container.js

    F2.log('"appId" missing from app object'); return false; } else if (!appConfig.manifestUrl) { - F2.log('manifestUrl" missing from app object'); + F2.log('"manifestUrl" missing from app object'); return false; } @@ -711,9 +721,9 @@

    File: sdk\src\container.js

    jQuery.each(appConfigs, function(i, a) { if (!_validateApp(a)) { - throw("Invalid appConfig at position " + i + ". Please check your inputs and try again."); + throw('Invalid appConfig at position ' + i + '. Please check your inputs and try again.'); } - else if(!a.root || jQuery(a.root).parents("body:first").length == 0) + else if(!a.root || jQuery(a.root).parents('body:first').length == 0) { throw('Preloaded app must have an appConfig that has property root. appConfig.root must be a native domNode that is appended to the body.'); } @@ -721,28 +731,14 @@

    File: sdk\src\container.js

    // add properties and methods _hydrateAppConfig(a); - // instantiate F2.UI - a.ui = new F2.UI(a); - // place unique instance of app in _apps collection using its instanceId _apps[a.instanceId] = { config:a }; // instantiate F2.App - if (F2.Apps[a.appId] !== undefined) { - if (typeof F2.Apps[a.appId] === 'function') { - - // - setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, jQuery(a.root).html(), a.root); - if (_apps[a.instanceId].app['init'] !== undefined) { - _apps[a.instanceId].app.init(); - } - }, 0); - - } else { - F2.log('app initialization class is defined but not a function. (' + a.appId + ')'); - } - } + _createAppInstance(a); + + // init events + _initAppEvents(a); }); }, /** diff --git a/docs/sdk/index.html b/docs/sdk/index.html index 3ae64f84..eadd76da 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -243,7 +243,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index cab452d4..21684d86 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -3119,6 +3119,34 @@ F2.extend('', (function(){ return !!_config; }; + /** + * Instantiates each app from it's appConfig and stores that in a local private collection + * @method _createAppInstance + * @private + * @param {Array} appConfigs An array of {{#crossLink "F2.AppConfig"}}{{/crossLink}} objects + */ + var _createAppInstance = function(appConfig){ + // instantiate F2.UI + appConfig.ui = new F2.UI(appConfig); + + // instantiate F2.App + if (F2.Apps[appConfig.appId] !== undefined) { + if (typeof F2.Apps[appConfig.appId] === 'function') { + + // + setTimeout(function() { + _apps[appConfig.instanceId].app = new F2.Apps[appConfig.appId](appConfig, jQuery(appConfig.root).html(), appConfig.root); + if (_apps[appConfig.instanceId].app['init'] !== undefined) { + _apps[appConfig.instanceId].app.init(); + } + }, 0); + + } else { + F2.log('app initialization class is defined but not a function. (' + appConfig.appId + ')'); + } + } + }; + /** * Loads the app's html/css/javascript * @method loadApp @@ -3150,25 +3178,7 @@ F2.extend('', (function(){ var scriptsLoaded = 0; var appInit = function() { jQuery.each(appConfigs, function(i, a) { - // instantiate F2.UI - a.ui = new F2.UI(a); - - // instantiate F2.App - if (F2.Apps[a.appId] !== undefined) { - if (typeof F2.Apps[a.appId] === 'function') { - - // - setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, appManifest.apps[i], a.root); - if (_apps[a.instanceId].app['init'] !== undefined) { - _apps[a.instanceId].app.init(); - } - }, 0); - - } else { - F2.log('app initialization class is defined but not a function. (' + a.appId + ')'); - } - } + _createAppInstance(a); }); }; @@ -3261,7 +3271,7 @@ F2.extend('', (function(){ F2.log('"appId" missing from app object'); return false; } else if (!appConfig.manifestUrl) { - F2.log('manifestUrl" missing from app object'); + F2.log('"manifestUrl" missing from app object'); return false; } @@ -3472,9 +3482,9 @@ F2.extend('', (function(){ jQuery.each(appConfigs, function(i, a) { if (!_validateApp(a)) { - throw("Invalid appConfig at position " + i + ". Please check your inputs and try again."); + throw('Invalid appConfig at position ' + i + '. Please check your inputs and try again.'); } - else if(!a.root || jQuery(a.root).parents("body:first").length == 0) + else if(!a.root || jQuery(a.root).parents('body:first').length == 0) { throw('Preloaded app must have an appConfig that has property root. appConfig.root must be a native domNode that is appended to the body.'); } @@ -3482,28 +3492,14 @@ F2.extend('', (function(){ // add properties and methods _hydrateAppConfig(a); - // instantiate F2.UI - a.ui = new F2.UI(a); - // place unique instance of app in _apps collection using its instanceId _apps[a.instanceId] = { config:a }; // instantiate F2.App - if (F2.Apps[a.appId] !== undefined) { - if (typeof F2.Apps[a.appId] === 'function') { - - // - setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, jQuery(a.root).html(), a.root); - if (_apps[a.instanceId].app['init'] !== undefined) { - _apps[a.instanceId].app.init(); - } - }, 0); - - } else { - F2.log('app initialization class is defined but not a function. (' + a.appId + ')'); - } - } + _createAppInstance(a); + + // init events + _initAppEvents(a); }); }, /** diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 1f26cad0..86beda1d 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -120,7 +120,7 @@ F2.extend("Constants",{Css:function(){var e="f2-";return{APP:e+"app",APP_CONTAIN F2.extend("Events",function(){var e=new EventEmitter2({wildcard:!0});return e.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(e,[].slice.call(arguments))},many:function(t,n,r){return e.many(t,n,r)},off:function(t,n){return e.off(t,n)},on:function(t,n){return e.on(t,n)},once:function(t,n){return e.once(t,n)}}}()); F2.extend("Rpc",function(){var e={},t="",n={},r=new RegExp("^"+F2.Constants.Sockets.EVENT),i=new RegExp("^"+F2.Constants.Sockets.RPC),s=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),o=new RegExp("^"+F2.Constants.Sockets.LOAD),u=new RegExp("^"+F2.Constants.Sockets.UI_RPC),a=function(){var e,t=!1,r=[],i=new easyXDM.Socket({onMessage:function(s,u){if(!t&&o.test(s)){s=s.replace(o,"");var a=F2.parse(s);a.length==2&&(e=a[0],n[e.instanceId]={config:e,socket:i},F2.registerApps([e],[a[1]]),jQuery.each(r,function(t,n){c(e,s,u)}),t=!0)}else t?c(e,s,u):r.push(s)}})},f=function(e,n){var r=jQuery(e.root);r=r.is("."+F2.Constants.Css.APP_CONTAINER)?r:r.find("."+F2.Constants.Css.APP_CONTAINER);if(!r.length){F2.log("Unable to locate app in order to establish secure connection.");return}var i={scrolling:"no",style:{width:"100%"}};e.height&&(i.style.height=e.height+"px");var s=new easyXDM.Socket({remote:t,container:r.get(0),props:i,onMessage:function(t,n){c(e,t,n)},onReady:function(){s.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([e,n],F2.appConfigReplacer))}});return s},l=function(e,t){return function(){F2.Rpc.call(e,F2.Constants.Sockets.RPC_CALLBACK,t,[].slice.call(arguments).slice(2))}},c=function(t,n,o){function f(e,t){var n=String(t).split(".");for(var r=0;r','",'",'",""].join("")},n=function(e){return['"].join("")};return{alert:function(n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.alert()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(e(n)).on("show",function(){var e=this;jQuery(e).find(".btn-primary").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()})}).modal({backdrop:!0})},confirm:function(e,r,i){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.Modals.confirm()");return}F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(n(e)).on("show",function(){var e=this;jQuery(e).find(".btn-ok").on("click",function(){jQuery(e).modal("hide").remove(),(r||jQuery.noop)()}),jQuery(e).find(".btn-cancel").on("click",function(){jQuery(e).modal("hide").remove(),(i||jQuery.noop)()})}).modal({backdrop:!0})}}}(),setTitle:function(e){F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[e]):jQuery(t.root).find("."+F2.Constants.Css.APP_TITLE).text(e)},showMask:function(e,n){F2.UI.showMask(t.instanceId,e,n)},updateHeight:r,Views:function(){var e=new EventEmitter2,i=/change/i;e.setMaxListeners(0);var s=function(e){return i.test(e)?!0:(F2.log('"'+e+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(i){typeof i=="function"?this.on("change",i):typeof i=="string"&&(t.isSecure&&!F2.Rpc.isRemote(t.instanceId)?F2.Rpc.call(t.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(i,t.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,n).addClass("hide").filter('[data-f2-view="'+i+'"]',n).removeClass("hide"),r(),e.emit("change",i)))},off:function(t,n){s(t)&&e.off(t,n)},on:function(t,n){s(t)&&e.on(t,n)}}}()}};return t.hideMask=function(e,t){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.hideMask()");return}if(F2.Rpc.isRemote(e)&&!jQuery(t).is("."+F2.Constants.Css.APP))F2.Rpc.call(e,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[e,jQuery(t).selector]);else{var n=jQuery(t),r=n.find("> ."+F2.Constants.Css.MASK).remove();n.removeClass(F2.Constants.Css.MASK_CONTAINER),n.data(F2.Constants.Css.MASK_CONTAINER)&&n.css({position:"static"})}},t.init=function(t){e=t,e.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,e.UI||{})},t.showMask=function(t,n,r){if(!F2.isInit()){F2.log("F2.init() must be called before F2.UI.showMask()");return}if(F2.Rpc.isRemote(t)&&jQuery(n).is("."+F2.Constants.Css.APP))F2.Rpc.call(t,F2.Constants.Sockets.RPC,"F2.UI.showMask",[t,jQuery(n).selector,r]);else{r&&!e.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var i=jQuery(n).addClass(F2.Constants.Css.MASK_CONTAINER),s=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);e.UI.Mask.useClasses||s.css({"background-color":e.UI.Mask.backgroundColor,"background-image":e.UI.Mask.loadingIcon?"url("+e.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":e.UI.Mask.zIndex,filter:"alpha(opacity="+e.UI.Mask.opacity*100+")",opacity:e.UI.Mask.opacity}),i.css("position")==="static"&&(i.css({position:"relative"}),i.data(F2.Constants.Css.MASK_CONTAINER,!0)),i.append(s)}},t}()); -F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){t.ui=new F2.UI(t),F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,appManifest.apps[e],t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},registerPreLoadedApps:function(e){if(!_isInit())throw"F2.init() must be called before F2.registerApps()";if(!e)throw"At least one AppConfig must be passed when calling F2.registerPreLoadedApps()";e=[].concat(e);if(!e.length)throw"At least one appConfig must be passed.";jQuery.each(e,function(e,t){if(!_validateApp(t))throw"Invalid appConfig at position "+e+". Please check your inputs and try again.";if(!t.root||jQuery(t.root).parents("body:first").length==0)throw"Preloaded app must have an appConfig that has property root. appConfig.root must be a native domNode that is appended to the body.";_hydrateAppConfig(t),t.ui=new F2.UI(t),_apps[t.instanceId]={config:t},F2.Apps[t.appId]!==undefined&&(typeof F2.Apps[t.appId]=="function"?setTimeout(function(){_apps[t.instanceId].app=new F2.Apps[t.appId](t,jQuery(t.root).html(),t.root),_apps[t.instanceId].app.init!==undefined&&_apps[t.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+t.appId+")"))})},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); +F2.extend("",function(){var _apps={},_config=!1,_afterAppRender=function(e,t){var n=_config.afterAppRender||function(e,t){return jQuery(t).appendTo("body")},r=n(e,t);if(!!_config.afterAppRender&&!r){F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app");return}return jQuery(r).addClass(F2.Constants.Css.APP),r.get(0)},_appRender=function(e,t){function n(e){return jQuery("
    ").append(e).html()}return t=n(jQuery(t).addClass(F2.Constants.Css.APP_CONTAINER+" "+e.appId)),_config.appRender&&(t=_config.appRender(e,t)),n(t)},_beforeAppRender=function(e){var t=_config.beforeAppRender||jQuery.noop;return t(e)},_hydrateAppConfig=function(e){e.instanceId=e.instanceId||F2.guid(),e.views=e.views||[],F2.inArray(F2.Constants.Views.HOME,e.views)||e.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(e){jQuery(e.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(t){t.preventDefault();var n=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();n==F2.Constants.Views.REMOVE?F2.removeApp(e.instanceId):e.ui.Views.change(n)})},_initContainerEvents=function(){var e,t=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(e),e=setTimeout(t,100)})},_isInit=function(){return!!_config},_createAppInstance=function(e){e.ui=new F2.UI(e),F2.Apps[e.appId]!==undefined&&(typeof F2.Apps[e.appId]=="function"?setTimeout(function(){_apps[e.instanceId].app=new F2.Apps[e.appId](e,jQuery(e.root).html(),e.root),_apps[e.instanceId].app.init!==undefined&&_apps[e.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+e.appId+")"))},_loadApps=function(appConfigs,appManifest){appConfigs=[].concat(appConfigs);if(appConfigs.length==1&&appConfigs[0].isSecure&&!_config.isSecureAppPage){_loadSecureApp(appConfigs[0],appManifest);return}if(appConfigs.length!=appManifest.apps.length){F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);return}var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(e,t){_createAppInstance(t)})},stylesFragment=[];jQuery.each(styles,function(e,t){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(e,t){appConfigs[e].root=_afterAppRender(appConfigs[e],_appRender(appConfigs[e],t.html)),_initAppEvents(appConfigs[e])}),jQuery.each(scripts,function(i,e){jQuery.ajax({url:e,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}}),appInit())},error:function(t,n,r){F2.log(["Failed to load script ("+e+")",r.toString()])}})}),scriptCount||appInit()},_loadSecureApp=function(e,t){_config.secureAppPagePath?(e.root=_afterAppRender(e,_appRender(e,"
    ")),e.ui=new F2.UI(e),_initAppEvents(e),F2.Rpc.register(e,t)):F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_validateApp=function(e){return e.appId?e.manifestUrl?!0:(F2.log('"manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)};return{getContainerState:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.getContainerState()");return}return jQuery.map(_apps,function(e,t){return{appId:e.config.appId}})},init:function(e){_config=e||{},(!!_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(e,t){if(!_isInit()){F2.log("F2.init() must be called before F2.registerApps()");return}if(!e){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}var n=[],r={},i={},s=!1;e=[].concat(e),t=t||[],s=!!t.length;if(!e.length){F2.log("At least one AppConfig must be passed when calling F2.registerApps()");return}if(e.length&&s&&e.length!=t.length){F2.log('The length of "apps" does not equal the length of "appManifests"');return}jQuery.each(e,function(e,i){if(!_validateApp(i))return;_hydrateAppConfig(i),i.root=_beforeAppRender(i),_apps[i.instanceId]={config:i},s?_loadApps(i,t[e]):i.enableBatchRequests&&!i.isSecure?(r[i.manifestUrl.toLowerCase()]=r[i.manifestUrl.toLowerCase()]||[],r[i.manifestUrl.toLowerCase()].push(i)):n.push({apps:[i],url:i.manifestUrl})}),s||(jQuery.each(r,function(e,t){n.push({url:e,apps:t})}),jQuery.each(n,function(e,t){var n=F2.Constants.JSONP_CALLBACK+t.apps[0].appId;i[n]=i[n]||[],i[n].push(t)}),jQuery.each(i,function(e,t){var n=function(r,i){if(!i)return;jQuery.ajax({url:i.url,data:{params:F2.stringify(i.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:r,dataType:"jsonp",success:function(e){_loadApps(i.apps,e)},error:function(e,t,n){F2.log("Failed to load app(s)",n.toString(),i.apps),jQuery.each(i.apps,function(e,t){F2.log("Removed failed "+t.name+" app",t),F2.removeApp(t.instanceId)})},complete:function(){n(e,t.pop())}})};n(e,t.pop())}))},registerPreLoadedApps:function(e){if(!_isInit())throw"F2.init() must be called before F2.registerApps()";if(!e)throw"At least one AppConfig must be passed when calling F2.registerPreLoadedApps()";e=[].concat(e);if(!e.length)throw"At least one appConfig must be passed.";jQuery.each(e,function(e,t){if(!_validateApp(t))throw"Invalid appConfig at position "+e+". Please check your inputs and try again.";if(!t.root||jQuery(t.root).parents("body:first").length==0)throw"Preloaded app must have an appConfig that has property root. appConfig.root must be a native domNode that is appended to the body.";_hydrateAppConfig(t),_apps[t.instanceId]={config:t},_createAppInstance(t),_initAppEvents(t)})},removeAllApps:function(){if(!_isInit()){F2.log("F2.init() must be called before F2.removeAllApps()");return}jQuery.each(_apps,function(e,t){F2.removeApp(t.config.instanceId)})},removeApp:function(e){if(!_isInit()){F2.log("F2.init() must be called before F2.removeApp()");return}_apps[e]&&(jQuery(_apps[e].config.root).fadeOut(function(){jQuery(this).remove()}),delete _apps[e])}}}()); exports.F2 = F2; diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index f0a07c07..6f347da0 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -1785,6 +1785,34 @@ F2.extend('', (function(){ return !!_config; }; + /** + * Instantiates each app from it's appConfig and stores that in a local private collection + * @method _createAppInstance + * @private + * @param {Array} appConfigs An array of {{#crossLink "F2.AppConfig"}}{{/crossLink}} objects + */ + var _createAppInstance = function(appConfig){ + // instantiate F2.UI + appConfig.ui = new F2.UI(appConfig); + + // instantiate F2.App + if (F2.Apps[appConfig.appId] !== undefined) { + if (typeof F2.Apps[appConfig.appId] === 'function') { + + // + setTimeout(function() { + _apps[appConfig.instanceId].app = new F2.Apps[appConfig.appId](appConfig, jQuery(appConfig.root).html(), appConfig.root); + if (_apps[appConfig.instanceId].app['init'] !== undefined) { + _apps[appConfig.instanceId].app.init(); + } + }, 0); + + } else { + F2.log('app initialization class is defined but not a function. (' + appConfig.appId + ')'); + } + } + }; + /** * Loads the app's html/css/javascript * @method loadApp @@ -1816,25 +1844,7 @@ F2.extend('', (function(){ var scriptsLoaded = 0; var appInit = function() { jQuery.each(appConfigs, function(i, a) { - // instantiate F2.UI - a.ui = new F2.UI(a); - - // instantiate F2.App - if (F2.Apps[a.appId] !== undefined) { - if (typeof F2.Apps[a.appId] === 'function') { - - // - setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, appManifest.apps[i], a.root); - if (_apps[a.instanceId].app['init'] !== undefined) { - _apps[a.instanceId].app.init(); - } - }, 0); - - } else { - F2.log('app initialization class is defined but not a function. (' + a.appId + ')'); - } - } + _createAppInstance(a); }); }; @@ -1927,7 +1937,7 @@ F2.extend('', (function(){ F2.log('"appId" missing from app object'); return false; } else if (!appConfig.manifestUrl) { - F2.log('manifestUrl" missing from app object'); + F2.log('"manifestUrl" missing from app object'); return false; } @@ -2138,9 +2148,9 @@ F2.extend('', (function(){ jQuery.each(appConfigs, function(i, a) { if (!_validateApp(a)) { - throw("Invalid appConfig at position " + i + ". Please check your inputs and try again."); + throw('Invalid appConfig at position ' + i + '. Please check your inputs and try again.'); } - else if(!a.root || jQuery(a.root).parents("body:first").length == 0) + else if(!a.root || jQuery(a.root).parents('body:first').length == 0) { throw('Preloaded app must have an appConfig that has property root. appConfig.root must be a native domNode that is appended to the body.'); } @@ -2148,28 +2158,14 @@ F2.extend('', (function(){ // add properties and methods _hydrateAppConfig(a); - // instantiate F2.UI - a.ui = new F2.UI(a); - // place unique instance of app in _apps collection using its instanceId _apps[a.instanceId] = { config:a }; // instantiate F2.App - if (F2.Apps[a.appId] !== undefined) { - if (typeof F2.Apps[a.appId] === 'function') { - - // - setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, jQuery(a.root).html(), a.root); - if (_apps[a.instanceId].app['init'] !== undefined) { - _apps[a.instanceId].app.init(); - } - }, 0); - - } else { - F2.log('app initialization class is defined but not a function. (' + a.appId + ')'); - } - } + _createAppInstance(a); + + // init events + _initAppEvents(a); }); }, /** diff --git a/sdk/src/container.js b/sdk/src/container.js index 7a8e2a3f..7cffa1e7 100644 --- a/sdk/src/container.js +++ b/sdk/src/container.js @@ -139,6 +139,34 @@ F2.extend('', (function(){ return !!_config; }; + /** + * Instantiates each app from it's appConfig and stores that in a local private collection + * @method _createAppInstance + * @private + * @param {Array} appConfigs An array of {{#crossLink "F2.AppConfig"}}{{/crossLink}} objects + */ + var _createAppInstance = function(appConfig){ + // instantiate F2.UI + appConfig.ui = new F2.UI(appConfig); + + // instantiate F2.App + if (F2.Apps[appConfig.appId] !== undefined) { + if (typeof F2.Apps[appConfig.appId] === 'function') { + + // + setTimeout(function() { + _apps[appConfig.instanceId].app = new F2.Apps[appConfig.appId](appConfig, jQuery(appConfig.root).html(), appConfig.root); + if (_apps[appConfig.instanceId].app['init'] !== undefined) { + _apps[appConfig.instanceId].app.init(); + } + }, 0); + + } else { + F2.log('app initialization class is defined but not a function. (' + appConfig.appId + ')'); + } + } + }; + /** * Loads the app's html/css/javascript * @method loadApp @@ -170,25 +198,7 @@ F2.extend('', (function(){ var scriptsLoaded = 0; var appInit = function() { jQuery.each(appConfigs, function(i, a) { - // instantiate F2.UI - a.ui = new F2.UI(a); - - // instantiate F2.App - if (F2.Apps[a.appId] !== undefined) { - if (typeof F2.Apps[a.appId] === 'function') { - - // - setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, appManifest.apps[i], a.root); - if (_apps[a.instanceId].app['init'] !== undefined) { - _apps[a.instanceId].app.init(); - } - }, 0); - - } else { - F2.log('app initialization class is defined but not a function. (' + a.appId + ')'); - } - } + _createAppInstance(a); }); }; @@ -281,7 +291,7 @@ F2.extend('', (function(){ F2.log('"appId" missing from app object'); return false; } else if (!appConfig.manifestUrl) { - F2.log('manifestUrl" missing from app object'); + F2.log('"manifestUrl" missing from app object'); return false; } @@ -492,9 +502,9 @@ F2.extend('', (function(){ jQuery.each(appConfigs, function(i, a) { if (!_validateApp(a)) { - throw("Invalid appConfig at position " + i + ". Please check your inputs and try again."); + throw('Invalid appConfig at position ' + i + '. Please check your inputs and try again.'); } - else if(!a.root || jQuery(a.root).parents("body:first").length == 0) + else if(!a.root || jQuery(a.root).parents('body:first').length == 0) { throw('Preloaded app must have an appConfig that has property root. appConfig.root must be a native domNode that is appended to the body.'); } @@ -502,28 +512,14 @@ F2.extend('', (function(){ // add properties and methods _hydrateAppConfig(a); - // instantiate F2.UI - a.ui = new F2.UI(a); - // place unique instance of app in _apps collection using its instanceId _apps[a.instanceId] = { config:a }; // instantiate F2.App - if (F2.Apps[a.appId] !== undefined) { - if (typeof F2.Apps[a.appId] === 'function') { - - // - setTimeout(function() { - _apps[a.instanceId].app = new F2.Apps[a.appId](a, jQuery(a.root).html(), a.root); - if (_apps[a.instanceId].app['init'] !== undefined) { - _apps[a.instanceId].app.init(); - } - }, 0); - - } else { - F2.log('app initialization class is defined but not a function. (' + a.appId + ')'); - } - } + _createAppInstance(a); + + // init events + _initAppEvents(a); }); }, /** From 9ac85d259d8463eb199730108c1616a23386a8e1 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Sat, 6 Apr 2013 09:52:11 -0600 Subject: [PATCH 061/181] Fixed references to Destroy vs destroy. Updated docs. Rebuilt. --- docs/sdk/index.html | 2 +- examples/container/js/container-app-handlers.js | 6 +++--- tests/js/test.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sdk/index.html b/docs/sdk/index.html index ee6c8693..4eb5b5a2 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -251,7 +251,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/examples/container/js/container-app-handlers.js b/examples/container/js/container-app-handlers.js index 3ac86af2..4e71b1eb 100644 --- a/examples/container/js/container-app-handlers.js +++ b/examples/container/js/container-app-handlers.js @@ -68,12 +68,12 @@ $(function() { if(!appInstance) { return; } // call the apps destroy method, if it has one - if(appInstance.app && appInstance.app.Destroy && typeof(appInstance.app.Destroy) == "function") + if(appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == "function") { - appInstance.app.Destroy(); + appInstance.app.destroy(); } // warn the container developer/app developer that even though they have a destroy method it hasn't been - else if(appInstance.app && appInstance.app.Destroy) + else if(appInstance.app && appInstance.app.destroy) { F2.log(app.config.appId + " has a Destroy property, but Destroy is not of type function and as such will not be executed."); } diff --git a/tests/js/test.js b/tests/js/test.js index f89df8bb..9549ea75 100644 --- a/tests/js/test.js +++ b/tests/js/test.js @@ -15,7 +15,7 @@ F2.Apps["com_openf2_tests_helloworld"] = (function() { }; App_Class.prototype.destroy = function () { - F2.destroyAppMethodCalled = true; + F2.destroyAppMethodCalled = true; }; return App_Class; From 17209399c78eb8847bb9a724f42100fcfbf47acb Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Tue, 9 Apr 2013 10:41:49 -0600 Subject: [PATCH 062/181] Fixed simple test failing because of missing double quote (") --- docs/js/f2.js | 100 +---------------------------------- tests/spec/container-spec.js | 2 +- 2 files changed, 2 insertions(+), 100 deletions(-) diff --git a/docs/js/f2.js b/docs/js/f2.js index 6d276f24..b7a5c6d2 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -17,102 +17,4 @@ */ ;typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/
    ","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); -; - -/*! ========================================================= - * bootstrap-modal.js v2.2.2 - * http://twitter.github.com/bootstrap/javascript.html#modals - * ========================================================= - * Copyright 2012 Twitter, 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(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length \ No newline at end of file diff --git a/tests/spec/container-spec.js b/tests/spec/container-spec.js index 4ca61d89..f4846518 100644 --- a/tests/spec/container-spec.js +++ b/tests/spec/container-spec.js @@ -191,7 +191,7 @@ describe('F2.registerApps', function() { expect(function() { F2.registerApps({appId:'com_openf2_tests_helloworld'}); - }).toLog('manifestUrl" missing from app object'); + }).toLog('"manifestUrl" missing from app object'); }); it('should fail when the parameter lengths do not match', function() { From 6a91ef56faa989946873d632b3612c0a9598212a Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Tue, 9 Apr 2013 10:59:31 -0600 Subject: [PATCH 063/181] Updated the index-amd.html test page to include preloadedTest-amd.js. Was causing unit tests to fail because F2 was not defined. --- tests/index-amd.html | 5 +++++ tests/js/preloadedTest-amd.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/js/preloadedTest-amd.js diff --git a/tests/index-amd.html b/tests/index-amd.html index b7af233e..84fab5b7 100644 --- a/tests/index-amd.html +++ b/tests/index-amd.html @@ -22,6 +22,8 @@ + + - + diff --git a/tests/spec/amd-spec.js b/tests/spec/amd-spec.js index c57cec9c..db80c33b 100644 --- a/tests/spec/amd-spec.js +++ b/tests/spec/amd-spec.js @@ -4,7 +4,7 @@ describe('AMD', function() { var isLoaded = false; - require(["../sdk/f2.debug.js"], function (nonGlobalF2) { + require(["../sdk/f2.min.js"], function (nonGlobalF2) { isLoaded = typeof nonGlobalF2 !== "undefined"; }); diff --git a/tests/spec/spec-helpers.js b/tests/spec/spec-helpers.js index ac4e7855..7df84b5b 100644 --- a/tests/spec/spec-helpers.js +++ b/tests/spec/spec-helpers.js @@ -4,7 +4,7 @@ AsyncSpec.prototype.beforeEachReloadF2 = function(callback) { this.beforeEach(function(done) { $.ajax({ - url: '../sdk/f2.debug.js', + url: '../sdk/f2.min.js', dataType: 'script', complete: function() { callback && callback(); From 2e782ecc9c97e2e878633bee45dfa3c9ca38959b Mon Sep 17 00:00:00 2001 From: brianbaker Date: Fri, 19 Apr 2013 09:06:26 -0600 Subject: [PATCH 068/181] - updated build.js to properly build the source map - pointed example containers to the minified source now that we have a source map --- build/build.js | 50 +- docs/js/f2.js | 95 +- docs/js/f2.min.js | 95 +- examples/container/index.html | 2 +- examples/container/secure.html | 2 +- f2.js | 95 +- sdk/f2.debug.js | 13362 +++++++++++++++++++++++++++++-- sdk/f2.min.js | 95 +- sdk/f2.min.js.map | 1 - sdk/f2.min.map | 1 + tests/index-amd.html | 2 +- 11 files changed, 12812 insertions(+), 988 deletions(-) delete mode 100644 sdk/f2.min.js.map create mode 100644 sdk/f2.min.map diff --git a/build/build.js b/build/build.js index 40c3a5c3..f77362b6 100755 --- a/build/build.js +++ b/build/build.js @@ -271,40 +271,36 @@ function js() { console.log('Building Minified Package...'); - var code = fs.readFileSync('./sdk/f2.debug.js', ENCODING); - var comments = []; - var token = '"F2: preserved commment block"'; - - // borrowed from ender-js - code = code.replace(/\/\*![\s\S]*?\*\//g, function(comment) { - comments.push(comment); - return token; - }); - - var result = uglify.minify(code, { - fromString: true, - outSourceMap: './sdk/f2.min.js.map' - }); - code = result.code; - - // var ast = jsp.parse(code); // parse code and get the initial AST - // ast = pro.ast_mangle(ast); // get a new AST with mangled names - // ast = pro.ast_squeeze(ast); // get an AST with compression optimizations - // code = pro.gen_code(ast); // compressed code here - - code = code.replace(RegExp(token, 'g'), function() { - return EOL + comments.shift() + EOL; + // we have to change the directory to the ./sdk folder because of how + // UglifyJS forms the source map + // https://github.com/mishoo/UglifyJS2/issues/101 + process.chdir('./sdk'); + var result = uglify.minify('f2.debug.js', { + outSourceMap: 'f2.min.js', + output: { + comments: function (node, comment){ + return /^!/.test(comment.value); + } + } }); - - contents = processTemplate(code, f2Info); + process.chdir('../'); + + contents = processTemplate(result.code, f2Info); + // we must manually append the sourceMappingURL + // https://github.com/mishoo/UglifyJS2/issues/135 + contents += EOL + [ + '/*', + '//@ sourceMappingURL=f2.min.map', + '*/' + ].join(EOL); fs.writeFileSync('./sdk/f2.min.js', contents, ENCODING); - fs.writeFileSync('./sdk/f2.min.js.map', result.map, ENCODING); + fs.writeFileSync('./sdk/f2.min.map', result.map, ENCODING); // update Last Update Date and save F2.json f2Info.sdk.lastUpdateDate = (new Date()).toJSON(); saveF2Info(); - console.log('COMPLETE'); + //copy F2.min.js over to docs/js folder so it makes to gh-pages console.log('Copying f2.min.js to ./docs/js/f2.js...'); diff --git a/docs/js/f2.js b/docs/js/f2.js index 528c7b4f..3078083f 100644 --- a/docs/js/f2.js +++ b/docs/js/f2.js @@ -1,11 +1,4 @@ -;(function(exports) { - - if (exports.F2 && !exports.F2_TESTING_MODE) { - return; - } -; - -/*! +(function(exports){if(!exports.F2||exports.F2_TESTING_MODE){/*! json2.js 2012-10-08 @@ -15,12 +8,28 @@ See http://www.JSON.org/js.html */ -;typeof JSON!="object"&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,s,o=gap,u,a=t[e];a&&typeof a=="object"&&typeof a.toJSON=="function"&&(a=a.toJSON(e)),typeof rep=="function"&&(a=rep.call(t,e,a));switch(typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";gap+=indent,u=[];if(Object.prototype.toString.apply(a)==="[object Array]"){s=a.length;for(n=0;n=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); -; - -/*! ========================================================= +"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,i,o,a,s=gap,c=t[e];switch(c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(e)),"function"==typeof rep&&(c=rep.call(t,e,c)),typeof c){case"string":return quote(c);case"number":return isFinite(c)?c+"":"null";case"boolean":case"null":return c+"";case"object":if(!c)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(o=c.length,n=0;o>n;n+=1)a[n]=str(n,c)||"null";return i=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,i}if(rep&&"object"==typeof rep)for(o=rep.length,n=0;o>n;n+=1)"string"==typeof rep[n]&&(r=rep[n],i=str(r,c),i&&a.push(quote(r)+(gap?": ":":")+i));else for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(i=str(r,c),i&&a.push(quote(r)+(gap?": ":":")+i));return i=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,i}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,i=e[t];if(i&&"object"==typeof i)for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r=walk(i,n),void 0!==r?i[n]=r:delete i[n]);return reviver.call(e,t,i)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),/*! + * jQuery JavaScript Library v1.8.3 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time) + */ +function(e,t){function n(e){var t=ht[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(mt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:gt.test(r)?Y.parseJSON(r):r}catch(o){}Y.data(e,n,r)}else r=t}return r}function i(e){var t;for(t in e)if(("data"!==t||!Y.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function o(){return!1}function a(){return!0}function s(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function c(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function l(e,t,n){if(t=t||0,Y.isFunction(t))return Y.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return Y.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=Y.grep(e,function(e){return 1===e.nodeType});if(Lt.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e){return Y.inArray(e,t)>=0===n})}function u(e){var t=Ht.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function p(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function f(e,t){if(1===t.nodeType&&Y.hasData(e)){var n,r,i,o=Y._data(e),a=Y._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)Y.event.add(t,n,s[n][r])}a.data&&(a.data=Y.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),Y.support.html5Clone&&e.innerHTML&&!Y.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Vt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Y.expando))}function h(e){return e.getElementsByTagName!==t?e.getElementsByTagName("*"):e.querySelectorAll!==t?e.querySelectorAll("*"):[]}function g(e){Vt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=vn.length;i--;)if(t=vn[i]+n,t in e)return t;return r}function y(e,t){return e=t||e,"none"===Y.css(e,"display")||!Y.contains(e.ownerDocument,e)}function v(e,t){for(var n,r,i=[],o=0,a=e.length;a>o;o++)n=e[o],n.style&&(i[o]=Y._data(n,"olddisplay"),t?(i[o]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&y(n)&&(i[o]=Y._data(n,"olddisplay",C(n.nodeName)))):(r=nn(n,"display"),i[o]||"none"===r||Y._data(n,"olddisplay",r)));for(o=0;a>o;o++)n=e[o],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?i[o]||"":"none"));return e}function b(e,t,n){var r=pn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function x(e,t,n,r){for(var i=n===(r?"border":"content")?4:"width"===t?1:0,o=0;4>i;i+=2)"margin"===n&&(o+=Y.css(e,n+yn[i],!0)),r?("content"===n&&(o-=parseFloat(nn(e,"padding"+yn[i]))||0),"margin"!==n&&(o-=parseFloat(nn(e,"border"+yn[i]+"Width"))||0)):(o+=parseFloat(nn(e,"padding"+yn[i]))||0,"padding"!==n&&(o+=parseFloat(nn(e,"border"+yn[i]+"Width"))||0));return o}function w(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,i=!0,o=Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing");if(0>=r||null==r){if(r=nn(e,t),(0>r||null==r)&&(r=e.style[t]),fn.test(r))return r;i=o&&(Y.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+x(e,t,n||(o?"border":"content"),i)+"px"}function C(e){if(hn[e])return hn[e];var t=Y("<"+e+">").appendTo($.body),n=t.css("display");return t.remove(),("none"===n||""===n)&&(rn=$.body.appendChild(rn||Y.extend($.createElement("iframe"),{frameBorder:0,width:0,height:0})),on&&rn.createElement||(on=(rn.contentWindow||rn.contentDocument).document,on.write(""),on.close()),t=on.body.appendChild(on.createElement(e)),n=nn(t,"display"),$.body.removeChild(rn)),hn[e]=n,n}function k(e,t,n,r){var i;if(Y.isArray(t))Y.each(t,function(t,i){n||wn.test(e)?r(e,i):k(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==Y.type(t))r(e,t);else for(i in t)k(e+"["+i+"]",t[i],n,r)}function T(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i,o,a=t.toLowerCase().split(tt),s=0,c=a.length;if(Y.isFunction(n))for(;c>s;s++)r=a[s],o=/^\+/.test(r),o&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[o?"unshift":"push"](n)}}function _(e,n,r,i,o,a){o=o||n.dataTypes[0],a=a||{},a[o]=!0;for(var s,c=e[o],l=0,u=c?c.length:0,p=e===Dn;u>l&&(p||!s);l++)s=c[l](n,r,i),"string"==typeof s&&(!p||a[s]?s=t:(n.dataTypes.unshift(s),s=_(e,n,r,i,s,a)));return!p&&s||a["*"]||(s=_(e,n,r,i,"*",a)),s}function N(e,n){var r,i,o=Y.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);i&&Y.extend(!0,e,i)}function E(e,n,r){var i,o,a,s,c=e.contents,l=e.dataTypes,u=e.responseFields;for(o in u)o in r&&(n[u[o]]=r[o]);for(;"*"===l[0];)l.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(o in c)if(c[o]&&c[o].test(i)){l.unshift(o);break}if(l[0]in r)a=l[0];else{for(o in r){if(!l[0]||e.converters[o+" "+l[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function A(e,t){var n,r,i,o,a=e.dataTypes.slice(),s=a[0],c={},l=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a[1])for(n in e.converters)c[n.toLowerCase()]=e.converters[n];for(;i=a[++l];)if("*"!==i){if("*"!==s&&s!==i){if(n=c[s+" "+i]||c["* "+i],!n)for(r in c)if(o=r.split(" "),o[1]===i&&(n=c[s+" "+o[0]]||c["* "+o[0]])){n===!0?n=c[r]:c[r]!==!0&&(i=o[0],a.splice(l--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(u){return{state:"parsererror",error:n?u:"No conversion from "+s+" to "+i}}}s=i}return{state:"success",data:t}}function F(){try{return new e.XMLHttpRequest}catch(t){}}function S(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function j(){return setTimeout(function(){Jn=t},0),Jn=Y.now()}function M(e,t){Y.each(t,function(t,n){for(var r=(er[t]||[]).concat(er["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function O(e,t,n){var r,i=0,o=Zn.length,a=Y.Deferred().always(function(){delete s.elem}),s=function(){for(var t=Jn||j(),n=Math.max(0,c.startTime+c.duration-t),r=n/c.duration||0,i=1-r,o=0,s=c.tweens.length;s>o;o++)c.tweens[o].run(i);return a.notifyWith(e,[c,i,n]),1>i&&s?n:(a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:Y.extend({},t),opts:Y.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Jn||j(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Y.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){for(var n=0,r=t?c.tweens.length:0;r>n;n++)c.tweens[n].run(1);return t?a.resolveWith(e,[c,t]):a.rejectWith(e,[c,t]),this}}),l=c.props;for(I(l,c.opts.specialEasing);o>i;i++)if(r=Zn[i].call(c,e,l,c.opts))return r;return M(c,l),Y.isFunction(c.opts.start)&&c.opts.start.call(e,c),Y.fx.timer(Y.extend(s,{anim:c,queue:c.opts.queue,elem:e})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}function I(e,t){var n,r,i,o,a;for(n in e)if(r=Y.camelCase(n),i=t[r],o=e[n],Y.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=Y.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function R(e,t,n){var r,i,o,a,s,c,l,u,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&y(e);n.queue||(u=Y._queueHooks(e,"fx"),null==u.unqueued&&(u.unqueued=0,p=u.empty.fire,u.empty.fire=function(){u.unqueued||p()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,Y.queue(e,"fx").length||u.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===Y.css(e,"display")&&"none"===Y.css(e,"float")&&(Y.support.inlineBlockNeedsLayout&&"inline"!==C(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",Y.support.shrinkWrapBlocks||f.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Gn.exec(o)){if(delete t[r],c=c||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=Y._data(e,"fxshow")||Y._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),c&&(s.hidden=!m),m?Y(e).show():f.done(function(){Y(e).hide()}),f.done(function(){var t;Y.removeData(e,"fxshow",!0);for(t in h)Y.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],l=f.createTween(i,m?s[i]:0),h[i]=s[i]||Y.style(e,i),i in s||(s[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function L(e,t,n,r,i){return new L.prototype.init(e,t,n,r,i)}function D(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=yn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function P(e){return Y.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var H,B,$=e.document,q=e.location,W=e.navigator,U=e.jQuery,Q=e.$,z=Array.prototype.push,X=Array.prototype.slice,J=Array.prototype.indexOf,V=Object.prototype.toString,G=Object.prototype.hasOwnProperty,K=String.prototype.trim,Y=function(e,t){return new Y.fn.init(e,t,H)},Z=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,et=/\S/,tt=/\s+/,nt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,it=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ot=/^[\],:{}\s]*$/,at=/(?:^|:|,)(?:\s*\[)+/g,st=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,ct=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,lt=/^-ms-/,ut=/-([\da-z])/gi,pt=function(e,t){return(t+"").toUpperCase()},ft=function(){$.addEventListener?($.removeEventListener("DOMContentLoaded",ft,!1),Y.ready()):"complete"===$.readyState&&($.detachEvent("onreadystatechange",ft),Y.ready())},dt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var i,o,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:rt.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1])return n=n instanceof Y?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:$,e=Y.parseHTML(i[1],a,!0),it.test(i[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);if(o=$.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=$,this.selector=e,this}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return X.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,"find"===t?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(X.apply(this,arguments),"slice",X.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:z,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},c=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},c=2),"object"==typeof s||Y.isFunction(s)||(s={}),l===c&&(s=this,--c);l>c;c++)if(null!=(e=arguments[c]))for(n in e)r=s[n],i=e[n],s!==i&&(u&&i&&(Y.isPlainObject(i)||(o=Y.isArray(i)))?(o?(o=!1,a=r&&Y.isArray(r)?r:[]):a=r&&Y.isPlainObject(r)?r:{},s[n]=Y.extend(u,a,i)):i!==t&&(s[n]=i));return s},Y.extend({noConflict:function(t){return e.$===Y&&(e.$=Q),t&&e.jQuery===Y&&(e.jQuery=U),Y},isReady:!1,readyWait:1,holdReady:function(e){e?Y.readyWait++:Y.ready(!0)},ready:function(e){if(e===!0?!--Y.readyWait:!Y.isReady){if(!$.body)return setTimeout(Y.ready,1);Y.isReady=!0,e!==!0&&--Y.readyWait>0||(B.resolveWith($,[Y]),Y.fn.trigger&&Y($).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Y.type(e)},isArray:Array.isArray||function(e){return"array"===Y.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":dt[V.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Y.type(e)||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!G.call(e,"constructor")&&!G.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||G.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){var r;return e&&"string"==typeof e?("boolean"==typeof t&&(n=t,t=0),t=t||$,(r=it.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(n){return n&&"string"==typeof n?(n=Y.trim(n),e.JSON&&e.JSON.parse?e.JSON.parse(n):ot.test(n.replace(st,"@").replace(ct,"]").replace(at,""))?Function("return "+n)():(Y.error("Invalid JSON: "+n),t)):null},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(lt,"ms-").replace(ut,pt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,o=0,a=e.length,s=a===t||Y.isFunction(e);if(r)if(s){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;a>o&&n.apply(e[o++],r)!==!1;);else if(s){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;a>o&&n.call(e[o],o,e[o++])!==!1;);return e},trim:K&&!K.call(" ")?function(e){return null==e?"":K.call(e)}:function(e){return null==e?"":(e+"").replace(nt,"")},makeArray:function(e,t){var n,r=t||[];return null!=e&&(n=Y.type(e),null==e.length||"string"===n||"function"===n||"regexp"===n||Y.isWindow(e)?z.call(r,e):Y.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(J)return J.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,n,r){var i,o,a=[],s=0,c=e.length,l=e instanceof Y||c!==t&&"number"==typeof c&&(c>0&&e[0]&&e[c-1]||0===c||Y.isArray(e));if(l)for(;c>s;s++)i=n(e[s],s,r),null!=i&&(a[a.length]=i);else for(o in e)i=n(e[o],o,r),null!=i&&(a[a.length]=i);return a.concat.apply([],a)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),Y.isFunction(e)?(i=X.call(arguments,2),o=function(){return e.apply(n,i.concat(X.call(arguments)))},o.guid=e.guid=e.guid||Y.guid++,o):t},access:function(e,n,r,i,o,a,s){var c,l=null==r,u=0,p=e.length;if(r&&"object"==typeof r){for(u in r)Y.access(e,n,u,r[u],1,a,i);o=1}else if(i!==t){if(c=s===t&&Y.isFunction(i),l&&(c?(c=n,n=function(e,t,n){return c.call(Y(e),n)}):(n.call(e,i),n=null)),n)for(;p>u;u++)n(e[u],r,c?i.call(e[u],u,n(e[u],r)):i,s);o=1}return o?e:l?n.call(e):p?n(e[0],r):a},now:function(){return(new Date).getTime()}}),Y.ready.promise=function(t){if(!B)if(B=Y.Deferred(),"complete"===$.readyState)setTimeout(Y.ready,1);else if($.addEventListener)$.addEventListener("DOMContentLoaded",ft,!1),e.addEventListener("load",Y.ready,!1);else{$.attachEvent("onreadystatechange",ft),e.attachEvent("onload",Y.ready);var n=!1;try{n=null==e.frameElement&&$.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!Y.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}Y.ready()}}()}return B.promise(t)},Y.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){dt["[object "+t+"]"]=t.toLowerCase()}),H=Y($);var ht={};Y.Callbacks=function(e){e="string"==typeof e?ht[e]||n(e):Y.extend({},e);var r,i,o,a,s,c,l=[],u=!e.once&&[],p=function(t){for(r=e.memory&&t,i=!0,c=a||0,a=0,s=l.length,o=!0;l&&s>c;c++)if(l[c].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}o=!1,l&&(u?u.length&&p(u.shift()):r?l=[]:f.disable())},f={add:function(){if(l){var t=l.length;(function n(t){Y.each(t,function(t,r){var i=Y.type(r);"function"===i?e.unique&&f.has(r)||l.push(r):r&&r.length&&"string"!==i&&n(r)})})(arguments),o?s=l.length:r&&(a=t,p(r))}return this},remove:function(){return l&&Y.each(arguments,function(e,t){for(var n;(n=Y.inArray(t,l,n))>-1;)l.splice(n,1),o&&(s>=n&&s--,c>=n&&c--)}),this},has:function(e){return Y.inArray(e,l)>-1},empty:function(){return l=[],this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||f.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!l||i&&!u||(o?u.push(t):p(t)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var o=r[0],a=e[t];i[r[1]](Y.isFunction(a)?function(){var e=a.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===i?n:this,[e])}:n[o])}),e=null}).promise()},promise:function(e){return null!=e?Y.extend(e,r):r}},i={};return r.pipe=r.then,Y.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=a.fire,i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=X.call(arguments),a=o.length,s=1!==a||e&&Y.isFunction(e.promise)?a:0,c=1===s?e:Y.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?X.call(arguments):i,r===t?c.notifyWith(n,r):--s||c.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&Y.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(c.reject).progress(l(i,n,t)):--s;return s||c.resolveWith(r,o),c.promise()}}),Y.support=function(){var n,r,i,o,a,s,c,l,u,p,f,d=$.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",r=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=$.createElement("select"),a=o.appendChild($.createElement("option")),s=d.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===s.value,optSelected:a.selected,getSetAttribute:"t"!==d.className,enctype:!!$.createElement("form").enctype,html5Clone:"<:nav>"!==$.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===$.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete d.test}catch(h){n.deleteExpando=!1}if(!d.addEventListener&&d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",f=function(){n.noCloneEvent=!1}),d.cloneNode(!0).fireEvent("onclick"),d.detachEvent("onclick",f)),s=$.createElement("input"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),d.appendChild(s),c=$.createDocumentFragment(),c.appendChild(d.lastChild),n.checkClone=c.cloneNode(!0).cloneNode(!0).lastChild.checked,n.appendChecked=s.checked,c.removeChild(s),c.appendChild(d),d.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})l="on"+u,p=l in d,p||(d.setAttribute(l,"return;"),p="function"==typeof d[l]),n[u+"Bubbles"]=p;return Y(function(){var r,i,o,a,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",c=$.getElementsByTagName("body")[0];c&&(r=$.createElement("div"),r.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",c.insertBefore(r,c.firstChild),i=$.createElement("div"),r.appendChild(i),i.innerHTML="
    t
    ",o=i.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=p&&0===o[0].offsetHeight,i.innerHTML="",i.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===i.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==c.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,a=$.createElement("div"),a.style.cssText=i.style.cssText=s,a.style.marginRight=a.style.width="0",i.style.width="1px",i.appendChild(a),n.reliableMarginRight=!parseFloat((e.getComputedStyle(a,null)||{}).marginRight)),i.style.zoom!==t&&(i.innerHTML="",i.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===i.offsetWidth,i.style.display="block",i.style.overflow="visible",i.innerHTML="
    ",i.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==i.offsetWidth,r.style.zoom=1),c.removeChild(r),r=i=o=a=null)}),c.removeChild(d),r=i=o=a=s=c=d=null,n}();var gt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!i(e)},data:function(e,n,r,i){if(Y.acceptData(e)){var o,a,s=Y.expando,c="string"==typeof n,l=e.nodeType,u=l?Y.cache:e,p=l?e[s]:e[s]&&s;if(p&&u[p]&&(i||u[p].data)||!c||r!==t)return p||(l?e[s]=p=Y.deletedIds.pop()||Y.guid++:p=s),u[p]||(u[p]={},l||(u[p].toJSON=Y.noop)),("object"==typeof n||"function"==typeof n)&&(i?u[p]=Y.extend(u[p],n):u[p].data=Y.extend(u[p].data,n)),o=u[p],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[Y.camelCase(n)]=r),c?(a=o[n],null==a&&(a=o[Y.camelCase(n)])):a=o,a}},removeData:function(e,t,n){if(Y.acceptData(e)){var r,o,a,s=e.nodeType,c=s?Y.cache:e,l=s?e[Y.expando]:Y.expando;if(c[l]){if(t&&(r=n?c[l]:c[l].data)){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t=t in r?[t]:t.split(" ")));for(o=0,a=t.length;a>o;o++)delete r[t[o]];if(!(n?i:Y.isEmptyObject)(r))return}(n||(delete c[l].data,i(c[l])))&&(s?Y.cleanData([e],!0):Y.support.deleteExpando||c!=c.window?delete c[l]:c[l]=null)}}},_data:function(e,t,n){return Y.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&Y.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Y.fn.extend({data:function(e,n){var i,o,a,s,c,l=this[0],u=0,p=null;if(e===t){if(this.length&&(p=Y.data(l),1===l.nodeType&&!Y._data(l,"parsedAttrs"))){for(a=l.attributes,c=a.length;c>u;u++)s=a[u].name,s.indexOf("data-")||(s=Y.camelCase(s.substring(5)),r(l,s,p[s]));Y._data(l,"parsedAttrs",!0)}return p}return"object"==typeof e?this.each(function(){Y.data(this,e)}):(i=e.split(".",2),i[1]=i[1]?"."+i[1]:"",o=i[1]+"!",Y.access(this,function(n){return n===t?(p=this.triggerHandler("getData"+o,[i[0]]),p===t&&l&&(p=Y.data(l,e),p=r(l,e,p)),p===t&&i[1]?this.data(i[0]):p):(i[1]=n,this.each(function(){var t=Y(this);t.triggerHandler("setData"+o,i),Y.data(this,e,n),t.triggerHandler("changeData"+o,i)}),t)},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=Y._data(e,n),r&&(!i||Y.isArray(r)?i=Y._data(e,n,Y.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.length,i=n.shift(),o=Y._queueHooks(e,t),a=function(){Y.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?Y.queue(this[0],e):n===t?this:this.each(function(){var t=Y.queue(this,e,n);Y._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Y.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Y.dequeue(this,e)})},delay:function(e,t){return e=Y.fx?Y.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=Y.Deferred(),a=this,s=this.length,c=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=Y._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(c));return c(),o.promise(n)}});var yt,vt,bt,xt=/[\t\r\n]/g,wt=/\r/g,Ct=/^(?:button|input)$/i,kt=/^(?:button|input|object|select|textarea)$/i,Tt=/^a(?:rea|)$/i,_t=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Nt=Y.support.getSetAttribute;Y.fn.extend({attr:function(e,t){return Y.access(this,Y.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a,s;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(tt),n=0,r=this.length;r>n;n++)if(i=this[n],1===i.nodeType)if(i.className||1!==t.length){for(o=" "+i.className+" ",a=0,s=t.length;s>a;a++)0>o.indexOf(" "+t[a]+" ")&&(o+=t[a]+" ");i.className=Y.trim(o)}else i.className=e;return this},removeClass:function(e){var n,r,i,o,a,s,c;if(Y.isFunction(e))return this.each(function(t){Y(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(n=(e||"").split(tt),s=0,c=this.length;c>s;s++)if(i=this[s],1===i.nodeType&&i.className){for(r=(" "+i.className+" ").replace(xt," "),o=0,a=n.length;a>o;o++)for(;r.indexOf(" "+n[o]+" ")>=0;)r=r.replace(" "+n[o]+" "," ");i.className=e?Y.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=Y(this),s=t,c=e.split(tt);i=c[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(xt," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=Y.isFunction(e),this.each(function(r){var o,a=Y(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":Y.isArray(o)&&(o=Y.map(o,function(e){return null==e?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=Y.valHooks[o.type]||Y.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(wt,""):null==r?"":r)}}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,c=0>i?s:o?i:0;s>c;c++)if(n=r[c],!(!n.selected&&c!==i||(Y.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Y.nodeName(n.parentNode,"optgroup"))){if(t=Y(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=Y.makeArray(t);return Y(e).find("option").each(function(){this.selected=Y.inArray(Y(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var o,a,s,c=e.nodeType;if(e&&3!==c&&8!==c&&2!==c)return i&&Y.isFunction(Y.fn[n])?Y(e)[n](r):e.getAttribute===t?Y.prop(e,n,r):(s=1!==c||!Y.isXMLDoc(e),s&&(n=n.toLowerCase(),a=Y.attrHooks[n]||(_t.test(n)?vt:yt)),r!==t?null===r?(Y.removeAttr(e,n),t):a&&"set"in a&&s&&(o=a.set(e,r,n))!==t?o:(e.setAttribute(n,r+""),r):a&&"get"in a&&s&&null!==(o=a.get(e,n))?o:(o=e.getAttribute(n),null===o?t:o))},removeAttr:function(e,t){var n,r,i,o,a=0;if(t&&1===e.nodeType)for(r=t.split(tt);r.length>a;a++)i=r[a],i&&(n=Y.propFix[i]||i,o=_t.test(i),o||Y.attr(e,i,""),e.removeAttribute(Nt?i:n),o&&n in e&&(e[n]=!1))},attrHooks:{type:{set:function(e,t){if(Ct.test(e.nodeName)&&e.parentNode)Y.error("type property can't be changed");else if(!Y.support.radioValue&&"radio"===t&&Y.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return yt&&Y.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,n,r){return yt&&Y.nodeName(e,"button")?yt.set(e,n,r):(e.value=n,t)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!Y.isXMLDoc(e),a&&(n=Y.propFix[n]||n,o=Y.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):kt.test(e.nodeName)||Tt.test(e.nodeName)&&e.href?0:t}}}}),vt={get:function(e,n){var r,i=Y.prop(e,n);return i===!0||"boolean"!=typeof i&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?Y.removeAttr(e,n):(r=Y.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},Nt||(bt={name:!0,id:!0,coords:!0},yt=Y.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(bt[n]?""!==r.value:r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=$.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},Y.each(["width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})}),Y.attrHooks.contenteditable={get:yt.get,set:function(e,t,n){""===t&&(t="false"),yt.set(e,t,n) +}}),Y.support.hrefNormalized||Y.each(["href","src","width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null===r?t:r}})}),Y.support.style||(Y.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),Y.support.optSelected||(Y.propHooks.selected=Y.extend(Y.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),Y.support.enctype||(Y.propFix.enctype="encoding"),Y.support.checkOn||Y.each(["radio","checkbox"],function(){Y.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),Y.each(["radio","checkbox"],function(){Y.valHooks[this]=Y.extend(Y.valHooks[this],{set:function(e,n){return Y.isArray(n)?e.checked=Y.inArray(Y(e).val(),n)>=0:t}})});var Et=/^(?:textarea|input|select)$/i,At=/^([^\.]*|)(?:\.(.+)|)$/,Ft=/(?:^|\s)hover(\.\S+|)\b/,St=/^key/,jt=/^(?:mouse|contextmenu)|click/,Mt=/^(?:focusinfocus|focusoutblur)$/,Ot=function(e){return Y.event.special.hover?e:e.replace(Ft,"mouseenter$1 mouseleave$1")};Y.event={add:function(e,n,r,i,o){var a,s,c,l,u,p,f,d,h,g,m;if(3!==e.nodeType&&8!==e.nodeType&&n&&r&&(a=Y._data(e))){for(r.handler&&(h=r,r=h.handler,o=h.selector),r.guid||(r.guid=Y.guid++),c=a.events,c||(a.events=c={}),s=a.handle,s||(a.handle=s=function(e){return Y===t||e&&Y.event.triggered===e.type?t:Y.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=Y.trim(Ot(n)).split(" "),l=0;n.length>l;l++)u=At.exec(n[l])||[],p=u[1],f=(u[2]||"").split(".").sort(),m=Y.event.special[p]||{},p=(o?m.delegateType:m.bindType)||p,m=Y.event.special[p]||{},d=Y.extend({type:p,origType:u[1],data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&Y.expr.match.needsContext.test(o),namespace:f.join(".")},h),g=c[p],g||(g=c[p]=[],g.delegateCount=0,m.setup&&m.setup.call(e,i,f,s)!==!1||(e.addEventListener?e.addEventListener(p,s,!1):e.attachEvent&&e.attachEvent("on"+p,s))),m.add&&(m.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),o?g.splice(g.delegateCount++,0,d):g.push(d),Y.event.global[p]=!0;e=null}},global:{},remove:function(e,t,n,r,i){var o,a,s,c,l,u,p,f,d,h,g,m=Y.hasData(e)&&Y._data(e);if(m&&(f=m.events)){for(t=Y.trim(Ot(t||"")).split(" "),o=0;t.length>o;o++)if(a=At.exec(t[o])||[],s=c=a[1],l=a[2],s){for(d=Y.event.special[s]||{},s=(r?d.delegateType:d.bindType)||s,h=f[s]||[],u=h.length,l=l?RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0;h.length>p;p++)g=h[p],!i&&c!==g.origType||n&&n.guid!==g.guid||l&&!l.test(g.namespace)||r&&r!==g.selector&&("**"!==r||!g.selector)||(h.splice(p--,1),g.selector&&h.delegateCount--,d.remove&&d.remove.call(e,g));0===h.length&&u!==h.length&&(d.teardown&&d.teardown.call(e,l,m.handle)!==!1||Y.removeEvent(e,s,m.handle),delete f[s])}else for(s in f)Y.event.remove(e,s+t[o],n,r,!0);Y.isEmptyObject(f)&&(delete m.handle,Y.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,i,o){if(!i||3!==i.nodeType&&8!==i.nodeType){var a,s,c,l,u,p,f,d,h,g,m=n.type||n,y=[];if(!Mt.test(m+Y.event.triggered)&&(m.indexOf("!")>=0&&(m=m.slice(0,-1),s=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),i&&!Y.event.customEvent[m]||Y.event.global[m]))if(n="object"==typeof n?n[Y.expando]?n:new Y.Event(m,n):new Y.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=y.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0>m.indexOf(":")?"on"+m:"",i){if(n.result=t,n.target||(n.target=i),r=null!=r?Y.makeArray(r):[],r.unshift(n),f=Y.event.special[m]||{},!f.trigger||f.trigger.apply(i,r)!==!1){if(h=[[i,f.bindType||m]],!o&&!f.noBubble&&!Y.isWindow(i)){for(g=f.delegateType||m,l=Mt.test(g+m)?i:i.parentNode,u=i;l;l=l.parentNode)h.push([l,g]),u=l;u===(i.ownerDocument||$)&&h.push([u.defaultView||u.parentWindow||e,g])}for(c=0;h.length>c&&!n.isPropagationStopped();c++)l=h[c][0],n.type=h[c][1],d=(Y._data(l,"events")||{})[n.type]&&Y._data(l,"handle"),d&&d.apply(l,r),d=p&&l[p],d&&Y.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=m,o||n.isDefaultPrevented()||f._default&&f._default.apply(i.ownerDocument,r)!==!1||"click"===m&&Y.nodeName(i,"a")||!Y.acceptData(i)||p&&i[m]&&("focus"!==m&&"blur"!==m||0!==n.target.offsetWidth)&&!Y.isWindow(i)&&(u=i[p],u&&(i[p]=null),Y.event.triggered=m,i[m](),Y.event.triggered=t,u&&(i[p]=u)),n.result}}else{a=Y.cache;for(c in a)a[c].events&&a[c].events[m]&&Y.event.trigger(n,r,a[c].handle.elem,!0)}}},dispatch:function(n){n=Y.event.fix(n||e.event);var r,i,o,a,s,c,l,u,p,f=(Y._data(this,"events")||{})[n.type]||[],d=f.delegateCount,h=X.call(arguments),g=!n.exclusive&&!n.namespace,m=Y.event.special[n.type]||{},y=[];if(h[0]=n,n.delegateTarget=this,!m.preDispatch||m.preDispatch.call(this,n)!==!1){if(d&&(!n.button||"click"!==n.type))for(o=n.target;o!=this;o=o.parentNode||this)if(o.disabled!==!0||"click"!==n.type){for(s={},l=[],r=0;d>r;r++)u=f[r],p=u.selector,s[p]===t&&(s[p]=u.needsContext?Y(p,this).index(o)>=0:Y.find(p,this,null,[o]).length),s[p]&&l.push(u);l.length&&y.push({elem:o,matches:l})}for(f.length>d&&y.push({elem:this,matches:f.slice(d)}),r=0;y.length>r&&!n.isPropagationStopped();r++)for(c=y[r],n.currentTarget=c.elem,i=0;c.matches.length>i&&!n.isImmediatePropagationStopped();i++)u=c.matches[i],(g||!n.namespace&&!u.namespace||n.namespace_re&&n.namespace_re.test(u.namespace))&&(n.data=u.data,n.handleObj=u,a=((Y.event.special[u.origType]||{}).handle||u.handler).apply(c.elem,h),a!==t&&(n.result=a,a===!1&&(n.preventDefault(),n.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||$,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[Y.expando])return e;var t,n,r=e,i=Y.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=Y.Event(r),t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||$),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){Y.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=Y.extend(new Y.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?Y.event.trigger(i,null,t):Y.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},Y.event.handle=Y.event.dispatch,Y.removeEvent=$.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},Y.Event=function(e,n){return this instanceof Y.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?a:o):this.type=e,n&&Y.extend(this,n),this.timeStamp=e&&e.timeStamp||Y.now(),this[Y.expando]=!0,t):new Y.Event(e,n)},Y.Event.prototype={preventDefault:function(){this.isDefaultPrevented=a;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=a;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()},isDefaultPrevented:o,isPropagationStopped:o,isImmediatePropagationStopped:o},Y.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Y.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return o.selector,(!i||i!==r&&!Y.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),Y.support.submitBubbles||(Y.event.special.submit={setup:function(){return Y.nodeName(this,"form")?!1:(Y.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=Y.nodeName(n,"input")||Y.nodeName(n,"button")?n.form:t;r&&!Y._data(r,"_submit_attached")&&(Y.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),Y._data(r,"_submit_attached",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&Y.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return Y.nodeName(this,"form")?!1:(Y.event.remove(this,"._submit"),t)}}),Y.support.changeBubbles||(Y.event.special.change={setup:function(){return Et.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(Y.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),Y.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),Y.event.simulate("change",this,e,!0)})),!1):(Y.event.add(this,"beforeactivate._change",function(e){var t=e.target;Et.test(t.nodeName)&&!Y._data(t,"_change_attached")&&(Y.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||Y.event.simulate("change",this.parentNode,e,!0)}),Y._data(t,"_change_attached",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return Y.event.remove(this,"._change"),!Et.test(this.nodeName)}}),Y.support.focusinBubbles||Y.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){Y.event.simulate(t,e.target,Y.event.fix(e),!0)};Y.event.special[t]={setup:function(){0===n++&&$.addEventListener(e,r,!0)},teardown:function(){0===--n&&$.removeEventListener(e,r,!0)}}}),Y.fn.extend({on:function(e,n,r,i,a){var s,c;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(c in e)this.on(c,n,r,e[c],a);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=o;else if(!i)return this;return 1===a&&(s=i,i=function(e){return Y().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=Y.guid++)),this.each(function(){Y.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,a;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,Y(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(a in e)this.off(a,n,e[a]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=o),this.each(function(){Y.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return Y(this.context).on(e,this.selector,t,n),this},die:function(e,t){return Y(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){Y.event.trigger(e,t,this)})},triggerHandler:function(e,n){return this[0]?Y.event.trigger(e,n,this[0],!0):t},toggle:function(e){var t=arguments,n=e.guid||Y.guid++,r=0,i=function(n){var i=(Y._data(this,"lastToggle"+e.guid)||0)%r;return Y._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};for(i.guid=n;t.length>r;)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Y.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Y.fn[t]=function(e,n){return null==n&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},St.test(t)&&(Y.event.fixHooks[t]=Y.event.keyHooks),jt.test(t)&&(Y.event.fixHooks[t]=Y.event.mouseHooks)}),/*! + * Sizzle CSS Selector Engine + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license + * http://sizzlejs.com/ + */ +function(e,t){function n(e,t,n,r){n=n||[],t=t||j;var i,o,a,s,c=t.nodeType;if(!e||"string"!=typeof e)return n;if(1!==c&&9!==c)return[];if(a=w(t),!a&&!r&&(i=nt.exec(e)))if(s=i[1]){if(9===c){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&C(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return L.apply(n,D.call(t.getElementsByTagName(e),0)),n;if((s=i[3])&&ft&&t.getElementsByClassName)return L.apply(n,D.call(t.getElementsByClassName(s),0)),n}return g(e.replace(K,"$1"),t,n,r,a)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function i(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function o(e){return H(function(t){return t=+t,H(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function a(e,t,n){if(e===t)return n;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function s(e,t){var r,i,o,a,s,c,l,u=q[F][e+" "];if(u)return t?0:u.slice(0);for(s=e,c=[],l=b.preFilter;s;){(!r||(i=Z.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),c.push(o=[])),r=!1,(i=et.exec(s))&&(o.push(r=new S(i.shift())),s=s.slice(r.length),r.type=i[0].replace(K," "));for(a in b.filter)!(i=st[a].exec(s))||l[a]&&!(i=l[a](i))||(o.push(r=new S(i.shift())),s=s.slice(r.length),r.type=a,r.matches=i);if(!r)break}return t?s.length:s?n.error(e):q(e,c).slice(0)}function c(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=I++;return t.first?function(t,n,o){for(;t=t[r];)if(i||1===t.nodeType)return e(t,n,o)}:function(t,n,a){if(a){for(;t=t[r];)if((i||1===t.nodeType)&&e(t,n,a))return t}else for(var s,c=O+" "+o+" ",l=c+y;t=t[r];)if(i||1===t.nodeType){if((s=t[F])===l)return t.sizset;if("string"==typeof s&&0===s.indexOf(c)){if(t.sizset)return t}else{if(t[F]=l,e(t,n,a))return t.sizset=!0,t;t.sizset=!1}}}}function l(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function u(e,t,n,r,i){for(var o,a=[],s=0,c=e.length,l=null!=t;c>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function p(e,t,n,r,i,o){return r&&!r[F]&&(r=p(r)),i&&!i[F]&&(i=p(i,o)),H(function(o,a,s,c){var l,p,f,d=[],g=[],m=a.length,y=o||h(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?y:u(y,d,e,s,c),b=n?i||(o?e:m||r)?[]:a:v;if(n&&n(v,b,s,c),r)for(l=u(b,g),r(l,[],s,c),p=l.length;p--;)(f=l[p])&&(b[g[p]]=!(v[g[p]]=f));if(o){if(i||e){if(i){for(l=[],p=b.length;p--;)(f=b[p])&&l.push(v[p]=f);i(null,b=[],l,c)}for(p=b.length;p--;)(f=b[p])&&(l=i?P.call(o,f):d[p])>-1&&(o[l]=!(a[l]=f))}}else b=u(b===a?b.splice(m,b.length):b),i?i(null,a,b,c):L.apply(a,b)})}function f(e){for(var t,n,r,i=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=c(function(e){return e===t},a,!0),d=c(function(e){return P.call(t,e)>-1},a,!0),h=[function(e,n,r){return!o&&(r||n!==N)||((t=n).nodeType?u(e,n,r):d(e,n,r))}];i>s;s++)if(n=b.relative[e[s].type])h=[c(l(h),n)];else{if(n=b.filter[e[s].type].apply(null,e[s].matches),n[F]){for(r=++s;i>r&&!b.relative[e[r].type];r++);return p(s>1&&l(h),s>1&&e.slice(0,s-1).join("").replace(K,"$1"),n,r>s&&f(e.slice(s,r)),i>r&&f(e=e.slice(r)),i>r&&e.join(""))}h.push(n)}return l(h)}function d(e,t){var r=t.length>0,i=e.length>0,o=function(a,s,c,l,p){var f,d,h,g=[],m=0,v="0",x=a&&[],w=null!=p,C=N,k=a||i&&b.find.TAG("*",p&&s.parentNode||s),T=O+=null==C?1:Math.E;for(w&&(N=s!==j&&s,y=o.el);null!=(f=k[v]);v++){if(i&&f){for(d=0;h=e[d];d++)if(h(f,s,c)){l.push(f);break}w&&(O=T,y=++o.el)}r&&((f=!h&&f)&&m--,a&&x.push(f))}if(m+=v,r&&v!==m){for(d=0;h=t[d];d++)h(x,g,s,c);if(a){if(m>0)for(;v--;)x[v]||g[v]||(g[v]=R.call(l));g=u(g)}L.apply(l,g),w&&!a&&g.length>0&&m+t.length>1&&n.uniqueSort(l)}return w&&(O=T,N=C),x};return o.el=0,r?H(o):o}function h(e,t,r){for(var i=0,o=t.length;o>i;i++)n(e,t[i],r);return r}function g(e,t,n,r,i){var o,a,c,l,u,p=s(e);if(p.length,!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(c=a[0]).type&&9===t.nodeType&&!i&&b.relative[a[1].type]){if(t=b.find.ID(c.matches[0].replace(at,""),t,i)[0],!t)return n;e=e.slice(a.shift().length)}for(o=st.POS.test(e)?-1:a.length-1;o>=0&&(c=a[o],!b.relative[l=c.type]);o--)if((u=b.find[l])&&(r=u(c.matches[0].replace(at,""),rt.test(a[0].type)&&t.parentNode||t,i))){if(a.splice(o,1),e=r.length&&a.join(""),!e)return L.apply(n,D.call(r,0)),n;break}}return k(e,p)(r,t,i,n,rt.test(e)),n}function m(){}var y,v,b,x,w,C,k,T,_,N,E=!0,A="undefined",F=("sizcache"+Math.random()).replace(".",""),S=String,j=e.document,M=j.documentElement,O=0,I=0,R=[].pop,L=[].push,D=[].slice,P=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},H=function(e,t){return e[F]=null==t||t,e},B=function(){var e={},t=[];return H(function(n,r){return t.push(n)>b.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},$=B(),q=B(),W=B(),U="[\\x20\\t\\r\\n\\f]",Q="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",z=Q.replace("w","w#"),X="([*^$|!~]?=)",J="\\["+U+"*("+Q+")"+U+"*(?:"+X+U+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+z+")|)|)"+U+"*\\]",V=":("+Q+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+J+")|[^:]|\\\\.)*|.*))\\)|)",G=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+U+"*((?:-\\d)?\\d*)"+U+"*\\)|)(?=[^-]|$)",K=RegExp("^"+U+"+|((?:^|[^\\\\])(?:\\\\.)*)"+U+"+$","g"),Z=RegExp("^"+U+"*,"+U+"*"),et=RegExp("^"+U+"*([\\x20\\t\\r\\n\\f>+~])"+U+"*"),tt=RegExp(V),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/[\x20\t\r\n\f]*[+~]/,it=/h\d/i,ot=/input|select|textarea|button/i,at=/\\(?!\\)/g,st={ID:RegExp("^#("+Q+")"),CLASS:RegExp("^\\.("+Q+")"),NAME:RegExp("^\\[name=['\"]?("+Q+")['\"]?\\]"),TAG:RegExp("^("+Q.replace("w","w*")+")"),ATTR:RegExp("^"+J),PSEUDO:RegExp("^"+V),POS:RegExp(G,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+U+"*(even|odd|(([+-]|)(\\d*)n|)"+U+"*(?:([+-]|)"+U+"*(\\d+)|))"+U+"*\\)|)","i"),needsContext:RegExp("^"+U+"*[>+~]|"+G,"i")},ct=function(e){var t=j.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},lt=ct(function(e){return e.appendChild(j.createComment("")),!e.getElementsByTagName("*").length}),ut=ct(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")}),pt=ct(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),ft=ct(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),dt=ct(function(e){e.id=F+0,e.innerHTML="
    ",M.insertBefore(e,M.firstChild);var t=j.getElementsByName&&j.getElementsByName(F).length===2+j.getElementsByName(F+0).length;return v=!j.getElementById(F),M.removeChild(e),t});try{D.call(M.childNodes,0)[0].nodeType}catch(ht){D=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},x=n.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=x(t);return n},w=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},C=n.contains=M.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:M.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=w(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||pt?e.getAttribute(t):(n=e.getAttributeNode(t),n?"boolean"==typeof e[t]?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:H,match:st,attrHandle:ut?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:v?function(e,t,n){if(typeof t.getElementById!==A&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==A&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==A&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:lt?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n=t.getElementsByTagName(e);if("*"===e){for(var r,i=[],o=0;r=n[o];o++)1===r.nodeType&&i.push(r);return i}return n},NAME:dt&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},CLASS:ft&&function(e,n,r){return typeof n.getElementsByClassName===A||r?t:n.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(at,""),e[3]=(e[4]||e[5]||"").replace(at,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;return st.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(tt.test(t)&&(n=s(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t),e.slice(0,3))}},filter:{ID:v?function(e){return e=e.replace(at,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(at,""),function(t){var n=typeof t.getAttributeNode!==A&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(at,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=$[F][e+" "];return t||(t=RegExp("(^|"+U+")"+e+"("+U+"|$)"))&&$(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(i){var o=n.attr(i,e);return null==o?"!="===t:t?(o+="","="===t?o===r:"!="===t?o!==r:"^="===t?r&&0===o.indexOf(r):"*="===t?r&&o.indexOf(r)>-1:"$="===t?r&&o.substr(o.length-r.length)===r:"~="===t?(" "+o+" ").indexOf(r)>-1:"|="===t?o===r||o.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r){return"nth"===e?function(e){var t,i,o=e.parentNode;if(1===n&&0===r)return!0;if(o)for(i=0,t=o.firstChild;t&&(1!==t.nodeType||(i++,e!==t));t=t.nextSibling);return i-=r,i===n||0===i%n&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===e)return!0;n=t;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(e,t){var r,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return i[F]?i(t):i.length>1?(r=[e,e,"",t],b.setFilters.hasOwnProperty(e.toLowerCase())?H(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=P.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,r)}):i}},pseudos:{not:H(function(e){var t=[],n=[],r=k(e.replace(K,"$1"));return r[F]?H(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:H(function(e){return function(t){return n(e,t).length>0}}),contains:H(function(e){return function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return it.test(e.nodeName)},text:function(e){var t,n;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(n=e.getAttribute("type"))||n.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:i("submit"),reset:i("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return ot.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:o(function(){return[0]}),last:o(function(e,t){return[t-1]}),eq:o(function(e,t,n){return[0>n?n+t:n]}),even:o(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:o(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:o(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:o(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}},T=M.compareDocumentPosition?function(e,t){return e===t?(_=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return _=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],o=[],s=e.parentNode,c=t.parentNode,l=s;if(s===c)return a(e,t);if(!s)return-1;if(!c)return 1;for(;l;)i.unshift(l),l=l.parentNode;for(l=c;l;)o.unshift(l),l=l.parentNode;n=i.length,r=o.length;for(var u=0;n>u&&r>u;u++)if(i[u]!==o[u])return a(i[u],o[u]);return u===n?a(e,o[u],-1):a(i[u],t,1)},[0,0].sort(T),E=!_,n.uniqueSort=function(e){var t,n=[],r=1,i=0;if(_=E,e.sort(T),_){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},n.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},k=n.compile=function(e,t){var n,r=[],i=[],o=W[F][e+" "];if(!o){for(t||(t=s(e)),n=t.length;n--;)o=f(t[n]),o[F]?r.push(o):i.push(o);o=W(e,d(i,r))}return o},j.querySelectorAll&&function(){var e,t=g,r=/'|\\/g,i=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,o=[":focus"],a=[":active"],c=M.matchesSelector||M.mozMatchesSelector||M.webkitMatchesSelector||M.oMatchesSelector||M.msMatchesSelector;ct(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||o.push("\\["+U+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||o.push(":checked")}),ct(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&o.push("[*^$]="+U+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||o.push(":enabled",":disabled")}),o=RegExp(o.join("|")),g=function(e,n,i,a,c){if(!a&&!c&&!o.test(e)){var l,u,p=!0,f=F,d=n,h=9===n.nodeType&&e;if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){for(l=s(e),(p=n.getAttribute("id"))?f=p.replace(r,"\\$&"):n.setAttribute("id",f),f="[id='"+f+"'] ",u=l.length;u--;)l[u]=f+l[u].join("");d=rt.test(e)&&n.parentNode||n,h=l.join(",")}if(h)try{return L.apply(i,D.call(d.querySelectorAll(h),0)),i}catch(g){}finally{p||n.removeAttribute("id")}}return t(e,n,i,a,c)},c&&(ct(function(t){e=c.call(t,"div");try{c.call(t,"[test!='']:sizzle"),a.push("!=",V)}catch(n){}}),a=RegExp(a.join("|")),n.matchesSelector=function(t,r){if(r=r.replace(i,"='$1']"),!w(t)&&!a.test(r)&&!o.test(r))try{var s=c.call(t,r);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(l){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=Y.attr,Y.find=n,Y.expr=n.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=n.uniqueSort,Y.text=n.getText,Y.isXMLDoc=n.isXML,Y.contains=n.contains}(e);var It=/Until$/,Rt=/^(?:parents|prev(?:Until|All))/,Lt=/^.[^:#\[\.,]*$/,Dt=Y.expr.match.needsContext,Pt={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,i,o,a,s=this;if("string"!=typeof e)return Y(e).filter(function(){for(t=0,n=s.length;n>t;t++)if(Y.contains(s[t],this))return!0});for(a=this.pushStack("","find",e),t=0,n=this.length;n>t;t++)if(r=a.length,Y.find(e,this[t],a),t>0)for(i=r;a.length>i;i++)for(o=0;r>o;o++)if(a[o]===a[i]){a.splice(i--,1);break}return a},has:function(e){var t,n=Y(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(Y.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(l(this,e,!1),"not",e)},filter:function(e){return this.pushStack(l(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?Dt.test(e)?Y(e,this.context).index(this[0])>=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=Dt.test(e)||"string"!=typeof e?Y(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:Y.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return o=o.length>1?Y.unique(o):o,this.pushStack(o,"closest",e)},index:function(e){return e?"string"==typeof e?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n="string"==typeof e?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(s(n[0])||s(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir(e,"parentNode",n)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var i=Y.map(this,t,n);return It.test(e)||(r=n),r&&"string"==typeof r&&(i=Y.filter(r,i)),i=this.length>1&&!Pt[e]?Y.unique(i):i,this.length>1&&Rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,X.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!Y(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var Ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Bt=/ jQuery\d+="(?:null|\d+)"/g,$t=/^\s+/,qt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Wt=/<([\w:]+)/,Ut=/]","i"),Vt=/^(?:checkbox|radio)$/,Gt=/checked\s*(?:[^=]|=\s*.checked.)/i,Kt=/\/(java|ecma)script/i,Yt=/^\s*\s*$/g,Zt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},en=u($),tn=en.appendChild($.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X
    ","
    "]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||$).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||Y.filter(e,[n]).length)&&(t||1!==n.nodeType||(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Y.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Bt,""):t;if(!("string"!=typeof e||zt.test(e)||!Y.support.htmlSerialize&&Jt.test(e)||!Y.support.leadingWhitespace&&$t.test(e)||Zt[(Wt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(qt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(Y.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return s(this[0])?this.length?this.pushStack(Y(Y.isFunction(e)?e():e),"replaceWith",e):this:Y.isFunction(e)?this.each(function(t){var n=Y(this),r=n.html();n.replaceWith(e.call(this,t,r))}):("string"!=typeof e&&(e=Y(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;Y(this).remove(),t?Y(t).before(e):Y(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,o,a,s,c=0,l=e[0],u=[],f=this.length;if(!Y.support.checkClone&&f>1&&"string"==typeof l&&Gt.test(l))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(l))return this.each(function(i){var o=Y(this);e[0]=l.call(this,i,n?o.html():t),o.domManip(e,n,r)});if(this[0]){if(i=Y.buildFragment(e,this,u),a=i.fragment,o=a.firstChild,1===a.childNodes.length&&(a=o),o)for(n=n&&Y.nodeName(o,"tr"),s=i.cacheable||f-1;f>c;c++)r.call(n&&Y.nodeName(this[c],"table")?p(this[c],"tbody"):this[c],c===s?a:Y.clone(a,!0,!0));a=o=null,u.length&&Y.each(u,function(e,t){t.src?Y.ajax?Y.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Y.error("no ajax"):Y.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Yt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Y.buildFragment=function(e,n,r){var i,o,a,s=e[0];return n=n||$,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,!(1===e.length&&"string"==typeof s&&512>s.length&&n===$&&"<"===s.charAt(0))||Xt.test(s)||!Y.support.checkClone&&Gt.test(s)||!Y.support.html5Clone&&Jt.test(s)||(o=!0,i=Y.fragments[s],a=i!==t),i||(i=n.createDocumentFragment(),Y.clean(e,n,i,r),o&&(Y.fragments[s]=a&&i)),{fragment:i,cacheable:o}},Y.fragments={},Y.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Y.fn[e]=function(n){var r,i=0,o=[],a=Y(n),s=a.length,c=1===this.length&&this[0].parentNode;if((null==c||c&&11===c.nodeType&&1===c.childNodes.length)&&1===s)return a[t](this[0]),this;for(;s>i;i++)r=(i>0?this.clone(!0):this).get(),Y(a[i])[t](r),o=o.concat(r);return this.pushStack(o,e,a.selector)}}),Y.extend({clone:function(e,t,n){var r,i,o,a;if(Y.support.html5Clone||Y.isXMLDoc(e)||!Jt.test("<"+e.nodeName+">")?a=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(a=tn.firstChild)),!(Y.support.noCloneEvent&&Y.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Y.isXMLDoc(e)))for(d(e,a),r=h(e),i=h(a),o=0;r[o];++o)i[o]&&d(r[o],i[o]);if(t&&(f(e,a),n))for(r=h(e),i=h(a),o=0;r[o];++o)f(r[o],i[o]);return r=i=null,a},clean:function(e,n,r,i){var o,a,s,c,l,p,f,d,h,m,y,v=n===$&&en,b=[];for(n&&n.createDocumentFragment!==t||(n=$),o=0;null!=(s=e[o]);o++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(Qt.test(s)){for(v=v||u(n),f=n.createElement("div"),v.appendChild(f),s=s.replace(qt,"<$1>"),c=(Wt.exec(s)||["",""])[1].toLowerCase(),l=Zt[c]||Zt._default,p=l[0],f.innerHTML=l[1]+s+l[2];p--;)f=f.lastChild;if(!Y.support.tbody)for(d=Ut.test(s),h="table"!==c||d?""!==l[1]||d?[]:f.childNodes:f.firstChild&&f.firstChild.childNodes,a=h.length-1;a>=0;--a)Y.nodeName(h[a],"tbody")&&!h[a].childNodes.length&&h[a].parentNode.removeChild(h[a]);!Y.support.leadingWhitespace&&$t.test(s)&&f.insertBefore(n.createTextNode($t.exec(s)[0]),f.firstChild),s=f.childNodes,f.parentNode.removeChild(f)}else s=n.createTextNode(s);s.nodeType?b.push(s):Y.merge(b,s)}if(f&&(s=f=v=null),!Y.support.appendChecked)for(o=0;null!=(s=b[o]);o++)Y.nodeName(s,"input")?g(s):s.getElementsByTagName!==t&&Y.grep(s.getElementsByTagName("input"),g);if(r)for(m=function(e){return!e.type||Kt.test(e.type)?i?i.push(e.parentNode?e.parentNode.removeChild(e):e):r.appendChild(e):t},o=0;null!=(s=b[o]);o++)Y.nodeName(s,"script")&&m(s)||(r.appendChild(s),s.getElementsByTagName!==t&&(y=Y.grep(Y.merge([],s.getElementsByTagName("script")),m),b.splice.apply(b,[o+1,0].concat(y)),o+=y.length));return b},cleanData:function(e,t){for(var n,r,i,o,a=0,s=Y.expando,c=Y.cache,l=Y.support.deleteExpando,u=Y.event.special;null!=(i=e[a]);a++)if((t||Y.acceptData(i))&&(r=i[s],n=r&&c[r])){if(n.events)for(o in n.events)u[o]?Y.event.remove(i,o):Y.removeEvent(i,o,n.handle);c[r]&&(delete c[r],l?delete i[s]:i.removeAttribute?i.removeAttribute(s):i[s]=null,Y.deletedIds.push(r))}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(W.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,r){return r&&r instanceof Y&&!(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e($);return e}}();var nn,rn,on,an=/alpha\([^)]*\)/i,sn=/opacity=([^)]*)/,cn=/^(top|right|bottom|left)$/,ln=/^(none|table(?!-c[ea]).+)/,un=/^margin/,pn=RegExp("^("+Z+")(.*)$","i"),fn=RegExp("^("+Z+")(?!px)[a-z%]+$","i"),dn=RegExp("^([-+])=("+Z+")","i"),hn={BODY:"block"},gn={position:"absolute",visibility:"hidden",display:"block"},mn={letterSpacing:0,fontWeight:400},yn=["Top","Right","Bottom","Left"],vn=["Webkit","O","Moz","ms"],bn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e,t){var n="boolean"==typeof e;return Y.isFunction(e)&&Y.isFunction(t)?bn.apply(this,arguments):this.each(function(){(n?e:y(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,c=Y.camelCase(n),l=e.style;if(n=Y.cssProps[c]||(Y.cssProps[c]=m(l,c)),s=Y.cssHooks[n]||Y.cssHooks[c],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=dn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(Y.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||Y.cssNumber[c]||(r+="px"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(u){}}},css:function(e,n,r,i){var o,a,s,c=Y.camelCase(n);return n=Y.cssProps[c]||(Y.cssProps[c]=m(e.style,c)),s=Y.cssHooks[n]||Y.cssHooks[c],s&&"get"in s&&(o=s.get(e,!0,i)),o===t&&(o=nn(e,n)),"normal"===o&&n in mn&&(o=mn[n]),r||i!==t?(a=parseFloat(o),r||Y.isNumeric(a)?a||0:o):o},swap:function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=o[i];return r}}),e.getComputedStyle?nn=function(t,n){var r,i,o,a,s=e.getComputedStyle(t,null),c=t.style;return s&&(r=s.getPropertyValue(n)||s[n],""!==r||Y.contains(t.ownerDocument,t)||(r=Y.style(t,n)),fn.test(r)&&un.test(n)&&(i=c.width,o=c.minWidth,a=c.maxWidth,c.minWidth=c.maxWidth=c.width=r,r=s.width,c.width=i,c.minWidth=o,c.maxWidth=a)),r}:$.documentElement.currentStyle&&(nn=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],o=e.style;return null==i&&o&&o[t]&&(i=o[t]),fn.test(i)&&!cn.test(t)&&(n=o.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),o.left="fontSize"===t?"1em":i,i=o.pixelLeft+"px",o.left=n,r&&(e.runtimeStyle.left=r)),""===i?"auto":i}),Y.each(["height","width"],function(e,n){Y.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&ln.test(nn(e,"display"))?Y.swap(e,gn,function(){return w(e,n,i)}):w(e,n,i):t},set:function(e,t,r){return b(e,t,r?x(e,n,r,Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing")):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return sn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=Y.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,t>=1&&""===Y.trim(o.replace(an,""))&&n.removeAttribute&&(n.removeAttribute("filter"),r&&!r.filter)||(n.filter=an.test(o)?o.replace(an,i):o+" "+i)}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,n){return Y.swap(e,{display:"inline-block"},function(){return n?nn(e,"marginRight"):t})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return fn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Y.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||nn(e,"display"))},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,i="string"==typeof n?n.split(" "):[n],o={};for(r=0;4>r;r++)o[e+yn[r]+t]=i[r]||i[r-2]||i[0];return o}},un.test(e)||(Y.cssHooks[e+t].set=b)});var xn=/%20/g,wn=/\[\]$/,Cn=/\r?\n/g,kn=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,Tn=/^(?:select|textarea)/i; +Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||Tn.test(this.nodeName)||kn.test(this.type))}).map(function(e,t){var n=Y(this).val();return null==n?null:Y.isArray(n)?Y.map(n,function(e){return{name:t.name,value:e.replace(Cn,"\r\n")}}):{name:t.name,value:n.replace(Cn,"\r\n")}}).get()}}),Y.param=function(e,n){var r,i=[],o=function(e,t){t=Y.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional),Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){o(this.name,this.value)});else for(r in e)k(r,e[r],n,o);return i.join("&").replace(xn,"+")};var _n,Nn,En=/#.*$/,An=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Fn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Sn=/^(?:GET|HEAD)$/,jn=/^\/\//,Mn=/\?/,On=/)<[^<]*)*<\/script>/gi,In=/([?&])_=[^&]*/,Rn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Ln=Y.fn.load,Dn={},Pn={},Hn=["*/"]+["*"];try{Nn=q.href}catch(Bn){Nn=$.createElement("a"),Nn.href="",Nn=Nn.href}_n=Rn.exec(Nn.toLowerCase())||[],Y.fn.load=function(e,n,r){if("string"!=typeof e&&Ln)return Ln.apply(this,arguments);if(!this.length)return this;var i,o,a,s=this,c=e.indexOf(" ");return c>=0&&(i=e.slice(c,e.length),e=e.slice(0,c)),Y.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),Y.ajax({url:e,type:o,dataType:"html",data:n,complete:function(e,t){r&&s.each(r,a||[e.responseText,t,e])}}).done(function(e){a=arguments,s.html(i?Y("
    ").append(e.replace(On,"")).find(i):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,i,o){return Y.isFunction(r)&&(o=o||i,i=r,r=t),Y.ajax({type:n,url:e,data:r,success:i,dataType:o})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?N(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),N(e,t),e},ajaxSettings:{url:Nn,isLocal:Fn.test(_n[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Hn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:T(Dn),ajaxTransport:T(Pn),ajax:function(e,n){function r(e,n,r,a){var l,p,v,b,w,k=n;2!==x&&(x=2,c&&clearTimeout(c),s=t,o=a||"",C.readyState=e>0?4:0,r&&(b=E(f,C,r)),e>=200&&300>e||304===e?(f.ifModified&&(w=C.getResponseHeader("Last-Modified"),w&&(Y.lastModified[i]=w),w=C.getResponseHeader("Etag"),w&&(Y.etag[i]=w)),304===e?(k="notmodified",l=!0):(l=A(f,b),k=l.state,p=l.data,v=l.error,l=!v)):(v=k,(!k||e)&&(k="error",0>e&&(e=0))),C.status=e,C.statusText=(n||k)+"",l?g.resolveWith(d,[p,k,C]):g.rejectWith(d,[C,k,v]),C.statusCode(y),y=t,u&&h.trigger("ajax"+(l?"Success":"Error"),[C,f,l?p:v]),m.fireWith(d,[C,k]),u&&(h.trigger("ajaxComplete",[C,f]),--Y.active||Y.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,c,l,u,p,f=Y.ajaxSetup({},n),d=f.context||f,h=d!==f&&(d.nodeType||d instanceof Y)?Y(d):Y.event,g=Y.Deferred(),m=Y.Callbacks("once memory"),y=f.statusCode||{},v={},b={},x=0,w="canceled",C={readyState:0,setRequestHeader:function(e,t){if(!x){var n=e.toLowerCase();e=b[n]=b[n]||e,v[e]=t}return this},getAllResponseHeaders:function(){return 2===x?o:null},getResponseHeader:function(e){var n;if(2===x){if(!a)for(a={};n=An.exec(o);)a[n[1].toLowerCase()]=n[2];n=a[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return x||(f.mimeType=e),this},abort:function(e){return e=e||w,s&&s.abort(e),r(0,e),this}};if(g.promise(C),C.success=C.done,C.error=C.fail,C.complete=m.add,C.statusCode=function(e){if(e){var t;if(2>x)for(t in e)y[t]=[y[t],e[t]];else t=e[C.status],C.always(t)}return this},f.url=((e||f.url)+"").replace(En,"").replace(jn,_n[1]+"//"),f.dataTypes=Y.trim(f.dataType||"*").toLowerCase().split(tt),null==f.crossDomain&&(l=Rn.exec(f.url.toLowerCase()),f.crossDomain=!(!l||l[1]===_n[1]&&l[2]===_n[2]&&(l[3]||("http:"===l[1]?80:443))==(_n[3]||("http:"===_n[1]?80:443)))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Y.param(f.data,f.traditional)),_(Dn,f,n,C),2===x)return C;if(u=f.global,f.type=f.type.toUpperCase(),f.hasContent=!Sn.test(f.type),u&&0===Y.active++&&Y.event.trigger("ajaxStart"),!f.hasContent&&(f.data&&(f.url+=(Mn.test(f.url)?"&":"?")+f.data,delete f.data),i=f.url,f.cache===!1)){var k=Y.now(),T=f.url.replace(In,"$1_="+k);f.url=T+(T===f.url?(Mn.test(f.url)?"&":"?")+"_="+k:"")}(f.data&&f.hasContent&&f.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),f.ifModified&&(i=i||f.url,Y.lastModified[i]&&C.setRequestHeader("If-Modified-Since",Y.lastModified[i]),Y.etag[i]&&C.setRequestHeader("If-None-Match",Y.etag[i])),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Hn+"; q=0.01":""):f.accepts["*"]);for(p in f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(f.beforeSend.call(d,C,f)===!1||2===x))return C.abort();w="abort";for(p in{success:1,error:1,complete:1})C[p](f[p]);if(s=_(Pn,f,n,C)){C.readyState=1,u&&h.trigger("ajaxSend",[C,f]),f.async&&f.timeout>0&&(c=setTimeout(function(){C.abort("timeout")},f.timeout));try{x=1,s.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return C},active:0,lastModified:{},etag:{}});var $n=[],qn=/\?/,Wn=/(=)\?(?=&|$)|\?\?/,Un=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=$n.pop()||Y.expando+"_"+Un++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,c=n.data,l=n.url,u=n.jsonp!==!1,p=u&&Wn.test(l),f=u&&!p&&"string"==typeof c&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wn.test(c);return"jsonp"===n.dataTypes[0]||p||f?(o=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a=e[o],p?n.url=l.replace(Wn,"$1"+o):f?n.data=c.replace(Wn,"$1"+o):u&&(n.url+=(qn.test(l)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||Y.error(o+" was not called"),s[0]},n.dataTypes[0]="json",e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,$n.push(o)),s&&Y.isFunction(a)&&a(s[0]),s=a=t}),"script"):t}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=$.head||$.getElementsByTagName("head")[0]||$.documentElement;return{send:function(i,o){n=$.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){(i||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Qn,zn=e.ActiveXObject?function(){for(var e in Qn)Qn[e](0,1)}:!1,Xn=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&F()||S()}:F,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(i,o){var a,s,c=n.xhr();if(n.username?c.open(n.type,n.url,n.async,n.username,n.password):c.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)c[s]=n.xhrFields[s];n.mimeType&&c.overrideMimeType&&c.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)c.setRequestHeader(s,i[s])}catch(l){}c.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,u,p,f;try{if(r&&(i||4===c.readyState))if(r=t,a&&(c.onreadystatechange=Y.noop,zn&&delete Qn[a]),i)4!==c.readyState&&c.abort();else{s=c.status,u=c.getAllResponseHeaders(),p={},f=c.responseXML,f&&f.documentElement&&(p.xml=f);try{p.text=c.responseText}catch(d){}try{l=c.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(h){i||o(-1,h)}p&&o(s,l,p,u)},n.async?4===c.readyState?setTimeout(r,0):(a=++Xn,zn&&(Qn||(Qn={},Y(e).unload(zn)),Qn[a]=r),c.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Jn,Vn,Gn=/^(?:toggle|show|hide)$/,Kn=RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Yn=/queueHooks$/,Zn=[R],er={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Kn.exec(t),a=i.cur(),s=+a||0,c=1,l=20;if(o){if(n=+o[2],r=o[3]||(Y.cssNumber[e]?"":"px"),"px"!==r&&s){s=Y.css(i.elem,e,!0)||n||1;do c=c||".5",s/=c,Y.style(i.elem,e,s+r);while(c!==(c=i.cur()/a)&&1!==c&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};Y.Animation=Y.extend(O,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],er[n]=er[n]||[],er[n].unshift(t)},prefilter:function(e,t){t?Zn.unshift(e):Zn.push(e)}}),Y.Tween=L,L.prototype={constructor:L,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(Y.cssNumber[n]?"":"px")},cur:function(){var e=L.propHooks[this.prop];return e&&e.get?e.get(this):L.propHooks._default.get(this)},run:function(e){var t,n=L.propHooks[this.prop];return this.pos=t=this.options.duration?Y.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Y.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Y.fx.step[e.prop]?Y.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Y.cssProps[e.prop]]||Y.cssHooks[e.prop])?Y.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Y.each(["toggle","show","hide"],function(e,t){var n=Y.fn[t];Y.fn[t]=function(r,i,o){return null==r||"boolean"==typeof r||!e&&Y.isFunction(r)&&Y.isFunction(i)?n.apply(this,arguments):this.animate(D(t,!0),r,i,o)}}),Y.fn.extend({fadeTo:function(e,t,n,r){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=Y.isEmptyObject(e),o=Y.speed(t,n,r),a=function(){var t=O(this,Y.extend({},e),o);i&&t.stop(!0)};return i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=Y.timers,a=Y._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Yn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&Y.dequeue(this,e)})}}),Y.each({slideDown:D("show"),slideUp:D("hide"),slideToggle:D("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Y.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Y.speed=function(e,t,n){var r=e&&"object"==typeof e?Y.extend({},e):{complete:n||!n&&t||Y.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Y.isFunction(t)&&t};return r.duration=Y.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Y.fx.speeds?Y.fx.speeds[r.duration]:Y.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Y.isFunction(r.old)&&r.old.call(this),r.queue&&Y.dequeue(this,r.queue)},r},Y.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Y.timers=[],Y.fx=L.prototype.init,Y.fx.tick=function(){var e,n=Y.timers,r=0;for(Jn=Y.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||Y.fx.stop(),Jn=t},Y.fx.timer=function(e){e()&&Y.timers.push(e)&&!Vn&&(Vn=setInterval(Y.fx.tick,Y.fx.interval))},Y.fx.interval=13,Y.fx.stop=function(){clearInterval(Vn),Vn=null},Y.fx.speeds={slow:600,fast:200,_default:400},Y.fx.step={},Y.expr&&Y.expr.filters&&(Y.expr.filters.animated=function(e){return Y.grep(Y.timers,function(t){return e===t.elem}).length});var tr=/^(?:body|html)$/i;Y.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Y.offset.setOffset(this,e,t)});var n,r,i,o,a,s,c,l={top:0,left:0},u=this[0],p=u&&u.ownerDocument;if(p)return(r=p.body)===u?Y.offset.bodyOffset(u):(n=p.documentElement,Y.contains(n,u)?(u.getBoundingClientRect!==t&&(l=u.getBoundingClientRect()),i=P(p),o=n.clientTop||r.clientTop||0,a=n.clientLeft||r.clientLeft||0,s=i.pageYOffset||n.scrollTop,c=i.pageXOffset||n.scrollLeft,{top:l.top+s-o,left:l.left+c-a}):l)},Y.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return Y.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Y.css(e,"marginTop"))||0,n+=parseFloat(Y.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=Y.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=Y(e),s=a.offset(),c=Y.css(e,"top"),l=Y.css(e,"left"),u=("absolute"===r||"fixed"===r)&&Y.inArray("auto",[c,l])>-1,p={},f={};u?(f=a.position(),i=f.top,o=f.left):(i=parseFloat(c)||0,o=parseFloat(l)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+i),null!=t.left&&(p.left=t.left-s.left+o),"using"in t?t.using.call(e,p):a.css(p)}},Y.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||$.body;e&&!tr.test(e.nodeName)&&"static"===Y.css(e,"position");)e=e.offsetParent;return e||$.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(i){return Y.access(this,function(e,i,o){var a=P(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?Y(a).scrollLeft():o,r?o:Y(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){Y.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return Y.access(this,function(n,r,i){var o;return Y.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?Y.css(n,r,i,s):Y.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=Y,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})}(window),/*! ========================================================= * bootstrap-modal.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= @@ -38,36 +47,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * ========================================================= */ -;!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e(' @@ -138,13 +138,12 @@ - + - - - \ No newline at end of file + + \ No newline at end of file diff --git a/docs/src/template/header.html b/docs/src/template/header.html index 979751c0..b23dd185 100644 --- a/docs/src/template/header.html +++ b/docs/src/template/header.html @@ -30,8 +30,8 @@
  • Blog
  • -
  • VIEW ON GITHUBv {{sdk.version}}
  • -
  • View on GitHub (v {{sdk.version}})
  • +
  • VIEW ON GITHUBv {{version}}
  • +
  • View on GitHub (v {{version}})
  • diff --git a/docs/src/template/style.html b/docs/src/template/style.html index e862cd9b..46137ab8 100644 --- a/docs/src/template/style.html +++ b/docs/src/template/style.html @@ -3,7 +3,7 @@ - + diff --git a/package.json b/package.json index 40514cc0..21aacbb8 100644 --- a/package.json +++ b/package.json @@ -1,48 +1,49 @@ { - "name": "F2", - "description": "An open framework for the financial services industry.", - "version": "1.2.0", - "keywords": [ - "openf2" - ], - "homepage": "https://github.com/OpenF2/F2", - "author": "Markit On Demand, Inc", - "scripts": { - "preinstall": "npm install grunt-cli markitdown -g" - }, - "repository": { - "type": "git", - "url": "https://github.com/OpenF2/F2.git" - }, - "bugs": { - "url": "https://github.com/OpenF2/F2/issues", - "email": "OpenF2@googlegroups.com" - }, - "licenses": [ - { - "type": "Apache-2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0" - } - ], - "devDependencies": { - "express": "~3.2.4", - "grunt": "~0.4.1", - "grunt-contrib-clean": "~0.4.1", - "grunt-contrib-concat": "~0.3.0", - "grunt-contrib-copy": "~0.4.1", - "grunt-contrib-jasmine": "~0.4.2", - "grunt-contrib-jshint": "~0.4.3", - "grunt-contrib-less": "~0.5.1", - "grunt-contrib-uglify": "~0.2.0", - "grunt-express": "~0.3.3", - "handlebars": "1.0.10", - "moment": "~2.0.0", - "pandoc": "0.2.0", - "semver": "~1.1.4" - }, - "engines": { - "node": ">=0.10" - }, - "_releaseDate": "2013-05-20T20:49:11.608Z", - "_releaseDateFormatted": "20 May 2013" -} \ No newline at end of file + "name": "F2", + "description": "An open framework for the financial services industry.", + "version": "1.1.2", + "keywords": [ + "openf2" + ], + "homepage": "https://github.com/OpenF2/F2", + "author": "Markit On Demand, Inc", + "scripts": { + "preinstall": "npm install grunt-cli markitdown -g" + }, + "repository": { + "type": "git", + "url": "https://github.com/OpenF2/F2.git" + }, + "bugs": { + "url": "https://github.com/OpenF2/F2/issues", + "email": "OpenF2@googlegroups.com" + }, + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "devDependencies": { + "express": "~3.2.4", + "grunt": "~0.4.1", + "grunt-contrib-clean": "~0.4.1", + "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-copy": "~0.4.1", + "grunt-contrib-jasmine": "~0.4.2", + "grunt-contrib-jshint": "~0.4.3", + "grunt-contrib-less": "~0.5.1", + "grunt-contrib-uglify": "~0.2.0", + "grunt-express": "~0.3.3", + "handlebars": "1.0.10", + "moment": "~2.0.0", + "pandoc": "0.2.0", + "semver": "~1.1.4", + "yuidocjs": "~0.3.44" + }, + "engines": { + "node": ">=0.10" + }, + "_releaseDate": "2013-04-08T14:34:33.095Z", + "_releaseDateFormatted": "8 April 2013" +} From f91d57bfa8a4a5973b09edb7a55b8013659d001a Mon Sep 17 00:00:00 2001 From: markhealey Date: Mon, 20 May 2013 17:15:12 -0600 Subject: [PATCH 132/181] preloading apps w/ code --- docs/src/container-development.md | 144 +++++++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 4 deletions(-) diff --git a/docs/src/container-development.md b/docs/src/container-development.md index 6927d5c1..df38cee1 100644 --- a/docs/src/container-development.md +++ b/docs/src/container-development.md @@ -589,17 +589,153 @@ This javascript code will insert the example news app into the container's ` + -About this jsfiddle To simulate an ajax request, this example uses jsfiddle's [echo feature](http://doc.jsfiddle.net/use/echo.html). Simply replace the `getAppConfigs` function your own ajax request and ignore the `echoData` variable. +About this jsfiddle To simulate an ajax request, this example uses jsfiddle's [echo feature](http://doc.jsfiddle.net/use/echo.html). Simply replace the `getAppConfigs` function with your own ajax request and ignore the `echoData` variable. ### Registering Pre-Loaded Apps -Incorporating apps which have been pre-loaded or are otherwise already on the container when it loads is an alternative method to integrating F2 apps. This method is useful when the container is being constructed on the server-side (at run-time or on a schedule). To use pre-loaded apps, the Container Developer is required to make a request to each apps' `AppManifest` and its dependencies _before_ the page is rendered. +Incorporating apps which have been pre-loaded or are otherwise already on the container when it loads is an alternative method to integrating F2 apps. This method is useful when the container is being constructed on the server-side (at run-time or on a schedule) and F2 functionality is desired. To use pre-loaded apps, the Container Developer is required to make a request to each apps' `AppManifest` and its dependencies _before_ the page is rendered. -Let's assume you have a web page composed on the server and delivered to the browser in one payload. Let's also assume your page has at least one module or widget or component you'd like to register with F2.js. +For the following example, let's assume you have a web page composed on the server and all of its HTML is delivered to the browser in one payload. This page also has at least one widget (or component) you'd like to register with F2.js. +#### 1. Setup Container +To use pre-loaded apps, a web page with a placeholder element for the apps is required. This simple (and empty) web page features a `div#news_app.span12` which serves as that placeholder. + +```html + + + F2 Container + + + +
    +
    +
    + +
    +
    +
    + + + +``` + +#### 2. Request AppManifest + +Next, make a server-side request to the news apps' `AppManifest`—the URL is found in `manifestUrl`—and capture the resulting JSON. Each `AppManifest` contains scripts, style sheets and HTML ([more](app-development.html#app-manifest)). The market news apps' `AppManifest` looks like this: + +```javascript +{ + "apps":[{ + "data":{}, + "html": "
    ...
    ", + }], + "scripts":[ + "http://www.openf2.org/js/main.js" + ], + "styles":[ + "http://www.openf2.org/css/site.css" + ] +} +``` + +Note Parts of this `AppManifest` were intentionally removed for legibility. The full `AppManifest` is [available on OpenF2.org](http://www.openf2.org/Examples/Apps?params=%5B%7B%22appId%22%3A%22com_openf2_examples_csharp_marketnews%22%7D%5D). + +#### 3. Add App to Container + +You're almost there. Next, embed the news app's `html`, `scripts` and `styles`. The F2 app is inserted into `.row > .span12` following [Bootstrap's scaffolding](http://twitter.github.io/bootstrap/scaffolding.html) guidelines. The `styles` were appended to the `head` and the `scripts` were appended to the `body` (in this case just one URL for each). + +```html + + + F2 Container + + + + +
    +
    +
    +
    ...
    +
    +
    +
    + + + + +``` + +The example news app is now part of the web page and everything should be functioning properly. The final step is to register the app with F2. + +#### 4. Assign Root Element to AppConfig + +To use pre-loaded apps, an additional property is required on the `AppConfig` object. It is called `root` and can be either a CSS selector string _or_ a DOM element. + +```javascript +var _appConfig = { + appId: 'com_openf2_examples_csharp_marketnews', + description: 'Example News', + manifestUrl: 'http://www.openf2.org/Examples/Apps', + name: 'Example News', + root: document.getElementById('news_app') //Look, I'm new! +}; +``` + +All of these are valid values for the `root` property. + +```javascript +{ + root: document.querySelectorAll('.span12') +} +``` + +or: + +```javascript +{ + root: '.row > .span12' +} +``` + +Using jQuery? You could either provide a CSS selector which F2 will pass to jQuery or use `jQuery.get` to find the DOM element instead of the jQuery object. + +```javascript +{ + root: $('#news_app').get(0) +} +``` + +or: + +```javascript +{ + root: '#news_app' +} +``` + +#### 5. Register App + +Since you started with the `AppConfig` and now have the `AppManifest` from step 2 along with an HTML page containing the embedded app, all that remains is a simple call to F2. + +```javascript +var _appConfig = { + appId: 'com_openf2_examples_csharp_marketnews', + description: 'Example News', + manifestUrl: 'http://www.openf2.org/Examples/Apps', + name: 'Example News', + root: document.getElementById('news_app') +}; + +$(function(){ + F2.init(); + F2.registerApps(_appConfig); +}); +``` + +The web page and pre-loaded news app is a fully F2-enabled container. Rejoice! * * * * From 5122440684fc9fa3bfe67ea9e02ce8e42bfb207b Mon Sep 17 00:00:00 2001 From: markhealey Date: Wed, 22 May 2013 10:58:57 -0600 Subject: [PATCH 133/181] root --- docs/src/container-development.md | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/src/container-development.md b/docs/src/container-development.md index df38cee1..d706e250 100644 --- a/docs/src/container-development.md +++ b/docs/src/container-development.md @@ -694,22 +694,6 @@ All of these are valid values for the `root` property. or: -```javascript -{ - root: '.row > .span12' -} -``` - -Using jQuery? You could either provide a CSS selector which F2 will pass to jQuery or use `jQuery.get` to find the DOM element instead of the jQuery object. - -```javascript -{ - root: $('#news_app').get(0) -} -``` - -or: - ```javascript { root: '#news_app' From fd15c1a30ffc23285e932a664164166109e18009 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Wed, 22 May 2013 17:06:54 -0600 Subject: [PATCH 134/181] Consolidated .registerPreLoadedApps() into .registerApps(). Added tests to support the change, and updated code documentation to call out changes. --- f2.js | 10 +- sdk/f2.debug.js | 217 ++++++++++++------ sdk/f2.min.js | 10 +- sdk/f2.min.map | 2 +- sdk/f2.no-third-party.js | 217 ++++++++++++------ sdk/src/container.js | 217 ++++++++++++------ tests/spec/app-handlers-spec.js | 390 ++++++++++++++++++-------------- tests/spec/container-spec.js | 85 +++++-- 8 files changed, 737 insertions(+), 411 deletions(-) diff --git a/f2.js b/f2.js index a9b0c207..6c350ca3 100644 --- a/f2.js +++ b/f2.js @@ -21,15 +21,15 @@ * * Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time) */ -function(e,t){function n(e){var t=ht[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(mt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:gt.test(r)?Y.parseJSON(r):r}catch(o){}Y.data(e,n,r)}else r=t}return r}function i(e){var t;for(t in e)if(("data"!==t||!Y.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function o(){return!1}function a(){return!0}function s(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function l(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function c(e,t,n){if(t=t||0,Y.isFunction(t))return Y.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return Y.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=Y.grep(e,function(e){return 1===e.nodeType});if(It.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e){return Y.inArray(e,t)>=0===n})}function u(e){var t=Lt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function p(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function f(e,t){if(1===t.nodeType&&Y.hasData(e)){var n,r,i,o=Y._data(e),a=Y._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)Y.event.add(t,n,s[n][r])}a.data&&(a.data=Y.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),Y.support.html5Clone&&e.innerHTML&&!Y.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Vt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Y.expando))}function h(e){return e.getElementsByTagName!==t?e.getElementsByTagName("*"):e.querySelectorAll!==t?e.querySelectorAll("*"):[]}function g(e){Vt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=vn.length;i--;)if(t=vn[i]+n,t in e)return t;return r}function y(e,t){return e=t||e,"none"===Y.css(e,"display")||!Y.contains(e.ownerDocument,e)}function v(e,t){for(var n,r,i=[],o=0,a=e.length;a>o;o++)n=e[o],n.style&&(i[o]=Y._data(n,"olddisplay"),t?(i[o]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&y(n)&&(i[o]=Y._data(n,"olddisplay",C(n.nodeName)))):(r=nn(n,"display"),i[o]||"none"===r||Y._data(n,"olddisplay",r)));for(o=0;a>o;o++)n=e[o],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?i[o]||"":"none"));return e}function b(e,t,n){var r=pn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function x(e,t,n,r){for(var i=n===(r?"border":"content")?4:"width"===t?1:0,o=0;4>i;i+=2)"margin"===n&&(o+=Y.css(e,n+yn[i],!0)),r?("content"===n&&(o-=parseFloat(nn(e,"padding"+yn[i]))||0),"margin"!==n&&(o-=parseFloat(nn(e,"border"+yn[i]+"Width"))||0)):(o+=parseFloat(nn(e,"padding"+yn[i]))||0,"padding"!==n&&(o+=parseFloat(nn(e,"border"+yn[i]+"Width"))||0));return o}function w(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,i=!0,o=Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing");if(0>=r||null==r){if(r=nn(e,t),(0>r||null==r)&&(r=e.style[t]),fn.test(r))return r;i=o&&(Y.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+x(e,t,n||(o?"border":"content"),i)+"px"}function C(e){if(hn[e])return hn[e];var t=Y("<"+e+">").appendTo($.body),n=t.css("display");return t.remove(),("none"===n||""===n)&&(rn=$.body.appendChild(rn||Y.extend($.createElement("iframe"),{frameBorder:0,width:0,height:0})),on&&rn.createElement||(on=(rn.contentWindow||rn.contentDocument).document,on.write(""),on.close()),t=on.body.appendChild(on.createElement(e)),n=nn(t,"display"),$.body.removeChild(rn)),hn[e]=n,n}function _(e,t,n,r){var i;if(Y.isArray(t))Y.each(t,function(t,i){n||wn.test(e)?r(e,i):_(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==Y.type(t))r(e,t);else for(i in t)_(e+"["+i+"]",t[i],n,r)}function k(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i,o,a=t.toLowerCase().split(tt),s=0,l=a.length;if(Y.isFunction(n))for(;l>s;s++)r=a[s],o=/^\+/.test(r),o&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[o?"unshift":"push"](n)}}function A(e,n,r,i,o,a){o=o||n.dataTypes[0],a=a||{},a[o]=!0;for(var s,l=e[o],c=0,u=l?l.length:0,p=e===Pn;u>c&&(p||!s);c++)s=l[c](n,r,i),"string"==typeof s&&(!p||a[s]?s=t:(n.dataTypes.unshift(s),s=A(e,n,r,i,s,a)));return!p&&s||a["*"]||(s=A(e,n,r,i,"*",a)),s}function T(e,n){var r,i,o=Y.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);i&&Y.extend(!0,e,i)}function E(e,n,r){var i,o,a,s,l=e.contents,c=e.dataTypes,u=e.responseFields;for(o in u)o in r&&(n[u[o]]=r[o]);for(;"*"===c[0];)c.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(o in l)if(l[o]&&l[o].test(i)){c.unshift(o);break}if(c[0]in r)a=c[0];else{for(o in r){if(!c[0]||e.converters[o+" "+c[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==c[0]&&c.unshift(a),r[a]):t}function F(e,t){var n,r,i,o,a=e.dataTypes.slice(),s=a[0],l={},c=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a[1])for(n in e.converters)l[n.toLowerCase()]=e.converters[n];for(;i=a[++c];)if("*"!==i){if("*"!==s&&s!==i){if(n=l[s+" "+i]||l["* "+i],!n)for(r in l)if(o=r.split(" "),o[1]===i&&(n=l[s+" "+o[0]]||l["* "+o[0]])){n===!0?n=l[r]:l[r]!==!0&&(i=o[0],a.splice(c--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(u){return{state:"parsererror",error:n?u:"No conversion from "+s+" to "+i}}}s=i}return{state:"success",data:t}}function N(){try{return new e.XMLHttpRequest}catch(t){}}function S(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function j(){return setTimeout(function(){Jn=t},0),Jn=Y.now()}function R(e,t){Y.each(t,function(t,n){for(var r=(er[t]||[]).concat(er["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function O(e,t,n){var r,i=0,o=Zn.length,a=Y.Deferred().always(function(){delete s.elem}),s=function(){for(var t=Jn||j(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,i=1-r,o=0,s=l.tweens.length;s>o;o++)l.tweens[o].run(i);return a.notifyWith(e,[l,i,n]),1>i&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:Y.extend({},t),opts:Y.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Jn||j(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Y.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){for(var n=0,r=t?l.tweens.length:0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(M(c,l.opts.specialEasing);o>i;i++)if(r=Zn[i].call(l,e,c,l.opts))return r;return R(l,c),Y.isFunction(l.opts.start)&&l.opts.start.call(e,l),Y.fx.timer(Y.extend(s,{anim:l,queue:l.opts.queue,elem:e})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function M(e,t){var n,r,i,o,a;for(n in e)if(r=Y.camelCase(n),i=t[r],o=e[n],Y.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=Y.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function H(e,t,n){var r,i,o,a,s,l,c,u,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&y(e);n.queue||(u=Y._queueHooks(e,"fx"),null==u.unqueued&&(u.unqueued=0,p=u.empty.fire,u.empty.fire=function(){u.unqueued||p()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,Y.queue(e,"fx").length||u.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===Y.css(e,"display")&&"none"===Y.css(e,"float")&&(Y.support.inlineBlockNeedsLayout&&"inline"!==C(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",Y.support.shrinkWrapBlocks||f.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Kn.exec(o)){if(delete t[r],l=l||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=Y._data(e,"fxshow")||Y._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),l&&(s.hidden=!m),m?Y(e).show():f.done(function(){Y(e).hide()}),f.done(function(){var t;Y.removeData(e,"fxshow",!0);for(t in h)Y.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],c=f.createTween(i,m?s[i]:0),h[i]=s[i]||Y.style(e,i),i in s||(s[i]=c.start,m&&(c.end=c.start,c.start="width"===i||"height"===i?1:0))}}function I(e,t,n,r,i){return new I.prototype.init(e,t,n,r,i)}function P(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=yn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function D(e){return Y.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var L,B,$=e.document,q=e.location,W=e.navigator,U=e.jQuery,Q=e.$,z=Array.prototype.push,X=Array.prototype.slice,J=Array.prototype.indexOf,V=Object.prototype.toString,K=Object.prototype.hasOwnProperty,G=String.prototype.trim,Y=function(e,t){return new Y.fn.init(e,t,L)},Z=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,et=/\S/,tt=/\s+/,nt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,it=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ot=/^[\],:{}\s]*$/,at=/(?:^|:|,)(?:\s*\[)+/g,st=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,lt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ct=/^-ms-/,ut=/-([\da-z])/gi,pt=function(e,t){return(t+"").toUpperCase()},ft=function(){$.addEventListener?($.removeEventListener("DOMContentLoaded",ft,!1),Y.ready()):"complete"===$.readyState&&($.detachEvent("onreadystatechange",ft),Y.ready())},dt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var i,o,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:rt.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1])return n=n instanceof Y?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:$,e=Y.parseHTML(i[1],a,!0),it.test(i[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);if(o=$.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=$,this.selector=e,this}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return X.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,"find"===t?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(X.apply(this,arguments),"slice",X.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:z,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),"object"==typeof s||Y.isFunction(s)||(s={}),c===l&&(s=this,--l);c>l;l++)if(null!=(e=arguments[l]))for(n in e)r=s[n],i=e[n],s!==i&&(u&&i&&(Y.isPlainObject(i)||(o=Y.isArray(i)))?(o?(o=!1,a=r&&Y.isArray(r)?r:[]):a=r&&Y.isPlainObject(r)?r:{},s[n]=Y.extend(u,a,i)):i!==t&&(s[n]=i));return s},Y.extend({noConflict:function(t){return e.$===Y&&(e.$=Q),t&&e.jQuery===Y&&(e.jQuery=U),Y},isReady:!1,readyWait:1,holdReady:function(e){e?Y.readyWait++:Y.ready(!0)},ready:function(e){if(e===!0?!--Y.readyWait:!Y.isReady){if(!$.body)return setTimeout(Y.ready,1);Y.isReady=!0,e!==!0&&--Y.readyWait>0||(B.resolveWith($,[Y]),Y.fn.trigger&&Y($).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Y.type(e)},isArray:Array.isArray||function(e){return"array"===Y.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":dt[V.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Y.type(e)||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!K.call(e,"constructor")&&!K.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||K.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){var r;return e&&"string"==typeof e?("boolean"==typeof t&&(n=t,t=0),t=t||$,(r=it.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(n){return n&&"string"==typeof n?(n=Y.trim(n),e.JSON&&e.JSON.parse?e.JSON.parse(n):ot.test(n.replace(st,"@").replace(lt,"]").replace(at,""))?Function("return "+n)():(Y.error("Invalid JSON: "+n),t)):null},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ct,"ms-").replace(ut,pt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,o=0,a=e.length,s=a===t||Y.isFunction(e);if(r)if(s){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;a>o&&n.apply(e[o++],r)!==!1;);else if(s){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;a>o&&n.call(e[o],o,e[o++])!==!1;);return e},trim:G&&!G.call(" ")?function(e){return null==e?"":G.call(e)}:function(e){return null==e?"":(e+"").replace(nt,"")},makeArray:function(e,t){var n,r=t||[];return null!=e&&(n=Y.type(e),null==e.length||"string"===n||"function"===n||"regexp"===n||Y.isWindow(e)?z.call(r,e):Y.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(J)return J.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,n,r){var i,o,a=[],s=0,l=e.length,c=e instanceof Y||l!==t&&"number"==typeof l&&(l>0&&e[0]&&e[l-1]||0===l||Y.isArray(e));if(c)for(;l>s;s++)i=n(e[s],s,r),null!=i&&(a[a.length]=i);else for(o in e)i=n(e[o],o,r),null!=i&&(a[a.length]=i);return a.concat.apply([],a)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),Y.isFunction(e)?(i=X.call(arguments,2),o=function(){return e.apply(n,i.concat(X.call(arguments)))},o.guid=e.guid=e.guid||Y.guid++,o):t},access:function(e,n,r,i,o,a,s){var l,c=null==r,u=0,p=e.length;if(r&&"object"==typeof r){for(u in r)Y.access(e,n,u,r[u],1,a,i);o=1}else if(i!==t){if(l=s===t&&Y.isFunction(i),c&&(l?(l=n,n=function(e,t,n){return l.call(Y(e),n)}):(n.call(e,i),n=null)),n)for(;p>u;u++)n(e[u],r,l?i.call(e[u],u,n(e[u],r)):i,s);o=1}return o?e:c?n.call(e):p?n(e[0],r):a},now:function(){return(new Date).getTime()}}),Y.ready.promise=function(t){if(!B)if(B=Y.Deferred(),"complete"===$.readyState)setTimeout(Y.ready,1);else if($.addEventListener)$.addEventListener("DOMContentLoaded",ft,!1),e.addEventListener("load",Y.ready,!1);else{$.attachEvent("onreadystatechange",ft),e.attachEvent("onload",Y.ready);var n=!1;try{n=null==e.frameElement&&$.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!Y.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}Y.ready()}}()}return B.promise(t)},Y.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){dt["[object "+t+"]"]=t.toLowerCase()}),L=Y($);var ht={};Y.Callbacks=function(e){e="string"==typeof e?ht[e]||n(e):Y.extend({},e);var r,i,o,a,s,l,c=[],u=!e.once&&[],p=function(t){for(r=e.memory&&t,i=!0,l=a||0,a=0,s=c.length,o=!0;c&&s>l;l++)if(c[l].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}o=!1,c&&(u?u.length&&p(u.shift()):r?c=[]:f.disable())},f={add:function(){if(c){var t=c.length;(function n(t){Y.each(t,function(t,r){var i=Y.type(r);"function"===i?e.unique&&f.has(r)||c.push(r):r&&r.length&&"string"!==i&&n(r)})})(arguments),o?s=c.length:r&&(a=t,p(r))}return this},remove:function(){return c&&Y.each(arguments,function(e,t){for(var n;(n=Y.inArray(t,c,n))>-1;)c.splice(n,1),o&&(s>=n&&s--,l>=n&&l--)}),this},has:function(e){return Y.inArray(e,c)>-1},empty:function(){return c=[],this},disable:function(){return c=u=r=t,this},disabled:function(){return!c},lock:function(){return u=t,r||f.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!c||i&&!u||(o?u.push(t):p(t)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var o=r[0],a=e[t];i[r[1]](Y.isFunction(a)?function(){var e=a.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===i?n:this,[e])}:n[o])}),e=null}).promise()},promise:function(e){return null!=e?Y.extend(e,r):r}},i={};return r.pipe=r.then,Y.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=a.fire,i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=X.call(arguments),a=o.length,s=1!==a||e&&Y.isFunction(e.promise)?a:0,l=1===s?e:Y.Deferred(),c=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?X.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&Y.isFunction(o[i].promise)?o[i].promise().done(c(i,r,o)).fail(l.reject).progress(c(i,n,t)):--s;return s||l.resolveWith(r,o),l.promise()}}),Y.support=function(){var n,r,i,o,a,s,l,c,u,p,f,d=$.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",r=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=$.createElement("select"),a=o.appendChild($.createElement("option")),s=d.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===s.value,optSelected:a.selected,getSetAttribute:"t"!==d.className,enctype:!!$.createElement("form").enctype,html5Clone:"<:nav>"!==$.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===$.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete d.test}catch(h){n.deleteExpando=!1}if(!d.addEventListener&&d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",f=function(){n.noCloneEvent=!1}),d.cloneNode(!0).fireEvent("onclick"),d.detachEvent("onclick",f)),s=$.createElement("input"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),d.appendChild(s),l=$.createDocumentFragment(),l.appendChild(d.lastChild),n.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,n.appendChecked=s.checked,l.removeChild(s),l.appendChild(d),d.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})c="on"+u,p=c in d,p||(d.setAttribute(c,"return;"),p="function"==typeof d[c]),n[u+"Bubbles"]=p;return Y(function(){var r,i,o,a,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",l=$.getElementsByTagName("body")[0];l&&(r=$.createElement("div"),r.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(r,l.firstChild),i=$.createElement("div"),r.appendChild(i),i.innerHTML="
    t
    ",o=i.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=p&&0===o[0].offsetHeight,i.innerHTML="",i.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===i.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,a=$.createElement("div"),a.style.cssText=i.style.cssText=s,a.style.marginRight=a.style.width="0",i.style.width="1px",i.appendChild(a),n.reliableMarginRight=!parseFloat((e.getComputedStyle(a,null)||{}).marginRight)),i.style.zoom!==t&&(i.innerHTML="",i.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===i.offsetWidth,i.style.display="block",i.style.overflow="visible",i.innerHTML="
    ",i.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==i.offsetWidth,r.style.zoom=1),l.removeChild(r),r=i=o=a=null)}),l.removeChild(d),r=i=o=a=s=l=d=null,n}();var gt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!i(e)},data:function(e,n,r,i){if(Y.acceptData(e)){var o,a,s=Y.expando,l="string"==typeof n,c=e.nodeType,u=c?Y.cache:e,p=c?e[s]:e[s]&&s;if(p&&u[p]&&(i||u[p].data)||!l||r!==t)return p||(c?e[s]=p=Y.deletedIds.pop()||Y.guid++:p=s),u[p]||(u[p]={},c||(u[p].toJSON=Y.noop)),("object"==typeof n||"function"==typeof n)&&(i?u[p]=Y.extend(u[p],n):u[p].data=Y.extend(u[p].data,n)),o=u[p],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[Y.camelCase(n)]=r),l?(a=o[n],null==a&&(a=o[Y.camelCase(n)])):a=o,a}},removeData:function(e,t,n){if(Y.acceptData(e)){var r,o,a,s=e.nodeType,l=s?Y.cache:e,c=s?e[Y.expando]:Y.expando;if(l[c]){if(t&&(r=n?l[c]:l[c].data)){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t=t in r?[t]:t.split(" ")));for(o=0,a=t.length;a>o;o++)delete r[t[o]];if(!(n?i:Y.isEmptyObject)(r))return}(n||(delete l[c].data,i(l[c])))&&(s?Y.cleanData([e],!0):Y.support.deleteExpando||l!=l.window?delete l[c]:l[c]=null)}}},_data:function(e,t,n){return Y.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&Y.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Y.fn.extend({data:function(e,n){var i,o,a,s,l,c=this[0],u=0,p=null;if(e===t){if(this.length&&(p=Y.data(c),1===c.nodeType&&!Y._data(c,"parsedAttrs"))){for(a=c.attributes,l=a.length;l>u;u++)s=a[u].name,s.indexOf("data-")||(s=Y.camelCase(s.substring(5)),r(c,s,p[s]));Y._data(c,"parsedAttrs",!0)}return p}return"object"==typeof e?this.each(function(){Y.data(this,e)}):(i=e.split(".",2),i[1]=i[1]?"."+i[1]:"",o=i[1]+"!",Y.access(this,function(n){return n===t?(p=this.triggerHandler("getData"+o,[i[0]]),p===t&&c&&(p=Y.data(c,e),p=r(c,e,p)),p===t&&i[1]?this.data(i[0]):p):(i[1]=n,this.each(function(){var t=Y(this);t.triggerHandler("setData"+o,i),Y.data(this,e,n),t.triggerHandler("changeData"+o,i)}),t)},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=Y._data(e,n),r&&(!i||Y.isArray(r)?i=Y._data(e,n,Y.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.length,i=n.shift(),o=Y._queueHooks(e,t),a=function(){Y.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?Y.queue(this[0],e):n===t?this:this.each(function(){var t=Y.queue(this,e,n);Y._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Y.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Y.dequeue(this,e)})},delay:function(e,t){return e=Y.fx?Y.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=Y.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=Y._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var yt,vt,bt,xt=/[\t\r\n]/g,wt=/\r/g,Ct=/^(?:button|input)$/i,_t=/^(?:button|input|object|select|textarea)$/i,kt=/^a(?:rea|)$/i,At=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Tt=Y.support.getSetAttribute;Y.fn.extend({attr:function(e,t){return Y.access(this,Y.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a,s;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(tt),n=0,r=this.length;r>n;n++)if(i=this[n],1===i.nodeType)if(i.className||1!==t.length){for(o=" "+i.className+" ",a=0,s=t.length;s>a;a++)0>o.indexOf(" "+t[a]+" ")&&(o+=t[a]+" ");i.className=Y.trim(o)}else i.className=e;return this},removeClass:function(e){var n,r,i,o,a,s,l;if(Y.isFunction(e))return this.each(function(t){Y(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(n=(e||"").split(tt),s=0,l=this.length;l>s;s++)if(i=this[s],1===i.nodeType&&i.className){for(r=(" "+i.className+" ").replace(xt," "),o=0,a=n.length;a>o;o++)for(;r.indexOf(" "+n[o]+" ")>=0;)r=r.replace(" "+n[o]+" "," ");i.className=e?Y.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=Y(this),s=t,l=e.split(tt);i=l[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(xt," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=Y.isFunction(e),this.each(function(r){var o,a=Y(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":Y.isArray(o)&&(o=Y.map(o,function(e){return null==e?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=Y.valHooks[o.type]||Y.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(wt,""):null==r?"":r)}}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(Y.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Y.nodeName(n.parentNode,"optgroup"))){if(t=Y(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=Y.makeArray(t);return Y(e).find("option").each(function(){this.selected=Y.inArray(Y(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var o,a,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return i&&Y.isFunction(Y.fn[n])?Y(e)[n](r):e.getAttribute===t?Y.prop(e,n,r):(s=1!==l||!Y.isXMLDoc(e),s&&(n=n.toLowerCase(),a=Y.attrHooks[n]||(At.test(n)?vt:yt)),r!==t?null===r?(Y.removeAttr(e,n),t):a&&"set"in a&&s&&(o=a.set(e,r,n))!==t?o:(e.setAttribute(n,r+""),r):a&&"get"in a&&s&&null!==(o=a.get(e,n))?o:(o=e.getAttribute(n),null===o?t:o))},removeAttr:function(e,t){var n,r,i,o,a=0;if(t&&1===e.nodeType)for(r=t.split(tt);r.length>a;a++)i=r[a],i&&(n=Y.propFix[i]||i,o=At.test(i),o||Y.attr(e,i,""),e.removeAttribute(Tt?i:n),o&&n in e&&(e[n]=!1))},attrHooks:{type:{set:function(e,t){if(Ct.test(e.nodeName)&&e.parentNode)Y.error("type property can't be changed");else if(!Y.support.radioValue&&"radio"===t&&Y.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return yt&&Y.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,n,r){return yt&&Y.nodeName(e,"button")?yt.set(e,n,r):(e.value=n,t)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!Y.isXMLDoc(e),a&&(n=Y.propFix[n]||n,o=Y.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):_t.test(e.nodeName)||kt.test(e.nodeName)&&e.href?0:t}}}}),vt={get:function(e,n){var r,i=Y.prop(e,n);return i===!0||"boolean"!=typeof i&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?Y.removeAttr(e,n):(r=Y.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},Tt||(bt={name:!0,id:!0,coords:!0},yt=Y.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(bt[n]?""!==r.value:r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=$.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},Y.each(["width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})}),Y.attrHooks.contenteditable={get:yt.get,set:function(e,t,n){""===t&&(t="false"),yt.set(e,t,n) +function(e,t){function n(e){var t=ht[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(mt,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:gt.test(r)?Y.parseJSON(r):r}catch(o){}Y.data(e,n,r)}else r=t}return r}function i(e){var t;for(t in e)if(("data"!==t||!Y.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function o(){return!1}function a(){return!0}function s(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function l(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function c(e,t,n){if(t=t||0,Y.isFunction(t))return Y.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return Y.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=Y.grep(e,function(e){return 1===e.nodeType});if(Pt.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e){return Y.inArray(e,t)>=0===n})}function u(e){var t=Lt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function p(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function f(e,t){if(1===t.nodeType&&Y.hasData(e)){var n,r,i,o=Y._data(e),a=Y._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)Y.event.add(t,n,s[n][r])}a.data&&(a.data=Y.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),Y.support.html5Clone&&e.innerHTML&&!Y.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Vt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Y.expando))}function h(e){return e.getElementsByTagName!==t?e.getElementsByTagName("*"):e.querySelectorAll!==t?e.querySelectorAll("*"):[]}function g(e){Vt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=vn.length;i--;)if(t=vn[i]+n,t in e)return t;return r}function y(e,t){return e=t||e,"none"===Y.css(e,"display")||!Y.contains(e.ownerDocument,e)}function v(e,t){for(var n,r,i=[],o=0,a=e.length;a>o;o++)n=e[o],n.style&&(i[o]=Y._data(n,"olddisplay"),t?(i[o]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&y(n)&&(i[o]=Y._data(n,"olddisplay",C(n.nodeName)))):(r=nn(n,"display"),i[o]||"none"===r||Y._data(n,"olddisplay",r)));for(o=0;a>o;o++)n=e[o],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?i[o]||"":"none"));return e}function b(e,t,n){var r=pn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function x(e,t,n,r){for(var i=n===(r?"border":"content")?4:"width"===t?1:0,o=0;4>i;i+=2)"margin"===n&&(o+=Y.css(e,n+yn[i],!0)),r?("content"===n&&(o-=parseFloat(nn(e,"padding"+yn[i]))||0),"margin"!==n&&(o-=parseFloat(nn(e,"border"+yn[i]+"Width"))||0)):(o+=parseFloat(nn(e,"padding"+yn[i]))||0,"padding"!==n&&(o+=parseFloat(nn(e,"border"+yn[i]+"Width"))||0));return o}function w(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,i=!0,o=Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing");if(0>=r||null==r){if(r=nn(e,t),(0>r||null==r)&&(r=e.style[t]),fn.test(r))return r;i=o&&(Y.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+x(e,t,n||(o?"border":"content"),i)+"px"}function C(e){if(hn[e])return hn[e];var t=Y("<"+e+">").appendTo($.body),n=t.css("display");return t.remove(),("none"===n||""===n)&&(rn=$.body.appendChild(rn||Y.extend($.createElement("iframe"),{frameBorder:0,width:0,height:0})),on&&rn.createElement||(on=(rn.contentWindow||rn.contentDocument).document,on.write(""),on.close()),t=on.body.appendChild(on.createElement(e)),n=nn(t,"display"),$.body.removeChild(rn)),hn[e]=n,n}function _(e,t,n,r){var i;if(Y.isArray(t))Y.each(t,function(t,i){n||wn.test(e)?r(e,i):_(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==Y.type(t))r(e,t);else for(i in t)_(e+"["+i+"]",t[i],n,r)}function k(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i,o,a=t.toLowerCase().split(tt),s=0,l=a.length;if(Y.isFunction(n))for(;l>s;s++)r=a[s],o=/^\+/.test(r),o&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[o?"unshift":"push"](n)}}function A(e,n,r,i,o,a){o=o||n.dataTypes[0],a=a||{},a[o]=!0;for(var s,l=e[o],c=0,u=l?l.length:0,p=e===In;u>c&&(p||!s);c++)s=l[c](n,r,i),"string"==typeof s&&(!p||a[s]?s=t:(n.dataTypes.unshift(s),s=A(e,n,r,i,s,a)));return!p&&s||a["*"]||(s=A(e,n,r,i,"*",a)),s}function T(e,n){var r,i,o=Y.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((o[r]?e:i||(i={}))[r]=n[r]);i&&Y.extend(!0,e,i)}function E(e,n,r){var i,o,a,s,l=e.contents,c=e.dataTypes,u=e.responseFields;for(o in u)o in r&&(n[u[o]]=r[o]);for(;"*"===c[0];)c.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(o in l)if(l[o]&&l[o].test(i)){c.unshift(o);break}if(c[0]in r)a=c[0];else{for(o in r){if(!c[0]||e.converters[o+" "+c[0]]){a=o;break}s||(s=o)}a=a||s}return a?(a!==c[0]&&c.unshift(a),r[a]):t}function F(e,t){var n,r,i,o,a=e.dataTypes.slice(),s=a[0],l={},c=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a[1])for(n in e.converters)l[n.toLowerCase()]=e.converters[n];for(;i=a[++c];)if("*"!==i){if("*"!==s&&s!==i){if(n=l[s+" "+i]||l["* "+i],!n)for(r in l)if(o=r.split(" "),o[1]===i&&(n=l[s+" "+o[0]]||l["* "+o[0]])){n===!0?n=l[r]:l[r]!==!0&&(i=o[0],a.splice(c--,0,i));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(u){return{state:"parsererror",error:n?u:"No conversion from "+s+" to "+i}}}s=i}return{state:"success",data:t}}function N(){try{return new e.XMLHttpRequest}catch(t){}}function S(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function j(){return setTimeout(function(){Jn=t},0),Jn=Y.now()}function R(e,t){Y.each(t,function(t,n){for(var r=(er[t]||[]).concat(er["*"]),i=0,o=r.length;o>i;i++)if(r[i].call(e,t,n))return})}function O(e,t,n){var r,i=0,o=Zn.length,a=Y.Deferred().always(function(){delete s.elem}),s=function(){for(var t=Jn||j(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,i=1-r,o=0,s=l.tweens.length;s>o;o++)l.tweens[o].run(i);return a.notifyWith(e,[l,i,n]),1>i&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:Y.extend({},t),opts:Y.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Jn||j(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Y.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){for(var n=0,r=t?l.tweens.length:0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(M(c,l.opts.specialEasing);o>i;i++)if(r=Zn[i].call(l,e,c,l.opts))return r;return R(l,c),Y.isFunction(l.opts.start)&&l.opts.start.call(e,l),Y.fx.timer(Y.extend(s,{anim:l,queue:l.opts.queue,elem:e})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function M(e,t){var n,r,i,o,a;for(n in e)if(r=Y.camelCase(n),i=t[r],o=e[n],Y.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=Y.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function H(e,t,n){var r,i,o,a,s,l,c,u,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&y(e);n.queue||(u=Y._queueHooks(e,"fx"),null==u.unqueued&&(u.unqueued=0,p=u.empty.fire,u.empty.fire=function(){u.unqueued||p()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,Y.queue(e,"fx").length||u.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===Y.css(e,"display")&&"none"===Y.css(e,"float")&&(Y.support.inlineBlockNeedsLayout&&"inline"!==C(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",Y.support.shrinkWrapBlocks||f.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(o=t[r],Kn.exec(o)){if(delete t[r],l=l||"toggle"===o,o===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=Y._data(e,"fxshow")||Y._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),l&&(s.hidden=!m),m?Y(e).show():f.done(function(){Y(e).hide()}),f.done(function(){var t;Y.removeData(e,"fxshow",!0);for(t in h)Y.style(e,t,h[t])});for(r=0;a>r;r++)i=g[r],c=f.createTween(i,m?s[i]:0),h[i]=s[i]||Y.style(e,i),i in s||(s[i]=c.start,m&&(c.end=c.start,c.start="width"===i||"height"===i?1:0))}}function P(e,t,n,r,i){return new P.prototype.init(e,t,n,r,i)}function I(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=yn[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function D(e){return Y.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var L,B,$=e.document,q=e.location,W=e.navigator,U=e.jQuery,Q=e.$,z=Array.prototype.push,X=Array.prototype.slice,J=Array.prototype.indexOf,V=Object.prototype.toString,K=Object.prototype.hasOwnProperty,G=String.prototype.trim,Y=function(e,t){return new Y.fn.init(e,t,L)},Z=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,et=/\S/,tt=/\s+/,nt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,it=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ot=/^[\],:{}\s]*$/,at=/(?:^|:|,)(?:\s*\[)+/g,st=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,lt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ct=/^-ms-/,ut=/-([\da-z])/gi,pt=function(e,t){return(t+"").toUpperCase()},ft=function(){$.addEventListener?($.removeEventListener("DOMContentLoaded",ft,!1),Y.ready()):"complete"===$.readyState&&($.detachEvent("onreadystatechange",ft),Y.ready())},dt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var i,o,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:rt.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1])return n=n instanceof Y?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:$,e=Y.parseHTML(i[1],a,!0),it.test(i[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);if(o=$.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=$,this.selector=e,this}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return X.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,"find"===t?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(X.apply(this,arguments),"slice",X.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:z,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),"object"==typeof s||Y.isFunction(s)||(s={}),c===l&&(s=this,--l);c>l;l++)if(null!=(e=arguments[l]))for(n in e)r=s[n],i=e[n],s!==i&&(u&&i&&(Y.isPlainObject(i)||(o=Y.isArray(i)))?(o?(o=!1,a=r&&Y.isArray(r)?r:[]):a=r&&Y.isPlainObject(r)?r:{},s[n]=Y.extend(u,a,i)):i!==t&&(s[n]=i));return s},Y.extend({noConflict:function(t){return e.$===Y&&(e.$=Q),t&&e.jQuery===Y&&(e.jQuery=U),Y},isReady:!1,readyWait:1,holdReady:function(e){e?Y.readyWait++:Y.ready(!0)},ready:function(e){if(e===!0?!--Y.readyWait:!Y.isReady){if(!$.body)return setTimeout(Y.ready,1);Y.isReady=!0,e!==!0&&--Y.readyWait>0||(B.resolveWith($,[Y]),Y.fn.trigger&&Y($).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Y.type(e)},isArray:Array.isArray||function(e){return"array"===Y.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":dt[V.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Y.type(e)||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!K.call(e,"constructor")&&!K.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||K.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){var r;return e&&"string"==typeof e?("boolean"==typeof t&&(n=t,t=0),t=t||$,(r=it.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(n){return n&&"string"==typeof n?(n=Y.trim(n),e.JSON&&e.JSON.parse?e.JSON.parse(n):ot.test(n.replace(st,"@").replace(lt,"]").replace(at,""))?Function("return "+n)():(Y.error("Invalid JSON: "+n),t)):null},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ct,"ms-").replace(ut,pt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,o=0,a=e.length,s=a===t||Y.isFunction(e);if(r)if(s){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;a>o&&n.apply(e[o++],r)!==!1;);else if(s){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;a>o&&n.call(e[o],o,e[o++])!==!1;);return e},trim:G&&!G.call(" ")?function(e){return null==e?"":G.call(e)}:function(e){return null==e?"":(e+"").replace(nt,"")},makeArray:function(e,t){var n,r=t||[];return null!=e&&(n=Y.type(e),null==e.length||"string"===n||"function"===n||"regexp"===n||Y.isWindow(e)?z.call(r,e):Y.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(J)return J.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else for(;n[o]!==t;)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,n,r){var i,o,a=[],s=0,l=e.length,c=e instanceof Y||l!==t&&"number"==typeof l&&(l>0&&e[0]&&e[l-1]||0===l||Y.isArray(e));if(c)for(;l>s;s++)i=n(e[s],s,r),null!=i&&(a[a.length]=i);else for(o in e)i=n(e[o],o,r),null!=i&&(a[a.length]=i);return a.concat.apply([],a)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(r=e[n],n=e,e=r),Y.isFunction(e)?(i=X.call(arguments,2),o=function(){return e.apply(n,i.concat(X.call(arguments)))},o.guid=e.guid=e.guid||Y.guid++,o):t},access:function(e,n,r,i,o,a,s){var l,c=null==r,u=0,p=e.length;if(r&&"object"==typeof r){for(u in r)Y.access(e,n,u,r[u],1,a,i);o=1}else if(i!==t){if(l=s===t&&Y.isFunction(i),c&&(l?(l=n,n=function(e,t,n){return l.call(Y(e),n)}):(n.call(e,i),n=null)),n)for(;p>u;u++)n(e[u],r,l?i.call(e[u],u,n(e[u],r)):i,s);o=1}return o?e:c?n.call(e):p?n(e[0],r):a},now:function(){return(new Date).getTime()}}),Y.ready.promise=function(t){if(!B)if(B=Y.Deferred(),"complete"===$.readyState)setTimeout(Y.ready,1);else if($.addEventListener)$.addEventListener("DOMContentLoaded",ft,!1),e.addEventListener("load",Y.ready,!1);else{$.attachEvent("onreadystatechange",ft),e.attachEvent("onload",Y.ready);var n=!1;try{n=null==e.frameElement&&$.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!Y.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}Y.ready()}}()}return B.promise(t)},Y.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){dt["[object "+t+"]"]=t.toLowerCase()}),L=Y($);var ht={};Y.Callbacks=function(e){e="string"==typeof e?ht[e]||n(e):Y.extend({},e);var r,i,o,a,s,l,c=[],u=!e.once&&[],p=function(t){for(r=e.memory&&t,i=!0,l=a||0,a=0,s=c.length,o=!0;c&&s>l;l++)if(c[l].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}o=!1,c&&(u?u.length&&p(u.shift()):r?c=[]:f.disable())},f={add:function(){if(c){var t=c.length;(function n(t){Y.each(t,function(t,r){var i=Y.type(r);"function"===i?e.unique&&f.has(r)||c.push(r):r&&r.length&&"string"!==i&&n(r)})})(arguments),o?s=c.length:r&&(a=t,p(r))}return this},remove:function(){return c&&Y.each(arguments,function(e,t){for(var n;(n=Y.inArray(t,c,n))>-1;)c.splice(n,1),o&&(s>=n&&s--,l>=n&&l--)}),this},has:function(e){return Y.inArray(e,c)>-1},empty:function(){return c=[],this},disable:function(){return c=u=r=t,this},disabled:function(){return!c},lock:function(){return u=t,r||f.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!c||i&&!u||(o?u.push(t):p(t)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!i}};return f},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var o=r[0],a=e[t];i[r[1]](Y.isFunction(a)?function(){var e=a.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o+"With"](this===i?n:this,[e])}:n[o])}),e=null}).promise()},promise:function(e){return null!=e?Y.extend(e,r):r}},i={};return r.pipe=r.then,Y.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=a.fire,i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=X.call(arguments),a=o.length,s=1!==a||e&&Y.isFunction(e.promise)?a:0,l=1===s?e:Y.Deferred(),c=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?X.call(arguments):i,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>i;i++)o[i]&&Y.isFunction(o[i].promise)?o[i].promise().done(c(i,r,o)).fail(l.reject).progress(c(i,n,t)):--s;return s||l.resolveWith(r,o),l.promise()}}),Y.support=function(){var n,r,i,o,a,s,l,c,u,p,f,d=$.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",r=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0],!r||!i||!r.length)return{};o=$.createElement("select"),a=o.appendChild($.createElement("option")),s=d.getElementsByTagName("input")[0],i.style.cssText="top:1px;float:left;opacity:.5",n={leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(i.getAttribute("style")),hrefNormalized:"/a"===i.getAttribute("href"),opacity:/^0.5/.test(i.style.opacity),cssFloat:!!i.style.cssFloat,checkOn:"on"===s.value,optSelected:a.selected,getSetAttribute:"t"!==d.className,enctype:!!$.createElement("form").enctype,html5Clone:"<:nav>"!==$.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===$.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,o.disabled=!0,n.optDisabled=!a.disabled;try{delete d.test}catch(h){n.deleteExpando=!1}if(!d.addEventListener&&d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",f=function(){n.noCloneEvent=!1}),d.cloneNode(!0).fireEvent("onclick"),d.detachEvent("onclick",f)),s=$.createElement("input"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),d.appendChild(s),l=$.createDocumentFragment(),l.appendChild(d.lastChild),n.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,n.appendChecked=s.checked,l.removeChild(s),l.appendChild(d),d.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})c="on"+u,p=c in d,p||(d.setAttribute(c,"return;"),p="function"==typeof d[c]),n[u+"Bubbles"]=p;return Y(function(){var r,i,o,a,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",l=$.getElementsByTagName("body")[0];l&&(r=$.createElement("div"),r.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(r,l.firstChild),i=$.createElement("div"),r.appendChild(i),i.innerHTML="
    t
    ",o=i.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",n.reliableHiddenOffsets=p&&0===o[0].offsetHeight,i.innerHTML="",i.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===i.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,a=$.createElement("div"),a.style.cssText=i.style.cssText=s,a.style.marginRight=a.style.width="0",i.style.width="1px",i.appendChild(a),n.reliableMarginRight=!parseFloat((e.getComputedStyle(a,null)||{}).marginRight)),i.style.zoom!==t&&(i.innerHTML="",i.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===i.offsetWidth,i.style.display="block",i.style.overflow="visible",i.innerHTML="
    ",i.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==i.offsetWidth,r.style.zoom=1),l.removeChild(r),r=i=o=a=null)}),l.removeChild(d),r=i=o=a=s=l=d=null,n}();var gt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!i(e)},data:function(e,n,r,i){if(Y.acceptData(e)){var o,a,s=Y.expando,l="string"==typeof n,c=e.nodeType,u=c?Y.cache:e,p=c?e[s]:e[s]&&s;if(p&&u[p]&&(i||u[p].data)||!l||r!==t)return p||(c?e[s]=p=Y.deletedIds.pop()||Y.guid++:p=s),u[p]||(u[p]={},c||(u[p].toJSON=Y.noop)),("object"==typeof n||"function"==typeof n)&&(i?u[p]=Y.extend(u[p],n):u[p].data=Y.extend(u[p].data,n)),o=u[p],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[Y.camelCase(n)]=r),l?(a=o[n],null==a&&(a=o[Y.camelCase(n)])):a=o,a}},removeData:function(e,t,n){if(Y.acceptData(e)){var r,o,a,s=e.nodeType,l=s?Y.cache:e,c=s?e[Y.expando]:Y.expando;if(l[c]){if(t&&(r=n?l[c]:l[c].data)){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t=t in r?[t]:t.split(" ")));for(o=0,a=t.length;a>o;o++)delete r[t[o]];if(!(n?i:Y.isEmptyObject)(r))return}(n||(delete l[c].data,i(l[c])))&&(s?Y.cleanData([e],!0):Y.support.deleteExpando||l!=l.window?delete l[c]:l[c]=null)}}},_data:function(e,t,n){return Y.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&Y.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Y.fn.extend({data:function(e,n){var i,o,a,s,l,c=this[0],u=0,p=null;if(e===t){if(this.length&&(p=Y.data(c),1===c.nodeType&&!Y._data(c,"parsedAttrs"))){for(a=c.attributes,l=a.length;l>u;u++)s=a[u].name,s.indexOf("data-")||(s=Y.camelCase(s.substring(5)),r(c,s,p[s]));Y._data(c,"parsedAttrs",!0)}return p}return"object"==typeof e?this.each(function(){Y.data(this,e)}):(i=e.split(".",2),i[1]=i[1]?"."+i[1]:"",o=i[1]+"!",Y.access(this,function(n){return n===t?(p=this.triggerHandler("getData"+o,[i[0]]),p===t&&c&&(p=Y.data(c,e),p=r(c,e,p)),p===t&&i[1]?this.data(i[0]):p):(i[1]=n,this.each(function(){var t=Y(this);t.triggerHandler("setData"+o,i),Y.data(this,e,n),t.triggerHandler("changeData"+o,i)}),t)},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=Y._data(e,n),r&&(!i||Y.isArray(r)?i=Y._data(e,n,Y.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.length,i=n.shift(),o=Y._queueHooks(e,t),a=function(){Y.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?Y.queue(this[0],e):n===t?this:this.each(function(){var t=Y.queue(this,e,n);Y._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Y.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Y.dequeue(this,e)})},delay:function(e,t){return e=Y.fx?Y.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=Y.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=Y._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var yt,vt,bt,xt=/[\t\r\n]/g,wt=/\r/g,Ct=/^(?:button|input)$/i,_t=/^(?:button|input|object|select|textarea)$/i,kt=/^a(?:rea|)$/i,At=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,Tt=Y.support.getSetAttribute;Y.fn.extend({attr:function(e,t){return Y.access(this,Y.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a,s;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(tt),n=0,r=this.length;r>n;n++)if(i=this[n],1===i.nodeType)if(i.className||1!==t.length){for(o=" "+i.className+" ",a=0,s=t.length;s>a;a++)0>o.indexOf(" "+t[a]+" ")&&(o+=t[a]+" ");i.className=Y.trim(o)}else i.className=e;return this},removeClass:function(e){var n,r,i,o,a,s,l;if(Y.isFunction(e))return this.each(function(t){Y(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(n=(e||"").split(tt),s=0,l=this.length;l>s;s++)if(i=this[s],1===i.nodeType&&i.className){for(r=(" "+i.className+" ").replace(xt," "),o=0,a=n.length;a>o;o++)for(;r.indexOf(" "+n[o]+" ")>=0;)r=r.replace(" "+n[o]+" "," ");i.className=e?Y.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var i,o=0,a=Y(this),s=t,l=e.split(tt);i=l[o++];)s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else("undefined"===n||"boolean"===n)&&(this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(xt," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=Y.isFunction(e),this.each(function(r){var o,a=Y(this);1===this.nodeType&&(o=i?e.call(this,r,a.val()):e,null==o?o="":"number"==typeof o?o+="":Y.isArray(o)&&(o=Y.map(o,function(e){return null==e?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,o,"value")!==t||(this.value=o))});if(o)return n=Y.valHooks[o.type]||Y.valHooks[o.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(o,"value"))!==t?r:(r=o.value,"string"==typeof r?r.replace(wt,""):null==r?"":r)}}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(Y.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Y.nodeName(n.parentNode,"optgroup"))){if(t=Y(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=Y.makeArray(t);return Y(e).find("option").each(function(){this.selected=Y.inArray(Y(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var o,a,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return i&&Y.isFunction(Y.fn[n])?Y(e)[n](r):e.getAttribute===t?Y.prop(e,n,r):(s=1!==l||!Y.isXMLDoc(e),s&&(n=n.toLowerCase(),a=Y.attrHooks[n]||(At.test(n)?vt:yt)),r!==t?null===r?(Y.removeAttr(e,n),t):a&&"set"in a&&s&&(o=a.set(e,r,n))!==t?o:(e.setAttribute(n,r+""),r):a&&"get"in a&&s&&null!==(o=a.get(e,n))?o:(o=e.getAttribute(n),null===o?t:o))},removeAttr:function(e,t){var n,r,i,o,a=0;if(t&&1===e.nodeType)for(r=t.split(tt);r.length>a;a++)i=r[a],i&&(n=Y.propFix[i]||i,o=At.test(i),o||Y.attr(e,i,""),e.removeAttribute(Tt?i:n),o&&n in e&&(e[n]=!1))},attrHooks:{type:{set:function(e,t){if(Ct.test(e.nodeName)&&e.parentNode)Y.error("type property can't be changed");else if(!Y.support.radioValue&&"radio"===t&&Y.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return yt&&Y.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,n,r){return yt&&Y.nodeName(e,"button")?yt.set(e,n,r):(e.value=n,t)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!Y.isXMLDoc(e),a&&(n=Y.propFix[n]||n,o=Y.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):_t.test(e.nodeName)||kt.test(e.nodeName)&&e.href?0:t}}}}),vt={get:function(e,n){var r,i=Y.prop(e,n);return i===!0||"boolean"!=typeof i&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?Y.removeAttr(e,n):(r=Y.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},Tt||(bt={name:!0,id:!0,coords:!0},yt=Y.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(bt[n]?""!==r.value:r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=$.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},Y.each(["width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})}),Y.attrHooks.contenteditable={get:yt.get,set:function(e,t,n){""===t&&(t="false"),yt.set(e,t,n) }}),Y.support.hrefNormalized||Y.each(["href","src","width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null===r?t:r}})}),Y.support.style||(Y.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),Y.support.optSelected||(Y.propHooks.selected=Y.extend(Y.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),Y.support.enctype||(Y.propFix.enctype="encoding"),Y.support.checkOn||Y.each(["radio","checkbox"],function(){Y.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),Y.each(["radio","checkbox"],function(){Y.valHooks[this]=Y.extend(Y.valHooks[this],{set:function(e,n){return Y.isArray(n)?e.checked=Y.inArray(Y(e).val(),n)>=0:t}})});var Et=/^(?:textarea|input|select)$/i,Ft=/^([^\.]*|)(?:\.(.+)|)$/,Nt=/(?:^|\s)hover(\.\S+|)\b/,St=/^key/,jt=/^(?:mouse|contextmenu)|click/,Rt=/^(?:focusinfocus|focusoutblur)$/,Ot=function(e){return Y.event.special.hover?e:e.replace(Nt,"mouseenter$1 mouseleave$1")};Y.event={add:function(e,n,r,i,o){var a,s,l,c,u,p,f,d,h,g,m;if(3!==e.nodeType&&8!==e.nodeType&&n&&r&&(a=Y._data(e))){for(r.handler&&(h=r,r=h.handler,o=h.selector),r.guid||(r.guid=Y.guid++),l=a.events,l||(a.events=l={}),s=a.handle,s||(a.handle=s=function(e){return Y===t||e&&Y.event.triggered===e.type?t:Y.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=Y.trim(Ot(n)).split(" "),c=0;n.length>c;c++)u=Ft.exec(n[c])||[],p=u[1],f=(u[2]||"").split(".").sort(),m=Y.event.special[p]||{},p=(o?m.delegateType:m.bindType)||p,m=Y.event.special[p]||{},d=Y.extend({type:p,origType:u[1],data:i,handler:r,guid:r.guid,selector:o,needsContext:o&&Y.expr.match.needsContext.test(o),namespace:f.join(".")},h),g=l[p],g||(g=l[p]=[],g.delegateCount=0,m.setup&&m.setup.call(e,i,f,s)!==!1||(e.addEventListener?e.addEventListener(p,s,!1):e.attachEvent&&e.attachEvent("on"+p,s))),m.add&&(m.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),o?g.splice(g.delegateCount++,0,d):g.push(d),Y.event.global[p]=!0;e=null}},global:{},remove:function(e,t,n,r,i){var o,a,s,l,c,u,p,f,d,h,g,m=Y.hasData(e)&&Y._data(e);if(m&&(f=m.events)){for(t=Y.trim(Ot(t||"")).split(" "),o=0;t.length>o;o++)if(a=Ft.exec(t[o])||[],s=l=a[1],c=a[2],s){for(d=Y.event.special[s]||{},s=(r?d.delegateType:d.bindType)||s,h=f[s]||[],u=h.length,c=c?RegExp("(^|\\.)"+c.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0;h.length>p;p++)g=h[p],!i&&l!==g.origType||n&&n.guid!==g.guid||c&&!c.test(g.namespace)||r&&r!==g.selector&&("**"!==r||!g.selector)||(h.splice(p--,1),g.selector&&h.delegateCount--,d.remove&&d.remove.call(e,g));0===h.length&&u!==h.length&&(d.teardown&&d.teardown.call(e,c,m.handle)!==!1||Y.removeEvent(e,s,m.handle),delete f[s])}else for(s in f)Y.event.remove(e,s+t[o],n,r,!0);Y.isEmptyObject(f)&&(delete m.handle,Y.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,i,o){if(!i||3!==i.nodeType&&8!==i.nodeType){var a,s,l,c,u,p,f,d,h,g,m=n.type||n,y=[];if(!Rt.test(m+Y.event.triggered)&&(m.indexOf("!")>=0&&(m=m.slice(0,-1),s=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),i&&!Y.event.customEvent[m]||Y.event.global[m]))if(n="object"==typeof n?n[Y.expando]?n:new Y.Event(m,n):new Y.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=y.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0>m.indexOf(":")?"on"+m:"",i){if(n.result=t,n.target||(n.target=i),r=null!=r?Y.makeArray(r):[],r.unshift(n),f=Y.event.special[m]||{},!f.trigger||f.trigger.apply(i,r)!==!1){if(h=[[i,f.bindType||m]],!o&&!f.noBubble&&!Y.isWindow(i)){for(g=f.delegateType||m,c=Rt.test(g+m)?i:i.parentNode,u=i;c;c=c.parentNode)h.push([c,g]),u=c;u===(i.ownerDocument||$)&&h.push([u.defaultView||u.parentWindow||e,g])}for(l=0;h.length>l&&!n.isPropagationStopped();l++)c=h[l][0],n.type=h[l][1],d=(Y._data(c,"events")||{})[n.type]&&Y._data(c,"handle"),d&&d.apply(c,r),d=p&&c[p],d&&Y.acceptData(c)&&d.apply&&d.apply(c,r)===!1&&n.preventDefault();return n.type=m,o||n.isDefaultPrevented()||f._default&&f._default.apply(i.ownerDocument,r)!==!1||"click"===m&&Y.nodeName(i,"a")||!Y.acceptData(i)||p&&i[m]&&("focus"!==m&&"blur"!==m||0!==n.target.offsetWidth)&&!Y.isWindow(i)&&(u=i[p],u&&(i[p]=null),Y.event.triggered=m,i[m](),Y.event.triggered=t,u&&(i[p]=u)),n.result}}else{a=Y.cache;for(l in a)a[l].events&&a[l].events[m]&&Y.event.trigger(n,r,a[l].handle.elem,!0)}}},dispatch:function(n){n=Y.event.fix(n||e.event);var r,i,o,a,s,l,c,u,p,f=(Y._data(this,"events")||{})[n.type]||[],d=f.delegateCount,h=X.call(arguments),g=!n.exclusive&&!n.namespace,m=Y.event.special[n.type]||{},y=[];if(h[0]=n,n.delegateTarget=this,!m.preDispatch||m.preDispatch.call(this,n)!==!1){if(d&&(!n.button||"click"!==n.type))for(o=n.target;o!=this;o=o.parentNode||this)if(o.disabled!==!0||"click"!==n.type){for(s={},c=[],r=0;d>r;r++)u=f[r],p=u.selector,s[p]===t&&(s[p]=u.needsContext?Y(p,this).index(o)>=0:Y.find(p,this,null,[o]).length),s[p]&&c.push(u);c.length&&y.push({elem:o,matches:c})}for(f.length>d&&y.push({elem:this,matches:f.slice(d)}),r=0;y.length>r&&!n.isPropagationStopped();r++)for(l=y[r],n.currentTarget=l.elem,i=0;l.matches.length>i&&!n.isImmediatePropagationStopped();i++)u=l.matches[i],(g||!n.namespace&&!u.namespace||n.namespace_re&&n.namespace_re.test(u.namespace))&&(n.data=u.data,n.handleObj=u,a=((Y.event.special[u.origType]||{}).handle||u.handler).apply(l.elem,h),a!==t&&(n.result=a,a===!1&&(n.preventDefault(),n.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||$,i=r.documentElement,o=r.body,e.pageX=n.clientX+(i&&i.scrollLeft||o&&o.scrollLeft||0)-(i&&i.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(i&&i.scrollTop||o&&o.scrollTop||0)-(i&&i.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[Y.expando])return e;var t,n,r=e,i=Y.event.fixHooks[e.type]||{},o=i.props?this.props.concat(i.props):this.props;for(e=Y.Event(r),t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||$),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,i.filter?i.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){Y.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=Y.extend(new Y.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?Y.event.trigger(i,null,t):Y.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},Y.event.handle=Y.event.dispatch,Y.removeEvent=$.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var i="on"+n;e.detachEvent&&(e[i]===t&&(e[i]=null),e.detachEvent(i,r))},Y.Event=function(e,n){return this instanceof Y.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?a:o):this.type=e,n&&Y.extend(this,n),this.timeStamp=e&&e.timeStamp||Y.now(),this[Y.expando]=!0,t):new Y.Event(e,n)},Y.Event.prototype={preventDefault:function(){this.isDefaultPrevented=a;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=a;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()},isDefaultPrevented:o,isPropagationStopped:o,isImmediatePropagationStopped:o},Y.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Y.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return o.selector,(!i||i!==r&&!Y.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),Y.support.submitBubbles||(Y.event.special.submit={setup:function(){return Y.nodeName(this,"form")?!1:(Y.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=Y.nodeName(n,"input")||Y.nodeName(n,"button")?n.form:t;r&&!Y._data(r,"_submit_attached")&&(Y.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),Y._data(r,"_submit_attached",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&Y.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return Y.nodeName(this,"form")?!1:(Y.event.remove(this,"._submit"),t)}}),Y.support.changeBubbles||(Y.event.special.change={setup:function(){return Et.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(Y.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),Y.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),Y.event.simulate("change",this,e,!0)})),!1):(Y.event.add(this,"beforeactivate._change",function(e){var t=e.target;Et.test(t.nodeName)&&!Y._data(t,"_change_attached")&&(Y.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||Y.event.simulate("change",this.parentNode,e,!0)}),Y._data(t,"_change_attached",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return Y.event.remove(this,"._change"),!Et.test(this.nodeName)}}),Y.support.focusinBubbles||Y.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){Y.event.simulate(t,e.target,Y.event.fix(e),!0)};Y.event.special[t]={setup:function(){0===n++&&$.addEventListener(e,r,!0)},teardown:function(){0===--n&&$.removeEventListener(e,r,!0)}}}),Y.fn.extend({on:function(e,n,r,i,a){var s,l;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(l in e)this.on(l,n,r,e[l],a);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=o;else if(!i)return this;return 1===a&&(s=i,i=function(e){return Y().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=Y.guid++)),this.each(function(){Y.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,a;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,Y(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(a in e)this.off(a,n,e[a]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=o),this.each(function(){Y.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return Y(this.context).on(e,this.selector,t,n),this},die:function(e,t){return Y(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){Y.event.trigger(e,t,this)})},triggerHandler:function(e,n){return this[0]?Y.event.trigger(e,n,this[0],!0):t},toggle:function(e){var t=arguments,n=e.guid||Y.guid++,r=0,i=function(n){var i=(Y._data(this,"lastToggle"+e.guid)||0)%r;return Y._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};for(i.guid=n;t.length>r;)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Y.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Y.fn[t]=function(e,n){return null==n&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},St.test(t)&&(Y.event.fixHooks[t]=Y.event.keyHooks),jt.test(t)&&(Y.event.fixHooks[t]=Y.event.mouseHooks)}),/*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ -function(e,t){function n(e,t,n,r){n=n||[],t=t||j;var i,o,a,s,l=t.nodeType;if(!e||"string"!=typeof e)return n;if(1!==l&&9!==l)return[];if(a=w(t),!a&&!r&&(i=nt.exec(e)))if(s=i[1]){if(9===l){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&C(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return I.apply(n,P.call(t.getElementsByTagName(e),0)),n;if((s=i[3])&&ft&&t.getElementsByClassName)return I.apply(n,P.call(t.getElementsByClassName(s),0)),n}return g(e.replace(G,"$1"),t,n,r,a)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function i(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function o(e){return L(function(t){return t=+t,L(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function a(e,t,n){if(e===t)return n;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function s(e,t){var r,i,o,a,s,l,c,u=q[N][e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=b.preFilter;s;){(!r||(i=Z.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=et.exec(s))&&(o.push(r=new S(i.shift())),s=s.slice(r.length),r.type=i[0].replace(G," "));for(a in b.filter)!(i=st[a].exec(s))||c[a]&&!(i=c[a](i))||(o.push(r=new S(i.shift())),s=s.slice(r.length),r.type=a,r.matches=i);if(!r)break}return t?s.length:s?n.error(e):q(e,l).slice(0)}function l(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=M++;return t.first?function(t,n,o){for(;t=t[r];)if(i||1===t.nodeType)return e(t,n,o)}:function(t,n,a){if(a){for(;t=t[r];)if((i||1===t.nodeType)&&e(t,n,a))return t}else for(var s,l=O+" "+o+" ",c=l+y;t=t[r];)if(i||1===t.nodeType){if((s=t[N])===c)return t.sizset;if("string"==typeof s&&0===s.indexOf(l)){if(t.sizset)return t}else{if(t[N]=c,e(t,n,a))return t.sizset=!0,t;t.sizset=!1}}}}function c(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function u(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function p(e,t,n,r,i,o){return r&&!r[N]&&(r=p(r)),i&&!i[N]&&(i=p(i,o)),L(function(o,a,s,l){var c,p,f,d=[],g=[],m=a.length,y=o||h(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?y:u(y,d,e,s,l),b=n?i||(o?e:m||r)?[]:a:v;if(n&&n(v,b,s,l),r)for(c=u(b,g),r(c,[],s,l),p=c.length;p--;)(f=c[p])&&(b[g[p]]=!(v[g[p]]=f));if(o){if(i||e){if(i){for(c=[],p=b.length;p--;)(f=b[p])&&c.push(v[p]=f);i(null,b=[],c,l)}for(p=b.length;p--;)(f=b[p])&&(c=i?D.call(o,f):d[p])>-1&&(o[c]=!(a[c]=f))}}else b=u(b===a?b.splice(m,b.length):b),i?i(null,a,b,l):I.apply(a,b)})}function f(e){for(var t,n,r,i=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=l(function(e){return e===t},a,!0),d=l(function(e){return D.call(t,e)>-1},a,!0),h=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?u(e,n,r):d(e,n,r))}];i>s;s++)if(n=b.relative[e[s].type])h=[l(c(h),n)];else{if(n=b.filter[e[s].type].apply(null,e[s].matches),n[N]){for(r=++s;i>r&&!b.relative[e[r].type];r++);return p(s>1&&c(h),s>1&&e.slice(0,s-1).join("").replace(G,"$1"),n,r>s&&f(e.slice(s,r)),i>r&&f(e=e.slice(r)),i>r&&e.join(""))}h.push(n)}return c(h)}function d(e,t){var r=t.length>0,i=e.length>0,o=function(a,s,l,c,p){var f,d,h,g=[],m=0,v="0",x=a&&[],w=null!=p,C=T,_=a||i&&b.find.TAG("*",p&&s.parentNode||s),k=O+=null==C?1:Math.E;for(w&&(T=s!==j&&s,y=o.el);null!=(f=_[v]);v++){if(i&&f){for(d=0;h=e[d];d++)if(h(f,s,l)){c.push(f);break}w&&(O=k,y=++o.el)}r&&((f=!h&&f)&&m--,a&&x.push(f))}if(m+=v,r&&v!==m){for(d=0;h=t[d];d++)h(x,g,s,l);if(a){if(m>0)for(;v--;)x[v]||g[v]||(g[v]=H.call(c));g=u(g)}I.apply(c,g),w&&!a&&g.length>0&&m+t.length>1&&n.uniqueSort(c)}return w&&(O=k,T=C),x};return o.el=0,r?L(o):o}function h(e,t,r){for(var i=0,o=t.length;o>i;i++)n(e,t[i],r);return r}function g(e,t,n,r,i){var o,a,l,c,u,p=s(e);if(p.length,!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(l=a[0]).type&&9===t.nodeType&&!i&&b.relative[a[1].type]){if(t=b.find.ID(l.matches[0].replace(at,""),t,i)[0],!t)return n;e=e.slice(a.shift().length)}for(o=st.POS.test(e)?-1:a.length-1;o>=0&&(l=a[o],!b.relative[c=l.type]);o--)if((u=b.find[c])&&(r=u(l.matches[0].replace(at,""),rt.test(a[0].type)&&t.parentNode||t,i))){if(a.splice(o,1),e=r.length&&a.join(""),!e)return I.apply(n,P.call(r,0)),n;break}}return _(e,p)(r,t,i,n,rt.test(e)),n}function m(){}var y,v,b,x,w,C,_,k,A,T,E=!0,F="undefined",N=("sizcache"+Math.random()).replace(".",""),S=String,j=e.document,R=j.documentElement,O=0,M=0,H=[].pop,I=[].push,P=[].slice,D=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},L=function(e,t){return e[N]=null==t||t,e},B=function(){var e={},t=[];return L(function(n,r){return t.push(n)>b.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},$=B(),q=B(),W=B(),U="[\\x20\\t\\r\\n\\f]",Q="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",z=Q.replace("w","w#"),X="([*^$|!~]?=)",J="\\["+U+"*("+Q+")"+U+"*(?:"+X+U+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+z+")|)|)"+U+"*\\]",V=":("+Q+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+J+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+U+"*((?:-\\d)?\\d*)"+U+"*\\)|)(?=[^-]|$)",G=RegExp("^"+U+"+|((?:^|[^\\\\])(?:\\\\.)*)"+U+"+$","g"),Z=RegExp("^"+U+"*,"+U+"*"),et=RegExp("^"+U+"*([\\x20\\t\\r\\n\\f>+~])"+U+"*"),tt=RegExp(V),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/[\x20\t\r\n\f]*[+~]/,it=/h\d/i,ot=/input|select|textarea|button/i,at=/\\(?!\\)/g,st={ID:RegExp("^#("+Q+")"),CLASS:RegExp("^\\.("+Q+")"),NAME:RegExp("^\\[name=['\"]?("+Q+")['\"]?\\]"),TAG:RegExp("^("+Q.replace("w","w*")+")"),ATTR:RegExp("^"+J),PSEUDO:RegExp("^"+V),POS:RegExp(K,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+U+"*(even|odd|(([+-]|)(\\d*)n|)"+U+"*(?:([+-]|)"+U+"*(\\d+)|))"+U+"*\\)|)","i"),needsContext:RegExp("^"+U+"*[>+~]|"+K,"i")},lt=function(e){var t=j.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},ct=lt(function(e){return e.appendChild(j.createComment("")),!e.getElementsByTagName("*").length}),ut=lt(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==F&&"#"===e.firstChild.getAttribute("href")}),pt=lt(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),ft=lt(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),dt=lt(function(e){e.id=N+0,e.innerHTML="
    ",R.insertBefore(e,R.firstChild);var t=j.getElementsByName&&j.getElementsByName(N).length===2+j.getElementsByName(N+0).length;return v=!j.getElementById(N),R.removeChild(e),t});try{P.call(R.childNodes,0)[0].nodeType}catch(ht){P=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},x=n.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=x(t);return n},w=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},C=n.contains=R.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:R.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=w(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||pt?e.getAttribute(t):(n=e.getAttributeNode(t),n?"boolean"==typeof e[t]?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:L,match:st,attrHandle:ut?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:v?function(e,t,n){if(typeof t.getElementById!==F&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==F&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==F&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:ct?function(e,n){return typeof n.getElementsByTagName!==F?n.getElementsByTagName(e):t}:function(e,t){var n=t.getElementsByTagName(e);if("*"===e){for(var r,i=[],o=0;r=n[o];o++)1===r.nodeType&&i.push(r);return i}return n},NAME:dt&&function(e,n){return typeof n.getElementsByName!==F?n.getElementsByName(name):t},CLASS:ft&&function(e,n,r){return typeof n.getElementsByClassName===F||r?t:n.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(at,""),e[3]=(e[4]||e[5]||"").replace(at,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;return st.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(tt.test(t)&&(n=s(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t),e.slice(0,3))}},filter:{ID:v?function(e){return e=e.replace(at,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(at,""),function(t){var n=typeof t.getAttributeNode!==F&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(at,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=$[N][e+" "];return t||(t=RegExp("(^|"+U+")"+e+"("+U+"|$)"))&&$(e,function(e){return t.test(e.className||typeof e.getAttribute!==F&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(i){var o=n.attr(i,e);return null==o?"!="===t:t?(o+="","="===t?o===r:"!="===t?o!==r:"^="===t?r&&0===o.indexOf(r):"*="===t?r&&o.indexOf(r)>-1:"$="===t?r&&o.substr(o.length-r.length)===r:"~="===t?(" "+o+" ").indexOf(r)>-1:"|="===t?o===r||o.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r){return"nth"===e?function(e){var t,i,o=e.parentNode;if(1===n&&0===r)return!0;if(o)for(i=0,t=o.firstChild;t&&(1!==t.nodeType||(i++,e!==t));t=t.nextSibling);return i-=r,i===n||0===i%n&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===e)return!0;n=t;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(e,t){var r,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return i[N]?i(t):i.length>1?(r=[e,e,"",t],b.setFilters.hasOwnProperty(e.toLowerCase())?L(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=D.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,r)}):i}},pseudos:{not:L(function(e){var t=[],n=[],r=_(e.replace(G,"$1"));return r[N]?L(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:L(function(e){return function(t){return n(e,t).length>0}}),contains:L(function(e){return function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return it.test(e.nodeName)},text:function(e){var t,n;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(n=e.getAttribute("type"))||n.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:i("submit"),reset:i("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return ot.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:o(function(){return[0]}),last:o(function(e,t){return[t-1]}),eq:o(function(e,t,n){return[0>n?n+t:n]}),even:o(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:o(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:o(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:o(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}},k=R.compareDocumentPosition?function(e,t){return e===t?(A=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],o=[],s=e.parentNode,l=t.parentNode,c=s;if(s===l)return a(e,t);if(!s)return-1;if(!l)return 1;for(;c;)i.unshift(c),c=c.parentNode;for(c=l;c;)o.unshift(c),c=c.parentNode;n=i.length,r=o.length;for(var u=0;n>u&&r>u;u++)if(i[u]!==o[u])return a(i[u],o[u]);return u===n?a(e,o[u],-1):a(i[u],t,1)},[0,0].sort(k),E=!A,n.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=E,e.sort(k),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},n.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},_=n.compile=function(e,t){var n,r=[],i=[],o=W[N][e+" "];if(!o){for(t||(t=s(e)),n=t.length;n--;)o=f(t[n]),o[N]?r.push(o):i.push(o);o=W(e,d(i,r))}return o},j.querySelectorAll&&function(){var e,t=g,r=/'|\\/g,i=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,o=[":focus"],a=[":active"],l=R.matchesSelector||R.mozMatchesSelector||R.webkitMatchesSelector||R.oMatchesSelector||R.msMatchesSelector;lt(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||o.push("\\["+U+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||o.push(":checked")}),lt(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&o.push("[*^$]="+U+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||o.push(":enabled",":disabled")}),o=RegExp(o.join("|")),g=function(e,n,i,a,l){if(!a&&!l&&!o.test(e)){var c,u,p=!0,f=N,d=n,h=9===n.nodeType&&e;if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){for(c=s(e),(p=n.getAttribute("id"))?f=p.replace(r,"\\$&"):n.setAttribute("id",f),f="[id='"+f+"'] ",u=c.length;u--;)c[u]=f+c[u].join("");d=rt.test(e)&&n.parentNode||n,h=c.join(",")}if(h)try{return I.apply(i,P.call(d.querySelectorAll(h),0)),i}catch(g){}finally{p||n.removeAttribute("id")}}return t(e,n,i,a,l)},l&&(lt(function(t){e=l.call(t,"div");try{l.call(t,"[test!='']:sizzle"),a.push("!=",V)}catch(n){}}),a=RegExp(a.join("|")),n.matchesSelector=function(t,r){if(r=r.replace(i,"='$1']"),!w(t)&&!a.test(r)&&!o.test(r))try{var s=l.call(t,r);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(c){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=Y.attr,Y.find=n,Y.expr=n.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=n.uniqueSort,Y.text=n.getText,Y.isXMLDoc=n.isXML,Y.contains=n.contains}(e);var Mt=/Until$/,Ht=/^(?:parents|prev(?:Until|All))/,It=/^.[^:#\[\.,]*$/,Pt=Y.expr.match.needsContext,Dt={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,i,o,a,s=this;if("string"!=typeof e)return Y(e).filter(function(){for(t=0,n=s.length;n>t;t++)if(Y.contains(s[t],this))return!0});for(a=this.pushStack("","find",e),t=0,n=this.length;n>t;t++)if(r=a.length,Y.find(e,this[t],a),t>0)for(i=r;a.length>i;i++)for(o=0;r>o;o++)if(a[o]===a[i]){a.splice(i--,1);break}return a},has:function(e){var t,n=Y(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(Y.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(c(this,e,!1),"not",e)},filter:function(e){return this.pushStack(c(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?Pt.test(e)?Y(e,this.context).index(this[0])>=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=Pt.test(e)||"string"!=typeof e?Y(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:Y.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return o=o.length>1?Y.unique(o):o,this.pushStack(o,"closest",e)},index:function(e){return e?"string"==typeof e?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n="string"==typeof e?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(s(n[0])||s(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var i=Y.map(this,t,n);return Mt.test(e)||(r=n),r&&"string"==typeof r&&(i=Y.filter(r,i)),i=this.length>1&&!Dt[e]?Y.unique(i):i,this.length>1&&Ht.test(e)&&(i=i.reverse()),this.pushStack(i,e,X.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!Y(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var Lt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Bt=/ jQuery\d+="(?:null|\d+)"/g,$t=/^\s+/,qt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Wt=/<([\w:]+)/,Ut=/]","i"),Vt=/^(?:checkbox|radio)$/,Kt=/checked\s*(?:[^=]|=\s*.checked.)/i,Gt=/\/(java|ecma)script/i,Yt=/^\s*\s*$/g,Zt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},en=u($),tn=en.appendChild($.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X
    ","
    "]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||$).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||Y.filter(e,[n]).length)&&(t||1!==n.nodeType||(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Y.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Bt,""):t;if(!("string"!=typeof e||zt.test(e)||!Y.support.htmlSerialize&&Jt.test(e)||!Y.support.leadingWhitespace&&$t.test(e)||Zt[(Wt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(qt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(Y.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return s(this[0])?this.length?this.pushStack(Y(Y.isFunction(e)?e():e),"replaceWith",e):this:Y.isFunction(e)?this.each(function(t){var n=Y(this),r=n.html();n.replaceWith(e.call(this,t,r))}):("string"!=typeof e&&(e=Y(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;Y(this).remove(),t?Y(t).before(e):Y(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,o,a,s,l=0,c=e[0],u=[],f=this.length;if(!Y.support.checkClone&&f>1&&"string"==typeof c&&Kt.test(c))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(c))return this.each(function(i){var o=Y(this);e[0]=c.call(this,i,n?o.html():t),o.domManip(e,n,r)});if(this[0]){if(i=Y.buildFragment(e,this,u),a=i.fragment,o=a.firstChild,1===a.childNodes.length&&(a=o),o)for(n=n&&Y.nodeName(o,"tr"),s=i.cacheable||f-1;f>l;l++)r.call(n&&Y.nodeName(this[l],"table")?p(this[l],"tbody"):this[l],l===s?a:Y.clone(a,!0,!0));a=o=null,u.length&&Y.each(u,function(e,t){t.src?Y.ajax?Y.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Y.error("no ajax"):Y.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Yt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Y.buildFragment=function(e,n,r){var i,o,a,s=e[0];return n=n||$,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,!(1===e.length&&"string"==typeof s&&512>s.length&&n===$&&"<"===s.charAt(0))||Xt.test(s)||!Y.support.checkClone&&Kt.test(s)||!Y.support.html5Clone&&Jt.test(s)||(o=!0,i=Y.fragments[s],a=i!==t),i||(i=n.createDocumentFragment(),Y.clean(e,n,i,r),o&&(Y.fragments[s]=a&&i)),{fragment:i,cacheable:o}},Y.fragments={},Y.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Y.fn[e]=function(n){var r,i=0,o=[],a=Y(n),s=a.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===s)return a[t](this[0]),this;for(;s>i;i++)r=(i>0?this.clone(!0):this).get(),Y(a[i])[t](r),o=o.concat(r);return this.pushStack(o,e,a.selector)}}),Y.extend({clone:function(e,t,n){var r,i,o,a;if(Y.support.html5Clone||Y.isXMLDoc(e)||!Jt.test("<"+e.nodeName+">")?a=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(a=tn.firstChild)),!(Y.support.noCloneEvent&&Y.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Y.isXMLDoc(e)))for(d(e,a),r=h(e),i=h(a),o=0;r[o];++o)i[o]&&d(r[o],i[o]);if(t&&(f(e,a),n))for(r=h(e),i=h(a),o=0;r[o];++o)f(r[o],i[o]);return r=i=null,a},clean:function(e,n,r,i){var o,a,s,l,c,p,f,d,h,m,y,v=n===$&&en,b=[];for(n&&n.createDocumentFragment!==t||(n=$),o=0;null!=(s=e[o]);o++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(Qt.test(s)){for(v=v||u(n),f=n.createElement("div"),v.appendChild(f),s=s.replace(qt,"<$1>"),l=(Wt.exec(s)||["",""])[1].toLowerCase(),c=Zt[l]||Zt._default,p=c[0],f.innerHTML=c[1]+s+c[2];p--;)f=f.lastChild;if(!Y.support.tbody)for(d=Ut.test(s),h="table"!==l||d?""!==c[1]||d?[]:f.childNodes:f.firstChild&&f.firstChild.childNodes,a=h.length-1;a>=0;--a)Y.nodeName(h[a],"tbody")&&!h[a].childNodes.length&&h[a].parentNode.removeChild(h[a]);!Y.support.leadingWhitespace&&$t.test(s)&&f.insertBefore(n.createTextNode($t.exec(s)[0]),f.firstChild),s=f.childNodes,f.parentNode.removeChild(f)}else s=n.createTextNode(s);s.nodeType?b.push(s):Y.merge(b,s)}if(f&&(s=f=v=null),!Y.support.appendChecked)for(o=0;null!=(s=b[o]);o++)Y.nodeName(s,"input")?g(s):s.getElementsByTagName!==t&&Y.grep(s.getElementsByTagName("input"),g);if(r)for(m=function(e){return!e.type||Gt.test(e.type)?i?i.push(e.parentNode?e.parentNode.removeChild(e):e):r.appendChild(e):t},o=0;null!=(s=b[o]);o++)Y.nodeName(s,"script")&&m(s)||(r.appendChild(s),s.getElementsByTagName!==t&&(y=Y.grep(Y.merge([],s.getElementsByTagName("script")),m),b.splice.apply(b,[o+1,0].concat(y)),o+=y.length));return b},cleanData:function(e,t){for(var n,r,i,o,a=0,s=Y.expando,l=Y.cache,c=Y.support.deleteExpando,u=Y.event.special;null!=(i=e[a]);a++)if((t||Y.acceptData(i))&&(r=i[s],n=r&&l[r])){if(n.events)for(o in n.events)u[o]?Y.event.remove(i,o):Y.removeEvent(i,o,n.handle);l[r]&&(delete l[r],c?delete i[s]:i.removeAttribute?i.removeAttribute(s):i[s]=null,Y.deletedIds.push(r))}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(W.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,r){return r&&r instanceof Y&&!(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e($);return e}}();var nn,rn,on,an=/alpha\([^)]*\)/i,sn=/opacity=([^)]*)/,ln=/^(top|right|bottom|left)$/,cn=/^(none|table(?!-c[ea]).+)/,un=/^margin/,pn=RegExp("^("+Z+")(.*)$","i"),fn=RegExp("^("+Z+")(?!px)[a-z%]+$","i"),dn=RegExp("^([-+])=("+Z+")","i"),hn={BODY:"block"},gn={position:"absolute",visibility:"hidden",display:"block"},mn={letterSpacing:0,fontWeight:400},yn=["Top","Right","Bottom","Left"],vn=["Webkit","O","Moz","ms"],bn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e,t){var n="boolean"==typeof e;return Y.isFunction(e)&&Y.isFunction(t)?bn.apply(this,arguments):this.each(function(){(n?e:y(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=Y.camelCase(n),c=e.style;if(n=Y.cssProps[l]||(Y.cssProps[l]=m(c,l)),s=Y.cssHooks[n]||Y.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:c[n];if(a=typeof r,"string"===a&&(o=dn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(Y.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||Y.cssNumber[l]||(r+="px"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{c[n]=r}catch(u){}}},css:function(e,n,r,i){var o,a,s,l=Y.camelCase(n);return n=Y.cssProps[l]||(Y.cssProps[l]=m(e.style,l)),s=Y.cssHooks[n]||Y.cssHooks[l],s&&"get"in s&&(o=s.get(e,!0,i)),o===t&&(o=nn(e,n)),"normal"===o&&n in mn&&(o=mn[n]),r||i!==t?(a=parseFloat(o),r||Y.isNumeric(a)?a||0:o):o},swap:function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=o[i];return r}}),e.getComputedStyle?nn=function(t,n){var r,i,o,a,s=e.getComputedStyle(t,null),l=t.style;return s&&(r=s.getPropertyValue(n)||s[n],""!==r||Y.contains(t.ownerDocument,t)||(r=Y.style(t,n)),fn.test(r)&&un.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),r}:$.documentElement.currentStyle&&(nn=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],o=e.style;return null==i&&o&&o[t]&&(i=o[t]),fn.test(i)&&!ln.test(t)&&(n=o.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),o.left="fontSize"===t?"1em":i,i=o.pixelLeft+"px",o.left=n,r&&(e.runtimeStyle.left=r)),""===i?"auto":i}),Y.each(["height","width"],function(e,n){Y.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&cn.test(nn(e,"display"))?Y.swap(e,gn,function(){return w(e,n,i)}):w(e,n,i):t},set:function(e,t,r){return b(e,t,r?x(e,n,r,Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing")):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return sn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=Y.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,t>=1&&""===Y.trim(o.replace(an,""))&&n.removeAttribute&&(n.removeAttribute("filter"),r&&!r.filter)||(n.filter=an.test(o)?o.replace(an,i):o+" "+i)}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,n){return Y.swap(e,{display:"inline-block"},function(){return n?nn(e,"marginRight"):t})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return fn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Y.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||nn(e,"display"))},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,i="string"==typeof n?n.split(" "):[n],o={};for(r=0;4>r;r++)o[e+yn[r]+t]=i[r]||i[r-2]||i[0];return o}},un.test(e)||(Y.cssHooks[e+t].set=b)});var xn=/%20/g,wn=/\[\]$/,Cn=/\r?\n/g,_n=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,kn=/^(?:select|textarea)/i; -Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||kn.test(this.nodeName)||_n.test(this.type))}).map(function(e,t){var n=Y(this).val();return null==n?null:Y.isArray(n)?Y.map(n,function(e){return{name:t.name,value:e.replace(Cn,"\r\n")}}):{name:t.name,value:n.replace(Cn,"\r\n")}}).get()}}),Y.param=function(e,n){var r,i=[],o=function(e,t){t=Y.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional),Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){o(this.name,this.value)});else for(r in e)_(r,e[r],n,o);return i.join("&").replace(xn,"+")};var An,Tn,En=/#.*$/,Fn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Sn=/^(?:GET|HEAD)$/,jn=/^\/\//,Rn=/\?/,On=/)<[^<]*)*<\/script>/gi,Mn=/([?&])_=[^&]*/,Hn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,In=Y.fn.load,Pn={},Dn={},Ln=["*/"]+["*"];try{Tn=q.href}catch(Bn){Tn=$.createElement("a"),Tn.href="",Tn=Tn.href}An=Hn.exec(Tn.toLowerCase())||[],Y.fn.load=function(e,n,r){if("string"!=typeof e&&In)return In.apply(this,arguments);if(!this.length)return this;var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),Y.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),Y.ajax({url:e,type:o,dataType:"html",data:n,complete:function(e,t){r&&s.each(r,a||[e.responseText,t,e])}}).done(function(e){a=arguments,s.html(i?Y("
    ").append(e.replace(On,"")).find(i):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,i,o){return Y.isFunction(r)&&(o=o||i,i=r,r=t),Y.ajax({type:n,url:e,data:r,success:i,dataType:o})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?T(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),T(e,t),e},ajaxSettings:{url:Tn,isLocal:Nn.test(An[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ln},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:k(Pn),ajaxTransport:k(Dn),ajax:function(e,n){function r(e,n,r,a){var c,p,v,b,w,_=n;2!==x&&(x=2,l&&clearTimeout(l),s=t,o=a||"",C.readyState=e>0?4:0,r&&(b=E(f,C,r)),e>=200&&300>e||304===e?(f.ifModified&&(w=C.getResponseHeader("Last-Modified"),w&&(Y.lastModified[i]=w),w=C.getResponseHeader("Etag"),w&&(Y.etag[i]=w)),304===e?(_="notmodified",c=!0):(c=F(f,b),_=c.state,p=c.data,v=c.error,c=!v)):(v=_,(!_||e)&&(_="error",0>e&&(e=0))),C.status=e,C.statusText=(n||_)+"",c?g.resolveWith(d,[p,_,C]):g.rejectWith(d,[C,_,v]),C.statusCode(y),y=t,u&&h.trigger("ajax"+(c?"Success":"Error"),[C,f,c?p:v]),m.fireWith(d,[C,_]),u&&(h.trigger("ajaxComplete",[C,f]),--Y.active||Y.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,l,c,u,p,f=Y.ajaxSetup({},n),d=f.context||f,h=d!==f&&(d.nodeType||d instanceof Y)?Y(d):Y.event,g=Y.Deferred(),m=Y.Callbacks("once memory"),y=f.statusCode||{},v={},b={},x=0,w="canceled",C={readyState:0,setRequestHeader:function(e,t){if(!x){var n=e.toLowerCase();e=b[n]=b[n]||e,v[e]=t}return this},getAllResponseHeaders:function(){return 2===x?o:null},getResponseHeader:function(e){var n;if(2===x){if(!a)for(a={};n=Fn.exec(o);)a[n[1].toLowerCase()]=n[2];n=a[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return x||(f.mimeType=e),this},abort:function(e){return e=e||w,s&&s.abort(e),r(0,e),this}};if(g.promise(C),C.success=C.done,C.error=C.fail,C.complete=m.add,C.statusCode=function(e){if(e){var t;if(2>x)for(t in e)y[t]=[y[t],e[t]];else t=e[C.status],C.always(t)}return this},f.url=((e||f.url)+"").replace(En,"").replace(jn,An[1]+"//"),f.dataTypes=Y.trim(f.dataType||"*").toLowerCase().split(tt),null==f.crossDomain&&(c=Hn.exec(f.url.toLowerCase()),f.crossDomain=!(!c||c[1]===An[1]&&c[2]===An[2]&&(c[3]||("http:"===c[1]?80:443))==(An[3]||("http:"===An[1]?80:443)))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Y.param(f.data,f.traditional)),A(Pn,f,n,C),2===x)return C;if(u=f.global,f.type=f.type.toUpperCase(),f.hasContent=!Sn.test(f.type),u&&0===Y.active++&&Y.event.trigger("ajaxStart"),!f.hasContent&&(f.data&&(f.url+=(Rn.test(f.url)?"&":"?")+f.data,delete f.data),i=f.url,f.cache===!1)){var _=Y.now(),k=f.url.replace(Mn,"$1_="+_);f.url=k+(k===f.url?(Rn.test(f.url)?"&":"?")+"_="+_:"")}(f.data&&f.hasContent&&f.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),f.ifModified&&(i=i||f.url,Y.lastModified[i]&&C.setRequestHeader("If-Modified-Since",Y.lastModified[i]),Y.etag[i]&&C.setRequestHeader("If-None-Match",Y.etag[i])),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ln+"; q=0.01":""):f.accepts["*"]);for(p in f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(f.beforeSend.call(d,C,f)===!1||2===x))return C.abort();w="abort";for(p in{success:1,error:1,complete:1})C[p](f[p]);if(s=A(Dn,f,n,C)){C.readyState=1,u&&h.trigger("ajaxSend",[C,f]),f.async&&f.timeout>0&&(l=setTimeout(function(){C.abort("timeout")},f.timeout));try{x=1,s.send(v,r)}catch(T){if(!(2>x))throw T;r(-1,T)}}else r(-1,"No Transport");return C},active:0,lastModified:{},etag:{}});var $n=[],qn=/\?/,Wn=/(=)\?(?=&|$)|\?\?/,Un=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=$n.pop()||Y.expando+"_"+Un++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.data,c=n.url,u=n.jsonp!==!1,p=u&&Wn.test(c),f=u&&!p&&"string"==typeof l&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wn.test(l);return"jsonp"===n.dataTypes[0]||p||f?(o=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a=e[o],p?n.url=c.replace(Wn,"$1"+o):f?n.data=l.replace(Wn,"$1"+o):u&&(n.url+=(qn.test(c)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||Y.error(o+" was not called"),s[0]},n.dataTypes[0]="json",e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,$n.push(o)),s&&Y.isFunction(a)&&a(s[0]),s=a=t}),"script"):t}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=$.head||$.getElementsByTagName("head")[0]||$.documentElement;return{send:function(i,o){n=$.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){(i||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Qn,zn=e.ActiveXObject?function(){for(var e in Qn)Qn[e](0,1)}:!1,Xn=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&N()||S()}:N,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(c){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,c,u,p,f;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=Y.noop,zn&&delete Qn[a]),i)4!==l.readyState&&l.abort();else{s=l.status,u=l.getAllResponseHeaders(),p={},f=l.responseXML,f&&f.documentElement&&(p.xml=f);try{p.text=l.responseText}catch(d){}try{c=l.statusText}catch(d){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(h){i||o(-1,h)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r,0):(a=++Xn,zn&&(Qn||(Qn={},Y(e).unload(zn)),Qn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Jn,Vn,Kn=/^(?:toggle|show|hide)$/,Gn=RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Yn=/queueHooks$/,Zn=[H],er={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Gn.exec(t),a=i.cur(),s=+a||0,l=1,c=20;if(o){if(n=+o[2],r=o[3]||(Y.cssNumber[e]?"":"px"),"px"!==r&&s){s=Y.css(i.elem,e,!0)||n||1;do l=l||".5",s/=l,Y.style(i.elem,e,s+r);while(l!==(l=i.cur()/a)&&1!==l&&--c)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};Y.Animation=Y.extend(O,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],er[n]=er[n]||[],er[n].unshift(t)},prefilter:function(e,t){t?Zn.unshift(e):Zn.push(e)}}),Y.Tween=I,I.prototype={constructor:I,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(Y.cssNumber[n]?"":"px")},cur:function(){var e=I.propHooks[this.prop];return e&&e.get?e.get(this):I.propHooks._default.get(this)},run:function(e){var t,n=I.propHooks[this.prop];return this.pos=t=this.options.duration?Y.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):I.propHooks._default.set(this),this}},I.prototype.init.prototype=I.prototype,I.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Y.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Y.fx.step[e.prop]?Y.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Y.cssProps[e.prop]]||Y.cssHooks[e.prop])?Y.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Y.each(["toggle","show","hide"],function(e,t){var n=Y.fn[t];Y.fn[t]=function(r,i,o){return null==r||"boolean"==typeof r||!e&&Y.isFunction(r)&&Y.isFunction(i)?n.apply(this,arguments):this.animate(P(t,!0),r,i,o)}}),Y.fn.extend({fadeTo:function(e,t,n,r){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=Y.isEmptyObject(e),o=Y.speed(t,n,r),a=function(){var t=O(this,Y.extend({},e),o);i&&t.stop(!0)};return i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=Y.timers,a=Y._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Yn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&Y.dequeue(this,e)})}}),Y.each({slideDown:P("show"),slideUp:P("hide"),slideToggle:P("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Y.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Y.speed=function(e,t,n){var r=e&&"object"==typeof e?Y.extend({},e):{complete:n||!n&&t||Y.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Y.isFunction(t)&&t};return r.duration=Y.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Y.fx.speeds?Y.fx.speeds[r.duration]:Y.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Y.isFunction(r.old)&&r.old.call(this),r.queue&&Y.dequeue(this,r.queue)},r},Y.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Y.timers=[],Y.fx=I.prototype.init,Y.fx.tick=function(){var e,n=Y.timers,r=0;for(Jn=Y.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||Y.fx.stop(),Jn=t},Y.fx.timer=function(e){e()&&Y.timers.push(e)&&!Vn&&(Vn=setInterval(Y.fx.tick,Y.fx.interval))},Y.fx.interval=13,Y.fx.stop=function(){clearInterval(Vn),Vn=null},Y.fx.speeds={slow:600,fast:200,_default:400},Y.fx.step={},Y.expr&&Y.expr.filters&&(Y.expr.filters.animated=function(e){return Y.grep(Y.timers,function(t){return e===t.elem}).length});var tr=/^(?:body|html)$/i;Y.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Y.offset.setOffset(this,e,t)});var n,r,i,o,a,s,l,c={top:0,left:0},u=this[0],p=u&&u.ownerDocument;if(p)return(r=p.body)===u?Y.offset.bodyOffset(u):(n=p.documentElement,Y.contains(n,u)?(u.getBoundingClientRect!==t&&(c=u.getBoundingClientRect()),i=D(p),o=n.clientTop||r.clientTop||0,a=n.clientLeft||r.clientLeft||0,s=i.pageYOffset||n.scrollTop,l=i.pageXOffset||n.scrollLeft,{top:c.top+s-o,left:c.left+l-a}):c)},Y.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return Y.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Y.css(e,"marginTop"))||0,n+=parseFloat(Y.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=Y.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=Y(e),s=a.offset(),l=Y.css(e,"top"),c=Y.css(e,"left"),u=("absolute"===r||"fixed"===r)&&Y.inArray("auto",[l,c])>-1,p={},f={};u?(f=a.position(),i=f.top,o=f.left):(i=parseFloat(l)||0,o=parseFloat(c)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+i),null!=t.left&&(p.left=t.left-s.left+o),"using"in t?t.using.call(e,p):a.css(p)}},Y.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||$.body;e&&!tr.test(e.nodeName)&&"static"===Y.css(e,"position");)e=e.offsetParent;return e||$.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(i){return Y.access(this,function(e,i,o){var a=D(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?Y(a).scrollLeft():o,r?o:Y(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){Y.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return Y.access(this,function(n,r,i){var o;return Y.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?Y.css(n,r,i,s):Y.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=Y,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})}(window),/*! ========================================================= +function(e,t){function n(e,t,n,r){n=n||[],t=t||j;var i,o,a,s,l=t.nodeType;if(!e||"string"!=typeof e)return n;if(1!==l&&9!==l)return[];if(a=w(t),!a&&!r&&(i=nt.exec(e)))if(s=i[1]){if(9===l){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&C(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return P.apply(n,I.call(t.getElementsByTagName(e),0)),n;if((s=i[3])&&ft&&t.getElementsByClassName)return P.apply(n,I.call(t.getElementsByClassName(s),0)),n}return g(e.replace(G,"$1"),t,n,r,a)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function i(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function o(e){return L(function(t){return t=+t,L(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function a(e,t,n){if(e===t)return n;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function s(e,t){var r,i,o,a,s,l,c,u=q[N][e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=b.preFilter;s;){(!r||(i=Z.exec(s)))&&(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=et.exec(s))&&(o.push(r=new S(i.shift())),s=s.slice(r.length),r.type=i[0].replace(G," "));for(a in b.filter)!(i=st[a].exec(s))||c[a]&&!(i=c[a](i))||(o.push(r=new S(i.shift())),s=s.slice(r.length),r.type=a,r.matches=i);if(!r)break}return t?s.length:s?n.error(e):q(e,l).slice(0)}function l(e,t,n){var r=t.dir,i=n&&"parentNode"===t.dir,o=M++;return t.first?function(t,n,o){for(;t=t[r];)if(i||1===t.nodeType)return e(t,n,o)}:function(t,n,a){if(a){for(;t=t[r];)if((i||1===t.nodeType)&&e(t,n,a))return t}else for(var s,l=O+" "+o+" ",c=l+y;t=t[r];)if(i||1===t.nodeType){if((s=t[N])===c)return t.sizset;if("string"==typeof s&&0===s.indexOf(l)){if(t.sizset)return t}else{if(t[N]=c,e(t,n,a))return t.sizset=!0,t;t.sizset=!1}}}}function c(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function u(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function p(e,t,n,r,i,o){return r&&!r[N]&&(r=p(r)),i&&!i[N]&&(i=p(i,o)),L(function(o,a,s,l){var c,p,f,d=[],g=[],m=a.length,y=o||h(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?y:u(y,d,e,s,l),b=n?i||(o?e:m||r)?[]:a:v;if(n&&n(v,b,s,l),r)for(c=u(b,g),r(c,[],s,l),p=c.length;p--;)(f=c[p])&&(b[g[p]]=!(v[g[p]]=f));if(o){if(i||e){if(i){for(c=[],p=b.length;p--;)(f=b[p])&&c.push(v[p]=f);i(null,b=[],c,l)}for(p=b.length;p--;)(f=b[p])&&(c=i?D.call(o,f):d[p])>-1&&(o[c]=!(a[c]=f))}}else b=u(b===a?b.splice(m,b.length):b),i?i(null,a,b,l):P.apply(a,b)})}function f(e){for(var t,n,r,i=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=l(function(e){return e===t},a,!0),d=l(function(e){return D.call(t,e)>-1},a,!0),h=[function(e,n,r){return!o&&(r||n!==T)||((t=n).nodeType?u(e,n,r):d(e,n,r))}];i>s;s++)if(n=b.relative[e[s].type])h=[l(c(h),n)];else{if(n=b.filter[e[s].type].apply(null,e[s].matches),n[N]){for(r=++s;i>r&&!b.relative[e[r].type];r++);return p(s>1&&c(h),s>1&&e.slice(0,s-1).join("").replace(G,"$1"),n,r>s&&f(e.slice(s,r)),i>r&&f(e=e.slice(r)),i>r&&e.join(""))}h.push(n)}return c(h)}function d(e,t){var r=t.length>0,i=e.length>0,o=function(a,s,l,c,p){var f,d,h,g=[],m=0,v="0",x=a&&[],w=null!=p,C=T,_=a||i&&b.find.TAG("*",p&&s.parentNode||s),k=O+=null==C?1:Math.E;for(w&&(T=s!==j&&s,y=o.el);null!=(f=_[v]);v++){if(i&&f){for(d=0;h=e[d];d++)if(h(f,s,l)){c.push(f);break}w&&(O=k,y=++o.el)}r&&((f=!h&&f)&&m--,a&&x.push(f))}if(m+=v,r&&v!==m){for(d=0;h=t[d];d++)h(x,g,s,l);if(a){if(m>0)for(;v--;)x[v]||g[v]||(g[v]=H.call(c));g=u(g)}P.apply(c,g),w&&!a&&g.length>0&&m+t.length>1&&n.uniqueSort(c)}return w&&(O=k,T=C),x};return o.el=0,r?L(o):o}function h(e,t,r){for(var i=0,o=t.length;o>i;i++)n(e,t[i],r);return r}function g(e,t,n,r,i){var o,a,l,c,u,p=s(e);if(p.length,!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(l=a[0]).type&&9===t.nodeType&&!i&&b.relative[a[1].type]){if(t=b.find.ID(l.matches[0].replace(at,""),t,i)[0],!t)return n;e=e.slice(a.shift().length)}for(o=st.POS.test(e)?-1:a.length-1;o>=0&&(l=a[o],!b.relative[c=l.type]);o--)if((u=b.find[c])&&(r=u(l.matches[0].replace(at,""),rt.test(a[0].type)&&t.parentNode||t,i))){if(a.splice(o,1),e=r.length&&a.join(""),!e)return P.apply(n,I.call(r,0)),n;break}}return _(e,p)(r,t,i,n,rt.test(e)),n}function m(){}var y,v,b,x,w,C,_,k,A,T,E=!0,F="undefined",N=("sizcache"+Math.random()).replace(".",""),S=String,j=e.document,R=j.documentElement,O=0,M=0,H=[].pop,P=[].push,I=[].slice,D=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},L=function(e,t){return e[N]=null==t||t,e},B=function(){var e={},t=[];return L(function(n,r){return t.push(n)>b.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},$=B(),q=B(),W=B(),U="[\\x20\\t\\r\\n\\f]",Q="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",z=Q.replace("w","w#"),X="([*^$|!~]?=)",J="\\["+U+"*("+Q+")"+U+"*(?:"+X+U+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+z+")|)|)"+U+"*\\]",V=":("+Q+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+J+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+U+"*((?:-\\d)?\\d*)"+U+"*\\)|)(?=[^-]|$)",G=RegExp("^"+U+"+|((?:^|[^\\\\])(?:\\\\.)*)"+U+"+$","g"),Z=RegExp("^"+U+"*,"+U+"*"),et=RegExp("^"+U+"*([\\x20\\t\\r\\n\\f>+~])"+U+"*"),tt=RegExp(V),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/[\x20\t\r\n\f]*[+~]/,it=/h\d/i,ot=/input|select|textarea|button/i,at=/\\(?!\\)/g,st={ID:RegExp("^#("+Q+")"),CLASS:RegExp("^\\.("+Q+")"),NAME:RegExp("^\\[name=['\"]?("+Q+")['\"]?\\]"),TAG:RegExp("^("+Q.replace("w","w*")+")"),ATTR:RegExp("^"+J),PSEUDO:RegExp("^"+V),POS:RegExp(K,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+U+"*(even|odd|(([+-]|)(\\d*)n|)"+U+"*(?:([+-]|)"+U+"*(\\d+)|))"+U+"*\\)|)","i"),needsContext:RegExp("^"+U+"*[>+~]|"+K,"i")},lt=function(e){var t=j.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},ct=lt(function(e){return e.appendChild(j.createComment("")),!e.getElementsByTagName("*").length}),ut=lt(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==F&&"#"===e.firstChild.getAttribute("href")}),pt=lt(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),ft=lt(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),dt=lt(function(e){e.id=N+0,e.innerHTML="
    ",R.insertBefore(e,R.firstChild);var t=j.getElementsByName&&j.getElementsByName(N).length===2+j.getElementsByName(N+0).length;return v=!j.getElementById(N),R.removeChild(e),t});try{I.call(R.childNodes,0)[0].nodeType}catch(ht){I=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},x=n.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=x(t);return n},w=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},C=n.contains=R.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:R.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=w(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||pt?e.getAttribute(t):(n=e.getAttributeNode(t),n?"boolean"==typeof e[t]?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:L,match:st,attrHandle:ut?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:v?function(e,t,n){if(typeof t.getElementById!==F&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==F&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==F&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:ct?function(e,n){return typeof n.getElementsByTagName!==F?n.getElementsByTagName(e):t}:function(e,t){var n=t.getElementsByTagName(e);if("*"===e){for(var r,i=[],o=0;r=n[o];o++)1===r.nodeType&&i.push(r);return i}return n},NAME:dt&&function(e,n){return typeof n.getElementsByName!==F?n.getElementsByName(name):t},CLASS:ft&&function(e,n,r){return typeof n.getElementsByClassName===F||r?t:n.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(at,""),e[3]=(e[4]||e[5]||"").replace(at,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;return st.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(tt.test(t)&&(n=s(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t),e.slice(0,3))}},filter:{ID:v?function(e){return e=e.replace(at,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(at,""),function(t){var n=typeof t.getAttributeNode!==F&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(at,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=$[N][e+" "];return t||(t=RegExp("(^|"+U+")"+e+"("+U+"|$)"))&&$(e,function(e){return t.test(e.className||typeof e.getAttribute!==F&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(i){var o=n.attr(i,e);return null==o?"!="===t:t?(o+="","="===t?o===r:"!="===t?o!==r:"^="===t?r&&0===o.indexOf(r):"*="===t?r&&o.indexOf(r)>-1:"$="===t?r&&o.substr(o.length-r.length)===r:"~="===t?(" "+o+" ").indexOf(r)>-1:"|="===t?o===r||o.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r){return"nth"===e?function(e){var t,i,o=e.parentNode;if(1===n&&0===r)return!0;if(o)for(i=0,t=o.firstChild;t&&(1!==t.nodeType||(i++,e!==t));t=t.nextSibling);return i-=r,i===n||0===i%n&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===e)return!0;n=t;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(e,t){var r,i=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return i[N]?i(t):i.length>1?(r=[e,e,"",t],b.setFilters.hasOwnProperty(e.toLowerCase())?L(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=D.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,r)}):i}},pseudos:{not:L(function(e){var t=[],n=[],r=_(e.replace(G,"$1"));return r[N]?L(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:L(function(e){return function(t){return n(e,t).length>0}}),contains:L(function(e){return function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return it.test(e.nodeName)},text:function(e){var t,n;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(n=e.getAttribute("type"))||n.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:i("submit"),reset:i("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return ot.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:o(function(){return[0]}),last:o(function(e,t){return[t-1]}),eq:o(function(e,t,n){return[0>n?n+t:n]}),even:o(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:o(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:o(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:o(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}},k=R.compareDocumentPosition?function(e,t){return e===t?(A=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return A=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],o=[],s=e.parentNode,l=t.parentNode,c=s;if(s===l)return a(e,t);if(!s)return-1;if(!l)return 1;for(;c;)i.unshift(c),c=c.parentNode;for(c=l;c;)o.unshift(c),c=c.parentNode;n=i.length,r=o.length;for(var u=0;n>u&&r>u;u++)if(i[u]!==o[u])return a(i[u],o[u]);return u===n?a(e,o[u],-1):a(i[u],t,1)},[0,0].sort(k),E=!A,n.uniqueSort=function(e){var t,n=[],r=1,i=0;if(A=E,e.sort(k),A){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return e},n.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},_=n.compile=function(e,t){var n,r=[],i=[],o=W[N][e+" "];if(!o){for(t||(t=s(e)),n=t.length;n--;)o=f(t[n]),o[N]?r.push(o):i.push(o);o=W(e,d(i,r))}return o},j.querySelectorAll&&function(){var e,t=g,r=/'|\\/g,i=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,o=[":focus"],a=[":active"],l=R.matchesSelector||R.mozMatchesSelector||R.webkitMatchesSelector||R.oMatchesSelector||R.msMatchesSelector;lt(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||o.push("\\["+U+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||o.push(":checked")}),lt(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&o.push("[*^$]="+U+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||o.push(":enabled",":disabled")}),o=RegExp(o.join("|")),g=function(e,n,i,a,l){if(!a&&!l&&!o.test(e)){var c,u,p=!0,f=N,d=n,h=9===n.nodeType&&e;if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){for(c=s(e),(p=n.getAttribute("id"))?f=p.replace(r,"\\$&"):n.setAttribute("id",f),f="[id='"+f+"'] ",u=c.length;u--;)c[u]=f+c[u].join("");d=rt.test(e)&&n.parentNode||n,h=c.join(",")}if(h)try{return P.apply(i,I.call(d.querySelectorAll(h),0)),i}catch(g){}finally{p||n.removeAttribute("id")}}return t(e,n,i,a,l)},l&&(lt(function(t){e=l.call(t,"div");try{l.call(t,"[test!='']:sizzle"),a.push("!=",V)}catch(n){}}),a=RegExp(a.join("|")),n.matchesSelector=function(t,r){if(r=r.replace(i,"='$1']"),!w(t)&&!a.test(r)&&!o.test(r))try{var s=l.call(t,r);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(c){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=Y.attr,Y.find=n,Y.expr=n.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=n.uniqueSort,Y.text=n.getText,Y.isXMLDoc=n.isXML,Y.contains=n.contains}(e);var Mt=/Until$/,Ht=/^(?:parents|prev(?:Until|All))/,Pt=/^.[^:#\[\.,]*$/,It=Y.expr.match.needsContext,Dt={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,i,o,a,s=this;if("string"!=typeof e)return Y(e).filter(function(){for(t=0,n=s.length;n>t;t++)if(Y.contains(s[t],this))return!0});for(a=this.pushStack("","find",e),t=0,n=this.length;n>t;t++)if(r=a.length,Y.find(e,this[t],a),t>0)for(i=r;a.length>i;i++)for(o=0;r>o;o++)if(a[o]===a[i]){a.splice(i--,1);break}return a},has:function(e){var t,n=Y(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(Y.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(c(this,e,!1),"not",e)},filter:function(e){return this.pushStack(c(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?It.test(e)?Y(e,this.context).index(this[0])>=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=It.test(e)||"string"!=typeof e?Y(e,t||this.context):0;i>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:Y.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}return o=o.length>1?Y.unique(o):o,this.pushStack(o,"closest",e)},index:function(e){return e?"string"==typeof e?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n="string"==typeof e?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(s(n[0])||s(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var i=Y.map(this,t,n);return Mt.test(e)||(r=n),r&&"string"==typeof r&&(i=Y.filter(r,i)),i=this.length>1&&!Dt[e]?Y.unique(i):i,this.length>1&&Ht.test(e)&&(i=i.reverse()),this.pushStack(i,e,X.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!Y(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var Lt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Bt=/ jQuery\d+="(?:null|\d+)"/g,$t=/^\s+/,qt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Wt=/<([\w:]+)/,Ut=/
    ]","i"),Vt=/^(?:checkbox|radio)$/,Kt=/checked\s*(?:[^=]|=\s*.checked.)/i,Gt=/\/(java|ecma)script/i,Yt=/^\s*\s*$/g,Zt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"
    ","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},en=u($),tn=en.appendChild($.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X
    ","
    "]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||$).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||Y.filter(e,[n]).length)&&(t||1!==n.nodeType||(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Y.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Bt,""):t;if(!("string"!=typeof e||zt.test(e)||!Y.support.htmlSerialize&&Jt.test(e)||!Y.support.leadingWhitespace&&$t.test(e)||Zt[(Wt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(qt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(Y.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return s(this[0])?this.length?this.pushStack(Y(Y.isFunction(e)?e():e),"replaceWith",e):this:Y.isFunction(e)?this.each(function(t){var n=Y(this),r=n.html();n.replaceWith(e.call(this,t,r))}):("string"!=typeof e&&(e=Y(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;Y(this).remove(),t?Y(t).before(e):Y(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,o,a,s,l=0,c=e[0],u=[],f=this.length;if(!Y.support.checkClone&&f>1&&"string"==typeof c&&Kt.test(c))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(c))return this.each(function(i){var o=Y(this);e[0]=c.call(this,i,n?o.html():t),o.domManip(e,n,r)});if(this[0]){if(i=Y.buildFragment(e,this,u),a=i.fragment,o=a.firstChild,1===a.childNodes.length&&(a=o),o)for(n=n&&Y.nodeName(o,"tr"),s=i.cacheable||f-1;f>l;l++)r.call(n&&Y.nodeName(this[l],"table")?p(this[l],"tbody"):this[l],l===s?a:Y.clone(a,!0,!0));a=o=null,u.length&&Y.each(u,function(e,t){t.src?Y.ajax?Y.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Y.error("no ajax"):Y.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Yt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Y.buildFragment=function(e,n,r){var i,o,a,s=e[0];return n=n||$,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,!(1===e.length&&"string"==typeof s&&512>s.length&&n===$&&"<"===s.charAt(0))||Xt.test(s)||!Y.support.checkClone&&Kt.test(s)||!Y.support.html5Clone&&Jt.test(s)||(o=!0,i=Y.fragments[s],a=i!==t),i||(i=n.createDocumentFragment(),Y.clean(e,n,i,r),o&&(Y.fragments[s]=a&&i)),{fragment:i,cacheable:o}},Y.fragments={},Y.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Y.fn[e]=function(n){var r,i=0,o=[],a=Y(n),s=a.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===s)return a[t](this[0]),this;for(;s>i;i++)r=(i>0?this.clone(!0):this).get(),Y(a[i])[t](r),o=o.concat(r);return this.pushStack(o,e,a.selector)}}),Y.extend({clone:function(e,t,n){var r,i,o,a;if(Y.support.html5Clone||Y.isXMLDoc(e)||!Jt.test("<"+e.nodeName+">")?a=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(a=tn.firstChild)),!(Y.support.noCloneEvent&&Y.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Y.isXMLDoc(e)))for(d(e,a),r=h(e),i=h(a),o=0;r[o];++o)i[o]&&d(r[o],i[o]);if(t&&(f(e,a),n))for(r=h(e),i=h(a),o=0;r[o];++o)f(r[o],i[o]);return r=i=null,a},clean:function(e,n,r,i){var o,a,s,l,c,p,f,d,h,m,y,v=n===$&&en,b=[];for(n&&n.createDocumentFragment!==t||(n=$),o=0;null!=(s=e[o]);o++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(Qt.test(s)){for(v=v||u(n),f=n.createElement("div"),v.appendChild(f),s=s.replace(qt,"<$1>"),l=(Wt.exec(s)||["",""])[1].toLowerCase(),c=Zt[l]||Zt._default,p=c[0],f.innerHTML=c[1]+s+c[2];p--;)f=f.lastChild;if(!Y.support.tbody)for(d=Ut.test(s),h="table"!==l||d?""!==c[1]||d?[]:f.childNodes:f.firstChild&&f.firstChild.childNodes,a=h.length-1;a>=0;--a)Y.nodeName(h[a],"tbody")&&!h[a].childNodes.length&&h[a].parentNode.removeChild(h[a]);!Y.support.leadingWhitespace&&$t.test(s)&&f.insertBefore(n.createTextNode($t.exec(s)[0]),f.firstChild),s=f.childNodes,f.parentNode.removeChild(f)}else s=n.createTextNode(s);s.nodeType?b.push(s):Y.merge(b,s)}if(f&&(s=f=v=null),!Y.support.appendChecked)for(o=0;null!=(s=b[o]);o++)Y.nodeName(s,"input")?g(s):s.getElementsByTagName!==t&&Y.grep(s.getElementsByTagName("input"),g);if(r)for(m=function(e){return!e.type||Gt.test(e.type)?i?i.push(e.parentNode?e.parentNode.removeChild(e):e):r.appendChild(e):t},o=0;null!=(s=b[o]);o++)Y.nodeName(s,"script")&&m(s)||(r.appendChild(s),s.getElementsByTagName!==t&&(y=Y.grep(Y.merge([],s.getElementsByTagName("script")),m),b.splice.apply(b,[o+1,0].concat(y)),o+=y.length));return b},cleanData:function(e,t){for(var n,r,i,o,a=0,s=Y.expando,l=Y.cache,c=Y.support.deleteExpando,u=Y.event.special;null!=(i=e[a]);a++)if((t||Y.acceptData(i))&&(r=i[s],n=r&&l[r])){if(n.events)for(o in n.events)u[o]?Y.event.remove(i,o):Y.removeEvent(i,o,n.handle);l[r]&&(delete l[r],c?delete i[s]:i.removeAttribute?i.removeAttribute(s):i[s]=null,Y.deletedIds.push(r))}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(W.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,r){return r&&r instanceof Y&&!(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e($);return e}}();var nn,rn,on,an=/alpha\([^)]*\)/i,sn=/opacity=([^)]*)/,ln=/^(top|right|bottom|left)$/,cn=/^(none|table(?!-c[ea]).+)/,un=/^margin/,pn=RegExp("^("+Z+")(.*)$","i"),fn=RegExp("^("+Z+")(?!px)[a-z%]+$","i"),dn=RegExp("^([-+])=("+Z+")","i"),hn={BODY:"block"},gn={position:"absolute",visibility:"hidden",display:"block"},mn={letterSpacing:0,fontWeight:400},yn=["Top","Right","Bottom","Left"],vn=["Webkit","O","Moz","ms"],bn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e,t){var n="boolean"==typeof e;return Y.isFunction(e)&&Y.isFunction(t)?bn.apply(this,arguments):this.each(function(){(n?e:y(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=Y.camelCase(n),c=e.style;if(n=Y.cssProps[l]||(Y.cssProps[l]=m(c,l)),s=Y.cssHooks[n]||Y.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:c[n];if(a=typeof r,"string"===a&&(o=dn.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(Y.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||Y.cssNumber[l]||(r+="px"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{c[n]=r}catch(u){}}},css:function(e,n,r,i){var o,a,s,l=Y.camelCase(n);return n=Y.cssProps[l]||(Y.cssProps[l]=m(e.style,l)),s=Y.cssHooks[n]||Y.cssHooks[l],s&&"get"in s&&(o=s.get(e,!0,i)),o===t&&(o=nn(e,n)),"normal"===o&&n in mn&&(o=mn[n]),r||i!==t?(a=parseFloat(o),r||Y.isNumeric(a)?a||0:o):o},swap:function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=o[i];return r}}),e.getComputedStyle?nn=function(t,n){var r,i,o,a,s=e.getComputedStyle(t,null),l=t.style;return s&&(r=s.getPropertyValue(n)||s[n],""!==r||Y.contains(t.ownerDocument,t)||(r=Y.style(t,n)),fn.test(r)&&un.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),r}:$.documentElement.currentStyle&&(nn=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],o=e.style;return null==i&&o&&o[t]&&(i=o[t]),fn.test(i)&&!ln.test(t)&&(n=o.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),o.left="fontSize"===t?"1em":i,i=o.pixelLeft+"px",o.left=n,r&&(e.runtimeStyle.left=r)),""===i?"auto":i}),Y.each(["height","width"],function(e,n){Y.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&cn.test(nn(e,"display"))?Y.swap(e,gn,function(){return w(e,n,i)}):w(e,n,i):t},set:function(e,t,r){return b(e,t,r?x(e,n,r,Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing")):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return sn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=Y.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,t>=1&&""===Y.trim(o.replace(an,""))&&n.removeAttribute&&(n.removeAttribute("filter"),r&&!r.filter)||(n.filter=an.test(o)?o.replace(an,i):o+" "+i)}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,n){return Y.swap(e,{display:"inline-block"},function(){return n?nn(e,"marginRight"):t})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return fn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Y.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||nn(e,"display"))},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,i="string"==typeof n?n.split(" "):[n],o={};for(r=0;4>r;r++)o[e+yn[r]+t]=i[r]||i[r-2]||i[0];return o}},un.test(e)||(Y.cssHooks[e+t].set=b)});var xn=/%20/g,wn=/\[\]$/,Cn=/\r?\n/g,_n=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,kn=/^(?:select|textarea)/i; +Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||kn.test(this.nodeName)||_n.test(this.type))}).map(function(e,t){var n=Y(this).val();return null==n?null:Y.isArray(n)?Y.map(n,function(e){return{name:t.name,value:e.replace(Cn,"\r\n")}}):{name:t.name,value:n.replace(Cn,"\r\n")}}).get()}}),Y.param=function(e,n){var r,i=[],o=function(e,t){t=Y.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional),Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){o(this.name,this.value)});else for(r in e)_(r,e[r],n,o);return i.join("&").replace(xn,"+")};var An,Tn,En=/#.*$/,Fn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Sn=/^(?:GET|HEAD)$/,jn=/^\/\//,Rn=/\?/,On=/)<[^<]*)*<\/script>/gi,Mn=/([?&])_=[^&]*/,Hn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Pn=Y.fn.load,In={},Dn={},Ln=["*/"]+["*"];try{Tn=q.href}catch(Bn){Tn=$.createElement("a"),Tn.href="",Tn=Tn.href}An=Hn.exec(Tn.toLowerCase())||[],Y.fn.load=function(e,n,r){if("string"!=typeof e&&Pn)return Pn.apply(this,arguments);if(!this.length)return this;var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),Y.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(o="POST"),Y.ajax({url:e,type:o,dataType:"html",data:n,complete:function(e,t){r&&s.each(r,a||[e.responseText,t,e])}}).done(function(e){a=arguments,s.html(i?Y("
    ").append(e.replace(On,"")).find(i):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,i,o){return Y.isFunction(r)&&(o=o||i,i=r,r=t),Y.ajax({type:n,url:e,data:r,success:i,dataType:o})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?T(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),T(e,t),e},ajaxSettings:{url:Tn,isLocal:Nn.test(An[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ln},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:k(In),ajaxTransport:k(Dn),ajax:function(e,n){function r(e,n,r,a){var c,p,v,b,w,_=n;2!==x&&(x=2,l&&clearTimeout(l),s=t,o=a||"",C.readyState=e>0?4:0,r&&(b=E(f,C,r)),e>=200&&300>e||304===e?(f.ifModified&&(w=C.getResponseHeader("Last-Modified"),w&&(Y.lastModified[i]=w),w=C.getResponseHeader("Etag"),w&&(Y.etag[i]=w)),304===e?(_="notmodified",c=!0):(c=F(f,b),_=c.state,p=c.data,v=c.error,c=!v)):(v=_,(!_||e)&&(_="error",0>e&&(e=0))),C.status=e,C.statusText=(n||_)+"",c?g.resolveWith(d,[p,_,C]):g.rejectWith(d,[C,_,v]),C.statusCode(y),y=t,u&&h.trigger("ajax"+(c?"Success":"Error"),[C,f,c?p:v]),m.fireWith(d,[C,_]),u&&(h.trigger("ajaxComplete",[C,f]),--Y.active||Y.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,l,c,u,p,f=Y.ajaxSetup({},n),d=f.context||f,h=d!==f&&(d.nodeType||d instanceof Y)?Y(d):Y.event,g=Y.Deferred(),m=Y.Callbacks("once memory"),y=f.statusCode||{},v={},b={},x=0,w="canceled",C={readyState:0,setRequestHeader:function(e,t){if(!x){var n=e.toLowerCase();e=b[n]=b[n]||e,v[e]=t}return this},getAllResponseHeaders:function(){return 2===x?o:null},getResponseHeader:function(e){var n;if(2===x){if(!a)for(a={};n=Fn.exec(o);)a[n[1].toLowerCase()]=n[2];n=a[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return x||(f.mimeType=e),this},abort:function(e){return e=e||w,s&&s.abort(e),r(0,e),this}};if(g.promise(C),C.success=C.done,C.error=C.fail,C.complete=m.add,C.statusCode=function(e){if(e){var t;if(2>x)for(t in e)y[t]=[y[t],e[t]];else t=e[C.status],C.always(t)}return this},f.url=((e||f.url)+"").replace(En,"").replace(jn,An[1]+"//"),f.dataTypes=Y.trim(f.dataType||"*").toLowerCase().split(tt),null==f.crossDomain&&(c=Hn.exec(f.url.toLowerCase()),f.crossDomain=!(!c||c[1]===An[1]&&c[2]===An[2]&&(c[3]||("http:"===c[1]?80:443))==(An[3]||("http:"===An[1]?80:443)))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Y.param(f.data,f.traditional)),A(In,f,n,C),2===x)return C;if(u=f.global,f.type=f.type.toUpperCase(),f.hasContent=!Sn.test(f.type),u&&0===Y.active++&&Y.event.trigger("ajaxStart"),!f.hasContent&&(f.data&&(f.url+=(Rn.test(f.url)?"&":"?")+f.data,delete f.data),i=f.url,f.cache===!1)){var _=Y.now(),k=f.url.replace(Mn,"$1_="+_);f.url=k+(k===f.url?(Rn.test(f.url)?"&":"?")+"_="+_:"")}(f.data&&f.hasContent&&f.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),f.ifModified&&(i=i||f.url,Y.lastModified[i]&&C.setRequestHeader("If-Modified-Since",Y.lastModified[i]),Y.etag[i]&&C.setRequestHeader("If-None-Match",Y.etag[i])),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ln+"; q=0.01":""):f.accepts["*"]);for(p in f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(f.beforeSend.call(d,C,f)===!1||2===x))return C.abort();w="abort";for(p in{success:1,error:1,complete:1})C[p](f[p]);if(s=A(Dn,f,n,C)){C.readyState=1,u&&h.trigger("ajaxSend",[C,f]),f.async&&f.timeout>0&&(l=setTimeout(function(){C.abort("timeout")},f.timeout));try{x=1,s.send(v,r)}catch(T){if(!(2>x))throw T;r(-1,T)}}else r(-1,"No Transport");return C},active:0,lastModified:{},etag:{}});var $n=[],qn=/\?/,Wn=/(=)\?(?=&|$)|\?\?/,Un=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=$n.pop()||Y.expando+"_"+Un++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.data,c=n.url,u=n.jsonp!==!1,p=u&&Wn.test(c),f=u&&!p&&"string"==typeof l&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wn.test(l);return"jsonp"===n.dataTypes[0]||p||f?(o=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a=e[o],p?n.url=c.replace(Wn,"$1"+o):f?n.data=l.replace(Wn,"$1"+o):u&&(n.url+=(qn.test(c)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||Y.error(o+" was not called"),s[0]},n.dataTypes[0]="json",e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,$n.push(o)),s&&Y.isFunction(a)&&a(s[0]),s=a=t}),"script"):t}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=$.head||$.getElementsByTagName("head")[0]||$.documentElement;return{send:function(i,o){n=$.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){(i||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Qn,zn=e.ActiveXObject?function(){for(var e in Qn)Qn[e](0,1)}:!1,Xn=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&N()||S()}:N,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(c){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,c,u,p,f;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=Y.noop,zn&&delete Qn[a]),i)4!==l.readyState&&l.abort();else{s=l.status,u=l.getAllResponseHeaders(),p={},f=l.responseXML,f&&f.documentElement&&(p.xml=f);try{p.text=l.responseText}catch(d){}try{c=l.statusText}catch(d){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(h){i||o(-1,h)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r,0):(a=++Xn,zn&&(Qn||(Qn={},Y(e).unload(zn)),Qn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Jn,Vn,Kn=/^(?:toggle|show|hide)$/,Gn=RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Yn=/queueHooks$/,Zn=[H],er={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Gn.exec(t),a=i.cur(),s=+a||0,l=1,c=20;if(o){if(n=+o[2],r=o[3]||(Y.cssNumber[e]?"":"px"),"px"!==r&&s){s=Y.css(i.elem,e,!0)||n||1;do l=l||".5",s/=l,Y.style(i.elem,e,s+r);while(l!==(l=i.cur()/a)&&1!==l&&--c)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};Y.Animation=Y.extend(O,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],er[n]=er[n]||[],er[n].unshift(t)},prefilter:function(e,t){t?Zn.unshift(e):Zn.push(e)}}),Y.Tween=P,P.prototype={constructor:P,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(Y.cssNumber[n]?"":"px")},cur:function(){var e=P.propHooks[this.prop];return e&&e.get?e.get(this):P.propHooks._default.get(this)},run:function(e){var t,n=P.propHooks[this.prop];return this.pos=t=this.options.duration?Y.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):P.propHooks._default.set(this),this}},P.prototype.init.prototype=P.prototype,P.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Y.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Y.fx.step[e.prop]?Y.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Y.cssProps[e.prop]]||Y.cssHooks[e.prop])?Y.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},P.propHooks.scrollTop=P.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Y.each(["toggle","show","hide"],function(e,t){var n=Y.fn[t];Y.fn[t]=function(r,i,o){return null==r||"boolean"==typeof r||!e&&Y.isFunction(r)&&Y.isFunction(i)?n.apply(this,arguments):this.animate(I(t,!0),r,i,o)}}),Y.fn.extend({fadeTo:function(e,t,n,r){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=Y.isEmptyObject(e),o=Y.speed(t,n,r),a=function(){var t=O(this,Y.extend({},e),o);i&&t.stop(!0)};return i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=Y.timers,a=Y._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Yn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&Y.dequeue(this,e)})}}),Y.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Y.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Y.speed=function(e,t,n){var r=e&&"object"==typeof e?Y.extend({},e):{complete:n||!n&&t||Y.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Y.isFunction(t)&&t};return r.duration=Y.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Y.fx.speeds?Y.fx.speeds[r.duration]:Y.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Y.isFunction(r.old)&&r.old.call(this),r.queue&&Y.dequeue(this,r.queue)},r},Y.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Y.timers=[],Y.fx=P.prototype.init,Y.fx.tick=function(){var e,n=Y.timers,r=0;for(Jn=Y.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||Y.fx.stop(),Jn=t},Y.fx.timer=function(e){e()&&Y.timers.push(e)&&!Vn&&(Vn=setInterval(Y.fx.tick,Y.fx.interval))},Y.fx.interval=13,Y.fx.stop=function(){clearInterval(Vn),Vn=null},Y.fx.speeds={slow:600,fast:200,_default:400},Y.fx.step={},Y.expr&&Y.expr.filters&&(Y.expr.filters.animated=function(e){return Y.grep(Y.timers,function(t){return e===t.elem}).length});var tr=/^(?:body|html)$/i;Y.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Y.offset.setOffset(this,e,t)});var n,r,i,o,a,s,l,c={top:0,left:0},u=this[0],p=u&&u.ownerDocument;if(p)return(r=p.body)===u?Y.offset.bodyOffset(u):(n=p.documentElement,Y.contains(n,u)?(u.getBoundingClientRect!==t&&(c=u.getBoundingClientRect()),i=D(p),o=n.clientTop||r.clientTop||0,a=n.clientLeft||r.clientLeft||0,s=i.pageYOffset||n.scrollTop,l=i.pageXOffset||n.scrollLeft,{top:c.top+s-o,left:c.left+l-a}):c)},Y.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return Y.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Y.css(e,"marginTop"))||0,n+=parseFloat(Y.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=Y.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=Y(e),s=a.offset(),l=Y.css(e,"top"),c=Y.css(e,"left"),u=("absolute"===r||"fixed"===r)&&Y.inArray("auto",[l,c])>-1,p={},f={};u?(f=a.position(),i=f.top,o=f.left):(i=parseFloat(l)||0,o=parseFloat(c)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+i),null!=t.left&&(p.left=t.left-s.left+o),"using"in t?t.using.call(e,p):a.css(p)}},Y.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||$.body;e&&!tr.test(e.nodeName)&&"static"===Y.css(e,"position");)e=e.offsetParent;return e||$.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(i){return Y.access(this,function(e,i,o){var a=D(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?Y(a).scrollLeft():o,r?o:Y(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){Y.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return Y.access(this,function(n,r,i){var o;return Y.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?Y.css(n,r,i,s):Y.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=Y,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})}(window),/*! ========================================================= * bootstrap-modal.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= @@ -70,7 +70,7 @@ Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},seriali * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -function(e,t,n,r,i,o){function a(e,t){var n=typeof e[t];return"function"==n||!("object"!=n||!e[t])||"unknown"==n}function s(e,t){return!("object"!=typeof e[t]||!e[t])}function l(e){return"[object Array]"===Object.prototype.toString.call(e)}function c(){try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return F=Array.prototype.slice.call(e.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/),1),N=parseInt(F[0],10)>9&&parseInt(F[1],10)>0,e=null,!0}catch(t){return!1}}function u(){if(!U){U=!0;for(var e=0;Q.length>e;e++)Q[e]();Q.length=0}}function p(e,t){return U?(e.call(t),void 0):(Q.push(function(){e.call(t)}),void 0)}function f(){var e=parent;if(""!==D)for(var t=0,n=D.split(".");n.length>t;t++)e=e[n[t]];return e.easyXDM}function d(t){return e.easyXDM=B,D=t,D&&($="easyXDM_"+D.replace(".","_")+"_"),L}function h(e){return e.match(H)[3]}function g(e){return e.match(H)[4]||""}function m(e){var t=e.toLowerCase().match(H),n=t[2],r=t[3],i=t[4]||"";return("http:"==n&&":80"==i||"https:"==n&&":443"==i)&&(i=""),n+"//"+r+i}function y(e){if(e=e.replace(P,"$1/"),!e.match(/^(http||https):\/\//)){var t="/"===e.substring(0,1)?"":n.pathname;"/"!==t.substring(t.length-1)&&(t=t.substring(0,t.lastIndexOf("/")+1)),e=n.protocol+"//"+n.host+t+e}for(;I.test(e);)e=e.replace(I,"");return e}function v(e,t){var n="",r=e.indexOf("#");-1!==r&&(n=e.substring(r),e=e.substring(0,r));var i=[];for(var a in t)t.hasOwnProperty(a)&&i.push(a+"="+o(t[a]));return e+(q?"#":-1==e.indexOf("?")?"?":"&")+i.join("&")+n}function b(e){return e===void 0}function x(e,t,n){var r;for(var i in t)t.hasOwnProperty(i)&&(i in e?(r=t[i],"object"==typeof r?x(e[i],r,n):n||(e[i]=t[i])):e[i]=t[i]);return e}function w(){var e=t.body.appendChild(t.createElement("form")),n=e.appendChild(t.createElement("input"));n.name=$+"TEST"+O,E=n!==e.elements[n.name],t.body.removeChild(e)}function C(e){b(E)&&w();var n;E?n=t.createElement(' + +This javascript code will insert the example news app into the container's ``. Press *Result* in the jsfiddle above to try this demo. + +Note If more granular control is needed for app placement, use `F2.AppHandlers` functionality. Read about that in [AppHandlers for App Layout](#apphandlers-for-app-layout). + +#### Dynamic App Configuration + +As an alternative to static app configuration shown above, the `_appConfig` variable could be assigned the result of an API call to the [F2 Registry](index.html#the-store). The Registry API response is designed to match the structure of the `AppConfig` for passing the JSON straight through to F2 in your code. Whether your app configuration JSON comes from the F2 Registry or your own database is irrelevant; the process is identically the same as shown in this example. + + + +About this jsfiddle To simulate an ajax request, this example uses jsfiddle's [echo feature](http://doc.jsfiddle.net/use/echo.html). Simply replace the `getAppConfigs` function with your own ajax request and ignore the `echoData` variable. + +### Registering Pre-Loaded Apps + +Incorporating apps which have been pre-loaded or are otherwise already on the container when it loads is an alternative method to integrating F2 apps. This method is useful when the container is being constructed on the server-side (at run-time or on a schedule) and F2 functionality is desired. To use pre-loaded apps, the Container Developer is required to make a request to each apps' `AppManifest` and its dependencies _before_ the page is rendered. + +For the following example, let's assume you have a web page composed on the server and all of its HTML is delivered to the browser in one payload. This page also has at least one widget (or component) you'd like to register with F2.js. + +#### 1. Setup Container + +To use pre-loaded apps, a web page with a placeholder element for the apps is required. This simple (and empty) web page features a `div#news_app.span12` which serves as that placeholder. + +```html + + + F2 Container + + + +
    +
    +
    + +
    +
    +
    + + + +``` + +#### 2. Request AppManifest + +Next, make a server-side request to the news apps' `AppManifest`—the URL is found in `manifestUrl`—and capture the resulting JSON. Each `AppManifest` contains scripts, style sheets and HTML ([more about the `AppManifest`](app-development.html#app-manifest)). The market news apps' `AppManifest` looks like this: + +```javascript +{ + "apps":[{ + "data":{}, + "html": "
    ...
    ", + }], + "scripts":[ + "http://www.openf2.org/js/main.js" + ], + "styles":[ + "http://www.openf2.org/css/site.css" + ] +} +``` + +Note Parts of this `AppManifest` were intentionally removed for legibility, including the required JSONP function name (`F2_jsonpCallback_com_openf2_examples_csharp_marketnews`). The full `AppManifest` is [available on OpenF2.org](http://www.openf2.org/Examples/Apps?params=%5B%7B%22appId%22%3A%22com_openf2_examples_csharp_marketnews%22%7D%5D). + +
    +
    Performance Tip
    + Container Developers can use the `AppConfig` and pre-loaded `AppManifest` (from step 2 above) in conjunction with `F2.registerApps()` to speed up the loading of F2 containers. For more information, browse to [Combining AppConfig and AppManifest](#combining-appconfig-and-appmanifest). +
    + +#### 3. Add App to Container + +You're almost there. Next, embed the news app's `html`, `scripts` and `styles`. The F2 app is inserted into `.row > .span12` following [Bootstrap's scaffolding](http://twitter.github.io/bootstrap/scaffolding.html) guidelines. The `styles` were appended to the `head` and the `scripts` were appended to the `body` (in this case just one URL for each). + +```html + + + F2 Container + + + + +
    +
    +
    +
    ...
    +
    +
    +
    + + + + +``` + +The example news app is now part of the web page and everything should be functioning properly. The final step is to register the app with F2. + +#### 4. Assign Root Element to AppConfig + +To use pre-loaded apps, an additional property is required on the `AppConfig` object. It is called `root` and can be either a CSS selector string _or_ a DOM element. Regardless of type, F2 will parse the value of `root` and it must return an existing in-page DOM element. Furthermore, the value of `root` must represent a _unique_ DOM element as each app needs its own containing, or `root`, element. + +```javascript +var _appConfig = { + appId: 'com_openf2_examples_csharp_marketnews', + description: 'Example News', + manifestUrl: 'http://www.openf2.org/Examples/Apps', + name: 'Example News', + root: document.getElementById('news_app') +}; +``` + +Both of these are valid values for the `root` property. Using JavaScript: + +```javascript +{ + root: document.getElementById('news_app') +} +``` + +Using a CSS selector string: + +```javascript +{ + root: '#news_app' +} +``` + +F2.js uses jQuery internally to parse the value of the `root` property and, in turn, jQuery relies on the [Sizzle javascript selector library](http://sizzlejs.com/). If a CSS selector string is assigned to `root`, it must be a valid CSS 3 selector supported by Sizzle. Refer to the [Sizzle documentation for more details](https://github.com/jquery/sizzle/wiki/Sizzle-Documentation). + +#### 5. Register App + +Since you started with the `AppConfig` and now have the `AppManifest` from step 2 along with an HTML page containing the embedded app, all that remains is a simple call to F2. Registering pre-loaded apps with F2.js means passing the ammended `AppConfig` as shown in the example below. + +```javascript +var _appConfig = { + appId: 'com_openf2_examples_csharp_marketnews', + description: 'Example News', + manifestUrl: 'http://www.openf2.org/Examples/Apps', + name: 'Example News', + root: document.getElementById('news_app') +}; + +$(function(){ + F2.init(); + F2.registerApps(_appConfig); +}); +``` + +The web page and pre-loaded news app is a fully F2-enabled container. Rejoice! + +### Combining AppConfig and AppManifest + +Container Developers can use the `AppConfig` and pre-loaded `AppManifest` (from [step 2 above](#request-appmanifest)) in conjunction with `F2.registerApps()` to speed up the loading of F2 containers. The [`F2.registerApps()` API supports](./sdk/classes/F2.html#methods-registerApps) two arguments: `appConfigs` and `appManifests`. The former is an array of [`F2.AppConfig` objects](./sdk/classes/F2.AppConfig.html) and the latter is an array of [`F2.AppManifest` objects](./sdk/classes/F2.AppManifest.html). The `appManifests` array must be the same length as the `appConfigs` array that is used as the first argument. This can be useful if apps are loaded on the server-side and passed down to the client. + +In the following example, the `AppManifest` was pre-loaded and stored in the `_appManifest` variable. + +```javascript +var _appConfig = { + appId: 'com_openf2_examples_csharp_marketnews', + description: 'Example News', + manifestUrl: 'http://www.openf2.org/Examples/Apps', + name: 'Example News', + root: document.getElementById('news_app') +}; + +var _appManifest = { + "apps":[{ + "data":{}, + "html": "
    ...
    ", + }], + "scripts":[ + "http://www.openf2.org/js/main.js" + ], + "styles":[ + "http://www.openf2.org/css/site.css" + ] +}; + +$(function(){ + F2.init(); + F2.registerApps(_appConfig,_appManifest); +}); +``` + +Important The `F2.registerApps()` API supports both an array of objects and object literals for each argument. Internally, F2.js converts the value of each argument into an array using concatenation (`[].concat()`). If arrays of objects are used (when there are more than one app on the container), the `_appConfig` and `_appManifest` arrays must be of equal length, and the object at each index must be a parallel reference. This means the `AppConfig` and `AppManifest` for the sample news app used above must be in `_appConfig[0]` and `_appManifest[0]`. + +* * * * + +## AppHandlers for App Layout + +New functionality called `F2.AppHandlers` was added in F2 1.2. The conversation about this collection of features occurred in [#38](https://github.com/OpenF2/F2/issues/38) on GitHub. The new `AppHandlers` functionality provides Container Developers a higher level of control over configuring app rendering and interaction. + +

    +The addition of `F2.AppHandlers` replaces the previous `ContainerConfig` properties `beforeAppRender`, `appRender`, and `afterAppRender`. These methods were deprecated in version 1.2. +

    + +

    +Starting with F2 version 1.2, `AppHandlers` is the preferred method for Container Developers to manage app layout. +

    + +The `AppHandlers` functionality provides an event-based system for Container Developers' programs. The addition of a collection of constants in `F2.Constants.AppHandlers` shows the primitive set of event types (or hooks) available to developers, including hooks such as `appCreateRoot`, `appRenderAfter`, `appDestroyAfter` and more. (Review the complete `F2.Constants.AppHandlers` collection in [the F2.js SDK documentation](./sdk/classes/F2.Constants.AppHandlers.html).) + +Using `AppHandlers` is as simple as attaching an event handler function to be executed at the appropriate time as determined by the order of operations in F2. There are three functions available on `F2.AppHandlers`: `getToken`, `on`, and `off`. + +### AppHandler Tokens + +A new feature has been added to F2 as part of `AppHandlers`: the event token. The token is designed to be used only by Container Developers to ensure the `AppHandlers` functions are only called by their programs, and aren't accessible to App Developers' code. Container Developers should create a variable for this token in their JavaScript and encapsulate it inside a closure. + +```javascript +(function(){ + var token = F2.AppHandlers.getToken(); + console.log(token); + //outputs a GUID like 'ce2e7aae-04fa-96a3-edd7-be67e99937b4' +}); +``` + +Important The `getToken()` function can only be called one-time. It self-destructs to protect the token for Container Developers and therefore Container Developers must call `F2.AppHandlers.getToken()` before any F2 apps are registered with the container. + +### Default App Layout + +In the unlikely event a Container Developer wishes to append all apps to the `` element, no configuration is required. Simply add this code to the container: + +```javascript +F2.init(); +F2.registerApps(appConfig); +``` + +Appending apps to the `` is the default app rendering behavior of F2. + +### Custom App Layout + +F2 `AppHandlers` provide event handlers for customized app layout using `F2.AppHandlers.on()` and `F2.AppHandlers.off()`. The use of `on` and `off` require both a [token](#apphandler-tokens) and an event type. The event types, defined as constants in `F2.Constants.AppHandlers`, are: + +* `appCreateRoot` +* `appDestroy` +* `appDestroyAfter` +* `appDestroyBefore` +* `appRender` +* `appRenderAfter` +* `appRenderBefore` + +Review the complete `F2.Constants.AppHandlers` collection in [the F2.js SDK documentation](./sdk/classes/F2.Constants.AppHandlers.html). + + +#### Creating an App Root + +The process of creating an app root involves establishing a DOM element for F2 apps to be inserted into within the container. This `AppHandler` function is called `appCreateRoot` and referred to by its constant variable: `F2.Constants.AppHandlers.APP_CREATE_ROOT`. + + +The app root becomes the `root` property in the `AppConfig` (as ) * * * * @@ -626,215 +852,6 @@ Said another way, while `{ symbol:"AAPL", name: "Apple, Inc" }` can be used to c * * * * -## App Integration - -There are two ways of integrating apps on a container: [requesting apps on-demand](#requesting-apps-on-demand) (via HTTP) or by [linking pre-loaded apps](#registering-pre-loaded-apps). Requesting apps on-demand when the container loads is the traditional way of integrating apps with F2. Incorporating apps which have been pre-fetched or are otherwise already on the container when it loads is an alternative method. The following sections describe both of these methods in detail. - -The process of loading apps on a container occurs by using a method called `F2.registerApps()`. The Container Developer must call [this method](./sdk/classes/F2.html)—which accepts two arguments, one required, one optional— after `F2.init()` is called. If this method isn't called, no apps can be loaded on the container. - -The two arguments provided to `registerApps()` are an array of `AppConfig` objects and, optionally, an array of `AppManifest` objects. As F2.js parses each `AppConfig`, the apps are validated, hydrated with some additional properties, and saved in browser memory on the container. - -Regardless of where the container's `AppConfig` object is defined (hard-coded or via API), integrating apps is a simple process. - -Note Not familiar with the `AppConfig`? [Read up on them](#app-configs) before continuing. - -### Requesting Apps On-Demand - -Requesting apps on-demand when the container loads is the traditional way of integrating apps with F2. For the purposes of this example, we will use an example news app from [OpenF2.org](http://www.openf2.org/Examples). - -Let's look at some container code. - -#### Static App Configuration - -First, we define the `AppConfig` in a _hard-coded_ `_appConfig` variable. This example demonstrates only a single app; if there were multiple apps, `_appConfig` would be an array of objects versus an object literal. Secondly, when the document is ready, `F2.init()` is called and subsequently `F2.registerApps()` with the single argument. - - - -This javascript code will insert the example news app into the container's ``. Press *Result* in the jsfiddle above to try this demo. - -Note If more granular control is needed for app placement, use the `beforeAppRender`, `appRender` and `afterAppRender` methods. Read about those functions in [Container Config](#container-config). - -#### Dynamic App Configuration - -As an alternative to static app configuration shown above, the `_appConfig` variable could be assigned the result of an API call to the [F2 Registry](index.html#the-store). The Registry API response is designed to match the structure of the `AppConfig` for passing the JSON straight through to F2 in your code. Whether your app configuration JSON comes from the F2 Registry or your own database is irrelevant; the process is identically the same as shown in this example. - - - -About this jsfiddle To simulate an ajax request, this example uses jsfiddle's [echo feature](http://doc.jsfiddle.net/use/echo.html). Simply replace the `getAppConfigs` function with your own ajax request and ignore the `echoData` variable. - -### Registering Pre-Loaded Apps - -Incorporating apps which have been pre-loaded or are otherwise already on the container when it loads is an alternative method to integrating F2 apps. This method is useful when the container is being constructed on the server-side (at run-time or on a schedule) and F2 functionality is desired. To use pre-loaded apps, the Container Developer is required to make a request to each apps' `AppManifest` and its dependencies _before_ the page is rendered. - -For the following example, let's assume you have a web page composed on the server and all of its HTML is delivered to the browser in one payload. This page also has at least one widget (or component) you'd like to register with F2.js. - -#### 1. Setup Container - -To use pre-loaded apps, a web page with a placeholder element for the apps is required. This simple (and empty) web page features a `div#news_app.span12` which serves as that placeholder. - -```html - - - F2 Container - - - -
    -
    -
    - -
    -
    -
    - - - -``` - -#### 2. Request AppManifest - -Next, make a server-side request to the news apps' `AppManifest`—the URL is found in `manifestUrl`—and capture the resulting JSON. Each `AppManifest` contains scripts, style sheets and HTML ([more about the `AppManifest`](app-development.html#app-manifest)). The market news apps' `AppManifest` looks like this: - -```javascript -{ - "apps":[{ - "data":{}, - "html": "
    ...
    ", - }], - "scripts":[ - "http://www.openf2.org/js/main.js" - ], - "styles":[ - "http://www.openf2.org/css/site.css" - ] -} -``` - -Note Parts of this `AppManifest` were intentionally removed for legibility, including the required JSONP function name (`F2_jsonpCallback_com_openf2_examples_csharp_marketnews`). The full `AppManifest` is [available on OpenF2.org](http://www.openf2.org/Examples/Apps?params=%5B%7B%22appId%22%3A%22com_openf2_examples_csharp_marketnews%22%7D%5D). - -
    -
    Performance Tip
    - Container Developers can use the `AppConfig` and pre-loaded `AppManifest` (from step 2 above) in conjunction with `F2.registerApps()` to speed up the loading of F2 containers. For more information, browse to [Combining AppConfig and AppManifest](#combining-appconfig-and-appmanifest). -
    - -#### 3. Add App to Container - -You're almost there. Next, embed the news app's `html`, `scripts` and `styles`. The F2 app is inserted into `.row > .span12` following [Bootstrap's scaffolding](http://twitter.github.io/bootstrap/scaffolding.html) guidelines. The `styles` were appended to the `head` and the `scripts` were appended to the `body` (in this case just one URL for each). - -```html - - - F2 Container - - - - -
    -
    -
    -
    ...
    -
    -
    -
    - - - - -``` - -The example news app is now part of the web page and everything should be functioning properly. The final step is to register the app with F2. - -#### 4. Assign Root Element to AppConfig - -To use pre-loaded apps, an additional property is required on the `AppConfig` object. It is called `root` and can be either a CSS selector string _or_ a DOM element. Regardless of type, F2 will parse the value of `root` and it must return an existing in-page DOM element. Furthermore, the value of `root` must represent a _unique_ DOM element as each app needs its own containing, or `root`, element. - -```javascript -var _appConfig = { - appId: 'com_openf2_examples_csharp_marketnews', - description: 'Example News', - manifestUrl: 'http://www.openf2.org/Examples/Apps', - name: 'Example News', - root: document.getElementById('news_app') -}; -``` - -Both of these are valid values for the `root` property. Using JavaScript: - -```javascript -{ - root: document.getElementById('news_app') -} -``` - -Using a CSS selector string: - -```javascript -{ - root: '#news_app' -} -``` - -F2.js uses jQuery internally to parse the value of the `root` property and, in turn, jQuery relies on the [Sizzle javascript selector library](http://sizzlejs.com/). If a CSS selector string is assigned to `root`, it must be a valid CSS 3 selector supported by Sizzle. Refer to the [Sizzle documentation for more details](https://github.com/jquery/sizzle/wiki/Sizzle-Documentation). - -#### 5. Register App - -Since you started with the `AppConfig` and now have the `AppManifest` from step 2 along with an HTML page containing the embedded app, all that remains is a simple call to F2. Registering pre-loaded apps with F2.js means passing the ammended `AppConfig` as shown in the example below. - -```javascript -var _appConfig = { - appId: 'com_openf2_examples_csharp_marketnews', - description: 'Example News', - manifestUrl: 'http://www.openf2.org/Examples/Apps', - name: 'Example News', - root: document.getElementById('news_app') -}; - -$(function(){ - F2.init(); - F2.registerApps(_appConfig); -}); -``` - -The web page and pre-loaded news app is a fully F2-enabled container. Rejoice! - -### Combining AppConfig and AppManifest - -Container Developers can use the `AppConfig` and pre-loaded `AppManifest` (from [step 2 above](#request-appmanifest)) in conjunction with `F2.registerApps()` to speed up the loading of F2 containers. The [`F2.registerApps()` API supports](./sdk/classes/F2.html#methods-registerApps) two arguments: `appConfigs` and `appManifests`. The former is an array of [`F2.AppConfig` objects](./sdk/classes/F2.AppConfig.html) and the latter is an array of [`F2.AppManifest` objects](./sdk/classes/F2.AppManifest.html). The `appManifests` array must be the same length as the `appConfigs` array that is used as the first argument. This can be useful if apps are loaded on the server-side and passed down to the client. - -In the following example, the `AppManifest` was pre-loaded and stored in the `_appManifest` variable. - -```javascript -var _appConfig = { - appId: 'com_openf2_examples_csharp_marketnews', - description: 'Example News', - manifestUrl: 'http://www.openf2.org/Examples/Apps', - name: 'Example News', - root: document.getElementById('news_app') -}; - -var _appManifest = { - "apps":[{ - "data":{}, - "html": "
    ...
    ", - }], - "scripts":[ - "http://www.openf2.org/js/main.js" - ], - "styles":[ - "http://www.openf2.org/css/site.css" - ] -}; - -$(function(){ - F2.init(); - F2.registerApps(_appConfig,_appManifest); -}); -``` - -Important The `F2.registerApps()` API supports both an array of objects and object literals for each argument. Internally, F2.js converts the value of each argument into an array using concatenation (`[].concat()`). If arrays of objects are used (when there are more than one app on the container), the `_appConfig` and `_appManifest` arrays must be of equal length, and the object at each index must be a parallel reference. This means the `AppConfig` and `AppManifest` for the sample news app used above must be in `_appConfig[0]` and `_appManifest[0]`. - -* * * * - ## Secure Apps Security is a fundamental requirement of any F2 container and many F2 apps. With that in mind, the integration of secure apps on a container requires more attention and effort. The process of [app integration](#app-integration) remains largely the same for integrating _secure_ apps with one significant addition: a _second_ container. diff --git a/examples/container/js/container-app-handlers.js b/examples/container/js/container-app-handlers.js index bce0dec8..3084ca25 100644 --- a/examples/container/js/container-app-handlers.js +++ b/examples/container/js/container-app-handlers.js @@ -1,7 +1,84 @@ $(function() { var containerAppHandlerToken = F2.AppHandlers.getToken(); - + + var appCreateRootFunc = function(appConfig) { + var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, appConfig.views); + var hasHelp = F2.inArray(F2.Constants.Views.HELP, appConfig.views); + var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, appConfig.views); + var showDivider = hasSettings || hasHelp || hasAbout; + var gridWidth = appConfig.minGridSize || 3; + + appConfig.root = $([ + '
    ', + '
    ', + '

    ', appConfig.name.toUpperCase(), '

    ', + '
    ', + '', + '', + '
    ', + '
    ', + '
    ' + ].join('')).get(0); + }; + + var appRenderFunc = function(appConfig, app) { + + var gridWidth = appConfig.minGridSize || 3; + + // find a row that can fit this app + var row; + $('#mainContent div.row').each(function(i, el) { + var span = 0; + $('.f2-app', el).each(function(j, app) { + span += Number($(app).data('gridWidth')); + }); + if (span <= (12 - gridWidth)) { + row = el; + return false; + } + }); + // create a new row if one wasn't found + if (row === undefined) { + row = $('
    ').appendTo('#mainContent'); + } + // append app to app root and also to row + $(appConfig.root).append(app).appendTo(row); + }; + + var appRenderCompleteFunc = function(appConfig) { + F2.UI.hideMask(appConfig.instanceId, appConfig.root); + }; + + var appDestroyFunc = function(appInstance) { + if(!appInstance) { return; } + + // call the apps destroy method, if it has one + if(appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function'){ + appInstance.app.destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been called + else if(appInstance.app && appInstance.app.destroy){ + F2.log(appInstance.appId + ' has a Destroy property, but Destroy is not of type function and as such will not be executed.'); + } + + // fade out and remove the root + jQuery(appInstance.config.root).fadeOut(250, function() { + jQuery(this).remove(); + }); + }; + /** + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ + /** * Init Container */ @@ -15,105 +92,23 @@ $(function() { secureAppPagePath: 'secure.html' // this should go on a separate domain from index.html }); - // Define these prior to init + // Define these prior to calling F2.registerApps + /* F2.AppHandlers - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_CREATE_ROOT, - function(appConfig) { - var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, appConfig.views); - var hasHelp = F2.inArray(F2.Constants.Views.HELP, appConfig.views); - var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, appConfig.views); - var showDivider = hasSettings || hasHelp || hasAbout; - var gridWidth = appConfig.minGridSize || 3; - - appConfig.root = $([ - '
    ', - '
    ', - '

    ', appConfig.name.toUpperCase(), '

    ', - '
    ', - '', - '', - '
    ', - '
    ', - '
    ' - ].join('')).get(0); - } - ) - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_RENDER, - function(appConfig, app) { - - var gridWidth = appConfig.minGridSize || 3; - - // find a row that can fit this app - var row; - $('#mainContent div.row').each(function(i, el) { - var span = 0; - $('.f2-app', el).each(function(j, app) { - span += Number($(app).data('gridWidth')); - }); - if (span <= (12 - gridWidth)) { - row = el; - return false; - } - }); - // create a new row if one wasn't found - if (row === undefined) { - row = $('
    ').appendTo('#mainContent'); - } - // append app to app root and also to row - $(appConfig.root).append(app).appendTo(row); - } - ) - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_RENDER_AFTER, - function(appConfig) { - F2.UI.hideMask(appConfig.instanceId, appConfig.root); - } - ) - .on( - containerAppHandlerToken, - F2.Constants.AppHandlers.APP_DESTROY, - function(appInstance) { - if(!appInstance) { return; } - - // call the apps destroy method, if it has one - if(appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') - { - appInstance.app.destroy(); - } - // warn the container developer/app developer that even though they have a destroy method it hasn't been - else if(appInstance.app && appInstance.app.destroy) - { - F2.log(appInstance.appId + ' has a Destroy property, but Destroy is not of type function and as such will not be executed.'); - } - - // fade out and remove the root - jQuery(appInstance.config.root).fadeOut(250, function() { - jQuery(this).remove(); - }); - } - ); - + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_CREATE_ROOT, appCreateRootFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER, appRenderFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER_AFTER, appRenderCompleteFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_DESTROY, appDestroyFunc) + ;*/ //listen for app symbol change events and re-broadcast - F2.Events.on( - F2.Constants.Events.APP_SYMBOL_CHANGE, - function(data) { - F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: data.symbol, name: data.name || '' }); - } - ); + F2.Events.on(F2.Constants.Events.APP_SYMBOL_CHANGE,function(data) { + F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: data.symbol, name: data.name || '' }); + }); + + /** + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ /** * init symbol lookup in navbar From 0955c2b6cfe1b1f44857dc4b9d253db796f88d8e Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Mon, 3 Jun 2013 08:48:35 -0600 Subject: [PATCH 151/181] Updates to fix complete "Update sdk documentation to explain what is passed to the listeners. For example, when binding to F2.Constants.AppHandlers.APP_RENDER, it looks like an appConfig and maybe a string of html that represents the app" and "List the order in which the events are executed. This should either be done in the sdk or the spec and linked to each other" from 1.2-wip pull request #69 --- sdk/src/app_handlers.js | 310 ++++++++++++++++++++++++++++++---------- 1 file changed, 233 insertions(+), 77 deletions(-) diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index 195eaba2..7a9f03e1 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -1,7 +1,25 @@ /** - * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.3 this is the preferred method - * for choosing how app rendering/interaction happens. This replaces the config versions of beforeAppRender, appRender, and afterAppRender. It also - * adds hooks into an app being removed/destroyed. As F2 evolves more hooks will be added to aid in container development. + * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.2 this is the preferred method + * for choosing how app rendering/interaction happens. This replaces the properties {{#crossLink "F2.ContainerConfig/beforeAppRender"}}{{/crossLink}}, + * {{#crossLink "F2.ContainerConfig/appRender"}}{{/crossLink}}, and {{#crossLink "F2.ContainerConfig/afterAppRender"}}{{/crossLink}} methods in {{#crossLink "F2.ContainerConfig"}}{{/crossLink}}. It also + * adds hooks into an app instance being removed from the container. + * + * **App Rendering** + * + * 0. {{#crossLink "F2/registerApps"}}F2.registerApps(){{/crossLink}} method is called by the container developer and the following methods are run for *each* {{#crossLink "F2.AppConfig"}}{{/crossLink}} passed. + * 1. **'appCreateRoot'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_CREATE\_ROOT*) handlers are fired in the order they were bound/added. + * 2. **'appRenderBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_BEFORE*) handlers are fired in the order they were bound/added. + * 3. Each app is requested asynchronously via manifest url, on success the following methods are fired. + * 3. **'appRender'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER*) handlers are fired in the order they were bound/added. + * 4. **'appRenderAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_AFTER*) handlers are fired in the order they were bound/added. + * + * + * **App Removal** + + * 0. {{#crossLink "F2/removeApp"}}F2.removeApp(){{/crossLink}} with a specific {{#crossLink "F2.AppConfig/instanceId "}}{{/crossLink}} or {{#crossLink "F2/removeAllApps"}}F2.removeAllApps(){{/crossLink}} method is called by the container developer and the following methods are run. + * 1. **'appDestroyBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_BEFORE*) handlers are fired in the order they were bound/added. + * 2. **'appDestroy'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY*) handlers are fired in the order they were bound/added. + * 3. **'appDestroyAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_AFTER*) handlers are fired in the order they were bound/added. * @class F2.AppHandlers */ F2.extend('AppHandlers', (function() { @@ -21,14 +39,14 @@ F2.extend('AppHandlers', (function() { }; var _defaultMethods = { - appRender: function(appConfig, html) + appRender: function(appConfig, appHtml) { var $root = null; // if no app root is defined use the apps outter most node if(!F2.isNativeDOMNode(appConfig.root)) { - appConfig.root = jQuery(html).get(0); + appConfig.root = jQuery(appHtml).get(0); // get a handle on the root in jQuery $root = jQuery(appConfig.root); } @@ -38,7 +56,7 @@ F2.extend('AppHandlers', (function() { $root = jQuery(appConfig.root); // append the app html to the root - $root.append(html); + $root.append(appHtml); } // append the root to the body by default. @@ -256,21 +274,47 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container')); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container')); + * var sToken = F2.AppHandlers.getToken(); + * + * F2.AppHandlers.on( + * sToken, + * 'appRender', + * document.getElementById('my_container') + * ); + * + * // or + * + * F2.AppHandlers.on( + * sToken, + * 'appRender.myNamespace', + * document.getElementById('my_container') + * ); **/ /** - * Allows you to add listener method that will be triggered when a specific event happens. + * Allows you to add listener method that will be triggered when a specific event occurs. * @method on * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. - * @params {Function} listener A function that will be triggered when a specific event happens. + * @params {Function} listener A function that will be triggered when a specific event occurs. For detailed argument definition refer to {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); }); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); }); + * var sToken = F2.AppHandlers.getToken(); + * + * F2.AppHandlers.on( + * sToken, + * 'appRenderBefore' + * function() { F2.log('before app rendered!'); + * }); + * + * // or + * + * F2.AppHandlers.on( + * sToken, + * 'appRenderBefore.myNamespace', + * function() { F2.log('before app rendered!'); + * }); **/ on: function(token, eventKey, func_or_element) { @@ -316,7 +360,10 @@ F2.extend('AppHandlers', (function() { * listeners for the specified event type will be removed. * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @example - * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + * F2.AppHandlers.off( + * F2.AppHandlers.getToken(), + * 'appRenderBefore' + * ); **/ off: function(token, eventKey) { @@ -353,72 +400,181 @@ F2.extend('AppHandlers', (function() { }; })()); -/** - * A convenient collection of all available appHandler events. - * @class F2.Constants.AppHandlers - */ F2.extend('Constants', { /** - * A collection of constants for the on/off method names in F2.AppHandlers. - * @property {Object} AppHandlers - **/ - AppHandlers: + * A convenient collection of all available appHandler events. + * @class F2.Constants.AppHandlers + */ + AppHandlers: function() { - /** - * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). - * @property APP_CREATE_ROOT - * @type string - * @static - * @final - */ - APP_CREATE_ROOT: 'appCreateRoot', - /** - * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER_BEFORE - * @type string - * @static - * @final - */ - APP_RENDER_BEFORE: 'appRenderBefore', - /** - * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER - * @type string - * @static - * @final - */ - APP_RENDER: 'appRender', - /** - * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER_AFTER - * @type string - * @static - * @final - */ - APP_RENDER_AFTER: 'appRenderAfter', - /** - * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY_BEFORE - * @type string - * @static - * @final - */ - APP_DESTROY_BEFORE: 'appDestroyBefore', - /** - * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY - * @type string - * @static - * @final - */ - APP_DESTROY: 'appDestroy', - /** - * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY_AFTER - * @type string - * @static - * @final - */ - APP_DESTROY_AFTER: 'appDestroyAfter' + return { + /** + * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_CREATE_ROOT + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_CREATE_ROOT, + * function(appConfig) + * { + * // If you want to create a custom root. By default F2 uses the app's outter most HTML element. + * // the app's html is not available until after the manifest is retrieved so this logic occurse in F2.Constants.AppHandlers.APP_RENDER + * appConfig.root = jQuery('
    ').get(0); + * } + * ); + */ + APP_CREATE_ROOT: 'appCreateRoot', + /** + * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_RENDER_BEFORE + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER_BEFORE, + * function(appConfig) + * { + * F2.log(appConfig); + * } + * ); + */ + APP_RENDER_BEFORE: 'appRenderBefore', + /** + * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}}, [appHtml](../../app-development.html#app-design) ) + * @property APP_RENDER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER, + * function(appConfig, appHtml) + * { + * var $root = null; + * + * // if no app root is defined use the apps outter most node + * if(!F2.isNativeDOMNode(appConfig.root)) + * { + * appConfig.root = jQuery(appHtml).get(0); + * // get a handle on the root in jQuery + * $root = jQuery(appConfig.root); + * } + * else + * { + * // get a handle on the root in jQuery + * $root = jQuery(appConfig.root); + * + * // append the app html to the root + * $root.append(appHtml); + * } + * + * // append the root to the body by default. + * jQuery('body').append($root); + * } + * ); + */ + APP_RENDER: 'appRender', + /** + * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_RENDER_AFTER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER_AFTER, + * function(appConfig) + * { + * F2.log(appConfig); + * } + * ); + */ + APP_RENDER_AFTER: 'appRenderAfter', + /** + * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY_BEFORE + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + * function(appInstance) + * { + * F2.log(appInstance); + * } + * ); + */ + APP_DESTROY_BEFORE: 'appDestroyBefore', + /** + * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY, + * function(appInstance) + * { + * // call the apps destroy method, if it has one + * if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') + * { + * appInstance.app.destroy(); + * } + * else if(appInstance && appInstance.app && appInstance.app.destroy) + * { + * F2.log(appInstance.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); + * } + * + * // fade out and remove the root + * jQuery(appInstance.config.root).fadeOut(500, function() { + * jQuery(this).remove(); + * }); + * } + * ); + */ + APP_DESTROY: 'appDestroy', + /** + * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY_AFTER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY_AFTER, + * function(appInstance) + * { + * F2.log(appInstance); + * } + * ); + */ + APP_DESTROY_AFTER: 'appDestroyAfter' + } } }); \ No newline at end of file From 594ade096fe7584e1c601e919b4b1f8ac335a049 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Mon, 3 Jun 2013 11:15:57 -0600 Subject: [PATCH 152/181] Fixed additional jshint items. Rebuild js. --- sdk/f2.debug.js | 308 +++++++++++++++++++++++++++++---------- sdk/f2.min.js | 2 +- sdk/f2.min.map | 2 +- sdk/f2.no-third-party.js | 308 +++++++++++++++++++++++++++++---------- sdk/src/app_handlers.js | 288 ++++++++++++++++++------------------ 5 files changed, 610 insertions(+), 298 deletions(-) diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 32fd2aaf..118497d0 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -13632,9 +13632,27 @@ F2 = (function() { })(); /** - * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.3 this is the preferred method - * for choosing how app rendering/interaction happens. This replaces the config versions of beforeAppRender, appRender, and afterAppRender. It also - * adds hooks into an app being removed/destroyed. As F2 evolves more hooks will be added to aid in container development. + * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.2 this is the preferred method + * for choosing how app rendering/interaction happens. This replaces the properties {{#crossLink "F2.ContainerConfig/beforeAppRender"}}{{/crossLink}}, + * {{#crossLink "F2.ContainerConfig/appRender"}}{{/crossLink}}, and {{#crossLink "F2.ContainerConfig/afterAppRender"}}{{/crossLink}} methods in {{#crossLink "F2.ContainerConfig"}}{{/crossLink}}. It also + * adds hooks into an app instance being removed from the container. + * + * **App Rendering** + * + * 0. {{#crossLink "F2/registerApps"}}F2.registerApps(){{/crossLink}} method is called by the container developer and the following methods are run for *each* {{#crossLink "F2.AppConfig"}}{{/crossLink}} passed. + * 1. **'appCreateRoot'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_CREATE\_ROOT*) handlers are fired in the order they were bound/added. + * 2. **'appRenderBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_BEFORE*) handlers are fired in the order they were bound/added. + * 3. Each app is requested asynchronously via manifest url, on success the following methods are fired. + * 3. **'appRender'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER*) handlers are fired in the order they were bound/added. + * 4. **'appRenderAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_AFTER*) handlers are fired in the order they were bound/added. + * + * + * **App Removal** + + * 0. {{#crossLink "F2/removeApp"}}F2.removeApp(){{/crossLink}} with a specific {{#crossLink "F2.AppConfig/instanceId "}}{{/crossLink}} or {{#crossLink "F2/removeAllApps"}}F2.removeAllApps(){{/crossLink}} method is called by the container developer and the following methods are run. + * 1. **'appDestroyBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_BEFORE*) handlers are fired in the order they were bound/added. + * 2. **'appDestroy'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY*) handlers are fired in the order they were bound/added. + * 3. **'appDestroyAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_AFTER*) handlers are fired in the order they were bound/added. * @class F2.AppHandlers */ F2.extend('AppHandlers', (function() { @@ -13654,14 +13672,14 @@ F2.extend('AppHandlers', (function() { }; var _defaultMethods = { - appRender: function(appConfig, html) + appRender: function(appConfig, appHtml) { var $root = null; // if no app root is defined use the apps outter most node if(!F2.isNativeDOMNode(appConfig.root)) { - appConfig.root = jQuery(html).get(0); + appConfig.root = jQuery(appHtml).get(0); // get a handle on the root in jQuery $root = jQuery(appConfig.root); } @@ -13671,7 +13689,7 @@ F2.extend('AppHandlers', (function() { $root = jQuery(appConfig.root); // append the app html to the root - $root.append(html); + $root.append(appHtml); } // append the root to the body by default. @@ -13889,21 +13907,47 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container')); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container')); + * var sToken = F2.AppHandlers.getToken(); + * + * F2.AppHandlers.on( + * sToken, + * 'appRender', + * document.getElementById('my_container') + * ); + * + * // or + * + * F2.AppHandlers.on( + * sToken, + * 'appRender.myNamespace', + * document.getElementById('my_container') + * ); **/ /** - * Allows you to add listener method that will be triggered when a specific event happens. + * Allows you to add listener method that will be triggered when a specific event occurs. * @method on * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. - * @params {Function} listener A function that will be triggered when a specific event happens. + * @params {Function} listener A function that will be triggered when a specific event occurs. For detailed argument definition refer to {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); }); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); }); + * var sToken = F2.AppHandlers.getToken(); + * + * F2.AppHandlers.on( + * sToken, + * 'appRenderBefore' + * function() { F2.log('before app rendered!'); + * }); + * + * // or + * + * F2.AppHandlers.on( + * sToken, + * 'appRenderBefore.myNamespace', + * function() { F2.log('before app rendered!'); + * }); **/ on: function(token, eventKey, func_or_element) { @@ -13949,7 +13993,10 @@ F2.extend('AppHandlers', (function() { * listeners for the specified event type will be removed. * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @example - * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + * F2.AppHandlers.off( + * F2.AppHandlers.getToken(), + * 'appRenderBefore' + * ); **/ off: function(token, eventKey) { @@ -13986,73 +14033,182 @@ F2.extend('AppHandlers', (function() { }; })()); -/** - * A convenient collection of all available appHandler events. - * @class F2.Constants.AppHandlers - */ F2.extend('Constants', { /** - * A collection of constants for the on/off method names in F2.AppHandlers. - * @property {Object} AppHandlers + * A convenient collection of all available appHandler events. + * @class F2.Constants.AppHandlers **/ - AppHandlers: + AppHandlers: function() { - /** - * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). - * @property APP_CREATE_ROOT - * @type string - * @static - * @final - */ - APP_CREATE_ROOT: 'appCreateRoot', - /** - * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER_BEFORE - * @type string - * @static - * @final - */ - APP_RENDER_BEFORE: 'appRenderBefore', - /** - * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER - * @type string - * @static - * @final - */ - APP_RENDER: 'appRender', - /** - * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER_AFTER - * @type string - * @static - * @final - */ - APP_RENDER_AFTER: 'appRenderAfter', - /** - * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY_BEFORE - * @type string - * @static - * @final - */ - APP_DESTROY_BEFORE: 'appDestroyBefore', - /** - * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY - * @type string - * @static - * @final - */ - APP_DESTROY: 'appDestroy', - /** - * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY_AFTER - * @type string - * @static - * @final - */ - APP_DESTROY_AFTER: 'appDestroyAfter' + return { + /** + * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_CREATE_ROOT + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_CREATE_ROOT, + * function(appConfig) + * { + * // If you want to create a custom root. By default F2 uses the app's outter most HTML element. + * // the app's html is not available until after the manifest is retrieved so this logic occurse in F2.Constants.AppHandlers.APP_RENDER + * appConfig.root = jQuery('
    ').get(0); + * } + * ); + */ + APP_CREATE_ROOT: 'appCreateRoot', + /** + * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_RENDER_BEFORE + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER_BEFORE, + * function(appConfig) + * { + * F2.log(appConfig); + * } + * ); + */ + APP_RENDER_BEFORE: 'appRenderBefore', + /** + * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}}, [appHtml](../../app-development.html#app-design) ) + * @property APP_RENDER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER, + * function(appConfig, appHtml) + * { + * var $root = null; + * + * // if no app root is defined use the apps outter most node + * if(!F2.isNativeDOMNode(appConfig.root)) + * { + * appConfig.root = jQuery(appHtml).get(0); + * // get a handle on the root in jQuery + * $root = jQuery(appConfig.root); + * } + * else + * { + * // get a handle on the root in jQuery + * $root = jQuery(appConfig.root); + * + * // append the app html to the root + * $root.append(appHtml); + * } + * + * // append the root to the body by default. + * jQuery('body').append($root); + * } + * ); + */ + APP_RENDER: 'appRender', + /** + * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_RENDER_AFTER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER_AFTER, + * function(appConfig) + * { + * F2.log(appConfig); + * } + * ); + */ + APP_RENDER_AFTER: 'appRenderAfter', + /** + * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY_BEFORE + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + * function(appInstance) + * { + * F2.log(appInstance); + * } + * ); + */ + APP_DESTROY_BEFORE: 'appDestroyBefore', + /** + * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY, + * function(appInstance) + * { + * // call the apps destroy method, if it has one + * if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') + * { + * appInstance.app.destroy(); + * } + * else if(appInstance && appInstance.app && appInstance.app.destroy) + * { + * F2.log(appInstance.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); + * } + * + * // fade out and remove the root + * jQuery(appInstance.config.root).fadeOut(500, function() { + * jQuery(this).remove(); + * }); + * } + * ); + */ + APP_DESTROY: 'appDestroy', + /** + * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY_AFTER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY_AFTER, + * function(appInstance) + * { + * F2.log(appInstance); + * } + * ); + */ + APP_DESTROY_AFTER: 'appDestroyAfter' + }; } }); /** diff --git a/sdk/f2.min.js b/sdk/f2.min.js index d1992732..64c7330b 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -116,5 +116,5 @@ function(a,b,c,d,e,f){function g(a,b){var c=typeof a[b];return"function"==c||!(" * in the terms and conditions related to the specific Third Party Material, if any. * */ -var F2;F2=function(){var a=function(a,c){function d(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}return c=b(c||""),a=b(a||""),c&&a?(c.protocol||a.protocol)+(c.protocol||c.authority?c.authority:a.authority)+d(c.protocol||c.authority||"/"===c.pathname.charAt(0)?c.pathname:c.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+c.pathname:a.pathname)+(c.protocol||c.authority||c.pathname?c.search:c.search||a.search)+c.hash:null},b=function(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null};return{appConfigReplacer:function(a,b){return"root"==a||"ui"==a||"height"==a?void 0:b},Apps:{},extend:function(a,b,c){var d="function"==typeof b,e=a?a.split("."):[],f=this;b=b||{},"F2"===e[0]&&(e=e.slice(1));for(var g=0,h=e.length;h>g;g++)f[e[g]]||(f[e[g]]=d&&g+1==h?b:{}),f=f[e[g]];if(!d)for(var i in b)("undefined"==typeof f[i]||c)&&(f[i]=b[i]);return f},guid:function(){var a=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},inArray:function(a,b){return jQuery.inArray(a,b)>-1},isLocalRequest:function(b){var c,d,e=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,f=b.toLowerCase(),g=e.exec(f);try{c=location.href}catch(h){c=document.createElement("a"),c.href="",c=c.href}c=c.toLowerCase(),g||(f=a(c,f).toLowerCase(),g=e.exec(f)),d=e.exec(c)||[];var i=!(g&&(g[1]!==d[1]||g[2]!==d[2]||(g[3]||("http:"===g[1]?"80":"443"))!==(d[3]||("http:"===d[1]?"80":"443"))));return i},isNativeDOMNode:function(a){var b="object"==typeof Node?a instanceof Node:a&&"object"==typeof a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName,c="object"==typeof HTMLElement?a instanceof HTMLElement:a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName;return b||c},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(a){return JSON.parse(a)},stringify:function(a,b,c){return JSON.stringify(a,b,c)},version:function(){return"{{sdk.version}}"}}}(),F2.extend("AppHandlers",function(){var a=F2.guid(),b=F2.guid(),c={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},d={appRender:function(a,b){var c=null;F2.isNativeDOMNode(a.root)?(c=jQuery(a.root),c.append(b)):(a.root=jQuery(b).get(0),c=jQuery(a.root)),jQuery("body").append(c)},appDestroy:function(a){a&&a.app&&a.app.destroy&&"function"==typeof a.app.destroy?a.app.destroy():a&&a.app&&a.app.destroy&&F2.log(a.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(a.config.root).fadeOut(500,function(){jQuery(this).remove()})}},e=function(a,b,c,d){f(a);var e={func:c,namespace:b,domNode:F2.isNativeDOMNode(c)?c:null};if(!e.func&&!e.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(e.domNode&&!d)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return e},f=function(c){if(a!=c&&b!=c)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},g=function(a,b,d){if(f(a),d||b)if(!d&&b)c[b]=[];else if(d&&!b){d=d.toLowerCase();for(var e in c){for(var g=c[e],h=[],i=0,j=g.length;j>i;i++){var k=g[i];k&&(k.namespace&&k.namespace.toLowerCase()==d||h.push(k))}g=h}}else if(d&&c[b]){d=d.toLowerCase();for(var l=[],m=0,n=c[b].length;n>m;m++){var o=c[b][m];o&&(o.namespace&&o.namespace.toLowerCase()==d||l.push(o))}c[b]=l}};return{getToken:function(){return delete this.getToken,a},__f2GetToken:function(){return delete this.__f2GetToken,b},__trigger:function(a,e){if(a!=b)throw"Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().";if(!c||!c[e])throw"Invalid EventKey passed. Check your inputs and try again.";for(var f=[],g=2,h=arguments.length;h>g;g++)f.push(arguments[g]);if(0===c[e].length&&d[e])return d[e].apply(F2,f),this;if(0===c[e].length&&!c[e])return this;for(var i=0,j=c[e].length;j>i;i++){var k=c[e][i];if(k.domNode&&arguments[2]&&arguments[2].root&&arguments[3]){var l=jQuery(arguments[2].root).append(arguments[3]);jQuery(k.domNode).append(l)}else k.func.apply(F2,f)}return this},on:function(a,b,d){var f=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var g=b.split(".");b=g[0],f=g[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return c[b].push(e(a,f,d,"appRender"==b)),this},off:function(a,b){var d=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var e=b.split(".");b=e[0],d=e[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return g(a,b,d),this}}}()),F2.extend("Constants",{AppHandlers:{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}),F2.extend("",{App:function(){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:void 0,ui:void 0,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(){},appRender:function(){},beforeAppRender:function(){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},xhr:{dataType:function(){},type:function(){},url:function(){}}}}),F2.extend("Constants",{Css:function(){var a="f2-";return{APP:a+"app",APP_CONTAINER:a+"app-container",APP_TITLE:a+"app-title",APP_VIEW:a+"app-view",APP_VIEW_TRIGGER:a+"app-view-trigger",MASK:a+"mask",MASK_CONTAINER:a+"mask-container"}}(),Events:function(){var a="App.",b="Container.";return{APP_SYMBOL_CHANGE:a+"symbolChange",APP_WIDTH_CHANGE:a+"widthChange.",CONTAINER_SYMBOL_CHANGE:b+"symbolChange",CONTAINER_WIDTH_CHANGE:b+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}),F2.extend("Events",function(){var a=new EventEmitter2({wildcard:!0});return a.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},many:function(b,c,d){return a.many(b,c,d)},off:function(b,c){return a.off(b,c)},on:function(b,c){return a.on(b,c)},once:function(b,c){return a.once(b,c)}}}()),F2.extend("Rpc",function(){var a={},b="",c={},d=new RegExp("^"+F2.Constants.Sockets.EVENT),e=new RegExp("^"+F2.Constants.Sockets.RPC),f=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),g=new RegExp("^"+F2.Constants.Sockets.LOAD),h=new RegExp("^"+F2.Constants.Sockets.UI_RPC),i=function(){var a,b=!1,d=[],e=new easyXDM.Socket({onMessage:function(f,h){if(!b&&g.test(f)){f=f.replace(g,"");var i=F2.parse(f);2==i.length&&(a=i[0],c[a.instanceId]={config:a,socket:e},F2.registerApps([a],[i[1]]),jQuery.each(d,function(){l(a,f,h)}),b=!0)}else b?l(a,f,h):d.push(f)}})},j=function(a,c){var d=jQuery(a.root);if(d.is("."+F2.Constants.Css.APP_CONTAINER)||d.find("."+F2.Constants.Css.APP_CONTAINER),!d.length)return F2.log("Unable to locate app in order to establish secure connection."),void 0;var e={scrolling:"no",style:{width:"100%"}};a.height&&(e.style.height=a.height+"px");var f=new easyXDM.Socket({remote:b,container:d.get(0),props:e,onMessage:function(b,c){l(a,b,c)},onReady:function(){f.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([a,c],F2.appConfigReplacer))}});return f},k=function(a,b){return function(){F2.Rpc.call(a,F2.Constants.Sockets.RPC_CALLBACK,b,[].slice.call(arguments).slice(2))}},l=function(b,c){function g(a,b){for(var c=String(b).split("."),d=0;d','",'",'","
    "].join("")},c=function(a){return['"].join("")};return{alert:function(c,d){return F2.isInit()?(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(a(c)).on("show",function(){var a=this;jQuery(a).find(".btn-primary").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.alert()"),void 0)},confirm:function(a,d,e){return F2.isInit()?(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(c(a)).on("show",function(){var a=this;jQuery(a).find(".btn-ok").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()}),jQuery(a).find(".btn-cancel").on("click",function(){jQuery(a).modal("hide").remove(),(e||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.confirm()"),void 0)}}}(),setTitle:function(a){F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[a]):jQuery(b.root).find("."+F2.Constants.Css.APP_TITLE).text(a)},showMask:function(a,c){F2.UI.showMask(b.instanceId,a,c)},updateHeight:d,Views:function(){var a=new EventEmitter2,e=/change/i;a.setMaxListeners(0);var f=function(a){return e.test(a)?!0:(F2.log('"'+a+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(e){"function"==typeof e?this.on("change",e):"string"==typeof e&&(b.isSecure&&!F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(e,b.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,c).addClass("hide").filter('[data-f2-view="'+e+'"]',c).removeClass("hide"),d(),a.emit("change",e)))},off:function(b,c){f(b)&&a.off(b,c)},on:function(b,c){f(b)&&a.on(b,c)}}}()}};return b.hideMask=function(a,b){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.hideMask()"),void 0;if(F2.Rpc.isRemote(a)&&!jQuery(b).is("."+F2.Constants.Css.APP))F2.Rpc.call(a,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[a,jQuery(b).selector]);else{var c=jQuery(b);c.find("> ."+F2.Constants.Css.MASK).remove(),c.removeClass(F2.Constants.Css.MASK_CONTAINER),c.data(F2.Constants.Css.MASK_CONTAINER)&&c.css({position:"static"})}},b.init=function(b){a=b,a.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,a.UI||{})},b.showMask=function(b,c,d){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.showMask()"),void 0;if(F2.Rpc.isRemote(b)&&jQuery(c).is("."+F2.Constants.Css.APP))F2.Rpc.call(b,F2.Constants.Sockets.RPC,"F2.UI.showMask",[b,jQuery(c).selector,d]);else{d&&!a.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var e=jQuery(c).addClass(F2.Constants.Css.MASK_CONTAINER),f=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);a.UI.Mask.useClasses||f.css({"background-color":a.UI.Mask.backgroundColor,"background-image":a.UI.Mask.loadingIcon?"url("+a.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":a.UI.Mask.zIndex,filter:"alpha(opacity="+100*a.UI.Mask.opacity+")",opacity:a.UI.Mask.opacity}),"static"===e.css("position")&&(e.css({position:"relative"}),e.data(F2.Constants.Css.MASK_CONTAINER,!0)),e.append(f)}},b}()),F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(a,b){var c=_config.afterAppRender||function(a,b){return jQuery(b).appendTo("body")},d=c(a,b);return _config.afterAppRender&&!d?(F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app"),void 0):(jQuery(d).addClass(F2.Constants.Css.APP),d.get(0))},_appRender=function(a,b){return b=_outerHtml(jQuery(b).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)),_config.appRender&&(b=_config.appRender(a,b)),_outerHtml(b)},_beforeAppRender=function(a){var b=_config.beforeAppRender||jQuery.noop;return b(a)},_hydrateAppConfig=function(a){a.instanceId=a.instanceId||F2.guid(),a.views=a.views||[],F2.inArray(F2.Constants.Views.HOME,a.views)||a.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(a){jQuery(a.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(b){b.preventDefault();var c=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();c==F2.Constants.Views.REMOVE?F2.removeApp(a.instanceId):a.ui.Views.change(c)})},_initContainerEvents=function(){var a,b=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(a),a=setTimeout(b,100)})},_isInit=function(){return!!_config},_createAppInstance=function(a,b){a.ui=new F2.UI(a),void 0!==F2.Apps[a.appId]&&("function"==typeof F2.Apps[a.appId]?setTimeout(function(){_apps[a.instanceId].app=new F2.Apps[a.appId](a,b,a.root),void 0!==_apps[a.instanceId].app.init&&_apps[a.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+a.appId+")"))},_loadApps=function(appConfigs,appManifest){if(appConfigs=[].concat(appConfigs),1==appConfigs.length&&appConfigs[0].isSecure&&!_config.isSecureAppPage)return _loadSecureApp(appConfigs[0],appManifest),void 0;if(appConfigs.length!=appManifest.apps.length)return F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest),void 0;var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(a,b){_createAppInstance(b,appManifest.apps[a])})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(a,b){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(a,b){if(_bUsesAppHandlers){if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[a],_outerHtml(b.html)),!appConfigs[a].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var c=jQuery(appConfigs[a].root);if(0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[a]),!F2.isNativeDOMNode(appConfigs[a].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";c.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[a].appId)}else appConfigs[a].root=_afterAppRender(appConfigs[a],_appRender(appConfigs[a],b.html));_initAppEvents(appConfigs[a])}),jQuery.each(scripts,function(a,b){jQuery.ajax({url:b,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(a,c,d){F2.log(["Failed to load script ("+b+")",d.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(a,b){if(_config.secureAppPagePath){if(_bUsesAppHandlers){var c=jQuery(a.root);if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,a,b.html),0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,a),!a.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(a.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(a.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)}else a.root=_afterAppRender(a,_appRender(a,"
    "));a.ui=new F2.UI(a),_initAppEvents(a),F2.Rpc.register(a,b)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_outerHtml=function(a){return jQuery("
    ").append(a).html()},_validateApp=function(a){return a.appId?a.root||a.manifestUrl?!0:(F2.log('"manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)},_validateContainerConfig=function(){if(_config&&_config.xhr){if("function"!=typeof _config.xhr&&"object"!=typeof _config.xhr)throw"ContainerConfig.xhr should be a function or an object";if(_config.xhr.dataType&&"function"!=typeof _config.xhr.dataType)throw"ContainerConfig.xhr.dataType should be a function";if(_config.xhr.type&&"function"!=typeof _config.xhr.type)throw"ContainerConfig.xhr.type should be a function";if(_config.xhr.url&&"function"!=typeof _config.xhr.url)throw"ContainerConfig.xhr.url should be a function"}return!0};return{getContainerState:function(){return _isInit()?jQuery.map(_apps,function(a){return{appId:a.config.appId}}):(F2.log("F2.init() must be called before F2.getContainerState()"),void 0)},init:function(a){_config=a||{},_validateContainerConfig(),_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(a,b){if(!_isInit())return F2.log("F2.init() must be called before F2.registerApps()"),void 0;if(!a)return F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0;var c=[],d={},e={},f=!1;return a=[].concat(a),b=[].concat(b||[]),f=!!b.length,a.length?a.length&&f&&a.length!=b.length?(F2.log('The length of "apps" does not equal the length of "appManifests"'),void 0):(jQuery.each(a,function(a,e){if(_hydrateAppConfig(e),e.root=e.root||null,_validateApp(e)){if(_apps[e.instanceId]={config:e},e.root){if(!e.root&&"string"!=typeof e.root&&!F2.isNativeDOMNode(e.root))throw F2.log("AppConfig invalid for pre-load, not a valid string and not dom node"),F2.log("AppConfig instance:",e),"Preloaded appConfig.root property must be a native dom node or a string representing a sizzle selector. Please check your inputs and try again.";if(1!=jQuery(e.root).length)throw F2.log("AppConfig invalid for pre-load, root not unique"),F2.log("AppConfig instance:",e),F2.log("Number of dom node instances:",jQuery(e.root).length),"Preloaded appConfig.root property must map to a unique dom node. Please check your inputs and try again.";return _createAppInstance(e),_initAppEvents(e),void 0}_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,e),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,e)):e.root=_beforeAppRender(e),f?_loadApps(e,b[a]):e.enableBatchRequests&&!e.isSecure?(d[e.manifestUrl.toLowerCase()]=d[e.manifestUrl.toLowerCase()]||[],d[e.manifestUrl.toLowerCase()].push(e)):c.push({apps:[e],url:e.manifestUrl})}}),f||(jQuery.each(d,function(a,b){c.push({url:a,apps:b})}),jQuery.each(c,function(a,b){var c=F2.Constants.JSONP_CALLBACK+b.apps[0].appId;e[c]=e[c]||[],e[c].push(b)}),jQuery.each(e,function(a,b){var c=function(d,e){if(e){var f=e.url,g="GET",h="jsonp",i=function(){c(a,b.pop())},j=function(){jQuery.each(e.apps,function(a,b){F2.log("Removed failed "+b.name+" app",b),F2.removeApp(b.instanceId)})},k=function(a){_loadApps(e.apps,a)};if(_config.xhr&&_config.xhr.dataType&&(h=_config.xhr.dataType(e.url,e.apps),"string"!=typeof h))throw"ContainerConfig.xhr.dataType should return a string";if(_config.xhr&&_config.xhr.type&&(g=_config.xhr.type(e.url,e.apps),"string"!=typeof g))throw"ContainerConfig.xhr.type should return a string";if(_config.xhr&&_config.xhr.url&&(f=_config.xhr.url(e.url,e.apps),"string"!=typeof f))throw"ContainerConfig.xhr.url should return a string";var l=_config.xhr;"function"!=typeof l&&(l=function(a,b,c,f,i){jQuery.ajax({url:a,type:g,data:{params:F2.stringify(e.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:d,dataType:h,success:c,error:function(a,b,c){F2.log("Failed to load app(s)",c.toString(),e.apps),f()},complete:i})}),l(f,e.apps,k,j,i)}};c(a,b.pop())})),void 0):(F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0)},removeAllApps:function(){return _isInit()?(jQuery.each(_apps,function(a,b){F2.removeApp(b.config.instanceId)}),void 0):(F2.log("F2.init() must be called before F2.removeAllApps()"),void 0)},removeApp:function(a){return _isInit()?(_apps[a]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[a]),delete _apps[a]),void 0):(F2.log("F2.init() must be called before F2.removeApp()"),void 0)}}}()),exports.F2=F2,"undefined"!=typeof define&&define.amd&&define(function(){return F2})}}("undefined"!=typeof exports?exports:window); +var F2;F2=function(){var a=function(a,c){function d(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}return c=b(c||""),a=b(a||""),c&&a?(c.protocol||a.protocol)+(c.protocol||c.authority?c.authority:a.authority)+d(c.protocol||c.authority||"/"===c.pathname.charAt(0)?c.pathname:c.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+c.pathname:a.pathname)+(c.protocol||c.authority||c.pathname?c.search:c.search||a.search)+c.hash:null},b=function(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null};return{appConfigReplacer:function(a,b){return"root"==a||"ui"==a||"height"==a?void 0:b},Apps:{},extend:function(a,b,c){var d="function"==typeof b,e=a?a.split("."):[],f=this;b=b||{},"F2"===e[0]&&(e=e.slice(1));for(var g=0,h=e.length;h>g;g++)f[e[g]]||(f[e[g]]=d&&g+1==h?b:{}),f=f[e[g]];if(!d)for(var i in b)("undefined"==typeof f[i]||c)&&(f[i]=b[i]);return f},guid:function(){var a=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},inArray:function(a,b){return jQuery.inArray(a,b)>-1},isLocalRequest:function(b){var c,d,e=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,f=b.toLowerCase(),g=e.exec(f);try{c=location.href}catch(h){c=document.createElement("a"),c.href="",c=c.href}c=c.toLowerCase(),g||(f=a(c,f).toLowerCase(),g=e.exec(f)),d=e.exec(c)||[];var i=!(g&&(g[1]!==d[1]||g[2]!==d[2]||(g[3]||("http:"===g[1]?"80":"443"))!==(d[3]||("http:"===d[1]?"80":"443"))));return i},isNativeDOMNode:function(a){var b="object"==typeof Node?a instanceof Node:a&&"object"==typeof a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName,c="object"==typeof HTMLElement?a instanceof HTMLElement:a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName;return b||c},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(a){return JSON.parse(a)},stringify:function(a,b,c){return JSON.stringify(a,b,c)},version:function(){return"{{sdk.version}}"}}}(),F2.extend("AppHandlers",function(){var a=F2.guid(),b=F2.guid(),c={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},d={appRender:function(a,b){var c=null;F2.isNativeDOMNode(a.root)?(c=jQuery(a.root),c.append(b)):(a.root=jQuery(b).get(0),c=jQuery(a.root)),jQuery("body").append(c)},appDestroy:function(a){a&&a.app&&a.app.destroy&&"function"==typeof a.app.destroy?a.app.destroy():a&&a.app&&a.app.destroy&&F2.log(a.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(a.config.root).fadeOut(500,function(){jQuery(this).remove()})}},e=function(a,b,c,d){f(a);var e={func:c,namespace:b,domNode:F2.isNativeDOMNode(c)?c:null};if(!e.func&&!e.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(e.domNode&&!d)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return e},f=function(c){if(a!=c&&b!=c)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},g=function(a,b,d){if(f(a),d||b)if(!d&&b)c[b]=[];else if(d&&!b){d=d.toLowerCase();for(var e in c){for(var g=c[e],h=[],i=0,j=g.length;j>i;i++){var k=g[i];k&&(k.namespace&&k.namespace.toLowerCase()==d||h.push(k))}g=h}}else if(d&&c[b]){d=d.toLowerCase();for(var l=[],m=0,n=c[b].length;n>m;m++){var o=c[b][m];o&&(o.namespace&&o.namespace.toLowerCase()==d||l.push(o))}c[b]=l}};return{getToken:function(){return delete this.getToken,a},__f2GetToken:function(){return delete this.__f2GetToken,b},__trigger:function(a,e){if(a!=b)throw"Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().";if(!c||!c[e])throw"Invalid EventKey passed. Check your inputs and try again.";for(var f=[],g=2,h=arguments.length;h>g;g++)f.push(arguments[g]);if(0===c[e].length&&d[e])return d[e].apply(F2,f),this;if(0===c[e].length&&!c[e])return this;for(var i=0,j=c[e].length;j>i;i++){var k=c[e][i];if(k.domNode&&arguments[2]&&arguments[2].root&&arguments[3]){var l=jQuery(arguments[2].root).append(arguments[3]);jQuery(k.domNode).append(l)}else k.func.apply(F2,f)}return this},on:function(a,b,d){var f=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var g=b.split(".");b=g[0],f=g[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return c[b].push(e(a,f,d,"appRender"==b)),this},off:function(a,b){var d=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var e=b.split(".");b=e[0],d=e[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return g(a,b,d),this}}}()),F2.extend("Constants",{AppHandlers:function(){return{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}),F2.extend("",{App:function(){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:void 0,ui:void 0,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(){},appRender:function(){},beforeAppRender:function(){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},xhr:{dataType:function(){},type:function(){},url:function(){}}}}),F2.extend("Constants",{Css:function(){var a="f2-";return{APP:a+"app",APP_CONTAINER:a+"app-container",APP_TITLE:a+"app-title",APP_VIEW:a+"app-view",APP_VIEW_TRIGGER:a+"app-view-trigger",MASK:a+"mask",MASK_CONTAINER:a+"mask-container"}}(),Events:function(){var a="App.",b="Container.";return{APP_SYMBOL_CHANGE:a+"symbolChange",APP_WIDTH_CHANGE:a+"widthChange.",CONTAINER_SYMBOL_CHANGE:b+"symbolChange",CONTAINER_WIDTH_CHANGE:b+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}),F2.extend("Events",function(){var a=new EventEmitter2({wildcard:!0});return a.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},many:function(b,c,d){return a.many(b,c,d)},off:function(b,c){return a.off(b,c)},on:function(b,c){return a.on(b,c)},once:function(b,c){return a.once(b,c)}}}()),F2.extend("Rpc",function(){var a={},b="",c={},d=new RegExp("^"+F2.Constants.Sockets.EVENT),e=new RegExp("^"+F2.Constants.Sockets.RPC),f=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),g=new RegExp("^"+F2.Constants.Sockets.LOAD),h=new RegExp("^"+F2.Constants.Sockets.UI_RPC),i=function(){var a,b=!1,d=[],e=new easyXDM.Socket({onMessage:function(f,h){if(!b&&g.test(f)){f=f.replace(g,"");var i=F2.parse(f);2==i.length&&(a=i[0],c[a.instanceId]={config:a,socket:e},F2.registerApps([a],[i[1]]),jQuery.each(d,function(){l(a,f,h)}),b=!0)}else b?l(a,f,h):d.push(f)}})},j=function(a,c){var d=jQuery(a.root);if(d.is("."+F2.Constants.Css.APP_CONTAINER)||d.find("."+F2.Constants.Css.APP_CONTAINER),!d.length)return F2.log("Unable to locate app in order to establish secure connection."),void 0;var e={scrolling:"no",style:{width:"100%"}};a.height&&(e.style.height=a.height+"px");var f=new easyXDM.Socket({remote:b,container:d.get(0),props:e,onMessage:function(b,c){l(a,b,c)},onReady:function(){f.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([a,c],F2.appConfigReplacer))}});return f},k=function(a,b){return function(){F2.Rpc.call(a,F2.Constants.Sockets.RPC_CALLBACK,b,[].slice.call(arguments).slice(2))}},l=function(b,c){function g(a,b){for(var c=String(b).split("."),d=0;d','",'",'","
    "].join("")},c=function(a){return['"].join("")};return{alert:function(c,d){return F2.isInit()?(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(a(c)).on("show",function(){var a=this;jQuery(a).find(".btn-primary").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.alert()"),void 0)},confirm:function(a,d,e){return F2.isInit()?(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(c(a)).on("show",function(){var a=this;jQuery(a).find(".btn-ok").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()}),jQuery(a).find(".btn-cancel").on("click",function(){jQuery(a).modal("hide").remove(),(e||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.confirm()"),void 0)}}}(),setTitle:function(a){F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[a]):jQuery(b.root).find("."+F2.Constants.Css.APP_TITLE).text(a)},showMask:function(a,c){F2.UI.showMask(b.instanceId,a,c)},updateHeight:d,Views:function(){var a=new EventEmitter2,e=/change/i;a.setMaxListeners(0);var f=function(a){return e.test(a)?!0:(F2.log('"'+a+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(e){"function"==typeof e?this.on("change",e):"string"==typeof e&&(b.isSecure&&!F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(e,b.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,c).addClass("hide").filter('[data-f2-view="'+e+'"]',c).removeClass("hide"),d(),a.emit("change",e)))},off:function(b,c){f(b)&&a.off(b,c)},on:function(b,c){f(b)&&a.on(b,c)}}}()}};return b.hideMask=function(a,b){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.hideMask()"),void 0;if(F2.Rpc.isRemote(a)&&!jQuery(b).is("."+F2.Constants.Css.APP))F2.Rpc.call(a,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[a,jQuery(b).selector]);else{var c=jQuery(b);c.find("> ."+F2.Constants.Css.MASK).remove(),c.removeClass(F2.Constants.Css.MASK_CONTAINER),c.data(F2.Constants.Css.MASK_CONTAINER)&&c.css({position:"static"})}},b.init=function(b){a=b,a.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,a.UI||{})},b.showMask=function(b,c,d){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.showMask()"),void 0;if(F2.Rpc.isRemote(b)&&jQuery(c).is("."+F2.Constants.Css.APP))F2.Rpc.call(b,F2.Constants.Sockets.RPC,"F2.UI.showMask",[b,jQuery(c).selector,d]);else{d&&!a.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var e=jQuery(c).addClass(F2.Constants.Css.MASK_CONTAINER),f=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);a.UI.Mask.useClasses||f.css({"background-color":a.UI.Mask.backgroundColor,"background-image":a.UI.Mask.loadingIcon?"url("+a.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":a.UI.Mask.zIndex,filter:"alpha(opacity="+100*a.UI.Mask.opacity+")",opacity:a.UI.Mask.opacity}),"static"===e.css("position")&&(e.css({position:"relative"}),e.data(F2.Constants.Css.MASK_CONTAINER,!0)),e.append(f)}},b}()),F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(a,b){var c=_config.afterAppRender||function(a,b){return jQuery(b).appendTo("body")},d=c(a,b);return _config.afterAppRender&&!d?(F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app"),void 0):(jQuery(d).addClass(F2.Constants.Css.APP),d.get(0))},_appRender=function(a,b){return b=_outerHtml(jQuery(b).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)),_config.appRender&&(b=_config.appRender(a,b)),_outerHtml(b)},_beforeAppRender=function(a){var b=_config.beforeAppRender||jQuery.noop;return b(a)},_hydrateAppConfig=function(a){a.instanceId=a.instanceId||F2.guid(),a.views=a.views||[],F2.inArray(F2.Constants.Views.HOME,a.views)||a.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(a){jQuery(a.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(b){b.preventDefault();var c=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();c==F2.Constants.Views.REMOVE?F2.removeApp(a.instanceId):a.ui.Views.change(c)})},_initContainerEvents=function(){var a,b=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(a),a=setTimeout(b,100)})},_isInit=function(){return!!_config},_createAppInstance=function(a,b){a.ui=new F2.UI(a),void 0!==F2.Apps[a.appId]&&("function"==typeof F2.Apps[a.appId]?setTimeout(function(){_apps[a.instanceId].app=new F2.Apps[a.appId](a,b,a.root),void 0!==_apps[a.instanceId].app.init&&_apps[a.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+a.appId+")"))},_loadApps=function(appConfigs,appManifest){if(appConfigs=[].concat(appConfigs),1==appConfigs.length&&appConfigs[0].isSecure&&!_config.isSecureAppPage)return _loadSecureApp(appConfigs[0],appManifest),void 0;if(appConfigs.length!=appManifest.apps.length)return F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest),void 0;var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(a,b){_createAppInstance(b,appManifest.apps[a])})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(a,b){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(a,b){if(_bUsesAppHandlers){if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[a],_outerHtml(b.html)),!appConfigs[a].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var c=jQuery(appConfigs[a].root);if(0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[a]),!F2.isNativeDOMNode(appConfigs[a].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";c.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[a].appId)}else appConfigs[a].root=_afterAppRender(appConfigs[a],_appRender(appConfigs[a],b.html));_initAppEvents(appConfigs[a])}),jQuery.each(scripts,function(a,b){jQuery.ajax({url:b,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(a,c,d){F2.log(["Failed to load script ("+b+")",d.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(a,b){if(_config.secureAppPagePath){if(_bUsesAppHandlers){var c=jQuery(a.root);if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,a,b.html),0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,a),!a.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(a.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(a.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)}else a.root=_afterAppRender(a,_appRender(a,"
    "));a.ui=new F2.UI(a),_initAppEvents(a),F2.Rpc.register(a,b)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_outerHtml=function(a){return jQuery("
    ").append(a).html()},_validateApp=function(a){return a.appId?a.root||a.manifestUrl?!0:(F2.log('"manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)},_validateContainerConfig=function(){if(_config&&_config.xhr){if("function"!=typeof _config.xhr&&"object"!=typeof _config.xhr)throw"ContainerConfig.xhr should be a function or an object";if(_config.xhr.dataType&&"function"!=typeof _config.xhr.dataType)throw"ContainerConfig.xhr.dataType should be a function";if(_config.xhr.type&&"function"!=typeof _config.xhr.type)throw"ContainerConfig.xhr.type should be a function";if(_config.xhr.url&&"function"!=typeof _config.xhr.url)throw"ContainerConfig.xhr.url should be a function"}return!0};return{getContainerState:function(){return _isInit()?jQuery.map(_apps,function(a){return{appId:a.config.appId}}):(F2.log("F2.init() must be called before F2.getContainerState()"),void 0)},init:function(a){_config=a||{},_validateContainerConfig(),_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(a,b){if(!_isInit())return F2.log("F2.init() must be called before F2.registerApps()"),void 0;if(!a)return F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0;var c=[],d={},e={},f=!1;return a=[].concat(a),b=[].concat(b||[]),f=!!b.length,a.length?a.length&&f&&a.length!=b.length?(F2.log('The length of "apps" does not equal the length of "appManifests"'),void 0):(jQuery.each(a,function(a,e){if(_hydrateAppConfig(e),e.root=e.root||null,_validateApp(e)){if(_apps[e.instanceId]={config:e},e.root){if(!e.root&&"string"!=typeof e.root&&!F2.isNativeDOMNode(e.root))throw F2.log("AppConfig invalid for pre-load, not a valid string and not dom node"),F2.log("AppConfig instance:",e),"Preloaded appConfig.root property must be a native dom node or a string representing a sizzle selector. Please check your inputs and try again.";if(1!=jQuery(e.root).length)throw F2.log("AppConfig invalid for pre-load, root not unique"),F2.log("AppConfig instance:",e),F2.log("Number of dom node instances:",jQuery(e.root).length),"Preloaded appConfig.root property must map to a unique dom node. Please check your inputs and try again.";return _createAppInstance(e),_initAppEvents(e),void 0}_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,e),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,e)):e.root=_beforeAppRender(e),f?_loadApps(e,b[a]):e.enableBatchRequests&&!e.isSecure?(d[e.manifestUrl.toLowerCase()]=d[e.manifestUrl.toLowerCase()]||[],d[e.manifestUrl.toLowerCase()].push(e)):c.push({apps:[e],url:e.manifestUrl})}}),f||(jQuery.each(d,function(a,b){c.push({url:a,apps:b})}),jQuery.each(c,function(a,b){var c=F2.Constants.JSONP_CALLBACK+b.apps[0].appId;e[c]=e[c]||[],e[c].push(b)}),jQuery.each(e,function(a,b){var c=function(d,e){if(e){var f=e.url,g="GET",h="jsonp",i=function(){c(a,b.pop())},j=function(){jQuery.each(e.apps,function(a,b){F2.log("Removed failed "+b.name+" app",b),F2.removeApp(b.instanceId)})},k=function(a){_loadApps(e.apps,a)};if(_config.xhr&&_config.xhr.dataType&&(h=_config.xhr.dataType(e.url,e.apps),"string"!=typeof h))throw"ContainerConfig.xhr.dataType should return a string";if(_config.xhr&&_config.xhr.type&&(g=_config.xhr.type(e.url,e.apps),"string"!=typeof g))throw"ContainerConfig.xhr.type should return a string";if(_config.xhr&&_config.xhr.url&&(f=_config.xhr.url(e.url,e.apps),"string"!=typeof f))throw"ContainerConfig.xhr.url should return a string";var l=_config.xhr;"function"!=typeof l&&(l=function(a,b,c,f,i){jQuery.ajax({url:a,type:g,data:{params:F2.stringify(e.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:d,dataType:h,success:c,error:function(a,b,c){F2.log("Failed to load app(s)",c.toString(),e.apps),f()},complete:i})}),l(f,e.apps,k,j,i)}};c(a,b.pop())})),void 0):(F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0)},removeAllApps:function(){return _isInit()?(jQuery.each(_apps,function(a,b){F2.removeApp(b.config.instanceId)}),void 0):(F2.log("F2.init() must be called before F2.removeAllApps()"),void 0)},removeApp:function(a){return _isInit()?(_apps[a]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[a]),delete _apps[a]),void 0):(F2.log("F2.init() must be called before F2.removeApp()"),void 0)}}}()),exports.F2=F2,"undefined"!=typeof define&&define.amd&&define(function(){return F2})}}("undefined"!=typeof exports?exports:window); //# sourceMappingURL=f2.min.map diff --git a/sdk/f2.min.map b/sdk/f2.min.map index 9360028e..a6454ada 100644 --- a/sdk/f2.min.map +++ b/sdk/f2.min.map @@ -1 +1 @@ -{"version":3,"file":"f2.min.js","sources":["f2.debug.js"],"names":["exports","F2","F2_TESTING_MODE","JSON","f","n","quote","string","escapable","lastIndex","test","replace","a","c","meta","charCodeAt","toString","slice","str","key","holder","i","k","v","length","partial","mind","gap","value","toJSON","rep","call","isFinite","String","indent","Object","prototype","apply","join","push","hasOwnProperty","Date","this","valueOf","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","Number","Boolean","cx","\b","\t","\n","\f","\r","\"","\\","stringify","replacer","space","Error","parse","text","reviver","walk","undefined","j","eval","SyntaxError","window","createOptions","options","object","optionsCache","jQuery","each","split","core_rspace","_","flag","dataAttr","elem","data","nodeType","name","rmultiDash","toLowerCase","getAttribute","rbrace","parseJSON","e","isEmptyDataObject","obj","isEmptyObject","returnFalse","returnTrue","isDisconnected","node","parentNode","sibling","cur","dir","winnow","elements","qualifier","keep","isFunction","grep","retVal","filtered","isSimple","filter","inArray","createSafeFragment","document","list","nodeNames","safeFrag","createDocumentFragment","createElement","pop","findOrAppend","tag","getElementsByTagName","appendChild","ownerDocument","cloneCopyEvent","src","dest","hasData","type","l","oldData","_data","curData","events","handle","event","add","extend","cloneFixAttributes","nodeName","clearAttributes","mergeAttributes","outerHTML","support","html5Clone","innerHTML","trim","rcheckableType","defaultChecked","checked","selected","defaultSelected","defaultValue","removeAttribute","expando","getAll","querySelectorAll","fixDefaultChecked","vendorPropName","style","capName","charAt","toUpperCase","origName","cssPrefixes","isHidden","el","css","contains","showHide","show","display","values","index","css_defaultDisplay","curCSS","setPositiveNumber","subtract","matches","rnumsplit","exec","Math","max","augmentWidthOrHeight","extra","isBorderBox","val","cssExpand","parseFloat","getWidthOrHeight","offsetWidth","offsetHeight","valueIsBorderBox","boxSizing","rnumnonpx","boxSizingReliable","elemdisplay","appendTo","body","remove","iframe","frameBorder","width","height","iframeDoc","contentWindow","contentDocument","write","close","removeChild","buildParams","prefix","traditional","isArray","rbracket","addToPrefiltersOrTransports","structure","dataTypeExpression","func","dataType","placeBefore","dataTypes","substr","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","selection","executeOnly","prefilters","unshift","ajaxExtend","target","deep","flatOptions","ajaxSettings","ajaxHandleResponses","s","responses","ct","finalDataType","firstDataType","contents","responseFields","shift","mimeType","getResponseHeader","converters","ajaxConvert","response","conv","conv2","current","tmp","prev","dataFilter","splice","state","error","createStandardXHR","XMLHttpRequest","createActiveXHR","ActiveXObject","createFxNow","setTimeout","fxNow","now","createTweens","animation","props","prop","collection","tweeners","concat","Animation","properties","result","animationPrefilters","deferred","Deferred","always","tick","currentTime","remaining","startTime","duration","temp","percent","tweens","run","notifyWith","resolveWith","promise","opts","specialEasing","originalProperties","createTween","end","tween","Tween","easing","stop","gotoEnd","rejectWith","propFilter","start","fx","timer","anim","queue","progress","done","complete","fail","hooks","camelCase","cssHooks","expand","defaultPrefilter","dataShow","toggle","oldfire","orig","handled","hidden","_queueHooks","unqueued","empty","fire","overflow","overflowX","overflowY","inlineBlockNeedsLayout","zoom","shrinkWrapBlocks","rfxtypes","hide","removeData","init","genFx","includeWidth","which","attrs","opacity","getWindow","isWindow","defaultView","parentWindow","rootjQuery","readyList","location","navigator","_jQuery","_$","$","core_push","Array","core_slice","core_indexOf","indexOf","core_toString","core_hasOwn","core_trim","selector","context","fn","core_pnum","source","core_rnotwhite","rtrim","rquickExpr","rsingleTag","rvalidchars","rvalidbraces","rvalidescape","rvalidtokens","rmsPrefix","rdashAlpha","fcamelCase","all","letter","DOMContentLoaded","addEventListener","removeEventListener","ready","readyState","detachEvent","class2type","constructor","match","doc","jquery","find","parseHTML","isPlainObject","attr","merge","getElementById","id","makeArray","size","toArray","get","num","pushStack","elems","ret","prevObject","callback","args","eq","first","last","arguments","map","sort","copy","copyIsArray","clone","noConflict","isReady","readyWait","holdReady","hold","wait","trigger","off","isNumeric","isNaN","msg","scripts","parsed","buildFragment","cacheable","fragment","childNodes","Function","parseXML","xml","DOMParser","parseFromString","async","loadXML","documentElement","noop","globalEval","execScript","isObj","arr","results","len","second","inv","arg","guid","proxy","access","chainable","emptyGet","pass","bulk","getTime","attachEvent","top","frameElement","doScroll","doScrollCheck","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","stack","once","stopOnFalse","self","disable","unique","has","disabled","lock","locked","fireWith","tuples","then","fns","newDefer","tuple","action","returned","resolve","reject","notify","pipe","stateString","when","subordinate","progressValues","progressContexts","resolveContexts","resolveValues","updateFunc","contexts","select","opt","input","eventName","isSupported","clickFn","div","setAttribute","cssText","leadingWhitespace","firstChild","tbody","htmlSerialize","hrefNormalized","cssFloat","checkOn","optSelected","getSetAttribute","className","enctype","cloneNode","boxModel","compatMode","submitBubbles","changeBubbles","focusinBubbles","deleteExpando","noCloneEvent","reliableMarginRight","pixelPosition","noCloneChecked","optDisabled","fireEvent","radioValue","lastChild","checkClone","appendChecked","submit","change","focusin","container","tds","marginDiv","divReset","insertBefore","reliableHiddenOffsets","doesNotIncludeMarginInBodyOffset","offsetTop","getComputedStyle","marginRight","cache","deletedIds","uuid","random","noData","embed","applet","pvt","acceptData","thisCache","internalKey","getByName","isNode","cleanData","parts","part","attributes","substring","triggerHandler","dequeue","startLength","next","setter","delay","time","speeds","timeout","clearTimeout","clearQueue","count","defer","nodeHook","boolHook","fixSpecified","rclass","rreturn","rtype","rfocusable","rclickable","rboolean","removeAttr","removeProp","propFix","addClass","classNames","setClass","cl","removeClass","removes","toggleClass","stateVal","isBool","hasClass","valHooks","set","option","specified","selectedIndex","one","attrFn","notxml","nType","isXMLDoc","attrHooks","propName","attrNames","tabindex","readonly","for","class","maxlength","cellspacing","cellpadding","rowspan","colspan","usemap","frameborder","contenteditable","propHooks","tabIndex","attributeNode","getAttributeNode","parseInt","href","attrNode","property","nodeValue","coords","button","createAttribute","setAttributeNode","parent","rformElems","rtypenamespace","rhoverHack","rkeyEvent","rmouseEvent","rfocusMorph","hoverHack","special","hover","types","handler","elemData","eventHandle","t","tns","namespaces","handleObj","handleObjIn","handlers","triggered","dispatch","delegateType","bindType","origType","needsContext","expr","namespace","delegateCount","setup","global","mappedTypes","origCount","eventType","RegExp","teardown","removeEvent","customEvent","getData","setData","changeData","onlyHandlers","exclusive","old","ontype","eventPath","bubbleType","Event","isTrigger","namespace_re","noBubble","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","selMatch","matched","sel","run_all","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","fixHooks","keyHooks","original","charCode","keyCode","mouseHooks","eventDoc","fromElement","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","relatedTarget","toElement","originalEvent","fixHook","srcElement","metaKey","load","focus","blur","beforeunload","onbeforeunload","simulate","bubble","isSimulated","defaultPrevented","returnValue","getPreventDefault","timeStamp","cancelBubble","stopImmediatePropagation","mouseenter","mouseleave","related","form","_submit_bubble","propertyName","_just_changed","attaches","on","origFn","bind","unbind","live","die","delegate","undelegate","toggler","lastToggle","click","fnOver","fnOut","Sizzle","seed","m","isXML","assertUsableClassName","getElementsByClassName","createInputPseudo","createButtonPseudo","createPositionalPseudo","markFunction","argument","matchIndexes","siblingCheck","b","nextSibling","tokenize","parseOnly","tokens","soFar","groups","preFilters","cached","tokenCache","Expr","preFilter","rcomma","rcombinators","Token","matchExpr","addCombinator","matcher","combinator","base","checkNonElements","doneName","dirkey","dirruns","cachedkey","cachedruns","sizset","elementMatcher","matchers","condense","unmatched","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","preMap","postMap","preexisting","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","expandContext","setMatched","matchedCount","outermost","contextBackup","dirrunsUnique","E","uniqueSort","token","rbackslash","rsibling","compile","setFilters","assertGetIdNotName","getText","sortOrder","hasDuplicate","baseHasDuplicate","strundefined","docElem","createCache","keys","cacheLength","classCache","compilerCache","whitespace","characterEncoding","identifier","operators","pseudos","pos","rpseudo","rheader","rinputs","ID","CLASS","NAME","TAG","ATTR","PSEUDO","POS","CHILD","assert","assertTagNameNoComments","createComment","assertHrefNotNormalized","assertAttributes","assertUsableName","getElementsByName","matchesSelector","textContent","adown","bup","compareDocumentPosition","attrHandle","selectors","createPseudo",">"," ","+","~","unquoted","excess","pattern","operator","check","diff","previousSibling","pseudo","idx","not","innerText","enabled","header","radio","checkbox","file","password","image","reset","activeElement","hasFocus","active","even","odd","lt","gt","sourceIndex","al","bl","ap","bp","aup","duplicates","group","disconnectedMatch","oldSelect","rescape","rattributeQuotes","rbuggyQSA","rbuggyMatches","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","msMatchesSelector","nid","newContext","newSelector","qsaError","filters","runtil","rparentsprev","rneedsContext","guaranteedUnique","children","r","targets","is","closest","prevAll","addBack","andSelf","parents","parentsUntil","until","nextAll","nextUntil","prevUntil","siblings","reverse","rinlinejQuery","rleadingWhitespace","rxhtmlTag","rtagName","rtbody","rhtml","rnoInnerhtml","rnocache","rnoshimcache","rchecked","rscriptType","rcleanScript","wrapMap","legend","thead","tr","td","col","area","safeFragment","fragmentDiv","optgroup","tfoot","colgroup","caption","th","append","createTextNode","wrapAll","html","wrap","wrapInner","unwrap","replaceWith","domManip","prepend","before","clean","after","keepData","dataAndEvents","deepDataAndEvents","detach","table","iNoClone","ajax","url","throws","cachehit","fragments","prependTo","insertAfter","replaceAll","insert","srcElements","destElements","depth","hasBody","handleScript","jsTags","safe","browser","uaMatch","ua","version","userAgent","chrome","webkit","safari","sub","jQuerySub","superclass","rootjQuerySub","ralpha","ropacity","rposition","rdisplayswap","rmargin","rrelNum","BODY","cssShow","position","visibility","cssNormalTransform","letterSpacing","fontWeight","eventsToggle","fn2","bool","computed","cssNumber","fillOpacity","lineHeight","orphans","widows","zIndex","cssProps","float","numeric","swap","minWidth","maxWidth","getPropertyValue","currentStyle","left","rsLeft","runtimeStyle","pixelLeft","$1","visible","margin","padding","border","suffix","expanded","r20","rCRLF","rinput","rselectTextarea","serialize","param","serializeArray","encodeURIComponent","ajaxLocParts","ajaxLocation","rhash","rheaders","rlocalProtocol","rnoContent","rprotocol","rquery","rscript","rts","rurl","_load","transports","allTypes","params","status","responseText","o","method","success","getScript","getJSON","ajaxSetup","settings","isLocal","contentType","processData","accepts","json","*","* text","text html","text json","text xml","ajaxPrefilter","ajaxTransport","nativeStatusText","headers","isSuccess","modified","statusText","timeoutTimer","transport","responseHeadersString","ifModified","lastModified","ifModifiedKey","etag","callbackContext","statusCode","fireGlobals","globalEventContext","completeDeferred","responseHeaders","requestHeaders","requestHeadersNames","strAbort","setRequestHeader","lname","getAllResponseHeaders","overrideMimeType","abort","crossDomain","hasContent","ts","beforeSend","send","oldCallbacks","rquestion","rjsonp","nonce","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","hasCallback","replaceInUrl","replaceInData","script","text script","head","scriptCharset","charset","onload","onreadystatechange","isAbort","xhrCallbacks","xhrOnUnloadAbort","xhrId","xhr","cors","username","open","xhrFields","responseXML","firefoxAccessException","unload","timerId","rfxnum","rrun","unit","scale","maxIterations","tweener","prefilter","eased","step","cssFn","speed","animate","fadeTo","to","optall","doAnimation","stopQueue","timers","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","linear","p","swing","cos","PI","setInterval","interval","clearInterval","slow","fast","animated","rroot","offset","setOffset","win","box","bodyOffset","getBoundingClientRect","pageYOffset","pageXOffset","offsetLeft","curTop","curLeft","curElem","curOffset","curCSSTop","curCSSLeft","calculatePosition","curPosition","using","offsetParent","parentOffset","scrollTo","Height","Width","content","defaultExtra","funcName","define","amd","Modal","element","$element","remote","isShown","that","escape","backdrop","transition","enforceFocus","hideWithTransition","hideModal","keyboard","removeBackdrop","$backdrop","doAnimate","modal","$this","defaults","Constructor","$target","_events","configure","conf","delimiter","wildcard","listenerTree","EventEmitter","searchListenerTree","tree","leaf","branch","xTree","xxTree","isolatedBranch","endReached","listeners","typeLength","currentType","nextType","_listeners","**","growListenerTree","listener","warned","defaultMaxListeners","maxListeners","console","trace","setMaxListeners","many","ttl","_origin","emit","newListener","_all","ns","onAny","addListener","leafs","iLeaf","offAny","removeListener","removeAllListeners","listenersAny","EventEmitter2","process","title","decodeURIComponent","isHostMethod","isHostObject","hasFlash","activeX","flashVersion","GetVariable","HAS_FLASH_THROTTLED_BUG","notSupportedException","dom_onReady","domIsReady","domReadyQueue","whenReady","scope","getParentObject","ii","easyXDM","_easyXDM","IFRAME_PREFIX","getDomainName","reURI","getPort","getLocation","proto","domain","port","resolveUrl","reDoubleSlash","path","pathname","lastIndexOf","protocol","host","reParent","appendQueryParameters","parameters","hash","q","useHash","undef","destination","noOverwrite","member","testForNamePropertyBug","channelId","HAS_NAME_PROPERTY_BUG","createFrame","config","frame","onLoad","allowTransparency","checkAcl","acl","re","prepareTransportStack","stackEls","isHost","query","xdm_p","channel","secret","swf","product","remoteHelper","xdm_c","xdm_s","xdm_e","useResize","useParent","usePolling","local","images","search","xdm_pa","xdm_po","HashTransport","ReliableBehavior","QueueBehavior","encode","maxLength","VerifyBehavior","initiate","PostMessageTransport","NameTransport","NixTransport","SameOriginTransport","FrameElementTransport","FlashTransport","lazy","chainStack","stackElements","stackEl","incoming","message","origin","up","outgoing","recipient","down","destroy","removeFromStack","un","floor","emptyFn","sEvent","fpNotify","pair","evalJSON","getJSONObject","DomHelper","requiresJSON","_map","Fn","del","Socket","onMessage","onReady","postMessage","Rpc","jsonRpcConfig","RpcBehavior","pub","targetOrigin","onDOMReady","sendFn","addSwf","swfContainer","swfNoThrottle","right","flashVars","destroyChannel","swfdomain","createChannel","_getOrigin","uri","_window_onMessage","callerWindow","waitForReady","referrer","_sendMessage","sendMessage","_onReady","readyCount","_onMessage","remoteOrigin","_onLoad","remoteWindow","remoteUrl","w","_callerWindow","_msgNr","_handleHash","_lastMsg","_remoteOrigin","_pollHash","_listenerWindow","_attachListeners","_timer","pollInterval","tries","getRef","frames","ex","idOut","idIn","currentMessage","ack","waiting","destroying","doFragment","seq","startVerification","mySecret","theirSecret","_send","jsonrpc","serializer","_createMethod","definition","_callbacks","_callbackCounter","namedParams","_executeMethod","code","ex1","_absolutizeURI","removeDotSegments","output","_parseURI","authority","hostname","appConfigReplacer","Apps","overwrite","isFunc","S4","array","isLocalRequest","urlLower","isNativeDOMNode","testObject","bIsNode","Node","bIsElement","HTMLElement","log","_ct","_f2t","_handlerCollection","appCreateRoot","appRenderBefore","appDestroyBefore","appRenderAfter","appDestroyAfter","appRender","appDestroy","_defaultMethods","appConfig","$root","root","appInstance","app","appId","_createHandler","sNamespace","func_or_element","bDomNodeAppropriate","_validateToken","domNode","sToken","_removeHandler","eventKey","currentEventKey","eventCollection","newEvents","ec","currentEventHandler","newHandlerCollection","iCounter","hc","currentHandler","getToken","__f2GetToken","__trigger","passableArgs","hcl","$appRoot","arData","AppHandlers","APP_CREATE_ROOT","APP_RENDER_BEFORE","APP_RENDER","APP_RENDER_AFTER","APP_DESTROY_BEFORE","APP_DESTROY","APP_DESTROY_AFTER","App","AppConfig","enableBatchRequests","instanceId","isSecure","manifestUrl","minGridSize","ui","views","AppManifest","apps","inlineScripts","styles","AppContent","ContainerConfig","afterAppRender","beforeAppRender","isSecureAppPage","secureAppPagePath","supportedViews","UI","Mask","backgroundColor","loadingIcon","useClasses","Css","_PREFIX","APP","APP_CONTAINER","APP_TITLE","APP_VIEW","APP_VIEW_TRIGGER","MASK","MASK_CONTAINER","Events","_APP_EVENT_PREFIX","_CONTAINER_EVENT_PREFIX","APP_SYMBOL_CHANGE","APP_WIDTH_CHANGE","CONTAINER_SYMBOL_CHANGE","CONTAINER_WIDTH_CHANGE","JSONP_CALLBACK","Sockets","EVENT","LOAD","RPC","RPC_CALLBACK","UI_RPC","Views","DATA_ATTRIBUTE","ABOUT","HELP","HOME","REMOVE","SETTINGS","_socketEmit","broadcast","Constants","timesToListen","_secureAppPagePath","_apps","_rEvents","_rRpc","_rRpcCallback","_rSocketLoad","_rUiCall","_createAppToContainerSocket","isLoaded","messagePlayback","socket","appParts","registerApps","_createContainerToAppSocket","appManifest","iframeProps","scrolling","_createRpcCallback","callbackId","parseFunction","functionName","parseMessage","regEx","callbacks","_registerCallback","messageType","cid","isRemote","register","_containerConfig","UI_Class","_appConfig","_updateHeight","outerHeight","hideMask","Modals","_renderAlert","_renderConfirm","alert","isInit","confirm","okCallback","cancelCallback","setTitle","showMask","showLoader","updateHeight","_rValidEvents","_isValid","containerConfig","showLoading","mask","background-color","background-image","background-position","background-repeat","min-height","z-index","_config","_bUsesAppHandlers","_sAppHandlerToken","_afterAppRender","appContainer","_appRender","_outerHtml","_beforeAppRender","_hydrateAppConfig","_initAppEvents","view","removeApp","_initContainerEvents","resizeTimeout","resizeHandler","_isInit","_createAppInstance","appContent","_loadApps","appConfigs","_loadSecureApp","inlines","scriptCount","scriptsLoaded","appInit","evalInlines","exception","stylesFragment","jqxhr","_validateApp","_validateContainerConfig","getContainerState","appManifests","appStack","batches","callbackStack","haveManifests","req","requests","manifestRequest","completeFunc","errorFunc","item","successFunc","requestFunc","successCallback","errorCallback","completeCallback","removeAllApps"],"mappings":"CAAC,SAAUA,SAEV,IAAIA,QAAQC,IAAOD,QAAQE,gBAA3B;;;;;;;;;;;;;;;;;;;AA8KmB,gBAATC,QACPA,SAGH,WACG,YAEA,SAASC,GAAEC,GAEP,MAAW,IAAJA,EAAS,IAAMA,EAAIA,EAwC9B,QAASC,OAAMC,GAQX,MADAC,WAAUC,UAAY,EACfD,UAAUE,KAAKH,GAA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AAeC,GACvEzoD,OAAO+6B,MACNC,IAAKA,EACLx3B,KAAMA,EACNhD,MACCmgC,OAAQvlC,GAAG2D,UAAUgpD,EAAIhJ,KAAM3jD,GAAGg/C,oBAEnChW,OAAO,EACPC,cAAeA,EACfl7B,SAAUA,EACV63B,QAASunB,EACT78C,MAAO,SAAS47C,EAAOlmB,EAAUgmB,GAChChsD,GAAG8/C,IAAI,wBAAyBkM,EAAUjrD,WAAY4rD,EAAIhJ,MAC1DyJ,KAEDx5C,SAAUy5C,MAKbH,EAAYttB,EAAK+sB,EAAIhJ,KAAMsJ,EAAaF,EAAWD,IAGpDD,GAAgBzrD,EAAGwrD,EAASllD,UAjL9B9C,SAVC5E,GAAG8/C,IAAI,wEACP,SAkMFwN,cAAe,WAEd,MAAKjC,YAKLzmD,OAAOC,KAAKgiD,MAAO,SAASzlD,EAAGT,GAC9BX,GAAGirD,UAAUtqD,EAAEq1C,OAAOoN,cADvBx+C,SAJC5E,GAAG8/C,IAAI,sDACP,SAYFmL,UAAW,SAAS7H,GAEnB,MAAKiI,YAKDxE,MAAMzD,KACTpjD,GAAGyiD,YAAYL,UACdoI,kBACAxqD,GAAG0mD,UAAUjE,YAAYK,mBACzB+D,MAAMzD,IAGPpjD,GAAGyiD,YAAYL,UACdoI,kBACAxqD,GAAG0mD,UAAUjE,YAAYM,YACzB8D,MAAMzD,IAGPpjD,GAAGyiD,YAAYL,UACdoI,kBACAxqD,GAAG0mD,UAAUjE,YAAYO,kBACzB6D,MAAMzD,UAGAyD,OAAMzD,IAnBd,SAJCpjD,GAAG8/C,IAAI,kDACP,cA4BH//C,QAAQC,GAAKA,GAES,mBAAX2uC,SAA0BA,OAAOC,KAE3CD,OAAO,WACN,MAAO3uC,QAKY,mBAAZD,SAA0BA,QAAUwE"} \ No newline at end of file +{"version":3,"file":"f2.min.js","sources":["f2.debug.js"],"names":["exports","F2","F2_TESTING_MODE","JSON","f","n","quote","string","escapable","lastIndex","test","replace","a","c","meta","charCodeAt","toString","slice","str","key","holder","i","k","v","length","partial","mind","gap","value","toJSON","rep","call","isFinite","String","indent","Object","prototype","apply","join","push","hasOwnProperty","Date","this","valueOf","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","Number","Boolean","cx","\b","\t","\n","\f","\r","\"","\\","stringify","replacer","space","Error","parse","text","reviver","walk","undefined","j","eval","SyntaxError","window","createOptions","options","object","optionsCache","jQuery","each","split","core_rspace","_","flag","dataAttr","elem","data","nodeType","name","rmultiDash","toLowerCase","getAttribute","rbrace","parseJSON","e","isEmptyDataObject","obj","isEmptyObject","returnFalse","returnTrue","isDisconnected","node","parentNode","sibling","cur","dir","winnow","elements","qualifier","keep","isFunction","grep","retVal","filtered","isSimple","filter","inArray","createSafeFragment","document","list","nodeNames","safeFrag","createDocumentFragment","createElement","pop","findOrAppend","tag","getElementsByTagName","appendChild","ownerDocument","cloneCopyEvent","src","dest","hasData","type","l","oldData","_data","curData","events","handle","event","add","extend","cloneFixAttributes","nodeName","clearAttributes","mergeAttributes","outerHTML","support","html5Clone","innerHTML","trim","rcheckableType","defaultChecked","checked","selected","defaultSelected","defaultValue","removeAttribute","expando","getAll","querySelectorAll","fixDefaultChecked","vendorPropName","style","capName","charAt","toUpperCase","origName","cssPrefixes","isHidden","el","css","contains","showHide","show","display","values","index","css_defaultDisplay","curCSS","setPositiveNumber","subtract","matches","rnumsplit","exec","Math","max","augmentWidthOrHeight","extra","isBorderBox","val","cssExpand","parseFloat","getWidthOrHeight","offsetWidth","offsetHeight","valueIsBorderBox","boxSizing","rnumnonpx","boxSizingReliable","elemdisplay","appendTo","body","remove","iframe","frameBorder","width","height","iframeDoc","contentWindow","contentDocument","write","close","removeChild","buildParams","prefix","traditional","isArray","rbracket","addToPrefiltersOrTransports","structure","dataTypeExpression","func","dataType","placeBefore","dataTypes","substr","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","selection","executeOnly","prefilters","unshift","ajaxExtend","target","deep","flatOptions","ajaxSettings","ajaxHandleResponses","s","responses","ct","finalDataType","firstDataType","contents","responseFields","shift","mimeType","getResponseHeader","converters","ajaxConvert","response","conv","conv2","current","tmp","prev","dataFilter","splice","state","error","createStandardXHR","XMLHttpRequest","createActiveXHR","ActiveXObject","createFxNow","setTimeout","fxNow","now","createTweens","animation","props","prop","collection","tweeners","concat","Animation","properties","result","animationPrefilters","deferred","Deferred","always","tick","currentTime","remaining","startTime","duration","temp","percent","tweens","run","notifyWith","resolveWith","promise","opts","specialEasing","originalProperties","createTween","end","tween","Tween","easing","stop","gotoEnd","rejectWith","propFilter","start","fx","timer","anim","queue","progress","done","complete","fail","hooks","camelCase","cssHooks","expand","defaultPrefilter","dataShow","toggle","oldfire","orig","handled","hidden","_queueHooks","unqueued","empty","fire","overflow","overflowX","overflowY","inlineBlockNeedsLayout","zoom","shrinkWrapBlocks","rfxtypes","hide","removeData","init","genFx","includeWidth","which","attrs","opacity","getWindow","isWindow","defaultView","parentWindow","rootjQuery","readyList","location","navigator","_jQuery","_$","$","core_push","Array","core_slice","core_indexOf","indexOf","core_toString","core_hasOwn","core_trim","selector","context","fn","core_pnum","source","core_rnotwhite","rtrim","rquickExpr","rsingleTag","rvalidchars","rvalidbraces","rvalidescape","rvalidtokens","rmsPrefix","rdashAlpha","fcamelCase","all","letter","DOMContentLoaded","addEventListener","removeEventListener","ready","readyState","detachEvent","class2type","constructor","match","doc","jquery","find","parseHTML","isPlainObject","attr","merge","getElementById","id","makeArray","size","toArray","get","num","pushStack","elems","ret","prevObject","callback","args","eq","first","last","arguments","map","sort","copy","copyIsArray","clone","noConflict","isReady","readyWait","holdReady","hold","wait","trigger","off","isNumeric","isNaN","msg","scripts","parsed","buildFragment","cacheable","fragment","childNodes","Function","parseXML","xml","DOMParser","parseFromString","async","loadXML","documentElement","noop","globalEval","execScript","isObj","arr","results","len","second","inv","arg","guid","proxy","access","chainable","emptyGet","pass","bulk","getTime","attachEvent","top","frameElement","doScroll","doScrollCheck","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","stack","once","stopOnFalse","self","disable","unique","has","disabled","lock","locked","fireWith","tuples","then","fns","newDefer","tuple","action","returned","resolve","reject","notify","pipe","stateString","when","subordinate","progressValues","progressContexts","resolveContexts","resolveValues","updateFunc","contexts","select","opt","input","eventName","isSupported","clickFn","div","setAttribute","cssText","leadingWhitespace","firstChild","tbody","htmlSerialize","hrefNormalized","cssFloat","checkOn","optSelected","getSetAttribute","className","enctype","cloneNode","boxModel","compatMode","submitBubbles","changeBubbles","focusinBubbles","deleteExpando","noCloneEvent","reliableMarginRight","pixelPosition","noCloneChecked","optDisabled","fireEvent","radioValue","lastChild","checkClone","appendChecked","submit","change","focusin","container","tds","marginDiv","divReset","insertBefore","reliableHiddenOffsets","doesNotIncludeMarginInBodyOffset","offsetTop","getComputedStyle","marginRight","cache","deletedIds","uuid","random","noData","embed","applet","pvt","acceptData","thisCache","internalKey","getByName","isNode","cleanData","parts","part","attributes","substring","triggerHandler","dequeue","startLength","next","setter","delay","time","speeds","timeout","clearTimeout","clearQueue","count","defer","nodeHook","boolHook","fixSpecified","rclass","rreturn","rtype","rfocusable","rclickable","rboolean","removeAttr","removeProp","propFix","addClass","classNames","setClass","cl","removeClass","removes","toggleClass","stateVal","isBool","hasClass","valHooks","set","option","specified","selectedIndex","one","attrFn","notxml","nType","isXMLDoc","attrHooks","propName","attrNames","tabindex","readonly","for","class","maxlength","cellspacing","cellpadding","rowspan","colspan","usemap","frameborder","contenteditable","propHooks","tabIndex","attributeNode","getAttributeNode","parseInt","href","attrNode","property","nodeValue","coords","button","createAttribute","setAttributeNode","parent","rformElems","rtypenamespace","rhoverHack","rkeyEvent","rmouseEvent","rfocusMorph","hoverHack","special","hover","types","handler","elemData","eventHandle","t","tns","namespaces","handleObj","handleObjIn","handlers","triggered","dispatch","delegateType","bindType","origType","needsContext","expr","namespace","delegateCount","setup","global","mappedTypes","origCount","eventType","RegExp","teardown","removeEvent","customEvent","getData","setData","changeData","onlyHandlers","exclusive","old","ontype","eventPath","bubbleType","Event","isTrigger","namespace_re","noBubble","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","selMatch","matched","sel","run_all","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","fixHooks","keyHooks","original","charCode","keyCode","mouseHooks","eventDoc","fromElement","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","relatedTarget","toElement","originalEvent","fixHook","srcElement","metaKey","load","focus","blur","beforeunload","onbeforeunload","simulate","bubble","isSimulated","defaultPrevented","returnValue","getPreventDefault","timeStamp","cancelBubble","stopImmediatePropagation","mouseenter","mouseleave","related","form","_submit_bubble","propertyName","_just_changed","attaches","on","origFn","bind","unbind","live","die","delegate","undelegate","toggler","lastToggle","click","fnOver","fnOut","Sizzle","seed","m","isXML","assertUsableClassName","getElementsByClassName","createInputPseudo","createButtonPseudo","createPositionalPseudo","markFunction","argument","matchIndexes","siblingCheck","b","nextSibling","tokenize","parseOnly","tokens","soFar","groups","preFilters","cached","tokenCache","Expr","preFilter","rcomma","rcombinators","Token","matchExpr","addCombinator","matcher","combinator","base","checkNonElements","doneName","dirkey","dirruns","cachedkey","cachedruns","sizset","elementMatcher","matchers","condense","unmatched","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","preMap","postMap","preexisting","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","expandContext","setMatched","matchedCount","outermost","contextBackup","dirrunsUnique","E","uniqueSort","token","rbackslash","rsibling","compile","setFilters","assertGetIdNotName","getText","sortOrder","hasDuplicate","baseHasDuplicate","strundefined","docElem","createCache","keys","cacheLength","classCache","compilerCache","whitespace","characterEncoding","identifier","operators","pseudos","pos","rpseudo","rheader","rinputs","ID","CLASS","NAME","TAG","ATTR","PSEUDO","POS","CHILD","assert","assertTagNameNoComments","createComment","assertHrefNotNormalized","assertAttributes","assertUsableName","getElementsByName","matchesSelector","textContent","adown","bup","compareDocumentPosition","attrHandle","selectors","createPseudo",">"," ","+","~","unquoted","excess","pattern","operator","check","diff","previousSibling","pseudo","idx","not","innerText","enabled","header","radio","checkbox","file","password","image","reset","activeElement","hasFocus","active","even","odd","lt","gt","sourceIndex","al","bl","ap","bp","aup","duplicates","group","disconnectedMatch","oldSelect","rescape","rattributeQuotes","rbuggyQSA","rbuggyMatches","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","msMatchesSelector","nid","newContext","newSelector","qsaError","filters","runtil","rparentsprev","rneedsContext","guaranteedUnique","children","r","targets","is","closest","prevAll","addBack","andSelf","parents","parentsUntil","until","nextAll","nextUntil","prevUntil","siblings","reverse","rinlinejQuery","rleadingWhitespace","rxhtmlTag","rtagName","rtbody","rhtml","rnoInnerhtml","rnocache","rnoshimcache","rchecked","rscriptType","rcleanScript","wrapMap","legend","thead","tr","td","col","area","safeFragment","fragmentDiv","optgroup","tfoot","colgroup","caption","th","append","createTextNode","wrapAll","html","wrap","wrapInner","unwrap","replaceWith","domManip","prepend","before","clean","after","keepData","dataAndEvents","deepDataAndEvents","detach","table","iNoClone","ajax","url","throws","cachehit","fragments","prependTo","insertAfter","replaceAll","insert","srcElements","destElements","depth","hasBody","handleScript","jsTags","safe","browser","uaMatch","ua","version","userAgent","chrome","webkit","safari","sub","jQuerySub","superclass","rootjQuerySub","ralpha","ropacity","rposition","rdisplayswap","rmargin","rrelNum","BODY","cssShow","position","visibility","cssNormalTransform","letterSpacing","fontWeight","eventsToggle","fn2","bool","computed","cssNumber","fillOpacity","lineHeight","orphans","widows","zIndex","cssProps","float","numeric","swap","minWidth","maxWidth","getPropertyValue","currentStyle","left","rsLeft","runtimeStyle","pixelLeft","$1","visible","margin","padding","border","suffix","expanded","r20","rCRLF","rinput","rselectTextarea","serialize","param","serializeArray","encodeURIComponent","ajaxLocParts","ajaxLocation","rhash","rheaders","rlocalProtocol","rnoContent","rprotocol","rquery","rscript","rts","rurl","_load","transports","allTypes","params","status","responseText","o","method","success","getScript","getJSON","ajaxSetup","settings","isLocal","contentType","processData","accepts","json","*","* text","text html","text json","text xml","ajaxPrefilter","ajaxTransport","nativeStatusText","headers","isSuccess","modified","statusText","timeoutTimer","transport","responseHeadersString","ifModified","lastModified","ifModifiedKey","etag","callbackContext","statusCode","fireGlobals","globalEventContext","completeDeferred","responseHeaders","requestHeaders","requestHeadersNames","strAbort","setRequestHeader","lname","getAllResponseHeaders","overrideMimeType","abort","crossDomain","hasContent","ts","beforeSend","send","oldCallbacks","rquestion","rjsonp","nonce","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","hasCallback","replaceInUrl","replaceInData","script","text script","head","scriptCharset","charset","onload","onreadystatechange","isAbort","xhrCallbacks","xhrOnUnloadAbort","xhrId","xhr","cors","username","open","xhrFields","responseXML","firefoxAccessException","unload","timerId","rfxnum","rrun","unit","scale","maxIterations","tweener","prefilter","eased","step","cssFn","speed","animate","fadeTo","to","optall","doAnimation","stopQueue","timers","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","linear","p","swing","cos","PI","setInterval","interval","clearInterval","slow","fast","animated","rroot","offset","setOffset","win","box","bodyOffset","getBoundingClientRect","pageYOffset","pageXOffset","offsetLeft","curTop","curLeft","curElem","curOffset","curCSSTop","curCSSLeft","calculatePosition","curPosition","using","offsetParent","parentOffset","scrollTo","Height","Width","content","defaultExtra","funcName","define","amd","Modal","element","$element","remote","isShown","that","escape","backdrop","transition","enforceFocus","hideWithTransition","hideModal","keyboard","removeBackdrop","$backdrop","doAnimate","modal","$this","defaults","Constructor","$target","_events","configure","conf","delimiter","wildcard","listenerTree","EventEmitter","searchListenerTree","tree","leaf","branch","xTree","xxTree","isolatedBranch","endReached","listeners","typeLength","currentType","nextType","_listeners","**","growListenerTree","listener","warned","defaultMaxListeners","maxListeners","console","trace","setMaxListeners","many","ttl","_origin","emit","newListener","_all","ns","onAny","addListener","leafs","iLeaf","offAny","removeListener","removeAllListeners","listenersAny","EventEmitter2","process","title","decodeURIComponent","isHostMethod","isHostObject","hasFlash","activeX","flashVersion","GetVariable","HAS_FLASH_THROTTLED_BUG","notSupportedException","dom_onReady","domIsReady","domReadyQueue","whenReady","scope","getParentObject","ii","easyXDM","_easyXDM","IFRAME_PREFIX","getDomainName","reURI","getPort","getLocation","proto","domain","port","resolveUrl","reDoubleSlash","path","pathname","lastIndexOf","protocol","host","reParent","appendQueryParameters","parameters","hash","q","useHash","undef","destination","noOverwrite","member","testForNamePropertyBug","channelId","HAS_NAME_PROPERTY_BUG","createFrame","config","frame","onLoad","allowTransparency","checkAcl","acl","re","prepareTransportStack","stackEls","isHost","query","xdm_p","channel","secret","swf","product","remoteHelper","xdm_c","xdm_s","xdm_e","useResize","useParent","usePolling","local","images","search","xdm_pa","xdm_po","HashTransport","ReliableBehavior","QueueBehavior","encode","maxLength","VerifyBehavior","initiate","PostMessageTransport","NameTransport","NixTransport","SameOriginTransport","FrameElementTransport","FlashTransport","lazy","chainStack","stackElements","stackEl","incoming","message","origin","up","outgoing","recipient","down","destroy","removeFromStack","un","floor","emptyFn","sEvent","fpNotify","pair","evalJSON","getJSONObject","DomHelper","requiresJSON","_map","Fn","del","Socket","onMessage","onReady","postMessage","Rpc","jsonRpcConfig","RpcBehavior","pub","targetOrigin","onDOMReady","sendFn","addSwf","swfContainer","swfNoThrottle","right","flashVars","destroyChannel","swfdomain","createChannel","_getOrigin","uri","_window_onMessage","callerWindow","waitForReady","referrer","_sendMessage","sendMessage","_onReady","readyCount","_onMessage","remoteOrigin","_onLoad","remoteWindow","remoteUrl","w","_callerWindow","_msgNr","_handleHash","_lastMsg","_remoteOrigin","_pollHash","_listenerWindow","_attachListeners","_timer","pollInterval","tries","getRef","frames","ex","idOut","idIn","currentMessage","ack","waiting","destroying","doFragment","seq","startVerification","mySecret","theirSecret","_send","jsonrpc","serializer","_createMethod","definition","_callbacks","_callbackCounter","namedParams","_executeMethod","code","ex1","_absolutizeURI","removeDotSegments","output","_parseURI","authority","hostname","appConfigReplacer","Apps","overwrite","isFunc","S4","array","isLocalRequest","urlLower","isNativeDOMNode","testObject","bIsNode","Node","bIsElement","HTMLElement","log","_ct","_f2t","_handlerCollection","appCreateRoot","appRenderBefore","appDestroyBefore","appRenderAfter","appDestroyAfter","appRender","appDestroy","_defaultMethods","appConfig","appHtml","$root","root","appInstance","app","appId","_createHandler","sNamespace","func_or_element","bDomNodeAppropriate","_validateToken","domNode","sToken","_removeHandler","eventKey","currentEventKey","eventCollection","newEvents","ec","currentEventHandler","newHandlerCollection","iCounter","hc","currentHandler","getToken","__f2GetToken","__trigger","passableArgs","hcl","$appRoot","arData","AppHandlers","APP_CREATE_ROOT","APP_RENDER_BEFORE","APP_RENDER","APP_RENDER_AFTER","APP_DESTROY_BEFORE","APP_DESTROY","APP_DESTROY_AFTER","App","AppConfig","enableBatchRequests","instanceId","isSecure","manifestUrl","minGridSize","ui","views","AppManifest","apps","inlineScripts","styles","AppContent","ContainerConfig","afterAppRender","beforeAppRender","isSecureAppPage","secureAppPagePath","supportedViews","UI","Mask","backgroundColor","loadingIcon","useClasses","Css","_PREFIX","APP","APP_CONTAINER","APP_TITLE","APP_VIEW","APP_VIEW_TRIGGER","MASK","MASK_CONTAINER","Events","_APP_EVENT_PREFIX","_CONTAINER_EVENT_PREFIX","APP_SYMBOL_CHANGE","APP_WIDTH_CHANGE","CONTAINER_SYMBOL_CHANGE","CONTAINER_WIDTH_CHANGE","JSONP_CALLBACK","Sockets","EVENT","LOAD","RPC","RPC_CALLBACK","UI_RPC","Views","DATA_ATTRIBUTE","ABOUT","HELP","HOME","REMOVE","SETTINGS","_socketEmit","broadcast","Constants","timesToListen","_secureAppPagePath","_apps","_rEvents","_rRpc","_rRpcCallback","_rSocketLoad","_rUiCall","_createAppToContainerSocket","isLoaded","messagePlayback","socket","appParts","registerApps","_createContainerToAppSocket","appManifest","iframeProps","scrolling","_createRpcCallback","callbackId","parseFunction","functionName","parseMessage","regEx","callbacks","_registerCallback","messageType","cid","isRemote","register","_containerConfig","UI_Class","_appConfig","_updateHeight","outerHeight","hideMask","Modals","_renderAlert","_renderConfirm","alert","isInit","confirm","okCallback","cancelCallback","setTitle","showMask","showLoader","updateHeight","_rValidEvents","_isValid","containerConfig","showLoading","mask","background-color","background-image","background-position","background-repeat","min-height","z-index","_config","_bUsesAppHandlers","_sAppHandlerToken","_afterAppRender","appContainer","_appRender","_outerHtml","_beforeAppRender","_hydrateAppConfig","_initAppEvents","view","removeApp","_initContainerEvents","resizeTimeout","resizeHandler","_isInit","_createAppInstance","appContent","_loadApps","appConfigs","_loadSecureApp","inlines","scriptCount","scriptsLoaded","appInit","evalInlines","exception","stylesFragment","jqxhr","_validateApp","_validateContainerConfig","getContainerState","appManifests","appStack","batches","callbackStack","haveManifests","req","requests","manifestRequest","completeFunc","errorFunc","item","successFunc","requestFunc","successCallback","errorCallback","completeCallback","removeAllApps"],"mappings":"CAAC,SAAUA,SAEV,IAAIA,QAAQC,IAAOD,QAAQE,gBAA3B;;;;;;;;;;;;;;;;;;;AA8KmB,gBAATC,QACPA,SAGH,WACG,YAEA,SAASC,GAAEC,GAEP,MAAW,IAAJA,EAAS,IAAMA,EAAIA,EAwC9B,QAASC,OAAMC,GAQX,MADAC,WAAUC,UAAY,EACfD,UAAUE,KAAKH,GAAU,IAAMA,EAAOI,QAAQH,UAAW,SAAUI,GACtE,GAAIC,GAAIC,KAAKF,EACb,OAAoB,gBAANC,GACRA,EACA,OAAS,OAASD,EAAEG,WAAW,GAAGC,SAAS,KAAKC,MAAM,MAC3D,IAAM,IAAMV,EAAS,IAI9B,QAASW,KAAIC,EAAKC,GAId,GAAIC,GACAC,EACAC,EACAC,EAEAC,EADAC,EAAOC,IAEPC,EAAQR,EAAOD,EAkBnB,QAdIS,GAA0B,gBAAVA,IACY,kBAAjBA,GAAMC,SACjBD,EAAQA,EAAMC,OAAOV,IAMN,kBAARW,OACPF,EAAQE,IAAIC,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jL9B9C,SAVC5E,GAAG8/C,IAAI,wEACP,SAkMFyN,cAAe,WAEd,MAAKjC,YAKL1mD,OAAOC,KAAKiiD,MAAO,SAAS1lD,EAAGT,GAC9BX,GAAGkrD,UAAUvqD,EAAEq1C,OAAOqN,cADvBz+C,SAJC5E,GAAG8/C,IAAI,sDACP,SAYFoL,UAAW,SAAS7H,GAEnB,MAAKiI,YAKDxE,MAAMzD,KACTrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYK,mBACzB+D,MAAMzD,IAGPrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYM,YACzB8D,MAAMzD,IAGPrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYO,kBACzB6D,MAAMzD,UAGAyD,OAAMzD,IAnBd,SAJCrjD,GAAG8/C,IAAI,kDACP,cA4BH//C,QAAQC,GAAKA,GAES,mBAAX2uC,SAA0BA,OAAOC,KAE3CD,OAAO,WACN,MAAO3uC,QAKY,mBAAZD,SAA0BA,QAAUwE"} \ No newline at end of file diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index c0c58e36..de61e35e 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -329,9 +329,27 @@ F2 = (function() { })(); /** - * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.3 this is the preferred method - * for choosing how app rendering/interaction happens. This replaces the config versions of beforeAppRender, appRender, and afterAppRender. It also - * adds hooks into an app being removed/destroyed. As F2 evolves more hooks will be added to aid in container development. + * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.2 this is the preferred method + * for choosing how app rendering/interaction happens. This replaces the properties {{#crossLink "F2.ContainerConfig/beforeAppRender"}}{{/crossLink}}, + * {{#crossLink "F2.ContainerConfig/appRender"}}{{/crossLink}}, and {{#crossLink "F2.ContainerConfig/afterAppRender"}}{{/crossLink}} methods in {{#crossLink "F2.ContainerConfig"}}{{/crossLink}}. It also + * adds hooks into an app instance being removed from the container. + * + * **App Rendering** + * + * 0. {{#crossLink "F2/registerApps"}}F2.registerApps(){{/crossLink}} method is called by the container developer and the following methods are run for *each* {{#crossLink "F2.AppConfig"}}{{/crossLink}} passed. + * 1. **'appCreateRoot'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_CREATE\_ROOT*) handlers are fired in the order they were bound/added. + * 2. **'appRenderBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_BEFORE*) handlers are fired in the order they were bound/added. + * 3. Each app is requested asynchronously via manifest url, on success the following methods are fired. + * 3. **'appRender'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER*) handlers are fired in the order they were bound/added. + * 4. **'appRenderAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_AFTER*) handlers are fired in the order they were bound/added. + * + * + * **App Removal** + + * 0. {{#crossLink "F2/removeApp"}}F2.removeApp(){{/crossLink}} with a specific {{#crossLink "F2.AppConfig/instanceId "}}{{/crossLink}} or {{#crossLink "F2/removeAllApps"}}F2.removeAllApps(){{/crossLink}} method is called by the container developer and the following methods are run. + * 1. **'appDestroyBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_BEFORE*) handlers are fired in the order they were bound/added. + * 2. **'appDestroy'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY*) handlers are fired in the order they were bound/added. + * 3. **'appDestroyAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_AFTER*) handlers are fired in the order they were bound/added. * @class F2.AppHandlers */ F2.extend('AppHandlers', (function() { @@ -351,14 +369,14 @@ F2.extend('AppHandlers', (function() { }; var _defaultMethods = { - appRender: function(appConfig, html) + appRender: function(appConfig, appHtml) { var $root = null; // if no app root is defined use the apps outter most node if(!F2.isNativeDOMNode(appConfig.root)) { - appConfig.root = jQuery(html).get(0); + appConfig.root = jQuery(appHtml).get(0); // get a handle on the root in jQuery $root = jQuery(appConfig.root); } @@ -368,7 +386,7 @@ F2.extend('AppHandlers', (function() { $root = jQuery(appConfig.root); // append the app html to the root - $root.append(html); + $root.append(appHtml); } // append the root to the body by default. @@ -586,21 +604,47 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {HTMLElement|Node} element Specific element to append your app to. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender', document.getElementById('my_container')); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRender.myNamespace', document.getElementById('my_container')); + * var sToken = F2.AppHandlers.getToken(); + * + * F2.AppHandlers.on( + * sToken, + * 'appRender', + * document.getElementById('my_container') + * ); + * + * // or + * + * F2.AppHandlers.on( + * sToken, + * 'appRender.myNamespace', + * document.getElementById('my_container') + * ); **/ /** - * Allows you to add listener method that will be triggered when a specific event happens. + * Allows you to add listener method that will be triggered when a specific event occurs. * @method on * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. - * @params {Function} listener A function that will be triggered when a specific event happens. + * @params {Function} listener A function that will be triggered when a specific event occurs. For detailed argument definition refer to {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. * @example - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore', function() { F2.log('before app rendered!'); }); - * F2.AppHandlers.on('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore.myNamespace', function() { F2.log('before app rendered!'); }); + * var sToken = F2.AppHandlers.getToken(); + * + * F2.AppHandlers.on( + * sToken, + * 'appRenderBefore' + * function() { F2.log('before app rendered!'); + * }); + * + * // or + * + * F2.AppHandlers.on( + * sToken, + * 'appRenderBefore.myNamespace', + * function() { F2.log('before app rendered!'); + * }); **/ on: function(token, eventKey, func_or_element) { @@ -646,7 +690,10 @@ F2.extend('AppHandlers', (function() { * listeners for the specified event type will be removed. * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @example - * F2.AppHandlers.off('3123-asd12-asd123dwase-123d-123d', 'appRenderBefore'); + * F2.AppHandlers.off( + * F2.AppHandlers.getToken(), + * 'appRenderBefore' + * ); **/ off: function(token, eventKey) { @@ -683,73 +730,182 @@ F2.extend('AppHandlers', (function() { }; })()); -/** - * A convenient collection of all available appHandler events. - * @class F2.Constants.AppHandlers - */ F2.extend('Constants', { /** - * A collection of constants for the on/off method names in F2.AppHandlers. - * @property {Object} AppHandlers + * A convenient collection of all available appHandler events. + * @class F2.Constants.AppHandlers **/ - AppHandlers: + AppHandlers: function() { - /** - * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). - * @property APP_CREATE_ROOT - * @type string - * @static - * @final - */ - APP_CREATE_ROOT: 'appCreateRoot', - /** - * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER_BEFORE - * @type string - * @static - * @final - */ - APP_RENDER_BEFORE: 'appRenderBefore', - /** - * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER - * @type string - * @static - * @final - */ - APP_RENDER: 'appRender', - /** - * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). - * @property APP_RENDER_AFTER - * @type string - * @static - * @final - */ - APP_RENDER_AFTER: 'appRenderAfter', - /** - * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY_BEFORE - * @type string - * @static - * @final - */ - APP_DESTROY_BEFORE: 'appDestroyBefore', - /** - * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY - * @type string - * @static - * @final - */ - APP_DESTROY: 'appDestroy', - /** - * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). - * @property APP_DESTROY_AFTER - * @type string - * @static - * @final - */ - APP_DESTROY_AFTER: 'appDestroyAfter' + return { + /** + * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_CREATE_ROOT + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_CREATE_ROOT, + * function(appConfig) + * { + * // If you want to create a custom root. By default F2 uses the app's outter most HTML element. + * // the app's html is not available until after the manifest is retrieved so this logic occurse in F2.Constants.AppHandlers.APP_RENDER + * appConfig.root = jQuery('
    ').get(0); + * } + * ); + */ + APP_CREATE_ROOT: 'appCreateRoot', + /** + * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_RENDER_BEFORE + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER_BEFORE, + * function(appConfig) + * { + * F2.log(appConfig); + * } + * ); + */ + APP_RENDER_BEFORE: 'appRenderBefore', + /** + * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}}, [appHtml](../../app-development.html#app-design) ) + * @property APP_RENDER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER, + * function(appConfig, appHtml) + * { + * var $root = null; + * + * // if no app root is defined use the apps outter most node + * if(!F2.isNativeDOMNode(appConfig.root)) + * { + * appConfig.root = jQuery(appHtml).get(0); + * // get a handle on the root in jQuery + * $root = jQuery(appConfig.root); + * } + * else + * { + * // get a handle on the root in jQuery + * $root = jQuery(appConfig.root); + * + * // append the app html to the root + * $root.append(appHtml); + * } + * + * // append the root to the body by default. + * jQuery('body').append($root); + * } + * ); + */ + APP_RENDER: 'appRender', + /** + * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_RENDER_AFTER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER_AFTER, + * function(appConfig) + * { + * F2.log(appConfig); + * } + * ); + */ + APP_RENDER_AFTER: 'appRenderAfter', + /** + * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY_BEFORE + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + * function(appInstance) + * { + * F2.log(appInstance); + * } + * ); + */ + APP_DESTROY_BEFORE: 'appDestroyBefore', + /** + * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY, + * function(appInstance) + * { + * // call the apps destroy method, if it has one + * if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') + * { + * appInstance.app.destroy(); + * } + * else if(appInstance && appInstance.app && appInstance.app.destroy) + * { + * F2.log(appInstance.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); + * } + * + * // fade out and remove the root + * jQuery(appInstance.config.root).fadeOut(500, function() { + * jQuery(this).remove(); + * }); + * } + * ); + */ + APP_DESTROY: 'appDestroy', + /** + * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY_AFTER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY_AFTER, + * function(appInstance) + * { + * F2.log(appInstance); + * } + * ); + */ + APP_DESTROY_AFTER: 'appDestroyAfter' + }; } }); /** diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index 7a9f03e1..66e3f1a6 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -276,7 +276,7 @@ F2.extend('AppHandlers', (function() { * @example * var sToken = F2.AppHandlers.getToken(); * - * F2.AppHandlers.on( + * F2.AppHandlers.on( * sToken, * 'appRender', * document.getElementById('my_container') @@ -284,7 +284,7 @@ F2.extend('AppHandlers', (function() { * * // or * - * F2.AppHandlers.on( + * F2.AppHandlers.on( * sToken, * 'appRender.myNamespace', * document.getElementById('my_container') @@ -300,7 +300,7 @@ F2.extend('AppHandlers', (function() { * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event occurs. For detailed argument definition refer to {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. * @example - * var sToken = F2.AppHandlers.getToken(); + * var sToken = F2.AppHandlers.getToken(); * * F2.AppHandlers.on( * sToken, @@ -402,32 +402,32 @@ F2.extend('AppHandlers', (function() { F2.extend('Constants', { /** - * A convenient collection of all available appHandler events. - * @class F2.Constants.AppHandlers - */ + * A convenient collection of all available appHandler events. + * @class F2.Constants.AppHandlers + **/ AppHandlers: function() { return { /** - * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). - * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the - * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) - * @property APP_CREATE_ROOT - * @type string - * @static - * @final - * @example - * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), - * F2.Constants.AppHandlers.APP_CREATE_ROOT, - * function(appConfig) - * { - * // If you want to create a custom root. By default F2 uses the app's outter most HTML element. - * // the app's html is not available until after the manifest is retrieved so this logic occurse in F2.Constants.AppHandlers.APP_RENDER - * appConfig.root = jQuery('
    ').get(0); - * } - * ); - */ + * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_CREATE_ROOT + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_CREATE_ROOT, + * function(appConfig) + * { + * // If you want to create a custom root. By default F2 uses the app's outter most HTML element. + * // the app's html is not available until after the manifest is retrieved so this logic occurse in F2.Constants.AppHandlers.APP_RENDER + * appConfig.root = jQuery('
    ').get(0); + * } + * ); + */ APP_CREATE_ROOT: 'appCreateRoot', /** * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). @@ -444,137 +444,137 @@ F2.extend('Constants', { * function(appConfig) * { * F2.log(appConfig); - * } + * } * ); */ APP_RENDER_BEFORE: 'appRenderBefore', /** - * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). - * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the - * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}}, [appHtml](../../app-development.html#app-design) ) - * @property APP_RENDER - * @type string - * @static - * @final - * @example - * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), - * F2.Constants.AppHandlers.APP_RENDER, - * function(appConfig, appHtml) - * { - * var $root = null; - * - * // if no app root is defined use the apps outter most node - * if(!F2.isNativeDOMNode(appConfig.root)) - * { - * appConfig.root = jQuery(appHtml).get(0); - * // get a handle on the root in jQuery - * $root = jQuery(appConfig.root); - * } - * else - * { - * // get a handle on the root in jQuery - * $root = jQuery(appConfig.root); - * - * // append the app html to the root - * $root.append(appHtml); - * } - * - * // append the root to the body by default. - * jQuery('body').append($root); - * } - * ); - */ + * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}}, [appHtml](../../app-development.html#app-design) ) + * @property APP_RENDER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER, + * function(appConfig, appHtml) + * { + * var $root = null; + * + * // if no app root is defined use the apps outter most node + * if(!F2.isNativeDOMNode(appConfig.root)) + * { + * appConfig.root = jQuery(appHtml).get(0); + * // get a handle on the root in jQuery + * $root = jQuery(appConfig.root); + * } + * else + * { + * // get a handle on the root in jQuery + * $root = jQuery(appConfig.root); + * + * // append the app html to the root + * $root.append(appHtml); + * } + * + * // append the root to the body by default. + * jQuery('body').append($root); + * } + * ); + */ APP_RENDER: 'appRender', /** - * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). - * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the - * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) - * @property APP_RENDER_AFTER - * @type string - * @static - * @final - * @example - * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), - * F2.Constants.AppHandlers.APP_RENDER_AFTER, - * function(appConfig) - * { - * F2.log(appConfig); - * } - * ); - */ + * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) + * @property APP_RENDER_AFTER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_RENDER_AFTER, + * function(appConfig) + * { + * F2.log(appConfig); + * } + * ); + */ APP_RENDER_AFTER: 'appRenderAfter', /** - * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). - * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the - * following argument(s): ( appInstance ) - * @property APP_DESTROY_BEFORE - * @type string - * @static - * @final - * @example - * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), - * F2.Constants.AppHandlers.APP_DESTROY_BEFORE, - * function(appInstance) - * { - * F2.log(appInstance); - * } - * ); - */ + * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY_BEFORE + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY_BEFORE, + * function(appInstance) + * { + * F2.log(appInstance); + * } + * ); + */ APP_DESTROY_BEFORE: 'appDestroyBefore', /** - * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). - * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the - * following argument(s): ( appInstance ) - * @property APP_DESTROY - * @type string - * @static - * @final - * @example - * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), - * F2.Constants.AppHandlers.APP_DESTROY, - * function(appInstance) - * { - * // call the apps destroy method, if it has one - * if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') - * { - * appInstance.app.destroy(); - * } - * else if(appInstance && appInstance.app && appInstance.app.destroy) - * { - * F2.log(appInstance.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); - * } - * - * // fade out and remove the root - * jQuery(appInstance.config.root).fadeOut(500, function() { - * jQuery(this).remove(); - * }); - * } - * ); - */ + * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY, + * function(appInstance) + * { + * // call the apps destroy method, if it has one + * if(appInstance && appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function') + * { + * appInstance.app.destroy(); + * } + * else if(appInstance && appInstance.app && appInstance.app.destroy) + * { + * F2.log(appInstance.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); + * } + * + * // fade out and remove the root + * jQuery(appInstance.config.root).fadeOut(500, function() { + * jQuery(this).remove(); + * }); + * } + * ); + */ APP_DESTROY: 'appDestroy', /** - * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). - * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the - * following argument(s): ( appInstance ) - * @property APP_DESTROY_AFTER - * @type string - * @static - * @final - * @example - * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), - * F2.Constants.AppHandlers.APP_DESTROY_AFTER, - * function(appInstance) - * { - * F2.log(appInstance); - * } - * ); - */ + * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the + * following argument(s): ( appInstance ) + * @property APP_DESTROY_AFTER + * @type string + * @static + * @final + * @example + * F2.AppHandlers.on( + * F2.AppHandlers.getToken(), + * F2.Constants.AppHandlers.APP_DESTROY_AFTER, + * function(appInstance) + * { + * F2.log(appInstance); + * } + * ); + */ APP_DESTROY_AFTER: 'appDestroyAfter' - } + }; } }); \ No newline at end of file From b6cad57e643e9cb5996431fdf42814e8ed572985 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Mon, 3 Jun 2013 11:29:07 -0600 Subject: [PATCH 153/181] Resolved issues with F2.Constants.AppHandlers not being a closure that executes immediately which in turn resolved tests not running. --- sdk/f2.debug.js | 4 ++-- sdk/f2.min.js | 2 +- sdk/f2.min.map | 2 +- sdk/f2.no-third-party.js | 4 ++-- sdk/src/app_handlers.js | 4 ++-- tests/spec/container-spec.js | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index 118497d0..caf67778 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -14038,7 +14038,7 @@ F2.extend('Constants', { * A convenient collection of all available appHandler events. * @class F2.Constants.AppHandlers **/ - AppHandlers: function() + AppHandlers: (function() { return { /** @@ -14209,7 +14209,7 @@ F2.extend('Constants', { */ APP_DESTROY_AFTER: 'appDestroyAfter' }; - } + })() }); /** * Class stubs for documentation purposes diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 64c7330b..1a1c26f1 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -116,5 +116,5 @@ function(a,b,c,d,e,f){function g(a,b){var c=typeof a[b];return"function"==c||!(" * in the terms and conditions related to the specific Third Party Material, if any. * */ -var F2;F2=function(){var a=function(a,c){function d(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}return c=b(c||""),a=b(a||""),c&&a?(c.protocol||a.protocol)+(c.protocol||c.authority?c.authority:a.authority)+d(c.protocol||c.authority||"/"===c.pathname.charAt(0)?c.pathname:c.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+c.pathname:a.pathname)+(c.protocol||c.authority||c.pathname?c.search:c.search||a.search)+c.hash:null},b=function(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null};return{appConfigReplacer:function(a,b){return"root"==a||"ui"==a||"height"==a?void 0:b},Apps:{},extend:function(a,b,c){var d="function"==typeof b,e=a?a.split("."):[],f=this;b=b||{},"F2"===e[0]&&(e=e.slice(1));for(var g=0,h=e.length;h>g;g++)f[e[g]]||(f[e[g]]=d&&g+1==h?b:{}),f=f[e[g]];if(!d)for(var i in b)("undefined"==typeof f[i]||c)&&(f[i]=b[i]);return f},guid:function(){var a=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},inArray:function(a,b){return jQuery.inArray(a,b)>-1},isLocalRequest:function(b){var c,d,e=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,f=b.toLowerCase(),g=e.exec(f);try{c=location.href}catch(h){c=document.createElement("a"),c.href="",c=c.href}c=c.toLowerCase(),g||(f=a(c,f).toLowerCase(),g=e.exec(f)),d=e.exec(c)||[];var i=!(g&&(g[1]!==d[1]||g[2]!==d[2]||(g[3]||("http:"===g[1]?"80":"443"))!==(d[3]||("http:"===d[1]?"80":"443"))));return i},isNativeDOMNode:function(a){var b="object"==typeof Node?a instanceof Node:a&&"object"==typeof a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName,c="object"==typeof HTMLElement?a instanceof HTMLElement:a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName;return b||c},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(a){return JSON.parse(a)},stringify:function(a,b,c){return JSON.stringify(a,b,c)},version:function(){return"{{sdk.version}}"}}}(),F2.extend("AppHandlers",function(){var a=F2.guid(),b=F2.guid(),c={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},d={appRender:function(a,b){var c=null;F2.isNativeDOMNode(a.root)?(c=jQuery(a.root),c.append(b)):(a.root=jQuery(b).get(0),c=jQuery(a.root)),jQuery("body").append(c)},appDestroy:function(a){a&&a.app&&a.app.destroy&&"function"==typeof a.app.destroy?a.app.destroy():a&&a.app&&a.app.destroy&&F2.log(a.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(a.config.root).fadeOut(500,function(){jQuery(this).remove()})}},e=function(a,b,c,d){f(a);var e={func:c,namespace:b,domNode:F2.isNativeDOMNode(c)?c:null};if(!e.func&&!e.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(e.domNode&&!d)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return e},f=function(c){if(a!=c&&b!=c)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},g=function(a,b,d){if(f(a),d||b)if(!d&&b)c[b]=[];else if(d&&!b){d=d.toLowerCase();for(var e in c){for(var g=c[e],h=[],i=0,j=g.length;j>i;i++){var k=g[i];k&&(k.namespace&&k.namespace.toLowerCase()==d||h.push(k))}g=h}}else if(d&&c[b]){d=d.toLowerCase();for(var l=[],m=0,n=c[b].length;n>m;m++){var o=c[b][m];o&&(o.namespace&&o.namespace.toLowerCase()==d||l.push(o))}c[b]=l}};return{getToken:function(){return delete this.getToken,a},__f2GetToken:function(){return delete this.__f2GetToken,b},__trigger:function(a,e){if(a!=b)throw"Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().";if(!c||!c[e])throw"Invalid EventKey passed. Check your inputs and try again.";for(var f=[],g=2,h=arguments.length;h>g;g++)f.push(arguments[g]);if(0===c[e].length&&d[e])return d[e].apply(F2,f),this;if(0===c[e].length&&!c[e])return this;for(var i=0,j=c[e].length;j>i;i++){var k=c[e][i];if(k.domNode&&arguments[2]&&arguments[2].root&&arguments[3]){var l=jQuery(arguments[2].root).append(arguments[3]);jQuery(k.domNode).append(l)}else k.func.apply(F2,f)}return this},on:function(a,b,d){var f=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var g=b.split(".");b=g[0],f=g[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return c[b].push(e(a,f,d,"appRender"==b)),this},off:function(a,b){var d=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var e=b.split(".");b=e[0],d=e[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return g(a,b,d),this}}}()),F2.extend("Constants",{AppHandlers:function(){return{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}}),F2.extend("",{App:function(){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:void 0,ui:void 0,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(){},appRender:function(){},beforeAppRender:function(){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},xhr:{dataType:function(){},type:function(){},url:function(){}}}}),F2.extend("Constants",{Css:function(){var a="f2-";return{APP:a+"app",APP_CONTAINER:a+"app-container",APP_TITLE:a+"app-title",APP_VIEW:a+"app-view",APP_VIEW_TRIGGER:a+"app-view-trigger",MASK:a+"mask",MASK_CONTAINER:a+"mask-container"}}(),Events:function(){var a="App.",b="Container.";return{APP_SYMBOL_CHANGE:a+"symbolChange",APP_WIDTH_CHANGE:a+"widthChange.",CONTAINER_SYMBOL_CHANGE:b+"symbolChange",CONTAINER_WIDTH_CHANGE:b+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}),F2.extend("Events",function(){var a=new EventEmitter2({wildcard:!0});return a.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},many:function(b,c,d){return a.many(b,c,d)},off:function(b,c){return a.off(b,c)},on:function(b,c){return a.on(b,c)},once:function(b,c){return a.once(b,c)}}}()),F2.extend("Rpc",function(){var a={},b="",c={},d=new RegExp("^"+F2.Constants.Sockets.EVENT),e=new RegExp("^"+F2.Constants.Sockets.RPC),f=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),g=new RegExp("^"+F2.Constants.Sockets.LOAD),h=new RegExp("^"+F2.Constants.Sockets.UI_RPC),i=function(){var a,b=!1,d=[],e=new easyXDM.Socket({onMessage:function(f,h){if(!b&&g.test(f)){f=f.replace(g,"");var i=F2.parse(f);2==i.length&&(a=i[0],c[a.instanceId]={config:a,socket:e},F2.registerApps([a],[i[1]]),jQuery.each(d,function(){l(a,f,h)}),b=!0)}else b?l(a,f,h):d.push(f)}})},j=function(a,c){var d=jQuery(a.root);if(d.is("."+F2.Constants.Css.APP_CONTAINER)||d.find("."+F2.Constants.Css.APP_CONTAINER),!d.length)return F2.log("Unable to locate app in order to establish secure connection."),void 0;var e={scrolling:"no",style:{width:"100%"}};a.height&&(e.style.height=a.height+"px");var f=new easyXDM.Socket({remote:b,container:d.get(0),props:e,onMessage:function(b,c){l(a,b,c)},onReady:function(){f.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([a,c],F2.appConfigReplacer))}});return f},k=function(a,b){return function(){F2.Rpc.call(a,F2.Constants.Sockets.RPC_CALLBACK,b,[].slice.call(arguments).slice(2))}},l=function(b,c){function g(a,b){for(var c=String(b).split("."),d=0;d','",'",'","
    "].join("")},c=function(a){return['"].join("")};return{alert:function(c,d){return F2.isInit()?(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(a(c)).on("show",function(){var a=this;jQuery(a).find(".btn-primary").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.alert()"),void 0)},confirm:function(a,d,e){return F2.isInit()?(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(c(a)).on("show",function(){var a=this;jQuery(a).find(".btn-ok").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()}),jQuery(a).find(".btn-cancel").on("click",function(){jQuery(a).modal("hide").remove(),(e||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.confirm()"),void 0)}}}(),setTitle:function(a){F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[a]):jQuery(b.root).find("."+F2.Constants.Css.APP_TITLE).text(a)},showMask:function(a,c){F2.UI.showMask(b.instanceId,a,c)},updateHeight:d,Views:function(){var a=new EventEmitter2,e=/change/i;a.setMaxListeners(0);var f=function(a){return e.test(a)?!0:(F2.log('"'+a+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(e){"function"==typeof e?this.on("change",e):"string"==typeof e&&(b.isSecure&&!F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(e,b.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,c).addClass("hide").filter('[data-f2-view="'+e+'"]',c).removeClass("hide"),d(),a.emit("change",e)))},off:function(b,c){f(b)&&a.off(b,c)},on:function(b,c){f(b)&&a.on(b,c)}}}()}};return b.hideMask=function(a,b){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.hideMask()"),void 0;if(F2.Rpc.isRemote(a)&&!jQuery(b).is("."+F2.Constants.Css.APP))F2.Rpc.call(a,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[a,jQuery(b).selector]);else{var c=jQuery(b);c.find("> ."+F2.Constants.Css.MASK).remove(),c.removeClass(F2.Constants.Css.MASK_CONTAINER),c.data(F2.Constants.Css.MASK_CONTAINER)&&c.css({position:"static"})}},b.init=function(b){a=b,a.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,a.UI||{})},b.showMask=function(b,c,d){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.showMask()"),void 0;if(F2.Rpc.isRemote(b)&&jQuery(c).is("."+F2.Constants.Css.APP))F2.Rpc.call(b,F2.Constants.Sockets.RPC,"F2.UI.showMask",[b,jQuery(c).selector,d]);else{d&&!a.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var e=jQuery(c).addClass(F2.Constants.Css.MASK_CONTAINER),f=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);a.UI.Mask.useClasses||f.css({"background-color":a.UI.Mask.backgroundColor,"background-image":a.UI.Mask.loadingIcon?"url("+a.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":a.UI.Mask.zIndex,filter:"alpha(opacity="+100*a.UI.Mask.opacity+")",opacity:a.UI.Mask.opacity}),"static"===e.css("position")&&(e.css({position:"relative"}),e.data(F2.Constants.Css.MASK_CONTAINER,!0)),e.append(f)}},b}()),F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(a,b){var c=_config.afterAppRender||function(a,b){return jQuery(b).appendTo("body")},d=c(a,b);return _config.afterAppRender&&!d?(F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app"),void 0):(jQuery(d).addClass(F2.Constants.Css.APP),d.get(0))},_appRender=function(a,b){return b=_outerHtml(jQuery(b).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)),_config.appRender&&(b=_config.appRender(a,b)),_outerHtml(b)},_beforeAppRender=function(a){var b=_config.beforeAppRender||jQuery.noop;return b(a)},_hydrateAppConfig=function(a){a.instanceId=a.instanceId||F2.guid(),a.views=a.views||[],F2.inArray(F2.Constants.Views.HOME,a.views)||a.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(a){jQuery(a.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(b){b.preventDefault();var c=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();c==F2.Constants.Views.REMOVE?F2.removeApp(a.instanceId):a.ui.Views.change(c)})},_initContainerEvents=function(){var a,b=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(a),a=setTimeout(b,100)})},_isInit=function(){return!!_config},_createAppInstance=function(a,b){a.ui=new F2.UI(a),void 0!==F2.Apps[a.appId]&&("function"==typeof F2.Apps[a.appId]?setTimeout(function(){_apps[a.instanceId].app=new F2.Apps[a.appId](a,b,a.root),void 0!==_apps[a.instanceId].app.init&&_apps[a.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+a.appId+")"))},_loadApps=function(appConfigs,appManifest){if(appConfigs=[].concat(appConfigs),1==appConfigs.length&&appConfigs[0].isSecure&&!_config.isSecureAppPage)return _loadSecureApp(appConfigs[0],appManifest),void 0;if(appConfigs.length!=appManifest.apps.length)return F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest),void 0;var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(a,b){_createAppInstance(b,appManifest.apps[a])})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(a,b){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(a,b){if(_bUsesAppHandlers){if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[a],_outerHtml(b.html)),!appConfigs[a].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var c=jQuery(appConfigs[a].root);if(0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[a]),!F2.isNativeDOMNode(appConfigs[a].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";c.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[a].appId)}else appConfigs[a].root=_afterAppRender(appConfigs[a],_appRender(appConfigs[a],b.html));_initAppEvents(appConfigs[a])}),jQuery.each(scripts,function(a,b){jQuery.ajax({url:b,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(a,c,d){F2.log(["Failed to load script ("+b+")",d.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(a,b){if(_config.secureAppPagePath){if(_bUsesAppHandlers){var c=jQuery(a.root);if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,a,b.html),0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,a),!a.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(a.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(a.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)}else a.root=_afterAppRender(a,_appRender(a,"
    "));a.ui=new F2.UI(a),_initAppEvents(a),F2.Rpc.register(a,b)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_outerHtml=function(a){return jQuery("
    ").append(a).html()},_validateApp=function(a){return a.appId?a.root||a.manifestUrl?!0:(F2.log('"manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)},_validateContainerConfig=function(){if(_config&&_config.xhr){if("function"!=typeof _config.xhr&&"object"!=typeof _config.xhr)throw"ContainerConfig.xhr should be a function or an object";if(_config.xhr.dataType&&"function"!=typeof _config.xhr.dataType)throw"ContainerConfig.xhr.dataType should be a function";if(_config.xhr.type&&"function"!=typeof _config.xhr.type)throw"ContainerConfig.xhr.type should be a function";if(_config.xhr.url&&"function"!=typeof _config.xhr.url)throw"ContainerConfig.xhr.url should be a function"}return!0};return{getContainerState:function(){return _isInit()?jQuery.map(_apps,function(a){return{appId:a.config.appId}}):(F2.log("F2.init() must be called before F2.getContainerState()"),void 0)},init:function(a){_config=a||{},_validateContainerConfig(),_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(a,b){if(!_isInit())return F2.log("F2.init() must be called before F2.registerApps()"),void 0;if(!a)return F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0;var c=[],d={},e={},f=!1;return a=[].concat(a),b=[].concat(b||[]),f=!!b.length,a.length?a.length&&f&&a.length!=b.length?(F2.log('The length of "apps" does not equal the length of "appManifests"'),void 0):(jQuery.each(a,function(a,e){if(_hydrateAppConfig(e),e.root=e.root||null,_validateApp(e)){if(_apps[e.instanceId]={config:e},e.root){if(!e.root&&"string"!=typeof e.root&&!F2.isNativeDOMNode(e.root))throw F2.log("AppConfig invalid for pre-load, not a valid string and not dom node"),F2.log("AppConfig instance:",e),"Preloaded appConfig.root property must be a native dom node or a string representing a sizzle selector. Please check your inputs and try again.";if(1!=jQuery(e.root).length)throw F2.log("AppConfig invalid for pre-load, root not unique"),F2.log("AppConfig instance:",e),F2.log("Number of dom node instances:",jQuery(e.root).length),"Preloaded appConfig.root property must map to a unique dom node. Please check your inputs and try again.";return _createAppInstance(e),_initAppEvents(e),void 0}_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,e),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,e)):e.root=_beforeAppRender(e),f?_loadApps(e,b[a]):e.enableBatchRequests&&!e.isSecure?(d[e.manifestUrl.toLowerCase()]=d[e.manifestUrl.toLowerCase()]||[],d[e.manifestUrl.toLowerCase()].push(e)):c.push({apps:[e],url:e.manifestUrl})}}),f||(jQuery.each(d,function(a,b){c.push({url:a,apps:b})}),jQuery.each(c,function(a,b){var c=F2.Constants.JSONP_CALLBACK+b.apps[0].appId;e[c]=e[c]||[],e[c].push(b)}),jQuery.each(e,function(a,b){var c=function(d,e){if(e){var f=e.url,g="GET",h="jsonp",i=function(){c(a,b.pop())},j=function(){jQuery.each(e.apps,function(a,b){F2.log("Removed failed "+b.name+" app",b),F2.removeApp(b.instanceId)})},k=function(a){_loadApps(e.apps,a)};if(_config.xhr&&_config.xhr.dataType&&(h=_config.xhr.dataType(e.url,e.apps),"string"!=typeof h))throw"ContainerConfig.xhr.dataType should return a string";if(_config.xhr&&_config.xhr.type&&(g=_config.xhr.type(e.url,e.apps),"string"!=typeof g))throw"ContainerConfig.xhr.type should return a string";if(_config.xhr&&_config.xhr.url&&(f=_config.xhr.url(e.url,e.apps),"string"!=typeof f))throw"ContainerConfig.xhr.url should return a string";var l=_config.xhr;"function"!=typeof l&&(l=function(a,b,c,f,i){jQuery.ajax({url:a,type:g,data:{params:F2.stringify(e.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:d,dataType:h,success:c,error:function(a,b,c){F2.log("Failed to load app(s)",c.toString(),e.apps),f()},complete:i})}),l(f,e.apps,k,j,i)}};c(a,b.pop())})),void 0):(F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0)},removeAllApps:function(){return _isInit()?(jQuery.each(_apps,function(a,b){F2.removeApp(b.config.instanceId)}),void 0):(F2.log("F2.init() must be called before F2.removeAllApps()"),void 0)},removeApp:function(a){return _isInit()?(_apps[a]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[a]),delete _apps[a]),void 0):(F2.log("F2.init() must be called before F2.removeApp()"),void 0)}}}()),exports.F2=F2,"undefined"!=typeof define&&define.amd&&define(function(){return F2})}}("undefined"!=typeof exports?exports:window); +var F2;F2=function(){var a=function(a,c){function d(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}return c=b(c||""),a=b(a||""),c&&a?(c.protocol||a.protocol)+(c.protocol||c.authority?c.authority:a.authority)+d(c.protocol||c.authority||"/"===c.pathname.charAt(0)?c.pathname:c.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+c.pathname:a.pathname)+(c.protocol||c.authority||c.pathname?c.search:c.search||a.search)+c.hash:null},b=function(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null};return{appConfigReplacer:function(a,b){return"root"==a||"ui"==a||"height"==a?void 0:b},Apps:{},extend:function(a,b,c){var d="function"==typeof b,e=a?a.split("."):[],f=this;b=b||{},"F2"===e[0]&&(e=e.slice(1));for(var g=0,h=e.length;h>g;g++)f[e[g]]||(f[e[g]]=d&&g+1==h?b:{}),f=f[e[g]];if(!d)for(var i in b)("undefined"==typeof f[i]||c)&&(f[i]=b[i]);return f},guid:function(){var a=function(){return(0|65536*(1+Math.random())).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},inArray:function(a,b){return jQuery.inArray(a,b)>-1},isLocalRequest:function(b){var c,d,e=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,f=b.toLowerCase(),g=e.exec(f);try{c=location.href}catch(h){c=document.createElement("a"),c.href="",c=c.href}c=c.toLowerCase(),g||(f=a(c,f).toLowerCase(),g=e.exec(f)),d=e.exec(c)||[];var i=!(g&&(g[1]!==d[1]||g[2]!==d[2]||(g[3]||("http:"===g[1]?"80":"443"))!==(d[3]||("http:"===d[1]?"80":"443"))));return i},isNativeDOMNode:function(a){var b="object"==typeof Node?a instanceof Node:a&&"object"==typeof a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName,c="object"==typeof HTMLElement?a instanceof HTMLElement:a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName;return b||c},log:function(){window.console&&window.console.log&&console.log([].slice.call(arguments))},parse:function(a){return JSON.parse(a)},stringify:function(a,b,c){return JSON.stringify(a,b,c)},version:function(){return"{{sdk.version}}"}}}(),F2.extend("AppHandlers",function(){var a=F2.guid(),b=F2.guid(),c={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[]},d={appRender:function(a,b){var c=null;F2.isNativeDOMNode(a.root)?(c=jQuery(a.root),c.append(b)):(a.root=jQuery(b).get(0),c=jQuery(a.root)),jQuery("body").append(c)},appDestroy:function(a){a&&a.app&&a.app.destroy&&"function"==typeof a.app.destroy?a.app.destroy():a&&a.app&&a.app.destroy&&F2.log(a.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(a.config.root).fadeOut(500,function(){jQuery(this).remove()})}},e=function(a,b,c,d){f(a);var e={func:c,namespace:b,domNode:F2.isNativeDOMNode(c)?c:null};if(!e.func&&!e.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(e.domNode&&!d)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return e},f=function(c){if(a!=c&&b!=c)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},g=function(a,b,d){if(f(a),d||b)if(!d&&b)c[b]=[];else if(d&&!b){d=d.toLowerCase();for(var e in c){for(var g=c[e],h=[],i=0,j=g.length;j>i;i++){var k=g[i];k&&(k.namespace&&k.namespace.toLowerCase()==d||h.push(k))}g=h}}else if(d&&c[b]){d=d.toLowerCase();for(var l=[],m=0,n=c[b].length;n>m;m++){var o=c[b][m];o&&(o.namespace&&o.namespace.toLowerCase()==d||l.push(o))}c[b]=l}};return{getToken:function(){return delete this.getToken,a},__f2GetToken:function(){return delete this.__f2GetToken,b},__trigger:function(a,e){if(a!=b)throw"Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().";if(!c||!c[e])throw"Invalid EventKey passed. Check your inputs and try again.";for(var f=[],g=2,h=arguments.length;h>g;g++)f.push(arguments[g]);if(0===c[e].length&&d[e])return d[e].apply(F2,f),this;if(0===c[e].length&&!c[e])return this;for(var i=0,j=c[e].length;j>i;i++){var k=c[e][i];if(k.domNode&&arguments[2]&&arguments[2].root&&arguments[3]){var l=jQuery(arguments[2].root).append(arguments[3]);jQuery(k.domNode).append(l)}else k.func.apply(F2,f)}return this},on:function(a,b,d){var f=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var g=b.split(".");b=g[0],f=g[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return c[b].push(e(a,f,d,"appRender"==b)),this},off:function(a,b){var d=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var e=b.split(".");b=e[0],d=e[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return g(a,b,d),this}}}()),F2.extend("Constants",{AppHandlers:function(){return{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter"}}()}),F2.extend("",{App:function(){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:void 0,ui:void 0,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(){},appRender:function(){},beforeAppRender:function(){},isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},xhr:{dataType:function(){},type:function(){},url:function(){}}}}),F2.extend("Constants",{Css:function(){var a="f2-";return{APP:a+"app",APP_CONTAINER:a+"app-container",APP_TITLE:a+"app-title",APP_VIEW:a+"app-view",APP_VIEW_TRIGGER:a+"app-view-trigger",MASK:a+"mask",MASK_CONTAINER:a+"mask-container"}}(),Events:function(){var a="App.",b="Container.";return{APP_SYMBOL_CHANGE:a+"symbolChange",APP_WIDTH_CHANGE:a+"widthChange.",CONTAINER_SYMBOL_CHANGE:b+"symbolChange",CONTAINER_WIDTH_CHANGE:b+"widthChange"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}),F2.extend("Events",function(){var a=new EventEmitter2({wildcard:!0});return a.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},many:function(b,c,d){return a.many(b,c,d)},off:function(b,c){return a.off(b,c)},on:function(b,c){return a.on(b,c)},once:function(b,c){return a.once(b,c)}}}()),F2.extend("Rpc",function(){var a={},b="",c={},d=new RegExp("^"+F2.Constants.Sockets.EVENT),e=new RegExp("^"+F2.Constants.Sockets.RPC),f=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),g=new RegExp("^"+F2.Constants.Sockets.LOAD),h=new RegExp("^"+F2.Constants.Sockets.UI_RPC),i=function(){var a,b=!1,d=[],e=new easyXDM.Socket({onMessage:function(f,h){if(!b&&g.test(f)){f=f.replace(g,"");var i=F2.parse(f);2==i.length&&(a=i[0],c[a.instanceId]={config:a,socket:e},F2.registerApps([a],[i[1]]),jQuery.each(d,function(){l(a,f,h)}),b=!0)}else b?l(a,f,h):d.push(f)}})},j=function(a,c){var d=jQuery(a.root);if(d.is("."+F2.Constants.Css.APP_CONTAINER)||d.find("."+F2.Constants.Css.APP_CONTAINER),!d.length)return F2.log("Unable to locate app in order to establish secure connection."),void 0;var e={scrolling:"no",style:{width:"100%"}};a.height&&(e.style.height=a.height+"px");var f=new easyXDM.Socket({remote:b,container:d.get(0),props:e,onMessage:function(b,c){l(a,b,c)},onReady:function(){f.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([a,c],F2.appConfigReplacer))}});return f},k=function(a,b){return function(){F2.Rpc.call(a,F2.Constants.Sockets.RPC_CALLBACK,b,[].slice.call(arguments).slice(2))}},l=function(b,c){function g(a,b){for(var c=String(b).split("."),d=0;d','",'",'","
    "].join("")},c=function(a){return['"].join("")};return{alert:function(c,d){return F2.isInit()?(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(a(c)).on("show",function(){var a=this;jQuery(a).find(".btn-primary").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.alert()"),void 0)},confirm:function(a,d,e){return F2.isInit()?(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(c(a)).on("show",function(){var a=this;jQuery(a).find(".btn-ok").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()}),jQuery(a).find(".btn-cancel").on("click",function(){jQuery(a).modal("hide").remove(),(e||jQuery.noop)()})}).modal({backdrop:!0}),void 0):(F2.log("F2.init() must be called before F2.UI.Modals.confirm()"),void 0)}}}(),setTitle:function(a){F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[a]):jQuery(b.root).find("."+F2.Constants.Css.APP_TITLE).text(a)},showMask:function(a,c){F2.UI.showMask(b.instanceId,a,c)},updateHeight:d,Views:function(){var a=new EventEmitter2,e=/change/i;a.setMaxListeners(0);var f=function(a){return e.test(a)?!0:(F2.log('"'+a+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(e){"function"==typeof e?this.on("change",e):"string"==typeof e&&(b.isSecure&&!F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(e,b.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,c).addClass("hide").filter('[data-f2-view="'+e+'"]',c).removeClass("hide"),d(),a.emit("change",e)))},off:function(b,c){f(b)&&a.off(b,c)},on:function(b,c){f(b)&&a.on(b,c)}}}()}};return b.hideMask=function(a,b){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.hideMask()"),void 0;if(F2.Rpc.isRemote(a)&&!jQuery(b).is("."+F2.Constants.Css.APP))F2.Rpc.call(a,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[a,jQuery(b).selector]);else{var c=jQuery(b);c.find("> ."+F2.Constants.Css.MASK).remove(),c.removeClass(F2.Constants.Css.MASK_CONTAINER),c.data(F2.Constants.Css.MASK_CONTAINER)&&c.css({position:"static"})}},b.init=function(b){a=b,a.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,a.UI||{})},b.showMask=function(b,c,d){if(!F2.isInit())return F2.log("F2.init() must be called before F2.UI.showMask()"),void 0;if(F2.Rpc.isRemote(b)&&jQuery(c).is("."+F2.Constants.Css.APP))F2.Rpc.call(b,F2.Constants.Sockets.RPC,"F2.UI.showMask",[b,jQuery(c).selector,d]);else{d&&!a.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var e=jQuery(c).addClass(F2.Constants.Css.MASK_CONTAINER),f=jQuery("
    ").height("100%").width("100%").addClass(F2.Constants.Css.MASK);a.UI.Mask.useClasses||f.css({"background-color":a.UI.Mask.backgroundColor,"background-image":a.UI.Mask.loadingIcon?"url("+a.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":a.UI.Mask.zIndex,filter:"alpha(opacity="+100*a.UI.Mask.opacity+")",opacity:a.UI.Mask.opacity}),"static"===e.css("position")&&(e.css({position:"relative"}),e.data(F2.Constants.Css.MASK_CONTAINER,!0)),e.append(f)}},b}()),F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_afterAppRender=function(a,b){var c=_config.afterAppRender||function(a,b){return jQuery(b).appendTo("body")},d=c(a,b);return _config.afterAppRender&&!d?(F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app"),void 0):(jQuery(d).addClass(F2.Constants.Css.APP),d.get(0))},_appRender=function(a,b){return b=_outerHtml(jQuery(b).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)),_config.appRender&&(b=_config.appRender(a,b)),_outerHtml(b)},_beforeAppRender=function(a){var b=_config.beforeAppRender||jQuery.noop;return b(a)},_hydrateAppConfig=function(a){a.instanceId=a.instanceId||F2.guid(),a.views=a.views||[],F2.inArray(F2.Constants.Views.HOME,a.views)||a.views.push(F2.Constants.Views.HOME)},_initAppEvents=function(a){jQuery(a.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(b){b.preventDefault();var c=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();c==F2.Constants.Views.REMOVE?F2.removeApp(a.instanceId):a.ui.Views.change(c)})},_initContainerEvents=function(){var a,b=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(a),a=setTimeout(b,100)})},_isInit=function(){return!!_config},_createAppInstance=function(a,b){a.ui=new F2.UI(a),void 0!==F2.Apps[a.appId]&&("function"==typeof F2.Apps[a.appId]?setTimeout(function(){_apps[a.instanceId].app=new F2.Apps[a.appId](a,b,a.root),void 0!==_apps[a.instanceId].app.init&&_apps[a.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+a.appId+")"))},_loadApps=function(appConfigs,appManifest){if(appConfigs=[].concat(appConfigs),1==appConfigs.length&&appConfigs[0].isSecure&&!_config.isSecureAppPage)return _loadSecureApp(appConfigs[0],appManifest),void 0;if(appConfigs.length!=appManifest.apps.length)return F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest),void 0;var scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],scriptCount=scripts.length,scriptsLoaded=0,appInit=function(){jQuery.each(appConfigs,function(a,b){_createAppInstance(b,appManifest.apps[a])})},evalInlines=function(){jQuery.each(inlines,function(i,e){try{eval(e)}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+e)}})},stylesFragment=[];jQuery.each(styles,function(a,b){stylesFragment.push('')}),jQuery("head").append(stylesFragment.join("")),jQuery.each(appManifest.apps,function(a,b){if(_bUsesAppHandlers){if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[a],_outerHtml(b.html)),!appConfigs[a].root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";var c=jQuery(appConfigs[a].root);if(0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[a]),!F2.isNativeDOMNode(appConfigs[a].root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";c.addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[a].appId)}else appConfigs[a].root=_afterAppRender(appConfigs[a],_appRender(appConfigs[a],b.html));_initAppEvents(appConfigs[a])}),jQuery.each(scripts,function(a,b){jQuery.ajax({url:b,cache:!0,async:!1,dataType:"script",type:"GET",success:function(){++scriptsLoaded==scriptCount&&(evalInlines(),appInit())},error:function(a,c,d){F2.log(["Failed to load script ("+b+")",d.toString()])}})}),scriptCount||(evalInlines(),appInit())},_loadSecureApp=function(a,b){if(_config.secureAppPagePath){if(_bUsesAppHandlers){var c=jQuery(a.root);if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,a,b.html),0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,a),!a.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(a.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";jQuery(a.root).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)}else a.root=_afterAppRender(a,_appRender(a,"
    "));a.ui=new F2.UI(a),_initAppEvents(a),F2.Rpc.register(a,b)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_outerHtml=function(a){return jQuery("
    ").append(a).html()},_validateApp=function(a){return a.appId?a.root||a.manifestUrl?!0:(F2.log('"manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)},_validateContainerConfig=function(){if(_config&&_config.xhr){if("function"!=typeof _config.xhr&&"object"!=typeof _config.xhr)throw"ContainerConfig.xhr should be a function or an object";if(_config.xhr.dataType&&"function"!=typeof _config.xhr.dataType)throw"ContainerConfig.xhr.dataType should be a function";if(_config.xhr.type&&"function"!=typeof _config.xhr.type)throw"ContainerConfig.xhr.type should be a function";if(_config.xhr.url&&"function"!=typeof _config.xhr.url)throw"ContainerConfig.xhr.url should be a function"}return!0};return{getContainerState:function(){return _isInit()?jQuery.map(_apps,function(a){return{appId:a.config.appId}}):(F2.log("F2.init() must be called before F2.getContainerState()"),void 0)},init:function(a){_config=a||{},_validateContainerConfig(),_bUsesAppHandlers=!_config.beforeAppRender&&!_config.appRender&&!_config.afterAppRender,(_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,registerApps:function(a,b){if(!_isInit())return F2.log("F2.init() must be called before F2.registerApps()"),void 0;if(!a)return F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0;var c=[],d={},e={},f=!1;return a=[].concat(a),b=[].concat(b||[]),f=!!b.length,a.length?a.length&&f&&a.length!=b.length?(F2.log('The length of "apps" does not equal the length of "appManifests"'),void 0):(jQuery.each(a,function(a,e){if(_hydrateAppConfig(e),e.root=e.root||null,_validateApp(e)){if(_apps[e.instanceId]={config:e},e.root){if(!e.root&&"string"!=typeof e.root&&!F2.isNativeDOMNode(e.root))throw F2.log("AppConfig invalid for pre-load, not a valid string and not dom node"),F2.log("AppConfig instance:",e),"Preloaded appConfig.root property must be a native dom node or a string representing a sizzle selector. Please check your inputs and try again.";if(1!=jQuery(e.root).length)throw F2.log("AppConfig invalid for pre-load, root not unique"),F2.log("AppConfig instance:",e),F2.log("Number of dom node instances:",jQuery(e.root).length),"Preloaded appConfig.root property must map to a unique dom node. Please check your inputs and try again.";return _createAppInstance(e),_initAppEvents(e),void 0}_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,e),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,e)):e.root=_beforeAppRender(e),f?_loadApps(e,b[a]):e.enableBatchRequests&&!e.isSecure?(d[e.manifestUrl.toLowerCase()]=d[e.manifestUrl.toLowerCase()]||[],d[e.manifestUrl.toLowerCase()].push(e)):c.push({apps:[e],url:e.manifestUrl})}}),f||(jQuery.each(d,function(a,b){c.push({url:a,apps:b})}),jQuery.each(c,function(a,b){var c=F2.Constants.JSONP_CALLBACK+b.apps[0].appId;e[c]=e[c]||[],e[c].push(b)}),jQuery.each(e,function(a,b){var c=function(d,e){if(e){var f=e.url,g="GET",h="jsonp",i=function(){c(a,b.pop())},j=function(){jQuery.each(e.apps,function(a,b){F2.log("Removed failed "+b.name+" app",b),F2.removeApp(b.instanceId)})},k=function(a){_loadApps(e.apps,a)};if(_config.xhr&&_config.xhr.dataType&&(h=_config.xhr.dataType(e.url,e.apps),"string"!=typeof h))throw"ContainerConfig.xhr.dataType should return a string";if(_config.xhr&&_config.xhr.type&&(g=_config.xhr.type(e.url,e.apps),"string"!=typeof g))throw"ContainerConfig.xhr.type should return a string";if(_config.xhr&&_config.xhr.url&&(f=_config.xhr.url(e.url,e.apps),"string"!=typeof f))throw"ContainerConfig.xhr.url should return a string";var l=_config.xhr;"function"!=typeof l&&(l=function(a,b,c,f,i){jQuery.ajax({url:a,type:g,data:{params:F2.stringify(e.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:d,dataType:h,success:c,error:function(a,b,c){F2.log("Failed to load app(s)",c.toString(),e.apps),f()},complete:i})}),l(f,e.apps,k,j,i)}};c(a,b.pop())})),void 0):(F2.log("At least one AppConfig must be passed when calling F2.registerApps()"),void 0)},removeAllApps:function(){return _isInit()?(jQuery.each(_apps,function(a,b){F2.removeApp(b.config.instanceId)}),void 0):(F2.log("F2.init() must be called before F2.removeAllApps()"),void 0)},removeApp:function(a){return _isInit()?(_apps[a]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[a]),delete _apps[a]),void 0):(F2.log("F2.init() must be called before F2.removeApp()"),void 0)}}}()),exports.F2=F2,"undefined"!=typeof define&&define.amd&&define(function(){return F2})}}("undefined"!=typeof exports?exports:window); //# sourceMappingURL=f2.min.map diff --git a/sdk/f2.min.map b/sdk/f2.min.map index a6454ada..075696f7 100644 --- a/sdk/f2.min.map +++ b/sdk/f2.min.map @@ -1 +1 @@ -{"version":3,"file":"f2.min.js","sources":["f2.debug.js"],"names":["exports","F2","F2_TESTING_MODE","JSON","f","n","quote","string","escapable","lastIndex","test","replace","a","c","meta","charCodeAt","toString","slice","str","key","holder","i","k","v","length","partial","mind","gap","value","toJSON","rep","call","isFinite","String","indent","Object","prototype","apply","join","push","hasOwnProperty","Date","this","valueOf","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","Number","Boolean","cx","\b","\t","\n","\f","\r","\"","\\","stringify","replacer","space","Error","parse","text","reviver","walk","undefined","j","eval","SyntaxError","window","createOptions","options","object","optionsCache","jQuery","each","split","core_rspace","_","flag","dataAttr","elem","data","nodeType","name","rmultiDash","toLowerCase","getAttribute","rbrace","parseJSON","e","isEmptyDataObject","obj","isEmptyObject","returnFalse","returnTrue","isDisconnected","node","parentNode","sibling","cur","dir","winnow","elements","qualifier","keep","isFunction","grep","retVal","filtered","isSimple","filter","inArray","createSafeFragment","document","list","nodeNames","safeFrag","createDocumentFragment","createElement","pop","findOrAppend","tag","getElementsByTagName","appendChild","ownerDocument","cloneCopyEvent","src","dest","hasData","type","l","oldData","_data","curData","events","handle","event","add","extend","cloneFixAttributes","nodeName","clearAttributes","mergeAttributes","outerHTML","support","html5Clone","innerHTML","trim","rcheckableType","defaultChecked","checked","selected","defaultSelected","defaultValue","removeAttribute","expando","getAll","querySelectorAll","fixDefaultChecked","vendorPropName","style","capName","charAt","toUpperCase","origName","cssPrefixes","isHidden","el","css","contains","showHide","show","display","values","index","css_defaultDisplay","curCSS","setPositiveNumber","subtract","matches","rnumsplit","exec","Math","max","augmentWidthOrHeight","extra","isBorderBox","val","cssExpand","parseFloat","getWidthOrHeight","offsetWidth","offsetHeight","valueIsBorderBox","boxSizing","rnumnonpx","boxSizingReliable","elemdisplay","appendTo","body","remove","iframe","frameBorder","width","height","iframeDoc","contentWindow","contentDocument","write","close","removeChild","buildParams","prefix","traditional","isArray","rbracket","addToPrefiltersOrTransports","structure","dataTypeExpression","func","dataType","placeBefore","dataTypes","substr","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","selection","executeOnly","prefilters","unshift","ajaxExtend","target","deep","flatOptions","ajaxSettings","ajaxHandleResponses","s","responses","ct","finalDataType","firstDataType","contents","responseFields","shift","mimeType","getResponseHeader","converters","ajaxConvert","response","conv","conv2","current","tmp","prev","dataFilter","splice","state","error","createStandardXHR","XMLHttpRequest","createActiveXHR","ActiveXObject","createFxNow","setTimeout","fxNow","now","createTweens","animation","props","prop","collection","tweeners","concat","Animation","properties","result","animationPrefilters","deferred","Deferred","always","tick","currentTime","remaining","startTime","duration","temp","percent","tweens","run","notifyWith","resolveWith","promise","opts","specialEasing","originalProperties","createTween","end","tween","Tween","easing","stop","gotoEnd","rejectWith","propFilter","start","fx","timer","anim","queue","progress","done","complete","fail","hooks","camelCase","cssHooks","expand","defaultPrefilter","dataShow","toggle","oldfire","orig","handled","hidden","_queueHooks","unqueued","empty","fire","overflow","overflowX","overflowY","inlineBlockNeedsLayout","zoom","shrinkWrapBlocks","rfxtypes","hide","removeData","init","genFx","includeWidth","which","attrs","opacity","getWindow","isWindow","defaultView","parentWindow","rootjQuery","readyList","location","navigator","_jQuery","_$","$","core_push","Array","core_slice","core_indexOf","indexOf","core_toString","core_hasOwn","core_trim","selector","context","fn","core_pnum","source","core_rnotwhite","rtrim","rquickExpr","rsingleTag","rvalidchars","rvalidbraces","rvalidescape","rvalidtokens","rmsPrefix","rdashAlpha","fcamelCase","all","letter","DOMContentLoaded","addEventListener","removeEventListener","ready","readyState","detachEvent","class2type","constructor","match","doc","jquery","find","parseHTML","isPlainObject","attr","merge","getElementById","id","makeArray","size","toArray","get","num","pushStack","elems","ret","prevObject","callback","args","eq","first","last","arguments","map","sort","copy","copyIsArray","clone","noConflict","isReady","readyWait","holdReady","hold","wait","trigger","off","isNumeric","isNaN","msg","scripts","parsed","buildFragment","cacheable","fragment","childNodes","Function","parseXML","xml","DOMParser","parseFromString","async","loadXML","documentElement","noop","globalEval","execScript","isObj","arr","results","len","second","inv","arg","guid","proxy","access","chainable","emptyGet","pass","bulk","getTime","attachEvent","top","frameElement","doScroll","doScrollCheck","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","stack","once","stopOnFalse","self","disable","unique","has","disabled","lock","locked","fireWith","tuples","then","fns","newDefer","tuple","action","returned","resolve","reject","notify","pipe","stateString","when","subordinate","progressValues","progressContexts","resolveContexts","resolveValues","updateFunc","contexts","select","opt","input","eventName","isSupported","clickFn","div","setAttribute","cssText","leadingWhitespace","firstChild","tbody","htmlSerialize","hrefNormalized","cssFloat","checkOn","optSelected","getSetAttribute","className","enctype","cloneNode","boxModel","compatMode","submitBubbles","changeBubbles","focusinBubbles","deleteExpando","noCloneEvent","reliableMarginRight","pixelPosition","noCloneChecked","optDisabled","fireEvent","radioValue","lastChild","checkClone","appendChecked","submit","change","focusin","container","tds","marginDiv","divReset","insertBefore","reliableHiddenOffsets","doesNotIncludeMarginInBodyOffset","offsetTop","getComputedStyle","marginRight","cache","deletedIds","uuid","random","noData","embed","applet","pvt","acceptData","thisCache","internalKey","getByName","isNode","cleanData","parts","part","attributes","substring","triggerHandler","dequeue","startLength","next","setter","delay","time","speeds","timeout","clearTimeout","clearQueue","count","defer","nodeHook","boolHook","fixSpecified","rclass","rreturn","rtype","rfocusable","rclickable","rboolean","removeAttr","removeProp","propFix","addClass","classNames","setClass","cl","removeClass","removes","toggleClass","stateVal","isBool","hasClass","valHooks","set","option","specified","selectedIndex","one","attrFn","notxml","nType","isXMLDoc","attrHooks","propName","attrNames","tabindex","readonly","for","class","maxlength","cellspacing","cellpadding","rowspan","colspan","usemap","frameborder","contenteditable","propHooks","tabIndex","attributeNode","getAttributeNode","parseInt","href","attrNode","property","nodeValue","coords","button","createAttribute","setAttributeNode","parent","rformElems","rtypenamespace","rhoverHack","rkeyEvent","rmouseEvent","rfocusMorph","hoverHack","special","hover","types","handler","elemData","eventHandle","t","tns","namespaces","handleObj","handleObjIn","handlers","triggered","dispatch","delegateType","bindType","origType","needsContext","expr","namespace","delegateCount","setup","global","mappedTypes","origCount","eventType","RegExp","teardown","removeEvent","customEvent","getData","setData","changeData","onlyHandlers","exclusive","old","ontype","eventPath","bubbleType","Event","isTrigger","namespace_re","noBubble","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","selMatch","matched","sel","run_all","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","fixHooks","keyHooks","original","charCode","keyCode","mouseHooks","eventDoc","fromElement","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","relatedTarget","toElement","originalEvent","fixHook","srcElement","metaKey","load","focus","blur","beforeunload","onbeforeunload","simulate","bubble","isSimulated","defaultPrevented","returnValue","getPreventDefault","timeStamp","cancelBubble","stopImmediatePropagation","mouseenter","mouseleave","related","form","_submit_bubble","propertyName","_just_changed","attaches","on","origFn","bind","unbind","live","die","delegate","undelegate","toggler","lastToggle","click","fnOver","fnOut","Sizzle","seed","m","isXML","assertUsableClassName","getElementsByClassName","createInputPseudo","createButtonPseudo","createPositionalPseudo","markFunction","argument","matchIndexes","siblingCheck","b","nextSibling","tokenize","parseOnly","tokens","soFar","groups","preFilters","cached","tokenCache","Expr","preFilter","rcomma","rcombinators","Token","matchExpr","addCombinator","matcher","combinator","base","checkNonElements","doneName","dirkey","dirruns","cachedkey","cachedruns","sizset","elementMatcher","matchers","condense","unmatched","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","preMap","postMap","preexisting","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","expandContext","setMatched","matchedCount","outermost","contextBackup","dirrunsUnique","E","uniqueSort","token","rbackslash","rsibling","compile","setFilters","assertGetIdNotName","getText","sortOrder","hasDuplicate","baseHasDuplicate","strundefined","docElem","createCache","keys","cacheLength","classCache","compilerCache","whitespace","characterEncoding","identifier","operators","pseudos","pos","rpseudo","rheader","rinputs","ID","CLASS","NAME","TAG","ATTR","PSEUDO","POS","CHILD","assert","assertTagNameNoComments","createComment","assertHrefNotNormalized","assertAttributes","assertUsableName","getElementsByName","matchesSelector","textContent","adown","bup","compareDocumentPosition","attrHandle","selectors","createPseudo",">"," ","+","~","unquoted","excess","pattern","operator","check","diff","previousSibling","pseudo","idx","not","innerText","enabled","header","radio","checkbox","file","password","image","reset","activeElement","hasFocus","active","even","odd","lt","gt","sourceIndex","al","bl","ap","bp","aup","duplicates","group","disconnectedMatch","oldSelect","rescape","rattributeQuotes","rbuggyQSA","rbuggyMatches","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","msMatchesSelector","nid","newContext","newSelector","qsaError","filters","runtil","rparentsprev","rneedsContext","guaranteedUnique","children","r","targets","is","closest","prevAll","addBack","andSelf","parents","parentsUntil","until","nextAll","nextUntil","prevUntil","siblings","reverse","rinlinejQuery","rleadingWhitespace","rxhtmlTag","rtagName","rtbody","rhtml","rnoInnerhtml","rnocache","rnoshimcache","rchecked","rscriptType","rcleanScript","wrapMap","legend","thead","tr","td","col","area","safeFragment","fragmentDiv","optgroup","tfoot","colgroup","caption","th","append","createTextNode","wrapAll","html","wrap","wrapInner","unwrap","replaceWith","domManip","prepend","before","clean","after","keepData","dataAndEvents","deepDataAndEvents","detach","table","iNoClone","ajax","url","throws","cachehit","fragments","prependTo","insertAfter","replaceAll","insert","srcElements","destElements","depth","hasBody","handleScript","jsTags","safe","browser","uaMatch","ua","version","userAgent","chrome","webkit","safari","sub","jQuerySub","superclass","rootjQuerySub","ralpha","ropacity","rposition","rdisplayswap","rmargin","rrelNum","BODY","cssShow","position","visibility","cssNormalTransform","letterSpacing","fontWeight","eventsToggle","fn2","bool","computed","cssNumber","fillOpacity","lineHeight","orphans","widows","zIndex","cssProps","float","numeric","swap","minWidth","maxWidth","getPropertyValue","currentStyle","left","rsLeft","runtimeStyle","pixelLeft","$1","visible","margin","padding","border","suffix","expanded","r20","rCRLF","rinput","rselectTextarea","serialize","param","serializeArray","encodeURIComponent","ajaxLocParts","ajaxLocation","rhash","rheaders","rlocalProtocol","rnoContent","rprotocol","rquery","rscript","rts","rurl","_load","transports","allTypes","params","status","responseText","o","method","success","getScript","getJSON","ajaxSetup","settings","isLocal","contentType","processData","accepts","json","*","* text","text html","text json","text xml","ajaxPrefilter","ajaxTransport","nativeStatusText","headers","isSuccess","modified","statusText","timeoutTimer","transport","responseHeadersString","ifModified","lastModified","ifModifiedKey","etag","callbackContext","statusCode","fireGlobals","globalEventContext","completeDeferred","responseHeaders","requestHeaders","requestHeadersNames","strAbort","setRequestHeader","lname","getAllResponseHeaders","overrideMimeType","abort","crossDomain","hasContent","ts","beforeSend","send","oldCallbacks","rquestion","rjsonp","nonce","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","hasCallback","replaceInUrl","replaceInData","script","text script","head","scriptCharset","charset","onload","onreadystatechange","isAbort","xhrCallbacks","xhrOnUnloadAbort","xhrId","xhr","cors","username","open","xhrFields","responseXML","firefoxAccessException","unload","timerId","rfxnum","rrun","unit","scale","maxIterations","tweener","prefilter","eased","step","cssFn","speed","animate","fadeTo","to","optall","doAnimation","stopQueue","timers","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","linear","p","swing","cos","PI","setInterval","interval","clearInterval","slow","fast","animated","rroot","offset","setOffset","win","box","bodyOffset","getBoundingClientRect","pageYOffset","pageXOffset","offsetLeft","curTop","curLeft","curElem","curOffset","curCSSTop","curCSSLeft","calculatePosition","curPosition","using","offsetParent","parentOffset","scrollTo","Height","Width","content","defaultExtra","funcName","define","amd","Modal","element","$element","remote","isShown","that","escape","backdrop","transition","enforceFocus","hideWithTransition","hideModal","keyboard","removeBackdrop","$backdrop","doAnimate","modal","$this","defaults","Constructor","$target","_events","configure","conf","delimiter","wildcard","listenerTree","EventEmitter","searchListenerTree","tree","leaf","branch","xTree","xxTree","isolatedBranch","endReached","listeners","typeLength","currentType","nextType","_listeners","**","growListenerTree","listener","warned","defaultMaxListeners","maxListeners","console","trace","setMaxListeners","many","ttl","_origin","emit","newListener","_all","ns","onAny","addListener","leafs","iLeaf","offAny","removeListener","removeAllListeners","listenersAny","EventEmitter2","process","title","decodeURIComponent","isHostMethod","isHostObject","hasFlash","activeX","flashVersion","GetVariable","HAS_FLASH_THROTTLED_BUG","notSupportedException","dom_onReady","domIsReady","domReadyQueue","whenReady","scope","getParentObject","ii","easyXDM","_easyXDM","IFRAME_PREFIX","getDomainName","reURI","getPort","getLocation","proto","domain","port","resolveUrl","reDoubleSlash","path","pathname","lastIndexOf","protocol","host","reParent","appendQueryParameters","parameters","hash","q","useHash","undef","destination","noOverwrite","member","testForNamePropertyBug","channelId","HAS_NAME_PROPERTY_BUG","createFrame","config","frame","onLoad","allowTransparency","checkAcl","acl","re","prepareTransportStack","stackEls","isHost","query","xdm_p","channel","secret","swf","product","remoteHelper","xdm_c","xdm_s","xdm_e","useResize","useParent","usePolling","local","images","search","xdm_pa","xdm_po","HashTransport","ReliableBehavior","QueueBehavior","encode","maxLength","VerifyBehavior","initiate","PostMessageTransport","NameTransport","NixTransport","SameOriginTransport","FrameElementTransport","FlashTransport","lazy","chainStack","stackElements","stackEl","incoming","message","origin","up","outgoing","recipient","down","destroy","removeFromStack","un","floor","emptyFn","sEvent","fpNotify","pair","evalJSON","getJSONObject","DomHelper","requiresJSON","_map","Fn","del","Socket","onMessage","onReady","postMessage","Rpc","jsonRpcConfig","RpcBehavior","pub","targetOrigin","onDOMReady","sendFn","addSwf","swfContainer","swfNoThrottle","right","flashVars","destroyChannel","swfdomain","createChannel","_getOrigin","uri","_window_onMessage","callerWindow","waitForReady","referrer","_sendMessage","sendMessage","_onReady","readyCount","_onMessage","remoteOrigin","_onLoad","remoteWindow","remoteUrl","w","_callerWindow","_msgNr","_handleHash","_lastMsg","_remoteOrigin","_pollHash","_listenerWindow","_attachListeners","_timer","pollInterval","tries","getRef","frames","ex","idOut","idIn","currentMessage","ack","waiting","destroying","doFragment","seq","startVerification","mySecret","theirSecret","_send","jsonrpc","serializer","_createMethod","definition","_callbacks","_callbackCounter","namedParams","_executeMethod","code","ex1","_absolutizeURI","removeDotSegments","output","_parseURI","authority","hostname","appConfigReplacer","Apps","overwrite","isFunc","S4","array","isLocalRequest","urlLower","isNativeDOMNode","testObject","bIsNode","Node","bIsElement","HTMLElement","log","_ct","_f2t","_handlerCollection","appCreateRoot","appRenderBefore","appDestroyBefore","appRenderAfter","appDestroyAfter","appRender","appDestroy","_defaultMethods","appConfig","appHtml","$root","root","appInstance","app","appId","_createHandler","sNamespace","func_or_element","bDomNodeAppropriate","_validateToken","domNode","sToken","_removeHandler","eventKey","currentEventKey","eventCollection","newEvents","ec","currentEventHandler","newHandlerCollection","iCounter","hc","currentHandler","getToken","__f2GetToken","__trigger","passableArgs","hcl","$appRoot","arData","AppHandlers","APP_CREATE_ROOT","APP_RENDER_BEFORE","APP_RENDER","APP_RENDER_AFTER","APP_DESTROY_BEFORE","APP_DESTROY","APP_DESTROY_AFTER","App","AppConfig","enableBatchRequests","instanceId","isSecure","manifestUrl","minGridSize","ui","views","AppManifest","apps","inlineScripts","styles","AppContent","ContainerConfig","afterAppRender","beforeAppRender","isSecureAppPage","secureAppPagePath","supportedViews","UI","Mask","backgroundColor","loadingIcon","useClasses","Css","_PREFIX","APP","APP_CONTAINER","APP_TITLE","APP_VIEW","APP_VIEW_TRIGGER","MASK","MASK_CONTAINER","Events","_APP_EVENT_PREFIX","_CONTAINER_EVENT_PREFIX","APP_SYMBOL_CHANGE","APP_WIDTH_CHANGE","CONTAINER_SYMBOL_CHANGE","CONTAINER_WIDTH_CHANGE","JSONP_CALLBACK","Sockets","EVENT","LOAD","RPC","RPC_CALLBACK","UI_RPC","Views","DATA_ATTRIBUTE","ABOUT","HELP","HOME","REMOVE","SETTINGS","_socketEmit","broadcast","Constants","timesToListen","_secureAppPagePath","_apps","_rEvents","_rRpc","_rRpcCallback","_rSocketLoad","_rUiCall","_createAppToContainerSocket","isLoaded","messagePlayback","socket","appParts","registerApps","_createContainerToAppSocket","appManifest","iframeProps","scrolling","_createRpcCallback","callbackId","parseFunction","functionName","parseMessage","regEx","callbacks","_registerCallback","messageType","cid","isRemote","register","_containerConfig","UI_Class","_appConfig","_updateHeight","outerHeight","hideMask","Modals","_renderAlert","_renderConfirm","alert","isInit","confirm","okCallback","cancelCallback","setTitle","showMask","showLoader","updateHeight","_rValidEvents","_isValid","containerConfig","showLoading","mask","background-color","background-image","background-position","background-repeat","min-height","z-index","_config","_bUsesAppHandlers","_sAppHandlerToken","_afterAppRender","appContainer","_appRender","_outerHtml","_beforeAppRender","_hydrateAppConfig","_initAppEvents","view","removeApp","_initContainerEvents","resizeTimeout","resizeHandler","_isInit","_createAppInstance","appContent","_loadApps","appConfigs","_loadSecureApp","inlines","scriptCount","scriptsLoaded","appInit","evalInlines","exception","stylesFragment","jqxhr","_validateApp","_validateContainerConfig","getContainerState","appManifests","appStack","batches","callbackStack","haveManifests","req","requests","manifestRequest","completeFunc","errorFunc","item","successFunc","requestFunc","successCallback","errorCallback","completeCallback","removeAllApps"],"mappings":"CAAC,SAAUA,SAEV,IAAIA,QAAQC,IAAOD,QAAQE,gBAA3B;;;;;;;;;;;;;;;;;;;AA8KmB,gBAATC,QACPA,SAGH,WACG,YAEA,SAASC,GAAEC,GAEP,MAAW,IAAJA,EAAS,IAAMA,EAAIA,EAwC9B,QAASC,OAAMC,GAQX,MADAC,WAAUC,UAAY,E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ACvE1oD,OAAO+6B,MACNC,IAAKA,EACLx3B,KAAMA,EACNhD,MACCmgC,OAAQvlC,GAAG2D,UAAUipD,EAAIhJ,KAAM5jD,GAAGg/C,oBAEnChW,OAAO,EACPC,cAAeA,EACfl7B,SAAUA,EACV63B,QAASwnB,EACT98C,MAAO,SAAS67C,EAAOnmB,EAAUimB,GAChCjsD,GAAG8/C,IAAI,wBAAyBmM,EAAUlrD,WAAY6rD,EAAIhJ,MAC1DyJ,KAEDz5C,SAAU05C,MAKbH,EAAYvtB,EAAKgtB,EAAIhJ,KAAMsJ,EAAaF,EAAWD,IAGpDD,GAAgB1rD,EAAGyrD,EAASnlD,UAjL9B9C,SAVC5E,GAAG8/C,IAAI,wEACP,SAkMFyN,cAAe,WAEd,MAAKjC,YAKL1mD,OAAOC,KAAKiiD,MAAO,SAAS1lD,EAAGT,GAC9BX,GAAGkrD,UAAUvqD,EAAEq1C,OAAOqN,cADvBz+C,SAJC5E,GAAG8/C,IAAI,sDACP,SAYFoL,UAAW,SAAS7H,GAEnB,MAAKiI,YAKDxE,MAAMzD,KACTrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYK,mBACzB+D,MAAMzD,IAGPrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYM,YACzB8D,MAAMzD,IAGPrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYO,kBACzB6D,MAAMzD,UAGAyD,OAAMzD,IAnBd,SAJCrjD,GAAG8/C,IAAI,kDACP,cA4BH//C,QAAQC,GAAKA,GAES,mBAAX2uC,SAA0BA,OAAOC,KAE3CD,OAAO,WACN,MAAO3uC,QAKY,mBAAZD,SAA0BA,QAAUwE"} \ No newline at end of file +{"version":3,"file":"f2.min.js","sources":["f2.debug.js"],"names":["exports","F2","F2_TESTING_MODE","JSON","f","n","quote","string","escapable","lastIndex","test","replace","a","c","meta","charCodeAt","toString","slice","str","key","holder","i","k","v","length","partial","mind","gap","value","toJSON","rep","call","isFinite","String","indent","Object","prototype","apply","join","push","hasOwnProperty","Date","this","valueOf","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","Number","Boolean","cx","\b","\t","\n","\f","\r","\"","\\","stringify","replacer","space","Error","parse","text","reviver","walk","undefined","j","eval","SyntaxError","window","createOptions","options","object","optionsCache","jQuery","each","split","core_rspace","_","flag","dataAttr","elem","data","nodeType","name","rmultiDash","toLowerCase","getAttribute","rbrace","parseJSON","e","isEmptyDataObject","obj","isEmptyObject","returnFalse","returnTrue","isDisconnected","node","parentNode","sibling","cur","dir","winnow","elements","qualifier","keep","isFunction","grep","retVal","filtered","isSimple","filter","inArray","createSafeFragment","document","list","nodeNames","safeFrag","createDocumentFragment","createElement","pop","findOrAppend","tag","getElementsByTagName","appendChild","ownerDocument","cloneCopyEvent","src","dest","hasData","type","l","oldData","_data","curData","events","handle","event","add","extend","cloneFixAttributes","nodeName","clearAttributes","mergeAttributes","outerHTML","support","html5Clone","innerHTML","trim","rcheckableType","defaultChecked","checked","selected","defaultSelected","defaultValue","removeAttribute","expando","getAll","querySelectorAll","fixDefaultChecked","vendorPropName","style","capName","charAt","toUpperCase","origName","cssPrefixes","isHidden","el","css","contains","showHide","show","display","values","index","css_defaultDisplay","curCSS","setPositiveNumber","subtract","matches","rnumsplit","exec","Math","max","augmentWidthOrHeight","extra","isBorderBox","val","cssExpand","parseFloat","getWidthOrHeight","offsetWidth","offsetHeight","valueIsBorderBox","boxSizing","rnumnonpx","boxSizingReliable","elemdisplay","appendTo","body","remove","iframe","frameBorder","width","height","iframeDoc","contentWindow","contentDocument","write","close","removeChild","buildParams","prefix","traditional","isArray","rbracket","addToPrefiltersOrTransports","structure","dataTypeExpression","func","dataType","placeBefore","dataTypes","substr","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","selection","executeOnly","prefilters","unshift","ajaxExtend","target","deep","flatOptions","ajaxSettings","ajaxHandleResponses","s","responses","ct","finalDataType","firstDataType","contents","responseFields","shift","mimeType","getResponseHeader","converters","ajaxConvert","response","conv","conv2","current","tmp","prev","dataFilter","splice","state","error","createStandardXHR","XMLHttpRequest","createActiveXHR","ActiveXObject","createFxNow","setTimeout","fxNow","now","createTweens","animation","props","prop","collection","tweeners","concat","Animation","properties","result","animationPrefilters","deferred","Deferred","always","tick","currentTime","remaining","startTime","duration","temp","percent","tweens","run","notifyWith","resolveWith","promise","opts","specialEasing","originalProperties","createTween","end","tween","Tween","easing","stop","gotoEnd","rejectWith","propFilter","start","fx","timer","anim","queue","progress","done","complete","fail","hooks","camelCase","cssHooks","expand","defaultPrefilter","dataShow","toggle","oldfire","orig","handled","hidden","_queueHooks","unqueued","empty","fire","overflow","overflowX","overflowY","inlineBlockNeedsLayout","zoom","shrinkWrapBlocks","rfxtypes","hide","removeData","init","genFx","includeWidth","which","attrs","opacity","getWindow","isWindow","defaultView","parentWindow","rootjQuery","readyList","location","navigator","_jQuery","_$","$","core_push","Array","core_slice","core_indexOf","indexOf","core_toString","core_hasOwn","core_trim","selector","context","fn","core_pnum","source","core_rnotwhite","rtrim","rquickExpr","rsingleTag","rvalidchars","rvalidbraces","rvalidescape","rvalidtokens","rmsPrefix","rdashAlpha","fcamelCase","all","letter","DOMContentLoaded","addEventListener","removeEventListener","ready","readyState","detachEvent","class2type","constructor","match","doc","jquery","find","parseHTML","isPlainObject","attr","merge","getElementById","id","makeArray","size","toArray","get","num","pushStack","elems","ret","prevObject","callback","args","eq","first","last","arguments","map","sort","copy","copyIsArray","clone","noConflict","isReady","readyWait","holdReady","hold","wait","trigger","off","isNumeric","isNaN","msg","scripts","parsed","buildFragment","cacheable","fragment","childNodes","Function","parseXML","xml","DOMParser","parseFromString","async","loadXML","documentElement","noop","globalEval","execScript","isObj","arr","results","len","second","inv","arg","guid","proxy","access","chainable","emptyGet","pass","bulk","getTime","attachEvent","top","frameElement","doScroll","doScrollCheck","Callbacks","memory","fired","firing","firingStart","firingLength","firingIndex","stack","once","stopOnFalse","self","disable","unique","has","disabled","lock","locked","fireWith","tuples","then","fns","newDefer","tuple","action","returned","resolve","reject","notify","pipe","stateString","when","subordinate","progressValues","progressContexts","resolveContexts","resolveValues","updateFunc","contexts","select","opt","input","eventName","isSupported","clickFn","div","setAttribute","cssText","leadingWhitespace","firstChild","tbody","htmlSerialize","hrefNormalized","cssFloat","checkOn","optSelected","getSetAttribute","className","enctype","cloneNode","boxModel","compatMode","submitBubbles","changeBubbles","focusinBubbles","deleteExpando","noCloneEvent","reliableMarginRight","pixelPosition","noCloneChecked","optDisabled","fireEvent","radioValue","lastChild","checkClone","appendChecked","submit","change","focusin","container","tds","marginDiv","divReset","insertBefore","reliableHiddenOffsets","doesNotIncludeMarginInBodyOffset","offsetTop","getComputedStyle","marginRight","cache","deletedIds","uuid","random","noData","embed","applet","pvt","acceptData","thisCache","internalKey","getByName","isNode","cleanData","parts","part","attributes","substring","triggerHandler","dequeue","startLength","next","setter","delay","time","speeds","timeout","clearTimeout","clearQueue","count","defer","nodeHook","boolHook","fixSpecified","rclass","rreturn","rtype","rfocusable","rclickable","rboolean","removeAttr","removeProp","propFix","addClass","classNames","setClass","cl","removeClass","removes","toggleClass","stateVal","isBool","hasClass","valHooks","set","option","specified","selectedIndex","one","attrFn","notxml","nType","isXMLDoc","attrHooks","propName","attrNames","tabindex","readonly","for","class","maxlength","cellspacing","cellpadding","rowspan","colspan","usemap","frameborder","contenteditable","propHooks","tabIndex","attributeNode","getAttributeNode","parseInt","href","attrNode","property","nodeValue","coords","button","createAttribute","setAttributeNode","parent","rformElems","rtypenamespace","rhoverHack","rkeyEvent","rmouseEvent","rfocusMorph","hoverHack","special","hover","types","handler","elemData","eventHandle","t","tns","namespaces","handleObj","handleObjIn","handlers","triggered","dispatch","delegateType","bindType","origType","needsContext","expr","namespace","delegateCount","setup","global","mappedTypes","origCount","eventType","RegExp","teardown","removeEvent","customEvent","getData","setData","changeData","onlyHandlers","exclusive","old","ontype","eventPath","bubbleType","Event","isTrigger","namespace_re","noBubble","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","selMatch","matched","sel","run_all","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","fixHooks","keyHooks","original","charCode","keyCode","mouseHooks","eventDoc","fromElement","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","relatedTarget","toElement","originalEvent","fixHook","srcElement","metaKey","load","focus","blur","beforeunload","onbeforeunload","simulate","bubble","isSimulated","defaultPrevented","returnValue","getPreventDefault","timeStamp","cancelBubble","stopImmediatePropagation","mouseenter","mouseleave","related","form","_submit_bubble","propertyName","_just_changed","attaches","on","origFn","bind","unbind","live","die","delegate","undelegate","toggler","lastToggle","click","fnOver","fnOut","Sizzle","seed","m","isXML","assertUsableClassName","getElementsByClassName","createInputPseudo","createButtonPseudo","createPositionalPseudo","markFunction","argument","matchIndexes","siblingCheck","b","nextSibling","tokenize","parseOnly","tokens","soFar","groups","preFilters","cached","tokenCache","Expr","preFilter","rcomma","rcombinators","Token","matchExpr","addCombinator","matcher","combinator","base","checkNonElements","doneName","dirkey","dirruns","cachedkey","cachedruns","sizset","elementMatcher","matchers","condense","unmatched","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","preMap","postMap","preexisting","multipleContexts","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","expandContext","setMatched","matchedCount","outermost","contextBackup","dirrunsUnique","E","uniqueSort","token","rbackslash","rsibling","compile","setFilters","assertGetIdNotName","getText","sortOrder","hasDuplicate","baseHasDuplicate","strundefined","docElem","createCache","keys","cacheLength","classCache","compilerCache","whitespace","characterEncoding","identifier","operators","pseudos","pos","rpseudo","rheader","rinputs","ID","CLASS","NAME","TAG","ATTR","PSEUDO","POS","CHILD","assert","assertTagNameNoComments","createComment","assertHrefNotNormalized","assertAttributes","assertUsableName","getElementsByName","matchesSelector","textContent","adown","bup","compareDocumentPosition","attrHandle","selectors","createPseudo",">"," ","+","~","unquoted","excess","pattern","operator","check","diff","previousSibling","pseudo","idx","not","innerText","enabled","header","radio","checkbox","file","password","image","reset","activeElement","hasFocus","active","even","odd","lt","gt","sourceIndex","al","bl","ap","bp","aup","duplicates","group","disconnectedMatch","oldSelect","rescape","rattributeQuotes","rbuggyQSA","rbuggyMatches","mozMatchesSelector","webkitMatchesSelector","oMatchesSelector","msMatchesSelector","nid","newContext","newSelector","qsaError","filters","runtil","rparentsprev","rneedsContext","guaranteedUnique","children","r","targets","is","closest","prevAll","addBack","andSelf","parents","parentsUntil","until","nextAll","nextUntil","prevUntil","siblings","reverse","rinlinejQuery","rleadingWhitespace","rxhtmlTag","rtagName","rtbody","rhtml","rnoInnerhtml","rnocache","rnoshimcache","rchecked","rscriptType","rcleanScript","wrapMap","legend","thead","tr","td","col","area","safeFragment","fragmentDiv","optgroup","tfoot","colgroup","caption","th","append","createTextNode","wrapAll","html","wrap","wrapInner","unwrap","replaceWith","domManip","prepend","before","clean","after","keepData","dataAndEvents","deepDataAndEvents","detach","table","iNoClone","ajax","url","throws","cachehit","fragments","prependTo","insertAfter","replaceAll","insert","srcElements","destElements","depth","hasBody","handleScript","jsTags","safe","browser","uaMatch","ua","version","userAgent","chrome","webkit","safari","sub","jQuerySub","superclass","rootjQuerySub","ralpha","ropacity","rposition","rdisplayswap","rmargin","rrelNum","BODY","cssShow","position","visibility","cssNormalTransform","letterSpacing","fontWeight","eventsToggle","fn2","bool","computed","cssNumber","fillOpacity","lineHeight","orphans","widows","zIndex","cssProps","float","numeric","swap","minWidth","maxWidth","getPropertyValue","currentStyle","left","rsLeft","runtimeStyle","pixelLeft","$1","visible","margin","padding","border","suffix","expanded","r20","rCRLF","rinput","rselectTextarea","serialize","param","serializeArray","encodeURIComponent","ajaxLocParts","ajaxLocation","rhash","rheaders","rlocalProtocol","rnoContent","rprotocol","rquery","rscript","rts","rurl","_load","transports","allTypes","params","status","responseText","o","method","success","getScript","getJSON","ajaxSetup","settings","isLocal","contentType","processData","accepts","json","*","* text","text html","text json","text xml","ajaxPrefilter","ajaxTransport","nativeStatusText","headers","isSuccess","modified","statusText","timeoutTimer","transport","responseHeadersString","ifModified","lastModified","ifModifiedKey","etag","callbackContext","statusCode","fireGlobals","globalEventContext","completeDeferred","responseHeaders","requestHeaders","requestHeadersNames","strAbort","setRequestHeader","lname","getAllResponseHeaders","overrideMimeType","abort","crossDomain","hasContent","ts","beforeSend","send","oldCallbacks","rquestion","rjsonp","nonce","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","hasCallback","replaceInUrl","replaceInData","script","text script","head","scriptCharset","charset","onload","onreadystatechange","isAbort","xhrCallbacks","xhrOnUnloadAbort","xhrId","xhr","cors","username","open","xhrFields","responseXML","firefoxAccessException","unload","timerId","rfxnum","rrun","unit","scale","maxIterations","tweener","prefilter","eased","step","cssFn","speed","animate","fadeTo","to","optall","doAnimation","stopQueue","timers","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","linear","p","swing","cos","PI","setInterval","interval","clearInterval","slow","fast","animated","rroot","offset","setOffset","win","box","bodyOffset","getBoundingClientRect","pageYOffset","pageXOffset","offsetLeft","curTop","curLeft","curElem","curOffset","curCSSTop","curCSSLeft","calculatePosition","curPosition","using","offsetParent","parentOffset","scrollTo","Height","Width","content","defaultExtra","funcName","define","amd","Modal","element","$element","remote","isShown","that","escape","backdrop","transition","enforceFocus","hideWithTransition","hideModal","keyboard","removeBackdrop","$backdrop","doAnimate","modal","$this","defaults","Constructor","$target","_events","configure","conf","delimiter","wildcard","listenerTree","EventEmitter","searchListenerTree","tree","leaf","branch","xTree","xxTree","isolatedBranch","endReached","listeners","typeLength","currentType","nextType","_listeners","**","growListenerTree","listener","warned","defaultMaxListeners","maxListeners","console","trace","setMaxListeners","many","ttl","_origin","emit","newListener","_all","ns","onAny","addListener","leafs","iLeaf","offAny","removeListener","removeAllListeners","listenersAny","EventEmitter2","process","title","decodeURIComponent","isHostMethod","isHostObject","hasFlash","activeX","flashVersion","GetVariable","HAS_FLASH_THROTTLED_BUG","notSupportedException","dom_onReady","domIsReady","domReadyQueue","whenReady","scope","getParentObject","ii","easyXDM","_easyXDM","IFRAME_PREFIX","getDomainName","reURI","getPort","getLocation","proto","domain","port","resolveUrl","reDoubleSlash","path","pathname","lastIndexOf","protocol","host","reParent","appendQueryParameters","parameters","hash","q","useHash","undef","destination","noOverwrite","member","testForNamePropertyBug","channelId","HAS_NAME_PROPERTY_BUG","createFrame","config","frame","onLoad","allowTransparency","checkAcl","acl","re","prepareTransportStack","stackEls","isHost","query","xdm_p","channel","secret","swf","product","remoteHelper","xdm_c","xdm_s","xdm_e","useResize","useParent","usePolling","local","images","search","xdm_pa","xdm_po","HashTransport","ReliableBehavior","QueueBehavior","encode","maxLength","VerifyBehavior","initiate","PostMessageTransport","NameTransport","NixTransport","SameOriginTransport","FrameElementTransport","FlashTransport","lazy","chainStack","stackElements","stackEl","incoming","message","origin","up","outgoing","recipient","down","destroy","removeFromStack","un","floor","emptyFn","sEvent","fpNotify","pair","evalJSON","getJSONObject","DomHelper","requiresJSON","_map","Fn","del","Socket","onMessage","onReady","postMessage","Rpc","jsonRpcConfig","RpcBehavior","pub","targetOrigin","onDOMReady","sendFn","addSwf","swfContainer","swfNoThrottle","right","flashVars","destroyChannel","swfdomain","createChannel","_getOrigin","uri","_window_onMessage","callerWindow","waitForReady","referrer","_sendMessage","sendMessage","_onReady","readyCount","_onMessage","remoteOrigin","_onLoad","remoteWindow","remoteUrl","w","_callerWindow","_msgNr","_handleHash","_lastMsg","_remoteOrigin","_pollHash","_listenerWindow","_attachListeners","_timer","pollInterval","tries","getRef","frames","ex","idOut","idIn","currentMessage","ack","waiting","destroying","doFragment","seq","startVerification","mySecret","theirSecret","_send","jsonrpc","serializer","_createMethod","definition","_callbacks","_callbackCounter","namedParams","_executeMethod","code","ex1","_absolutizeURI","removeDotSegments","output","_parseURI","authority","hostname","appConfigReplacer","Apps","overwrite","isFunc","S4","array","isLocalRequest","urlLower","isNativeDOMNode","testObject","bIsNode","Node","bIsElement","HTMLElement","log","_ct","_f2t","_handlerCollection","appCreateRoot","appRenderBefore","appDestroyBefore","appRenderAfter","appDestroyAfter","appRender","appDestroy","_defaultMethods","appConfig","appHtml","$root","root","appInstance","app","appId","_createHandler","sNamespace","func_or_element","bDomNodeAppropriate","_validateToken","domNode","sToken","_removeHandler","eventKey","currentEventKey","eventCollection","newEvents","ec","currentEventHandler","newHandlerCollection","iCounter","hc","currentHandler","getToken","__f2GetToken","__trigger","passableArgs","hcl","$appRoot","arData","AppHandlers","APP_CREATE_ROOT","APP_RENDER_BEFORE","APP_RENDER","APP_RENDER_AFTER","APP_DESTROY_BEFORE","APP_DESTROY","APP_DESTROY_AFTER","App","AppConfig","enableBatchRequests","instanceId","isSecure","manifestUrl","minGridSize","ui","views","AppManifest","apps","inlineScripts","styles","AppContent","ContainerConfig","afterAppRender","beforeAppRender","isSecureAppPage","secureAppPagePath","supportedViews","UI","Mask","backgroundColor","loadingIcon","useClasses","Css","_PREFIX","APP","APP_CONTAINER","APP_TITLE","APP_VIEW","APP_VIEW_TRIGGER","MASK","MASK_CONTAINER","Events","_APP_EVENT_PREFIX","_CONTAINER_EVENT_PREFIX","APP_SYMBOL_CHANGE","APP_WIDTH_CHANGE","CONTAINER_SYMBOL_CHANGE","CONTAINER_WIDTH_CHANGE","JSONP_CALLBACK","Sockets","EVENT","LOAD","RPC","RPC_CALLBACK","UI_RPC","Views","DATA_ATTRIBUTE","ABOUT","HELP","HOME","REMOVE","SETTINGS","_socketEmit","broadcast","Constants","timesToListen","_secureAppPagePath","_apps","_rEvents","_rRpc","_rRpcCallback","_rSocketLoad","_rUiCall","_createAppToContainerSocket","isLoaded","messagePlayback","socket","appParts","registerApps","_createContainerToAppSocket","appManifest","iframeProps","scrolling","_createRpcCallback","callbackId","parseFunction","functionName","parseMessage","regEx","callbacks","_registerCallback","messageType","cid","isRemote","register","_containerConfig","UI_Class","_appConfig","_updateHeight","outerHeight","hideMask","Modals","_renderAlert","_renderConfirm","alert","isInit","confirm","okCallback","cancelCallback","setTitle","showMask","showLoader","updateHeight","_rValidEvents","_isValid","containerConfig","showLoading","mask","background-color","background-image","background-position","background-repeat","min-height","z-index","_config","_bUsesAppHandlers","_sAppHandlerToken","_afterAppRender","appContainer","_appRender","_outerHtml","_beforeAppRender","_hydrateAppConfig","_initAppEvents","view","removeApp","_initContainerEvents","resizeTimeout","resizeHandler","_isInit","_createAppInstance","appContent","_loadApps","appConfigs","_loadSecureApp","inlines","scriptCount","scriptsLoaded","appInit","evalInlines","exception","stylesFragment","jqxhr","_validateApp","_validateContainerConfig","getContainerState","appManifests","appStack","batches","callbackStack","haveManifests","req","requests","manifestRequest","completeFunc","errorFunc","item","successFunc","requestFunc","successCallback","errorCallback","completeCallback","removeAllApps"],"mappings":"CAAC,SAAUA,SAEV,IAAIA,QAAQC,IAAOD,QAAQE,gBAA3B;;;;;;;;;;;;;;;;;;;AA8KmB,gBAATC,QACPA,SAGH,WACG,YAEA,SAASC,GAAEC,GAEP,MAAW,IAAJA,EAAS,IAAMA,EAAIA,EAwC9B,QAASC,OAAMC,GAQX,MADAC,WAAUC,UAAY,EACfD,UAAUE,KAAKH,GAAU,IAAMA,EAAOI,QAAQH,UAAW,SAAUI,GACtE,GAAIC,GAAIC,KAAKF,EACb,OAAoB,gBAANC,GACRA,EACA,OAAS,OAASD,EAAEG,WAAW,GAAGC,SAAS,KAAKC,MAAM,MAC3D,IAAM,IAAMV,EAAS,IAI9B,QAASW,KAAIC,EAAKC,GAId,GAAIC,GACAC,EACAC,EACAC,EAEAC,EADAC,EAAOC,IAEPC,EAAQR,EAAOD,EAkBnB,QAdIS,GAA0B,gBAAVA,IACY,kBAAjBA,GAAMC,SACjBD,EAAQA,EAAMC,OAAOV,IAMN,kBAARW,OACPF,EAAQE,IAAIC,KAA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B9C,SAVC5E,GAAG8/C,IAAI,wEACP,SAkMFyN,cAAe,WAEd,MAAKjC,YAKL1mD,OAAOC,KAAKiiD,MAAO,SAAS1lD,EAAGT,GAC9BX,GAAGkrD,UAAUvqD,EAAEq1C,OAAOqN,cADvBz+C,SAJC5E,GAAG8/C,IAAI,sDACP,SAYFoL,UAAW,SAAS7H,GAEnB,MAAKiI,YAKDxE,MAAMzD,KACTrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYK,mBACzB+D,MAAMzD,IAGPrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYM,YACzB8D,MAAMzD,IAGPrjD,GAAG0iD,YAAYL,UACdoI,kBACAzqD,GAAG2mD,UAAUjE,YAAYO,kBACzB6D,MAAMzD,UAGAyD,OAAMzD,IAnBd,SAJCrjD,GAAG8/C,IAAI,kDACP,cA4BH//C,QAAQC,GAAKA,GAES,mBAAX2uC,SAA0BA,OAAOC,KAE3CD,OAAO,WACN,MAAO3uC,QAKY,mBAAZD,SAA0BA,QAAUwE"} \ No newline at end of file diff --git a/sdk/f2.no-third-party.js b/sdk/f2.no-third-party.js index de61e35e..5f2b2cac 100644 --- a/sdk/f2.no-third-party.js +++ b/sdk/f2.no-third-party.js @@ -735,7 +735,7 @@ F2.extend('Constants', { * A convenient collection of all available appHandler events. * @class F2.Constants.AppHandlers **/ - AppHandlers: function() + AppHandlers: (function() { return { /** @@ -906,7 +906,7 @@ F2.extend('Constants', { */ APP_DESTROY_AFTER: 'appDestroyAfter' }; - } + })() }); /** * Class stubs for documentation purposes diff --git a/sdk/src/app_handlers.js b/sdk/src/app_handlers.js index 66e3f1a6..a4454194 100644 --- a/sdk/src/app_handlers.js +++ b/sdk/src/app_handlers.js @@ -405,7 +405,7 @@ F2.extend('Constants', { * A convenient collection of all available appHandler events. * @class F2.Constants.AppHandlers **/ - AppHandlers: function() + AppHandlers: (function() { return { /** @@ -576,5 +576,5 @@ F2.extend('Constants', { */ APP_DESTROY_AFTER: 'appDestroyAfter' }; - } + })() }); \ No newline at end of file diff --git a/tests/spec/container-spec.js b/tests/spec/container-spec.js index e11866b4..6ff8679f 100644 --- a/tests/spec/container-spec.js +++ b/tests/spec/container-spec.js @@ -68,7 +68,7 @@ describe('F2.registerApps - pre-load', function() { F2.init(); - F2.AppHandlers.on(F2.AppHandlers.getToken(), "appRenderAfter", function(){ bAfterFired = true; }); + F2.AppHandlers.on(F2.AppHandlers.getToken(), F2.Constants.AppHandlers.APP_RENDER_AFTER, function(){ bAfterFired = true; }); F2.registerApps(appConfigs); From b8f4c93dde508356d554f516beed54a4cc16b3f7 Mon Sep 17 00:00:00 2001 From: markhealey Date: Mon, 3 Jun 2013 12:03:35 -0600 Subject: [PATCH 154/181] Archive support + container dev chgs --- Gruntfile.js | 14 ++++++++++++++ docs/src/container-development.md | 4 +++- package.json | 5 +++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index adb5caaa..c7f98803 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -57,6 +57,19 @@ module.exports = function(grunt) { ] } }, + compress: { + main: { + options: { + archive: 'F2-examples.zip' + }, + files: [ + { + src: ['examples/**'], + dest: '../gh-pages' + } + ] + } + }, concat: { options: { process: { data: pkg }, @@ -178,6 +191,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-compress'); grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-less'); diff --git a/docs/src/container-development.md b/docs/src/container-development.md index dafa20d8..48f45cfe 100644 --- a/docs/src/container-development.md +++ b/docs/src/container-development.md @@ -1,6 +1,8 @@ % Container Development -

    You've come to the right place if you want to start building F2 containers. Before continuing, make sure you've [cloned the F2 repository on GitHub](https://github.com/OpenF2/F2#quick-start) or [downloaded the latest framework build](index.html#get-started) (v{{version}}). Secondly, [read about the F2 Framework](index.html#framework). There are a few important concepts to help you better understand apps, containers and context.

    +

    +The container is the foundation of any F2-enabled solution. By leveraging the [F2.js SDK](f2js-sdk.html), Container Providers offer a consistent and reliable mechanism for all App Developers to load their apps on that container regardless of where it is hosted, who developed it, or what back-end stack it uses. You can [read more about the framework](index.html#framework), [download the project on GitHub](https://github.com/OpenF2/F2#quick-start) or [get started](#get-started) below. The current version of F2 is {{version}}. +

    * * * * diff --git a/package.json b/package.json index de05de2c..00fc0973 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "grunt": "~0.4.1", "grunt-contrib-clean": "~0.4.1", "grunt-contrib-concat": "~0.3.0", + "grunt-contrib-compress": "~0.5.1", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-jasmine": "~0.4.2", "grunt-contrib-jshint": "~0.4.3", @@ -44,6 +45,6 @@ "engines": { "node": ">=0.10" }, - "_releaseDate": "2013-05-30T22:13:29.844Z", - "_releaseDateFormatted": "30 May 2013" + "_releaseDate": "2013-06-03T15:46:34.585Z", + "_releaseDateFormatted": "3 June 2013" } \ No newline at end of file From 4c38fbccabcb7ba1295ca2e3716cbc3267c7e309 Mon Sep 17 00:00:00 2001 From: markhealey Date: Mon, 3 Jun 2013 14:50:49 -0600 Subject: [PATCH 155/181] Uncommenting my forgotten comment --- examples/container/js/container-app-handlers.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/container/js/container-app-handlers.js b/examples/container/js/container-app-handlers.js index 3084ca25..2b8d50d0 100644 --- a/examples/container/js/container-app-handlers.js +++ b/examples/container/js/container-app-handlers.js @@ -93,13 +93,12 @@ $(function() { }); // Define these prior to calling F2.registerApps - /* F2.AppHandlers .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_CREATE_ROOT, appCreateRootFunc) .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER, appRenderFunc) .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER_AFTER, appRenderCompleteFunc) .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_DESTROY, appDestroyFunc) - ;*/ + ; //listen for app symbol change events and re-broadcast F2.Events.on(F2.Constants.Events.APP_SYMBOL_CHANGE,function(data) { From d38104c2cdb2468c40588323d50dde82663cb8e5 Mon Sep 17 00:00:00 2001 From: markhealey Date: Mon, 3 Jun 2013 14:59:53 -0600 Subject: [PATCH 156/181] grunt zip for examples --- Gruntfile.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index c7f98803..9608fd3b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -21,6 +21,10 @@ module.exports = function(grunt) { 'github-pages': { options: { force: true }, src: ['../gh-pages/src'] + }, + 'F2-examples': { + options: { force: true }, + src: ['./F2-examples.zip'] } }, copy: { @@ -55,17 +59,30 @@ module.exports = function(grunt) { dest: '../gh-pages' } ] + }, + 'F2-examples': { + files: [ + { + expand: true, + cwd: './', + src: ['F2-examples.zip'], + dest: '../gh-pages' + } + ] } }, compress: { main: { options: { - archive: 'F2-examples.zip' + archive: 'F2-examples.zip', + pretty: true }, files: [ { - src: ['examples/**'], - dest: '../gh-pages' + expand: true, + cwd: 'examples/', + src: ['**'], + dest: '../F2-examples' } ] } @@ -361,11 +378,12 @@ module.exports = function(grunt) { grunt.registerTask('docs', ['less', 'yuidoc', 'copy:docs', 'markitdown', 'clean:docs']); grunt.registerTask('github-pages', ['copy:github-pages', 'clean:github-pages']); + grunt.registerTask('zip', ['compress', 'copy:F2-examples', 'clean:F2-examples']); grunt.registerTask('js', ['jshint', 'concat', 'uglify:dist', 'sourcemap']); grunt.registerTask('sourcemap', ['uglify:sourcemap', 'fix-sourcemap']); grunt.registerTask('test', ['jshint', 'express', 'jasmine'/*, 'express-keepalive'*/]); grunt.registerTask('travis', ['test']); // the default task - grunt.registerTask('default', ['test', 'js', 'docs']); + grunt.registerTask('default', ['test', 'js', 'docs', 'zip']); }; \ No newline at end of file From beefcf17bff70db75d97b2aecb2cd96c0f716cf3 Mon Sep 17 00:00:00 2001 From: markhealey Date: Mon, 3 Jun 2013 16:21:43 -0600 Subject: [PATCH 157/181] container dev writing --- docs/src/container-development.md | 79 ++++++++++--------------------- 1 file changed, 26 insertions(+), 53 deletions(-) diff --git a/docs/src/container-development.md b/docs/src/container-development.md index 48f45cfe..68e94515 100644 --- a/docs/src/container-development.md +++ b/docs/src/container-development.md @@ -8,88 +8,63 @@ The container is the foundation of any F2-enabled solution. By leveraging the [F ## Get Started -To help you get started building an F2 container, browse through the resources below. To jump start your F2 container and app development, download the F2 template (which now includes a basic container) _or_ follow the instructions below. +To help you get started building an F2 container, review the documentation and examples below. To jump start your F2 container or app development, download the F2 example container and apps. -

    Download Basic F2 Container Template

    +

    Download F2 Examples

    ### Basic Container -To begin, you **do not need to build F2** [as described in the readme on GitHub](https://github.com/OpenF2/F2#build-f2). Simply download [Bootstrap](http://twitter.github.io/bootstrap/index.html) and save a local copy of [F2.js](f2js-sdk.html). Also ensure you're [properly configured](#configuration). +To begin, you **do not need to build or compile F2** [as described in the readme on GitHub](https://github.com/OpenF2/F2#build-f2). Simply download [Bootstrap](http://twitter.github.io/bootstrap/index.html) and save a local copy of [F2.js](f2js-sdk.html). Also ensure you're [properly configured](#configuration).

    Download F2.js Download Bootstrap

    -Create your basic container HTML template: +Setup a basic container HTML template (or add F2.js to an existing website): ```html - F2 Container -
    -
    -

    Hello F2

    -
    -
    -
    - - - - - - ``` In developing a more advanced container, the HTML document's `body` element would contain additional markup and allow for specific positioning or placement of apps. Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the [F2 design guidelines](#container-design). -### Basic App - -Create your basic [F2 app manifest](app-development.html#app-manifest) and save it as `/path/to/your/manifest.js` using this code below. Note the path to this file should be specified in the `manifestUrl` property within the `_appConfigs` array in your basic container (shown above). +### Basic AppConfig ```javascript -F2_jsonpCallback_com_your_app_id({ - "scripts": [], - "styles": [], - "apps": [{ - "data": {}, - "html": "

    Hello, world. I'm an F2 app.

    " - }] -}) +var _appConfig = { + appId: 'com_openf2_examples_javascript_helloworld', + manifestUrl: 'http://docs.openf2.org/demos/apps/JavaScript/HelloWorld/manifest.js' +}; + +$(function(){ + F2.init(); + F2.registerApps(_appConfig); +}); ``` -Note You can [download the F2 container/app template](https://github.com/downloads/OpenF2/F2/Basic-F2-App-Template-1.0.4.zip) instead of creating the basic app by hand. - ### Testing the Basics -Now with a basic container and a basic app, you can load your F2 container and expect to see: +Now with a basic container and a basic app, combine these two for a working example. -![](./img/basic-f2-app-test.png "Basic F2 app") + In getting to this point, you've only scratched the surface of F2 containers and apps. Continue reading and understanding the F2 spec to build exactly the financial solutions that our customers want. ### Sample Apps and Container -Good news! In the [project repo on GitHub](https://github.com/OpenF2/F2/tree/master/examples/container/), you will find a basic container along with a number of sample apps which demonstrate functionality far beyond the basic app above. Once you clone or download the project repository, open the sample container by pointing your browser at: +Good news! In the [project repo on GitHub](https://github.com/OpenF2/F2/tree/master/examples/), you will find a basic container along with a number of sample apps which demonstrate functionality far beyond the basic app above. Once you clone or download the project repository, open the sample container by pointing your browser at: -`http://localhost/F2/examples/container/` +`http://localhost/F2/examples/` + +These examples are also available in a separate archive if you don't want to download the entire repository. + +

    Download F2 Examples

    ### Configuration @@ -113,17 +88,17 @@ If App Developers embed URLs back to their own websites or to third party sites, ### Choices -In order to ensure that apps built using F2 are successful, they must be accessible. As such, F2 made choices for which open-source libraries and frameworks would be leveraged to reduce the level of effort across F2 adopters. +In order to ensure that containers built using F2 are successful, they must be accessible. As such, F2 made choices for which open-source libraries and frameworks would be leveraged to reduce the level of effort across F2 adopters. [Read more about those choices in the Framework](index.html#choices). -Ultimately, the responsibility of app design falls on either the Container or App Developer or both. In many cases, Container Developers will provide App Developers will visual designs, style guides or other assets required to ensure apps have the form and function for a given container. Container Developers may also [provide CSS for App Developers](index.html#creating-a-common-look-and-feel) to adhere to—which should be easy since F2 enforces a [consistent HTML structure across all containers and apps](app-development.html#automatic-consistency). +Ultimately, the responsibility of app design falls on either the Container or App Developer or both. In many cases, Container Developers will provide App Developers will visual designs, style guides or other assets required to ensure apps have the form and function for a given container. Container Developers may also [provide CSS for App Developers](index.html#creating-a-common-look-and-feel) to adhere to—which should be easy since F2 enforces a [consistent HTML structure across all containers and apps](app-development.html#automatic-consistency). In other cases, Container and App Developers may never know each other and it's important everyone strictly adheres to the guidelines set forth in this documentation. * * * * ## Developing F2 Containers -A container is a browser-based web application which brings F2 apps together onto a seamless user interface. It can also provide data and horsepower to its apps in the form of request-response web services or streaming data feeds. +A container is a browser-based web application which brings F2 apps together onto a seamless user interface. It can also provide data and user context to its apps in the form of request-response web services or streaming data feeds. ### Including the F2 SDK @@ -133,9 +108,7 @@ For a webpage to be considered an F2 container, it must first include the [F2.js ``` -You will find a basic container in the [project repo on GitHub](https://github.com/OpenF2/F2/tree/master/examples/container/) along with a number of sample apps. - -Once the script tag has been added, it is up to the Container Developer to configure and customize the container. The first step is getting a ContainerID. +You will find a basic container in the [project repo on GitHub](https://github.com/OpenF2/F2/tree/master/examples/) along with a number of sample apps. Once the script tag has been added, it is up to the Container Developer to configure and customize the container. The first step is getting a ContainerID. ### F2 ContainerID From 978744ae3899e29c4f55703eaffcd5cb8cd4cf6b Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Mon, 3 Jun 2013 21:44:36 -0600 Subject: [PATCH 158/181] Converted amd-container to appHandlers. Storage seems to be having issues. Was having issues prior to this commit not sure if there is something environmental causing it. --- examples/container-amd/js/main.js | 125 ++++++++++++++++++++---------- 1 file changed, 85 insertions(+), 40 deletions(-) diff --git a/examples/container-amd/js/main.js b/examples/container-amd/js/main.js index 8b37c6da..81452a35 100644 --- a/examples/container-amd/js/main.js +++ b/examples/container-amd/js/main.js @@ -43,60 +43,105 @@ require( // init the app selector new AppSelector(); - /** - * Init Container - */ - F2.init({ + var containerAppHandlerToken = F2.AppHandlers.getToken(); - afterAppRender: function (app, html) { - var el = $(app.root).append(html); - F2.UI.hideMask(app.instanceId, el); - return el; - }, + var appCreateRootFunc = function(appConfig) { + var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, appConfig.views); + var hasHelp = F2.inArray(F2.Constants.Views.HELP, appConfig.views); + var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, appConfig.views); + var showDivider = hasSettings || hasHelp || hasAbout; + var gridWidth = appConfig.minGridSize || 3; - beforeAppRender: function(app) { + appConfig.root = $([ + '
    ', + '
    ', + '

    ', appConfig.name.toUpperCase(), '

    ', + '
    ', + '', + '', + '
    ', + '
    ', + '
    ' + ].join('')).get(0); + }; - var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, app.views); - var hasHelp = F2.inArray(F2.Constants.Views.HELP, app.views); - var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, app.views); - var showDivider = hasSettings || hasHelp || hasAbout; - var gridWidth = app.minGridSize || 3; + var appRenderFunc = function(appConfig, app) { - var appRoot = $([ - '
    ', - '
    ', - '

    ', app.name.toUpperCase(), '

    ', - '
    ', - '', - '', - '
    ', - '
    ', - '
    ' - ].join('')).appendTo($('#mainContent div.row')); + var gridWidth = appConfig.minGridSize || 3; + + // find a row that can fit this app + var row; + $('#mainContent div.row').each(function(i, el) { + var span = 0; + $('.f2-app', el).each(function(j, app) { + span += Number($(app).data('gridWidth')); + }); + if (span <= (12 - gridWidth)) { + row = el; + return false; + } + }); + // create a new row if one wasn't found + if (row === undefined) { + row = $('
    ').appendTo('#mainContent'); + } + // append app to app root and also to row + $(appConfig.root).append(app).appendTo(row); + }; - // show loader - F2.UI.showMask(app.instanceId, appRoot, true); + var appRenderCompleteFunc = function(appConfig) { + F2.UI.hideMask(appConfig.instanceId, appConfig.root); + }; - return appRoot; - }, + var appDestroyFunc = function(appInstance) { + if(!appInstance) { return; } + + // call the apps destroy method, if it has one + if(appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function'){ + appInstance.app.destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been called + else if(appInstance.app && appInstance.app.destroy){ + F2.log(appInstance.appId + ' has a Destroy property, but Destroy is not of type function and as such will not be executed.'); + } + + // fade out and remove the root + jQuery(appInstance.config.root).fadeOut(250, function() { + jQuery(this).remove(); + }); + }; + /** + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ + /** + * Init Container + */ + F2.init({ UI:{ Mask:{ loadingIcon:'./img/ajax-loader.gif' } }, - supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE], - secureAppPagePath: "secure.html" // this should go on a separate domain from index.html + secureAppPagePath: 'secure.html' // this should go on a separate domain from index.html }); + + // Define these prior to calling F2.registerApps + F2.AppHandlers + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_CREATE_ROOT, appCreateRootFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER, appRenderFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER_AFTER, appRenderCompleteFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_DESTROY, appDestroyFunc) + ; //listen for app symbol change events and re-broadcast F2.Events.on( From e8aa58cefb26441c643b9b81fb02072c4da2ec99 Mon Sep 17 00:00:00 2001 From: Ali Khatami Date: Mon, 3 Jun 2013 21:53:51 -0600 Subject: [PATCH 159/181] Removed the extra container-app-handlers.js file and overwrote container.js to have the code from container-app-handlers.js. --- examples/container/index.html | 4 +- .../container/js/container-app-handlers.js | 153 ----------------- examples/container/js/container.js | 161 ++++++++++-------- 3 files changed, 95 insertions(+), 223 deletions(-) delete mode 100644 examples/container/js/container-app-handlers.js diff --git a/examples/container/index.html b/examples/container/index.html index a99376dd..5376b13d 100644 --- a/examples/container/index.html +++ b/examples/container/index.html @@ -95,9 +95,7 @@

    F2 Example Container

    }); - - - + diff --git a/examples/container/js/container-app-handlers.js b/examples/container/js/container-app-handlers.js deleted file mode 100644 index 2b8d50d0..00000000 --- a/examples/container/js/container-app-handlers.js +++ /dev/null @@ -1,153 +0,0 @@ -$(function() { - - var containerAppHandlerToken = F2.AppHandlers.getToken(); - - var appCreateRootFunc = function(appConfig) { - var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, appConfig.views); - var hasHelp = F2.inArray(F2.Constants.Views.HELP, appConfig.views); - var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, appConfig.views); - var showDivider = hasSettings || hasHelp || hasAbout; - var gridWidth = appConfig.minGridSize || 3; - - appConfig.root = $([ - '
    ', - '
    ', - '

    ', appConfig.name.toUpperCase(), '

    ', - '
    ', - '', - '', - '
    ', - '
    ', - '
    ' - ].join('')).get(0); - }; - - var appRenderFunc = function(appConfig, app) { - - var gridWidth = appConfig.minGridSize || 3; - - // find a row that can fit this app - var row; - $('#mainContent div.row').each(function(i, el) { - var span = 0; - $('.f2-app', el).each(function(j, app) { - span += Number($(app).data('gridWidth')); - }); - if (span <= (12 - gridWidth)) { - row = el; - return false; - } - }); - // create a new row if one wasn't found - if (row === undefined) { - row = $('
    ').appendTo('#mainContent'); - } - // append app to app root and also to row - $(appConfig.root).append(app).appendTo(row); - }; - - var appRenderCompleteFunc = function(appConfig) { - F2.UI.hideMask(appConfig.instanceId, appConfig.root); - }; - - var appDestroyFunc = function(appInstance) { - if(!appInstance) { return; } - - // call the apps destroy method, if it has one - if(appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function'){ - appInstance.app.destroy(); - } - // warn the container developer/app developer that even though they have a destroy method it hasn't been called - else if(appInstance.app && appInstance.app.destroy){ - F2.log(appInstance.appId + ' has a Destroy property, but Destroy is not of type function and as such will not be executed.'); - } - - // fade out and remove the root - jQuery(appInstance.config.root).fadeOut(250, function() { - jQuery(this).remove(); - }); - }; - /** - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - */ - - /** - * Init Container - */ - F2.init({ - UI:{ - Mask:{ - loadingIcon:'./img/ajax-loader.gif' - } - }, - supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE], - secureAppPagePath: 'secure.html' // this should go on a separate domain from index.html - }); - - // Define these prior to calling F2.registerApps - F2.AppHandlers - .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_CREATE_ROOT, appCreateRootFunc) - .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER, appRenderFunc) - .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER_AFTER, appRenderCompleteFunc) - .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_DESTROY, appDestroyFunc) - ; - - //listen for app symbol change events and re-broadcast - F2.Events.on(F2.Constants.Events.APP_SYMBOL_CHANGE,function(data) { - F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: data.symbol, name: data.name || '' }); - }); - - /** - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - */ - - /** - * init symbol lookup in navbar - */ - $('#symbolLookup') - .on('keypress', function(event) { - if (event.keyCode == 13) { - event.preventDefault(); - } - }) - .autocomplete({ - autoFocus:true, - minLength: 0, - select: function (event, ui) { - F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: ui.item.value, name: ui.item.label }); - }, - source: function (request, response) { - - $.ajax({ - url: 'http://dev.markitondemand.com/api/Lookup/jsonp', - dataType: 'jsonp', - data: { - input: request.term - }, - success: function (data) { - response($.map(data, function (item) { - return { - label: item.Name + ' (' + item.Exchange + ')', - value: item.Symbol - }; - })); - }, - open: function() { - $(this).removeClass('ui-corner-all').addClass('ui-corner-top'); - }, - close: function() { - $(this).removeClass('ui-corner-top').addClass('ui-corner-all'); - } - }); - } - }); - -}); \ No newline at end of file diff --git a/examples/container/js/container.js b/examples/container/js/container.js index 59ddafff..2b8d50d0 100644 --- a/examples/container/js/container.js +++ b/examples/container/js/container.js @@ -1,86 +1,113 @@ $(function() { + + var containerAppHandlerToken = F2.AppHandlers.getToken(); - /** - * Init Container - */ - F2.init({ - - afterAppRender: function(app, html) { - var el = $(app.root).append(html); - F2.UI.hideMask(app.instanceId, el); - return el; - }, - - beforeAppRender: function(app) { + var appCreateRootFunc = function(appConfig) { + var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, appConfig.views); + var hasHelp = F2.inArray(F2.Constants.Views.HELP, appConfig.views); + var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, appConfig.views); + var showDivider = hasSettings || hasHelp || hasAbout; + var gridWidth = appConfig.minGridSize || 3; - var hasSettings = F2.inArray(F2.Constants.Views.SETTINGS, app.views); - var hasHelp = F2.inArray(F2.Constants.Views.HELP, app.views); - var hasAbout = F2.inArray(F2.Constants.Views.ABOUT, app.views); - var showDivider = hasSettings || hasHelp || hasAbout; - var gridWidth = app.minGridSize || 3; + appConfig.root = $([ + '
    ', + '
    ', + '

    ', appConfig.name.toUpperCase(), '

    ', + '
    ', + '', + '', + '
    ', + '
    ', + '
    ' + ].join('')).get(0); + }; - var appRoot = $([ - '
    ', - '
    ', - '

    ', app.name.toUpperCase(), '

    ', - '
    ', - '', - '', - '
    ', - '
    ', - '
    ' - ].join('')); + var appRenderFunc = function(appConfig, app) { - // find a row that can fit this app - var row; - $('#mainContent div.row').each(function(i, el) { - var span = 0; - $('.f2-app', el).each(function(j, app) { - span += Number($(app).data('gridWidth')); - }); - if (span <= (12 - gridWidth)) { - row = el; - return false; - } + var gridWidth = appConfig.minGridSize || 3; + + // find a row that can fit this app + var row; + $('#mainContent div.row').each(function(i, el) { + var span = 0; + $('.f2-app', el).each(function(j, app) { + span += Number($(app).data('gridWidth')); }); - // create a new row if one wasn't found - if (row === undefined) { - row = $('
    ').appendTo('#mainContent'); + if (span <= (12 - gridWidth)) { + row = el; + return false; } - // append app to row - $(appRoot).appendTo(row); + }); + // create a new row if one wasn't found + if (row === undefined) { + row = $('
    ').appendTo('#mainContent'); + } + // append app to app root and also to row + $(appConfig.root).append(app).appendTo(row); + }; - // show loader - F2.UI.showMask(app.instanceId, appRoot, true); + var appRenderCompleteFunc = function(appConfig) { + F2.UI.hideMask(appConfig.instanceId, appConfig.root); + }; - return appRoot; - }, + var appDestroyFunc = function(appInstance) { + if(!appInstance) { return; } + + // call the apps destroy method, if it has one + if(appInstance.app && appInstance.app.destroy && typeof(appInstance.app.destroy) == 'function'){ + appInstance.app.destroy(); + } + // warn the container developer/app developer that even though they have a destroy method it hasn't been called + else if(appInstance.app && appInstance.app.destroy){ + F2.log(appInstance.appId + ' has a Destroy property, but Destroy is not of type function and as such will not be executed.'); + } + + // fade out and remove the root + jQuery(appInstance.config.root).fadeOut(250, function() { + jQuery(this).remove(); + }); + }; + /** + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ + /** + * Init Container + */ + F2.init({ UI:{ Mask:{ loadingIcon:'./img/ajax-loader.gif' } }, - supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE], secureAppPagePath: 'secure.html' // this should go on a separate domain from index.html }); - + + // Define these prior to calling F2.registerApps + F2.AppHandlers + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_CREATE_ROOT, appCreateRootFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER, appRenderFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_RENDER_AFTER, appRenderCompleteFunc) + .on(containerAppHandlerToken, F2.Constants.AppHandlers.APP_DESTROY, appDestroyFunc) + ; + //listen for app symbol change events and re-broadcast - F2.Events.on( - F2.Constants.Events.APP_SYMBOL_CHANGE, - function(data) { - F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: data.symbol, name: data.name || '' }); - } - ); + F2.Events.on(F2.Constants.Events.APP_SYMBOL_CHANGE,function(data) { + F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: data.symbol, name: data.name || '' }); + }); + + /** + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + */ /** * init symbol lookup in navbar @@ -94,10 +121,10 @@ $(function() { .autocomplete({ autoFocus:true, minLength: 0, - select: function(event, ui) { + select: function (event, ui) { F2.Events.emit(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, { symbol: ui.item.value, name: ui.item.label }); }, - source: function(request, response) { + source: function (request, response) { $.ajax({ url: 'http://dev.markitondemand.com/api/Lookup/jsonp', @@ -105,7 +132,7 @@ $(function() { data: { input: request.term }, - success: function(data) { + success: function (data) { response($.map(data, function (item) { return { label: item.Name + ' (' + item.Exchange + ')', From dd9420a0c954db6879e83b38887d843c5aef63dd Mon Sep 17 00:00:00 2001 From: markhealey Date: Tue, 4 Jun 2013 09:34:11 -0600 Subject: [PATCH 160/181] Docs updates --- docs/src/app-development.md | 3 +- docs/src/container-development.md | 88 ++++++++++++++++++++++++------- docs/src/index.md | 6 +-- package.json | 4 +- 4 files changed, 75 insertions(+), 26 deletions(-) diff --git a/docs/src/app-development.md b/docs/src/app-development.md index f8bfae6f..ee145c69 100644 --- a/docs/src/app-development.md +++ b/docs/src/app-development.md @@ -867,8 +867,7 @@ If you open `~/F2/examples/container/js/sampleApps.js` in your text editor, you' ```javascript { appId: "com_companyName_appName", - manifestUrl: "http://www.domain.com/manifest.js", - name: "App name" + manifestUrl: "http://www.domain.com/manifest.js" } ``` diff --git a/docs/src/container-development.md b/docs/src/container-development.md index 68e94515..95390bfe 100644 --- a/docs/src/container-development.md +++ b/docs/src/container-development.md @@ -10,13 +10,13 @@ The container is the foundation of any F2-enabled solution. By leveraging the [F To help you get started building an F2 container, review the documentation and examples below. To jump start your F2 container or app development, download the F2 example container and apps. -

    Download F2 Examples

    +

    Download F2 Examples

    ### Basic Container -To begin, you **do not need to build or compile F2** [as described in the readme on GitHub](https://github.com/OpenF2/F2#build-f2). Simply download [Bootstrap](http://twitter.github.io/bootstrap/index.html) and save a local copy of [F2.js](f2js-sdk.html). Also ensure you're [properly configured](#configuration). +To begin, you **do not** need to build (or compile) F2 [as described in the readme on GitHub](https://github.com/OpenF2/F2#build-f2). Simply download [F2.js](f2js-sdk.html) and [Bootstrap](http://twitter.github.io/bootstrap/index.html), and ensure you're [properly configured](#configuration) for continuing with the documentation. -

    Download F2.js Download Bootstrap

    +

    Download F2.js Download Bootstrap

    Setup a basic container HTML template (or add F2.js to an existing website): @@ -32,7 +32,7 @@ Setup a basic container HTML template (or add F2.js to an existing website): ``` -In developing a more advanced container, the HTML document's `body` element would contain additional markup and allow for specific positioning or placement of apps. Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the [F2 design guidelines](#container-design). +Note In developing a more advanced container, the HTML document's `body` element would contain additional markup and allow for [specific positioning or placement of apps](#apphandlers-for-app-layout). Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the [F2 design guidelines](#container-design). ### Basic AppConfig @@ -48,9 +48,11 @@ $(function(){ }); ``` +Note For more information about the `AppConfig`, [read up on them](##appconfigs) in App Integration. + ### Testing the Basics -Now with a basic container and a basic app, combine these two for a working example. +Now with a basic container and a basic app, combine these two for a working example. Press **Result** in this jsfiddle. @@ -64,7 +66,7 @@ Good news! In the [project repo on GitHub](https://github.com/OpenF2/F2/tree/mas These examples are also available in a separate archive if you don't want to download the entire repository. -

    Download F2 Examples

    +

    Download F2 Examples

    ### Configuration @@ -76,7 +78,7 @@ To get started working with or developing apps, browse to the [documentation for **Ready to start coding?** -

    Developing F2 Containers F2.js SDK Reference

    +

    Developing F2 Containers F2.js SDK Reference

    * * * * @@ -186,6 +188,8 @@ For more information on `F2.UI`, [browse to the F2.js SDK docs](./sdk/classes/F2 Occasionally Container Developers need more granular control over the `AppManifest` request mechanism in F2.js. The [manifest request process](./sdk/classes/F2.html#methods-registerApps)—intentionally obscured from developers through the `F2.registerApps()` API—is handled by a simple ajax call to an HTTP endpoint. (F2 relies on `jQuery.ajax()` for this.) In version {{version}} of F2, the `AppManifest` request can be overridden in the Container Config. +Note The `AppManifest` endpoint is configured in the `manifestUrl` property within each [`AppConfig`](#appconfigs). + The following example demonstrates how the `xhr` property of the `ContainerConfig` is used to override F2.js. ```javascript @@ -237,7 +241,7 @@ F2.init({ ##### Type -The `type` property allows the container to override the request method that is used (similar to the [type parameter to jQuery.ajax()](http://api.jquery.com/jQuery.ajax/)). Since HTTP POST is not supported on JSONP requests, using POST as a `type` is only available for F2 apps using JSON and are therefore running on the same domain as the container. +The `type` property allows the container to override the request method that is used (similar to the [type parameter to jQuery.ajax()](http://api.jquery.com/jQuery.ajax/)). Since HTTP POST is not supported on JSONP requests, using POST as a `type` is only available for F2 apps using JSON and are therefore running on the same base domain as the container. ```javascript F2.init({ @@ -261,7 +265,7 @@ F2.init({ }); ``` -Note Every F2 app has a `home` view (whether defined by the App Developer or not). This means if no views are provided by the App Developer, a `home` view is automatically added to `appConfig.views` during the app registration process inside F2. +Note Every F2 app has a `home` view (whether defined by the App Developer or not). This means if no views are provided by the App Developer, a `home` view is automatically added to `appConfig.views` during the app registration process inside F2. #### Secure Apps @@ -277,13 +281,57 @@ If you're looking for sample container HTML template code, jump to the [Get Star There are two ways of integrating apps on a container: [requesting apps on-demand](#requesting-apps-on-demand) (via HTTP) or by [linking pre-loaded apps](#registering-pre-loaded-apps). Requesting apps on-demand when the container loads is the traditional way of integrating apps with F2. Incorporating apps which have been pre-fetched or are otherwise already on the container when it loads is an alternative method. The following sections describe both of these methods in detail. -The process of loading apps on a container occurs by using a method called `F2.registerApps()`. The Container Developer must call [this method](./sdk/classes/F2.html)—which accepts two arguments, one required, one optional— after `F2.init()` is called. If this method isn't called, no apps can be loaded on the container. +The process of loading apps on a container occurs by using a method called `F2.registerApps()`. The Container Developer must call [this method](./sdk/classes/F2.html)—which accepts two arguments: one required, one optional— after `F2.init()` is called. If this method isn't called, no apps can be loaded on the container. + +The two arguments provided to `registerApps()` are an array of `AppConfig` objects and, optionally, an array of `AppManifest` objects. As F2.js parses each `AppConfig`, the apps are validated, hydrated with some additional properties, and saved in browser memory on the container. Regardless of where the container's `AppConfig` object is defined (hard-coded or via API), integrating apps is a simple process. + +### AppConfigs + +Before continuing, let's discuss the `AppConfig`. The container-provided app configurations are represented simply as an array of [AppConfig objects](./sdk/classes/F2.AppConfig.html). These could be configured statically or fetched from an F2 Registry API. `AppConfig` objects contain app meta data—including the `manifestUrl`—provided by the App Developer when an app is registered in the [Developer Center](index.html#developer-center). -The two arguments provided to `registerApps()` are an array of `AppConfig` objects and, optionally, an array of `AppManifest` objects. As F2.js parses each `AppConfig`, the apps are validated, hydrated with some additional properties, and saved in browser memory on the container. +An example `AppConfig` object from an _individual_ app: -Regardless of where the container's `AppConfig` object is defined (hard-coded or via API), integrating apps is a simple process. +```javascript +{ + appId: "com_companyName_appName", + manifestUrl: "http://www.domain.com/manifest.js", + name: "App name", + context: { + data: [1,2,3,4,5] + } +} +``` -Note Not familiar with the `AppConfig`? [Read up on them](#app-configs) before continuing. +An example array of `AppConfig` objects for a collection of apps: + +```javascript +[ + { + appId: "com_companyName_appName", + manifestUrl: "http://www.domain.com/manifest.js", + name: "App name", + context: { + data: [1,2,3,4,5] + } + }, + { + appId: "com_companyName_appName2", + manifestUrl: "http://www.domain.com/manifest2.js", + name: "App2 name", + context: { + name: 'value' + } + }, + { + appId: "com_companyName_appName3", + manifestUrl: "http://www.domain.com/manifest3.js", + name: "App3 name", + context: { + status: 'ok' + } + }, +]; +``` ### Requesting Apps On-Demand @@ -297,7 +345,7 @@ First, we define the `AppConfig` in a _hard-coded_ `_appConfig` variable. This e -This javascript code will insert the example news app into the container's ``. Press *Result* in the jsfiddle above to try this demo. +This javascript code will insert the example news app into the container's ``. Press **Result** in the jsfiddle above to try this demo. Note If more granular control is needed for app placement, use `F2.AppHandlers` functionality. Read about that in [AppHandlers for App Layout](#apphandlers-for-app-layout). @@ -317,7 +365,7 @@ For the following example, let's assume you have a web page composed on the serv #### 1. Setup Container -To use pre-loaded apps, a web page with a placeholder element for the apps is required. This simple (and empty) web page features a `div#news_app.span12` which serves as that placeholder. +To use pre-loaded apps, a web page with a placeholder element for the apps is required. This simple (and empty) web page features a `div#news_app.span12` which serves as that placeholder or "root" element. ```html @@ -357,7 +405,7 @@ Next, make a server-side request to the news apps' `AppManifest`—the URL i } ``` -Note Parts of this `AppManifest` were intentionally removed for legibility, including the required JSONP function name (`F2_jsonpCallback_com_openf2_examples_csharp_marketnews`). The full `AppManifest` is [available on OpenF2.org](http://www.openf2.org/Examples/Apps?params=%5B%7B%22appId%22%3A%22com_openf2_examples_csharp_marketnews%22%7D%5D). +Note Parts of this `AppManifest` were intentionally removed for legibility, including the required JSONP function name (`F2_jsonpCallback_com_openf2_examples_csharp_marketnews`). The full `AppManifest` is [available on OpenF2.org](http://www.openf2.org/Examples/Apps?params=%5B%7B%22appId%22%3A%22com_openf2_examples_csharp_marketnews%22%7D%5D).
    Performance Tip
    @@ -389,7 +437,7 @@ You're almost there. Next, embed the news app's `html`, `scripts` and `styles`. ``` -The example news app is now part of the web page and everything should be functioning properly. The final step is to register the app with F2. +The example news app is now part of the web page and everything should be functioning properly. **The final step is to register the app with F2**. #### 4. Assign Root Element to AppConfig @@ -405,7 +453,9 @@ var _appConfig = { }; ``` -Both of these are valid values for the `root` property. Using JavaScript: +Both of these are valid values for the `root` property. + +Using JavaScript: ```javascript { @@ -487,7 +537,7 @@ $(function(){ New functionality called `F2.AppHandlers` was added in F2 1.2. The conversation about this collection of features occurred in [#38](https://github.com/OpenF2/F2/issues/38) on GitHub. The new `AppHandlers` functionality provides Container Developers a higher level of control over configuring app rendering and interaction.

    -The addition of `F2.AppHandlers` replaces the previous `ContainerConfig` properties `beforeAppRender`, `appRender`, and `afterAppRender`. These methods were deprecated in version 1.2. +The addition of `F2.AppHandlers` replaces the previous `ContainerConfig` properties `beforeAppRender`, `appRender`, and `afterAppRender`. These methods were deprecated—but not removed—in version 1.2. They will be permanently removed in a future version of F2.

    diff --git a/docs/src/index.md b/docs/src/index.md index ec57c04a..2ca13b9d 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -89,7 +89,7 @@ All contributors will be expected to follow consistent standards and guidelines ### Notational Conventions -The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](http://tools.ietf.org/html/rfc2119). +The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC 2119](http://tools.ietf.org/html/rfc2119). For readability, these words do not appear in all uppercase letters in this specification. * * * * @@ -101,11 +101,11 @@ Following are definitions for the main F2 Framework components: the apps, the co ### Choices -In order to ensure that applications built using F2 are successful, they must be accessible. With this in mind, the front-end technology choice is HTML5. Using the [progressive enhancement methodology](http://www.alistapart.com/articles/understandingprogressiveenhancement/), F2 incorporates a rock-solid foundation. The F2 open standard provides guidelines for developers to add feature enhancements targeting specific environments or visitors. For example, F2 apps built following the [mobile first](http://www.lukew.com/presos/preso.asp?26) design approach and with [responsive](http://www.abookapart.com/products/responsive-web-design) [CSS](http://twitter.github.com/bootstrap/scaffolding.html#responsive), allow users to access the apps on their desktop, tablet or smartphone and App Developers only need to build a single app. +In order to ensure that applications built using F2 are successful, they must be accessible. With this in mind, the front-end technology choice is HTML5. Using the [progressive enhancement methodology](http://www.alistapart.com/articles/understandingprogressiveenhancement/), F2 incorporates a rock-solid foundation. The F2 open standard provides guidelines for developers to add feature enhancements targeting specific environments or visitors. For example, F2 apps built following the [mobile first](http://www.lukew.com/presos/preso.asp?26) design approach and with [responsive](http://www.abookapart.com/products/responsive-web-design) [CSS](http://twitter.github.io/bootstrap/scaffolding.html#responsive), allow users to access the apps on their desktop, tablet or smartphone and App Developers only need to build a single app. Support across all desktop browsers and mobile devices is sometimes limited so F2 includes some third-party web development libraries to bridge those gaps. Why reinvent the wheel, right? -* F2 uses and recommends [Twitter Bootstrap](http://twitter.github.com/bootstrap/) for a consistent HTML & CSS structure for app development regardless of App Developer ([we'll explain more later](app-development.html#container-integration)). +* F2 uses and recommends [Bootstrap](http://twitter.github.io/bootstrap/) for a consistent HTML & CSS structure for app development regardless of App Developer ([we'll explain more later](app-development.html#container-integration)). * F2 relies on data structures represented in JSON, so it incorporates Crockford's [JSON](http://www.json.org/). * To support a secured container environment, F2 needs cross-domain in-browser messaging. For this, it relies on [easyXDM](https://github.com/oyvindkinsey/easyXDM). diff --git a/package.json b/package.json index 00fc0973..7ded580b 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,6 @@ "engines": { "node": ">=0.10" }, - "_releaseDate": "2013-06-03T15:46:34.585Z", - "_releaseDateFormatted": "3 June 2013" + "_releaseDate": "2013-06-04T15:33:35.065Z", + "_releaseDateFormatted": "4 June 2013" } \ No newline at end of file From 22d047502f7f07d37d8f901bdde9106ac92b3b0e Mon Sep 17 00:00:00 2001 From: markhealey Date: Tue, 4 Jun 2013 17:31:30 -0600 Subject: [PATCH 161/181] More container dev updates --- docs/src/container-development.md | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/src/container-development.md b/docs/src/container-development.md index 95390bfe..1f571c8d 100644 --- a/docs/src/container-development.md +++ b/docs/src/container-development.md @@ -534,7 +534,7 @@ $(function(){ ## AppHandlers for App Layout -New functionality called `F2.AppHandlers` was added in F2 1.2. The conversation about this collection of features occurred in [#38](https://github.com/OpenF2/F2/issues/38) on GitHub. The new `AppHandlers` functionality provides Container Developers a higher level of control over configuring app rendering and interaction. +New functionality called `F2.AppHandlers` was added in F2 1.2, and the conversation about this collection of features occurred in [#38](https://github.com/OpenF2/F2/issues/38) on GitHub. The new `AppHandlers` functionality provides Container Developers a higher level of control over configuring app rendering and interaction.

    The addition of `F2.AppHandlers` replaces the previous `ContainerConfig` properties `beforeAppRender`, `appRender`, and `afterAppRender`. These methods were deprecated—but not removed—in version 1.2. They will be permanently removed in a future version of F2. @@ -544,13 +544,13 @@ The addition of `F2.AppHandlers` replaces the previous `ContainerConfig` propert Starting with F2 version 1.2, `AppHandlers` is the preferred method for Container Developers to manage app layout.

    -The `AppHandlers` functionality provides an event-based system for Container Developers' programs. The addition of a collection of constants in `F2.Constants.AppHandlers` shows the primitive set of event types (or hooks) available to developers, including hooks such as `appCreateRoot`, `appRenderAfter`, `appDestroyAfter` and more. (Review the complete `F2.Constants.AppHandlers` collection in [the F2.js SDK documentation](./sdk/classes/F2.Constants.AppHandlers.html).) +The `AppHandlers` functionality provides an event-based system for Container Developers' web applications. The addition of a collection of constants in `F2.Constants.AppHandlers` shows the primitive set of event types (or hooks) available to developers, including hooks such as `appCreateRoot`, `appRenderAfter`, `appDestroyAfter` and more. (Review the complete `F2.Constants.AppHandlers` collection in [the F2.js SDK documentation](./sdk/classes/F2.Constants.AppHandlers.html).) -Using `AppHandlers` is as simple as attaching an event handler function to be executed at the appropriate time as determined by the order of operations in F2. There are three functions available on `F2.AppHandlers`: `getToken`, `on`, and `off`. +Using `AppHandlers` is as simple as attaching an event handler function to be executed at the appropriate time as determined by the order of operations in F2. To do this there are three functions available on `F2.AppHandlers`: `getToken`, `on`, and `off`. We'll review the token concept first as a token is the required first argument in `on` and `off`. ### AppHandler Tokens -A new feature has been added to F2 as part of `AppHandlers`: the event token. The token is designed to be used only by Container Developers to ensure the `AppHandlers` functions are only called by their programs, and aren't accessible to App Developers' code. Container Developers should create a variable for this token in their JavaScript and encapsulate it inside a closure. +A new feature has been added to F2 as part of `AppHandlers`: the event token. The token is designed to be used only by Container Developers to ensure the `AppHandlers` listeners are only called by their applications, and aren't accessible to App Developers' code. Container Developers should create a variable for this token in their JavaScript and encapsulate it inside a closure as shown in the example below. ```javascript (function(){ @@ -560,7 +560,7 @@ A new feature has been added to F2 as part of `AppHandlers`: the event token. Th }); ``` -Important The `getToken()` function can only be called one-time. It self-destructs to protect the token for Container Developers and therefore Container Developers must call `F2.AppHandlers.getToken()` before any F2 apps are registered with the container. +Important The `getToken()` function can only be called one-time. It self-destructs to protect the token for Container Developers and therefore Container Developers must call `F2.AppHandlers.getToken()` and store its return value before any F2 apps are registered with the container. ### Default App Layout @@ -575,7 +575,7 @@ Appending apps to the `` is the default app rendering behavior of F2. ### Custom App Layout -F2 `AppHandlers` provide event handlers for customized app layout using `F2.AppHandlers.on()` and `F2.AppHandlers.off()`. The use of `on` and `off` require both a [token](#apphandler-tokens) and an event type. The event types, defined as constants in `F2.Constants.AppHandlers`, are: +F2 `AppHandlers` provide event handlers for customized app layout using `F2.AppHandlers.on()` and `F2.AppHandlers.off()`. The use of `on` and `off` require both a [token](#apphandler-tokens) and an event type as arguments. The event types, defined as constants in `F2.Constants.AppHandlers`, are: * `appCreateRoot` * `appDestroy` @@ -585,7 +585,7 @@ F2 `AppHandlers` provide event handlers for customized app layout using `F2.AppH * `appRenderAfter` * `appRenderBefore` -Review the complete `F2.Constants.AppHandlers` collection in [the F2.js SDK documentation](./sdk/classes/F2.Constants.AppHandlers.html). +Review the complete `F2.Constants.AppHandlers` collection and their purpose in [the F2.js SDK documentation](./sdk/classes/F2.Constants.AppHandlers.html). #### Creating an App Root diff --git a/package.json b/package.json index 7ded580b..c47711da 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,6 @@ "engines": { "node": ">=0.10" }, - "_releaseDate": "2013-06-04T15:33:35.065Z", + "_releaseDate": "2013-06-04T23:31:07.261Z", "_releaseDateFormatted": "4 June 2013" } \ No newline at end of file From 0604ae788993ef56e83f6777568b8f32554b611d Mon Sep 17 00:00:00 2001 From: markhealey Date: Wed, 5 Jun 2013 08:01:07 -0600 Subject: [PATCH 162/181] cannot run in wd --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e950354b..672793b2 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,8 @@ For help, run: `$> grunt --help` +Some Mac users have run into a Grunt "cannot run in wd" error when using `grunt` and/or `npm install`. If you're getting that error in your shell, try using '--unsafe-perm' [as discussed here](https://github.com/isaacs/npm/issues/2984). + #### NuGet Package Good news if you're using C#! We have an [F2 NuGet package available](https://nuget.org/packages/F2/). In the Package Manager Console run: From bb06feac2f7325353e11991b7ba57b8ff8b3c048 Mon Sep 17 00:00:00 2001 From: markhealey Date: Wed, 5 Jun 2013 08:33:22 -0600 Subject: [PATCH 163/181] Docs template updates --- docs/js/docs.js | 19 +++++++++++++------ docs/src/template/baseTemplate.html | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/js/docs.js b/docs/js/docs.js index 7d3ece53..c5dfa110 100644 --- a/docs/js/docs.js +++ b/docs/js/docs.js @@ -30,10 +30,11 @@ F2Docs.fn.init = function() { this.buildBookmarks(); this.formatSourceCodeElements(); - $("body").scrollspy(); + /* removed b/c this removes 'active' class on top-level "Docs" nav
  • . weird. + $('body').scrollspy();*/ //affix left nav - $("#toc > ul.nav").affix(); + $('#toc > ul.nav').affix(); } /** @@ -285,11 +286,17 @@ F2Docs.fn._animateAnchor = function(e, isTableOfContentsLink){ */ F2Docs.fn._watchScrollSpy = function(){ $(window).on('scroll',$.proxy(function(e){ - var $nav = this.$currentSectionNavList; - var $activeNav = ("development" == this.currentPage) ? $nav.parent() : $('li',$nav).first(); - if (document.body.scrollTop < 1 && !$activeNav.hasClass('active')){ + var $nav = this.$currentSectionNavList, + $activeNav = $.proxy(function(){ + if (!this.activeNavElement){ + this.activeNavElement = ('development' == this.currentPage) ? $nav.parent() : $('li',$nav).first(); + } + return this.activeNavElement; + },this); + + if (document.body.scrollTop < 1 && !$activeNav().hasClass('active')){ $('li',$nav).removeClass('active'); - $activeNav.addClass('active'); + $activeNav().addClass('active'); } },this)); } diff --git a/docs/src/template/baseTemplate.html b/docs/src/template/baseTemplate.html index 31678412..5eea9fdc 100644 --- a/docs/src/template/baseTemplate.html +++ b/docs/src/template/baseTemplate.html @@ -8,7 +8,7 @@ $endfor$ - + From 77ff20d2cef5d7e63e030c703d5ede7e89ae4271 Mon Sep 17 00:00:00 2001 From: markhealey Date: Wed, 5 Jun 2013 08:38:13 -0600 Subject: [PATCH 164/181] Docs template scrollspy offset --- docs/src/template/baseTemplate.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/template/baseTemplate.html b/docs/src/template/baseTemplate.html index 5eea9fdc..5aeaf98d 100644 --- a/docs/src/template/baseTemplate.html +++ b/docs/src/template/baseTemplate.html @@ -18,7 +18,7 @@ $header-includes$ $endfor$ - + $for(include-before)$ $include-before$ $endfor$ From 21ab5ce19749dd0846b0c17001405f8bce553016 Mon Sep 17 00:00:00 2001 From: brianbaker Date: Wed, 5 Jun 2013 15:03:25 -0600 Subject: [PATCH 165/181] added yuidoc helper so that member names with periods can be linked properly --- Gruntfile.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index 9608fd3b..ca8c6e74 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -362,6 +362,11 @@ module.exports = function(grunt) { return title; }); + // handle any member names that have periods in them + Y.Handlebars.registerHelper('memberNameAsId', function() { + return String(this.name).replace('.', '_'); + }); + // insert readme markdown Y.Handlebars.registerHelper('readme', function() { return builder.markdown(readmeMd, true); From 3088ae9dc0969cf5b1ef18e44ebe2bad17545d74 Mon Sep 17 00:00:00 2001 From: markhealey Date: Wed, 5 Jun 2013 22:30:08 -0600 Subject: [PATCH 166/181] code --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 672793b2..0d6f1617 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ For help, run: `$> grunt --help` -Some Mac users have run into a Grunt "cannot run in wd" error when using `grunt` and/or `npm install`. If you're getting that error in your shell, try using '--unsafe-perm' [as discussed here](https://github.com/isaacs/npm/issues/2984). +Some Mac users have run into a Grunt "cannot run in wd" error when using `grunt` and/or `npm install`. If you're getting that error in your shell, try using `--unsafe-perm` [as discussed here](https://github.com/isaacs/npm/issues/2984). #### NuGet Package From ae5056507df718dce734fa8168b883c02208a98c Mon Sep 17 00:00:00 2001 From: markhealey Date: Wed, 5 Jun 2013 23:21:35 -0600 Subject: [PATCH 167/181] upgrading --- docs/src/f2js-sdk.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/docs/src/f2js-sdk.md b/docs/src/f2js-sdk.md index 2b8f0871..04534e3e 100644 --- a/docs/src/f2js-sdk.md +++ b/docs/src/f2js-sdk.md @@ -6,9 +6,9 @@ Developers who adhere to the F2 standard will make it possible for multiple apps * * * * -## The JavaScript +## F2.js -F2 is an open framework meaning anyone can build individual components or the entire product. To get Container and App Developers started, there is a JavaScript SDK—called F2.js—in addition to example apps as part of an open-source project maintained on [GitHub](https://github.com/OpenF2/F2/). +F2 is an open framework and to get Container and App Developers started, there is a JavaScript SDK—called F2.js—in addition to example apps as part of an open-source project maintained on [GitHub](https://github.com/OpenF2/F2/). * * * * @@ -28,7 +28,9 @@ The latest version of F2.js is **{{version}}**. ## Versioning -The latest version of F2.js will always be in the project root, and the version number is in the top of file. The version number is also available on the command line by using `node build -v`. +The latest version of F2.js will always be in the project root, and the version number is in the top of file. The version number is also available on the command line by using: + +`$> grunt version`. To adhere to industry standards, F2 will be maintained under the Semantic Versioning guidelines as much as possible. @@ -40,9 +42,29 @@ For more information on SemVer, please visit [SemVer.org](http://semver.org/). * * * * +## Upgrading + +It is a goal of ours to make upgrading to the latest version of F2 a minor effort for development teams. Releasing feature enhancements, addressing bugs or security patches, and working hard to maintain backward compatibility for F2.js APIs—while constantly pushing the boundaries—are all part of evolving a web framework for the financial services industry. + +The details from each release of F2, minor and major, are tracked in the [changelog](https://github.com/OpenF2/F2/wiki/Changelog). + +### The Latest + +For developers, getting the latest F2.js SDK is as simple as going to the [project repository on GitHub](https://github.com/OpenF2/F2). A download ([zip](https://github.com/OpenF2/F2/zipball/master)) of the current version ({{version}}) of F2 is always available along with [tags of previous releases](https://github.com/OpenF2/F2/tags). + +Developers can quick-link to the latest copy of F2.js: + +`https://raw.github.com/OpenF2/F2/master/f2.js` + +Note GitHub is [not a CDN](http://stackoverflow.com/questions/5502540/should-github-be-used-as-a-cdn-for-javascript-libraries). + +### Deprecated Features or APIs + +As F2 features and/or F2.js APIs are deprecated, advance notice will be provided on any or all of the F2 [communication channels](https://github.com/OpenF2/F2/blob/master/CONTRIBUTING.md#keep-in-touch). In addition, backward compatibility will be maintained for at least one minor version of F2. For example, if `Feature X` is deprecated in `1.0`, backward compatibility will be maintained until at least version `1.1`. F2 documentation will be updated accordingly to reflect any changes, and the conversation behind deprecated features will be publicly [available on GitHub](https://github.com/OpenF2/F2/issues). + ## Forum -Have a question? Ask it on the [F2 Google Group](https://groups.google.com/forum/#!forum/OpenF2). +Have a question? Ask it on the [F2 Google Group](https://groups.google.com/forum/#!forum/OpenF2) or start a discussion using [Issues on GitHub](https://github.com/OpenF2/F2/issues). @@ -53,3 +75,7 @@ Have a question? Ask it on the [F2 Google Group](https://groups.google.com/forum To track bugs or issues, F2 is using [Issues on GitHub](https://github.com/OpenF2/F2/issues). * * * * + +## License + +F2 is licensed under the Apache License version 2.0. Details are available in the [project readme](https://github.com/OpenF2/F2#copyright-and-license). From 8dfbb1f901f7b542a7336f16399ce561f5dfcaa9 Mon Sep 17 00:00:00 2001 From: markhealey Date: Thu, 6 Jun 2013 07:47:44 -0600 Subject: [PATCH 168/181] fixing linked code elements --- docs/src/template/less/code.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/src/template/less/code.less b/docs/src/template/less/code.less index f1851a07..a78ae002 100755 --- a/docs/src/template/less/code.less +++ b/docs/src/template/less/code.less @@ -55,4 +55,10 @@ pre { .pre-scrollable { max-height: 340px; overflow-y: scroll; +} + +a { + code { + border-color: #e1e1e8 !important; + } } \ No newline at end of file From b0d1019225b692cdae51d4b4d8506a8533c30afd Mon Sep 17 00:00:00 2001 From: markhealey Date: Thu, 6 Jun 2013 11:17:14 -0600 Subject: [PATCH 169/181] updating tests --- tests/index.html | 7 ++-- tests/js/preloadedTest.js | 2 +- tests/server.js | 4 +-- tests/spec/app-handlers-spec.js | 32 +++++++++--------- tests/spec/container-spec.js | 60 ++++++++++++++++----------------- tests/spec/spec-helpers.js | 6 ++++ 6 files changed, 59 insertions(+), 52 deletions(-) diff --git a/tests/index.html b/tests/index.html index 0d6dd17c..d73ecd04 100644 --- a/tests/index.html +++ b/tests/index.html @@ -14,8 +14,8 @@ - - + + @@ -37,10 +37,11 @@ - + + diff --git a/tests/js/preloadedTest.js b/tests/js/preloadedTest.js index 964f4337..52eb0f94 100644 --- a/tests/js/preloadedTest.js +++ b/tests/js/preloadedTest.js @@ -1,4 +1,4 @@ -F2.Apps["com_alikhatami_preloaded_test"] = (function() { +F2.Apps[TEST_APP_ID] = (function() { var App_Class = function (appConfig, appContent, root) { this.appConfig = appConfig; diff --git a/tests/server.js b/tests/server.js index 6735156c..fd0e98fb 100644 --- a/tests/server.js +++ b/tests/server.js @@ -8,10 +8,10 @@ var app = express(); */ app.use('/httpPostTest', function(req, res) { res.setHeader('Content-Type', 'application/json'); - res.end('F2_jsonpCallback_com_openf2_tests_helloworld(' + JSON.stringify({ + res.end('F2_jsonpCallback_com_test_app(' + JSON.stringify({ inlineScripts: [ [ - 'F2.Apps["com_openf2_tests_helloworld"] = function(appConfig, appContent, root) {', + 'F2.Apps["com_test_app"] = function(appConfig, appContent, root) {', 'F2.log(appContent.data.method == "POST");', '};' ].join('') diff --git a/tests/spec/app-handlers-spec.js b/tests/spec/app-handlers-spec.js index b2aa1eb8..a275b3be 100644 --- a/tests/spec/app-handlers-spec.js +++ b/tests/spec/app-handlers-spec.js @@ -8,8 +8,8 @@ describe('F2.AppHandlers', function() { var appConfig = function() { return { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; }; @@ -266,8 +266,8 @@ describe('F2.AppHandlers - rendering - appCreateRoot', function() { var appConfig = function() { return { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; }; @@ -645,8 +645,8 @@ describe('F2.AppHandlers - rendering - appRenderBefore', function() { var appConfig = function() { return { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; }; @@ -1041,8 +1041,8 @@ describe('F2.AppHandlers - rendering - appRender', function() { var appConfig = function() { return { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; }; @@ -1490,8 +1490,8 @@ describe('F2.AppHandlers - rendering - appRenderAfter', function() { var appConfig = function() { return { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; }; @@ -1658,8 +1658,8 @@ describe('F2.AppHandlers - rendering - appDestroyBefore', function() { var appConfig = function() { return { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; }; @@ -1806,8 +1806,8 @@ describe('F2.AppHandlers - rendering - appDestroy', function() { var appConfig = function() { return { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; }; @@ -2053,8 +2053,8 @@ describe('F2.AppHandlers - rendering - appDestroyBefore', function() { var appConfig = function() { return { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; }; diff --git a/tests/spec/container-spec.js b/tests/spec/container-spec.js index 6ff8679f..949db8b0 100644 --- a/tests/spec/container-spec.js +++ b/tests/spec/container-spec.js @@ -4,9 +4,9 @@ describe('F2.registerApps - pre-load', function() { expect(function(){ var appConfig = { - appId:'com_alikhatami_preloaded_test', - manifestUrl:'http://www.openf2.org', - root: $("body").find("div.com_alikhatami_preloaded_test:first").get(0) + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL, + root: $("body").find("div."+TEST_APP_ID+":first").get(0) }; F2.registerApps([appConfig]); @@ -24,8 +24,8 @@ describe('F2.registerApps - pre-load', function() { expect(function(){ F2.init(); var appConfig = { - appId:'com_alikhatami_preloaded_test', - root: $("body").find("div.com_alikhatami_preloaded_test:first").get(0) + appId:TEST_APP_ID, + root: $("body").find("div."+TEST_APP_ID+":first").get(0) }; F2.registerApps(appConfig); }).not.toThrow(); @@ -35,8 +35,8 @@ describe('F2.registerApps - pre-load', function() { expect(function(){ F2.init(); var appConfig = { - appId:'com_alikhatami_preloaded_test', - root: $("body").find("div.com_alikhatami_preloaded_test:first").get(0) + appId: TEST_APP_ID, + root: $("body").find("div."+TEST_APP_ID+":first").get(0) }; F2.registerApps(appConfig); }).not.toLog('"manifestUrl" missing from app object'); @@ -57,12 +57,12 @@ describe('F2.registerApps - pre-load', function() { var appConfigs = [ { - appId: 'com_openf2_examples_csharp_stocknews', - manifestUrl: 'http://www.openf2.org/f2/apps' + appId: TEST_APP_ID2, + manifestUrl: TEST_MANIFEST_URL2 }, { - appId:'com_alikhatami_preloaded_test', - root: $("body").find('div.com_alikhatami_preloaded_test:first').get(0) + appId: TEST_APP_ID, + root: $("body").find('div.'+TEST_APP_ID+':first').get(0) } ]; @@ -96,9 +96,9 @@ describe('F2.registerApps - pre-load', function() { F2.PreloadRetrievedEmit = false; var appConfig = { - appId:'com_alikhatami_preloaded_test', - manifestUrl:'http://www.openf2.org', - root: $("body").find("div.com_alikhatami_preloaded_test:first").get(0) + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL, + root: $("body").find("div."+TEST_APP_ID+":first").get(0) }; F2.init(); @@ -133,16 +133,16 @@ describe('F2.registerApps - pre-load', function() { F2.PreloadAppInitializedCounter = 0; F2.PreloadRetrievedEmitCounter = 0; - var $appsOnPage = $("body").find("div.com_alikhatami_preloaded_test"); + var $appsOnPage = $("body").find("div."+TEST_APP_ID); var appConfigs = [ { - appId:'com_alikhatami_preloaded_test', - manifestUrl:'http://www.openf2.org', + appId:TEST_APP_ID, + manifestUrl:TEST_MANIFEST_URL, root: $appsOnPage.get(0) }, { - appId:'com_alikhatami_preloaded_test', - manifestUrl:'http://www.openf2.org', + appId:TEST_APP_ID, + manifestUrl:TEST_MANIFEST_URL, root: $appsOnPage.get(1) } ]; @@ -276,13 +276,13 @@ describe('F2.registerApps - basic', function() { }).toLog('"appId" missing from app object'); expect(function() { - F2.registerApps({appId:'com_openf2_tests_helloworld'}); + F2.registerApps({appId:TEST_APP_ID}); }).toLog('"manifestUrl" missing from app object'); }); it('should fail when the parameter lengths do not match', function() { expect(function() { - F2.registerApps({appId:'com_openf2_tests_helloworld', manifestUrl:'http://www.openf2.org'}, [{}, {}]); + F2.registerApps({appId:TEST_APP_ID, manifestUrl:TEST_MANIFEST_URL}, [{}, {}]); }).toLog('The length of "apps" does not equal the length of "appManifests"'); }); @@ -294,7 +294,7 @@ describe('F2.registerApps - basic', function() { }; runs(function() { - F2.registerApps({appId:'com_openf2_tests_helloworld', manifestUrl:'http://www.openf2.org'}, {apps:[{html:'
    '}]}); + F2.registerApps({appId:TEST_APP_ID, manifestUrl:TEST_MANIFEST_URL}, {apps:[{html:'
    '}]}); }); // wait long enough for registerApps to have failed @@ -315,8 +315,8 @@ describe('F2.registerApps - xhr overrides', function() { }); var appConfig = { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; it('should call xhr if it is defined', function() { @@ -484,7 +484,7 @@ describe('F2.registerApps - xhr overrides', function() { } } }); - F2.registerApps({appId:'com_openf2_tests_helloworld', manifestUrl:'http://localhost:8080/httpPostTest'}); + F2.registerApps({appId:'com_test_app', manifestUrl:'http://localhost:8080/httpPostTest'}); }); // wait for registerApps to complete and load the app @@ -517,7 +517,7 @@ describe('F2.registerApps - xhr overrides', function() { } } }); - F2.registerApps({appId:'com_openf2_tests_helloworld', manifestUrl:'http://127.0.0.1:8080/httpPostTest'}); + F2.registerApps({appId:'com_test_app', manifestUrl:'http://127.0.0.1:8080/httpPostTest'}); }); // wait for registerApps to complete and load the app @@ -539,8 +539,8 @@ describe('F2.registerApps - rendering', function() { }); var appConfig = { - appId: 'com_openf2_tests_helloworld', - manifestUrl: 'http://www.openf2.org' + appId: TEST_APP_ID, + manifestUrl: TEST_MANIFEST_URL }; var appManifest = { scripts:[], @@ -582,7 +582,7 @@ describe('F2.registerApps - rendering', function() { it('should eval AppManifest.inlineScripts when AppManifest.scripts are defined', function(){ F2.inlineScriptsEvaluated = false; F2.init(); - F2.registerApps([{appId:'com_openf2_tests_helloworld', manifestUrl:'/'}], [{'inlineScripts': ['(function(){F2.inlineScriptsEvaluated=true;})()'], 'scripts':['js/test.js'],'apps':[{'html': '
    Testing
    ' }]}]); + F2.registerApps([{appId:TEST_APP_ID, manifestUrl:TEST_MANIFEST_URL}], [{'inlineScripts': ['(function(){F2.inlineScriptsEvaluated=true;})()'], 'scripts':['js/test.js'],'apps':[{'html': '
    Testing
    ' }]}]); waitsFor( function() @@ -602,7 +602,7 @@ describe('F2.registerApps - rendering', function() { it('should eval AppManifest.inlineScripts when AppManifest.scripts are not defined', function(){ F2.inlineScriptsEvaluated = false; F2.init(); - F2.registerApps([{appId:'com_openf2_tests_helloworld', manifestUrl:'/'}], [{'inlineScripts': ['(function(){F2.inlineScriptsEvaluated=true;})()'],'apps':[{'html': '
    Testing
    ' }]}]); + F2.registerApps([{appId:TEST_APP_ID, manifestUrl:TEST_MANIFEST_URL}], [{'inlineScripts': ['(function(){F2.inlineScriptsEvaluated=true;})()'],'apps':[{'html': '
    Testing
    ' }]}]); waitsFor( function() { diff --git a/tests/spec/spec-helpers.js b/tests/spec/spec-helpers.js index fcea0f93..6a49e505 100644 --- a/tests/spec/spec-helpers.js +++ b/tests/spec/spec-helpers.js @@ -1,3 +1,9 @@ +var TEST_MANIFEST_URL = 'http://docs.openf2.org/demos/apps/JavaScript/HelloWorld/manifest.js', + TEST_APP_ID = 'com_openf2_examples_javascript_helloworld', + TEST_MANIFEST_URL2 = 'http://www.openf2.org/Examples/Apps', + TEST_APP_ID2 = 'com_openf2_examples_csharp_marketnews' +; + /** * Addition to Jasmine Async that reloads F2 */ From 61d192d60565a4ef792e77fac34dcd2481a0c58f Mon Sep 17 00:00:00 2001 From: markhealey Date: Thu, 6 Jun 2013 11:24:53 -0600 Subject: [PATCH 170/181] updating amd tests --- tests/index-amd.html | 4 ++-- tests/index.html | 2 -- tests/js/preloadedTest-amd.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/index-amd.html b/tests/index-amd.html index 3d276905..61d0b914 100644 --- a/tests/index-amd.html +++ b/tests/index-amd.html @@ -13,8 +13,8 @@ - - + + diff --git a/tests/index.html b/tests/index.html index d73ecd04..48fd3e4c 100644 --- a/tests/index.html +++ b/tests/index.html @@ -37,8 +37,6 @@ - - diff --git a/tests/js/preloadedTest-amd.js b/tests/js/preloadedTest-amd.js index bedd45e5..45d8ac82 100644 --- a/tests/js/preloadedTest-amd.js +++ b/tests/js/preloadedTest-amd.js @@ -1,5 +1,5 @@ require(['../sdk/f2.min.js'], function () { - F2.Apps['com_alikhatami_preloaded_test'] = (function() { + F2.Apps[TEST_APP_ID] = (function() { var App_Class = function (appConfig, appContent, root) { this.appConfig = appConfig; From 3a1becea1b9b2f1794220e50e40a2165974e6959 Mon Sep 17 00:00:00 2001 From: markhealey Date: Thu, 6 Jun 2013 11:28:04 -0600 Subject: [PATCH 171/181] app handlers chngs --- sdk/f2.debug.js | 155 +++++++++++++++++++++------------------ sdk/f2.min.js | 20 ++--- sdk/f2.min.map | 2 +- sdk/f2.no-third-party.js | 155 +++++++++++++++++++++------------------ sdk/src/app_handlers.js | 155 +++++++++++++++++++++------------------ 5 files changed, 260 insertions(+), 227 deletions(-) diff --git a/sdk/f2.debug.js b/sdk/f2.debug.js index caf67778..d63f6f50 100644 --- a/sdk/f2.debug.js +++ b/sdk/f2.debug.js @@ -13632,27 +13632,34 @@ F2 = (function() { })(); /** - * Allows container developers more flexibility when it comes to handling app interaction. Starting with version 1.2 this is the preferred method - * for choosing how app rendering/interaction happens. This replaces the properties {{#crossLink "F2.ContainerConfig/beforeAppRender"}}{{/crossLink}}, - * {{#crossLink "F2.ContainerConfig/appRender"}}{{/crossLink}}, and {{#crossLink "F2.ContainerConfig/afterAppRender"}}{{/crossLink}} methods in {{#crossLink "F2.ContainerConfig"}}{{/crossLink}}. It also - * adds hooks into an app instance being removed from the container. + * The new `AppHandlers` functionality provides Container Developers a higher level of control over configuring app rendering and interaction. + * + *

    + *The addition of `F2.AppHandlers` replaces the previous {{#crossLink "F2.ContainerConfig"}}{{/crossLink}} properties `beforeAppRender`, `appRender`, and `afterAppRender`. These methods were deprecated—but not removed—in version 1.2. They will be permanently removed in a future version of F2. + *

    + * + *

    + *Starting with F2 version 1.2, `AppHandlers` is the preferred method for Container Developers to manage app layout. + *

    + * + * ### Order of Execution * * **App Rendering** * - * 0. {{#crossLink "F2/registerApps"}}F2.registerApps(){{/crossLink}} method is called by the container developer and the following methods are run for *each* {{#crossLink "F2.AppConfig"}}{{/crossLink}} passed. - * 1. **'appCreateRoot'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_CREATE\_ROOT*) handlers are fired in the order they were bound/added. - * 2. **'appRenderBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_BEFORE*) handlers are fired in the order they were bound/added. - * 3. Each app is requested asynchronously via manifest url, on success the following methods are fired. - * 3. **'appRender'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER*) handlers are fired in the order they were bound/added. - * 4. **'appRenderAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_AFTER*) handlers are fired in the order they were bound/added. + * 0. {{#crossLink "F2/registerApps"}}F2.registerApps(){{/crossLink}} method is called by the Container Developer and the following methods are run for *each* {{#crossLink "F2.AppConfig"}}{{/crossLink}} passed. + * 1. **'appCreateRoot'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_CREATE\_ROOT*) handlers are fired in the order they were attached. + * 2. **'appRenderBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_BEFORE*) handlers are fired in the order they were attached. + * 3. Each app's `manifestUrl` is requested asynchronously; on success the following methods are fired. + * 3. **'appRender'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER*) handlers are fired in the order they were attached. + * 4. **'appRenderAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_RENDER\_AFTER*) handlers are fired in the order they were attached. * * * **App Removal** - * 0. {{#crossLink "F2/removeApp"}}F2.removeApp(){{/crossLink}} with a specific {{#crossLink "F2.AppConfig/instanceId "}}{{/crossLink}} or {{#crossLink "F2/removeAllApps"}}F2.removeAllApps(){{/crossLink}} method is called by the container developer and the following methods are run. - * 1. **'appDestroyBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_BEFORE*) handlers are fired in the order they were bound/added. - * 2. **'appDestroy'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY*) handlers are fired in the order they were bound/added. - * 3. **'appDestroyAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_AFTER*) handlers are fired in the order they were bound/added. + * 0. {{#crossLink "F2/removeApp"}}F2.removeApp(){{/crossLink}} with a specific {{#crossLink "F2.AppConfig/instanceId "}}{{/crossLink}} or {{#crossLink "F2/removeAllApps"}}F2.removeAllApps(){{/crossLink}} method is called by the Container Developer and the following methods are run. + * 1. **'appDestroyBefore'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_BEFORE*) handlers are fired in the order they were attached. + * 2. **'appDestroy'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY*) handlers are fired in the order they were attached. + * 3. **'appDestroyAfter'** (*{{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}.APP\_DESTROY\_AFTER*) handlers are fired in the order they were attached. * @class F2.AppHandlers */ F2.extend('AppHandlers', (function() { @@ -13676,7 +13683,7 @@ F2.extend('AppHandlers', (function() { { var $root = null; - // if no app root is defined use the apps outter most node + // if no app root is defined use the apps outer most node if(!F2.isNativeDOMNode(appConfig.root)) { appConfig.root = jQuery(appHtml).get(0); @@ -13702,7 +13709,7 @@ F2.extend('AppHandlers', (function() { { appInstance.app.destroy(); } - // warn the container developer/app developer that even though they have a destroy method it hasn't been + // warn the Container and App Developer that even though they have a destroy method it hasn't been else if(appInstance && appInstance.app && appInstance.app.destroy) { F2.log(appInstance.config.appId + ' has a destroy property, but destroy is not of type function and as such will not be executed.'); @@ -13742,7 +13749,7 @@ F2.extend('AppHandlers', (function() { var _validateToken = function(sToken) { - // check token against F2 and Container + // check token against F2 and container if(_ct != sToken && _f2t != sToken) { throw ('Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken().'); } }; @@ -13809,15 +13816,15 @@ F2.extend('AppHandlers', (function() { return { /** - * Allows container developer to retrieve a special token which must be passed to - * all On and Off methods. This function will self destruct so be sure to keep the response - * inside of a closure somewhere. + * Allows Container Developer to retrieve a unique token which must be passed to + * all `on` and `off` methods. This function will self destruct and can only be called + * one time. Container Developers must store the return value inside of a closure. * @method getToken **/ getToken: function() { // delete this method for security that way only the container has access to the token 1 time. - // kind of James Bond-ish, this message will self destruct immediately. + // kind of Ethan Hunt-ish, this message will self destruct immediately. delete this.getToken; // return the token, which we validate against. return _ct; @@ -13825,25 +13832,25 @@ F2.extend('AppHandlers', (function() { /** * Allows F2 to get a token internally. Token is required to call {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. * This function will self destruct to eliminate other sources from using the {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}} - * and other internal methods. + * and additional internal methods. * @method __f2GetToken * @private **/ __f2GetToken: function() { // delete this method for security that way only the F2 internally has access to the token 1 time. - // kind of James Bond-ish, this message will self destruct immediately. + // kind of Ethan Hunt-ish, this message will self destruct immediately. delete this.__f2GetToken; // return the token, which we validate against. return _f2t; }, /** - * Allows F2 to trigger specific app events internally. + * Allows F2 to trigger specific events internally. * @method __trigger * @private * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/\_\_f2GetToken:method"}}{{/crossLink}}. - * @param {String} eventKey The event you want to fire. Complete list of event keys available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. + * @param {String} eventKey The event to fire. The complete list of event keys is available in {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. **/ __trigger: function(token, eventKey) // additional arguments will likely be passed { @@ -13898,53 +13905,51 @@ F2.extend('AppHandlers', (function() { return this; }, /** - * Allows you to easily tell all apps to render in a specific location. Only valid for eventType 'appRender'. + * Allows Container Developer to easily tell all apps to render in a specific location. Only valid for eventType `appRender`. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:methods"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key used to determine which event to attach the listener to. The namespace is useful for removal * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in - * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. - * @params {HTMLElement|Node} element Specific element to append your app to. + * {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. + * @params {HTMLElement} element Specific DOM element to which app gets appended. * @example - * var sToken = F2.AppHandlers.getToken(); - * + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * sToken, + * _token, * 'appRender', - * document.getElementById('my_container') + * document.getElementById('my_app') * ); * - * // or - * + * Or: + * @example * F2.AppHandlers.on( - * sToken, + * _token, * 'appRender.myNamespace', - * document.getElementById('my_container') + * document.getElementById('my_app') * ); **/ /** - * Allows you to add listener method that will be triggered when a specific event occurs. + * Allows Container Developer to add listener method that will be triggered when a specific event occurs. * @method on * @chainable - * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}} or {{#crossLink "F2.AppHandlers/\_\_trigger:method"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what event you want to bind to. The namespace is useful for removal + * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}}. + * @param {String} eventKey{.namespace} The event key used to determine which event to attach the listener to. The namespace is useful for removal * purposes. At this time it does not affect when an event is fired. Complete list of event keys available in - * {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. + * {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. * @params {Function} listener A function that will be triggered when a specific event occurs. For detailed argument definition refer to {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. * @example - * var sToken = F2.AppHandlers.getToken(); - * + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * sToken, + * _token, * 'appRenderBefore' * function() { F2.log('before app rendered!'); * }); * - * // or - * + * Or: + * @example * F2.AppHandlers.on( - * sToken, + * _token, * 'appRenderBefore.myNamespace', * function() { F2.log('before app rendered!'); * }); @@ -13985,18 +13990,17 @@ F2.extend('AppHandlers', (function() { return this; }, /** - * Allows you to remove listener methods for specific events + * Allows Container Developer to remove listener methods for specific events * @method off * @chainable * @param {String} token The token received from {{#crossLink "F2.AppHandlers/getToken:method"}}{{/crossLink}}. - * @param {String} eventKey{.namespace} The event key to determine what listeners need to be removed. If no namespace is provided all + * @param {String} eventKey{.namespace} The event key used to determine which event to attach the listener to. If no namespace is provided all * listeners for the specified event type will be removed. - * Complete list available in {{#crossLink "F2.Constants/AppHandlers:property"}}{{/crossLink}}. + * Complete list available in {{#crossLink "F2.Constants.AppHandlers"}}{{/crossLink}}. * @example - * F2.AppHandlers.off( - * F2.AppHandlers.getToken(), - * 'appRenderBefore' - * ); + * var _token = F2.AppHandlers.getToken(); + * F2.AppHandlers.off(_token,'appRenderBefore'); + * **/ off: function(token, eventKey) { @@ -14042,7 +14046,7 @@ F2.extend('Constants', { { return { /** - * Equivalent to 'appCreateRoot'. Identifies the create root method for use in AppHandlers.on/off/__trigger(). + * Equivalent to `appCreateRoot`. Identifies the create root method for use in AppHandlers.on/off. * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) * @property APP_CREATE_ROOT @@ -14050,20 +14054,21 @@ F2.extend('Constants', { * @static * @final * @example + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), + * _token, * F2.Constants.AppHandlers.APP_CREATE_ROOT, * function(appConfig) * { - * // If you want to create a custom root. By default F2 uses the app's outter most HTML element. - * // the app's html is not available until after the manifest is retrieved so this logic occurse in F2.Constants.AppHandlers.APP_RENDER + * // If you want to create a custom root. By default F2 uses the app's outermost HTML element. + * // the app's html is not available until after the manifest is retrieved so this logic occurs in F2.Constants.AppHandlers.APP_RENDER * appConfig.root = jQuery('
    ').get(0); * } * ); */ APP_CREATE_ROOT: 'appCreateRoot', /** - * Equivalent to 'appRenderBefore'. Identifies the before app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to `appRenderBefore`. Identifies the before app render method for use in AppHandlers.on/off. * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) * @property APP_RENDER_BEFORE @@ -14071,8 +14076,9 @@ F2.extend('Constants', { * @static * @final * @example + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), + * _token, * F2.Constants.AppHandlers.APP_RENDER_BEFORE, * function(appConfig) * { @@ -14082,7 +14088,7 @@ F2.extend('Constants', { */ APP_RENDER_BEFORE: 'appRenderBefore', /** - * Equivalent to 'appRender'. Identifies the app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to `appRender`. Identifies the app render method for use in AppHandlers.on/off. * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}}, [appHtml](../../app-development.html#app-design) ) * @property APP_RENDER @@ -14090,14 +14096,15 @@ F2.extend('Constants', { * @static * @final * @example + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), + * _token, * F2.Constants.AppHandlers.APP_RENDER, * function(appConfig, appHtml) * { * var $root = null; * - * // if no app root is defined use the apps outter most node + * // if no app root is defined use the apps outer most node * if(!F2.isNativeDOMNode(appConfig.root)) * { * appConfig.root = jQuery(appHtml).get(0); @@ -14120,7 +14127,7 @@ F2.extend('Constants', { */ APP_RENDER: 'appRender', /** - * Equivalent to 'appRenderAfter'. Identifies the after app render method for use in AppHandlers.on/off/__trigger(). + * Equivalent to `appRenderAfter`. Identifies the after app render method for use in AppHandlers.on/off. * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the * following argument(s): ( {{#crossLink "F2.AppConfig"}}appConfig{{/crossLink}} ) * @property APP_RENDER_AFTER @@ -14128,8 +14135,9 @@ F2.extend('Constants', { * @static * @final * @example + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), + * _token, * F2.Constants.AppHandlers.APP_RENDER_AFTER, * function(appConfig) * { @@ -14139,7 +14147,7 @@ F2.extend('Constants', { */ APP_RENDER_AFTER: 'appRenderAfter', /** - * Equivalent to 'appDestroyBefore'. Identifies the before app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to `appDestroyBefore`. Identifies the before app destroy method for use in AppHandlers.on/off. * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the * following argument(s): ( appInstance ) * @property APP_DESTROY_BEFORE @@ -14147,8 +14155,9 @@ F2.extend('Constants', { * @static * @final * @example + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), + * _token, * F2.Constants.AppHandlers.APP_DESTROY_BEFORE, * function(appInstance) * { @@ -14158,7 +14167,7 @@ F2.extend('Constants', { */ APP_DESTROY_BEFORE: 'appDestroyBefore', /** - * Equivalent to 'appDestroy'. Identifies the app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to `appDestroy`. Identifies the app destroy method for use in AppHandlers.on/off. * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the * following argument(s): ( appInstance ) * @property APP_DESTROY @@ -14166,8 +14175,9 @@ F2.extend('Constants', { * @static * @final * @example + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), + * _token, * F2.Constants.AppHandlers.APP_DESTROY, * function(appInstance) * { @@ -14190,7 +14200,7 @@ F2.extend('Constants', { */ APP_DESTROY: 'appDestroy', /** - * Equivalent to 'appDestroyAfter'. Identifies the after app destroy method for use in AppHandlers.on/off/__trigger(). + * Equivalent to `appDestroyAfter`. Identifies the after app destroy method for use in AppHandlers.on/off. * When bound using {{#crossLink "F2.AppHandlers/on"}}F2.AppHandlers.on(){{/crossLink}} the listener function passed will receive the * following argument(s): ( appInstance ) * @property APP_DESTROY_AFTER @@ -14198,8 +14208,9 @@ F2.extend('Constants', { * @static * @final * @example + * var _token = F2.AppHandlers.getToken(); * F2.AppHandlers.on( - * F2.AppHandlers.getToken(), + * _token, * F2.Constants.AppHandlers.APP_DESTROY_AFTER, * function(appInstance) * { diff --git a/sdk/f2.min.js b/sdk/f2.min.js index 1a1c26f1..05d37a5b 100644 --- a/sdk/f2.min.js +++ b/sdk/f2.min.js @@ -1,4 +1,4 @@ -!function(exports){if(!exports.F2||exports.F2_TESTING_MODE){/*! +(function(exports){if(!exports.F2||exports.F2_TESTING_MODE){/*! JSON.org requires the following notice to accompany json2: Copyright (c) 2002 JSON.org @@ -17,7 +17,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(a){return 10>a?"0"+a:a}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'"'+a.replace(escapable,function(a){var b=meta[a];return"string"==typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function str(a,b){var c,d,e,f,g,h=gap,i=b[a];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(a)),"function"==typeof rep&&(i=rep.call(b,a,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,g=[],"[object Array]"===Object.prototype.toString.apply(i)){for(f=i.length,c=0;f>c;c+=1)g[c]=str(c,i)||"null";return e=0===g.length?"[]":gap?"[\n"+gap+g.join(",\n"+gap)+"\n"+h+"]":"["+g.join(",")+"]",gap=h,e}if(rep&&"object"==typeof rep)for(f=rep.length,c=0;f>c;c+=1)"string"==typeof rep[c]&&(d=rep[c],e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&&(e=str(d,i),e&&g.push(quote(d)+(gap?": ":":")+e));return e=0===g.length?"{}":gap?"{\n"+gap+g.join(",\n"+gap)+"\n"+h+"}":"{"+g.join(",")+"}",gap=h,e}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,b,c){var d;if(gap="",indent="","number"==typeof c)for(d=0;c>d;d+=1)indent+=" ";else"string"==typeof c&&(indent=c);if(rep=b,b&&"function"!=typeof b&&("object"!=typeof b||"number"!=typeof b.length))throw new Error("JSON.stringify");return str("",{"":a})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&&"object"==typeof e)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&&(d=walk(e,c),void 0!==d?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),/*! +"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,a,s=gap,l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),"function"==typeof rep&&(l=rep.call(t,e,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?l+"":"null";case"boolean":case"null":return l+"";case"object":if(!l)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(l)){for(i=l.length,n=0;i>n;n+=1)a[n]=str(n,l)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;i>n;n+=1)"string"==typeof rep[n]&&(r=rep[n],o=str(r,l),o&&a.push(quote(r)+(gap?": ":":")+o));else for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(o=str(r,l),o&&a.push(quote(r)+(gap?": ":":")+o));return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(e,t,o)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),/*! * jQuery JavaScript Library v1.8.3 * The jQuery Foundation and other contributors require the following notice to accompany jQuery: * @@ -38,15 +38,15 @@ * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -function(a,b){function c(a){var b=ob[a]={};return $.each(a.split(bb),function(a,c){b[c]=!0}),b}function d(a,c,d){if(d===b&&1===a.nodeType){var e="data-"+c.replace(qb,"-$1").toLowerCase();if(d=a.getAttribute(e),"string"==typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:+d+""===d?+d:pb.test(d)?$.parseJSON(d):d}catch(f){}$.data(a,c,d)}else d=b}return d}function e(a){var b;for(b in a)if(("data"!==b||!$.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function f(){return!1}function g(){return!0}function h(a){return!a||!a.parentNode||11===a.parentNode.nodeType}function i(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function j(a,b,c){if(b=b||0,$.isFunction(b))return $.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return $.grep(a,function(a){return a===b===c});if("string"==typeof b){var d=$.grep(a,function(a){return 1===a.nodeType});if(Kb.test(b))return $.filter(b,d,!c);b=$.filter(b,d)}return $.grep(a,function(a){return $.inArray(a,b)>=0===c})}function k(a){var b=Nb.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function l(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function m(a,b){if(1===b.nodeType&&$.hasData(a)){var c,d,e,f=$._data(a),g=$._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)$.event.add(b,c,h[c][d])}g.data&&(g.data=$.extend({},g.data))}}function n(a,b){var c;1===b.nodeType&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),$.support.html5Clone&&a.innerHTML&&!$.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Xb.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.selected=a.defaultSelected:"input"===c||"textarea"===c?b.defaultValue=a.defaultValue:"script"===c&&b.text!==a.text&&(b.text=a.text),b.removeAttribute($.expando))}function o(a){return"undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function p(a){Xb.test(a.type)&&(a.defaultChecked=a.checked)}function q(a,b){if(b in a)return b;for(var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=rc.length;e--;)if(b=rc[e]+c,b in a)return b;return d}function r(a,b){return a=b||a,"none"===$.css(a,"display")||!$.contains(a.ownerDocument,a)}function s(a,b){for(var c,d,e=[],f=0,g=a.length;g>f;f++)c=a[f],c.style&&(e[f]=$._data(c,"olddisplay"),b?(e[f]||"none"!==c.style.display||(c.style.display=""),""===c.style.display&&r(c)&&(e[f]=$._data(c,"olddisplay",w(c.nodeName)))):(d=cc(c,"display"),e[f]||"none"===d||$._data(c,"olddisplay",d)));for(f=0;g>f;f++)c=a[f],c.style&&(b&&"none"!==c.style.display&&""!==c.style.display||(c.style.display=b?e[f]||"":"none"));return a}function t(a,b,c){var d=kc.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function u(a,b,c,d){for(var e=c===(d?"border":"content")?4:"width"===b?1:0,f=0;4>e;e+=2)"margin"===c&&(f+=$.css(a,c+qc[e],!0)),d?("content"===c&&(f-=parseFloat(cc(a,"padding"+qc[e]))||0),"margin"!==c&&(f-=parseFloat(cc(a,"border"+qc[e]+"Width"))||0)):(f+=parseFloat(cc(a,"padding"+qc[e]))||0,"padding"!==c&&(f+=parseFloat(cc(a,"border"+qc[e]+"Width"))||0));return f}function v(a,b,c){var d="width"===b?a.offsetWidth:a.offsetHeight,e=!0,f=$.support.boxSizing&&"border-box"===$.css(a,"boxSizing");if(0>=d||null==d){if(d=cc(a,b),(0>d||null==d)&&(d=a.style[b]),lc.test(d))return d;e=f&&($.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+u(a,b,c||(f?"border":"content"),e)+"px"}function w(a){if(nc[a])return nc[a];var b=$("<"+a+">").appendTo(P.body),c=b.css("display");return b.remove(),("none"===c||""===c)&&(dc=P.body.appendChild(dc||$.extend(P.createElement("iframe"),{frameBorder:0,width:0,height:0})),ec&&dc.createElement||(ec=(dc.contentWindow||dc.contentDocument).document,ec.write(""),ec.close()),b=ec.body.appendChild(ec.createElement(a)),c=cc(b,"display"),P.body.removeChild(dc)),nc[a]=c,c}function x(a,b,c,d){var e;if($.isArray(b))$.each(b,function(b,e){c||uc.test(a)?d(a,e):x(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==$.type(b))d(a,b);else for(e in b)x(a+"["+e+"]",b[e],c,d)}function y(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(bb),h=0,i=g.length;if($.isFunction(c))for(;i>h;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function z(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;for(var h,i=a[f],j=0,k=i?i.length:0,l=a===Kc;k>j&&(l||!h);j++)h=i[j](c,d,e),"string"==typeof h&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=z(a,c,d,e,h,g)));return!l&&h||g["*"]||(h=z(a,c,d,e,"*",g)),h}function A(a,c){var d,e,f=$.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&$.extend(!0,a,e)}function B(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);for(;"*"===j[0];)j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}return g?(g!==j[0]&&j.unshift(g),d[g]):void 0}function C(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;if(a.dataFilter&&(b=a.dataFilter(b,a.dataType)),g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if("*"!==e){if("*"!==h&&h!==e){if(c=i[h+" "+e]||i["* "+e],!c)for(d in i)if(f=d.split(" "),f[1]===e&&(c=i[h+" "+f[0]]||i["* "+f[0]])){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function D(){try{return new a.XMLHttpRequest}catch(b){}}function E(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function F(){return setTimeout(function(){Vc=b},0),Vc=$.now()}function G(a,b){$.each(b,function(b,c){for(var d=(_c[b]||[]).concat(_c["*"]),e=0,f=d.length;f>e;e++)if(d[e].call(a,b,c))return})}function H(a,b,c){var d,e=0,f=$c.length,g=$.Deferred().always(function(){delete h.elem}),h=function(){for(var b=Vc||F(),c=Math.max(0,i.startTime+i.duration-b),d=c/i.duration||0,e=1-d,f=0,h=i.tweens.length;h>f;f++)i.tweens[f].run(e);return g.notifyWith(a,[i,e,c]),1>e&&h?c:(g.resolveWith(a,[i]),!1)},i=g.promise({elem:a,props:$.extend({},b),opts:$.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Vc||F(),duration:c.duration,tweens:[],createTween:function(b,c){var d=$.Tween(a,i.opts,b,c,i.opts.specialEasing[b]||i.opts.easing);return i.tweens.push(d),d},stop:function(b){for(var c=0,d=b?i.tweens.length:0;d>c;c++)i.tweens[c].run(1);return b?g.resolveWith(a,[i,b]):g.rejectWith(a,[i,b]),this}}),j=i.props;for(I(j,i.opts.specialEasing);f>e;e++)if(d=$c[e].call(i,a,j,i.opts))return d;return G(i,j),$.isFunction(i.opts.start)&&i.opts.start.call(a,i),$.fx.timer($.extend(h,{anim:i,queue:i.opts.queue,elem:a})),i.progress(i.opts.progress).done(i.opts.done,i.opts.complete).fail(i.opts.fail).always(i.opts.always)}function I(a,b){var c,d,e,f,g;for(c in a)if(d=$.camelCase(c),e=b[d],f=a[c],$.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=$.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function J(a,b,c){var d,e,f,g,h,i,j,k,l,m=this,n=a.style,o={},p=[],q=a.nodeType&&r(a);c.queue||(k=$._queueHooks(a,"fx"),null==k.unqueued&&(k.unqueued=0,l=k.empty.fire,k.empty.fire=function(){k.unqueued||l()}),k.unqueued++,m.always(function(){m.always(function(){k.unqueued--,$.queue(a,"fx").length||k.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[n.overflow,n.overflowX,n.overflowY],"inline"===$.css(a,"display")&&"none"===$.css(a,"float")&&($.support.inlineBlockNeedsLayout&&"inline"!==w(a.nodeName)?n.zoom=1:n.display="inline-block")),c.overflow&&(n.overflow="hidden",$.support.shrinkWrapBlocks||m.done(function(){n.overflow=c.overflow[0],n.overflowX=c.overflow[1],n.overflowY=c.overflow[2]}));for(d in b)if(f=b[d],Xc.exec(f)){if(delete b[d],i=i||"toggle"===f,f===(q?"hide":"show"))continue;p.push(d)}if(g=p.length){h=$._data(a,"fxshow")||$._data(a,"fxshow",{}),"hidden"in h&&(q=h.hidden),i&&(h.hidden=!q),q?$(a).show():m.done(function(){$(a).hide()}),m.done(function(){var b;$.removeData(a,"fxshow",!0);for(b in o)$.style(a,b,o[b])});for(d=0;g>d;d++)e=p[d],j=m.createTween(e,q?h[e]:0),o[e]=h[e]||$.style(a,e),e in h||(h[e]=j.start,q&&(j.end=j.start,j.start="width"===e||"height"===e?1:0))}}function K(a,b,c,d,e){return new K.prototype.init(a,b,c,d,e)}function L(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=qc[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function M(a){return $.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}var N,O,P=a.document,Q=a.location,R=a.navigator,S=a.jQuery,T=a.$,U=Array.prototype.push,V=Array.prototype.slice,W=Array.prototype.indexOf,X=Object.prototype.toString,Y=Object.prototype.hasOwnProperty,Z=String.prototype.trim,$=function(a,b){return new $.fn.init(a,b,N)},_=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,ab=/\S/,bb=/\s+/,cb=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,db=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,eb=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,fb=/^[\],:{}\s]*$/,gb=/(?:^|:|,)(?:\s*\[)+/g,hb=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,ib=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,jb=/^-ms-/,kb=/-([\da-z])/gi,lb=function(a,b){return(b+"").toUpperCase()},mb=function(){P.addEventListener?(P.removeEventListener("DOMContentLoaded",mb,!1),$.ready()):"complete"===P.readyState&&(P.detachEvent("onreadystatechange",mb),$.ready())},nb={};$.fn=$.prototype={constructor:$,init:function(a,c,d){var e,f,g;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if("string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:db.exec(a),!e||!e[1]&&c)return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a);if(e[1])return c=c instanceof $?c[0]:c,g=c&&c.nodeType?c.ownerDocument||c:P,a=$.parseHTML(e[1],g,!0),eb.test(e[1])&&$.isPlainObject(c)&&this.attr.call(a,c,!0),$.merge(this,a);if(f=P.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return d.find(a);this.length=1,this[0]=f}return this.context=P,this.selector=a,this}return $.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),$.makeArray(a,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return V.call(this)},get:function(a){return null==a?this.toArray():0>a?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=$.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,"find"===b?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return $.each(this,a,b)},ready:function(a){return $.ready.promise().done(a),this},eq:function(a){return a=+a,-1===a?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(V.apply(this,arguments),"slice",V.call(arguments).join(","))},map:function(a){return this.pushStack($.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:U,sort:[].sort,splice:[].splice},$.fn.init.prototype=$.fn,$.extend=$.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),"object"==typeof h||$.isFunction(h)||(h={}),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&($.isPlainObject(e)||(f=$.isArray(e)))?(f?(f=!1,g=d&&$.isArray(d)?d:[]):g=d&&$.isPlainObject(d)?d:{},h[c]=$.extend(k,g,e)):e!==b&&(h[c]=e));return h},$.extend({noConflict:function(b){return a.$===$&&(a.$=T),b&&a.jQuery===$&&(a.jQuery=S),$},isReady:!1,readyWait:1,holdReady:function(a){a?$.readyWait++:$.ready(!0)},ready:function(a){if(a===!0?!--$.readyWait:!$.isReady){if(!P.body)return setTimeout($.ready,1);$.isReady=!0,a!==!0&&--$.readyWait>0||(O.resolveWith(P,[$]),$.fn.trigger&&$(P).trigger("ready").off("ready"))}},isFunction:function(a){return"function"===$.type(a)},isArray:Array.isArray||function(a){return"array"===$.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return null==a?String(a):nb[X.call(a)]||"object"},isPlainObject:function(a){if(!a||"object"!==$.type(a)||a.nodeType||$.isWindow(a))return!1;try{if(a.constructor&&!Y.call(a,"constructor")&&!Y.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||Y.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return a&&"string"==typeof a?("boolean"==typeof b&&(c=b,b=0),b=b||P,(d=eb.exec(a))?[b.createElement(d[1])]:(d=$.buildFragment([a],b,c?null:[]),$.merge([],(d.cacheable?$.clone(d.fragment):d.fragment).childNodes))):null},parseJSON:function(b){return b&&"string"==typeof b?(b=$.trim(b),a.JSON&&a.JSON.parse?a.JSON.parse(b):fb.test(b.replace(hb,"@").replace(ib,"]").replace(gb,""))?new Function("return "+b)():($.error("Invalid JSON: "+b),void 0)):null},parseXML:function(c){var d,e;if(!c||"string"!=typeof c)return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return d&&d.documentElement&&!d.getElementsByTagName("parsererror").length||$.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&ab.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(jb,"ms-").replace(kb,lb)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||$.isFunction(a);if(d)if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;g>f&&c.apply(a[f++],d)!==!1;);else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;g>f&&c.call(a[f],f,a[f++])!==!1;);return a},trim:Z&&!Z.call(" ")?function(a){return null==a?"":Z.call(a)}:function(a){return null==a?"":(a+"").replace(cb,"")},makeArray:function(a,b){var c,d=b||[];return null!=a&&(c=$.type(a),null==a.length||"string"===c||"function"===c||"regexp"===c||$.isWindow(a)?U.call(d,a):$.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(W)return W.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if("number"==typeof d)for(;d>f;f++)a[e++]=c[f];else for(;c[f]!==b;)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;for(c=!!c;g>f;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof $||i!==b&&"number"==typeof i&&(i>0&&a[0]&&a[i-1]||0===i||$.isArray(a));if(j)for(;i>h;h++)e=c(a[h],h,d),null!=e&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),null!=e&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return"string"==typeof c&&(d=a[c],c=a,a=d),$.isFunction(a)?(e=V.call(arguments,2),f=function(){return a.apply(c,e.concat(V.call(arguments)))},f.guid=a.guid=a.guid||$.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=null==d,k=0,l=a.length;if(d&&"object"==typeof d){for(k in d)$.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){if(i=h===b&&$.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call($(a),c)}):(c.call(a,e),c=null)),c)for(;l>k;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),$.ready.promise=function(b){if(!O)if(O=$.Deferred(),"complete"===P.readyState)setTimeout($.ready,1);else if(P.addEventListener)P.addEventListener("DOMContentLoaded",mb,!1),a.addEventListener("load",$.ready,!1);else{P.attachEvent("onreadystatechange",mb),a.attachEvent("onload",$.ready);var c=!1;try{c=null==a.frameElement&&P.documentElement}catch(d){}c&&c.doScroll&&function e(){if(!$.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}$.ready()}}()}return O.promise(b)},$.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){nb["[object "+b+"]"]=b.toLowerCase()}),N=$(P);var ob={};$.Callbacks=function(a){a="string"==typeof a?ob[a]||c(a):$.extend({},a);var d,e,f,g,h,i,j=[],k=!a.once&&[],l=function(b){for(d=a.memory&&b,e=!0,i=g||0,g=0,h=j.length,f=!0;j&&h>i;i++)if(j[i].apply(b[0],b[1])===!1&&a.stopOnFalse){d=!1;break}f=!1,j&&(k?k.length&&l(k.shift()):d?j=[]:m.disable())},m={add:function(){if(j){var b=j.length;!function c(b){$.each(b,function(b,d){var e=$.type(d);"function"===e?a.unique&&m.has(d)||j.push(d):d&&d.length&&"string"!==e&&c(d)})}(arguments),f?h=j.length:d&&(g=b,l(d))}return this},remove:function(){return j&&$.each(arguments,function(a,b){for(var c;(c=$.inArray(b,j,c))>-1;)j.splice(c,1),f&&(h>=c&&h--,i>=c&&i--)}),this},has:function(a){return $.inArray(a,j)>-1},empty:function(){return j=[],this},disable:function(){return j=k=d=b,this},disabled:function(){return!j},lock:function(){return k=b,d||m.disable(),this},locked:function(){return!k},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],!j||e&&!k||(f?k.push(b):l(b)),this},fire:function(){return m.fireWith(this,arguments),this},fired:function(){return!!e}};return m},$.extend({Deferred:function(a){var b=[["resolve","done",$.Callbacks("once memory"),"resolved"],["reject","fail",$.Callbacks("once memory"),"rejected"],["notify","progress",$.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return $.Deferred(function(c){$.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]]($.isFunction(g)?function(){var a=g.apply(this,arguments);a&&$.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return null!=a?$.extend(a,d):d}},e={};return d.pipe=d.then,$.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b,c,d,e=0,f=V.call(arguments),g=f.length,h=1!==g||a&&$.isFunction(a.promise)?g:0,i=1===h?a:$.Deferred(),j=function(a,c,d){return function(e){c[a]=this,d[a]=arguments.length>1?V.call(arguments):e,d===b?i.notifyWith(c,d):--h||i.resolveWith(c,d)}};if(g>1)for(b=new Array(g),c=new Array(g),d=new Array(g);g>e;e++)f[e]&&$.isFunction(f[e].promise)?f[e].promise().done(j(e,d,f)).fail(i.reject).progress(j(e,c,b)):--h;return h||i.resolveWith(d,f),i.promise()}}),$.support=function(){var b,c,d,e,f,g,h,i,j,k,l,m=P.createElement("div");if(m.setAttribute("className","t"),m.innerHTML="
  • a",c=m.getElementsByTagName("*"),d=m.getElementsByTagName("a")[0],!c||!d||!c.length)return{};e=P.createElement("select"),f=e.appendChild(P.createElement("option")),g=m.getElementsByTagName("input")[0],d.style.cssText="top:1px;float:left;opacity:.5",b={leadingWhitespace:3===m.firstChild.nodeType,tbody:!m.getElementsByTagName("tbody").length,htmlSerialize:!!m.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:"/a"===d.getAttribute("href"),opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:"on"===g.value,optSelected:f.selected,getSetAttribute:"t"!==m.className,enctype:!!P.createElement("form").enctype,html5Clone:"<:nav>"!==P.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===P.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},g.checked=!0,b.noCloneChecked=g.cloneNode(!0).checked,e.disabled=!0,b.optDisabled=!f.disabled;try{delete m.test}catch(n){b.deleteExpando=!1}if(!m.addEventListener&&m.attachEvent&&m.fireEvent&&(m.attachEvent("onclick",l=function(){b.noCloneEvent=!1}),m.cloneNode(!0).fireEvent("onclick"),m.detachEvent("onclick",l)),g=P.createElement("input"),g.value="t",g.setAttribute("type","radio"),b.radioValue="t"===g.value,g.setAttribute("checked","checked"),g.setAttribute("name","t"),m.appendChild(g),h=P.createDocumentFragment(),h.appendChild(m.lastChild),b.checkClone=h.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=g.checked,h.removeChild(g),h.appendChild(m),m.attachEvent)for(j in{submit:!0,change:!0,focusin:!0})i="on"+j,k=i in m,k||(m.setAttribute(i,"return;"),k="function"==typeof m[i]),b[j+"Bubbles"]=k;return $(function(){var c,d,e,f,g="padding:0;margin:0;border:0;display:block;overflow:hidden;",h=P.getElementsByTagName("body")[0];h&&(c=P.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",h.insertBefore(c,h.firstChild),d=P.createElement("div"),c.appendChild(d),d.innerHTML="
    t
    ",e=d.getElementsByTagName("td"),e[0].style.cssText="padding:0;margin:0;border:0;display:none",k=0===e[0].offsetHeight,e[0].style.display="",e[1].style.display="none",b.reliableHiddenOffsets=k&&0===e[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=4===d.offsetWidth,b.doesNotIncludeMarginInBodyOffset=1!==h.offsetTop,a.getComputedStyle&&(b.pixelPosition="1%"!==(a.getComputedStyle(d,null)||{}).top,b.boxSizingReliable="4px"===(a.getComputedStyle(d,null)||{width:"4px"}).width,f=P.createElement("div"),f.style.cssText=d.style.cssText=g,f.style.marginRight=f.style.width="0",d.style.width="1px",d.appendChild(f),b.reliableMarginRight=!parseFloat((a.getComputedStyle(f,null)||{}).marginRight)),"undefined"!=typeof d.style.zoom&&(d.innerHTML="",d.style.cssText=g+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.style.overflow="visible",d.innerHTML="
    ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=3!==d.offsetWidth,c.style.zoom=1),h.removeChild(c),c=d=e=f=null)}),h.removeChild(m),c=d=e=f=g=h=m=null,b}();var pb=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,qb=/([A-Z])/g;$.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+($.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?$.cache[a[$.expando]]:a[$.expando],!!a&&!e(a)},data:function(a,c,d,e){if($.acceptData(a)){var f,g,h=$.expando,i="string"==typeof c,j=a.nodeType,k=j?$.cache:a,l=j?a[h]:a[h]&&h;if(l&&k[l]&&(e||k[l].data)||!i||d!==b)return l||(j?a[h]=l=$.deletedIds.pop()||$.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=$.noop)),("object"==typeof c||"function"==typeof c)&&(e?k[l]=$.extend(k[l],c):k[l].data=$.extend(k[l].data,c)),f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[$.camelCase(c)]=d),i?(g=f[c],null==g&&(g=f[$.camelCase(c)])):g=f,g}},removeData:function(a,b,c){if($.acceptData(a)){var d,f,g,h=a.nodeType,i=h?$.cache:a,j=h?a[$.expando]:$.expando;if(i[j]){if(b&&(d=c?i[j]:i[j].data)){$.isArray(b)||(b in d?b=[b]:(b=$.camelCase(b),b=b in d?[b]:b.split(" ")));for(f=0,g=b.length;g>f;f++)delete d[b[f]];if(!(c?e:$.isEmptyObject)(d))return}(c||(delete i[j].data,e(i[j])))&&(h?$.cleanData([a],!0):$.support.deleteExpando||i!=i.window?delete i[j]:i[j]=null)}}},_data:function(a,b,c){return $.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&$.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),$.fn.extend({data:function(a,c){var e,f,g,h,i,j=this[0],k=0,l=null;if(a===b){if(this.length&&(l=$.data(j),1===j.nodeType&&!$._data(j,"parsedAttrs"))){for(g=j.attributes,i=g.length;i>k;k++)h=g[k].name,h.indexOf("data-")||(h=$.camelCase(h.substring(5)),d(j,h,l[h]));$._data(j,"parsedAttrs",!0)}return l}return"object"==typeof a?this.each(function(){$.data(this,a)}):(e=a.split(".",2),e[1]=e[1]?"."+e[1]:"",f=e[1]+"!",$.access(this,function(c){return c===b?(l=this.triggerHandler("getData"+f,[e[0]]),l===b&&j&&(l=$.data(j,a),l=d(j,a,l)),l===b&&e[1]?this.data(e[0]):l):(e[1]=c,this.each(function(){var b=$(this);b.triggerHandler("setData"+f,e),$.data(this,a,c),b.triggerHandler("changeData"+f,e)}),void 0)},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){$.removeData(this,a)})}}),$.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=$._data(a,b),c&&(!d||$.isArray(c)?d=$._data(a,b,$.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=$.queue(a,b),d=c.length,e=c.shift(),f=$._queueHooks(a,b),g=function(){$.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return $._data(a,c)||$._data(a,c,{empty:$.Callbacks("once memory").add(function(){$.removeData(a,b+"queue",!0),$.removeData(a,c,!0)})})}}),$.fn.extend({queue:function(a,c){var d=2;return"string"!=typeof a&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){$.removeAttr(this,a)})},prop:function(a,b){return $.access(this,$.prop,a,b,arguments.length>1)},removeProp:function(a){return a=$.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if($.isFunction(a))return this.each(function(b){$(this).addClass(a.call(this,b,this.className))});if(a&&"string"==typeof a)for(b=a.split(bb),c=0,d=this.length;d>c;c++)if(e=this[c],1===e.nodeType)if(e.className||1!==b.length){for(f=" "+e.className+" ",g=0,h=b.length;h>g;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=$.trim(f)}else e.className=a;return this},removeClass:function(a){var c,d,e,f,g,h,i;if($.isFunction(a))return this.each(function(b){$(this).removeClass(a.call(this,b,this.className))});if(a&&"string"==typeof a||a===b)for(c=(a||"").split(bb),h=0,i=this.length;i>h;h++)if(e=this[h],1===e.nodeType&&e.className){for(d=(" "+e.className+" ").replace(ub," "),f=0,g=c.length;g>f;f++)for(;d.indexOf(" "+c[f]+" ")>=0;)d=d.replace(" "+c[f]+" "," ");e.className=a?$.trim(d):""}return this},toggleClass:function(a,b){var c=typeof a,d="boolean"==typeof b;return $.isFunction(a)?this.each(function(c){$(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c)for(var e,f=0,g=$(this),h=b,i=a.split(bb);e=i[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else("undefined"===c||"boolean"===c)&&(this.className&&$._data(this,"__className__",this.className),this.className=this.className||a===!1?"":$._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];{if(arguments.length)return e=$.isFunction(a),this.each(function(d){var f,g=$(this);1===this.nodeType&&(f=e?a.call(this,d,g.val()):a,null==f?f="":"number"==typeof f?f+="":$.isArray(f)&&(f=$.map(f,function(a){return null==a?"":a+""})),c=$.valHooks[this.type]||$.valHooks[this.nodeName.toLowerCase()],c&&"set"in c&&c.set(this,f,"value")!==b||(this.value=f))});if(f)return c=$.valHooks[f.type]||$.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,"string"==typeof d?d.replace(vb,""):null==d?"":d)}}}),$.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||($.support.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&$.nodeName(c.parentNode,"optgroup"))){if(b=$(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c=$.makeArray(b);return $(a).find("option").each(function(){this.selected=$.inArray($(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(a&&3!==i&&8!==i&&2!==i)return e&&$.isFunction($.fn[c])?$(a)[c](d):"undefined"==typeof a.getAttribute?$.prop(a,c,d):(h=1!==i||!$.isXMLDoc(a),h&&(c=c.toLowerCase(),g=$.attrHooks[c]||(zb.test(c)?sb:rb)),d!==b?null===d?($.removeAttr(a,c),void 0):g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d):g&&"get"in g&&h&&null!==(f=g.get(a,c))?f:(f=a.getAttribute(c),null===f?b:f))},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&1===a.nodeType)for(d=b.split(bb);g=0:void 0}})});var Bb=/^(?:textarea|input|select)$/i,Cb=/^([^\.]*|)(?:\.(.+)|)$/,Db=/(?:^|\s)hover(\.\S+|)\b/,Eb=/^key/,Fb=/^(?:mouse|contextmenu)|click/,Gb=/^(?:focusinfocus|focusoutblur)$/,Hb=function(a){return $.event.special.hover?a:a.replace(Db,"mouseenter$1 mouseleave$1")};$.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;if(3!==a.nodeType&&8!==a.nodeType&&c&&d&&(g=$._data(a))){for(d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=$.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return"undefined"==typeof $||a&&$.event.triggered===a.type?b:$.event.dispatch.apply(h.elem,arguments)},h.elem=a),c=$.trim(Hb(c)).split(" "),j=0;j=0&&(q=q.slice(0,-1),h=!0),q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),e&&!$.event.customEvent[q]||$.event.global[q]))if(c="object"==typeof c?c[$.expando]?c:new $.Event(q,c):new $.Event(q),c.type=q,c.isTrigger=!0,c.exclusive=h,c.namespace=r.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,l=q.indexOf(":")<0?"on"+q:"",e){if(c.result=b,c.target||(c.target=e),d=null!=d?$.makeArray(d):[],d.unshift(c),m=$.event.special[q]||{},!m.trigger||m.trigger.apply(e,d)!==!1){if(o=[[e,m.bindType||q]],!f&&!m.noBubble&&!$.isWindow(e)){for(p=m.delegateType||q,j=Gb.test(p+q)?e:e.parentNode,k=e;j;j=j.parentNode)o.push([j,p]),k=j;k===(e.ownerDocument||P)&&o.push([k.defaultView||k.parentWindow||a,p])}for(i=0;id;d++)k=m[d],l=k.selector,h[l]===b&&(h[l]=k.needsContext?$(l,this).index(f)>=0:$.find(l,this,null,[f]).length),h[l]&&j.push(k);j.length&&r.push({elem:f,matches:j})}for(m.length>n&&r.push({elem:this,matches:m.slice(n)}),d=0;d0?this.on(b,null,a,c):this.trigger(b)},Eb.test(b)&&($.event.fixHooks[b]=$.event.keyHooks),Fb.test(b)&&($.event.fixHooks[b]=$.event.mouseHooks)}),/*! +function(e,t){function n(e){var t=ht[e]={};return Y.each(e.split(tt),function(e,n){t[n]=!0}),t}function r(e,n,r){if(r===t&&1===e.nodeType){var o="data-"+n.replace(mt,"-$1").toLowerCase();if(r=e.getAttribute(o),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:gt.test(r)?Y.parseJSON(r):r}catch(i){}Y.data(e,n,r)}else r=t}return r}function o(e){var t;for(t in e)if(("data"!==t||!Y.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function i(){return!1}function a(){return!0}function s(e){return!e||!e.parentNode||11===e.parentNode.nodeType}function l(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function c(e,t,n){if(t=t||0,Y.isFunction(t))return Y.grep(e,function(e,r){var o=!!t.call(e,r,e);return o===n});if(t.nodeType)return Y.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=Y.grep(e,function(e){return 1===e.nodeType});if(Pt.test(t))return Y.filter(t,r,!n);t=Y.filter(t,r)}return Y.grep(e,function(e){return Y.inArray(e,t)>=0===n})}function u(e){var t=Lt.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function p(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function f(e,t){if(1===t.nodeType&&Y.hasData(e)){var n,r,o,i=Y._data(e),a=Y._data(t,i),s=i.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,o=s[n].length;o>r;r++)Y.event.add(t,n,s[n][r])}a.data&&(a.data=Y.extend({},a.data))}}function d(e,t){var n;1===t.nodeType&&(t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),Y.support.html5Clone&&e.innerHTML&&!Y.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Vt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.selected=e.defaultSelected:"input"===n||"textarea"===n?t.defaultValue=e.defaultValue:"script"===n&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(Y.expando))}function h(e){return e.getElementsByTagName!==t?e.getElementsByTagName("*"):e.querySelectorAll!==t?e.querySelectorAll("*"):[]}function g(e){Vt.test(e.type)&&(e.defaultChecked=e.checked)}function m(e,t){if(t in e)return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,o=vn.length;o--;)if(t=vn[o]+n,t in e)return t;return r}function y(e,t){return e=t||e,"none"===Y.css(e,"display")||!Y.contains(e.ownerDocument,e)}function v(e,t){for(var n,r,o=[],i=0,a=e.length;a>i;i++)n=e[i],n.style&&(o[i]=Y._data(n,"olddisplay"),t?(o[i]||"none"!==n.style.display||(n.style.display=""),""===n.style.display&&y(n)&&(o[i]=Y._data(n,"olddisplay",C(n.nodeName)))):(r=nn(n,"display"),o[i]||"none"===r||Y._data(n,"olddisplay",r)));for(i=0;a>i;i++)n=e[i],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?o[i]||"":"none"));return e}function b(e,t,n){var r=pn.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function x(e,t,n,r){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,i=0;4>o;o+=2)"margin"===n&&(i+=Y.css(e,n+yn[o],!0)),r?("content"===n&&(i-=parseFloat(nn(e,"padding"+yn[o]))||0),"margin"!==n&&(i-=parseFloat(nn(e,"border"+yn[o]+"Width"))||0)):(i+=parseFloat(nn(e,"padding"+yn[o]))||0,"padding"!==n&&(i+=parseFloat(nn(e,"border"+yn[o]+"Width"))||0));return i}function w(e,t,n){var r="width"===t?e.offsetWidth:e.offsetHeight,o=!0,i=Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing");if(0>=r||null==r){if(r=nn(e,t),(0>r||null==r)&&(r=e.style[t]),fn.test(r))return r;o=i&&(Y.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+x(e,t,n||(i?"border":"content"),o)+"px"}function C(e){if(hn[e])return hn[e];var t=Y("<"+e+">").appendTo($.body),n=t.css("display");return t.remove(),("none"===n||""===n)&&(rn=$.body.appendChild(rn||Y.extend($.createElement("iframe"),{frameBorder:0,width:0,height:0})),on&&rn.createElement||(on=(rn.contentWindow||rn.contentDocument).document,on.write(""),on.close()),t=on.body.appendChild(on.createElement(e)),n=nn(t,"display"),$.body.removeChild(rn)),hn[e]=n,n}function _(e,t,n,r){var o;if(Y.isArray(t))Y.each(t,function(t,o){n||wn.test(e)?r(e,o):_(e+"["+("object"==typeof o?t:"")+"]",o,n,r)});else if(n||"object"!==Y.type(t))r(e,t);else for(o in t)_(e+"["+o+"]",t[o],n,r)}function k(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o,i,a=t.toLowerCase().split(tt),s=0,l=a.length;if(Y.isFunction(n))for(;l>s;s++)r=a[s],i=/^\+/.test(r),i&&(r=r.substr(1)||"*"),o=e[r]=e[r]||[],o[i?"unshift":"push"](n)}}function T(e,n,r,o,i,a){i=i||n.dataTypes[0],a=a||{},a[i]=!0;for(var s,l=e[i],c=0,u=l?l.length:0,p=e===In;u>c&&(p||!s);c++)s=l[c](n,r,o),"string"==typeof s&&(!p||a[s]?s=t:(n.dataTypes.unshift(s),s=T(e,n,r,o,s,a)));return!p&&s||a["*"]||(s=T(e,n,r,o,"*",a)),s}function A(e,n){var r,o,i=Y.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((i[r]?e:o||(o={}))[r]=n[r]);o&&Y.extend(!0,e,o)}function E(e,n,r){var o,i,a,s,l=e.contents,c=e.dataTypes,u=e.responseFields;for(i in u)i in r&&(n[u[i]]=r[i]);for(;"*"===c[0];)c.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("content-type"));if(o)for(i in l)if(l[i]&&l[i].test(o)){c.unshift(i);break}if(c[0]in r)a=c[0];else{for(i in r){if(!c[0]||e.converters[i+" "+c[0]]){a=i;break}s||(s=i)}a=a||s}return a?(a!==c[0]&&c.unshift(a),r[a]):t}function F(e,t){var n,r,o,i,a=e.dataTypes.slice(),s=a[0],l={},c=0;if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a[1])for(n in e.converters)l[n.toLowerCase()]=e.converters[n];for(;o=a[++c];)if("*"!==o){if("*"!==s&&s!==o){if(n=l[s+" "+o]||l["* "+o],!n)for(r in l)if(i=r.split(" "),i[1]===o&&(n=l[s+" "+i[0]]||l["* "+i[0]])){n===!0?n=l[r]:l[r]!==!0&&(o=i[0],a.splice(c--,0,o));break}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(u){return{state:"parsererror",error:n?u:"No conversion from "+s+" to "+o}}}s=o}return{state:"success",data:t}}function N(){try{return new e.XMLHttpRequest}catch(t){}}function S(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function j(){return setTimeout(function(){Jn=t},0),Jn=Y.now()}function R(e,t){Y.each(t,function(t,n){for(var r=(er[t]||[]).concat(er["*"]),o=0,i=r.length;i>o;o++)if(r[o].call(e,t,n))return})}function O(e,t,n){var r,o=0,i=Zn.length,a=Y.Deferred().always(function(){delete s.elem}),s=function(){for(var t=Jn||j(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,i=0,s=l.tweens.length;s>i;i++)l.tweens[i].run(o);return a.notifyWith(e,[l,o,n]),1>o&&s?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:Y.extend({},t),opts:Y.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Jn||j(),duration:n.duration,tweens:[],createTween:function(t,n){var r=Y.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){for(var n=0,r=t?l.tweens.length:0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(M(c,l.opts.specialEasing);i>o;o++)if(r=Zn[o].call(l,e,c,l.opts))return r;return R(l,c),Y.isFunction(l.opts.start)&&l.opts.start.call(e,l),Y.fx.timer(Y.extend(s,{anim:l,queue:l.opts.queue,elem:e})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function M(e,t){var n,r,o,i,a;for(n in e)if(r=Y.camelCase(n),o=t[r],i=e[n],Y.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),a=Y.cssHooks[r],a&&"expand"in a){i=a.expand(i),delete e[r];for(n in i)n in e||(e[n]=i[n],t[n]=o)}else t[r]=o}function H(e,t,n){var r,o,i,a,s,l,c,u,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&y(e);n.queue||(u=Y._queueHooks(e,"fx"),null==u.unqueued&&(u.unqueued=0,p=u.empty.fire,u.empty.fire=function(){u.unqueued||p()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,Y.queue(e,"fx").length||u.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===Y.css(e,"display")&&"none"===Y.css(e,"float")&&(Y.support.inlineBlockNeedsLayout&&"inline"!==C(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",Y.support.shrinkWrapBlocks||f.done(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Kn.exec(i)){if(delete t[r],l=l||"toggle"===i,i===(m?"hide":"show"))continue;g.push(r)}if(a=g.length){s=Y._data(e,"fxshow")||Y._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),l&&(s.hidden=!m),m?Y(e).show():f.done(function(){Y(e).hide()}),f.done(function(){var t;Y.removeData(e,"fxshow",!0);for(t in h)Y.style(e,t,h[t])});for(r=0;a>r;r++)o=g[r],c=f.createTween(o,m?s[o]:0),h[o]=s[o]||Y.style(e,o),o in s||(s[o]=c.start,m&&(c.end=c.start,c.start="width"===o||"height"===o?1:0))}}function P(e,t,n,r,o){return new P.prototype.init(e,t,n,r,o)}function I(e,t){var n,r={height:e},o=0;for(t=t?1:0;4>o;o+=2-t)n=yn[o],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function D(e){return Y.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}var L,B,$=e.document,q=e.location,W=e.navigator,U=e.jQuery,Q=e.$,z=Array.prototype.push,X=Array.prototype.slice,J=Array.prototype.indexOf,V=Object.prototype.toString,K=Object.prototype.hasOwnProperty,G=String.prototype.trim,Y=function(e,t){return new Y.fn.init(e,t,L)},Z=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,et=/\S/,tt=/\s+/,nt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,ot=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,it=/^[\],:{}\s]*$/,at=/(?:^|:|,)(?:\s*\[)+/g,st=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,lt=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,ct=/^-ms-/,ut=/-([\da-z])/gi,pt=function(e,t){return(t+"").toUpperCase()},ft=function(){$.addEventListener?($.removeEventListener("DOMContentLoaded",ft,!1),Y.ready()):"complete"===$.readyState&&($.detachEvent("onreadystatechange",ft),Y.ready())},dt={};Y.fn=Y.prototype={constructor:Y,init:function(e,n,r){var o,i,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if("string"==typeof e){if(o="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:rt.exec(e),!o||!o[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(o[1])return n=n instanceof Y?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:$,e=Y.parseHTML(o[1],a,!0),ot.test(o[1])&&Y.isPlainObject(n)&&this.attr.call(e,n,!0),Y.merge(this,e);if(i=$.getElementById(o[2]),i&&i.parentNode){if(i.id!==o[2])return r.find(e);this.length=1,this[0]=i}return this.context=$,this.selector=e,this}return Y.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),Y.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return X.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=Y.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,"find"===t?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return Y.each(this,e,t)},ready:function(e){return Y.ready.promise().done(e),this},eq:function(e){return e=+e,-1===e?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(X.apply(this,arguments),"slice",X.call(arguments).join(","))},map:function(e){return this.pushStack(Y.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:z,sort:[].sort,splice:[].splice},Y.fn.init.prototype=Y.fn,Y.extend=Y.fn.extend=function(){var e,n,r,o,i,a,s=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),"object"==typeof s||Y.isFunction(s)||(s={}),c===l&&(s=this,--l);c>l;l++)if(null!=(e=arguments[l]))for(n in e)r=s[n],o=e[n],s!==o&&(u&&o&&(Y.isPlainObject(o)||(i=Y.isArray(o)))?(i?(i=!1,a=r&&Y.isArray(r)?r:[]):a=r&&Y.isPlainObject(r)?r:{},s[n]=Y.extend(u,a,o)):o!==t&&(s[n]=o));return s},Y.extend({noConflict:function(t){return e.$===Y&&(e.$=Q),t&&e.jQuery===Y&&(e.jQuery=U),Y},isReady:!1,readyWait:1,holdReady:function(e){e?Y.readyWait++:Y.ready(!0)},ready:function(e){if(e===!0?!--Y.readyWait:!Y.isReady){if(!$.body)return setTimeout(Y.ready,1);Y.isReady=!0,e!==!0&&--Y.readyWait>0||(B.resolveWith($,[Y]),Y.fn.trigger&&Y($).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===Y.type(e)},isArray:Array.isArray||function(e){return"array"===Y.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":dt[V.call(e)]||"object"},isPlainObject:function(e){if(!e||"object"!==Y.type(e)||e.nodeType||Y.isWindow(e))return!1;try{if(e.constructor&&!K.call(e,"constructor")&&!K.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||K.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){var r;return e&&"string"==typeof e?("boolean"==typeof t&&(n=t,t=0),t=t||$,(r=ot.exec(e))?[t.createElement(r[1])]:(r=Y.buildFragment([e],t,n?null:[]),Y.merge([],(r.cacheable?Y.clone(r.fragment):r.fragment).childNodes))):null},parseJSON:function(n){return n&&"string"==typeof n?(n=Y.trim(n),e.JSON&&e.JSON.parse?e.JSON.parse(n):it.test(n.replace(st,"@").replace(lt,"]").replace(at,""))?Function("return "+n)():(Y.error("Invalid JSON: "+n),t)):null},parseXML:function(n){var r,o;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(o=new DOMParser,r=o.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(i){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||Y.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&et.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(ct,"ms-").replace(ut,pt)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var o,i=0,a=e.length,s=a===t||Y.isFunction(e);if(r)if(s){for(o in e)if(n.apply(e[o],r)===!1)break}else for(;a>i&&n.apply(e[i++],r)!==!1;);else if(s){for(o in e)if(n.call(e[o],o,e[o])===!1)break}else for(;a>i&&n.call(e[i],i,e[i++])!==!1;);return e},trim:G&&!G.call(" ")?function(e){return null==e?"":G.call(e)}:function(e){return null==e?"":(e+"").replace(nt,"")},makeArray:function(e,t){var n,r=t||[];return null!=e&&(n=Y.type(e),null==e.length||"string"===n||"function"===n||"regexp"===n||Y.isWindow(e)?z.call(r,e):Y.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(J)return J.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,o=e.length,i=0;if("number"==typeof r)for(;r>i;i++)e[o++]=n[i];else for(;n[i]!==t;)e[o++]=n[i++];return e.length=o,e},grep:function(e,t,n){var r,o=[],i=0,a=e.length;for(n=!!n;a>i;i++)r=!!t(e[i],i),n!==r&&o.push(e[i]);return o},map:function(e,n,r){var o,i,a=[],s=0,l=e.length,c=e instanceof Y||l!==t&&"number"==typeof l&&(l>0&&e[0]&&e[l-1]||0===l||Y.isArray(e));if(c)for(;l>s;s++)o=n(e[s],s,r),null!=o&&(a[a.length]=o);else for(i in e)o=n(e[i],i,r),null!=o&&(a[a.length]=o);return a.concat.apply([],a)},guid:1,proxy:function(e,n){var r,o,i;return"string"==typeof n&&(r=e[n],n=e,e=r),Y.isFunction(e)?(o=X.call(arguments,2),i=function(){return e.apply(n,o.concat(X.call(arguments)))},i.guid=e.guid=e.guid||Y.guid++,i):t},access:function(e,n,r,o,i,a,s){var l,c=null==r,u=0,p=e.length;if(r&&"object"==typeof r){for(u in r)Y.access(e,n,u,r[u],1,a,o);i=1}else if(o!==t){if(l=s===t&&Y.isFunction(o),c&&(l?(l=n,n=function(e,t,n){return l.call(Y(e),n)}):(n.call(e,o),n=null)),n)for(;p>u;u++)n(e[u],r,l?o.call(e[u],u,n(e[u],r)):o,s);i=1}return i?e:c?n.call(e):p?n(e[0],r):a},now:function(){return(new Date).getTime()}}),Y.ready.promise=function(t){if(!B)if(B=Y.Deferred(),"complete"===$.readyState)setTimeout(Y.ready,1);else if($.addEventListener)$.addEventListener("DOMContentLoaded",ft,!1),e.addEventListener("load",Y.ready,!1);else{$.attachEvent("onreadystatechange",ft),e.attachEvent("onload",Y.ready);var n=!1;try{n=null==e.frameElement&&$.documentElement}catch(r){}n&&n.doScroll&&function o(){if(!Y.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}Y.ready()}}()}return B.promise(t)},Y.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){dt["[object "+t+"]"]=t.toLowerCase()}),L=Y($);var ht={};Y.Callbacks=function(e){e="string"==typeof e?ht[e]||n(e):Y.extend({},e);var r,o,i,a,s,l,c=[],u=!e.once&&[],p=function(t){for(r=e.memory&&t,o=!0,l=a||0,a=0,s=c.length,i=!0;c&&s>l;l++)if(c[l].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}i=!1,c&&(u?u.length&&p(u.shift()):r?c=[]:f.disable())},f={add:function(){if(c){var t=c.length;(function n(t){Y.each(t,function(t,r){var o=Y.type(r);"function"===o?e.unique&&f.has(r)||c.push(r):r&&r.length&&"string"!==o&&n(r)})})(arguments),i?s=c.length:r&&(a=t,p(r))}return this},remove:function(){return c&&Y.each(arguments,function(e,t){for(var n;(n=Y.inArray(t,c,n))>-1;)c.splice(n,1),i&&(s>=n&&s--,l>=n&&l--)}),this},has:function(e){return Y.inArray(e,c)>-1},empty:function(){return c=[],this},disable:function(){return c=u=r=t,this},disabled:function(){return!c},lock:function(){return u=t,r||f.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!c||o&&!u||(i?u.push(t):p(t)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},Y.extend({Deferred:function(e){var t=[["resolve","done",Y.Callbacks("once memory"),"resolved"],["reject","fail",Y.Callbacks("once memory"),"rejected"],["notify","progress",Y.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return Y.Deferred(function(n){Y.each(t,function(t,r){var i=r[0],a=e[t];o[r[1]](Y.isFunction(a)?function(){var e=a.apply(this,arguments);e&&Y.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[i+"With"](this===o?n:this,[e])}:n[i])}),e=null}).promise()},promise:function(e){return null!=e?Y.extend(e,r):r}},o={};return r.pipe=r.then,Y.each(t,function(e,i){var a=i[2],s=i[3];r[i[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),o[i[0]]=a.fire,o[i[0]+"With"]=a.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(e){var t,n,r,o=0,i=X.call(arguments),a=i.length,s=1!==a||e&&Y.isFunction(e.promise)?a:0,l=1===s?e:Y.Deferred(),c=function(e,n,r){return function(o){n[e]=this,r[e]=arguments.length>1?X.call(arguments):o,r===t?l.notifyWith(n,r):--s||l.resolveWith(n,r)}};if(a>1)for(t=Array(a),n=Array(a),r=Array(a);a>o;o++)i[o]&&Y.isFunction(i[o].promise)?i[o].promise().done(c(o,r,i)).fail(l.reject).progress(c(o,n,t)):--s;return s||l.resolveWith(r,i),l.promise()}}),Y.support=function(){var n,r,o,i,a,s,l,c,u,p,f,d=$.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",r=d.getElementsByTagName("*"),o=d.getElementsByTagName("a")[0],!r||!o||!r.length)return{};i=$.createElement("select"),a=i.appendChild($.createElement("option")),s=d.getElementsByTagName("input")[0],o.style.cssText="top:1px;float:left;opacity:.5",n={leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(o.getAttribute("style")),hrefNormalized:"/a"===o.getAttribute("href"),opacity:/^0.5/.test(o.style.opacity),cssFloat:!!o.style.cssFloat,checkOn:"on"===s.value,optSelected:a.selected,getSetAttribute:"t"!==d.className,enctype:!!$.createElement("form").enctype,html5Clone:"<:nav>"!==$.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===$.compatMode,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},s.checked=!0,n.noCloneChecked=s.cloneNode(!0).checked,i.disabled=!0,n.optDisabled=!a.disabled;try{delete d.test}catch(h){n.deleteExpando=!1}if(!d.addEventListener&&d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",f=function(){n.noCloneEvent=!1}),d.cloneNode(!0).fireEvent("onclick"),d.detachEvent("onclick",f)),s=$.createElement("input"),s.value="t",s.setAttribute("type","radio"),n.radioValue="t"===s.value,s.setAttribute("checked","checked"),s.setAttribute("name","t"),d.appendChild(s),l=$.createDocumentFragment(),l.appendChild(d.lastChild),n.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,n.appendChecked=s.checked,l.removeChild(s),l.appendChild(d),d.attachEvent)for(u in{submit:!0,change:!0,focusin:!0})c="on"+u,p=c in d,p||(d.setAttribute(c,"return;"),p="function"==typeof d[c]),n[u+"Bubbles"]=p;return Y(function(){var r,o,i,a,s="padding:0;margin:0;border:0;display:block;overflow:hidden;",l=$.getElementsByTagName("body")[0];l&&(r=$.createElement("div"),r.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",l.insertBefore(r,l.firstChild),o=$.createElement("div"),r.appendChild(o),o.innerHTML="
    t
    ",i=o.getElementsByTagName("td"),i[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",n.reliableHiddenOffsets=p&&0===i[0].offsetHeight,o.innerHTML="",o.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",n.boxSizing=4===o.offsetWidth,n.doesNotIncludeMarginInBodyOffset=1!==l.offsetTop,e.getComputedStyle&&(n.pixelPosition="1%"!==(e.getComputedStyle(o,null)||{}).top,n.boxSizingReliable="4px"===(e.getComputedStyle(o,null)||{width:"4px"}).width,a=$.createElement("div"),a.style.cssText=o.style.cssText=s,a.style.marginRight=a.style.width="0",o.style.width="1px",o.appendChild(a),n.reliableMarginRight=!parseFloat((e.getComputedStyle(a,null)||{}).marginRight)),o.style.zoom!==t&&(o.innerHTML="",o.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",n.inlineBlockNeedsLayout=3===o.offsetWidth,o.style.display="block",o.style.overflow="visible",o.innerHTML="
    ",o.firstChild.style.width="5px",n.shrinkWrapBlocks=3!==o.offsetWidth,r.style.zoom=1),l.removeChild(r),r=o=i=a=null)}),l.removeChild(d),r=o=i=a=s=l=d=null,n}();var gt=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,mt=/([A-Z])/g;Y.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(Y.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?Y.cache[e[Y.expando]]:e[Y.expando],!!e&&!o(e)},data:function(e,n,r,o){if(Y.acceptData(e)){var i,a,s=Y.expando,l="string"==typeof n,c=e.nodeType,u=c?Y.cache:e,p=c?e[s]:e[s]&&s;if(p&&u[p]&&(o||u[p].data)||!l||r!==t)return p||(c?e[s]=p=Y.deletedIds.pop()||Y.guid++:p=s),u[p]||(u[p]={},c||(u[p].toJSON=Y.noop)),("object"==typeof n||"function"==typeof n)&&(o?u[p]=Y.extend(u[p],n):u[p].data=Y.extend(u[p].data,n)),i=u[p],o||(i.data||(i.data={}),i=i.data),r!==t&&(i[Y.camelCase(n)]=r),l?(a=i[n],null==a&&(a=i[Y.camelCase(n)])):a=i,a}},removeData:function(e,t,n){if(Y.acceptData(e)){var r,i,a,s=e.nodeType,l=s?Y.cache:e,c=s?e[Y.expando]:Y.expando;if(l[c]){if(t&&(r=n?l[c]:l[c].data)){Y.isArray(t)||(t in r?t=[t]:(t=Y.camelCase(t),t=t in r?[t]:t.split(" ")));for(i=0,a=t.length;a>i;i++)delete r[t[i]];if(!(n?o:Y.isEmptyObject)(r))return}(n||(delete l[c].data,o(l[c])))&&(s?Y.cleanData([e],!0):Y.support.deleteExpando||l!=l.window?delete l[c]:l[c]=null)}}},_data:function(e,t,n){return Y.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&Y.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),Y.fn.extend({data:function(e,n){var o,i,a,s,l,c=this[0],u=0,p=null;if(e===t){if(this.length&&(p=Y.data(c),1===c.nodeType&&!Y._data(c,"parsedAttrs"))){for(a=c.attributes,l=a.length;l>u;u++)s=a[u].name,s.indexOf("data-")||(s=Y.camelCase(s.substring(5)),r(c,s,p[s]));Y._data(c,"parsedAttrs",!0)}return p}return"object"==typeof e?this.each(function(){Y.data(this,e)}):(o=e.split(".",2),o[1]=o[1]?"."+o[1]:"",i=o[1]+"!",Y.access(this,function(n){return n===t?(p=this.triggerHandler("getData"+i,[o[0]]),p===t&&c&&(p=Y.data(c,e),p=r(c,e,p)),p===t&&o[1]?this.data(o[0]):p):(o[1]=n,this.each(function(){var t=Y(this);t.triggerHandler("setData"+i,o),Y.data(this,e,n),t.triggerHandler("changeData"+i,o)}),t)},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){Y.removeData(this,e)})}}),Y.extend({queue:function(e,n,r){var o;return e?(n=(n||"fx")+"queue",o=Y._data(e,n),r&&(!o||Y.isArray(r)?o=Y._data(e,n,Y.makeArray(r)):o.push(r)),o||[]):t},dequeue:function(e,t){t=t||"fx";var n=Y.queue(e,t),r=n.length,o=n.shift(),i=Y._queueHooks(e,t),a=function(){Y.dequeue(e,t)};"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,a,i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y._data(e,n)||Y._data(e,n,{empty:Y.Callbacks("once memory").add(function(){Y.removeData(e,t+"queue",!0),Y.removeData(e,n,!0)})})}}),Y.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?Y.queue(this[0],e):n===t?this:this.each(function(){var t=Y.queue(this,e,n);Y._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&Y.dequeue(this,e)})},dequeue:function(e){return this.each(function(){Y.dequeue(this,e)})},delay:function(e,t){return e=Y.fx?Y.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,o=1,i=Y.Deferred(),a=this,s=this.length,l=function(){--o||i.resolveWith(a,[a])};for("string"!=typeof e&&(n=e,e=t),e=e||"fx";s--;)r=Y._data(a[s],e+"queueHooks"),r&&r.empty&&(o++,r.empty.add(l));return l(),i.promise(n)}});var yt,vt,bt,xt=/[\t\r\n]/g,wt=/\r/g,Ct=/^(?:button|input)$/i,_t=/^(?:button|input|object|select|textarea)$/i,kt=/^a(?:rea|)$/i,Tt=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,At=Y.support.getSetAttribute;Y.fn.extend({attr:function(e,t){return Y.access(this,Y.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){Y.removeAttr(this,e)})},prop:function(e,t){return Y.access(this,Y.prop,e,t,arguments.length>1)},removeProp:function(e){return e=Y.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,o,i,a,s;if(Y.isFunction(e))return this.each(function(t){Y(this).addClass(e.call(this,t,this.className))});if(e&&"string"==typeof e)for(t=e.split(tt),n=0,r=this.length;r>n;n++)if(o=this[n],1===o.nodeType)if(o.className||1!==t.length){for(i=" "+o.className+" ",a=0,s=t.length;s>a;a++)0>i.indexOf(" "+t[a]+" ")&&(i+=t[a]+" ");o.className=Y.trim(i)}else o.className=e;return this},removeClass:function(e){var n,r,o,i,a,s,l;if(Y.isFunction(e))return this.each(function(t){Y(this).removeClass(e.call(this,t,this.className))});if(e&&"string"==typeof e||e===t)for(n=(e||"").split(tt),s=0,l=this.length;l>s;s++)if(o=this[s],1===o.nodeType&&o.className){for(r=(" "+o.className+" ").replace(xt," "),i=0,a=n.length;a>i;i++)for(;r.indexOf(" "+n[i]+" ")>=0;)r=r.replace(" "+n[i]+" "," ");o.className=e?Y.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return Y.isFunction(e)?this.each(function(n){Y(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n)for(var o,i=0,a=Y(this),s=t,l=e.split(tt);o=l[i++];)s=r?s:!a.hasClass(o),a[s?"addClass":"removeClass"](o);else("undefined"===n||"boolean"===n)&&(this.className&&Y._data(this,"__className__",this.className),this.className=this.className||e===!1?"":Y._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(xt," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,o,i=this[0];{if(arguments.length)return o=Y.isFunction(e),this.each(function(r){var i,a=Y(this);1===this.nodeType&&(i=o?e.call(this,r,a.val()):e,null==i?i="":"number"==typeof i?i+="":Y.isArray(i)&&(i=Y.map(i,function(e){return null==e?"":e+""})),n=Y.valHooks[this.type]||Y.valHooks[this.nodeName.toLowerCase()],n&&"set"in n&&n.set(this,i,"value")!==t||(this.value=i))});if(i)return n=Y.valHooks[i.type]||Y.valHooks[i.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(i,"value"))!==t?r:(r=i.value,"string"==typeof r?r.replace(wt,""):null==r?"":r)}}}),Y.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,o=e.selectedIndex,i="select-one"===e.type||0>o,a=i?null:[],s=i?o+1:r.length,l=0>o?s:i?o:0;s>l;l++)if(n=r[l],!(!n.selected&&l!==o||(Y.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Y.nodeName(n.parentNode,"optgroup"))){if(t=Y(n).val(),i)return t;a.push(t)}return a},set:function(e,t){var n=Y.makeArray(t);return Y(e).find("option").each(function(){this.selected=Y.inArray(Y(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,o){var i,a,s,l=e.nodeType;if(e&&3!==l&&8!==l&&2!==l)return o&&Y.isFunction(Y.fn[n])?Y(e)[n](r):e.getAttribute===t?Y.prop(e,n,r):(s=1!==l||!Y.isXMLDoc(e),s&&(n=n.toLowerCase(),a=Y.attrHooks[n]||(Tt.test(n)?vt:yt)),r!==t?null===r?(Y.removeAttr(e,n),t):a&&"set"in a&&s&&(i=a.set(e,r,n))!==t?i:(e.setAttribute(n,r+""),r):a&&"get"in a&&s&&null!==(i=a.get(e,n))?i:(i=e.getAttribute(n),null===i?t:i))},removeAttr:function(e,t){var n,r,o,i,a=0;if(t&&1===e.nodeType)for(r=t.split(tt);r.length>a;a++)o=r[a],o&&(n=Y.propFix[o]||o,i=Tt.test(o),i||Y.attr(e,o,""),e.removeAttribute(At?o:n),i&&n in e&&(e[n]=!1))},attrHooks:{type:{set:function(e,t){if(Ct.test(e.nodeName)&&e.parentNode)Y.error("type property can't be changed");else if(!Y.support.radioValue&&"radio"===t&&Y.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return yt&&Y.nodeName(e,"button")?yt.get(e,t):t in e?e.value:null},set:function(e,n,r){return yt&&Y.nodeName(e,"button")?yt.set(e,n,r):(e.value=n,t)}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var o,i,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!Y.isXMLDoc(e),a&&(n=Y.propFix[n]||n,i=Y.propHooks[n]),r!==t?i&&"set"in i&&(o=i.set(e,r,n))!==t?o:e[n]=r:i&&"get"in i&&null!==(o=i.get(e,n))?o:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):_t.test(e.nodeName)||kt.test(e.nodeName)&&e.href?0:t}}}}),vt={get:function(e,n){var r,o=Y.prop(e,n);return o===!0||"boolean"!=typeof o&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?Y.removeAttr(e,n):(r=Y.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},At||(bt={name:!0,id:!0,coords:!0},yt=Y.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(bt[n]?""!==r.value:r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=$.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},Y.each(["width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})}),Y.attrHooks.contenteditable={get:yt.get,set:function(e,t,n){""===t&&(t="false"),yt.set(e,t,n) +}}),Y.support.hrefNormalized||Y.each(["href","src","width","height"],function(e,n){Y.attrHooks[n]=Y.extend(Y.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null===r?t:r}})}),Y.support.style||(Y.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),Y.support.optSelected||(Y.propHooks.selected=Y.extend(Y.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),Y.support.enctype||(Y.propFix.enctype="encoding"),Y.support.checkOn||Y.each(["radio","checkbox"],function(){Y.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),Y.each(["radio","checkbox"],function(){Y.valHooks[this]=Y.extend(Y.valHooks[this],{set:function(e,n){return Y.isArray(n)?e.checked=Y.inArray(Y(e).val(),n)>=0:t}})});var Et=/^(?:textarea|input|select)$/i,Ft=/^([^\.]*|)(?:\.(.+)|)$/,Nt=/(?:^|\s)hover(\.\S+|)\b/,St=/^key/,jt=/^(?:mouse|contextmenu)|click/,Rt=/^(?:focusinfocus|focusoutblur)$/,Ot=function(e){return Y.event.special.hover?e:e.replace(Nt,"mouseenter$1 mouseleave$1")};Y.event={add:function(e,n,r,o,i){var a,s,l,c,u,p,f,d,h,g,m;if(3!==e.nodeType&&8!==e.nodeType&&n&&r&&(a=Y._data(e))){for(r.handler&&(h=r,r=h.handler,i=h.selector),r.guid||(r.guid=Y.guid++),l=a.events,l||(a.events=l={}),s=a.handle,s||(a.handle=s=function(e){return Y===t||e&&Y.event.triggered===e.type?t:Y.event.dispatch.apply(s.elem,arguments)},s.elem=e),n=Y.trim(Ot(n)).split(" "),c=0;n.length>c;c++)u=Ft.exec(n[c])||[],p=u[1],f=(u[2]||"").split(".").sort(),m=Y.event.special[p]||{},p=(i?m.delegateType:m.bindType)||p,m=Y.event.special[p]||{},d=Y.extend({type:p,origType:u[1],data:o,handler:r,guid:r.guid,selector:i,needsContext:i&&Y.expr.match.needsContext.test(i),namespace:f.join(".")},h),g=l[p],g||(g=l[p]=[],g.delegateCount=0,m.setup&&m.setup.call(e,o,f,s)!==!1||(e.addEventListener?e.addEventListener(p,s,!1):e.attachEvent&&e.attachEvent("on"+p,s))),m.add&&(m.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),i?g.splice(g.delegateCount++,0,d):g.push(d),Y.event.global[p]=!0;e=null}},global:{},remove:function(e,t,n,r,o){var i,a,s,l,c,u,p,f,d,h,g,m=Y.hasData(e)&&Y._data(e);if(m&&(f=m.events)){for(t=Y.trim(Ot(t||"")).split(" "),i=0;t.length>i;i++)if(a=Ft.exec(t[i])||[],s=l=a[1],c=a[2],s){for(d=Y.event.special[s]||{},s=(r?d.delegateType:d.bindType)||s,h=f[s]||[],u=h.length,c=c?RegExp("(^|\\.)"+c.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0;h.length>p;p++)g=h[p],!o&&l!==g.origType||n&&n.guid!==g.guid||c&&!c.test(g.namespace)||r&&r!==g.selector&&("**"!==r||!g.selector)||(h.splice(p--,1),g.selector&&h.delegateCount--,d.remove&&d.remove.call(e,g));0===h.length&&u!==h.length&&(d.teardown&&d.teardown.call(e,c,m.handle)!==!1||Y.removeEvent(e,s,m.handle),delete f[s])}else for(s in f)Y.event.remove(e,s+t[i],n,r,!0);Y.isEmptyObject(f)&&(delete m.handle,Y.removeData(e,"events",!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,o,i){if(!o||3!==o.nodeType&&8!==o.nodeType){var a,s,l,c,u,p,f,d,h,g,m=n.type||n,y=[];if(!Rt.test(m+Y.event.triggered)&&(m.indexOf("!")>=0&&(m=m.slice(0,-1),s=!0),m.indexOf(".")>=0&&(y=m.split("."),m=y.shift(),y.sort()),o&&!Y.event.customEvent[m]||Y.event.global[m]))if(n="object"==typeof n?n[Y.expando]?n:new Y.Event(m,n):new Y.Event(m),n.type=m,n.isTrigger=!0,n.exclusive=s,n.namespace=y.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,p=0>m.indexOf(":")?"on"+m:"",o){if(n.result=t,n.target||(n.target=o),r=null!=r?Y.makeArray(r):[],r.unshift(n),f=Y.event.special[m]||{},!f.trigger||f.trigger.apply(o,r)!==!1){if(h=[[o,f.bindType||m]],!i&&!f.noBubble&&!Y.isWindow(o)){for(g=f.delegateType||m,c=Rt.test(g+m)?o:o.parentNode,u=o;c;c=c.parentNode)h.push([c,g]),u=c;u===(o.ownerDocument||$)&&h.push([u.defaultView||u.parentWindow||e,g])}for(l=0;h.length>l&&!n.isPropagationStopped();l++)c=h[l][0],n.type=h[l][1],d=(Y._data(c,"events")||{})[n.type]&&Y._data(c,"handle"),d&&d.apply(c,r),d=p&&c[p],d&&Y.acceptData(c)&&d.apply&&d.apply(c,r)===!1&&n.preventDefault();return n.type=m,i||n.isDefaultPrevented()||f._default&&f._default.apply(o.ownerDocument,r)!==!1||"click"===m&&Y.nodeName(o,"a")||!Y.acceptData(o)||p&&o[m]&&("focus"!==m&&"blur"!==m||0!==n.target.offsetWidth)&&!Y.isWindow(o)&&(u=o[p],u&&(o[p]=null),Y.event.triggered=m,o[m](),Y.event.triggered=t,u&&(o[p]=u)),n.result}}else{a=Y.cache;for(l in a)a[l].events&&a[l].events[m]&&Y.event.trigger(n,r,a[l].handle.elem,!0)}}},dispatch:function(n){n=Y.event.fix(n||e.event);var r,o,i,a,s,l,c,u,p,f=(Y._data(this,"events")||{})[n.type]||[],d=f.delegateCount,h=X.call(arguments),g=!n.exclusive&&!n.namespace,m=Y.event.special[n.type]||{},y=[];if(h[0]=n,n.delegateTarget=this,!m.preDispatch||m.preDispatch.call(this,n)!==!1){if(d&&(!n.button||"click"!==n.type))for(i=n.target;i!=this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==n.type){for(s={},c=[],r=0;d>r;r++)u=f[r],p=u.selector,s[p]===t&&(s[p]=u.needsContext?Y(p,this).index(i)>=0:Y.find(p,this,null,[i]).length),s[p]&&c.push(u);c.length&&y.push({elem:i,matches:c})}for(f.length>d&&y.push({elem:this,matches:f.slice(d)}),r=0;y.length>r&&!n.isPropagationStopped();r++)for(l=y[r],n.currentTarget=l.elem,o=0;l.matches.length>o&&!n.isImmediatePropagationStopped();o++)u=l.matches[o],(g||!n.namespace&&!u.namespace||n.namespace_re&&n.namespace_re.test(u.namespace))&&(n.data=u.data,n.handleObj=u,a=((Y.event.special[u.origType]||{}).handle||u.handler).apply(l.elem,h),a!==t&&(n.result=a,a===!1&&(n.preventDefault(),n.stopPropagation())));return m.postDispatch&&m.postDispatch.call(this,n),n.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,o,i,a=n.button,s=n.fromElement;return null==e.pageX&&null!=n.clientX&&(r=e.target.ownerDocument||$,o=r.documentElement,i=r.body,e.pageX=n.clientX+(o&&o.scrollLeft||i&&i.scrollLeft||0)-(o&&o.clientLeft||i&&i.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||i&&i.scrollTop||0)-(o&&o.clientTop||i&&i.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?n.toElement:s),e.which||a===t||(e.which=1&a?1:2&a?3:4&a?2:0),e}},fix:function(e){if(e[Y.expando])return e;var t,n,r=e,o=Y.event.fixHooks[e.type]||{},i=o.props?this.props.concat(o.props):this.props;for(e=Y.Event(r),t=i.length;t;)n=i[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||$),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,o.filter?o.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){Y.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var o=Y.extend(new Y.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?Y.event.trigger(o,null,t):Y.event.dispatch.call(t,o),o.isDefaultPrevented()&&n.preventDefault()}},Y.event.handle=Y.event.dispatch,Y.removeEvent=$.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,n,r){var o="on"+n;e.detachEvent&&(e[o]===t&&(e[o]=null),e.detachEvent(o,r))},Y.Event=function(e,n){return this instanceof Y.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?a:i):this.type=e,n&&Y.extend(this,n),this.timeStamp=e&&e.timeStamp||Y.now(),this[Y.expando]=!0,t):new Y.Event(e,n)},Y.Event.prototype={preventDefault:function(){this.isDefaultPrevented=a;var e=this.originalEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=a;var e=this.originalEvent;e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=a,this.stopPropagation()},isDefaultPrevented:i,isPropagationStopped:i,isImmediatePropagationStopped:i},Y.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){Y.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,o=e.relatedTarget,i=e.handleObj;return i.selector,(!o||o!==r&&!Y.contains(r,o))&&(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),Y.support.submitBubbles||(Y.event.special.submit={setup:function(){return Y.nodeName(this,"form")?!1:(Y.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=Y.nodeName(n,"input")||Y.nodeName(n,"button")?n.form:t;r&&!Y._data(r,"_submit_attached")&&(Y.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),Y._data(r,"_submit_attached",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&Y.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return Y.nodeName(this,"form")?!1:(Y.event.remove(this,"._submit"),t)}}),Y.support.changeBubbles||(Y.event.special.change={setup:function(){return Et.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(Y.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),Y.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),Y.event.simulate("change",this,e,!0)})),!1):(Y.event.add(this,"beforeactivate._change",function(e){var t=e.target;Et.test(t.nodeName)&&!Y._data(t,"_change_attached")&&(Y.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||Y.event.simulate("change",this.parentNode,e,!0)}),Y._data(t,"_change_attached",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return Y.event.remove(this,"._change"),!Et.test(this.nodeName)}}),Y.support.focusinBubbles||Y.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){Y.event.simulate(t,e.target,Y.event.fix(e),!0)};Y.event.special[t]={setup:function(){0===n++&&$.addEventListener(e,r,!0)},teardown:function(){0===--n&&$.removeEventListener(e,r,!0)}}}),Y.fn.extend({on:function(e,n,r,o,a){var s,l;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(l in e)this.on(l,n,r,e[l],a);return this}if(null==r&&null==o?(o=n,r=n=t):null==o&&("string"==typeof n?(o=r,r=t):(o=r,r=n,n=t)),o===!1)o=i;else if(!o)return this;return 1===a&&(s=o,o=function(e){return Y().off(e),s.apply(this,arguments)},o.guid=s.guid||(s.guid=Y.guid++)),this.each(function(){Y.event.add(this,e,o,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var o,a;if(e&&e.preventDefault&&e.handleObj)return o=e.handleObj,Y(e.delegateTarget).off(o.namespace?o.origType+"."+o.namespace:o.origType,o.selector,o.handler),this;if("object"==typeof e){for(a in e)this.off(a,n,e[a]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=i),this.each(function(){Y.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return Y(this.context).on(e,this.selector,t,n),this},die:function(e,t){return Y(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){Y.event.trigger(e,t,this)})},triggerHandler:function(e,n){return this[0]?Y.event.trigger(e,n,this[0],!0):t},toggle:function(e){var t=arguments,n=e.guid||Y.guid++,r=0,o=function(n){var o=(Y._data(this,"lastToggle"+e.guid)||0)%r;return Y._data(this,"lastToggle"+e.guid,o+1),n.preventDefault(),t[o].apply(this,arguments)||!1};for(o.guid=n;t.length>r;)t[r++].guid=n;return this.click(o)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),Y.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){Y.fn[t]=function(e,n){return null==n&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},St.test(t)&&(Y.event.fixHooks[t]=Y.event.keyHooks),jt.test(t)&&(Y.event.fixHooks[t]=Y.event.mouseHooks)}),/*! * Sizzle CSS Selector Engine * Copyright 2012 jQuery Foundation and other contributors * Released under the MIT license * http://sizzlejs.com/ */ -function(a,b){function c(a,b,c,d){c=c||[],b=b||F;var e,f,g,h,i=b.nodeType;if(!a||"string"!=typeof a)return c;if(1!==i&&9!==i)return[];if(g=v(b),!g&&!d&&(e=cb.exec(a)))if(h=e[1]){if(9===i){if(f=b.getElementById(h),!f||!f.parentNode)return c;if(f.id===h)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(h))&&w(b,f)&&f.id===h)return c.push(f),c}else{if(e[2])return K.apply(c,L.call(b.getElementsByTagName(a),0)),c;if((h=e[3])&&mb&&b.getElementsByClassName)return K.apply(c,L.call(b.getElementsByClassName(h),0)),c}return p(a.replace(Z,"$1"),b,c,d,g)}function d(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function e(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function f(a){return N(function(b){return b=+b,N(function(c,d){for(var e,f=a([],c.length,b),g=f.length;g--;)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function g(a,b,c){if(a===b)return c;for(var d=a.nextSibling;d;){if(d===b)return-1;d=d.nextSibling}return 1}function h(a,b){var d,e,f,g,h,i,j,k=Q[D][a+" "];if(k)return b?0:k.slice(0);for(h=a,i=[],j=t.preFilter;h;){(!d||(e=_.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),d=!1,(e=ab.exec(h))&&(f.push(d=new E(e.shift())),h=h.slice(d.length),d.type=e[0].replace(Z," "));for(g in t.filter)!(e=hb[g].exec(h))||j[g]&&!(e=j[g](e))||(f.push(d=new E(e.shift())),h=h.slice(d.length),d.type=g,d.matches=e);if(!d)break}return b?h.length:h?c.error(a):Q(a,i).slice(0)}function i(a,b,c){var d=b.dir,e=c&&"parentNode"===b.dir,f=I++;return b.first?function(b,c,f){for(;b=b[d];)if(e||1===b.nodeType)return a(b,c,f)}:function(b,c,g){if(g){for(;b=b[d];)if((e||1===b.nodeType)&&a(b,c,g))return b}else for(var h,i=H+" "+f+" ",j=i+r;b=b[d];)if(e||1===b.nodeType){if((h=b[D])===j)return b.sizset;if("string"==typeof h&&0===h.indexOf(i)){if(b.sizset)return b}else{if(b[D]=j,a(b,c,g))return b.sizset=!0,b;b.sizset=!1}}}}function j(a){return a.length>1?function(b,c,d){for(var e=a.length;e--;)if(!a[e](b,c,d))return!1;return!0}:a[0]}function k(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function l(a,b,c,d,e,f){return d&&!d[D]&&(d=l(d)),e&&!e[D]&&(e=l(e,f)),N(function(f,g,h,i){var j,l,m,n=[],p=[],q=g.length,r=f||o(b||"*",h.nodeType?[h]:h,[]),s=!a||!f&&b?r:k(r,n,a,h,i),t=c?e||(f?a:q||d)?[]:g:s;if(c&&c(s,t,h,i),d)for(j=k(t,p),d(j,[],h,i),l=j.length;l--;)(m=j[l])&&(t[p[l]]=!(s[p[l]]=m));if(f){if(e||a){if(e){for(j=[],l=t.length;l--;)(m=t[l])&&j.push(s[l]=m);e(null,t=[],j,i)}for(l=t.length;l--;)(m=t[l])&&(j=e?M.call(f,m):n[l])>-1&&(f[j]=!(g[j]=m))}}else t=k(t===g?t.splice(q,t.length):t),e?e(null,g,t,i):K.apply(g,t)})}function m(a){for(var b,c,d,e=a.length,f=t.relative[a[0].type],g=f||t.relative[" "],h=f?1:0,k=i(function(a){return a===b},g,!0),n=i(function(a){return M.call(b,a)>-1},g,!0),o=[function(a,c,d){return!f&&(d||c!==A)||((b=c).nodeType?k(a,c,d):n(a,c,d))}];e>h;h++)if(c=t.relative[a[h].type])o=[i(j(o),c)];else{if(c=t.filter[a[h].type].apply(null,a[h].matches),c[D]){for(d=++h;e>d&&!t.relative[a[d].type];d++);return l(h>1&&j(o),h>1&&a.slice(0,h-1).join("").replace(Z,"$1"),c,d>h&&m(a.slice(h,d)),e>d&&m(a=a.slice(d)),e>d&&a.join(""))}o.push(c)}return j(o)}function n(a,b){var d=b.length>0,e=a.length>0,f=function(g,h,i,j,l){var m,n,o,p=[],q=0,s="0",u=g&&[],v=null!=l,w=A,x=g||e&&t.find.TAG("*",l&&h.parentNode||h),y=H+=null==w?1:Math.E;for(v&&(A=h!==F&&h,r=f.el);null!=(m=x[s]);s++){if(e&&m){for(n=0;o=a[n];n++)if(o(m,h,i)){j.push(m);break}v&&(H=y,r=++f.el)}d&&((m=!o&&m)&&q--,g&&u.push(m))}if(q+=s,d&&s!==q){for(n=0;o=b[n];n++)o(u,p,h,i);if(g){if(q>0)for(;s--;)u[s]||p[s]||(p[s]=J.call(j));p=k(p)}K.apply(j,p),v&&!g&&p.length>0&&q+b.length>1&&c.uniqueSort(j)}return v&&(H=y,A=w),u};return f.el=0,d?N(f):f}function o(a,b,d){for(var e=0,f=b.length;f>e;e++)c(a,b[e],d);return d}function p(a,b,c,d,e){var f,g,i,j,k,l=h(a);if(l.length,!d&&1===l.length){if(g=l[0]=l[0].slice(0),g.length>2&&"ID"===(i=g[0]).type&&9===b.nodeType&&!e&&t.relative[g[1].type]){if(b=t.find.ID(i.matches[0].replace(gb,""),b,e)[0],!b)return c;a=a.slice(g.shift().length)}for(f=hb.POS.test(a)?-1:g.length-1;f>=0&&(i=g[f],!t.relative[j=i.type]);f--)if((k=t.find[j])&&(d=k(i.matches[0].replace(gb,""),db.test(g[0].type)&&b.parentNode||b,e))){if(g.splice(f,1),a=d.length&&g.join(""),!a)return K.apply(c,L.call(d,0)),c;break}}return x(a,l)(d,b,e,c,db.test(a)),c}function q(){}var r,s,t,u,v,w,x,y,z,A,B=!0,C="undefined",D=("sizcache"+Math.random()).replace(".",""),E=String,F=a.document,G=F.documentElement,H=0,I=0,J=[].pop,K=[].push,L=[].slice,M=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},N=function(a,b){return a[D]=null==b||b,a},O=function(){var a={},b=[];return N(function(c,d){return b.push(c)>t.cacheLength&&delete a[b.shift()],a[c+" "]=d},a)},P=O(),Q=O(),R=O(),S="[\\x20\\t\\r\\n\\f]",T="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",U=T.replace("w","w#"),V="([*^$|!~]?=)",W="\\["+S+"*("+T+")"+S+"*(?:"+V+S+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+U+")|)|)"+S+"*\\]",X=":("+T+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+W+")|[^:]|\\\\.)*|.*))\\)|)",Y=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+S+"*((?:-\\d)?\\d*)"+S+"*\\)|)(?=[^-]|$)",Z=new RegExp("^"+S+"+|((?:^|[^\\\\])(?:\\\\.)*)"+S+"+$","g"),_=new RegExp("^"+S+"*,"+S+"*"),ab=new RegExp("^"+S+"*([\\x20\\t\\r\\n\\f>+~])"+S+"*"),bb=new RegExp(X),cb=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,db=/[\x20\t\r\n\f]*[+~]/,eb=/h\d/i,fb=/input|select|textarea|button/i,gb=/\\(?!\\)/g,hb={ID:new RegExp("^#("+T+")"),CLASS:new RegExp("^\\.("+T+")"),NAME:new RegExp("^\\[name=['\"]?("+T+")['\"]?\\]"),TAG:new RegExp("^("+T.replace("w","w*")+")"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+X),POS:new RegExp(Y,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+S+"*(even|odd|(([+-]|)(\\d*)n|)"+S+"*(?:([+-]|)"+S+"*(\\d+)|))"+S+"*\\)|)","i"),needsContext:new RegExp("^"+S+"*[>+~]|"+Y,"i")},ib=function(a){var b=F.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},jb=ib(function(a){return a.appendChild(F.createComment("")),!a.getElementsByTagName("*").length}),kb=ib(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==C&&"#"===a.firstChild.getAttribute("href")}),lb=ib(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return"boolean"!==b&&"string"!==b}),mb=ib(function(a){return a.innerHTML="",a.getElementsByClassName&&a.getElementsByClassName("e").length?(a.lastChild.className="e",2===a.getElementsByClassName("e").length):!1}),nb=ib(function(a){a.id=D+0,a.innerHTML="
    ",G.insertBefore(a,G.firstChild);var b=F.getElementsByName&&F.getElementsByName(D).length===2+F.getElementsByName(D+0).length;return s=!F.getElementById(D),G.removeChild(a),b});try{L.call(G.childNodes,0)[0].nodeType}catch(ob){L=function(a){for(var b,c=[];b=this[a];a++)c.push(b);return c}}c.matches=function(a,b){return c(a,null,null,b)},c.matchesSelector=function(a,b){return c(b,null,null,[a]).length>0},u=c.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(1===e||9===e||11===e){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=u(a)}else if(3===e||4===e)return a.nodeValue}else for(;b=a[d];d++)c+=u(b);return c},v=c.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},w=c.contains=G.contains?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&1===d.nodeType&&c.contains&&c.contains(d))}:G.compareDocumentPosition?function(a,b){return b&&!!(16&a.compareDocumentPosition(b))}:function(a,b){for(;b=b.parentNode;)if(b===a)return!0;return!1},c.attr=function(a,b){var c,d=v(a);return d||(b=b.toLowerCase()),(c=t.attrHandle[b])?c(a):d||lb?a.getAttribute(b):(c=a.getAttributeNode(b),c?"boolean"==typeof a[b]?a[b]?b:null:c.specified?c.value:null:null)},t=c.selectors={cacheLength:50,createPseudo:N,match:hb,attrHandle:kb?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:s?function(a,b,c){if(typeof b.getElementById!==C&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==C&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==C&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:jb?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c=b.getElementsByTagName(a);if("*"===a){for(var d,e=[],f=0;d=c[f];f++)1===d.nodeType&&e.push(d);return e}return c},NAME:nb&&function(a,b){return typeof b.getElementsByName!==C?b.getElementsByName(name):void 0},CLASS:mb&&function(a,b,c){return typeof b.getElementsByClassName===C||c?void 0:b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(gb,""),a[3]=(a[4]||a[5]||"").replace(gb,""),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1]?(a[2]||c.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*("even"===a[2]||"odd"===a[2])),a[4]=+(a[6]+a[7]||"odd"===a[2])):a[2]&&c.error(a[0]),a},PSEUDO:function(a){var b,c;return hb.CHILD.test(a[0])?null:(a[3]?a[2]=a[3]:(b=a[4])&&(bb.test(b)&&(c=h(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b),a.slice(0,3))}},filter:{ID:s?function(a){return a=a.replace(gb,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(gb,""),function(b){var c=typeof b.getAttributeNode!==C&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return"*"===a?function(){return!0}:(a=a.replace(gb,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=P[D][a+" "];return b||(b=new RegExp("(^|"+S+")"+a+"("+S+"|$)"))&&P(a,function(a){return b.test(a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,d){return function(e){var f=c.attr(e,a);return null==f?"!="===b:b?(f+="","="===b?f===d:"!="===b?f!==d:"^="===b?d&&0===f.indexOf(d):"*="===b?d&&f.indexOf(d)>-1:"$="===b?d&&f.substr(f.length-d.length)===d:"~="===b?(" "+f+" ").indexOf(d)>-1:"|="===b?f===d||f.substr(0,d.length+1)===d+"-":!1):!0}},CHILD:function(a,b,c,d){return"nth"===a?function(a){var b,e,f=a.parentNode;if(1===c&&0===d)return!0;if(f)for(e=0,b=f.firstChild;b&&(1!==b.nodeType||(e++,a!==b));b=b.nextSibling);return e-=d,e===c||0===e%c&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":for(;c=c.previousSibling;)if(1===c.nodeType)return!1;if("first"===a)return!0;c=b;case"last":for(;c=c.nextSibling;)if(1===c.nodeType)return!1;return!0}}},PSEUDO:function(a,b){var d,e=t.pseudos[a]||t.setFilters[a.toLowerCase()]||c.error("unsupported pseudo: "+a);return e[D]?e(b):e.length>1?(d=[a,a,"",b],t.setFilters.hasOwnProperty(a.toLowerCase())?N(function(a,c){for(var d,f=e(a,b),g=f.length;g--;)d=M.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,d)}):e}},pseudos:{not:N(function(a){var b=[],c=[],d=x(a.replace(Z,"$1"));return d[D]?N(function(a,b,c,e){for(var f,g=d(a,null,e,[]),h=a.length;h--;)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:N(function(a){return function(b){return c(a,b).length>0}}),contains:N(function(a){return function(b){return(b.textContent||b.innerText||u(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!t.pseudos.empty(a)},empty:function(a){var b;for(a=a.firstChild;a;){if(a.nodeName>"@"||3===(b=a.nodeType)||4===b)return!1;a=a.nextSibling}return!0},header:function(a){return eb.test(a.nodeName)},text:function(a){var b,c;return"input"===a.nodeName.toLowerCase()&&"text"===(b=a.type)&&(null==(c=a.getAttribute("type"))||c.toLowerCase()===b)},radio:d("radio"),checkbox:d("checkbox"),file:d("file"),password:d("password"),image:d("image"),submit:e("submit"),reset:e("reset"),button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},input:function(a){return fb.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},active:function(a){return a===a.ownerDocument.activeElement},first:f(function(){return[0]}),last:f(function(a,b){return[b-1]}),eq:f(function(a,b,c){return[0>c?c+b:c]}),even:f(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:f(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:f(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:f(function(a,b,c){for(var d=0>c?c+b:c;++dk&&d>k;k++)if(e[k]!==f[k])return g(e[k],f[k]);return k===c?g(a,f[k],-1):g(e[k],b,1)},[0,0].sort(y),B=!z,c.uniqueSort=function(a){var b,c=[],d=1,e=0;if(z=B,a.sort(y),z){for(;b=a[d];d++)b===a[d-1]&&(e=c.push(d));for(;e--;)a.splice(c[e],1)}return a},c.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},x=c.compile=function(a,b){var c,d=[],e=[],f=R[D][a+" "];if(!f){for(b||(b=h(a)),c=b.length;c--;)f=m(b[c]),f[D]?d.push(f):e.push(f);f=R(a,n(e,d))}return f},F.querySelectorAll&&function(){var a,b=p,d=/'|\\/g,e=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,f=[":focus"],g=[":active"],i=G.matchesSelector||G.mozMatchesSelector||G.webkitMatchesSelector||G.oMatchesSelector||G.msMatchesSelector;ib(function(a){a.innerHTML="",a.querySelectorAll("[selected]").length||f.push("\\["+S+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||f.push(":checked")}),ib(function(a){a.innerHTML="

    ",a.querySelectorAll("[test^='']").length&&f.push("[*^$]="+S+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||f.push(":enabled",":disabled")}),f=new RegExp(f.join("|")),p=function(a,c,e,g,i){if(!g&&!i&&!f.test(a)){var j,k,l=!0,m=D,n=c,o=9===c.nodeType&&a;if(1===c.nodeType&&"object"!==c.nodeName.toLowerCase()){for(j=h(a),(l=c.getAttribute("id"))?m=l.replace(d,"\\$&"):c.setAttribute("id",m),m="[id='"+m+"'] ",k=j.length;k--;)j[k]=m+j[k].join("");n=db.test(a)&&c.parentNode||c,o=j.join(",")}if(o)try{return K.apply(e,L.call(n.querySelectorAll(o),0)),e}catch(p){}finally{l||c.removeAttribute("id")}}return b(a,c,e,g,i)},i&&(ib(function(b){a=i.call(b,"div");try{i.call(b,"[test!='']:sizzle"),g.push("!=",X)}catch(c){}}),g=new RegExp(g.join("|")),c.matchesSelector=function(b,d){if(d=d.replace(e,"='$1']"),!v(b)&&!g.test(d)&&!f.test(d))try{var h=i.call(b,d);if(h||a||b.document&&11!==b.document.nodeType)return h}catch(j){}return c(d,null,null,[b]).length>0})}(),t.pseudos.nth=t.pseudos.eq,t.filters=q.prototype=t.pseudos,t.setFilters=new q,c.attr=$.attr,$.find=c,$.expr=c.selectors,$.expr[":"]=$.expr.pseudos,$.unique=c.uniqueSort,$.text=c.getText,$.isXMLDoc=c.isXML,$.contains=c.contains}(a);var Ib=/Until$/,Jb=/^(?:parents|prev(?:Until|All))/,Kb=/^.[^:#\[\.,]*$/,Lb=$.expr.match.needsContext,Mb={children:!0,contents:!0,next:!0,prev:!0};$.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if("string"!=typeof a)return $(a).filter(function(){for(b=0,c=h.length;c>b;b++)if($.contains(h[b],this))return!0});for(g=this.pushStack("","find",a),b=0,c=this.length;c>b;b++)if(d=g.length,$.find(a,this[b],g),b>0)for(e=d;ef;f++)if(g[f]===g[e]){g.splice(e--,1);break}return g},has:function(a){var b,c=$(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if($.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(j(this,a,!1),"not",a)},filter:function(a){return this.pushStack(j(this,a,!0),"filter",a)},is:function(a){return!!a&&("string"==typeof a?Lb.test(a)?$(a,this.context).index(this[0])>=0:$.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=Lb.test(a)||"string"!=typeof a?$(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c.ownerDocument&&c!==b&&11!==c.nodeType;){if(g?g.index(c)>-1:$.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}return f=f.length>1?$.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?"string"==typeof a?$.inArray(this[0],$(a)):$.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c="string"==typeof a?$(a,b):$.makeArray(a&&a.nodeType?[a]:a),d=$.merge(this.get(),c);return this.pushStack(h(c[0])||h(d[0])?d:$.unique(d))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}}),$.fn.andSelf=$.fn.addBack,$.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return $.dir(a,"parentNode")},parentsUntil:function(a,b,c){return $.dir(a,"parentNode",c)},next:function(a){return i(a,"nextSibling")},prev:function(a){return i(a,"previousSibling")},nextAll:function(a){return $.dir(a,"nextSibling")},prevAll:function(a){return $.dir(a,"previousSibling")},nextUntil:function(a,b,c){return $.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return $.dir(a,"previousSibling",c)},siblings:function(a){return $.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return $.sibling(a.firstChild)},contents:function(a){return $.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:$.merge([],a.childNodes)}},function(a,b){$.fn[a]=function(c,d){var e=$.map(this,b,c);return Ib.test(a)||(d=c),d&&"string"==typeof d&&(e=$.filter(d,e)),e=this.length>1&&!Mb[a]?$.unique(e):e,this.length>1&&Jb.test(a)&&(e=e.reverse()),this.pushStack(e,a,V.call(arguments).join(","))}}),$.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),1===b.length?$.find.matchesSelector(b[0],a)?[b[0]]:[]:$.find.matches(a,b)},dir:function(a,c,d){for(var e=[],f=a[c];f&&9!==f.nodeType&&(d===b||1!==f.nodeType||!$(f).is(d));)1===f.nodeType&&e.push(f),f=f[c];return e},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}});var Nb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Ob=/ jQuery\d+="(?:null|\d+)"/g,Pb=/^\s+/,Qb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Rb=/<([\w:]+)/,Sb=/]","i"),Xb=/^(?:checkbox|radio)$/,Yb=/checked\s*(?:[^=]|=\s*.checked.)/i,Zb=/\/(java|ecma)script/i,$b=/^\s*\s*$/g,_b={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},ac=k(P),bc=ac.appendChild(P.createElement("div"));_b.optgroup=_b.option,_b.tbody=_b.tfoot=_b.colgroup=_b.caption=_b.thead,_b.th=_b.td,$.support.htmlSerialize||(_b._default=[1,"X
    ","
    "]),$.fn.extend({text:function(a){return $.access(this,function(a){return a===b?$.text(this):this.empty().append((this[0]&&this[0].ownerDocument||P).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if($.isFunction(a))return this.each(function(b){$(this).wrapAll(a.call(this,b))});if(this[0]){var b=$(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){for(var a=this;a.firstChild&&1===a.firstChild.nodeType;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return $.isFunction(a)?this.each(function(b){$(this).wrapInner(a.call(this,b))}):this.each(function(){var b=$(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=$.isFunction(a);return this.each(function(c){$(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){$.nodeName(this,"body")||$(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(1===this.nodeType||11===this.nodeType)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!h(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=$.clean(arguments);return this.pushStack($.merge(a,this),"before",this.selector)}},after:function(){if(!h(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=$.clean(arguments);return this.pushStack($.merge(this,a),"after",this.selector)}},remove:function(a,b){for(var c,d=0;null!=(c=this[d]);d++)(!a||$.filter(a,[c]).length)&&(b||1!==c.nodeType||($.cleanData(c.getElementsByTagName("*")),$.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)for(1===a.nodeType&&$.cleanData(a.getElementsByTagName("*"));a.firstChild;)a.removeChild(a.firstChild);return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return $.clone(this,a,b)})},html:function(a){return $.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(Ob,""):b;if(!("string"!=typeof a||Ub.test(a)||!$.support.htmlSerialize&&Wb.test(a)||!$.support.leadingWhitespace&&Pb.test(a)||_b[(Rb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(Qb,"<$1>");try{for(;e>d;d++)c=this[d]||{},1===c.nodeType&&($.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return h(this[0])?this.length?this.pushStack($($.isFunction(a)?a():a),"replaceWith",a):this:$.isFunction(a)?this.each(function(b){var c=$(this),d=c.html();c.replaceWith(a.call(this,b,d))}):("string"!=typeof a&&(a=$(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;$(this).remove(),b?$(b).before(a):$(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],m=this.length;if(!$.support.checkClone&&m>1&&"string"==typeof j&&Yb.test(j))return this.each(function(){$(this).domManip(a,c,d)});if($.isFunction(j))return this.each(function(e){var f=$(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){if(e=$.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,1===g.childNodes.length&&(g=f),f)for(c=c&&$.nodeName(f,"tr"),h=e.cacheable||m-1;m>i;i++)d.call(c&&$.nodeName(this[i],"table")?l(this[i],"tbody"):this[i],i===h?g:$.clone(g,!0,!0));g=f=null,k.length&&$.each(k,function(a,b){b.src?$.ajax?$.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):$.error("no ajax"):$.globalEval((b.text||b.textContent||b.innerHTML||"").replace($b,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),$.buildFragment=function(a,c,d){var e,f,g,h=a[0];return c=c||P,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,!(1===a.length&&"string"==typeof h&&h.length<512&&c===P&&"<"===h.charAt(0))||Vb.test(h)||!$.support.checkClone&&Yb.test(h)||!$.support.html5Clone&&Wb.test(h)||(f=!0,e=$.fragments[h],g=e!==b),e||(e=c.createDocumentFragment(),$.clean(a,c,e,d),f&&($.fragments[h]=g&&e)),{fragment:e,cacheable:f}},$.fragments={},$.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){$.fn[a]=function(c){var d,e=0,f=[],g=$(c),h=g.length,i=1===this.length&&this[0].parentNode;if((null==i||i&&11===i.nodeType&&1===i.childNodes.length)&&1===h)return g[b](this[0]),this;for(;h>e;e++)d=(e>0?this.clone(!0):this).get(),$(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),$.extend({clone:function(a,b,c){var d,e,f,g;if($.support.html5Clone||$.isXMLDoc(a)||!Wb.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bc.innerHTML=a.outerHTML,bc.removeChild(g=bc.firstChild)),!($.support.noCloneEvent&&$.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||$.isXMLDoc(a)))for(n(a,g),d=o(a),e=o(g),f=0;d[f];++f)e[f]&&n(d[f],e[f]);if(b&&(m(a,g),c))for(d=o(a),e=o(g),f=0;d[f];++f)m(d[f],e[f]);return d=e=null,g},clean:function(a,b,c,d){var e,f,g,h,i,j,l,m,n,o,q,r=b===P&&ac,s=[];for(b&&"undefined"!=typeof b.createDocumentFragment||(b=P),e=0;null!=(g=a[e]);e++)if("number"==typeof g&&(g+=""),g){if("string"==typeof g)if(Tb.test(g)){for(r=r||k(b),l=b.createElement("div"),r.appendChild(l),g=g.replace(Qb,"<$1>"),h=(Rb.exec(g)||["",""])[1].toLowerCase(),i=_b[h]||_b._default,j=i[0],l.innerHTML=i[1]+g+i[2];j--;)l=l.lastChild;if(!$.support.tbody)for(m=Sb.test(g),n="table"!==h||m?""!==i[1]||m?[]:l.childNodes:l.firstChild&&l.firstChild.childNodes,f=n.length-1;f>=0;--f)$.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f]);!$.support.leadingWhitespace&&Pb.test(g)&&l.insertBefore(b.createTextNode(Pb.exec(g)[0]),l.firstChild),g=l.childNodes,l.parentNode.removeChild(l)}else g=b.createTextNode(g);g.nodeType?s.push(g):$.merge(s,g)}if(l&&(g=l=r=null),!$.support.appendChecked)for(e=0;null!=(g=s[e]);e++)$.nodeName(g,"input")?p(g):"undefined"!=typeof g.getElementsByTagName&&$.grep(g.getElementsByTagName("input"),p);if(c)for(o=function(a){return!a.type||Zb.test(a.type)?d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a):void 0},e=0;null!=(g=s[e]);e++)$.nodeName(g,"script")&&o(g)||(c.appendChild(g),"undefined"!=typeof g.getElementsByTagName&&(q=$.grep($.merge([],g.getElementsByTagName("script")),o),s.splice.apply(s,[e+1,0].concat(q)),e+=q.length));return s},cleanData:function(a,b){for(var c,d,e,f,g=0,h=$.expando,i=$.cache,j=$.support.deleteExpando,k=$.event.special;null!=(e=a[g]);g++)if((b||$.acceptData(e))&&(d=e[h],c=d&&i[d])){if(c.events)for(f in c.events)k[f]?$.event.remove(e,f):$.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,$.deletedIds.push(d))}}}),function(){var a,b;$.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=$.uaMatch(R.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),$.browser=b,$.sub=function(){function a(b,c){return new a.fn.init(b,c)}$.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(c,d){return d&&d instanceof $&&!(d instanceof a)&&(d=a(d)),$.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(P);return a}}();var cc,dc,ec,fc=/alpha\([^)]*\)/i,gc=/opacity=([^)]*)/,hc=/^(top|right|bottom|left)$/,ic=/^(none|table(?!-c[ea]).+)/,jc=/^margin/,kc=new RegExp("^("+_+")(.*)$","i"),lc=new RegExp("^("+_+")(?!px)[a-z%]+$","i"),mc=new RegExp("^([-+])=("+_+")","i"),nc={BODY:"block"},oc={position:"absolute",visibility:"hidden",display:"block"},pc={letterSpacing:0,fontWeight:400},qc=["Top","Right","Bottom","Left"],rc=["Webkit","O","Moz","ms"],sc=$.fn.toggle;$.fn.extend({css:function(a,c){return $.access(this,function(a,c,d){return d!==b?$.style(a,c,d):$.css(a,c)},a,c,arguments.length>1)},show:function(){return s(this,!0)},hide:function(){return s(this)},toggle:function(a,b){var c="boolean"==typeof a;return $.isFunction(a)&&$.isFunction(b)?sc.apply(this,arguments):this.each(function(){(c?a:r(this))?$(this).show():$(this).hide()})}}),$.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=cc(a,"opacity");return""===c?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":$.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g,h,i=$.camelCase(c),j=a.style;if(c=$.cssProps[i]||($.cssProps[i]=q(j,i)),h=$.cssHooks[c]||$.cssHooks[i],d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];if(g=typeof d,"string"===g&&(f=mc.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat($.css(a,c)),g="number"),!(null==d||"number"===g&&isNaN(d)||("number"!==g||$.cssNumber[i]||(d+="px"),h&&"set"in h&&(d=h.set(a,d,e))===b)))try{j[c]=d}catch(k){}}},css:function(a,c,d,e){var f,g,h,i=$.camelCase(c);return c=$.cssProps[i]||($.cssProps[i]=q(a.style,i)),h=$.cssHooks[c]||$.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=cc(a,c)),"normal"===f&&c in pc&&(f=pc[c]),d||e!==b?(g=parseFloat(f),d||$.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?cc=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h.getPropertyValue(c)||h[c],""!==d||$.contains(b.ownerDocument,b)||(d=$.style(b,c)),lc.test(d)&&jc.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:P.documentElement.currentStyle&&(cc=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return null==e&&f&&f[b]&&(e=f[b]),lc.test(e)&&!hc.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left="fontSize"===b?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),""===e?"auto":e}),$.each(["height","width"],function(a,b){$.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&ic.test(cc(a,"display"))?$.swap(a,oc,function(){return v(a,b,d)}):v(a,b,d):void 0},set:function(a,c,d){return t(a,c,d?u(a,b,d,$.support.boxSizing&&"border-box"===$.css(a,"boxSizing")):0)}}}),$.support.opacity||($.cssHooks.opacity={get:function(a,b){return gc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=$.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,b>=1&&""===$.trim(f.replace(fc,""))&&c.removeAttribute&&(c.removeAttribute("filter"),d&&!d.filter)||(c.filter=fc.test(f)?f.replace(fc,e):f+" "+e)}}),$(function(){$.support.reliableMarginRight||($.cssHooks.marginRight={get:function(a,b){return $.swap(a,{display:"inline-block"},function(){return b?cc(a,"marginRight"):void 0})}}),!$.support.pixelPosition&&$.fn.position&&$.each(["top","left"],function(a,b){$.cssHooks[b]={get:function(a,c){if(c){var d=cc(a,b);return lc.test(d)?$(a).position()[b]+"px":d}}}})}),$.expr&&$.expr.filters&&($.expr.filters.hidden=function(a){return 0===a.offsetWidth&&0===a.offsetHeight||!$.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||cc(a,"display"))},$.expr.filters.visible=function(a){return!$.expr.filters.hidden(a)}),$.each({margin:"",padding:"",border:"Width"},function(a,b){$.cssHooks[a+b]={expand:function(c){var d,e="string"==typeof c?c.split(" "):[c],f={};for(d=0;4>d;d++)f[a+qc[d]+b]=e[d]||e[d-2]||e[0]; -return f}},jc.test(a)||($.cssHooks[a+b].set=t)});var tc=/%20/g,uc=/\[\]$/,vc=/\r?\n/g,wc=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,xc=/^(?:select|textarea)/i;$.fn.extend({serialize:function(){return $.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?$.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||xc.test(this.nodeName)||wc.test(this.type))}).map(function(a,b){var c=$(this).val();return null==c?null:$.isArray(c)?$.map(c,function(a){return{name:b.name,value:a.replace(vc,"\r\n")}}):{name:b.name,value:c.replace(vc,"\r\n")}}).get()}}),$.param=function(a,c){var d,e=[],f=function(a,b){b=$.isFunction(b)?b():null==b?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(c===b&&(c=$.ajaxSettings&&$.ajaxSettings.traditional),$.isArray(a)||a.jquery&&!$.isPlainObject(a))$.each(a,function(){f(this.name,this.value)});else for(d in a)x(d,a[d],c,f);return e.join("&").replace(tc,"+")};var yc,zc,Ac=/#.*$/,Bc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cc=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Dc=/^(?:GET|HEAD)$/,Ec=/^\/\//,Fc=/\?/,Gc=/)<[^<]*)*<\/script>/gi,Hc=/([?&])_=[^&]*/,Ic=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Jc=$.fn.load,Kc={},Lc={},Mc=["*/"]+["*"];try{zc=Q.href}catch(Nc){zc=P.createElement("a"),zc.href="",zc=zc.href}yc=Ic.exec(zc.toLowerCase())||[],$.fn.load=function(a,c,d){if("string"!=typeof a&&Jc)return Jc.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),$.isFunction(c)?(d=c,c=b):c&&"object"==typeof c&&(f="POST"),$.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?$("
    ").append(a.replace(Gc,"")).find(e):a)}),this},$.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){$.fn[b]=function(a){return this.on(b,a)}}),$.each(["get","post"],function(a,c){$[c]=function(a,d,e,f){return $.isFunction(d)&&(f=f||e,e=d,d=b),$.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),$.extend({getScript:function(a,c){return $.get(a,b,c,"script")},getJSON:function(a,b,c){return $.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?A(a,$.ajaxSettings):(b=a,a=$.ajaxSettings),A(a,b),a},ajaxSettings:{url:zc,isLocal:Cc.test(yc[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Mc},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":$.parseJSON,"text xml":$.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:y(Kc),ajaxTransport:y(Lc),ajax:function(a,c){function d(a,c,d,g){var j,l,s,t,v,x=c;2!==u&&(u=2,i&&clearTimeout(i),h=b,f=g||"",w.readyState=a>0?4:0,d&&(t=B(m,w,d)),a>=200&&300>a||304===a?(m.ifModified&&(v=w.getResponseHeader("Last-Modified"),v&&($.lastModified[e]=v),v=w.getResponseHeader("Etag"),v&&($.etag[e]=v)),304===a?(x="notmodified",j=!0):(j=C(m,t),x=j.state,l=j.data,s=j.error,j=!s)):(s=x,(!x||a)&&(x="error",0>a&&(a=0))),w.status=a,w.statusText=(c||x)+"",j?p.resolveWith(n,[l,x,w]):p.rejectWith(n,[w,x,s]),w.statusCode(r),r=b,k&&o.trigger("ajax"+(j?"Success":"Error"),[w,m,j?l:s]),q.fireWith(n,[w,x]),k&&(o.trigger("ajaxComplete",[w,m]),--$.active||$.event.trigger("ajaxStop")))}"object"==typeof a&&(c=a,a=b),c=c||{};var e,f,g,h,i,j,k,l,m=$.ajaxSetup({},c),n=m.context||m,o=n!==m&&(n.nodeType||n instanceof $)?$(n):$.event,p=$.Deferred(),q=$.Callbacks("once memory"),r=m.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,setRequestHeader:function(a,b){if(!u){var c=a.toLowerCase();a=t[c]=t[c]||a,s[a]=b}return this},getAllResponseHeaders:function(){return 2===u?f:null},getResponseHeader:function(a){var c;if(2===u){if(!g)for(g={};c=Bc.exec(f);)g[c[1].toLowerCase()]=c[2];c=g[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return u||(m.mimeType=a),this},abort:function(a){return a=a||v,h&&h.abort(a),d(0,a),this}};if(p.promise(w),w.success=w.done,w.error=w.fail,w.complete=q.add,w.statusCode=function(a){if(a){var b;if(2>u)for(b in a)r[b]=[r[b],a[b]];else b=a[w.status],w.always(b)}return this},m.url=((a||m.url)+"").replace(Ac,"").replace(Ec,yc[1]+"//"),m.dataTypes=$.trim(m.dataType||"*").toLowerCase().split(bb),null==m.crossDomain&&(j=Ic.exec(m.url.toLowerCase()),m.crossDomain=!(!j||j[1]===yc[1]&&j[2]===yc[2]&&(j[3]||("http:"===j[1]?80:443))==(yc[3]||("http:"===yc[1]?80:443)))),m.data&&m.processData&&"string"!=typeof m.data&&(m.data=$.param(m.data,m.traditional)),z(Kc,m,c,w),2===u)return w;if(k=m.global,m.type=m.type.toUpperCase(),m.hasContent=!Dc.test(m.type),k&&0===$.active++&&$.event.trigger("ajaxStart"),!m.hasContent&&(m.data&&(m.url+=(Fc.test(m.url)?"&":"?")+m.data,delete m.data),e=m.url,m.cache===!1)){var x=$.now(),y=m.url.replace(Hc,"$1_="+x);m.url=y+(y===m.url?(Fc.test(m.url)?"&":"?")+"_="+x:"")}(m.data&&m.hasContent&&m.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",m.contentType),m.ifModified&&(e=e||m.url,$.lastModified[e]&&w.setRequestHeader("If-Modified-Since",$.lastModified[e]),$.etag[e]&&w.setRequestHeader("If-None-Match",$.etag[e])),w.setRequestHeader("Accept",m.dataTypes[0]&&m.accepts[m.dataTypes[0]]?m.accepts[m.dataTypes[0]]+("*"!==m.dataTypes[0]?", "+Mc+"; q=0.01":""):m.accepts["*"]);for(l in m.headers)w.setRequestHeader(l,m.headers[l]);if(m.beforeSend&&(m.beforeSend.call(n,w,m)===!1||2===u))return w.abort();v="abort";for(l in{success:1,error:1,complete:1})w[l](m[l]);if(h=z(Lc,m,c,w)){w.readyState=1,k&&o.trigger("ajaxSend",[w,m]),m.async&&m.timeout>0&&(i=setTimeout(function(){w.abort("timeout")},m.timeout));try{u=1,h.send(s,d)}catch(A){if(!(2>u))throw A;d(-1,A)}}else d(-1,"No Transport");return w},active:0,lastModified:{},etag:{}});var Oc=[],Pc=/\?/,Qc=/(=)\?(?=&|$)|\?\?/,Rc=$.now();$.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Oc.pop()||$.expando+"_"+Rc++;return this[a]=!0,a}}),$.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&Qc.test(j),m=k&&!l&&"string"==typeof i&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qc.test(i);return"jsonp"===c.dataTypes[0]||l||m?(f=c.jsonpCallback=$.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(Qc,"$1"+f):m?c.data=i.replace(Qc,"$1"+f):k&&(c.url+=(Pc.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||$.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,Oc.push(f)),h&&$.isFunction(g)&&g(h[0]),h=g=b}),"script"):void 0}),$.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return $.globalEval(a),a}}}),$.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),$.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=P.head||P.getElementsByTagName("head")[0]||P.documentElement;return{send:function(e,f){c=P.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){(e||!c.readyState||/loaded|complete/.test(c.readyState))&&(c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||f(200,"success"))},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var Sc,Tc=a.ActiveXObject?function(){for(var a in Sc)Sc[a](0,1)}:!1,Uc=0;$.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&D()||E()}:D,function(a){$.extend($.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}($.ajaxSettings.xhr()),$.support.ajax&&$.ajaxTransport(function(c){if(!c.crossDomain||$.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();if(c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async),c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),c.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||4===i.readyState))if(d=b,g&&(i.onreadystatechange=$.noop,Tc&&delete Sc[g]),e)4!==i.readyState&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(n){}try{j=i.statusText}catch(n){j=""}h||!c.isLocal||c.crossDomain?1223===h&&(h=204):h=l.text?200:404}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?4===i.readyState?setTimeout(d,0):(g=++Uc,Tc&&(Sc||(Sc={},$(a).unload(Tc)),Sc[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var Vc,Wc,Xc=/^(?:toggle|show|hide)$/,Yc=new RegExp("^(?:([-+])=|)("+_+")([a-z%]*)$","i"),Zc=/queueHooks$/,$c=[J],_c={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=Yc.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){if(c=+f[2],d=f[3]||($.cssNumber[a]?"":"px"),"px"!==d&&h){h=$.css(e.elem,a,!0)||c||1;do i=i||".5",h/=i,$.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&1!==i&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};$.Animation=$.extend(H,{tweener:function(a,b){$.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],_c[c]=_c[c]||[],_c[c].unshift(b)},prefilter:function(a,b){b?$c.unshift(a):$c.push(a)}}),$.Tween=K,K.prototype={constructor:K,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||($.cssNumber[c]?"":"px")},cur:function(){var a=K.propHooks[this.prop];return a&&a.get?a.get(this):K.propHooks._default.get(this)},run:function(a){var b,c=K.propHooks[this.prop];return this.pos=b=this.options.duration?$.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):K.propHooks._default.set(this),this}},K.prototype.init.prototype=K.prototype,K.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=$.css(a.elem,a.prop,!1,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){$.fx.step[a.prop]?$.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[$.cssProps[a.prop]]||$.cssHooks[a.prop])?$.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},K.propHooks.scrollTop=K.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},$.each(["toggle","show","hide"],function(a,b){var c=$.fn[b];$.fn[b]=function(d,e,f){return null==d||"boolean"==typeof d||!a&&$.isFunction(d)&&$.isFunction(e)?c.apply(this,arguments):this.animate(L(b,!0),d,e,f)}}),$.fn.extend({fadeTo:function(a,b,c,d){return this.filter(r).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=$.isEmptyObject(a),f=$.speed(b,c,d),g=function(){var b=H(this,$.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return"string"!=typeof a&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=null!=a&&a+"queueHooks",f=$.timers,g=$._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&Zc.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem!==this||null!=a&&f[c].queue!==a||(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&$.dequeue(this,a)})}}),$.each({slideDown:L("show"),slideUp:L("hide"),slideToggle:L("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){$.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),$.speed=function(a,b,c){var d=a&&"object"==typeof a?$.extend({},a):{complete:c||!c&&b||$.isFunction(a)&&a,duration:a,easing:c&&b||b&&!$.isFunction(b)&&b};return d.duration=$.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in $.fx.speeds?$.fx.speeds[d.duration]:$.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){$.isFunction(d.old)&&d.old.call(this),d.queue&&$.dequeue(this,d.queue)},d},$.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},$.timers=[],$.fx=K.prototype.init,$.fx.tick=function(){var a,c=$.timers,d=0;for(Vc=$.now();d-1,l={},m={};k?(m=g.position(),e=m.top,f=m.left):(e=parseFloat(i)||0,f=parseFloat(j)||0),$.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(l.top=b.top-h.top+e),null!=b.left&&(l.left=b.left-h.left+f),"using"in b?b.using.call(a,l):g.css(l)}},$.fn.extend({position:function(){if(this[0]){var a=this[0],b=this.offsetParent(),c=this.offset(),d=ad.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat($.css(a,"marginTop"))||0,c.left-=parseFloat($.css(a,"marginLeft"))||0,d.top+=parseFloat($.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat($.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||P.body;a&&!ad.test(a.nodeName)&&"static"===$.css(a,"position");)a=a.offsetParent;return a||P.body})}}),$.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);$.fn[a]=function(e){return $.access(this,function(a,e,f){var g=M(a);return f===b?g?c in g?g[c]:g.document.documentElement[e]:a[e]:(g?g.scrollTo(d?$(g).scrollLeft():f,d?f:$(g).scrollTop()):a[e]=f,void 0)},a,e,arguments.length,null)}}),$.each({Height:"height",Width:"width"},function(a,c){$.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){$.fn[e]=function(e,f){var g=arguments.length&&(d||"boolean"!=typeof e),h=d||(e===!0||f===!0?"margin":"border");return $.access(this,function(c,d,e){var f;return $.isWindow(c)?c.document.documentElement["client"+a]:9===c.nodeType?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?$.css(c,d,e,h):$.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=$,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return $})}(window),/*! ========================================================= +function(e,t){function n(e,t,n,r){n=n||[],t=t||j;var o,i,a,s,l=t.nodeType;if(!e||"string"!=typeof e)return n;if(1!==l&&9!==l)return[];if(a=w(t),!a&&!r&&(o=nt.exec(e)))if(s=o[1]){if(9===l){if(i=t.getElementById(s),!i||!i.parentNode)return n;if(i.id===s)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(s))&&C(t,i)&&i.id===s)return n.push(i),n}else{if(o[2])return P.apply(n,I.call(t.getElementsByTagName(e),0)),n;if((s=o[3])&&ft&&t.getElementsByClassName)return P.apply(n,I.call(t.getElementsByClassName(s),0)),n}return g(e.replace(G,"$1"),t,n,r,a)}function r(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function o(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function i(e){return L(function(t){return t=+t,L(function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function a(e,t,n){if(e===t)return n;for(var r=e.nextSibling;r;){if(r===t)return-1;r=r.nextSibling}return 1}function s(e,t){var r,o,i,a,s,l,c,u=q[N][e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=b.preFilter;s;){(!r||(o=Z.exec(s)))&&(o&&(s=s.slice(o[0].length)||s),l.push(i=[])),r=!1,(o=et.exec(s))&&(i.push(r=new S(o.shift())),s=s.slice(r.length),r.type=o[0].replace(G," "));for(a in b.filter)!(o=st[a].exec(s))||c[a]&&!(o=c[a](o))||(i.push(r=new S(o.shift())),s=s.slice(r.length),r.type=a,r.matches=o);if(!r)break}return t?s.length:s?n.error(e):q(e,l).slice(0)}function l(e,t,n){var r=t.dir,o=n&&"parentNode"===t.dir,i=M++;return t.first?function(t,n,i){for(;t=t[r];)if(o||1===t.nodeType)return e(t,n,i)}:function(t,n,a){if(a){for(;t=t[r];)if((o||1===t.nodeType)&&e(t,n,a))return t}else for(var s,l=O+" "+i+" ",c=l+y;t=t[r];)if(o||1===t.nodeType){if((s=t[N])===c)return t.sizset;if("string"==typeof s&&0===s.indexOf(l)){if(t.sizset)return t}else{if(t[N]=c,e(t,n,a))return t.sizset=!0,t;t.sizset=!1}}}}function c(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function u(e,t,n,r,o){for(var i,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(i=e[s])&&(!n||n(i,r,o))&&(a.push(i),c&&t.push(s));return a}function p(e,t,n,r,o,i){return r&&!r[N]&&(r=p(r)),o&&!o[N]&&(o=p(o,i)),L(function(i,a,s,l){var c,p,f,d=[],g=[],m=a.length,y=i||h(t||"*",s.nodeType?[s]:s,[]),v=!e||!i&&t?y:u(y,d,e,s,l),b=n?o||(i?e:m||r)?[]:a:v;if(n&&n(v,b,s,l),r)for(c=u(b,g),r(c,[],s,l),p=c.length;p--;)(f=c[p])&&(b[g[p]]=!(v[g[p]]=f));if(i){if(o||e){if(o){for(c=[],p=b.length;p--;)(f=b[p])&&c.push(v[p]=f);o(null,b=[],c,l)}for(p=b.length;p--;)(f=b[p])&&(c=o?D.call(i,f):d[p])>-1&&(i[c]=!(a[c]=f))}}else b=u(b===a?b.splice(m,b.length):b),o?o(null,a,b,l):P.apply(a,b)})}function f(e){for(var t,n,r,o=e.length,i=b.relative[e[0].type],a=i||b.relative[" "],s=i?1:0,u=l(function(e){return e===t},a,!0),d=l(function(e){return D.call(t,e)>-1},a,!0),h=[function(e,n,r){return!i&&(r||n!==A)||((t=n).nodeType?u(e,n,r):d(e,n,r))}];o>s;s++)if(n=b.relative[e[s].type])h=[l(c(h),n)];else{if(n=b.filter[e[s].type].apply(null,e[s].matches),n[N]){for(r=++s;o>r&&!b.relative[e[r].type];r++);return p(s>1&&c(h),s>1&&e.slice(0,s-1).join("").replace(G,"$1"),n,r>s&&f(e.slice(s,r)),o>r&&f(e=e.slice(r)),o>r&&e.join(""))}h.push(n)}return c(h)}function d(e,t){var r=t.length>0,o=e.length>0,i=function(a,s,l,c,p){var f,d,h,g=[],m=0,v="0",x=a&&[],w=null!=p,C=A,_=a||o&&b.find.TAG("*",p&&s.parentNode||s),k=O+=null==C?1:Math.E;for(w&&(A=s!==j&&s,y=i.el);null!=(f=_[v]);v++){if(o&&f){for(d=0;h=e[d];d++)if(h(f,s,l)){c.push(f);break}w&&(O=k,y=++i.el)}r&&((f=!h&&f)&&m--,a&&x.push(f))}if(m+=v,r&&v!==m){for(d=0;h=t[d];d++)h(x,g,s,l);if(a){if(m>0)for(;v--;)x[v]||g[v]||(g[v]=H.call(c));g=u(g)}P.apply(c,g),w&&!a&&g.length>0&&m+t.length>1&&n.uniqueSort(c)}return w&&(O=k,A=C),x};return i.el=0,r?L(i):i}function h(e,t,r){for(var o=0,i=t.length;i>o;o++)n(e,t[o],r);return r}function g(e,t,n,r,o){var i,a,l,c,u,p=s(e);if(p.length,!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(l=a[0]).type&&9===t.nodeType&&!o&&b.relative[a[1].type]){if(t=b.find.ID(l.matches[0].replace(at,""),t,o)[0],!t)return n;e=e.slice(a.shift().length)}for(i=st.POS.test(e)?-1:a.length-1;i>=0&&(l=a[i],!b.relative[c=l.type]);i--)if((u=b.find[c])&&(r=u(l.matches[0].replace(at,""),rt.test(a[0].type)&&t.parentNode||t,o))){if(a.splice(i,1),e=r.length&&a.join(""),!e)return P.apply(n,I.call(r,0)),n;break}}return _(e,p)(r,t,o,n,rt.test(e)),n}function m(){}var y,v,b,x,w,C,_,k,T,A,E=!0,F="undefined",N=("sizcache"+Math.random()).replace(".",""),S=String,j=e.document,R=j.documentElement,O=0,M=0,H=[].pop,P=[].push,I=[].slice,D=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},L=function(e,t){return e[N]=null==t||t,e},B=function(){var e={},t=[];return L(function(n,r){return t.push(n)>b.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},$=B(),q=B(),W=B(),U="[\\x20\\t\\r\\n\\f]",Q="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",z=Q.replace("w","w#"),X="([*^$|!~]?=)",J="\\["+U+"*("+Q+")"+U+"*(?:"+X+U+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+z+")|)|)"+U+"*\\]",V=":("+Q+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+J+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+U+"*((?:-\\d)?\\d*)"+U+"*\\)|)(?=[^-]|$)",G=RegExp("^"+U+"+|((?:^|[^\\\\])(?:\\\\.)*)"+U+"+$","g"),Z=RegExp("^"+U+"*,"+U+"*"),et=RegExp("^"+U+"*([\\x20\\t\\r\\n\\f>+~])"+U+"*"),tt=RegExp(V),nt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,rt=/[\x20\t\r\n\f]*[+~]/,ot=/h\d/i,it=/input|select|textarea|button/i,at=/\\(?!\\)/g,st={ID:RegExp("^#("+Q+")"),CLASS:RegExp("^\\.("+Q+")"),NAME:RegExp("^\\[name=['\"]?("+Q+")['\"]?\\]"),TAG:RegExp("^("+Q.replace("w","w*")+")"),ATTR:RegExp("^"+J),PSEUDO:RegExp("^"+V),POS:RegExp(K,"i"),CHILD:RegExp("^:(only|nth|first|last)-child(?:\\("+U+"*(even|odd|(([+-]|)(\\d*)n|)"+U+"*(?:([+-]|)"+U+"*(\\d+)|))"+U+"*\\)|)","i"),needsContext:RegExp("^"+U+"*[>+~]|"+K,"i")},lt=function(e){var t=j.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},ct=lt(function(e){return e.appendChild(j.createComment("")),!e.getElementsByTagName("*").length}),ut=lt(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==F&&"#"===e.firstChild.getAttribute("href")}),pt=lt(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),ft=lt(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),dt=lt(function(e){e.id=N+0,e.innerHTML="
    ",R.insertBefore(e,R.firstChild);var t=j.getElementsByName&&j.getElementsByName(N).length===2+j.getElementsByName(N+0).length;return v=!j.getElementById(N),R.removeChild(e),t});try{I.call(R.childNodes,0)[0].nodeType}catch(ht){I=function(e){for(var t,n=[];t=this[e];e++)n.push(t);return n}}n.matches=function(e,t){return n(e,null,null,t)},n.matchesSelector=function(e,t){return n(t,null,null,[e]).length>0},x=n.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=x(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=x(t);return n},w=n.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},C=n.contains=R.contains?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&1===r.nodeType&&n.contains&&n.contains(r))}:R.compareDocumentPosition?function(e,t){return t&&!!(16&e.compareDocumentPosition(t))}:function(e,t){for(;t=t.parentNode;)if(t===e)return!0;return!1},n.attr=function(e,t){var n,r=w(e);return r||(t=t.toLowerCase()),(n=b.attrHandle[t])?n(e):r||pt?e.getAttribute(t):(n=e.getAttributeNode(t),n?"boolean"==typeof e[t]?e[t]?t:null:n.specified?n.value:null:null)},b=n.selectors={cacheLength:50,createPseudo:L,match:st,attrHandle:ut?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:v?function(e,t,n){if(typeof t.getElementById!==F&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==F&&!r){var o=n.getElementById(e);return o?o.id===e||typeof o.getAttributeNode!==F&&o.getAttributeNode("id").value===e?[o]:t:[]}},TAG:ct?function(e,n){return typeof n.getElementsByTagName!==F?n.getElementsByTagName(e):t}:function(e,t){var n=t.getElementsByTagName(e);if("*"===e){for(var r,o=[],i=0;r=n[i];i++)1===r.nodeType&&o.push(r);return o}return n},NAME:dt&&function(e,n){return typeof n.getElementsByName!==F?n.getElementsByName(name):t},CLASS:ft&&function(e,n,r){return typeof n.getElementsByClassName===F||r?t:n.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(at,""),e[3]=(e[4]||e[5]||"").replace(at,""),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1]?(e[2]||n.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*("even"===e[2]||"odd"===e[2])),e[4]=+(e[6]+e[7]||"odd"===e[2])):e[2]&&n.error(e[0]),e},PSEUDO:function(e){var t,n;return st.CHILD.test(e[0])?null:(e[3]?e[2]=e[3]:(t=e[4])&&(tt.test(t)&&(n=s(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t),e.slice(0,3))}},filter:{ID:v?function(e){return e=e.replace(at,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace(at,""),function(t){var n=typeof t.getAttributeNode!==F&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(at,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=$[N][e+" "];return t||(t=RegExp("(^|"+U+")"+e+"("+U+"|$)"))&&$(e,function(e){return t.test(e.className||typeof e.getAttribute!==F&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(o){var i=n.attr(o,e);return null==i?"!="===t:t?(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.substr(i.length-r.length)===r:"~="===t?(" "+i+" ").indexOf(r)>-1:"|="===t?i===r||i.substr(0,r.length+1)===r+"-":!1):!0}},CHILD:function(e,t,n,r){return"nth"===e?function(e){var t,o,i=e.parentNode;if(1===n&&0===r)return!0;if(i)for(o=0,t=i.firstChild;t&&(1!==t.nodeType||(o++,e!==t));t=t.nextSibling);return o-=r,o===n||0===o%n&&o/n>=0}:function(t){var n=t;switch(e){case"only":case"first":for(;n=n.previousSibling;)if(1===n.nodeType)return!1;if("first"===e)return!0;n=t;case"last":for(;n=n.nextSibling;)if(1===n.nodeType)return!1;return!0}}},PSEUDO:function(e,t){var r,o=b.pseudos[e]||b.setFilters[e.toLowerCase()]||n.error("unsupported pseudo: "+e);return o[N]?o(t):o.length>1?(r=[e,e,"",t],b.setFilters.hasOwnProperty(e.toLowerCase())?L(function(e,n){for(var r,i=o(e,t),a=i.length;a--;)r=D.call(e,i[a]),e[r]=!(n[r]=i[a])}):function(e){return o(e,0,r)}):o}},pseudos:{not:L(function(e){var t=[],n=[],r=_(e.replace(G,"$1"));return r[N]?L(function(e,t,n,o){for(var i,a=r(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))}):function(e,o,i){return t[0]=e,r(t,null,i,n),!n.pop()}}),has:L(function(e){return function(t){return n(e,t).length>0}}),contains:L(function(e){return function(t){return(t.textContent||t.innerText||x(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!b.pseudos.empty(e)},empty:function(e){var t;for(e=e.firstChild;e;){if(e.nodeName>"@"||3===(t=e.nodeType)||4===t)return!1;e=e.nextSibling}return!0},header:function(e){return ot.test(e.nodeName)},text:function(e){var t,n;return"input"===e.nodeName.toLowerCase()&&"text"===(t=e.type)&&(null==(n=e.getAttribute("type"))||n.toLowerCase()===t)},radio:r("radio"),checkbox:r("checkbox"),file:r("file"),password:r("password"),image:r("image"),submit:o("submit"),reset:o("reset"),button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},input:function(e){return it.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:i(function(){return[0]}),last:i(function(e,t){return[t-1]}),eq:i(function(e,t,n){return[0>n?n+t:n]}),even:i(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:i(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:i(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:i(function(e,t,n){for(var r=0>n?n+t:n;t>++r;)e.push(r);return e})}},k=R.compareDocumentPosition?function(e,t){return e===t?(T=!0,0):(e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t):e.compareDocumentPosition)?-1:1}:function(e,t){if(e===t)return T=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,o=[],i=[],s=e.parentNode,l=t.parentNode,c=s;if(s===l)return a(e,t);if(!s)return-1;if(!l)return 1;for(;c;)o.unshift(c),c=c.parentNode;for(c=l;c;)i.unshift(c),c=c.parentNode;n=o.length,r=i.length;for(var u=0;n>u&&r>u;u++)if(o[u]!==i[u])return a(o[u],i[u]);return u===n?a(e,i[u],-1):a(o[u],t,1)},[0,0].sort(k),E=!T,n.uniqueSort=function(e){var t,n=[],r=1,o=0;if(T=E,e.sort(k),T){for(;t=e[r];r++)t===e[r-1]&&(o=n.push(r));for(;o--;)e.splice(n[o],1)}return e},n.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},_=n.compile=function(e,t){var n,r=[],o=[],i=W[N][e+" "];if(!i){for(t||(t=s(e)),n=t.length;n--;)i=f(t[n]),i[N]?r.push(i):o.push(i);i=W(e,d(o,r))}return i},j.querySelectorAll&&function(){var e,t=g,r=/'|\\/g,o=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],a=[":active"],l=R.matchesSelector||R.mozMatchesSelector||R.webkitMatchesSelector||R.oMatchesSelector||R.msMatchesSelector;lt(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||i.push("\\["+U+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),lt(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+U+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=RegExp(i.join("|")),g=function(e,n,o,a,l){if(!a&&!l&&!i.test(e)){var c,u,p=!0,f=N,d=n,h=9===n.nodeType&&e;if(1===n.nodeType&&"object"!==n.nodeName.toLowerCase()){for(c=s(e),(p=n.getAttribute("id"))?f=p.replace(r,"\\$&"):n.setAttribute("id",f),f="[id='"+f+"'] ",u=c.length;u--;)c[u]=f+c[u].join("");d=rt.test(e)&&n.parentNode||n,h=c.join(",")}if(h)try{return P.apply(o,I.call(d.querySelectorAll(h),0)),o}catch(g){}finally{p||n.removeAttribute("id")}}return t(e,n,o,a,l)},l&&(lt(function(t){e=l.call(t,"div");try{l.call(t,"[test!='']:sizzle"),a.push("!=",V)}catch(n){}}),a=RegExp(a.join("|")),n.matchesSelector=function(t,r){if(r=r.replace(o,"='$1']"),!w(t)&&!a.test(r)&&!i.test(r))try{var s=l.call(t,r);if(s||e||t.document&&11!==t.document.nodeType)return s}catch(c){}return n(r,null,null,[t]).length>0})}(),b.pseudos.nth=b.pseudos.eq,b.filters=m.prototype=b.pseudos,b.setFilters=new m,n.attr=Y.attr,Y.find=n,Y.expr=n.selectors,Y.expr[":"]=Y.expr.pseudos,Y.unique=n.uniqueSort,Y.text=n.getText,Y.isXMLDoc=n.isXML,Y.contains=n.contains}(e);var Mt=/Until$/,Ht=/^(?:parents|prev(?:Until|All))/,Pt=/^.[^:#\[\.,]*$/,It=Y.expr.match.needsContext,Dt={children:!0,contents:!0,next:!0,prev:!0};Y.fn.extend({find:function(e){var t,n,r,o,i,a,s=this;if("string"!=typeof e)return Y(e).filter(function(){for(t=0,n=s.length;n>t;t++)if(Y.contains(s[t],this))return!0});for(a=this.pushStack("","find",e),t=0,n=this.length;n>t;t++)if(r=a.length,Y.find(e,this[t],a),t>0)for(o=r;a.length>o;o++)for(i=0;r>i;i++)if(a[i]===a[o]){a.splice(o--,1);break}return a},has:function(e){var t,n=Y(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(Y.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(c(this,e,!1),"not",e)},filter:function(e){return this.pushStack(c(this,e,!0),"filter",e)},is:function(e){return!!e&&("string"==typeof e?It.test(e)?Y(e,this.context).index(this[0])>=0:Y.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,o=this.length,i=[],a=It.test(e)||"string"!=typeof e?Y(e,t||this.context):0;o>r;r++)for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:Y.find.matchesSelector(n,e)){i.push(n);break}n=n.parentNode}return i=i.length>1?Y.unique(i):i,this.pushStack(i,"closest",e)},index:function(e){return e?"string"==typeof e?Y.inArray(this[0],Y(e)):Y.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n="string"==typeof e?Y(e,t):Y.makeArray(e&&e.nodeType?[e]:e),r=Y.merge(this.get(),n);return this.pushStack(s(n[0])||s(r[0])?r:Y.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),Y.fn.andSelf=Y.fn.addBack,Y.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Y.dir(e,"parentNode")},parentsUntil:function(e,t,n){return Y.dir(e,"parentNode",n)},next:function(e){return l(e,"nextSibling")},prev:function(e){return l(e,"previousSibling")},nextAll:function(e){return Y.dir(e,"nextSibling")},prevAll:function(e){return Y.dir(e,"previousSibling")},nextUntil:function(e,t,n){return Y.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return Y.dir(e,"previousSibling",n)},siblings:function(e){return Y.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return Y.sibling(e.firstChild)},contents:function(e){return Y.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:Y.merge([],e.childNodes)}},function(e,t){Y.fn[e]=function(n,r){var o=Y.map(this,t,n);return Mt.test(e)||(r=n),r&&"string"==typeof r&&(o=Y.filter(r,o)),o=this.length>1&&!Dt[e]?Y.unique(o):o,this.length>1&&Ht.test(e)&&(o=o.reverse()),this.pushStack(o,e,X.call(arguments).join(","))}}),Y.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?Y.find.matchesSelector(t[0],e)?[t[0]]:[]:Y.find.matches(e,t)},dir:function(e,n,r){for(var o=[],i=e[n];i&&9!==i.nodeType&&(r===t||1!==i.nodeType||!Y(i).is(r));)1===i.nodeType&&o.push(i),i=i[n];return o},sibling:function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});var Lt="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Bt=/ jQuery\d+="(?:null|\d+)"/g,$t=/^\s+/,qt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Wt=/<([\w:]+)/,Ut=/
    ]","i"),Vt=/^(?:checkbox|radio)$/,Kt=/checked\s*(?:[^=]|=\s*.checked.)/i,Gt=/\/(java|ecma)script/i,Yt=/^\s*\s*$/g,Zt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"
    ","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},en=u($),tn=en.appendChild($.createElement("div"));Zt.optgroup=Zt.option,Zt.tbody=Zt.tfoot=Zt.colgroup=Zt.caption=Zt.thead,Zt.th=Zt.td,Y.support.htmlSerialize||(Zt._default=[1,"X
    ","
    "]),Y.fn.extend({text:function(e){return Y.access(this,function(e){return e===t?Y.text(this):this.empty().append((this[0]&&this[0].ownerDocument||$).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(Y.isFunction(e))return this.each(function(t){Y(this).wrapAll(e.call(this,t))});if(this[0]){var t=Y(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return Y.isFunction(e)?this.each(function(t){Y(this).wrapInner(e.call(this,t))}):this.each(function(){var t=Y(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=Y.isFunction(e);return this.each(function(n){Y(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){Y.nodeName(this,"body")||Y(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(e,this),"before",this.selector)}},after:function(){if(!s(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=Y.clean(arguments);return this.pushStack(Y.merge(this,e),"after",this.selector)}},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||Y.filter(e,[n]).length)&&(t||1!==n.nodeType||(Y.cleanData(n.getElementsByTagName("*")),Y.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)for(1===e.nodeType&&Y.cleanData(e.getElementsByTagName("*"));e.firstChild;)e.removeChild(e.firstChild);return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return Y.clone(this,e,t)})},html:function(e){return Y.access(this,function(e){var n=this[0]||{},r=0,o=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(Bt,""):t;if(!("string"!=typeof e||zt.test(e)||!Y.support.htmlSerialize&&Jt.test(e)||!Y.support.leadingWhitespace&&$t.test(e)||Zt[(Wt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(qt,"<$1>");try{for(;o>r;r++)n=this[r]||{},1===n.nodeType&&(Y.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(i){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return s(this[0])?this.length?this.pushStack(Y(Y.isFunction(e)?e():e),"replaceWith",e):this:Y.isFunction(e)?this.each(function(t){var n=Y(this),r=n.html();n.replaceWith(e.call(this,t,r))}):("string"!=typeof e&&(e=Y(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;Y(this).remove(),t?Y(t).before(e):Y(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var o,i,a,s,l=0,c=e[0],u=[],f=this.length;if(!Y.support.checkClone&&f>1&&"string"==typeof c&&Kt.test(c))return this.each(function(){Y(this).domManip(e,n,r)});if(Y.isFunction(c))return this.each(function(o){var i=Y(this);e[0]=c.call(this,o,n?i.html():t),i.domManip(e,n,r)});if(this[0]){if(o=Y.buildFragment(e,this,u),a=o.fragment,i=a.firstChild,1===a.childNodes.length&&(a=i),i)for(n=n&&Y.nodeName(i,"tr"),s=o.cacheable||f-1;f>l;l++)r.call(n&&Y.nodeName(this[l],"table")?p(this[l],"tbody"):this[l],l===s?a:Y.clone(a,!0,!0));a=i=null,u.length&&Y.each(u,function(e,t){t.src?Y.ajax?Y.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):Y.error("no ajax"):Y.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Yt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),Y.buildFragment=function(e,n,r){var o,i,a,s=e[0];return n=n||$,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,!(1===e.length&&"string"==typeof s&&512>s.length&&n===$&&"<"===s.charAt(0))||Xt.test(s)||!Y.support.checkClone&&Kt.test(s)||!Y.support.html5Clone&&Jt.test(s)||(i=!0,o=Y.fragments[s],a=o!==t),o||(o=n.createDocumentFragment(),Y.clean(e,n,o,r),i&&(Y.fragments[s]=a&&o)),{fragment:o,cacheable:i}},Y.fragments={},Y.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){Y.fn[e]=function(n){var r,o=0,i=[],a=Y(n),s=a.length,l=1===this.length&&this[0].parentNode;if((null==l||l&&11===l.nodeType&&1===l.childNodes.length)&&1===s)return a[t](this[0]),this;for(;s>o;o++)r=(o>0?this.clone(!0):this).get(),Y(a[o])[t](r),i=i.concat(r);return this.pushStack(i,e,a.selector)}}),Y.extend({clone:function(e,t,n){var r,o,i,a;if(Y.support.html5Clone||Y.isXMLDoc(e)||!Jt.test("<"+e.nodeName+">")?a=e.cloneNode(!0):(tn.innerHTML=e.outerHTML,tn.removeChild(a=tn.firstChild)),!(Y.support.noCloneEvent&&Y.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||Y.isXMLDoc(e)))for(d(e,a),r=h(e),o=h(a),i=0;r[i];++i)o[i]&&d(r[i],o[i]);if(t&&(f(e,a),n))for(r=h(e),o=h(a),i=0;r[i];++i)f(r[i],o[i]);return r=o=null,a},clean:function(e,n,r,o){var i,a,s,l,c,p,f,d,h,m,y,v=n===$&&en,b=[];for(n&&n.createDocumentFragment!==t||(n=$),i=0;null!=(s=e[i]);i++)if("number"==typeof s&&(s+=""),s){if("string"==typeof s)if(Qt.test(s)){for(v=v||u(n),f=n.createElement("div"),v.appendChild(f),s=s.replace(qt,"<$1>"),l=(Wt.exec(s)||["",""])[1].toLowerCase(),c=Zt[l]||Zt._default,p=c[0],f.innerHTML=c[1]+s+c[2];p--;)f=f.lastChild;if(!Y.support.tbody)for(d=Ut.test(s),h="table"!==l||d?""!==c[1]||d?[]:f.childNodes:f.firstChild&&f.firstChild.childNodes,a=h.length-1;a>=0;--a)Y.nodeName(h[a],"tbody")&&!h[a].childNodes.length&&h[a].parentNode.removeChild(h[a]);!Y.support.leadingWhitespace&&$t.test(s)&&f.insertBefore(n.createTextNode($t.exec(s)[0]),f.firstChild),s=f.childNodes,f.parentNode.removeChild(f)}else s=n.createTextNode(s);s.nodeType?b.push(s):Y.merge(b,s)}if(f&&(s=f=v=null),!Y.support.appendChecked)for(i=0;null!=(s=b[i]);i++)Y.nodeName(s,"input")?g(s):s.getElementsByTagName!==t&&Y.grep(s.getElementsByTagName("input"),g);if(r)for(m=function(e){return!e.type||Gt.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):r.appendChild(e):t},i=0;null!=(s=b[i]);i++)Y.nodeName(s,"script")&&m(s)||(r.appendChild(s),s.getElementsByTagName!==t&&(y=Y.grep(Y.merge([],s.getElementsByTagName("script")),m),b.splice.apply(b,[i+1,0].concat(y)),i+=y.length));return b},cleanData:function(e,t){for(var n,r,o,i,a=0,s=Y.expando,l=Y.cache,c=Y.support.deleteExpando,u=Y.event.special;null!=(o=e[a]);a++)if((t||Y.acceptData(o))&&(r=o[s],n=r&&l[r])){if(n.events)for(i in n.events)u[i]?Y.event.remove(o,i):Y.removeEvent(o,i,n.handle);l[r]&&(delete l[r],c?delete o[s]:o.removeAttribute?o.removeAttribute(s):o[s]=null,Y.deletedIds.push(r))}}}),function(){var e,t;Y.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=Y.uaMatch(W.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),Y.browser=t,Y.sub=function(){function e(t,n){return new e.fn.init(t,n)}Y.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(n,r){return r&&r instanceof Y&&!(r instanceof e)&&(r=e(r)),Y.fn.init.call(this,n,r,t)},e.fn.init.prototype=e.fn;var t=e($);return e}}();var nn,rn,on,an=/alpha\([^)]*\)/i,sn=/opacity=([^)]*)/,ln=/^(top|right|bottom|left)$/,cn=/^(none|table(?!-c[ea]).+)/,un=/^margin/,pn=RegExp("^("+Z+")(.*)$","i"),fn=RegExp("^("+Z+")(?!px)[a-z%]+$","i"),dn=RegExp("^([-+])=("+Z+")","i"),hn={BODY:"block"},gn={position:"absolute",visibility:"hidden",display:"block"},mn={letterSpacing:0,fontWeight:400},yn=["Top","Right","Bottom","Left"],vn=["Webkit","O","Moz","ms"],bn=Y.fn.toggle;Y.fn.extend({css:function(e,n){return Y.access(this,function(e,n,r){return r!==t?Y.style(e,n,r):Y.css(e,n)},e,n,arguments.length>1)},show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e,t){var n="boolean"==typeof e;return Y.isFunction(e)&&Y.isFunction(t)?bn.apply(this,arguments):this.each(function(){(n?e:y(this))?Y(this).show():Y(this).hide()})}}),Y.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=nn(e,"opacity");return""===n?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":Y.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,o){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,a,s,l=Y.camelCase(n),c=e.style;if(n=Y.cssProps[l]||(Y.cssProps[l]=m(c,l)),s=Y.cssHooks[n]||Y.cssHooks[l],r===t)return s&&"get"in s&&(i=s.get(e,!1,o))!==t?i:c[n];if(a=typeof r,"string"===a&&(i=dn.exec(r))&&(r=(i[1]+1)*i[2]+parseFloat(Y.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||Y.cssNumber[l]||(r+="px"),s&&"set"in s&&(r=s.set(e,r,o))===t)))try{c[n]=r}catch(u){}}},css:function(e,n,r,o){var i,a,s,l=Y.camelCase(n);return n=Y.cssProps[l]||(Y.cssProps[l]=m(e.style,l)),s=Y.cssHooks[n]||Y.cssHooks[l],s&&"get"in s&&(i=s.get(e,!0,o)),i===t&&(i=nn(e,n)),"normal"===i&&n in mn&&(i=mn[n]),r||o!==t?(a=parseFloat(i),r||Y.isNumeric(a)?a||0:i):i},swap:function(e,t,n){var r,o,i={};for(o in t)i[o]=e.style[o],e.style[o]=t[o];r=n.call(e);for(o in t)e.style[o]=i[o];return r}}),e.getComputedStyle?nn=function(t,n){var r,o,i,a,s=e.getComputedStyle(t,null),l=t.style;return s&&(r=s.getPropertyValue(n)||s[n],""!==r||Y.contains(t.ownerDocument,t)||(r=Y.style(t,n)),fn.test(r)&&un.test(n)&&(o=l.width,i=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=r,r=s.width,l.width=o,l.minWidth=i,l.maxWidth=a)),r}:$.documentElement.currentStyle&&(nn=function(e,t){var n,r,o=e.currentStyle&&e.currentStyle[t],i=e.style;return null==o&&i&&i[t]&&(o=i[t]),fn.test(o)&&!ln.test(t)&&(n=i.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),i.left="fontSize"===t?"1em":o,o=i.pixelLeft+"px",i.left=n,r&&(e.runtimeStyle.left=r)),""===o?"auto":o}),Y.each(["height","width"],function(e,n){Y.cssHooks[n]={get:function(e,r,o){return r?0===e.offsetWidth&&cn.test(nn(e,"display"))?Y.swap(e,gn,function(){return w(e,n,o)}):w(e,n,o):t},set:function(e,t,r){return b(e,t,r?x(e,n,r,Y.support.boxSizing&&"border-box"===Y.css(e,"boxSizing")):0)}}}),Y.support.opacity||(Y.cssHooks.opacity={get:function(e,t){return sn.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,o=Y.isNumeric(t)?"alpha(opacity="+100*t+")":"",i=r&&r.filter||n.filter||"";n.zoom=1,t>=1&&""===Y.trim(i.replace(an,""))&&n.removeAttribute&&(n.removeAttribute("filter"),r&&!r.filter)||(n.filter=an.test(i)?i.replace(an,o):i+" "+o)}}),Y(function(){Y.support.reliableMarginRight||(Y.cssHooks.marginRight={get:function(e,n){return Y.swap(e,{display:"inline-block"},function(){return n?nn(e,"marginRight"):t})}}),!Y.support.pixelPosition&&Y.fn.position&&Y.each(["top","left"],function(e,t){Y.cssHooks[t]={get:function(e,n){if(n){var r=nn(e,t);return fn.test(r)?Y(e).position()[t]+"px":r}}}})}),Y.expr&&Y.expr.filters&&(Y.expr.filters.hidden=function(e){return 0===e.offsetWidth&&0===e.offsetHeight||!Y.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||nn(e,"display"))},Y.expr.filters.visible=function(e){return!Y.expr.filters.hidden(e)}),Y.each({margin:"",padding:"",border:"Width"},function(e,t){Y.cssHooks[e+t]={expand:function(n){var r,o="string"==typeof n?n.split(" "):[n],i={};for(r=0;4>r;r++)i[e+yn[r]+t]=o[r]||o[r-2]||o[0];return i}},un.test(e)||(Y.cssHooks[e+t].set=b)});var xn=/%20/g,wn=/\[\]$/,Cn=/\r?\n/g,_n=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,kn=/^(?:select|textarea)/i; +Y.fn.extend({serialize:function(){return Y.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?Y.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||kn.test(this.nodeName)||_n.test(this.type))}).map(function(e,t){var n=Y(this).val();return null==n?null:Y.isArray(n)?Y.map(n,function(e){return{name:t.name,value:e.replace(Cn,"\r\n")}}):{name:t.name,value:n.replace(Cn,"\r\n")}}).get()}}),Y.param=function(e,n){var r,o=[],i=function(e,t){t=Y.isFunction(t)?t():null==t?"":t,o[o.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=Y.ajaxSettings&&Y.ajaxSettings.traditional),Y.isArray(e)||e.jquery&&!Y.isPlainObject(e))Y.each(e,function(){i(this.name,this.value)});else for(r in e)_(r,e[r],n,i);return o.join("&").replace(xn,"+")};var Tn,An,En=/#.*$/,Fn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,Sn=/^(?:GET|HEAD)$/,jn=/^\/\//,Rn=/\?/,On=/)<[^<]*)*<\/script>/gi,Mn=/([?&])_=[^&]*/,Hn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Pn=Y.fn.load,In={},Dn={},Ln=["*/"]+["*"];try{An=q.href}catch(Bn){An=$.createElement("a"),An.href="",An=An.href}Tn=Hn.exec(An.toLowerCase())||[],Y.fn.load=function(e,n,r){if("string"!=typeof e&&Pn)return Pn.apply(this,arguments);if(!this.length)return this;var o,i,a,s=this,l=e.indexOf(" ");return l>=0&&(o=e.slice(l,e.length),e=e.slice(0,l)),Y.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(i="POST"),Y.ajax({url:e,type:i,dataType:"html",data:n,complete:function(e,t){r&&s.each(r,a||[e.responseText,t,e])}}).done(function(e){a=arguments,s.html(o?Y("
    ").append(e.replace(On,"")).find(o):e)}),this},Y.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){Y.fn[t]=function(e){return this.on(t,e)}}),Y.each(["get","post"],function(e,n){Y[n]=function(e,r,o,i){return Y.isFunction(r)&&(i=i||o,o=r,r=t),Y.ajax({type:n,url:e,data:r,success:o,dataType:i})}}),Y.extend({getScript:function(e,n){return Y.get(e,t,n,"script")},getJSON:function(e,t,n){return Y.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?A(e,Y.ajaxSettings):(t=e,e=Y.ajaxSettings),A(e,t),e},ajaxSettings:{url:An,isLocal:Nn.test(Tn[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Ln},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":Y.parseJSON,"text xml":Y.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:k(In),ajaxTransport:k(Dn),ajax:function(e,n){function r(e,n,r,a){var c,p,v,b,w,_=n;2!==x&&(x=2,l&&clearTimeout(l),s=t,i=a||"",C.readyState=e>0?4:0,r&&(b=E(f,C,r)),e>=200&&300>e||304===e?(f.ifModified&&(w=C.getResponseHeader("Last-Modified"),w&&(Y.lastModified[o]=w),w=C.getResponseHeader("Etag"),w&&(Y.etag[o]=w)),304===e?(_="notmodified",c=!0):(c=F(f,b),_=c.state,p=c.data,v=c.error,c=!v)):(v=_,(!_||e)&&(_="error",0>e&&(e=0))),C.status=e,C.statusText=(n||_)+"",c?g.resolveWith(d,[p,_,C]):g.rejectWith(d,[C,_,v]),C.statusCode(y),y=t,u&&h.trigger("ajax"+(c?"Success":"Error"),[C,f,c?p:v]),m.fireWith(d,[C,_]),u&&(h.trigger("ajaxComplete",[C,f]),--Y.active||Y.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var o,i,a,s,l,c,u,p,f=Y.ajaxSetup({},n),d=f.context||f,h=d!==f&&(d.nodeType||d instanceof Y)?Y(d):Y.event,g=Y.Deferred(),m=Y.Callbacks("once memory"),y=f.statusCode||{},v={},b={},x=0,w="canceled",C={readyState:0,setRequestHeader:function(e,t){if(!x){var n=e.toLowerCase();e=b[n]=b[n]||e,v[e]=t}return this},getAllResponseHeaders:function(){return 2===x?i:null},getResponseHeader:function(e){var n;if(2===x){if(!a)for(a={};n=Fn.exec(i);)a[n[1].toLowerCase()]=n[2];n=a[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return x||(f.mimeType=e),this},abort:function(e){return e=e||w,s&&s.abort(e),r(0,e),this}};if(g.promise(C),C.success=C.done,C.error=C.fail,C.complete=m.add,C.statusCode=function(e){if(e){var t;if(2>x)for(t in e)y[t]=[y[t],e[t]];else t=e[C.status],C.always(t)}return this},f.url=((e||f.url)+"").replace(En,"").replace(jn,Tn[1]+"//"),f.dataTypes=Y.trim(f.dataType||"*").toLowerCase().split(tt),null==f.crossDomain&&(c=Hn.exec(f.url.toLowerCase()),f.crossDomain=!(!c||c[1]===Tn[1]&&c[2]===Tn[2]&&(c[3]||("http:"===c[1]?80:443))==(Tn[3]||("http:"===Tn[1]?80:443)))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Y.param(f.data,f.traditional)),T(In,f,n,C),2===x)return C;if(u=f.global,f.type=f.type.toUpperCase(),f.hasContent=!Sn.test(f.type),u&&0===Y.active++&&Y.event.trigger("ajaxStart"),!f.hasContent&&(f.data&&(f.url+=(Rn.test(f.url)?"&":"?")+f.data,delete f.data),o=f.url,f.cache===!1)){var _=Y.now(),k=f.url.replace(Mn,"$1_="+_);f.url=k+(k===f.url?(Rn.test(f.url)?"&":"?")+"_="+_:"")}(f.data&&f.hasContent&&f.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",f.contentType),f.ifModified&&(o=o||f.url,Y.lastModified[o]&&C.setRequestHeader("If-Modified-Since",Y.lastModified[o]),Y.etag[o]&&C.setRequestHeader("If-None-Match",Y.etag[o])),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ln+"; q=0.01":""):f.accepts["*"]);for(p in f.headers)C.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(f.beforeSend.call(d,C,f)===!1||2===x))return C.abort();w="abort";for(p in{success:1,error:1,complete:1})C[p](f[p]);if(s=T(Dn,f,n,C)){C.readyState=1,u&&h.trigger("ajaxSend",[C,f]),f.async&&f.timeout>0&&(l=setTimeout(function(){C.abort("timeout")},f.timeout));try{x=1,s.send(v,r)}catch(A){if(!(2>x))throw A;r(-1,A)}}else r(-1,"No Transport");return C},active:0,lastModified:{},etag:{}});var $n=[],qn=/\?/,Wn=/(=)\?(?=&|$)|\?\?/,Un=Y.now();Y.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=$n.pop()||Y.expando+"_"+Un++;return this[e]=!0,e}}),Y.ajaxPrefilter("json jsonp",function(n,r,o){var i,a,s,l=n.data,c=n.url,u=n.jsonp!==!1,p=u&&Wn.test(c),f=u&&!p&&"string"==typeof l&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wn.test(l);return"jsonp"===n.dataTypes[0]||p||f?(i=n.jsonpCallback=Y.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,a=e[i],p?n.url=c.replace(Wn,"$1"+i):f?n.data=l.replace(Wn,"$1"+i):u&&(n.url+=(qn.test(c)?"&":"?")+n.jsonp+"="+i),n.converters["script json"]=function(){return s||Y.error(i+" was not called"),s[0]},n.dataTypes[0]="json",e[i]=function(){s=arguments},o.always(function(){e[i]=a,n[i]&&(n.jsonpCallback=r.jsonpCallback,$n.push(i)),s&&Y.isFunction(a)&&a(s[0]),s=a=t}),"script"):t}),Y.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return Y.globalEval(e),e}}}),Y.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),Y.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=$.head||$.getElementsByTagName("head")[0]||$.documentElement;return{send:function(o,i){n=$.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,o){(o||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,o||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Qn,zn=e.ActiveXObject?function(){for(var e in Qn)Qn[e](0,1)}:!1,Xn=0;Y.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&N()||S()}:N,function(e){Y.extend(Y.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(Y.ajaxSettings.xhr()),Y.support.ajax&&Y.ajaxTransport(function(n){if(!n.crossDomain||Y.support.cors){var r;return{send:function(o,i){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");try{for(s in o)l.setRequestHeader(s,o[s])}catch(c){}l.send(n.hasContent&&n.data||null),r=function(e,o){var s,c,u,p,f;try{if(r&&(o||4===l.readyState))if(r=t,a&&(l.onreadystatechange=Y.noop,zn&&delete Qn[a]),o)4!==l.readyState&&l.abort();else{s=l.status,u=l.getAllResponseHeaders(),p={},f=l.responseXML,f&&f.documentElement&&(p.xml=f);try{p.text=l.responseText}catch(d){}try{c=l.statusText}catch(d){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(h){o||i(-1,h)}p&&i(s,c,p,u)},n.async?4===l.readyState?setTimeout(r,0):(a=++Xn,zn&&(Qn||(Qn={},Y(e).unload(zn)),Qn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var Jn,Vn,Kn=/^(?:toggle|show|hide)$/,Gn=RegExp("^(?:([-+])=|)("+Z+")([a-z%]*)$","i"),Yn=/queueHooks$/,Zn=[H],er={"*":[function(e,t){var n,r,o=this.createTween(e,t),i=Gn.exec(t),a=o.cur(),s=+a||0,l=1,c=20;if(i){if(n=+i[2],r=i[3]||(Y.cssNumber[e]?"":"px"),"px"!==r&&s){s=Y.css(o.elem,e,!0)||n||1;do l=l||".5",s/=l,Y.style(o.elem,e,s+r);while(l!==(l=o.cur()/a)&&1!==l&&--c)}o.unit=r,o.start=s,o.end=i[1]?s+(i[1]+1)*n:n}return o}]};Y.Animation=Y.extend(O,{tweener:function(e,t){Y.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,o=e.length;o>r;r++)n=e[r],er[n]=er[n]||[],er[n].unshift(t)},prefilter:function(e,t){t?Zn.unshift(e):Zn.push(e)}}),Y.Tween=P,P.prototype={constructor:P,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(Y.cssNumber[n]?"":"px")},cur:function(){var e=P.propHooks[this.prop];return e&&e.get?e.get(this):P.propHooks._default.get(this)},run:function(e){var t,n=P.propHooks[this.prop];return this.pos=t=this.options.duration?Y.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):P.propHooks._default.set(this),this}},P.prototype.init.prototype=P.prototype,P.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=Y.css(e.elem,e.prop,!1,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){Y.fx.step[e.prop]?Y.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[Y.cssProps[e.prop]]||Y.cssHooks[e.prop])?Y.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},P.propHooks.scrollTop=P.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},Y.each(["toggle","show","hide"],function(e,t){var n=Y.fn[t];Y.fn[t]=function(r,o,i){return null==r||"boolean"==typeof r||!e&&Y.isFunction(r)&&Y.isFunction(o)?n.apply(this,arguments):this.animate(I(t,!0),r,o,i)}}),Y.fn.extend({fadeTo:function(e,t,n,r){return this.filter(y).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=Y.isEmptyObject(e),i=Y.speed(t,n,r),a=function(){var t=O(this,Y.extend({},e),i);o&&t.stop(!0)};return o||i.queue===!1?this.each(a):this.queue(i.queue,a)},stop:function(e,n,r){var o=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",i=Y.timers,a=Y._data(this);if(n)a[n]&&a[n].stop&&o(a[n]);else for(n in a)a[n]&&a[n].stop&&Yn.test(n)&&o(a[n]);for(n=i.length;n--;)i[n].elem!==this||null!=e&&i[n].queue!==e||(i[n].anim.stop(r),t=!1,i.splice(n,1));(t||!r)&&Y.dequeue(this,e)})}}),Y.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){Y.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),Y.speed=function(e,t,n){var r=e&&"object"==typeof e?Y.extend({},e):{complete:n||!n&&t||Y.isFunction(e)&&e,duration:e,easing:n&&t||t&&!Y.isFunction(t)&&t};return r.duration=Y.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Y.fx.speeds?Y.fx.speeds[r.duration]:Y.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Y.isFunction(r.old)&&r.old.call(this),r.queue&&Y.dequeue(this,r.queue)},r},Y.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},Y.timers=[],Y.fx=P.prototype.init,Y.fx.tick=function(){var e,n=Y.timers,r=0;for(Jn=Y.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||Y.fx.stop(),Jn=t},Y.fx.timer=function(e){e()&&Y.timers.push(e)&&!Vn&&(Vn=setInterval(Y.fx.tick,Y.fx.interval))},Y.fx.interval=13,Y.fx.stop=function(){clearInterval(Vn),Vn=null},Y.fx.speeds={slow:600,fast:200,_default:400},Y.fx.step={},Y.expr&&Y.expr.filters&&(Y.expr.filters.animated=function(e){return Y.grep(Y.timers,function(t){return e===t.elem}).length});var tr=/^(?:body|html)$/i;Y.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){Y.offset.setOffset(this,e,t)});var n,r,o,i,a,s,l,c={top:0,left:0},u=this[0],p=u&&u.ownerDocument;if(p)return(r=p.body)===u?Y.offset.bodyOffset(u):(n=p.documentElement,Y.contains(n,u)?(u.getBoundingClientRect!==t&&(c=u.getBoundingClientRect()),o=D(p),i=n.clientTop||r.clientTop||0,a=n.clientLeft||r.clientLeft||0,s=o.pageYOffset||n.scrollTop,l=o.pageXOffset||n.scrollLeft,{top:c.top+s-i,left:c.left+l-a}):c)},Y.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return Y.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(Y.css(e,"marginTop"))||0,n+=parseFloat(Y.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=Y.css(e,"position");"static"===r&&(e.style.position="relative");var o,i,a=Y(e),s=a.offset(),l=Y.css(e,"top"),c=Y.css(e,"left"),u=("absolute"===r||"fixed"===r)&&Y.inArray("auto",[l,c])>-1,p={},f={};u?(f=a.position(),o=f.top,i=f.left):(o=parseFloat(l)||0,i=parseFloat(c)||0),Y.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(p.top=t.top-s.top+o),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):a.css(p)}},Y.fn.extend({position:function(){if(this[0]){var e=this[0],t=this.offsetParent(),n=this.offset(),r=tr.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(Y.css(e,"marginTop"))||0,n.left-=parseFloat(Y.css(e,"marginLeft"))||0,r.top+=parseFloat(Y.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(Y.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||$.body;e&&!tr.test(e.nodeName)&&"static"===Y.css(e,"position");)e=e.offsetParent;return e||$.body})}}),Y.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);Y.fn[e]=function(o){return Y.access(this,function(e,o,i){var a=D(e);return i===t?a?n in a?a[n]:a.document.documentElement[o]:e[o]:(a?a.scrollTo(r?Y(a).scrollLeft():i,r?i:Y(a).scrollTop()):e[o]=i,t)},e,o,arguments.length,null)}}),Y.each({Height:"height",Width:"width"},function(e,n){Y.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,o){Y.fn[o]=function(o,i){var a=arguments.length&&(r||"boolean"!=typeof o),s=r||(o===!0||i===!0?"margin":"border");return Y.access(this,function(n,r,o){var i;return Y.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(i=n.documentElement,Math.max(n.body["scroll"+e],i["scroll"+e],n.body["offset"+e],i["offset"+e],i["client"+e])):o===t?Y.css(n,r,o,s):Y.style(n,r,o,s)},n,a?o:t,a,null)}})}),e.jQuery=e.$=Y,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return Y})}(window),/*! ========================================================= * bootstrap-modal.js v2.2.2 * http://twitter.github.com/bootstrap/javascript.html#modals * ========================================================= @@ -64,7 +64,7 @@ return f}},jc.test(a)||($.cssHooks[a+b].set=t)});var tc=/%20/g,uc=/\[\]$/,vc=/\r * implied. See the License for the specific language governing permissions and limitations under the License. * * ========================================================= */ -!function(a){"use strict";var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this,c=a.Event("show");this.$element.trigger(c),this.isShown||c.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var c=a.support.transition&&b.$element.hasClass("fade");b.$element.parent().length||b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in").attr("aria-hidden",!1),b.enforceFocus(),c?b.$element.one(a.support.transition.end,function(){b.$element.focus().trigger("shown")}):b.$element.focus().trigger("shown")}))},hide:function(b){b&&b.preventDefault(),b=a.Event("hide"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),a(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),a.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var b=this;a(document).on("focusin.modal",function(a){b.$element[0]===a.target||b.$element.has(a.target).length||b.$element.focus()})},escape:function(){var a=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(b){27==b.which&&a.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),b.hideModal()},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),b.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(b){var c=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var d=a.support.transition&&c;this.$backdrop=a(' @@ -94,19 +93,19 @@
    - + @@ -119,13 +118,13 @@ -
    -
    +
    +

    App Development

    -You've come to the right place if you want to start building F2 apps. Before continuing, make sure you've cloned the F2 repository on GitHub or downloaded the latest framework build (v1.1.2). Secondly, read about the F2 Framework. There are a few important concepts to help you better understand apps, containers and context. +You've come to the right place if you want to start building F2 apps. Before continuing, make sure you've cloned the F2 repository on GitHub or downloaded the latest framework build (v1.2.0). Secondly, read about the F2 Framework. There are a few important concepts to help you better understand apps, containers and context.

    F2 apps are synonymous with modules, widgets and portlets. Think charts, portfolios, trade tickets, and screeners. F2 apps only need to be programmed once, no matter where they will be used. To start, F2 Apps are either:

    @@ -624,7 +623,7 @@

    Container-to-App Context

    F2.Events.on(
         F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, 
         function(data){
    -        F2.log("The symbol was changed to " + data.symbol);
    +        F2.log("The symbol was changed to " + data.symbol);
         }
     );

    The F2.Events.on() method accepts the event name and listener function as arguments. Read the SDK for more information.

    @@ -667,7 +666,7 @@

    App-to-Container Context

    F2.Events.on(
         F2.Constants.Events.APP_SYMBOL_CHANGE, 
         function(data){
    -        F2.log("The symbol was changed to " + data.symbol);
    +        F2.log("The symbol was changed to " + data.symbol);
         }
     );

    Note For a full list of support event types, browse to the SDK for F2.Constants.Events.

    @@ -690,8 +689,8 @@

    App-to-App Context

    F2.Events.on(
         "buy_stock", 
         function(data){
    -        if (data.isAvailableToPurchase){
    -            F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
    +        if (data.isAvailableToPurchase){
    +            F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
             } else {
                 F2.log("This stock is not available for purchase.")
             }
    @@ -743,7 +742,7 @@ 

    More Complex Context

    F2.Events.on(
         "buy_stock", 
         function(data){
    -        F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
    +        F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
             //..populate the trade ticket...
             //fire the callback
             if (typeof data.callback === 'function'){
    @@ -793,8 +792,7 @@ 

    Testing Your App

    If you open ~/F2/examples/container/js/sampleApps.js in your text editor, you'll find a list of sample F2 apps broken down by programming language. Simply modify this file to your liking and add your app anywhere in the appropriate array (JavaScript, PHP or C#). The configuration is comprised of F2.AppConfig properties, and the following are the minimum required properties.

    {
         appId: "com_companyName_appName",
    -    manifestUrl: "http://www.domain.com/manifest.js",
    -    name: "App name"
    +    manifestUrl: "http://www.domain.com/manifest.js"
     }

    For full details on these F2.AppConfig properties and all the others, browse the F2.js SDK documentation.


    @@ -842,7 +840,7 @@

    Showing or Hiding Loading Spinners

    }).done(function(jqxhr){ F2.log(jqxhr); //hide loading - this.ui.hideMask(this.root); + this.ui.hideMask(this.root); }); ...

    The showMask() method takes two arguments: a DOM element where to show the mask and a boolean indicating whether or not to show a spinning graphic.

    @@ -918,7 +916,7 @@

    Setting Up Views

    Controlling View State

    The F2.UI namespace provides an API for developers to manage F2 app View state.

    To programmatically change a View in javascript:

    -
    appConfig.ui.Views.change(F2.Constants.Views.HOME);
    +
    appConfig.ui.Views.change(F2.Constants.Views.HOME);

    Note When appConfig.ui.Views.change() is called, the hide classname is automatically added or removed by F2.js depending on the visibility of the view. Read more in the SDK docs.

    In F2 app HTML, you can use a combination of CSS classnames and data- attributes to provide UI elements making it easy for users to navigate between Views.

    For example, an app has two views: "home" and "about". On the "home" View, a button allows the user to navigate to the "about" view. In the presence of the classname f2-app-view-trigger and the data-f2-view data attribute, F2.js automatically adds a javascript event to the button.

    @@ -975,8 +973,8 @@

    Considerations


    @@ -984,8 +982,7 @@

    Considerations

    - - - + + \ No newline at end of file diff --git a/docs/container-development.html b/docs/container-development.html index 68455cad..f3d238a0 100644 --- a/docs/container-development.html +++ b/docs/container-development.html @@ -3,10 +3,9 @@ F2 - Container Development - - + - + @@ -17,7 +16,7 @@ - + @@ -26,7 +25,7 @@ - +
    @@ -94,19 +93,19 @@
    - + @@ -119,102 +118,71 @@
    -
    -
    +
    +

    Container Development

    -You've come to the right place if you want to start building F2 containers. Before continuing, make sure you've cloned the F2 repository on GitHub or downloaded the latest framework build (v1.1.2). Secondly, read about the F2 Framework. There are a few important concepts to help you better understand apps, containers and context. +The container is the foundation of any F2-enabled solution. By leveraging the F2.js SDK, Container Providers offer a consistent and reliable mechanism for all App Developers to load their apps on that container regardless of where it is hosted, who developed it, or what back-end stack it uses. You can read more about the framework, download the project on GitHub or get started below. The current version of F2 is 1.2.0.


    Get Started

    -

    To help you get started building an F2 container, browse through the resources below. To jump start your F2 container and app development, download the F2 template (which now includes a basic container) or follow the instructions below.

    +

    To help you get started building an F2 container, review the documentation and examples below. To jump start your F2 container or app development, download the F2 example container and apps.

    -Download Basic F2 Container Template +Download F2 Examples

    Basic Container

    -

    To begin, you do not need to build F2 as described in the readme on GitHub. Simply download Bootstrap and save a local copy of F2.js. Also ensure you're properly configured.

    +

    To begin, you do not need to build (or compile) F2 as described in the readme on GitHub. Simply download F2.js and Bootstrap, and ensure you're properly configured for continuing with the documentation.

    -Download F2.js Download Bootstrap +Download F2.js Download Bootstrap

    -

    Create your basic container HTML template:

    +

    Setup a basic container HTML template (or add F2.js to an existing website):

    <!DOCTYPE html>
    -<html>
         <head>
             <title>F2 Container</title>
             <link rel="stylesheet" href="/path/to/your/bootstrap.css">
         </head>
         <body>
    -        <div class="container">
    -            <div class="hero-unit">
    -                <h1>Hello F2</h1>
    -            </div>
    -            <div class="row"><!--apps go here--></div>
    -        </div>
    -        <!--include jQuery & Bootstrap-->
    -        <script src="http://code.jquery.com/jquery-latest.js"></script>
    -        <script src="/path/to/your/bootstrap.js"></script>
    -        <!--include F2.js-->
             <script src="/path/to/your/F2.js"></script>
    -        <!--init & register-->
    -        <script>
    -            (function(){
    -                //define AppConfigs
    -                var _appConfigs = [{
    -                    appId: "com_your_app_id",
    -                    description: "F2 app description",
    -                    name: "F2 App",
    -                    manifestUrl: "/path/to/your/manifest.js" //note the path to your manifest! 
    -                }];
    -                //Setup ContainerConfig
    -                F2.init({
    -                    beforeAppRender: function(app){
    -                        var appRoot = '<section class="well span12"></section>';
    -                        return $(appRoot).appendTo('div.row');
    -                    },
    -                    afterAppRender: function (app, html) {
    -                        //app.root is `appRoot` from beforeAppRender()
    -                        return $(app.root).append(html);
    -                    }
    -                }); 
    -                F2.registerApps(_appConfigs); //pass _appConfigs to initialize apps
    -            })();
    -        </script>
         </body>
     </html>
    -

    In developing a more advanced container, the HTML document's body element would contain additional markup and allow for specific positioning or placement of apps. Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the F2 design guidelines.

    -
    -
    -

    Basic App

    -

    Create your basic F2 app manifest and save it as /path/to/your/manifest.js using this code below. Note the path to this file should be specified in the manifestUrl property within the _appConfigs array in your basic container (shown above).

    -
    F2_jsonpCallback_com_your_app_id({
    -    "scripts": [],   
    -    "styles": [],   
    -    "apps": [{
    -        "data": {},
    -        "html": "<div><p>Hello, world. I'm an F2 app.</p></div>"
    -    }]
    -})
    -

    Note You can download the F2 container/app template instead of creating the basic app by hand.

    +

    Note In developing a more advanced container, the HTML document's body element would contain additional markup and allow for specific positioning or placement of apps. Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the F2 design guidelines.

    +
    +
    +

    Basic AppConfig

    +
    var _appConfig = {
    +    appId: 'com_openf2_examples_javascript_helloworld',
    +    manifestUrl: 'http://docs.openf2.org/demos/apps/JavaScript/HelloWorld/manifest.js'
    +};
    + 
    +$(function(){
    +    F2.init();
    +    F2.registerApps(_appConfig);
    +});
    +

    Note For more information about the AppConfig, read up on them in App Integration.

    Testing the Basics

    -

    Now with a basic container and a basic app, you can load your F2 container and expect to see:

    -
    -
    -
    +

    Now with a basic container and a basic app, combine these two for a working example. Press Result in this jsfiddle.

    + +

    In getting to this point, you've only scratched the surface of F2 containers and apps. Continue reading and understanding the F2 spec to build exactly the financial solutions that our customers want.

    Sample Apps and Container

    -

    Good news! In the project repo on GitHub, you will find a basic container along with a number of sample apps which demonstrate functionality far beyond the basic app above. Once you clone or download the project repository, open the sample container by pointing your browser at:

    -

    http://localhost/F2/examples/container/

    +

    Good news! In the project repo on GitHub, you will find a basic container along with a number of sample apps which demonstrate functionality far beyond the basic app above. Once you clone or download the project repository, open the sample container by pointing your browser at:

    +

    http://localhost/F2/examples/

    +

    These examples are also available in a separate archive if you don't want to download the entire repository.

    +

    +Download F2 Examples +

    +

    Configuration

    @@ -223,7 +191,7 @@

    Configuration

    To get started working with or developing apps, browse to the documentation for developing apps.

    Ready to start coding?

    -Developing F2 Containers F2.js SDK Reference +Developing F2 Containers F2.js SDK Reference


    @@ -235,21 +203,20 @@

    Container Design

    If App Developers embed URLs back to their own websites or to third party sites, URLs must be opened in a new window as to not interrupt the experience of someone using the container. If authentication is required on an App Developer's site, this can be accomplished with pass-through authentication using encrypted URLs as discussed in Single Sign On.

    Choices

    -

    In order to ensure that apps built using F2 are successful, they must be accessible. As such, F2 made choices for which open-source libraries and frameworks would be leveraged to reduce the level of effort across F2 adopters.

    +

    In order to ensure that containers built using F2 are successful, they must be accessible. As such, F2 made choices for which open-source libraries and frameworks would be leveraged to reduce the level of effort across F2 adopters.

    Read more about those choices in the Framework.

    -

    Ultimately, the responsibility of app design falls on either the Container or App Developer. In many cases, Container Developers will provide App Developers will visual designs, style guides or other assets required to ensure apps have the form and function for a given container. Container Developers may also provide CSS for App Developers to adhere to—which should be easy since F2 enforces a consistent HTML structure across all containers and apps.

    +

    Ultimately, the responsibility of app design falls on either the Container or App Developer or both. In many cases, Container Developers will provide App Developers will visual designs, style guides or other assets required to ensure apps have the form and function for a given container. Container Developers may also provide CSS for App Developers to adhere to—which should be easy since F2 enforces a consistent HTML structure across all containers and apps. In other cases, Container and App Developers may never know each other and it's important everyone strictly adheres to the guidelines set forth in this documentation.


    Developing F2 Containers

    -

    A container is a browser-based desktop-like application which brings F2 apps together onto a seamless user interface. It also can provide horsepower to its apps in the form of request-response web services or streaming data feeds.

    +

    A container is a browser-based web application which brings F2 apps together onto a seamless user interface. It can also provide data and user context to its apps in the form of request-response web services or streaming data feeds.

    Including the F2 SDK

    For a webpage to be considered an F2 container, it must first include the F2.js JavaScript SDK. This is as simple as downloading the F2 project from GitHub and adding a script tag to the page.

    -
    <script src="/path/to/your/container/f2.js"></script>
    -

    You will find a basic container in the project repo on GitHub along with a number of sample apps.

    -

    Once the script tag has been added, it is up to the Container Developer to configure and customize the container. The first step is getting a ContainerID.

    +
    <script src="/path/to/your/f2.js"></script>
    +

    You will find a basic container in the project repo on GitHub along with a number of sample apps. Once the script tag has been added, it is up to the Container Developer to configure and customize the container. The first step is getting a ContainerID.

    F2 ContainerID

    @@ -268,95 +235,406 @@

    F2 ContainerID

    Setting Up Your Project

    Once you have your ContainerID, start by setting up your container project. You will need at least one configuration in addition to an HTML page: the app configs. (In the GitHub repository, an example is found in /examples/container/js/sampleApps.js.) This doesn't need to be a static javascript file like sampleApps.js but the structure and format of the app configs is important.

    -
    -

    App Configs

    -

    An F2 Container Provider must deliver the app configs to its container before calling F2.init(). The app configurations are represented quite simply as a list of AppConfig objects. These could be stored in a JavaScript array or in an enterprise-class database. AppConfig objects contain app meta data provided by the App Developer when he creates his app in the Developer Center.

    -

    Example AppConfig object from an individual app:

    +
    +

    Container Config

    +

    The F2.js JavaScript SDK provides an API for providers to configure their containers. Every container must be setup using ContainerConfig and the methods available, however if the F2 defaults are acceptable, the ContainerConfig is not required.

    +

    To initialize a container using F2 defaults, call this function:

    +
    F2.init();
    +

    To initialize a container with a ContainerConfig, use:

    +
    F2.init({
    +    UI: {},
    +    xhr: function(){},
    +    supportedViews: []  
    +});
    +

    Review all of the ContainerConfig properties in the reference documentation.

    +

    To see a more detailed example of F2.init(), look at the sample container javascript in the F2 repo on GitHub.

    +
    +

    AppRender, BeforeAppRender, AfterAppRender

    +

    The appRender(), beforeAppRender(), and afterAppRender() methods were deprecated in F2 version 1.2 in favor of F2.AppHandlers. Upgrading to F2 1.2 will not break existing containers using any of these methods as they are still present in the SDK.

    +

    For more information, see AppHandlers for App Layout.

    +
    +
    +

    Setting Up a Loading GIF

    +

    Container Developers have the opportunity to customize some user interface (UI) elements which propagate to the App Developers' toolkit in F2.js. One of those is F2.UI.Mask. The Mask object contains configuration defaults for the F2.UI.showMask() and F2.UI.hideMask() methods.

    +

    An example of setting the mask in F2.init():

    +
    F2.init({
    +    UI:{
    +        Mask:{
    +            loadingIcon:'./img/spinner.gif',
    +            backgroundColor: '#fff',
    +            opacity: 0.5
    +        }
    +    }
    +});
    +

    Included in the F2.UI.Mask configuration object are the following properties: backgroundColor, loadingIcon, opacity, useClasses, and zIndex. Each of these F2.UI.Mask properties is detailed in the F2.js SDK docs.

    +

    For more information on F2.UI, browse to the F2.js SDK docs.

    +
    +
    +

    Override the AppManifest Request

    +

    Occasionally Container Developers need more granular control over the AppManifest request mechanism in F2.js. The manifest request process—intentionally obscured from developers through the F2.registerApps() API—is handled by a simple ajax call to an HTTP endpoint. (F2 relies on jQuery.ajax() for this.) In version 1.2.0 of F2, the AppManifest request can be overridden in the Container Config.

    +

    Note The AppManifest endpoint is configured in the manifestUrl property within each AppConfig.

    +

    The following example demonstrates how the xhr property of the ContainerConfig is used to override F2.js.

    +
    F2.init({
    +    xhr: function(url, appConfigs, success, error, complete) {
    +        $.ajax({
    +            url: url,
    +            type: 'POST',
    +            data: {
    +                params: F2.stringify(appConfigs, F2.appConfigReplacer)
    +            },
    +            jsonp: false, // do not put 'callback=' in the query string
    +            jsonpCallback: F2.Constants.JSONP_CALLBACK + appConfigs[0].appId, // Unique function name
    +            dataType: 'json',
    +            success: function(appManifest) {
    +                // custom success logic
    +                success(appManifest); // fire success callback
    +            },
    +            error: function() {
    +                // custom error logic
    +                error(); // fire error callback
    +            },
    +            complete: function() {
    +                // custom complete logic
    +                complete(); // fire complete callback
    +            }
    +        });
    +    }
    +});
    +
    +
    +

    Extending XHR

    +

    The F2.ContainerConfig.xhr property has two additional customizable properties available: dataType and type.

    +
    +
    DataType
    +

    The dataType property allows the container to override the request data type (JSON or JSONP) that is used for the request. Using JSON as a dataType is only available for F2 apps running on the same domain as the container.

    +
    F2.init({
    +    xhr: {
    +        dataType: function(url) {
    +            return F2.isLocalRequest(url) ? 'json' : 'jsonp';
    +        }
    +    }
    +});
    +
    +
    +
    Type
    +

    The type property allows the container to override the request method that is used (similar to the type parameter to jQuery.ajax()). Since HTTP POST is not supported on JSONP requests, using POST as a type is only available for F2 apps using JSON and are therefore running on the same base domain as the container.

    +
    F2.init({
    +    xhr: {
    +        type: function(url) {
    +            return F2.isLocalRequest(url) ? 'POST' : 'GET';
    +        }
    +    }
    +});
    +

    For more information on F2.ContainerConfig.xhr, browse to the F2.js SDK docs.

    +
    +
    +
    +

    Supported Views

    +

    F2 Container Developers should define which app views their container supports. This is set in the supportedViews property of the ContainerConfig using F2.Constants.Views.

    +
    F2.init({
    +    supportedViews: [F2.Constants.Views.HOME, F2.Constants.Views.SETTINGS, F2.Constants.Views.REMOVE]
    +});
    +

    Note Every F2 app has a home view (whether defined by the App Developer or not). This means if no views are provided by the App Developer, a home view is automatically added to appConfig.views during the app registration process inside F2.

    +
    +
    +

    Secure Apps

    +

    For information about how to configure secure apps (i.e., load 3rd party apps in an isolated iframe) on a container, read about Secure Apps.

    +
    +
    +

    Container Templates

    +

    If you're looking for sample container HTML template code, jump to the Get Started section.

    +
    +
    +
    +
    +
    +

    App Integration

    +

    There are two ways of integrating apps on a container: requesting apps on-demand (via HTTP) or by linking pre-loaded apps. Requesting apps on-demand when the container loads is the traditional way of integrating apps with F2. Incorporating apps which have been pre-fetched or are otherwise already on the container when it loads is an alternative method. The following sections describe both of these methods in detail.

    +

    The process of loading apps on a container occurs by using a method called F2.registerApps(). The Container Developer must call this method—which accepts two arguments: one required, one optional— after F2.init() is called. If this method isn't called, no apps can be loaded on the container.

    +

    The two arguments provided to registerApps() are an array of AppConfig objects and, optionally, an array of AppManifest objects. As F2.js parses each AppConfig, the apps are validated, hydrated with some additional properties, and saved in browser memory on the container. Regardless of where the container's AppConfig object is defined (hard-coded or via API), integrating apps is a simple process.

    +
    +

    AppConfigs

    +

    Before continuing, let's discuss the AppConfig. The container-provided app configurations are represented simply as an array of AppConfig objects. These could be configured statically or fetched from an F2 Registry API. AppConfig objects contain app meta data—including the manifestUrl—provided by the App Developer when an app is registered in the Developer Center.

    +

    An example AppConfig object from an individual app:

    {
         appId: "com_companyName_appName",
    -    description: "App description",
    -    height: 500,
         manifestUrl: "http://www.domain.com/manifest.js",
    -    name: "App name"
    +    name: "App name",
    +    context: {
    +        data: [1,2,3,4,5]
    +    }
     }
    -

    Example array of AppConfig objects for a collection of apps:

    -
    var _appConfigs = [
    +

    An example array of AppConfig objects for a collection of apps:

    +
    [
         {
             appId: "com_companyName_appName",
    -        description: "App description",
    -        height:500,
             manifestUrl: "http://www.domain.com/manifest.js",
    -        name: "App name"
    +        name: "App name",
    +        context: {
    +            data: [1,2,3,4,5]
    +        }
         },
         {
             appId: "com_companyName_appName2",
    -        description: "App2 description",
    -        height:100,
    -        manifestUrl: "http://www.domain2.com/manifest.js",
    -        name: "App2 name"
    +        manifestUrl: "http://www.domain.com/manifest2.js",
    +        name: "App2 name",
    +        context: {
    +            name: 'value'
    +        }
         },
         {
             appId: "com_companyName_appName3",
    -        description: "App3 description",
    -        height:200,
    -        manifestUrl: "http://www.domain3.com/manifest.js",
    -        name: "App3 name"
    -    }
    +        manifestUrl: "http://www.domain.com/manifest3.js",
    +        name: "App3 name",
    +        context: {
    +            status: 'ok'
    +        }
    +    },
     ];
    -
    -

    Container Config

    -

    The F2.js JavaScript SDK provides an API for providers to configure their containers. Every container must be setup using ContainerConfig and the methods available.

    -

    In the container's $(document).ready(), add the F2.init():

    -
    $(document).ready(function(){
    -    F2.init({
    -        //define ContainerConfig properties
    -        appRender: function(appConfig, html){ ... },
    -        beforeAppRender: function(appConfig, html){ ... },
    -        afterAppRender: function(appConfig){ ... }
    -    });
    +
    +

    Requesting Apps On-Demand

    +

    Requesting apps on-demand when the container loads is the traditional way of integrating apps with F2. For the purposes of this example, we will use an example news app from OpenF2.org.

    +

    Let's look at some container code.

    +
    +

    Static App Configuration

    +

    First, we define the AppConfig in a hard-coded _appConfig variable. This example demonstrates only a single app; if there were multiple apps, _appConfig would be an array of objects versus an object literal. Secondly, when the document is ready, F2.init() is called and subsequently F2.registerApps() with the single argument.

    + + +

    This javascript code will insert the example news app into the container's <body>. Press Result in the jsfiddle above to try this demo.

    +

    Note If more granular control is needed for app placement, use F2.AppHandlers functionality. Read about that in AppHandlers for App Layout.

    +
    +
    +

    Dynamic App Configuration

    +

    As an alternative to static app configuration shown above, the _appConfig variable could be assigned the result of an API call to the F2 Registry. The Registry API response is designed to match the structure of the AppConfig for passing the JSON straight through to F2 in your code. Whether your app configuration JSON comes from the F2 Registry or your own database is irrelevant; the process is identically the same as shown in this example.

    + + +

    About this jsfiddle To simulate an ajax request, this example uses jsfiddle's echo feature. Simply replace the getAppConfigs function with your own ajax request and ignore the echoData variable.

    +
    +
    +
    +

    Registering Pre-Loaded Apps

    +

    Incorporating apps which have been pre-loaded or are otherwise already on the container when it loads is an alternative method to integrating F2 apps. This method is useful when the container is being constructed on the server-side (at run-time or on a schedule) and F2 functionality is desired. To use pre-loaded apps, the Container Developer is required to make a request to each apps' AppManifest and its dependencies before the page is rendered.

    +

    For the following example, let's assume you have a web page composed on the server and all of its HTML is delivered to the browser in one payload. This page also has at least one widget (or component) you'd like to register with F2.js.

    +
    +

    1. Setup Container

    +

    To use pre-loaded apps, a web page with a placeholder element for the apps is required. This simple (and empty) web page features a div#news_app.span12 which serves as that placeholder or "root" element.

    +
    <!DOCTYPE html>
    +    <head>
    +        <title>F2 Container</title>
    +        <link rel="stylesheet" href="/path/to/your/bootstrap.css">
    +    </head>
    +    <body>
    +        <div class="container">
    +            <div class="row">
    +                <div class="span12" id="news_app">
    +                    <!--app goes here-->
    +                </div>
    +            </div>
    +        </div>
    +        <script src="/path/to/your/F2.js"></script>
    +    </body>
    +</html>
    +
    +
    +

    2. Request AppManifest

    +

    Next, make a server-side request to the news apps' AppManifest—the URL is found in manifestUrl—and capture the resulting JSON. Each AppManifest contains scripts, style sheets and HTML (more about the AppManifest). The market news apps' AppManifest looks like this:

    +
    {
    +   "apps":[{
    +         "data":{},
    +         "html": "<div data-module-name=\"MarketNewsApp\">...</div>",
    +    }],
    +   "scripts":[
    +      "http://www.openf2.org/js/main.js"
    +   ],
    +   "styles":[
    +      "http://www.openf2.org/css/site.css"
    +   ]
    +}
    +

    Note Parts of this AppManifest were intentionally removed for legibility, including the required JSONP function name (F2_jsonpCallback_com_openf2_examples_csharp_marketnews). The full AppManifest is available on OpenF2.org.

    +
    +
    +Performance Tip +
    + +Container Developers can use the AppConfig and pre-loaded AppManifest (from step 2 above) in conjunction with F2.registerApps() to speed up the loading of F2 containers. For more information, browse to Combining AppConfig and AppManifest. +
    + +
    +
    +

    3. Add App to Container

    +

    You're almost there. Next, embed the news app's html, scripts and styles. The F2 app is inserted into .row > .span12 following Bootstrap's scaffolding guidelines. The styles were appended to the head and the scripts were appended to the body (in this case just one URL for each).

    +
    <!DOCTYPE html>
    +    <head>
    +        <title>F2 Container</title>
    +        <link rel="stylesheet" href="/path/to/your/bootstrap.css">
    +        <link rel="stylesheet" href="http://www.openf2.org/css/site.css">
    +    </head>
    +    <body>
    +        <div class="container">
    +            <div class="row">
    +                <div class="span12" id="news_app">
    +                    <div data-module-name="MarketNewsApp" id="news_app">...</div>
    +                </div>
    +            </div>
    +        </div>
    +        <script src="/path/to/your/F2.js"></script>
    +        <script src="http://www.openf2.org/js/main.js"></script>
    +    </body>
    +</html>
    +

    The example news app is now part of the web page and everything should be functioning properly. The final step is to register the app with F2.

    +
    +
    +

    4. Assign Root Element to AppConfig

    +

    To use pre-loaded apps, an additional property is required on the AppConfig object. It is called root and can be either a CSS selector string or a DOM element. Regardless of type, F2 will parse the value of root and it must return an existing in-page DOM element. Furthermore, the value of root must represent a unique DOM element as each app needs its own containing, or root, element.

    +
    var _appConfig = {
    +    appId: 'com_openf2_examples_csharp_marketnews',
    +    description: 'Example News',
    +    manifestUrl: 'http://www.openf2.org/Examples/Apps',
    +    name: 'Example News',
    +    root: document.getElementById('news_app')
    +};
    +

    Both of these are valid values for the root property.

    +

    Using JavaScript:

    +
    {
    +    root: document.getElementById('news_app')
    +}
    +

    Using a CSS selector string:

    +
    {
    +    root: '#news_app'
    +}
    +

    F2.js uses jQuery internally to parse the value of the root property and, in turn, jQuery relies on the Sizzle javascript selector library. If a CSS selector string is assigned to root, it must be a valid CSS 3 selector supported by Sizzle. Refer to the Sizzle documentation for more details.

    +
    +
    +

    5. Register App

    +

    Since you started with the AppConfig and now have the AppManifest from step 2 along with an HTML page containing the embedded app, all that remains is a simple call to F2. Registering pre-loaded apps with F2.js means passing the ammended AppConfig as shown in the example below.

    +
    var _appConfig = {
    +    appId: 'com_openf2_examples_csharp_marketnews',
    +    description: 'Example News',
    +    manifestUrl: 'http://www.openf2.org/Examples/Apps',
    +    name: 'Example News',
    +    root: document.getElementById('news_app')
    +};
    +
    +$(function(){
    +    F2.init();
    +    F2.registerApps(_appConfig);
     });
    -

    To see an more detailed example of F2.init(), look at the sample container javascript file in the F2 repo on GitHub.

    -
    -

    AppRender

    -

    The appRender() method allows the container to wrap an app in extra HTML. The function should accept an F2.AppConfig object and also a string of HTML. The extra HTML can provide links to edit app settings and remove an app from the container. See F2.Constants.Css for CSS classes that should be applied to elements.

    -
    -
    -

    BeforeAppRender

    -

    The beforeAppRender() method allows the container to render HTML for an app before the AppManifest for an app has loaded. This can be useful if the design calls for loading spinners to appear for each app before each app is loaded and rendered to the page.

    -
    -
    -

    AfterAppRender

    -

    The afterAppRender() method allows the container to override how an app's HTML is inserted into the page. The function should accept an F2.AppConfig object and also a string of HTML.

    -

    For more information on F2.ContainerConfig, browse to the F2.js SDK docs.

    -
    -
    -

    F2 UI Mask

    -

    Container Developers have the opportunity to customize some user interface (UI) elements which propagate to the App Developers' toolkit in F2.js. One of those is F2.UI.Mask. The Mask object contains configuration defaults for the F2.UI.showMask() and F2.UI.hideMask() methods.

    -

    An example of setting the mask in F2.init():

    -
    $(document).ready(function(){
    -    F2.init({
    -        //define ContainerConfig properties
    -        appRender: function(appConfig, html){ ... },
    -        beforeAppRender: function(appConfig, html){ ... },
    -        afterAppRender: function(appConfig){ ... },
    +

    The web page and pre-loaded news app is a fully F2-enabled container. Rejoice!

    +
    +
    +
    +

    Combining AppConfig and AppManifest

    +

    Container Developers can use the AppConfig and pre-loaded AppManifest (from step 2 above) in conjunction with F2.registerApps() to speed up the loading of F2 containers. The F2.registerApps() API supports two arguments: appConfigs and appManifests. The former is an array of F2.AppConfig objects and the latter is an array of F2.AppManifest objects. The appManifests array must be the same length as the appConfigs array that is used as the first argument. This can be useful if apps are loaded on the server-side and passed down to the client.

    +

    In the following example, the AppManifest was pre-loaded and stored in the _appManifest variable.

    +
    var _appConfig = {
    +    appId: 'com_openf2_examples_csharp_marketnews',
    +    description: 'Example News',
    +    manifestUrl: 'http://www.openf2.org/Examples/Apps',
    +    name: 'Example News',
    +    root: document.getElementById('news_app')
    +};
     
    -        //setup UI
    -        UI:{
    -            Mask:{
    -                loadingIcon:'./img/spinner.gif',
    -                backgroundColor: '#fff',
    -                opacity: 0.5
    -            }
    -        }
    -    });
    +var _appManifest = {
    +   "apps":[{
    +         "data":{},
    +         "html": "<div data-module-name=\"MarketNewsApp\">...</div>",
    +    }],
    +   "scripts":[
    +      "http://www.openf2.org/js/main.js"
    +   ],
    +   "styles":[
    +      "http://www.openf2.org/css/site.css"
    +   ]
    +};
    +
    +$(function(){
    +    F2.init();
    +    F2.registerApps(_appConfig,_appManifest);
     });
    -

    Included in the F2.UI.Mask configuration object are the following properties: backgroundColor, loadingIcon, opacity, useClasses, and zIndex. Each of these F2.UI.Mask properties is detailed in the F2.js SDK docs.

    -

    For more information on F2.UI, browse to the F2.js SDK docs.

    +

    Important The F2.registerApps() API supports both an array of objects and object literals for each argument. Internally, F2.js converts the value of each argument into an array using concatenation ([].concat()). If arrays of objects are used (when there are more than one app on the container), the _appConfig and _appManifest arrays must be of equal length, and the object at each index must be a parallel reference. This means the AppConfig and AppManifest for the sample news app used above must be in _appConfig[0] and _appManifest[0].

    +
    -
    -

    Container Templates

    -

    If you're looking for sample container HTML template code, jump to the Get Started section. There is also a basic F2 container/app template available for download on GitHub.

    +
    +
    +

    AppHandlers for App Layout

    +

    New functionality called F2.AppHandlers was added in F2 1.2, and the conversation about this collection of features occurred in #38 on GitHub. The new AppHandlers functionality provides Container Developers a higher level of control over configuring app rendering and interaction.

    +

    +The addition of F2.AppHandlers replaces the previous ContainerConfig properties beforeAppRender, appRender, and afterAppRender. These methods were deprecated—but not removed—in version 1.2. They will be permanently removed in a future version of F2. +

    + +

    +Starting with F2 version 1.2, AppHandlers is the preferred method for Container Developers to manage app layout. +

    + +

    The AppHandlers functionality provides an event-based system for Container Developers' web applications. The addition of a collection of constants in F2.Constants.AppHandlers shows the primitive set of event types (or hooks) available to developers, including hooks such as appCreateRoot, appRenderAfter, appDestroyAfter and more. (Review the complete F2.Constants.AppHandlers collection in the F2.js SDK documentation.)

    +

    Using AppHandlers is as simple as attaching an event handler function to be executed at the appropriate time as determined by the order of operations in F2. To do this there are three functions available on F2.AppHandlers: getToken, on, and off. We'll review the token concept first as a token is the required first argument in on and off.

    +
    +

    AppHandler Tokens

    +

    A new feature has been added to F2 as part of AppHandlers: the event token. The token is designed to be used only by Container Developers to ensure the AppHandlers listeners are only called by their applications, and aren't accessible to App Developers' code. Container Developers should create a variable for this token in their JavaScript and encapsulate it inside a closure as shown in the example below.

    +
    (function(){
    +    var token = F2.AppHandlers.getToken(); 
    +    console.log(token);
    +    //outputs a GUID like 'ce2e7aae-04fa-96a3-edd7-be67e99937b4'
    +});
    +

    Important The getToken() function can only be called one-time. It self-destructs to protect the token for Container Developers and therefore Container Developers must call F2.AppHandlers.getToken() and store its return value before any F2 apps are registered with the container.

    +
    +
    +

    Default App Layout

    +

    In the unlikely event a Container Developer wishes to append all apps to the <body> element, no configuration is required. Simply add this code to the container:

    +
    F2.init();
    +F2.registerApps(appConfig);
    +

    Appending apps to the <body> is the default app rendering behavior of F2.

    +
    +
    +

    Custom App Layout

    +

    F2 AppHandlers provide event handlers for customized app layout using F2.AppHandlers.on() and F2.AppHandlers.off(). The use of on and off require both a token and an event type as arguments. The event types, defined as constants in F2.Constants.AppHandlers, are:

    +
      +
    • appCreateRoot
    • +
    • appDestroy
    • +
    • appDestroyAfter
    • +
    • appDestroyBefore
    • +
    • appRender
    • +
    • appRenderAfter
    • +
    • appRenderBefore
    • +
    +

    Review the complete F2.Constants.AppHandlers collection and their purpose in the F2.js SDK documentation. The order of operations is detailed in F2.AppHandlers.

    +
    +

    Appending an App to a DOM Element

    +

    There are many uses for AppHandlers in Container Developers' applications and they are detailed—including plenty of examples—in the F2.js SDK documentation. Before jumping to that section of the docs, let's look at one of the more common uses for AppHandlers: targeting the placement of an app into a specific DOM element.

    +

    In the following example, the app will be appended to the #my_sidebar DOM element on the container.

    +
    var _token = F2.AppHandlers.getToken(),
    +    _appConfig = {
    +        appId: 'com_example_app',
    +        manifestUrl: '/manifest.js'
    +    };
    +
    +F2.init();
    +F2.AppHandlers.on(_token, 'appRender', document.getElementById('my_sidebar'));
    +F2.registerApps(_appConfig);
    +

    F2 will insert html from the AppManifest inside the specified DOM element. The resulting HTML will look like this after registerApps is called. Take note F2.js adds three class names to the apps' outermost element (f2-app, f2-app-container, and com_example_app for the appId).

    +
    <div id="my_sidebar">
    +    <!--HTML defined in AppManifest inserted here-->
    +    <div class="f2-app f2-app-container com_example_app">
    +        <div class="f2-app-view" data-f2-view="home">
    +            <p>Hello World!</p>
    +        </div>
    +    </div>
    +</div>
    +

    Note The original html in this example app manifest is available here.

    +

    The jsfiddle below demonstrates a Hello World example using the appRender event type and a DOM element as the third argument in on.

    + + +
    +
    +

    Placing Apps in Separate Locations

    +

    Here is a slightly more complicated example of the appRender event coupled with appCreateRoot to place two apps in two separate DOM elements.

    + + +
    +
    +

    More AppHandlers

    +

    There are numerous examples shown on the Properties tab of F2.Constants.AppHandlers. These demonstrate more advanced use of F2.AppHandlers and aim to provide Container Developers demonstrable low-level control over the life-cycle of app rendering.


    @@ -430,7 +708,7 @@

    Container-to-App Context

    F2.Events.on(
         F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, 
         function(data){
    -        F2.log("The symbol was changed to " + data.symbol);
    +        F2.log("The symbol was changed to " + data.symbol);
         }
     );

    The F2.Events.on() method accepts the event name and listener function as arguments. Read the SDK for more information.

    @@ -472,7 +750,7 @@

    App-to-Container Context

    F2.Events.on(
         F2.Constants.Events.APP_SYMBOL_CHANGE, 
         function(data){
    -        F2.log("The symbol was changed to " + data.symbol);
    +        F2.log("The symbol was changed to " + data.symbol);
         }
     );

    Note For a full list of support event types, browse to the SDK for F2.Constants.Events.

    @@ -495,8 +773,8 @@

    App-to-App Context

    F2.Events.on(
         "buy_stock", 
         function(data){
    -        if (data.isAvailableToPurchase){
    -            F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
    +        if (data.isAvailableToPurchase){
    +            F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
             } else {
                 F2.log("This stock is not available for purchase.")
             }
    @@ -548,7 +826,7 @@ 

    More Complex Context

    F2.Events.on(
         "buy_stock", 
         function(data){
    -        F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
    +        F2.log("Trade ticket order for " + data.symbol + " at $" + data.price);
             //..populate the trade ticket...
             //fire the callback
             if (typeof data.callback === 'function'){
    @@ -567,127 +845,7 @@ 

    Universal F2 Instrument ID

    -
    -

    App Integration

    -

    The process of loading apps on a container happens through a method called F2.registerApps(). The Container Developer must call this method—which accepts two arguments, one required, one optional— after F2.init() is called. If this method isn't called, no apps can be loaded on the container.

    -

    The two arguments provided to registerApps() are an array of AppConfig objects and, optionally, an array of AppManifest objects. As F2.js parses each AppConfig, the apps are validated, hydrated with some additional properties, and saved in F2 memory on the container.

    -

    Regardless of where the container's AppConfig comes from, integrating apps is a simple process. For the purposes of this example, we will use an Acme Corp news app.

    -

    Let's look at some container code.

    -
    -

    Static App Configuration

    -

    First, we define the AppConfigs in a hard-coded _appConfigs array. Secondly, when the document is ready, we call F2.init() and subsequently F2.registerApps() with the single argument.

    -
    //define app config
    -var _appConfigs = [
    -    {
    -        appId: "com_acmecorp_news",
    -        description: "Acme Corp News",
    -        manifestUrl: "http://www.acme.com/apps/news-manifest.js",
    -        name: "Acme News App"
    -    }
    -];
    -
    -$(document).ready(function(){
    -
    -    //init F2 container
    -    F2.init({
    -        //define ContainerConfig properties
    -        appRender: function(appConfig, html){ ... },
    -        beforeAppRender: function(appConfig, html){ ... },
    -        afterAppRender: function(appConfig){ ... },
    -
    -        //setup UI
    -        UI:{
    -            Mask:{
    -                loadingIcon:'./img/spinner.gif',
    -                backgroundColor: '#fff',
    -                opacity: 0.5
    -            }
    -        }
    -    });
    -
    -    //load apps
    -    F2.registerApps(_appConfigs);
    -
    -});
    -

    This javascript code will insert the Acme Corp news app into the container's DOM, provided the appRender method is configured correctly.

    -
    -
    -

    Dynamic App Configuration

    -

    Alternatively, AppConfigs could live in a database—eventually the F2 Store—at which time container developers could provide their containers with AppManifests instead of relying on each AppConfig.manifestUrl property to be retrieved and parsed at run time.

    -

    Such an implementation would require the container developer to make a HTTP call to a Store web service to retrieve AppConfigs and AppManifests. You are already familiar with what the AppConfig looks like, but if you aren't sure what an AppManifest looks like, take note of this empty manifest.

    -
    {
    -    "inlineScripts":[],  
    -    "scripts":[],    
    -    "styles":[],     
    -    "apps":[{
    -            "data":{},
    -            "html":"",
    -            "status":""
    -    }]
    -}
    -

    Note Read more about the AppManifest.

    -

    An example of a container making a request to the F2 Store for AppConfigs and AppManifests:

    -
    (function(){
    -    
    -    var _appConfigs = [], _appManifests = [];
    -
    -    //make request to Store web service
    -    var $req = $.ajax({
    -        url: 'https://store.openf2.org/getApps',
    -        dataType: 'jsonp'
    -    });
    -
    -    //parse successful response
    -    $req.done(function(jqxhr,txtStatus){
    -        jqxhr = jqxhr || {};
    -        if (jqxhr.status == "good"){
    -            _appConfigs = jqxhr.appConfigs || [];
    -            _appManifests = jqxhr.appManifests || [];
    -            //load
    -            loadContainer();
    -        } else {
    -            F2.log("Store web service did not do something 'good'.", jqxhr, txtStatus);
    -        }
    -    });
    -
    -    //handle errors
    -    $req.fail(function(jqxhr,txtStatus){
    -        F2.log("Store web service failed.", jqxhr, txtStatus);
    -    });
    -
    -    //wrap this up so we can call it in $req.done()
    -    var loadContainer = function(){
    -        $(document).ready(function(){
    -            //init F2 container
    -            F2.init({
    -                //define ContainerConfig properties
    -                appRender: function(appConfig, html){ ... },
    -                beforeAppRender: function(appConfig, html){ ... },
    -                afterAppRender: function(appConfig){ ... },
    -
    -                //setup UI
    -                UI:{
    -                    Mask:{
    -                        loadingIcon:'./img/spinner.gif',
    -                        backgroundColor: '#fff',
    -                        opacity: 0.5
    -                    }
    -                }
    -            });
    -
    -            //load apps
    -            F2.registerApps(_appConfigs, _appManifests);
    -
    -        });
    -    }//loadContainer
    -    
    -})();
    -

    Important The _appConfigs and _appManifests arrays must be of equal length, and the object at each index must be a parallel reference. This means the AppConfig and AppManifest for Acme Corp's news app must be in _appConfigs[0] and _appManifests[0].

    -

    There are numerous benefits to dynamic app configuration, most notably performance and security. In the dynamic model, AppManifests have already been requested and loaded before a user opens the container reducing the overall number of outbound HTTP requests. Security is improved because Container Developers have the opportunity to parse and scrub AppManifest contents before F2.js injects markup in the AppManifest.html property into the container DOM.

    -
    -
    -
    -
    +

    Secure Apps

    Security is a fundamental requirement of any F2 container and many F2 apps. With that in mind, the integration of secure apps on a container requires more attention and effort. The process of app integration remains largely the same for integrating secure apps with one significant addition: a second container.

    To support a secured container environment, one of the choices made when writing this specification was the inclusion of an open-source cross-domain in-browser secure messaging library. For this, F2 relies on easyXDM. EasyXDM helps front-end developers safely work around the Same Origin Policy using browser-supported techniques without compromising the user experience. For all browsers, the easyXDM transport stack offers bi-directionality, reliability, queueing and sender-verification.

    @@ -775,8 +933,8 @@

    Considerations


    @@ -784,8 +942,7 @@

    Considerations

    - - - + + \ No newline at end of file diff --git a/docs/css/F2.Docs.css b/docs/css/F2.Docs.css index b47b0196..be24fd5e 100644 --- a/docs/css/F2.Docs.css +++ b/docs/css/F2.Docs.css @@ -312,6 +312,7 @@ code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{margin-bottom:20px;} pre code{padding:0;color:inherit;background-color:transparent;border:0;} .pre-scrollable{max-height:340px;overflow-y:scroll;} +a code{border-color:#e1e1e8 !important;} form{margin:0 0 20px;} fieldset{padding:0;margin:0;border:0;} legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}legend small{font-size:15px;color:#999999;} diff --git a/docs/css/F2.Sdk.css b/docs/css/F2.Sdk.css index 7f89b22d..c1257ed8 100644 --- a/docs/css/F2.Sdk.css +++ b/docs/css/F2.Sdk.css @@ -312,6 +312,7 @@ code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{margin-bottom:20px;} pre code{padding:0;color:inherit;background-color:transparent;border:0;} .pre-scrollable{max-height:340px;overflow-y:scroll;} +a code{border-color:#e1e1e8 !important;} form{margin:0 0 20px;} fieldset{padding:0;margin:0;border:0;} legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}legend small{font-size:15px;color:#999999;} diff --git a/docs/css/F2.css b/docs/css/F2.css index 3db675bf..4020beba 100644 --- a/docs/css/F2.css +++ b/docs/css/F2.css @@ -312,6 +312,7 @@ code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{margin-bottom:20px;} pre code{padding:0;color:inherit;background-color:transparent;border:0;} .pre-scrollable{max-height:340px;overflow-y:scroll;} +a code{border-color:#e1e1e8 !important;} form{margin:0 0 20px;} fieldset{padding:0;margin:0;border:0;} legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}legend small{font-size:15px;color:#999999;} diff --git a/docs/extending-f2.html b/docs/extending-f2.html index 971a98b4..fcc131e1 100644 --- a/docs/extending-f2.html +++ b/docs/extending-f2.html @@ -3,10 +3,9 @@ F2 - Extending F2 - - + - + @@ -17,7 +16,7 @@ - + @@ -26,7 +25,7 @@ - +
    @@ -94,19 +93,19 @@
    - + @@ -119,8 +118,8 @@
    -
    -
    +
    +

    Extending F2

    @@ -183,8 +182,8 @@

    Forum


    @@ -192,8 +191,7 @@

    Forum

    - - - + + \ No newline at end of file diff --git a/docs/f2js-sdk.html b/docs/f2js-sdk.html index c401b24b..ae71cdc9 100644 --- a/docs/f2js-sdk.html +++ b/docs/f2js-sdk.html @@ -3,10 +3,9 @@ F2 - F2.js SDK - - + - + @@ -17,7 +16,7 @@ - + @@ -26,7 +25,7 @@ - +
    @@ -94,19 +93,19 @@
    - + @@ -119,8 +118,8 @@
    -
    -
    +
    +

    F2.js SDK

    @@ -130,34 +129,51 @@

    F2.js SDK

    Developers who adhere to the F2 standard will make it possible for multiple apps, developed independently by different organizations, to function together creating a seamless and integrated experience.


    -
    -

    The JavaScript

    -

    F2 is an open framework meaning anyone can build individual components or the entire product. To get Container and App Developers started, there is a JavaScript SDK—called F2.js—in addition to example apps as part of an open-source project maintained on GitHub.

    +
    +

    F2.js

    +

    F2 is an open framework and to get Container and App Developers started, there is a JavaScript SDK—called F2.js—in addition to example apps as part of an open-source project maintained on GitHub.


    Download

    Anyone is free to download F2.js from the F2 project repository on GitHub. Once downloaded, F2.js can be added to any web page using a script tag:

    <script src="/path/to/your/container/f2.js"></script>
    -

    The latest version of F2.js is 1.1.2.

    +

    The latest version of F2.js is 1.2.0.

    -Download F2.js 1.1.2 View on GitHub +Download F2.js 1.2.0 View on GitHub


    Versioning

    -

    The latest version of F2.js will always be in the project root, and the version number is in the top of file. The version number is also available on the command line by using node build -v.

    +

    The latest version of F2.js will always be in the project root, and the version number is in the top of file. The version number is also available on the command line by using:

    +

    $> grunt version.

    To adhere to industry standards, F2 will be maintained under the Semantic Versioning guidelines as much as possible.

    Releases will be numbered with the following format:

    <major>.<minor>.<patch>

    For more information on SemVer, please visit SemVer.org.


    +
    +

    Upgrading

    +

    It is a goal of ours to make upgrading to the latest version of F2 a minor effort for development teams. Releasing feature enhancements, addressing bugs or security patches, and working hard to maintain backward compatibility for F2.js APIs—while constantly pushing the boundaries—are all part of evolving a web framework for the financial services industry.

    +

    The details from each release of F2, minor and major, are tracked in the changelog.

    +
    +

    The Latest

    +

    For developers, getting the latest F2.js SDK is as simple as going to the project repository on GitHub. A download (zip) of the current version (1.2.0) of F2 is always available along with tags of previous releases.

    +

    Developers can quick-link to the latest copy of F2.js:

    +

    https://raw.github.com/OpenF2/F2/master/f2.js

    +

    Note GitHub is not a CDN.

    +
    +
    +

    Deprecated Features or APIs

    +

    As F2 features and/or F2.js APIs are deprecated, advance notice will be provided on any or all of the F2 communication channels. In addition, backward compatibility will be maintained for at least one minor version of F2. For example, if Feature X is deprecated in 1.0, backward compatibility will be maintained until at least version 1.1. F2 documentation will be updated accordingly to reflect any changes, and the conversation behind deprecated features will be publicly available on GitHub.

    +
    +

    Forum

    -

    Have a question? Ask it on the F2 Google Group.

    +

    Have a question? Ask it on the F2 Google Group or start a discussion using Issues on GitHub.

    - - - + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index f10ae011..11d52a30 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,10 +6,9 @@ - - + - + @@ -20,7 +19,7 @@ - + @@ -29,7 +28,7 @@ - +

    @@ -97,19 +96,19 @@
    - + @@ -122,8 +121,8 @@
    -
    -
    +
    +

    About F2

    @@ -224,8 +223,8 @@

    Spec Management

    .

    Track

    -

    F2 v1.0 was released on October 15, 2012. The latest version of the F2 specification is 1.1.2 released on 8 April 2013. To provide transparency into the future of F2, a roadmap wiki will be available on GitHub. A changelog that tracks version-to-version changes, upgrades and deprecated features will offer a historical look at F2's evolution.

    -

    Note There is a separate changelog for the F2.js SDK which is currently version 1.1.2.

    +

    F2 v1.0 was released on October 15, 2012. The latest version of the F2 specification is 1.2.0 released on 4 June 2013. To provide transparency into the future of F2, a roadmap wiki will be available on GitHub. A changelog that tracks version-to-version changes, upgrades and deprecated features will offer a historical look at F2's evolution.

    +

    Note There is a separate changelog for the F2.js SDK which is currently version 1.2.0.

    Collaborate

    @@ -239,7 +238,7 @@

    Collaborate

    Notational Conventions

    -

    The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

    +

    The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119. For readability, these words do not appear in all uppercase letters in this specification.


    @@ -249,10 +248,10 @@

    Framework

    Following are definitions for the main F2 Framework components: the apps, the container, and the store.

    Choices

    -

    In order to ensure that applications built using F2 are successful, they must be accessible. With this in mind, the front-end technology choice is HTML5. Using the progressive enhancement methodology, F2 incorporates a rock-solid foundation. The F2 open standard provides guidelines for developers to add feature enhancements targeting specific environments or visitors. For example, F2 apps built following the mobile first design approach and with responsive CSS, allow users to access the apps on their desktop, tablet or smartphone and App Developers only need to build a single app.

    +

    In order to ensure that applications built using F2 are successful, they must be accessible. With this in mind, the front-end technology choice is HTML5. Using the progressive enhancement methodology, F2 incorporates a rock-solid foundation. The F2 open standard provides guidelines for developers to add feature enhancements targeting specific environments or visitors. For example, F2 apps built following the mobile first design approach and with responsive CSS, allow users to access the apps on their desktop, tablet or smartphone and App Developers only need to build a single app.

    Support across all desktop browsers and mobile devices is sometimes limited so F2 includes some third-party web development libraries to bridge those gaps. Why reinvent the wheel, right?

      -
    • F2 uses and recommends Twitter Bootstrap for a consistent HTML & CSS structure for app development regardless of App Developer (we'll explain more later).
    • +
    • F2 uses and recommends Bootstrap for a consistent HTML & CSS structure for app development regardless of App Developer (we'll explain more later).
    • F2 relies on data structures represented in JSON, so it incorporates Crockford's JSON.
    • To support a secured container environment, F2 needs cross-domain in-browser messaging. For this, it relies on easyXDM.
    @@ -373,8 +372,8 @@

    Get Started


    @@ -382,8 +381,7 @@

    Get Started

    - - - + + \ No newline at end of file diff --git a/docs/sdk/classes/F2.App.html b/docs/sdk/classes/F2.App.html index 12a936a5..3f7e4c2e 100644 --- a/docs/sdk/classes/F2.App.html +++ b/docs/sdk/classes/F2.App.html @@ -3,8 +3,7 @@ F2 - F2.App - - + @@ -17,7 +16,7 @@ - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - + @@ -25,7 +24,7 @@ - + - - - - ``` -In developing a more advanced container, the HTML document's `body` element would contain additional markup and allow for specific positioning or placement of apps. Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the [F2 design guidelines](container-development.html#container-design). +Note In [developing a more advanced container](container-development.html), the HTML document's `body` element would contain additional markup and allow for [specific positioning or placement of apps](container-development.html#apphandlers-for-app-layout). Additionally, more advanced containers could introduce features and functionality to their apps in the form of authentication APIs, streaming data feeds, federated search, etc. All containers must follow the [F2 design guidelines](#container-design). -### Basic App - -Create your basic [F2 app manifest](#app-manifest) and save it as `/path/to/your/manifest.js` using this code below. Note the path to this file should be specified in the `manifestUrl` property within the `_appConfigs` array in your basic container (shown above). +### Basic AppConfig ```javascript -F2_jsonpCallback_com_your_app_id({ - "scripts": [], - "styles": [], - "apps": [{ - "data": {}, - "html": "

    Hello, world. I'm an F2 app.

    " - }] -}) +var _appConfig = { + appId: 'com_openf2_examples_javascript_helloworld', + manifestUrl: 'http://docs.openf2.org/demos/apps/JavaScript/HelloWorld/manifest.js' +}; + +$(function(){ + F2.init(); + F2.registerApps(_appConfig); +}); ``` -Note You can [download the F2 app template](https://github.com/downloads/OpenF2/F2/Basic-F2-App-Template-1.0.4.zip) instead of creating the basic app by hand. +Note For more information about the `AppConfig`, [read up on them](container-development.html#appconfigs) in Container Development: App Integration. ### Testing the Basics -Now with a basic container and a basic app, you can load your F2 container and expect to see: +Now with a basic container and a basic app, combine these two for a working example. Press **Result** in this jsfiddle. -![](./img/basic-f2-app-test.png "Basic F2 app") + In getting to this point, you've only scratched the surface of F2 containers and apps. Continue reading and understanding the F2 spec to build exactly the financial solutions that our customers want. ### Sample Apps and Container -Good news! In the [project repo on GitHub](https://github.com/OpenF2/F2/tree/master/examples/container/), you will find a basic container along with a number of sample apps which demonstrate functionality far beyond the basic app above. Once you clone or download the project repository, open the sample container by pointing your browser at: +Good news! In the [project repo on GitHub](https://github.com/OpenF2/F2/tree/master/examples/), you will find a basic container along with a number of sample apps which demonstrate functionality far beyond the basic app above. Once you clone or download the project repository, open the sample container by pointing your browser at: -`http://localhost/F2/examples/container/` +`http://localhost/F2/examples/` + +These examples are also available in a separate archive if you don't want to download the entire repository. + +

    Download F2 Examples

    ### Configuration @@ -121,7 +89,7 @@ To get started working with or developing containers, browse to the [documentati **Ready to start coding?** -

    Developing F2 Apps F2.js SDK Reference

    +

    Developing F2 Apps F2.js SDK Reference

    * * * * @@ -172,7 +140,7 @@ Once you have your AppID, start by setting up your project. You will need at lea ![](./img/project_folder.png "Setup your project") -Helper [Download the F2 app starter zip](https://github.com/downloads/OpenF2/F2/Basic-F2-App-Template-1.0.4.zip) or read about [setting up a basic container and app](#get-started) in Getting Started. +Helper [Download the F2 examples](http://docs.openf2.org/F2-examples.zip) or read about [setting up a basic container and app](#get-started) in Getting Started. ### App Manifest diff --git a/docs/src/container-development.md b/docs/src/container-development.md index caf0c658..8ddc62e9 100644 --- a/docs/src/container-development.md +++ b/docs/src/container-development.md @@ -1,7 +1,7 @@ % Container Development

    -The container is the foundation of any F2-enabled solution. By leveraging the [F2.js SDK](f2js-sdk.html), Container Providers offer a consistent and reliable mechanism for all App Developers to load their apps on that container regardless of where it is hosted, who developed it, or what back-end stack it uses. You can [read more about the framework](index.html#framework), [download the project on GitHub](https://github.com/OpenF2/F2#quick-start) or [get started](#get-started) below. The current version of F2 is {{version}}. +The container is the foundation of any F2-enabled solution. By leveraging the [F2.js SDK](f2js-sdk.html), Container Providers offer a consistent and reliable mechanism for all App Developers to load their apps on that container regardless of where it is hosted, who developed it, or what back-end stack it uses. You can [read more about the framework](index.html#framework), [download the project on GitHub](https://github.com/OpenF2/F2#quick-start) or [get started](#get-started) below. The latest version of F2 is {{version}}.

    * * * * @@ -48,7 +48,7 @@ $(function(){ }); ``` -Note For more information about the `AppConfig`, [read up on them](##appconfigs) in App Integration. +Note For more information about the `AppConfig`, [read up on them](#appconfigs) in App Integration. ### Testing the Basics From 6f716bdd56830cb9f57f224093a65d63860144dc Mon Sep 17 00:00:00 2001 From: markhealey Date: Fri, 7 Jun 2013 15:33:35 -0600 Subject: [PATCH 180/181] Readme logo --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d6f1617..3ad40d4f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ -# An open framework for the financial services industry. +# F2 - An open web framework for the financial services industry. + F2 is an open and free web integration framework designed to help you and other financial industry participants develop custom solutions that combine the best tools and content from multiple providers into one, privately-labeled, seamlessly integrated front-end. The [essential components](http://docs.openf2.org/index.html#framework) defined by the F2 specification are the Container, Apps, Context and Store—all supported under the hood by **[F2.js](http://docs.openf2.org/f2js-sdk.html)**, a JavaScript SDK which provides an extensible foundation powering all F2-based web applications. F2 is currently maintained by [Markit On Demand](http://www.markitondemand.com) and you're encouraged to read [more details about the management of the F2 spec](http://docs.openf2.org/#spec-management). Visit [OpenF2.org](http://www.openf2.org) for more information and follow [@OpenF2](http://twitter.com/OpenF2) on Twitter. From fb5501f6b1a4c2d098dda2a6931f56c6deb7095f Mon Sep 17 00:00:00 2001 From: markhealey Date: Fri, 7 Jun 2013 15:37:32 -0600 Subject: [PATCH 181/181] 1.2 final --- docs/app-development.html | 2 +- docs/container-development.html | 2 +- docs/sdk/index.html | 7 ++++--- package.json | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/app-development.html b/docs/app-development.html index 1a4709cb..7d14ebfb 100644 --- a/docs/app-development.html +++ b/docs/app-development.html @@ -124,7 +124,7 @@

    App Development

    -Apps are the building blocks of any F2-enabled solution. F2 apps are web-based, are built with HTML5, CSS3, and JavaScript, and contain entitled data. F2 enables App Developers to build once and deploy to any container with a simple and modern API. You can read more about the framework, download the project on GitHub or get started below. The current version of F2 is 1.2.0. +Apps are the building blocks of any F2-enabled solution. F2 apps are web-based, are built with HTML5, CSS3, and JavaScript, and contain entitled data. F2 enables App Developers to build once and deploy to any container with a simple and modern API. You can read more about the framework, download the project on GitHub or get started below. The latest version of F2 is 1.2.0.

    F2 apps are synonymous with modules, widgets and portlets. Think charts, portfolios, trade tickets, and screeners. F2 apps only need to be programmed once, no matter where they will be used. To start, F2 Apps are either:

    diff --git a/docs/container-development.html b/docs/container-development.html index 90eee11f..54e2b590 100644 --- a/docs/container-development.html +++ b/docs/container-development.html @@ -124,7 +124,7 @@

    Container Development

    -The container is the foundation of any F2-enabled solution. By leveraging the F2.js SDK, Container Providers offer a consistent and reliable mechanism for all App Developers to load their apps on that container regardless of where it is hosted, who developed it, or what back-end stack it uses. You can read more about the framework, download the project on GitHub or get started below. The current version of F2 is 1.2.0. +The container is the foundation of any F2-enabled solution. By leveraging the F2.js SDK, Container Providers offer a consistent and reliable mechanism for all App Developers to load their apps on that container regardless of where it is hosted, who developed it, or what back-end stack it uses. You can read more about the framework, download the project on GitHub or get started below. The latest version of F2 is 1.2.0.


    diff --git a/docs/sdk/index.html b/docs/sdk/index.html index a6f9c90f..11602dff 100644 --- a/docs/sdk/index.html +++ b/docs/sdk/index.html @@ -220,9 +220,10 @@
    -

    An open framework for the financial services industry.

    +

    F2 - An open web framework for the financial services industry.

    -

    F2 is an open and free web integration framework designed to help you and other financial industry participants develop custom solutions that combine the best tools and content from multiple providers into one, privately-labeled, seamlessly integrated front-end. The essential components defined by the F2 specification are the Container, Apps, Context and Store—all supported under the hood by F2.js, a JavaScript SDK which provides an extensible foundation powering all F2-based web applications.

    +

    +F2 is an open and free web integration framework designed to help you and other financial industry participants develop custom solutions that combine the best tools and content from multiple providers into one, privately-labeled, seamlessly integrated front-end. The essential components defined by the F2 specification are the Container, Apps, Context and Store—all supported under the hood by F2.js, a JavaScript SDK which provides an extensible foundation powering all F2-based web applications.

    F2 is currently maintained by Markit On Demand and you're encouraged to read more details about the management of the F2 spec. Visit OpenF2.org for more information and follow @OpenF2 on Twitter.

    @@ -250,7 +251,7 @@

    Versioning

    Talk

    -

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    +

    Have a question? Want to chat? Open an Issue on GitHub, ask it on our Google Group or send an email to info@openf2.org.

    Bug Tracking

    diff --git a/package.json b/package.json index db284a27..beccefac 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,6 @@ "engines": { "node": ">=0.10" }, - "_releaseDate": "2013-06-07T18:00:45.358Z", + "_releaseDate": "2013-06-07T21:34:58.500Z", "_releaseDateFormatted": "7 June 2013" } \ No newline at end of file