diff --git a/.eslintrc b/.eslintrc
new file mode 100644
index 00000000..9da27ca6
--- /dev/null
+++ b/.eslintrc
@@ -0,0 +1,19 @@
+{
+ "env": {
+ "browser": true,
+ "es2021": true
+ },
+ "extends": ["eslint:recommended", "prettier"],
+ "parserOptions": {
+ "ecmaVersion": 12,
+ "sourceType": "module"
+ },
+ "rules": {
+ "no-irregular-whitespace": [
+ "error",
+ {
+ "skipComments": true
+ }
+ ]
+ }
+}
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6b623dff..cf928349 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -10,4 +10,4 @@ jobs:
node-version: '14'
- run: npm ci
- run: npm run build
- - run: npm test
\ No newline at end of file
+ - run: npm test
diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index b353d700..00000000
--- a/.jshintrc
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "esversion": 9,
- "browser": true,
- "curly": true,
- "evil": true,
- "globals": {
- "console": true,
- "define": true, "exports": true, "require": true, "module": true,
- "describe": true, "xdescribe": true, "it": true, "xit": true, "expect": true, "runs": true, "waits": true, "waitsFor": true, "itConditionally": true,
- "EventEmitter2": true,
- "F2": true,
- "domify": true,
- "fetchJsonp": true,
- "_": true
- },
- "latedef": false,
- "noarg": true,
- "quotmark": "single",
- "shadow": false,
- "sub": true,
- "undef": true,
- "unused": "vars"
-}
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..f9085fe3
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,2 @@
+dist
+docs
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 00000000..e166c065
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1 @@
+{ singleQuote: true, tabWidth: 2, trailingComma: none, useTabs: true }
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 335ee03b..b21a73b8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -14,8 +14,8 @@ First, a couple of ground rules.
1. Make sure you have a [GitHub account](https://github.com/signup/free).
2. [Submit a ticket for your issue](https://github.com/OpenF2/F2/issues), assuming one does not already exist. **(Search first!)**
- * Clearly describe the issue including steps to reproduce when it is a bug.
- * Include the F2 version number.
+ - Clearly describe the issue including steps to reproduce when it is a bug.
+ - Include the F2 version number.
3. [Fork the F2 repository](https://github.com/OpenF2/F2/fork).
## New to GitHub?
@@ -26,7 +26,7 @@ GitHub has terrific [Guides](http://guides.github.com/) to help developers throu
### Understanding the "wip" branch
-The latest F2 changes can be found in the `*-wip` branch. This branch's name uses the upcoming version number followed by `-wip` which stands for "work-in-progress", for example `1.3.1-wip` as shown below. There *should* only be one `-wip` branch at any given time.
+The latest F2 changes can be found in the `*-wip` branch. This branch's name uses the upcoming version number followed by `-wip` which stands for "work-in-progress", for example `1.3.1-wip` as shown below. There _should_ only be one `-wip` branch at any given time.
Do not work directly in `master`!
@@ -36,21 +36,21 @@ Do not work directly in `master`!
Once you've forked the F2 repository:
-1. Create a new branch in your fork from the next version `*-wip` branch. Do not work directly in `master`!
- * `$> git checkout -b 'your_branch_name' *-wip`
-3. Read the F2 [coding standards](https://github.com/OpenF2/F2/wiki/Coding-Standards).
-4. Add and document unit test(s) for your changes. **At least one unit test is required** for new or changed functionality.
-5. Re-run all the Jasmine tests to confirm your changes didn't break anything. `$> npm test` and/or `$> npm run test-live`
-6. Perform browser testing in [supported browsers](https://github.com/OpenF2/F2/wiki/Browser-Compatibility).
+1. Create a new branch in your fork from the next version `*-wip` branch. Do not work directly in `master`!
+ - `$> git checkout -b 'your_branch_name' *-wip`
+2. Read the F2 [coding standards](https://github.com/OpenF2/F2/wiki/Coding-Standards).
+3. Add and document unit test(s) for your changes. **At least one unit test is required** for new or changed functionality.
+4. Re-run all the Jasmine tests to confirm your changes didn't break anything. `$> npm test` and/or `$> npm run test-live`
+5. Perform browser testing in [supported browsers](https://github.com/OpenF2/F2/wiki/Browser-Compatibility).
### Committing Changes
-* You should only commit files you have changed. **Do not commit compiled or generated F2 files**
-* After you've staged your changes, add a detailed commit message.
-* Push committed changes to your fork's branch.
-* [Submit a pull request](https://help.github.com/articles/using-pull-requests) for `F2\*-wip` **not** `F2\master`.
-* Add a message or additional detail for your changes in the pull request comments.
-* Wait for your change(s) to be reviewed.
+- You should only commit files you have changed. **Do not commit compiled or generated F2 files**
+- After you've staged your changes, add a detailed commit message.
+- Push committed changes to your fork's branch.
+- [Submit a pull request](https://help.github.com/articles/using-pull-requests) for `F2\*-wip` **not** `F2\master`.
+- Add a message or additional detail for your changes in the pull request comments.
+- Wait for your change(s) to be reviewed.
## Coding Standards
@@ -66,7 +66,7 @@ If you have any questions while writing code to contribute to F2, post a message
## Resources
-* [F2 Google Group](https://groups.google.com/forum/#!forum/OpenF2)
-* [F2 Coding Standards](https://github.com/OpenF2/F2/wiki/Coding-Standards)
-* [GitHub Documentation: Using Pull Requests](https://help.github.com/articles/using-pull-requests)
-* [GitHub Documentation](https://help.github.com/)
+- [F2 Google Group](https://groups.google.com/forum/#!forum/OpenF2)
+- [F2 Coding Standards](https://github.com/OpenF2/F2/wiki/Coding-Standards)
+- [GitHub Documentation: Using Pull Requests](https://help.github.com/articles/using-pull-requests)
+- [GitHub Documentation](https://help.github.com/)
diff --git a/README.md b/README.md
index a720fdb1..a0e2af0e 100644
--- a/README.md
+++ b/README.md
@@ -26,10 +26,10 @@ Join the team and help contribute to F2 on GitHub. Begin by reading our [contrib
### Get F2.js
-* Choose a [F2.js package](http://docs.openf2.org/f2js-sdk.html#packages), including [F2.basic.js](https://raw.github.com/OpenF2/F2/master/sdk/packages/f2.basic.min.js) (7kb, minified and gzipped)
-* Grab any version of F2 [on cdnjs.com](http://cdnjs.com/libraries/F2/).
-* For .NET developers: install the [NuGet Package](https://nuget.org/packages/F2/) or `PM> Install-Package F2`
-* Bower: `bower install F2`
+- Choose a [F2.js package](http://docs.openf2.org/f2js-sdk.html#packages), including [F2.basic.js](https://raw.github.com/OpenF2/F2/master/sdk/packages/f2.basic.min.js) (7kb, minified and gzipped)
+- Grab any version of F2 [on cdnjs.com](http://cdnjs.com/libraries/F2/).
+- For .NET developers: install the [NuGet Package](https://nuget.org/packages/F2/) or `PM> Install-Package F2`
+- Bower: `bower install F2`
### Docs
@@ -81,7 +81,6 @@ Copyright © 2015 Markit On Demand, Inc.
[http://www.apache.org/licenses/LICENSE-2.0](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.
-
-Please note that F2 ("Software") may contain third party material that Markit On Demand Inc. has a license to use and include within the Software (the "Third Party Material"). A list of the software comprising the Third Party Material and the terms and conditions under which such Third Party Material is distributed are reproduced in the [ThirdPartyMaterial.md](ThirdPartyMaterial.md) file. The inclusion of the Third Party Material in the Software does not grant, provide nor result in you having acquiring any rights whatsoever, other than as stipulated in the terms and conditions related to the specific Third Party Material, if any.
+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.
+Please note that F2 ("Software") may contain third party material that Markit On Demand Inc. has a license to use and include within the Software (the "Third Party Material"). A list of the software comprising the Third Party Material and the terms and conditions under which such Third Party Material is distributed are reproduced in the [ThirdPartyMaterial.md](ThirdPartyMaterial.md) file. The inclusion of the Third Party Material in the Software does not grant, provide nor result in you having acquiring any rights whatsoever, other than as stipulated in the terms and conditions related to the specific Third Party Material, if any.
diff --git a/ThirdPartyMaterial.md b/ThirdPartyMaterial.md
index ca82c6c3..c5faa068 100644
--- a/ThirdPartyMaterial.md
+++ b/ThirdPartyMaterial.md
@@ -25,7 +25,6 @@ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
## lodash
The MIT License
@@ -82,7 +81,7 @@ terms above.
Hij1nx requires the following notice to accompany EventEmitter:
-Copyright © 2011 hij1nx
+Copyright © 2011 hij1nx
[http://www.twitter.com/hij1nx](http://www.twitter.com/hij1nx)
@@ -94,7 +93,7 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
## fetch-jsonp
-Copyright (c) 2021 Cam Song - https://github.com/camsong/fetch-jsonp
+Copyright (c) 2021 Cam Song - https://github.com/camsong/fetch-jsonp
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -112,4 +111,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
+SOFTWARE.
diff --git a/bower.json b/bower.json
index f8ca0785..9284d95e 100644
--- a/bower.json
+++ b/bower.json
@@ -1,11 +1,7 @@
{
"name": "f2",
"description": "F2 is an open and free web integration framework that allows you to deploy apps & components both within your existing web application and cross-domain.",
- "keywords": [
- "f2",
- "openf2",
- "markit f2"
- ],
+ "keywords": ["f2", "openf2", "markit f2"],
"homepage": "http://www.openf2.org",
"version": "1.4.5",
"main": "dist/f2.js",
@@ -32,4 +28,4 @@
"type": "git",
"url": "git://github.com/OpenF2/F2.git"
}
-}
\ No newline at end of file
+}
diff --git a/docs/bin/gen-docs.js b/docs/bin/gen-docs.js
index 20b84bf7..a6627cac 100644
--- a/docs/bin/gen-docs.js
+++ b/docs/bin/gen-docs.js
@@ -11,112 +11,141 @@ var handlebars = require('handlebars');
var _ = require('underscore');
var srcDir = path.resolve(__dirname, '../src/'),
- distDir = path.resolve(__dirname, '../dist/'),
- srcFiles = fs.readdirSync(srcDir),
- templateFile = path.resolve(__dirname, '../src/template/layout.html'),
- template = fs.readFileSync(templateFile, 'utf8'),
- renderer = new marked.Renderer(),
- locals = {};
+ distDir = path.resolve(__dirname, '../dist/'),
+ srcFiles = fs.readdirSync(srcDir),
+ templateFile = path.resolve(__dirname, '../src/template/layout.html'),
+ template = fs.readFileSync(templateFile, 'utf8'),
+ renderer = new marked.Renderer(),
+ locals = {};
//setup partials
locals.templates = {
- head: fs.readFileSync(path.resolve(__dirname, '../src/template/head.html'), 'utf8'),
- nav: fs.readFileSync(path.resolve(__dirname, '../src/template/nav.html'), 'utf8'),
- footer: fs.readFileSync(path.resolve(__dirname, '../src/template/footer.html'), 'utf8')
+ head: fs.readFileSync(
+ path.resolve(__dirname, '../src/template/head.html'),
+ 'utf8'
+ ),
+ nav: fs.readFileSync(
+ path.resolve(__dirname, '../src/template/nav.html'),
+ 'utf8'
+ ),
+ footer: fs.readFileSync(
+ path.resolve(__dirname, '../src/template/footer.html'),
+ 'utf8'
+ )
};
//loop over *.md files in source directory for conversion
-srcFiles.forEach(function(filename) {
- var src, html, dist, _locals, headings = [];
-
- _locals = _.extend({},locals,pkg);
-
- //F2 docs are written only in markdown
- if (!filename.match(/\.md$/)) {
- return;
- }
-
- _locals.filename = filename;
- _locals.filename_html = filename.replace(/\.md$/, '.html');
- _locals.filename_amd = filename.replace(/\.md$/, '');
-
- //override Marked heading renderer
- //https://github.com/chjj/marked#overriding-renderer-methods
- renderer.heading = function(text, level) {
- var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-');
- var html;
-
- //de-dupe headings so we end up with unique Developing F2 Apps F2.js SDK Reference An error occurred loading StockTwits data for " + this.symbol + ". An error occurred loading StockTwits data for ' +
+ this.symbol +
+ '.');
-
- $.each(data.messages, $.proxy(function (idx, item) {
- //body, created_at, source, symbols, user
-
- if (idx > 4) {
- return true;
- } //only show 5
-
- var body = item.body,
- created_at = moment(new Date(item.created_at)).startOf('hour').fromNow(),
- id = item.id,
- source = item.source,
- symbols = item.symbols,
- user = item.user,
- symList = [];
-
- body = this.replaceURLWithHTMLLinks(body);
- body = this.replaceDollarSigns(body);
-
- //build list of symbols
- // $.each(symbols, function (idx, item) {
- // symList.push(
- // '
');
- }
-
- this.$app.html(html.join(''));
-
- //assign event to change container focus
- $("a.focus", this.$app).click(function () {
- F2.Events.emit(
- F2.Constants.Events.APP_SYMBOL_CHANGE, {
- symbol: $(this).attr("data-symbol"),
- name: $(this).attr("data-symbol")
- }
- );
- });
- }
-
- //http://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links
- App_Class.prototype.replaceURLWithHTMLLinks = function (text) {
- var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
- return text.replace(exp, "$1");
- }
-
- App_Class.prototype.replaceDollarSigns = function (text) {
- var exp = /\$([A-Za-z0-9_]+)/ig;
- //use this to link to StockTwits.com
- //return text.replace(exp,"$$$1");
-
- //use this to apply focus to container
- return text.replace(exp, "$$$1");
- }
-
- return App_Class;
-})();
\ No newline at end of file
+F2.Apps['com_openf2_examples_csharp_stocktwits'] = (function () {
+ var App_Class = function (appConfig, appContent, root) {
+ // constructor
+ this.appConfig = appConfig;
+ this.appContent = appContent;
+ this.$root = $(root); //if you're using jQuery.
+ this.$app = $('div', this.$root);
+ this.context = this.appConfig.context || {};
+ this.symbol = this.context.symbol || 'MSFT'; //default to MSFT
+ this.setupEvents();
+ };
+
+ App_Class.prototype.init = function () {
+ this.getTwits();
+ };
+
+ App_Class.prototype.setupEvents = function () {
+ F2.Events.on(
+ F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
+ $.proxy(function (data) {
+ this.symbol = data.symbol;
+ this.init();
+ }, this)
+ );
+ };
+
+ App_Class.prototype.getTwits = function () {
+ $.ajax({
+ //url: "http://www.openf2.org/api/stocktwits/" + this.symbol,
+ url:
+ 'https://api.stocktwits.com/api/2/streams/symbol/' +
+ this.symbol +
+ '.json',
+ data: {},
+ cache: true,
+ context: this
+ })
+ .done(function (data, txtStatus) {
+ this.draw(data);
+ })
+ .fail(function (jqxhr, txtStatus) {
+ console.error(
+ 'F2wits failed to load StockTwits data.',
+ jqxhr,
+ txtStatus
+ );
+ this.$app.html(
+ '',
- ' '
- );
- }, this));
-
- html.push(' ',
- '',
- body,
- ' ',
- '');
+
+ $.each(
+ data.messages,
+ $.proxy(function (idx, item) {
+ //body, created_at, source, symbols, user
+
+ if (idx > 4) {
+ return true;
+ } //only show 5
+
+ var body = item.body,
+ created_at = moment(new Date(item.created_at))
+ .startOf('hour')
+ .fromNow(),
+ id = item.id,
+ source = item.source,
+ symbols = item.symbols,
+ user = item.user,
+ symList = [];
+
+ body = this.replaceURLWithHTMLLinks(body);
+ body = this.replaceDollarSigns(body);
+
+ //build list of symbols
+ // $.each(symbols, function (idx, item) {
+ // symList.push(
+ // '
');
+ }
+
+ this.$app.html(html.join(''));
+
+ //assign event to change container focus
+ $('a.focus', this.$app).click(function () {
+ F2.Events.emit(F2.Constants.Events.APP_SYMBOL_CHANGE, {
+ symbol: $(this).attr('data-symbol'),
+ name: $(this).attr('data-symbol')
+ });
+ });
+ };
+
+ //http://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links
+ App_Class.prototype.replaceURLWithHTMLLinks = function (text) {
+ var exp =
+ /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;
+ return text.replace(exp, "$1");
+ };
+
+ App_Class.prototype.replaceDollarSigns = function (text) {
+ var exp = /\$([A-Za-z0-9_]+)/gi;
+ //use this to link to StockTwits.com
+ //return text.replace(exp,"$$$1");
+
+ //use this to apply focus to container
+ return text.replace(
+ exp,
+ "$$$1"
+ );
+ };
+
+ return App_Class;
+})();
diff --git a/docs/src/apps/com_openf2_examples_csharp_stocktwits/manifest.js b/docs/src/apps/com_openf2_examples_csharp_stocktwits/manifest.js
index a59ce37c..026c48fe 100644
--- a/docs/src/apps/com_openf2_examples_csharp_stocktwits/manifest.js
+++ b/docs/src/apps/com_openf2_examples_csharp_stocktwits/manifest.js
@@ -1,18 +1,16 @@
F2_jsonpCallback_com_openf2_examples_csharp_stocktwits({
- "inlineScripts": [],
- "scripts": [
- "/js/thirdparty/moment.min.js",
- "/apps/com_openf2_examples_csharp_stocktwits/appclass.js"
- ],
- "styles": [
- "/apps/com_openf2_examples_csharp_stocktwits/app.css"
- ],
- "apps": [
- {
- "data": {},
- "html": "",
- "status": "SUCCESS",
- "id": "com_openf2_examples_csharp_stocktwits"
- }
- ]
-});
\ No newline at end of file
+ inlineScripts: [],
+ scripts: [
+ '/js/thirdparty/moment.min.js',
+ '/apps/com_openf2_examples_csharp_stocktwits/appclass.js'
+ ],
+ styles: ['/apps/com_openf2_examples_csharp_stocktwits/app.css'],
+ apps: [
+ {
+ data: {},
+ html: '',
+ status: 'SUCCESS',
+ id: 'com_openf2_examples_csharp_stocktwits'
+ }
+ ]
+});
diff --git a/docs/src/container-development.md b/docs/src/container-development.md
index 6e6be97c..26d8f2f2 100644
--- a/docs/src/container-development.md
+++ b/docs/src/container-development.md
@@ -4,7 +4,7 @@
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](about-f2.html#framework), [download the project on GitHub](https://github.com/OpenF2/F2#quick-start) or [get started](#get-started) below.
',
+ ' '
+ );
+ }, this)
+ );
+
+ html.push(' ',
+ '',
+ body,
+ ' ',
+ '
Developing F2 Containers F2.js SDK Reference
-* * * * +--- ## Container Design @@ -98,7 +99,7 @@ In order to ensure that containers built using F2 are successful, they must be a 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](about-f2.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 @@ -124,9 +125,9 @@ As an example, your ContainerID could look like this: 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` +- `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](about-f2.html#developer-center). @@ -148,9 +149,9 @@ To initialize a container with a `ContainerConfig`, use: ```javascript F2.init({ - UI: {}, - xhr: function(){}, - supportedViews: [] + UI: {}, + xhr: function () {}, + supportedViews: [] }); ``` @@ -164,7 +165,7 @@ To enable debug mode in a container, use the following [property](./sdk/classes/ ```javascript F2.init({ - debugMode: true + debugMode: true }); ``` @@ -178,7 +179,7 @@ Configuration of current region and language using the `locale`: ```javascript F2.init({ - locale: 'en-us' + locale: 'en-us' }); ``` @@ -194,8 +195,8 @@ Here is an example of triggering the locale change event: var currentLocale = F2.getContainerLocale(); //en-us //emit F2 event with new locale -F2.Events.emit(F2.Constants.Events.CONTAINER_LOCALE_CHANGE,{ - locale: 'en-gb' +F2.Events.emit(F2.Constants.Events.CONTAINER_LOCALE_CHANGE, { + locale: 'en-gb' }); //get newly-updated locale @@ -209,21 +210,21 @@ There is a parameter sent to each `AppManifest` request during `F2.registerApps` Here is an example of the two ways of getting the container locale inside an AppClass. ```javascript -F2.Apps["com_companyname_appname"] = (function() { - var App_Class = function(appConfig, appContent, root) { - // "containerLocale" is added to the AppConfig - // during F2.registerApps - console.log(appConfig.containerLocale);//en-us - } - - App_Class.prototype.init = function() { - // get locale using helper function - // if locale changes, this function will - // always return the current locale - console.log(F2.getContainerLocale());//en-us - } - - return App_Class; +F2.Apps['com_companyname_appname'] = (function () { + var App_Class = function (appConfig, appContent, root) { + // "containerLocale" is added to the AppConfig + // during F2.registerApps + console.log(appConfig.containerLocale); //en-us + }; + + App_Class.prototype.init = function () { + // get locale using helper function + // if locale changes, this function will + // always return the current locale + console.log(F2.getContainerLocale()); //en-us + }; + + return App_Class; })(); ``` @@ -250,7 +251,7 @@ Sample `AppConfig` showing the `localeSupport` property: ### Override the AppManifest Request -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. +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). @@ -258,30 +259,30 @@ The following example demonstrates how the `xhr` property of the `ContainerConfi ```javascript 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 - } - }); - } + 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 + } + }); + } }); ``` @@ -295,11 +296,11 @@ The `dataType` property allows the container to override the request data type ( ```javascript F2.init({ - xhr: { - dataType: function(url) { - return F2.isLocalRequest(url) ? 'json' : 'jsonp'; - } - } + xhr: { + dataType: function (url) { + return F2.isLocalRequest(url) ? 'json' : 'jsonp'; + } + } }); ``` @@ -309,11 +310,11 @@ The `type` property allows the container to override the request method that is ```javascript F2.init({ - xhr: { - type: function(url) { - return F2.isLocalRequest(url) ? 'POST' : 'GET'; - } - } + xhr: { + type: function (url) { + return F2.isLocalRequest(url) ? 'POST' : 'GET'; + } + } }); ``` @@ -331,10 +332,10 @@ To override the script loader, assign a function to `loadScripts` in `F2.init` a ```javascript F2.init({ - loadScripts: function(scripts,callback){ - //perform script loading - callback(); - } + loadScripts: function (scripts, callback) { + //perform script loading + callback(); + } }); ``` @@ -342,11 +343,11 @@ The following example demonstrates using [HeadJS](http://headjs.com/site/api/v1. ```javascript F2.init({ - loadScripts: function(scripts,callback){ - head.load(scripts, function(){ - callback(); - }); - } + loadScripts: function (scripts, callback) { + head.load(scripts, function () { + callback(); + }); + } }); ``` @@ -360,10 +361,10 @@ To override the stylesheet loader, assign a function to `loadStyles` in `F2.init ```javascript F2.init({ - loadStyles: function(styles,callback){ - //perform stylesheet loading - callback(); - } + loadStyles: function (styles, callback) { + //perform stylesheet loading + callback(); + } }); ``` @@ -371,11 +372,11 @@ The following example demonstrates using [HeadJS](http://headjs.com/site/api/v1. ```javascript F2.init({ - loadStyles: function(styles,callback){ - head.load(styles, function(){ - callback(); - }); - } + loadStyles: function (styles, callback) { + head.load(styles, function () { + callback(); + }); + } }); ``` @@ -389,10 +390,10 @@ To override the inline script evaluator, assign a function to `loadInlineScripts ```javascript F2.init({ - loadInlineScripts: function(inlines,callback){ - //perform inline script evaluation - callback(); - } + loadInlineScripts: function (inlines, callback) { + //perform inline script evaluation + callback(); + } }); ``` @@ -407,11 +408,11 @@ In the event any scripts defined in an `AppManifest` fail to load—such as ```javascript var _token = F2.AppHandlers.getToken(); F2.AppHandlers.on( - _token, - F2.Constants.AppHandlers.APP_SCRIPT_LOAD_FAILED, - function(appConfig, scriptInfo) { - F2.log(appConfig.appId); - } + _token, + F2.Constants.AppHandlers.APP_SCRIPT_LOAD_FAILED, + function (appConfig, scriptInfo) { + F2.log(appConfig.appId); + } ); ``` @@ -420,9 +421,9 @@ F2.AppHandlers.on( When all of the scripts defined in an `AppManifest` have been loaded, the `APP_SCRIPTS_LOADED` event is triggered. This event receives the `appId` and array of `scripts` just loaded. _This event is fired for every App registered._ ```javascript -F2.Events.on('APP_SCRIPTS_LOADED', function(data){ - F2.log('All scripts for ' +data.appId+ ' have been loaded.'); - //Ouputs 'All scripts for com_test_app have been loaded.' +F2.Events.on('APP_SCRIPTS_LOADED', function (data) { + F2.log('All scripts for ' + data.appId + ' have been loaded.'); + //Ouputs 'All scripts for com_test_app have been loaded.' }); ``` @@ -430,7 +431,7 @@ F2.Events.on('APP_SCRIPTS_LOADED', function(data){ If you're looking for sample container HTML template code, jump to the [Get Started section](#get-started). -* * * * +--- ## App Integration @@ -461,30 +462,30 @@ 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' - } - }, + { + 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' + } + } ]; ``` @@ -500,11 +501,11 @@ During the F2 app load life cycle, the following events happen in order: 4. If the `AppConfig` contains a `root` property, F2 switches to [preloading mode](#registering-pre-loaded-apps) 5. If the `AppConfig` contains the `enableBatchRequests:true` property, F2 switches to [batching mode](#batch-requesting-apps) 6. Finally, the [internal `_loadApps` function](https://github.com/OpenF2/F2/blob/master/sdk/src/container.js#L211) is called which: - 1. Iterates over each URL in the `styles` array, creates a new `` tag and inserts it into the ``. - 2. Iterates over each app in the `apps` array, stores off any `data` to pass to the `appclass` later, and inserts any HTML into the app's root. - 3. Iterates over each URL in the `scripts` array, creates a new `",rE:!0,sL:"javascript"}},t,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"?",e:"/?>",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},r]}]}}),hljs.registerLanguage("markdown",function(){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link_url",e:"$"}}]}]}}),hljs.registerLanguage("nginx",function(e){var t={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},r={eW:!0,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,t],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[t]},{cN:"regexp",c:[e.BE,t],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},t]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"title",b:e.UIR,starts:r}],r:0}],i:"[^\\s\\}]"}}),hljs.registerLanguage("objectivec",function(e){var t={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSData NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView NSView NSViewController NSWindow NSWindowController NSSet NSUUID NSIndexSet UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection NSURLSession NSURLSessionDataTask NSURLSessionDownloadTask NSURLSessionUploadTask NSURLResponseUIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["m","mm","objc","obj-c"],k:t,l:r,i:"",c:[e.CLCM,e.CBCM,e.CNM,e.QSM,{cN:"string",v:[{b:'@"',e:'"',i:"\\n",c:[e.BE]},{b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"}]},{cN:"preprocessor",b:"#",e:"$",c:[{cN:"title",v:[{b:'"',e:'"'},{b:"<",e:">"}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:r,c:[e.UTM]},{cN:"variable",b:"\\."+e.UIR,r:0}]}}),hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},n={b:"->{",e:"}"},a={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@][^\s\w{]/,r:0}]},i={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5},s=[e.BE,r,a],c=[a,e.HCM,i,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:!0},n,{cN:"string",c:s,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,i,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];return r.c=c,n.c=c,{aliases:["pl"],k:t,c:c}}),hljs.registerLanguage("php",function(e){var t={cN:"variable",b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},r={cN:"preprocessor",b:/<\?(php)?|\?>/},n={cN:"string",c:[e.BE,r],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.CLCM,e.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},r]},{cN:"comment",b:"__halt_compiler.+?;",eW:!0,k:"__halt_compiler",l:e.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[e.BE]},r,t,{b:/->+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",t,e.CBCM,n,a]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},n,a]}}),hljs.registerLanguage("python",function(e){var t={cN:"prompt",b:/^(>>>|\.\.\.) /},r={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[t],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[t],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},n={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},a={cN:"params",b:/\(/,e:/\)/,c:["self",t,n,r]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[t,n,r,e.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n]/,c:[e.UTM,a]},{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}}),hljs.registerLanguage("ruby",function(e){var t="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",n={cN:"yardoctag",b:"@[A-Za-z]+"},a={cN:"value",b:"#<",e:">"},i={cN:"comment",v:[{b:"#",e:"$",c:[n]},{b:"^\\=begin",e:"^\\=end",c:[n],r:10},{b:"^__END__",e:"\\n$"}]},s={cN:"subst",b:"#\\{",e:"}",k:r},c={cN:"string",c:[e.BE,s],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},o={cN:"params",b:"\\(",e:"\\)",k:r},l=[c,a,i,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},i]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:t}),o,i]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[c,{b:t}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[a,i,{cN:"regexp",c:[e.BE,s],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];s.c=l,o.c=l;var u="[>?]>",d="[\\w#]+\\(\\w+\\):\\d+:\\d+>",b="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",p=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:l}},{cN:"prompt",b:"^("+u+"|"+d+"|"+b+")",starts:{e:"$",c:l}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,c:[i].concat(p).concat(l)}}),hljs.registerLanguage("sql",function(e){var t={cN:"comment",b:"--",e:"$"};return{cI:!0,i:/[<>]/,c:[{cN:"operator",bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup",e:/;/,eW:!0,k:{keyword:"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]} -}); \ No newline at end of file +!(function (e) { + 'undefined' != typeof exports + ? e(exports) + : ((window.hljs = e({})), + 'function' == typeof define && + define.amd && + define([], function () { + return window.hljs; + })); +})(function (e) { + function t(e) { + return e + .replace(/&/gm, '&') + .replace(//gm, '>'); + } + function r(e) { + return e.nodeName.toLowerCase(); + } + function n(e, t) { + var r = e && e.exec(t); + return r && 0 == r.index; + } + function a(e) { + var t = ( + e.className + + ' ' + + (e.parentNode ? e.parentNode.className : '') + ).split(/\s+/); + return ( + (t = t.map(function (e) { + return e.replace(/^lang(uage)?-/, ''); + })), + t.filter(function (e) { + return N(e) || /no(-?)highlight/.test(e); + })[0] + ); + } + function i(e, t) { + var r = {}; + for (var n in e) r[n] = e[n]; + if (t) for (var n in t) r[n] = t[n]; + return r; + } + function s(e) { + var t = []; + return ( + (function n(e, a) { + for (var i = e.firstChild; i; i = i.nextSibling) + 3 == i.nodeType + ? (a += i.nodeValue.length) + : 1 == i.nodeType && + (t.push({ event: 'start', offset: a, node: i }), + (a = n(i, a)), + r(i).match(/br|hr|img|input/) || + t.push({ event: 'stop', offset: a, node: i })); + return a; + })(e, 0), + t + ); + } + function c(e, n, a) { + function i() { + return e.length && n.length + ? e[0].offset != n[0].offset + ? e[0].offset < n[0].offset + ? e + : n + : 'start' == n[0].event + ? e + : n + : e.length + ? e + : n; + } + function s(e) { + function n(e) { + return ' ' + e.nodeName + '="' + t(e.value) + '"'; + } + u += + '<' + r(e) + Array.prototype.map.call(e.attributes, n).join('') + '>'; + } + function c(e) { + u += '' + r(e) + '>'; + } + function o(e) { + ('start' == e.event ? s : c)(e.node); + } + for (var l = 0, u = '', d = []; e.length || n.length; ) { + var b = i(); + if (((u += t(a.substr(l, b[0].offset - l))), (l = b[0].offset), b == e)) { + d.reverse().forEach(c); + do o(b.splice(0, 1)[0]), (b = i()); + while (b == e && b.length && b[0].offset == l); + d.reverse().forEach(s); + } else + 'start' == b[0].event ? d.push(b[0].node) : d.pop(), + o(b.splice(0, 1)[0]); + } + return u + t(a.substr(l)); + } + function o(e) { + function t(e) { + return (e && e.source) || e; + } + function r(r, n) { + return RegExp(t(r), 'm' + (e.cI ? 'i' : '') + (n ? 'g' : '')); + } + function n(a, s) { + if (!a.compiled) { + if (((a.compiled = !0), (a.k = a.k || a.bK), a.k)) { + var c = {}, + o = function (t, r) { + e.cI && (r = r.toLowerCase()), + r.split(' ').forEach(function (e) { + var r = e.split('|'); + c[r[0]] = [t, r[1] ? Number(r[1]) : 1]; + }); + }; + 'string' == typeof a.k + ? o('keyword', a.k) + : Object.keys(a.k).forEach(function (e) { + o(e, a.k[e]); + }), + (a.k = c); + } + (a.lR = r(a.l || /\b[A-Za-z0-9_]+\b/, !0)), + s && + (a.bK && (a.b = '\\b(' + a.bK.split(' ').join('|') + ')\\b'), + a.b || (a.b = /\B|\b/), + (a.bR = r(a.b)), + a.e || a.eW || (a.e = /\B|\b/), + a.e && (a.eR = r(a.e)), + (a.tE = t(a.e) || ''), + a.eW && s.tE && (a.tE += (a.e ? '|' : '') + s.tE)), + a.i && (a.iR = r(a.i)), + void 0 === a.r && (a.r = 1), + a.c || (a.c = []); + var l = []; + a.c.forEach(function (e) { + e.v + ? e.v.forEach(function (t) { + l.push(i(e, t)); + }) + : l.push('self' == e ? a : e); + }), + (a.c = l), + a.c.forEach(function (e) { + n(e, a); + }), + a.starts && n(a.starts, s); + var u = a.c + .map(function (e) { + return e.bK ? '\\.?(' + e.b + ')\\.?' : e.b; + }) + .concat([a.tE, a.i]) + .map(t) + .filter(Boolean); + a.t = u.length + ? r(u.join('|'), !0) + : { + exec: function () { + return null; + } + }; + } + } + n(e); + } + function l(e, r, a, i) { + function s(e, t) { + for (var r = 0; r < t.c.length; r++) if (n(t.c[r].bR, e)) return t.c[r]; + } + function c(e, t) { + return n(e.eR, t) ? e : e.eW ? c(e.parent, t) : void 0; + } + function d(e, t) { + return !a && n(t.iR, e); + } + function b(e, t) { + var r = y.cI ? t[0].toLowerCase() : t[0]; + return e.k.hasOwnProperty(r) && e.k[r]; + } + function p(e, t, r, n) { + var a = n ? '' : v.classPrefix, + i = ''), i + t + s; + } + function f() { + if (!k.k) return t(S); + var e = '', + r = 0; + k.lR.lastIndex = 0; + for (var n = k.lR.exec(S); n; ) { + e += t(S.substr(r, n.index - r)); + var a = b(k, n); + a ? ((E += a[1]), (e += p(a[0], t(n[0])))) : (e += t(n[0])), + (r = k.lR.lastIndex), + (n = k.lR.exec(S)); + } + return e + t(S.substr(r)); + } + function m() { + if (k.sL && !w[k.sL]) return t(S); + var e = k.sL ? l(k.sL, S, !0, x[k.sL]) : u(S); + return ( + k.r > 0 && (E += e.r), + 'continuous' == k.subLanguageMode && (x[k.sL] = e.top), + p(e.language, e.value, !1, !0) + ); + } + function g() { + return void 0 !== k.sL ? m() : f(); + } + function _(e, r) { + var n = e.cN ? p(e.cN, '', !0) : ''; + e.rB + ? ((M += n), (S = '')) + : e.eB + ? ((M += t(r) + n), (S = '')) + : ((M += n), (S = r)), + (k = Object.create(e, { parent: { value: k } })); + } + function h(e, r) { + if (((S += e), void 0 === r)) return (M += g()), 0; + var n = s(r, k); + if (n) return (M += g()), _(n, r), n.rB ? 0 : r.length; + var a = c(k, r); + if (a) { + var i = k; + i.rE || i.eE || (S += r), (M += g()); + do k.cN && (M += ''), (E += k.r), (k = k.parent); + while (k != a.parent); + return ( + i.eE && (M += t(r)), + (S = ''), + a.starts && _(a.starts, ''), + i.rE ? 0 : r.length + ); + } + if (d(r, k)) + throw new Error( + 'Illegal lexeme "' + r + '" for mode "' + (k.cN || '// elements inside
blocks. */
-pre code, pre kbd, pre samp { font-size: 100%; }
+pre code,
+pre kbd,
+pre samp {
+ font-size: 100%;
+}
/* Used to denote text that shouldn't be selectable, such as line numbers or
shell prompts. Guess which browser this doesn't work in. */
.noselect {
- -moz-user-select: -moz-none;
- -khtml-user-select: none;
- -webkit-user-select: none;
- -o-user-select: none;
- user-select: none;
+ -moz-user-select: -moz-none;
+ -khtml-user-select: none;
+ -webkit-user-select: none;
+ -o-user-select: none;
+ user-select: none;
}
/* -- Lists ----------------------------------------------------------------- */
-dd { margin: 0.2em 0 0.7em 1em; }
-dl { margin: 1em 0; }
-dt { font-weight: bold; }
+dd {
+ margin: 0.2em 0 0.7em 1em;
+}
+dl {
+ margin: 1em 0;
+}
+dt {
+ font-weight: bold;
+}
/* -- Tables ---------------------------------------------------------------- */
-caption, th { text-align: left; }
+caption,
+th {
+ text-align: left;
+}
table {
- border-collapse: collapse;
- width: 100%;
+ border-collapse: collapse;
+ width: 100%;
}
-td, th {
- border: 1px solid #fff;
- padding: 5px 12px;
- vertical-align: top;
+td,
+th {
+ border: 1px solid #fff;
+ padding: 5px 12px;
+ vertical-align: top;
}
-td { background: #E6E9F5; }
-td dl { margin: 0; }
-td dl dl { margin: 1em 0; }
-td pre:first-child { margin-top: 0; }
+td {
+ background: #e6e9f5;
+}
+td dl {
+ margin: 0;
+}
+td dl dl {
+ margin: 1em 0;
+}
+td pre:first-child {
+ margin-top: 0;
+}
th {
- background: #D2D7E6;/*#97A0BF*/
- border-bottom: none;
- border-top: none;
- color: #000;/*#FFF1D5*/
- font-family: 'Trebuchet MS', sans-serif;
- font-weight: bold;
- line-height: 1.3;
- white-space: nowrap;
+ background: #d2d7e6; /*#97A0BF*/
+ border-bottom: none;
+ border-top: none;
+ color: #000; /*#FFF1D5*/
+ font-family: 'Trebuchet MS', sans-serif;
+ font-weight: bold;
+ line-height: 1.3;
+ white-space: nowrap;
}
-
/* -- Layout and Content ---------------------------------------------------- */
#doc {
- margin: auto;
- min-width: 1024px;
+ margin: auto;
+ min-width: 1024px;
}
-.content { padding: 0 20px 0 25px; }
+.content {
+ padding: 0 20px 0 25px;
+}
.sidebar {
- padding: 0 15px 0 10px;
+ padding: 0 15px 0 10px;
}
#bd {
- padding: 7px 0 130px;
- position: relative;
- width: 99%;
+ padding: 7px 0 130px;
+ position: relative;
+ width: 99%;
}
/* -- Table of Contents ----------------------------------------------------- */
@@ -203,9 +267,17 @@ th {
/* The #toc id refers to the single global table of contents, while the .toc
class refers to generic TOC lists that could be used throughout the page. */
-.toc code, .toc kbd, .toc samp { font-size: 100%; }
-.toc li { font-weight: bold; }
-.toc li li { font-weight: normal; }
+.toc code,
+.toc kbd,
+.toc samp {
+ font-size: 100%;
+}
+.toc li {
+ font-weight: bold;
+}
+.toc li li {
+ font-weight: normal;
+}
/* -- Intro and Example Boxes ----------------------------------------------- */
/*
@@ -230,135 +302,170 @@ th {
theme. */
.button {
- border: 1px solid #dadada;
- -moz-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
- color: #444;
- display: inline-block;
- font-family: Helvetica, Arial, sans-serif;
- font-size: 92.308%;
- font-weight: bold;
- padding: 4px 13px 3px;
- -moz-text-shadow: 1px 1px 0 #fff;
- -webkit-text-shadow: 1px 1px 0 #fff;
- text-shadow: 1px 1px 0 #fff;
- white-space: nowrap;
-
- background: #EFEFEF; /* old browsers */
- background: -moz-linear-gradient(top, #f5f5f5 0%, #efefef 50%, #e5e5e5 51%, #dfdfdf 100%); /* firefox */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(50%,#efefef), color-stop(51%,#e5e5e5), color-stop(100%,#dfdfdf)); /* webkit */
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
+ border: 1px solid #dadada;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ color: #444;
+ display: inline-block;
+ font-family: Helvetica, Arial, sans-serif;
+ font-size: 92.308%;
+ font-weight: bold;
+ padding: 4px 13px 3px;
+ -moz-text-shadow: 1px 1px 0 #fff;
+ -webkit-text-shadow: 1px 1px 0 #fff;
+ text-shadow: 1px 1px 0 #fff;
+ white-space: nowrap;
+
+ background: #efefef; /* old browsers */
+ background: -moz-linear-gradient(
+ top,
+ #f5f5f5 0%,
+ #efefef 50%,
+ #e5e5e5 51%,
+ #dfdfdf 100%
+ ); /* firefox */
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ color-stop(0%, #f5f5f5),
+ color-stop(50%, #efefef),
+ color-stop(51%, #e5e5e5),
+ color-stop(100%, #dfdfdf)
+ ); /* webkit */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#dfdfdf',GradientType=0 ); /* ie */
}
.button:hover {
- border-color: #466899;
- color: #fff;
- text-decoration: none;
- -moz-text-shadow: 1px 1px 0 #222;
- -webkit-text-shadow: 1px 1px 0 #222;
- text-shadow: 1px 1px 0 #222;
-
- background: #6396D8; /* old browsers */
- background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+ border-color: #466899;
+ color: #fff;
+ text-decoration: none;
+ -moz-text-shadow: 1px 1px 0 #222;
+ -webkit-text-shadow: 1px 1px 0 #222;
+ text-shadow: 1px 1px 0 #222;
+
+ background: #6396d8; /* old browsers */
+ background: -moz-linear-gradient(
+ top,
+ #6396d8 0%,
+ #5a83bc 50%,
+ #547ab7 51%,
+ #466899 100%
+ ); /* firefox */
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ color-stop(0%, #6396d8),
+ color-stop(50%, #5a83bc),
+ color-stop(51%, #547ab7),
+ color-stop(100%, #466899)
+ ); /* webkit */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
+}
+
+.newwindow {
+ text-align: center;
}
-.newwindow { text-align: center; }
-
.header .version em {
- display: block;
- text-align: right;
+ display: block;
+ text-align: right;
}
-
#classdocs .item {
- border-bottom: 1px solid #466899;
- margin: 1em 0;
- padding: 1.5em;
+ border-bottom: 1px solid #466899;
+ margin: 1em 0;
+ padding: 1.5em;
}
#classdocs .item .params p,
- #classdocs .item .returns p,{
- display: inline;
+#classdocs .item .returns p {
+ display: inline;
}
-#classdocs .item em code, #classdocs .item em.comment {
- color: green;
+#classdocs .item em code,
+#classdocs .item em.comment {
+ color: green;
}
#classdocs .item em.comment a {
- color: green;
- text-decoration: underline;
+ color: green;
+ text-decoration: underline;
}
#classdocs .foundat {
- font-size: 11px;
- font-style: normal;
+ font-size: 11px;
+ font-style: normal;
}
.attrs .emits {
- margin-left: 2em;
- padding: .5em;
- border-left: 1px dashed #ccc;
+ margin-left: 2em;
+ padding: 0.5em;
+ border-left: 1px dashed #ccc;
}
abbr {
- border-bottom: 1px dashed #ccc;
- font-size: 80%;
- cursor: help;
-}
-
-.prettyprint li.L0,
-.prettyprint li.L1,
-.prettyprint li.L2,
-.prettyprint li.L3,
-.prettyprint li.L5,
-.prettyprint li.L6,
-.prettyprint li.L7,
+ border-bottom: 1px dashed #ccc;
+ font-size: 80%;
+ cursor: help;
+}
+
+.prettyprint li.L0,
+.prettyprint li.L1,
+.prettyprint li.L2,
+.prettyprint li.L3,
+.prettyprint li.L5,
+.prettyprint li.L6,
+.prettyprint li.L7,
.prettyprint li.L8 {
- list-style: decimal;
+ list-style: decimal;
}
ul li p {
- margin-top: 0;
+ margin-top: 0;
}
.method .name {
- font-size: 110%;
+ font-size: 110%;
}
.apidocs .methods .extends .method,
.apidocs .properties .extends .property,
.apidocs .attrs .extends .attr,
.apidocs .events .extends .event {
- font-weight: bold;
+ font-weight: bold;
}
.apidocs .methods .extends .inherited,
.apidocs .properties .extends .inherited,
.apidocs .attrs .extends .inherited,
.apidocs .events .extends .inherited {
- font-weight: normal;
+ font-weight: normal;
}
#hd {
- background: whiteSmoke;
- background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
- background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
- border-bottom: 1px solid #DFDFDF;
- padding: 0 15px 1px 20px;
- margin-bottom: 15px;
+ background: whiteSmoke;
+ background: -moz-linear-gradient(top, #dcdbd9 0, #f6f5f3 100%);
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ color-stop(0%, #dcdbd9),
+ color-stop(100%, #f6f5f3)
+ );
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
+ border-bottom: 1px solid #dfdfdf;
+ padding: 0 15px 1px 20px;
+ margin-bottom: 15px;
}
#hd img {
- margin-right: 10px;
- vertical-align: middle;
+ margin-right: 10px;
+ vertical-align: middle;
}
-
/* -- API Docs CSS ---------------------------------------------------------- */
/*
@@ -376,109 +483,135 @@ specific tabview, see the other sections below.
*/
.yui3-js-enabled .apidocs .tabview {
- visibility: hidden; /* Hide until the TabView finishes rendering. */
- _visibility: visible;
+ visibility: hidden; /* Hide until the TabView finishes rendering. */
+ _visibility: visible;
}
-.apidocs .tabview.yui3-tabview-content { visibility: visible; }
-.apidocs .tabview .yui3-tabview-panel { background: #fff; }
+.apidocs .tabview.yui3-tabview-content {
+ visibility: visible;
+}
+.apidocs .tabview .yui3-tabview-panel {
+ background: #fff;
+}
/* -- Generic Content Styles ------------------------------------------------ */
/* Headings */
-h2, h3, h4, h5, h6 {
- border: none;
- color: #30418C;
- font-weight: bold;
- text-decoration: none;
+h2,
+h3,
+h4,
+h5,
+h6 {
+ border: none;
+ color: #30418c;
+ font-weight: bold;
+ text-decoration: none;
}
.link-docs {
- float: right;
- font-size: 15px;
- margin: 4px 4px 6px;
- padding: 6px 30px 5px;
+ float: right;
+ font-size: 15px;
+ margin: 4px 4px 6px;
+ padding: 6px 30px 5px;
}
-.apidocs { zoom: 1; }
+.apidocs {
+ zoom: 1;
+}
/* Generic box styles. */
.apidocs .box {
- border: 1px solid;
- border-radius: 3px;
- margin: 1em 0;
- padding: 0 1em;
+ border: 1px solid;
+ border-radius: 3px;
+ margin: 1em 0;
+ padding: 0 1em;
}
/* A flag is a compact, capsule-like indicator of some kind. It's used to
indicate private and protected items, item return types, etc. in an
attractive and unobtrusive way. */
.apidocs .flag {
- background: #bababa;
- border-radius: 3px;
- color: #fff;
- font-size: 11px;
- margin: 0 0.5em;
- padding: 2px 4px 1px;
+ background: #bababa;
+ border-radius: 3px;
+ color: #fff;
+ font-size: 11px;
+ margin: 0 0.5em;
+ padding: 2px 4px 1px;
}
/* Class/module metadata such as "Uses", "Extends", "Defined in", etc. */
.apidocs .meta {
- background: #f9f9f9;
- border-color: #efefef;
- color: #555;
- font-size: 11px;
- padding: 3px 6px;
+ background: #f9f9f9;
+ border-color: #efefef;
+ color: #555;
+ font-size: 11px;
+ padding: 3px 6px;
}
-.apidocs .meta p { margin: 0; }
+.apidocs .meta p {
+ margin: 0;
+}
/* Deprecation warning. */
.apidocs .box.deprecated,
.apidocs .flag.deprecated {
- background: #fdac9f;
- border: 1px solid #fd7775;
+ background: #fdac9f;
+ border: 1px solid #fd7775;
}
-.apidocs .box.deprecated p { margin: 0.5em 0; }
-.apidocs .flag.deprecated { color: #333; }
+.apidocs .box.deprecated p {
+ margin: 0.5em 0;
+}
+.apidocs .flag.deprecated {
+ color: #333;
+}
/* Module/Class intro description. */
.apidocs .intro {
- background: #f0f1f8;
- border-color: #d4d8eb;
+ background: #f0f1f8;
+ border-color: #d4d8eb;
}
/* Loading spinners. */
#bd.loading .apidocs,
#api-list.loading .yui3-tabview-panel {
- background: #fff url(../img/spinner.gif) no-repeat center 70px;
- min-height: 150px;
+ background: #fff url(../img/spinner.gif) no-repeat center 70px;
+ min-height: 150px;
}
#bd.loading .apidocs .content,
#api-list.loading .yui3-tabview-panel .apis {
- display: none;
+ display: none;
}
-.apidocs .no-visible-items { color: #666; }
+.apidocs .no-visible-items {
+ color: #666;
+}
/* Generic inline list. */
.apidocs ul.inline {
- display: inline;
- list-style: none;
- margin: 0;
- padding: 0;
+ display: inline;
+ list-style: none;
+ margin: 0;
+ padding: 0;
}
-.apidocs ul.inline li { display: inline; }
+.apidocs ul.inline li {
+ display: inline;
+}
/* Comma-separated list. */
-.apidocs ul.commas li:after { content: ','; }
-.apidocs ul.commas li:last-child:after { content: ''; }
+.apidocs ul.commas li:after {
+ content: ',';
+}
+.apidocs ul.commas li:last-child:after {
+ content: '';
+}
/* Keyboard shortcuts. */
-kbd .cmd { font-family: Monaco, Helvetica; }
+kbd .cmd {
+ font-family: Monaco, Helvetica;
+}
/* -- Generic Access Level styles ------------------------------------------- */
.apidocs .item.protected,
@@ -486,7 +619,7 @@ kbd .cmd { font-family: Monaco, Helvetica; }
.apidocs .index-item.protected,
.apidocs .index-item.deprecated,
.apidocs .index-item.private {
- display: none;
+ display: none;
}
.show-deprecated .item.deprecated,
@@ -495,181 +628,205 @@ kbd .cmd { font-family: Monaco, Helvetica; }
.show-protected .index-item.protected,
.show-private .item.private,
.show-private .index-item.private {
- display: block;
+ display: block;
}
.hide-inherited .item.inherited,
.hide-inherited .index-item.inherited {
- display: none;
+ display: none;
}
/* -- Generic Item Index styles --------------------------------------------- */
-.apidocs .index { margin: 1.5em 0 3em; }
+.apidocs .index {
+ margin: 1.5em 0 3em;
+}
.apidocs .index h3 {
- border-bottom: 1px solid #efefef;
- color: #333;
- font-size: 13px;
- margin: 2em 0 0.6em;
- padding-bottom: 2px;
+ border-bottom: 1px solid #efefef;
+ color: #333;
+ font-size: 13px;
+ margin: 2em 0 0.6em;
+ padding-bottom: 2px;
}
-.apidocs .index .no-visible-items { margin-top: 2em; }
+.apidocs .index .no-visible-items {
+ margin-top: 2em;
+}
.apidocs .index-list {
- border-color: #efefef;
- font-size: 12px;
- list-style: none;
- margin: 0;
- padding: 0;
- -moz-column-count: 4;
- -moz-column-gap: 10px;
- -moz-column-width: 170px;
- -ms-column-count: 4;
- -ms-column-gap: 10px;
- -ms-column-width: 170px;
- -o-column-count: 4;
- -o-column-gap: 10px;
- -o-column-width: 170px;
- -webkit-column-count: 4;
- -webkit-column-gap: 10px;
- -webkit-column-width: 170px;
- column-count: 4;
- column-gap: 10px;
- column-width: 170px;
+ border-color: #efefef;
+ font-size: 12px;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ -moz-column-count: 4;
+ -moz-column-gap: 10px;
+ -moz-column-width: 170px;
+ -ms-column-count: 4;
+ -ms-column-gap: 10px;
+ -ms-column-width: 170px;
+ -o-column-count: 4;
+ -o-column-gap: 10px;
+ -o-column-width: 170px;
+ -webkit-column-count: 4;
+ -webkit-column-gap: 10px;
+ -webkit-column-width: 170px;
+ column-count: 4;
+ column-gap: 10px;
+ column-width: 170px;
}
.apidocs .no-columns .index-list {
- -moz-column-count: 1;
- -ms-column-count: 1;
- -o-column-count: 1;
- -webkit-column-count: 1;
- column-count: 1;
+ -moz-column-count: 1;
+ -ms-column-count: 1;
+ -o-column-count: 1;
+ -webkit-column-count: 1;
+ column-count: 1;
}
-.apidocs .index-item { white-space: nowrap; }
+.apidocs .index-item {
+ white-space: nowrap;
+}
.apidocs .index-item .flag {
- background: none;
- border: none;
- color: #afafaf;
- display: inline;
- margin: 0 0 0 0.2em;
- padding: 0;
+ background: none;
+ border: none;
+ color: #afafaf;
+ display: inline;
+ margin: 0 0 0 0.2em;
+ padding: 0;
}
/* -- Generic API item styles ----------------------------------------------- */
.apidocs .args {
- display: inline;
- margin: 0 0.5em;
+ display: inline;
+ margin: 0 0.5em;
}
-.apidocs .flag.chainable { background: #46ca3b; }
-.apidocs .flag.protected { background: #9b86fc; }
-.apidocs .flag.private { background: #fd6b1b; }
-.apidocs .flag.async { background: #356de4; }
-.apidocs .flag.required { background: #e60923; }
+.apidocs .flag.chainable {
+ background: #46ca3b;
+}
+.apidocs .flag.protected {
+ background: #9b86fc;
+}
+.apidocs .flag.private {
+ background: #fd6b1b;
+}
+.apidocs .flag.async {
+ background: #356de4;
+}
+.apidocs .flag.required {
+ background: #e60923;
+}
.apidocs .item {
- border-bottom: 1px solid #efefef;
- padding-top: 10px;
- padding-bottom: 10px;
+ border-bottom: 1px solid #efefef;
+ padding-top: 10px;
+ padding-bottom: 10px;
}
.apidocs .item h4,
.apidocs .item h5,
.apidocs .item h6 {
- color: #333;
- font-family: inherit;
- font-size: 100%;
+ color: #333;
+ font-family: inherit;
+ font-size: 100%;
}
.apidocs .item .description p,
.apidocs .item pre.code {
- margin: 1em 0 0;
+ margin: 1em 0 0;
}
.apidocs .item .meta {
- background: none;
- border: none;
- padding: 0;
+ background: none;
+ border: none;
+ padding: 0;
}
.apidocs .item .name {
- display: inline;
- font-size: 14px;
+ display: inline;
+ font-size: 14px;
}
.apidocs .item .type,
.apidocs .item .type a,
.apidocs .returns-inline {
- color: #555;
+ color: #555;
}
.apidocs .item .type,
.apidocs .returns-inline {
- font-size: 11px;
- margin: 0 0 0 0;
+ font-size: 11px;
+ margin: 0 0 0 0;
}
-.apidocs .item .type a { border-bottom: 1px dotted #afafaf; }
-.apidocs .item .type a:hover { border: none; }
+.apidocs .item .type a {
+ border-bottom: 1px dotted #afafaf;
+}
+.apidocs .item .type a:hover {
+ border: none;
+}
/* -- Item Parameter List --------------------------------------------------- */
.apidocs .params-list {
- list-style: square;
- margin: 1em 0 0 2em;
- padding: 0;
+ list-style: square;
+ margin: 1em 0 0 2em;
+ padding: 0;
}
.apidocs .param .param-description {
- padding-top: 2px;
+ padding-top: 2px;
}
-.apidocs .param { margin-bottom: 1em; }
+.apidocs .param {
+ margin-bottom: 1em;
+}
.apidocs .param .type,
.apidocs .param .type a {
- color: #666;
+ color: #666;
}
.apidocs .param .type {
- margin: 0 0 0 0.5em;
- *margin-left: 0.5em;
+ margin: 0 0 0 0.5em;
+ *margin-left: 0.5em;
}
-.apidocs .param-name { font-weight: bold; }
+.apidocs .param-name {
+ font-weight: bold;
+}
/* -- Item "Emits" block ---------------------------------------------------- */
.apidocs .item .emits {
- background: #f9f9f9;
- border-color: #eaeaea;
+ background: #f9f9f9;
+ border-color: #eaeaea;
}
/* -- Item "Returns" block -------------------------------------------------- */
.apidocs .item .returns .type,
.apidocs .item .returns .type a {
- font-size: 100%;
- margin: 0;
+ font-size: 100%;
+ margin: 0;
}
/* -- Class Constructor block ----------------------------------------------- */
.apidocs .constructor .item {
- border: none;
- padding-bottom: 0;
+ border: none;
+ padding-bottom: 0;
}
.apidocs .constructor {
- padding-bottom: 10px;
+ padding-bottom: 10px;
}
/* -- File Source View ------------------------------------------------------ */
.apidocs .file pre.code,
#doc .apidocs .file pre.prettyprint {
- background: inherit;
- border: none;
- overflow: visible;
- padding: 0;
+ background: inherit;
+ border: none;
+ overflow: visible;
+ padding: 0;
}
.apidocs .L0,
@@ -682,36 +839,46 @@ kbd .cmd { font-family: Monaco, Helvetica; }
.apidocs .L7,
.apidocs .L8,
.apidocs .L9 {
- background: inherit;
+ background: inherit;
}
/* -- Submodule List -------------------------------------------------------- */
.apidocs .module-submodule-description {
- font-size: 12px;
- margin: 0.3em 0 1em;
+ font-size: 12px;
+ margin: 0.3em 0 1em;
}
-.apidocs .module-submodule-description p:first-child { margin-top: 0; }
+.apidocs .module-submodule-description p:first-child {
+ margin-top: 0;
+}
/* -- Sidebar TabView ------------------------------------------------------- */
-#api-tabview { margin-top: 0.6em; }
+#api-tabview {
+ margin-top: 0.6em;
+}
#api-tabview-filter,
#api-tabview-panel {
- border: 1px solid #dfdfdf;
+ border: 1px solid #dfdfdf;
}
#api-tabview-filter {
- border-bottom: none;
- border-top: none;
- padding: 0.6em 10px 0 10px;
+ border-bottom: none;
+ border-top: none;
+ padding: 0.6em 10px 0 10px;
}
-#api-tabview-panel { border-top: none; }
-#api-filter { width: 97%; }
+#api-tabview-panel {
+ border-top: none;
+}
+#api-filter {
+ width: 97%;
+}
/* -- Content TabView ------------------------------------------------------- */
-#classdocs .yui3-tabview-panel { border: none; }
+#classdocs .yui3-tabview-panel {
+ border: none;
+}
/* -- Source File Contents -------------------------------------------------- */
.prettyprint li.L0,
@@ -722,72 +889,82 @@ kbd .cmd { font-family: Monaco, Helvetica; }
.prettyprint li.L6,
.prettyprint li.L7,
.prettyprint li.L8 {
- list-style: decimal;
+ list-style: decimal;
}
/* -- API options ----------------------------------------------------------- */
#api-options {
- font-size: 11px;
- margin-top: 2.2em;
- position: absolute;
- right: 1.5em;
+ font-size: 11px;
+ margin-top: 2.2em;
+ position: absolute;
+ right: 1.5em;
}
/*#api-options label { margin-right: 0.6em; }*/
/* -- API list -------------------------------------------------------------- */
#api-list {
- margin-top: 1.5em;
- *zoom: 1;
+ margin-top: 1.5em;
+ *zoom: 1;
}
.apis {
- font-size: 12px;
- line-height: 1.4;
- list-style: none;
- margin: 0;
- padding: 0.5em 0 0.5em 0.4em;
+ font-size: 12px;
+ line-height: 1.4;
+ list-style: none;
+ margin: 0;
+ padding: 0.5em 0 0.5em 0.4em;
}
.apis a {
- border: 1px solid transparent;
- display: block;
- margin: 0 0 0 -4px;
- padding: 1px 4px 0;
- text-decoration: none;
- _border: none;
- _display: inline;
+ border: 1px solid transparent;
+ display: block;
+ margin: 0 0 0 -4px;
+ padding: 1px 4px 0;
+ text-decoration: none;
+ _border: none;
+ _display: inline;
}
.apis a:hover,
.apis a:focus {
- background: #E8EDFC;
- background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#E8EDFC), color-stop(100%,#BECEF7));
- border-color: #AAC0FA;
- border-radius: 3px;
- color: #333;
- outline: none;
+ background: #e8edfc;
+ background: -moz-linear-gradient(top, #e8edfc 0%, #becef7 100%);
+ background: -webkit-gradient(
+ linear,
+ left top,
+ left bottom,
+ color-stop(0%, #e8edfc),
+ color-stop(100%, #becef7)
+ );
+ border-color: #aac0fa;
+ border-radius: 3px;
+ color: #333;
+ outline: none;
}
.api-list-item a:hover,
.api-list-item a:focus {
- font-weight: bold;
- text-shadow: 1px 1px 1px #fff;
+ font-weight: bold;
+ text-shadow: 1px 1px 1px #fff;
}
-.apis .message { color: #888; }
-.apis .result a { padding: 3px 5px 2px; }
+.apis .message {
+ color: #888;
+}
+.apis .result a {
+ padding: 3px 5px 2px;
+}
.apis .result .type {
- right: 4px;
- top: 7px;
+ right: 4px;
+ top: 7px;
}
.api-list-item .yui3-highlight {
- font-weight: bold;
+ font-weight: bold;
}
.form-inline label {
- line-height: 20px;
+ line-height: 20px;
}
diff --git a/docs/src/sdk-template/assets/css/prettify.css b/docs/src/sdk-template/assets/css/prettify.css
index 9a5a887d..77706ba0 100644
--- a/docs/src/sdk-template/assets/css/prettify.css
+++ b/docs/src/sdk-template/assets/css/prettify.css
@@ -1,120 +1,121 @@
/* GitHub Theme */
.prettyprint {
-
}
.pln {
- color: #333333;
+ color: #333333;
}
@media screen {
- .str {
- color: #dd1144;
- }
+ .str {
+ color: #dd1144;
+ }
- .kwd {
- color: #333333;
- }
+ .kwd {
+ color: #333333;
+ }
- .com {
- color: #999988;
- }
+ .com {
+ color: #999988;
+ }
- .typ {
- color: #445588;
- }
+ .typ {
+ color: #445588;
+ }
- .lit {
- color: #445588;
- }
+ .lit {
+ color: #445588;
+ }
- .pun {
- color: #333333;
- }
+ .pun {
+ color: #333333;
+ }
- .opn {
- color: #333333;
- }
+ .opn {
+ color: #333333;
+ }
- .clo {
- color: #333333;
- }
+ .clo {
+ color: #333333;
+ }
- .tag {
- color: navy;
- }
+ .tag {
+ color: navy;
+ }
- .atn {
- color: teal;
- }
+ .atn {
+ color: teal;
+ }
- .atv {
- color: #dd1144;
- }
+ .atv {
+ color: #dd1144;
+ }
- .dec {
- color: #333333;
- }
+ .dec {
+ color: #333333;
+ }
- .var {
- color: teal;
- }
+ .var {
+ color: teal;
+ }
- .fun {
- color: #990000;
- }
+ .fun {
+ color: #990000;
+ }
}
@media print, projection {
- .str {
- color: #006600;
- }
-
- .kwd {
- color: #006;
- font-weight: bold;
- }
-
- .com {
- color: #600;
- font-style: italic;
- }
-
- .typ {
- color: #404;
- font-weight: bold;
- }
-
- .lit {
- color: #004444;
- }
-
- .pun, .opn, .clo {
- color: #444400;
- }
-
- .tag {
- color: #006;
- font-weight: bold;
- }
-
- .atn {
- color: #440044;
- }
-
- .atv {
- color: #006600;
- }
+ .str {
+ color: #006600;
+ }
+
+ .kwd {
+ color: #006;
+ font-weight: bold;
+ }
+
+ .com {
+ color: #600;
+ font-style: italic;
+ }
+
+ .typ {
+ color: #404;
+ font-weight: bold;
+ }
+
+ .lit {
+ color: #004444;
+ }
+
+ .pun,
+ .opn,
+ .clo {
+ color: #444400;
+ }
+
+ .tag {
+ color: #006;
+ font-weight: bold;
+ }
+
+ .atn {
+ color: #440044;
+ }
+
+ .atv {
+ color: #006600;
+ }
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
- margin: 0;
+ margin: 0;
}
ol.linenums li {
- padding-left: 12px;
- color: #bebec5;
- line-height: 20px;
- text-shadow: 0 1px 0 #fff;
+ padding-left: 12px;
+ color: #bebec5;
+ line-height: 20px;
+ text-shadow: 0 1px 0 #fff;
}
/* IE indents via margin-left */
@@ -128,7 +129,7 @@ li.L6,
li.L7,
li.L8,
li.L9 {
- /* */
+ /* */
}
/* Alternate shading for lines */
@@ -137,5 +138,5 @@ li.L3,
li.L5,
li.L7,
li.L9 {
- /* */
-}
\ No newline at end of file
+ /* */
+}
diff --git a/docs/src/sdk-template/assets/index.html b/docs/src/sdk-template/assets/index.html
index 487fe15b..498c3647 100755
--- a/docs/src/sdk-template/assets/index.html
+++ b/docs/src/sdk-template/assets/index.html
@@ -1,10 +1,10 @@
-
+
-
- Redirector
-
-
-
- Click here to redirect
-
+
+ Redirector
+
+
+
+ Click here to redirect
+
diff --git a/docs/src/sdk-template/assets/js/yuidoc-bootstrap.js b/docs/src/sdk-template/assets/js/yuidoc-bootstrap.js
index 2039696e..a099beeb 100755
--- a/docs/src/sdk-template/assets/js/yuidoc-bootstrap.js
+++ b/docs/src/sdk-template/assets/js/yuidoc-bootstrap.js
@@ -1,130 +1,126 @@
/* global $:true */
-$(function() {
- 'use strict';
-
- //trim whitespace
- $('li','ul.params').each(function(){
- $(this).text( $.trim( $(this).text() ) );
- });
-
- //options radios
- function setUpOptionsCheckboxes() {
- if(localStorage.getItem('f2docsoptions')){
- var optionsArr = JSON.parse(localStorage.f2docsoptions),
- optionsForm = $('#options-form');
-
- for(var i=0;i li').eq(whichLi);
- }
-
- $tabToActivate = $('[data-toggle=tab][href="'+ tabToActivate + '"]');
- if ($tabToActivate.length) {
- $tabToActivate.trigger('click', { ignore: true });
- }
-
- if ($scroll.length) {
- scrollToAnchor($scroll);
- }
- }
-
- // ************************************************************************* //
- // Initializations + Event listeners
- // ************************************************************************* //
-
- //
- // Bind change events for options form checkboxes
- $('#options-form input:checkbox').on('change', function(){
- setOptionDisplayState($(this));
-
- // Update localstorage
- var optionsArr = [];
- $('#options-form input:checkbox').each(function(i,el) {
- optionsArr.push($(el).is(':checked'));
- });
- localStorage.f2docsoptions = JSON.stringify(optionsArr);
- });
-
- function setUpHashChange() {
- $(window).on('hashchange', moveToWindowHash);
- }
-
- // ************************************************************************* //
- // Immediate function calls
- // ************************************************************************* //
- setUpOptionsCheckboxes();
- setUpHashChange();
- if (window.location.hash) {
- moveToWindowHash();
- }
-
+$(function () {
+ 'use strict';
+
+ //trim whitespace
+ $('li', 'ul.params').each(function () {
+ $(this).text($.trim($(this).text()));
+ });
+
+ //options radios
+ function setUpOptionsCheckboxes() {
+ if (localStorage.getItem('f2docsoptions')) {
+ var optionsArr = JSON.parse(localStorage.f2docsoptions),
+ optionsForm = $('#options-form');
+
+ for (var i = 0; i < optionsArr.length; i++) {
+ var box = optionsForm.find('input:checkbox').eq(i);
+ box.prop('checked', optionsArr[i]);
+ setOptionDisplayState(box);
+ }
+ } else {
+ $('#options-form input:checkbox').each(function () {
+ setOptionDisplayState($(this));
+ });
+ }
+ }
+
+ function setOptionDisplayState(box) {
+ var cssName = $.trim(box.parent('label').text()).toLowerCase();
+ if (box.is(':checked')) {
+ $('.' + cssName).css('display', 'block');
+ $('.' + cssName).css('display', 'block');
+ $('tr.' + cssName).css('display', 'table-row');
+ } else {
+ $('.' + cssName).css('display', 'none');
+ }
+ }
+
+ function scrollToAnchor($anchor) {
+ $(document).scrollTop($anchor.offset().top);
+ }
+
+ $('[data-toggle=tab]').on('click', function (event, extraArgs) {
+ // Why? If responding to the click of a link or hashchange already, we really
+ // don't want to change window hash
+ if (extraArgs && extraArgs.ignore === true) {
+ return;
+ }
+ window.location.hash = $(this).attr('href');
+ });
+
+ $('[data-tabid]').on('click', function (event) {
+ var tabToActivate = $(this).attr('data-tabid'),
+ anchor = $(this).attr('data-anchor');
+ event.preventDefault();
+
+ $('[data-toggle=tab][href="' + tabToActivate + '"]').click();
+ // ...huh? http://stackoverflow.com/a/9930611
+ // otherwise, can't select an element by ID if the ID has a '.' in it
+ var scrollAnchor = anchor.replace(/\./g, '\\.');
+ scrollToAnchor($(scrollAnchor));
+ window.location.hash = anchor;
+ });
+
+ function moveToWindowHash() {
+ var hash = window.location.hash,
+ tabToActivate = hash,
+ $tabToActivate = false,
+ $scroll = $(hash);
+
+ if (!hash) {
+ return;
+ }
+
+ if (hash.match(/^#method_/)) {
+ tabToActivate = '#methods';
+ } else if (hash.match(/^#property_/)) {
+ tabToActivate = '#properties';
+ } else if (hash.match(/^#event_/)) {
+ tabToActivate = '#event';
+ } else if (hash.match(/#l\d+/)) {
+ var lineNumber = /#l(\d+)/.exec(hash)[1];
+ var whichLi = parseInt(lineNumber, 10) - 1; //e.g. line 1 is 0th element
+ $scroll = $('ol.linenums > li').eq(whichLi);
+ }
+
+ $tabToActivate = $('[data-toggle=tab][href="' + tabToActivate + '"]');
+ if ($tabToActivate.length) {
+ $tabToActivate.trigger('click', { ignore: true });
+ }
+
+ if ($scroll.length) {
+ scrollToAnchor($scroll);
+ }
+ }
+
+ // ************************************************************************* //
+ // Initializations + Event listeners
+ // ************************************************************************* //
+
+ //
+ // Bind change events for options form checkboxes
+ $('#options-form input:checkbox').on('change', function () {
+ setOptionDisplayState($(this));
+
+ // Update localstorage
+ var optionsArr = [];
+ $('#options-form input:checkbox').each(function (i, el) {
+ optionsArr.push($(el).is(':checked'));
+ });
+ localStorage.f2docsoptions = JSON.stringify(optionsArr);
+ });
+
+ function setUpHashChange() {
+ $(window).on('hashchange', moveToWindowHash);
+ }
+
+ // ************************************************************************* //
+ // Immediate function calls
+ // ************************************************************************* //
+ setUpOptionsCheckboxes();
+ setUpHashChange();
+ if (window.location.hash) {
+ moveToWindowHash();
+ }
});
diff --git a/docs/src/sdk-template/helpers/helpers.js b/docs/src/sdk-template/helpers/helpers.js
index ffca6bb3..ad7ebe49 100755
--- a/docs/src/sdk-template/helpers/helpers.js
+++ b/docs/src/sdk-template/helpers/helpers.js
@@ -1,40 +1,40 @@
module.exports = {
- publicClasses: function(context, options) {
- 'use strict';
- var ret = "";
+ publicClasses: function (context, options) {
+ 'use strict';
+ var ret = '';
- for(var i=0; i < context.length; i++) {
- if(!context[i].itemtype && context[i].access === 'public') {
- ret = ret + options.fn(context[i]);
- } else if (context[i].itemtype) {
- ret = ret + options.fn(context[i]);
- }
- }
+ for (var i = 0; i < context.length; i++) {
+ if (!context[i].itemtype && context[i].access === 'public') {
+ ret = ret + options.fn(context[i]);
+ } else if (context[i].itemtype) {
+ ret = ret + options.fn(context[i]);
+ }
+ }
- return ret;
- },
- search : function(classes, modules) {
- 'use strict';
- var ret = '';
+ return ret;
+ },
+ search: function (classes, modules) {
+ 'use strict';
+ var ret = '';
- for(var i=0; i < classes.length; i++) {
- if(i > 0) {
- ret += ', ';
- }
- ret += "\"" + 'classes/' + classes[i].displayName + "\"";
- }
+ for (var i = 0; i < classes.length; i++) {
+ if (i > 0) {
+ ret += ', ';
+ }
+ ret += '"' + 'classes/' + classes[i].displayName + '"';
+ }
- if(ret.length > 0 && modules.length > 0) {
- ret += ', ';
- }
+ if (ret.length > 0 && modules.length > 0) {
+ ret += ', ';
+ }
- for(var j=0; j < modules.length; j++) {
- if(j > 0) {
- ret += ', ';
- }
- ret += "\"" + 'modules/' + modules[j].displayName + "\"";
- }
+ for (var j = 0; j < modules.length; j++) {
+ if (j > 0) {
+ ret += ', ';
+ }
+ ret += '"' + 'modules/' + modules[j].displayName + '"';
+ }
- return ret;
- }
+ return ret;
+ }
};
diff --git a/docs/src/sdk-template/package.json b/docs/src/sdk-template/package.json
index 2fb63a91..7e886f9e 100755
--- a/docs/src/sdk-template/package.json
+++ b/docs/src/sdk-template/package.json
@@ -1,22 +1,22 @@
{
- "name": "yuidoc-bootstrap-theme",
- "version": "1.0.4",
- "description": "A revamped yuidoc theme with bootstrap",
- "repository": {
- "type": "git",
- "url": "git://github.com/kevinlacotaco/yuidoc-bootstrap-theme.git"
- },
- "keywords": [
- "yuidoc",
- "bootstrap"
- ],
- "author": "Kevin Lakotko",
- "contributors": [
- "Anthony Barone (http://anthonyb.me)"
- ],
- "bugs": {
- "url": "https://github.com/kevinlacotaco/yuidoc-bootstrap-theme/issues"
- },
- "homepage": "https://github.com/kevinlacotaco/yuidoc-bootstrap-theme",
- "license": "MIT"
+ "name": "yuidoc-bootstrap-theme",
+ "version": "1.0.4",
+ "description": "A revamped yuidoc theme with bootstrap",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/kevinlacotaco/yuidoc-bootstrap-theme.git"
+ },
+ "keywords": [
+ "yuidoc",
+ "bootstrap"
+ ],
+ "author": "Kevin Lakotko",
+ "contributors": [
+ "Anthony Barone (http://anthonyb.me)"
+ ],
+ "bugs": {
+ "url": "https://github.com/kevinlacotaco/yuidoc-bootstrap-theme/issues"
+ },
+ "homepage": "https://github.com/kevinlacotaco/yuidoc-bootstrap-theme",
+ "license": "MIT"
}
diff --git a/docs/src/sdk-template/partials/files.handlebars b/docs/src/sdk-template/partials/files.handlebars
index 056c519a..0d3615ff 100755
--- a/docs/src/sdk-template/partials/files.handlebars
+++ b/docs/src/sdk-template/partials/files.handlebars
@@ -1,7 +1,7 @@
-{{fileName}} File
+{{fileName}} File
-
-
-{{fileData}}
-
-
+
+
+ {{fileData}}
+
+
\ No newline at end of file
diff --git a/docs/src/sdk-template/partials/index.handlebars b/docs/src/sdk-template/partials/index.handlebars
index a406b8f6..9417fea6 100755
--- a/docs/src/sdk-template/partials/index.handlebars
+++ b/docs/src/sdk-template/partials/index.handlebars
@@ -1,60 +1,97 @@
-API Reference
+API Reference
-
-The goal of F2 is to define a development standard for the financial services industry that offers a cost saving, risk-reducing method for building innovative, multi-provider solutions.
+
+ The goal of F2 is to define a development standard for the financial services
+ industry that offers a cost saving, risk-reducing method for building
+ innovative, multi-provider solutions.
Getting Started
-To instantly F2-enable your solution, download and include F2.js on your web pages. It's only 7.6kb and works with jQuery, Angular, Dojo, ExtJS and other toolkits. You can use any backend you'd like; .NET, Java, Node.js, PHP and more are all supported.
+To instantly F2-enable your solution, download and include F2.js on your web
+ pages. It's only 7.6kb and works with jQuery, Angular, Dojo, ExtJS and other
+ toolkits. You can use any backend you'd like; .NET, Java, Node.js, PHP and
+ more are all supported.
Latest Version
-The latest version of F2 is {{projectVersion}}. Previous versions are available on GitHub.
+The latest version of F2 is
+ {{projectVersion}}. Previous
+ versions are available on
+ GitHub.
-
+
-Download version {{projectVersion}}
+Download version {{projectVersion}}
Examples
There are a few different types of examples available below.
-
-
-
- Examples
- Visit the [examples](../examples.html) page for a live demo of Apps in a basic Container.
+
+
+
+ Examples
+ Visit the [examples](../examples.html) page for a live demo of Apps in a
+ basic Container.
-
-
-
- Download
- A variety of example Containers and Apps to download and run on your localhost. Most are "plain" javascript, others are written in .NET, PHP and Node.js. The examples source code is also on GitHub.
+
+
+
+ Download
+ A variety of example Containers and Apps to
+ download
+ and run on your localhost. Most are "plain" javascript, others are written
+ in .NET, PHP and Node.js. The
+ examples source
+ code is also on GitHub.
-
-
-
- jsFiddle
- Review a collection of fiddles on jsfiddle.net/user/openF2js.
+
+
+
+ jsFiddle
+ Review a collection of fiddles on
+ jsfiddle.net/user/openF2js.
-
-
-
- Codepen
- Review a collection of pens on codepen.io/openF2.
+
+
+
+ Codepen
+ Review a collection of pens on
+ codepen.io/openF2.
-
-
-
- iOS Demo App
- An iOS app demonstrating F2 App integration using UIWebViews, a javascript bridge for F2 Context, and a native search control.
+
+
+
+ iOS Demo App
+ An
+ iOS app
+ demonstrating F2 App integration using UIWebViews, a javascript bridge for
+ F2 Context, and a native
+ search control.
-
+
\ No newline at end of file
diff --git a/docs/src/sdk-template/partials/options.handlebars b/docs/src/sdk-template/partials/options.handlebars
index 0273dfc1..1e8cfe61 100755
--- a/docs/src/sdk-template/partials/options.handlebars
+++ b/docs/src/sdk-template/partials/options.handlebars
@@ -1,6 +1,6 @@
-
\ No newline at end of file
diff --git a/docs/src/sdk-template/theme.json b/docs/src/sdk-template/theme.json
index e4c4ab71..11880fc4 100755
--- a/docs/src/sdk-template/theme.json
+++ b/docs/src/sdk-template/theme.json
@@ -1,3 +1,3 @@
{
- "yuiSeedUrl": "http://yui.yahooapis.com/combo?3.7.0/build/yui/yui-min.js"
+ "yuiSeedUrl": "http://yui.yahooapis.com/combo?3.7.0/build/yui/yui-min.js"
}
diff --git a/docs/src/template/footer.html b/docs/src/template/footer.html
index 4539253b..b17b93b8 100644
--- a/docs/src/template/footer.html
+++ b/docs/src/template/footer.html
@@ -1,44 +1,85 @@
-
\ No newline at end of file
+
+
+
+ F2
+
+
+
+
+
+
+
+
+
diff --git a/docs/src/template/head.html b/docs/src/template/head.html
index 31288669..0b7cd7e9 100644
--- a/docs/src/template/head.html
+++ b/docs/src/template/head.html
@@ -1,39 +1,97 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
+ (function () {
+ var ga = document.createElement('script');
+ ga.type = 'text/javascript';
+ ga.async = true;
+ ga.src =
+ ('https:' == document.location.protocol
+ ? 'https://ssl'
+ : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(ga, s);
+ })();
+ }
+
diff --git a/docs/src/template/nav.html b/docs/src/template/nav.html
index 93978fe4..31ab1fdc 100644
--- a/docs/src/template/nav.html
+++ b/docs/src/template/nav.html
@@ -1,14 +1,22 @@
-
\ No newline at end of file
+
+
+
+
+
diff --git a/docs/src/webpack.config.js b/docs/src/webpack.config.js
index ebce147a..9cb34623 100644
--- a/docs/src/webpack.config.js
+++ b/docs/src/webpack.config.js
@@ -1,4 +1,4 @@
-const MiniCssExtractPlugin = require("mini-css-extract-plugin");
+const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path');
const pkg = require('../../package.json');
@@ -25,7 +25,10 @@ module.exports = {
loader: 'less-loader',
options: {
lessOptions: {
- banner: `/*! F2 v${pkg.version} ${new Date().toLocaleString('en', { dateStyle: 'short' })} Copyright IHS Markit Digital */\n`,
+ banner: `/*! F2 v${pkg.version} ${new Date().toLocaleString(
+ 'en',
+ { dateStyle: 'short' }
+ )} Copyright IHS Markit Digital */\n`,
compress: true,
modifyVars: {
imgPath: '',
@@ -45,4 +48,4 @@ module.exports = {
filename: '[name].css'
})
]
-}
\ No newline at end of file
+};
diff --git a/examples/apps/CSharp/Content/Scripts/HelloWorld/appclass.js b/examples/apps/CSharp/Content/Scripts/HelloWorld/appclass.js
index b0113b12..59650594 100644
--- a/examples/apps/CSharp/Content/Scripts/HelloWorld/appclass.js
+++ b/examples/apps/CSharp/Content/Scripts/HelloWorld/appclass.js
@@ -1,5 +1,4 @@
-F2.Apps["com_openf2_examples_csharp_helloworld"] = (function() {
-
+F2.Apps['com_openf2_examples_csharp_helloworld'] = (function () {
var App_Class = function (appConfig, appContent, root) {
this.appConfig = appConfig;
this.appContent = appContent;
@@ -7,47 +6,52 @@ F2.Apps["com_openf2_examples_csharp_helloworld"] = (function() {
};
App_Class.prototype.init = function () {
-
- $('a.testAlert', this.$root).on('click', $.proxy(function() {
- alert("Hello World!");
- F2.log('callback fired!');
- }, this));
-
- $('a.testConfirm', this.$root).on('click', $.proxy(function() {
- let r = confirm('Hello World!');
- if (r == true) {
- F2.log('ok callback fired!');
- } else {
- F2.log('cancel callback fired!');
- }
- }, this));
-
+ $('a.testAlert', this.$root).on(
+ 'click',
+ $.proxy(function () {
+ alert('Hello World!');
+ F2.log('callback fired!');
+ }, this)
+ );
+
+ $('a.testConfirm', this.$root).on(
+ 'click',
+ $.proxy(function () {
+ let r = confirm('Hello World!');
+ if (r == true) {
+ F2.log('ok callback fired!');
+ } else {
+ F2.log('cancel callback fired!');
+ }
+ }, this)
+ );
// bind symbol change event
- F2.Events.on(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, $.proxy(this._handleSymbolChange, this));
+ F2.Events.on(
+ F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
+ $.proxy(this._handleSymbolChange, this)
+ );
};
App_Class.prototype._handleSymbolChange = function (data) {
-
- var symbolAlert = $("div.symbolAlert", this.$root);
- symbolAlert = (symbolAlert.length)
- ? symbolAlert
- : this._renderSymbolAlert();
-
- $("span:first", symbolAlert).text("The symbol has been changed to " + data.symbol);
+ var symbolAlert = $('div.symbolAlert', this.$root);
+ symbolAlert = symbolAlert.length ? symbolAlert : this._renderSymbolAlert();
+ $('span:first', symbolAlert).text(
+ 'The symbol has been changed to ' + data.symbol
+ );
};
- App_Class.prototype._renderSymbolAlert = function() {
-
- return $([
+ App_Class.prototype._renderSymbolAlert = function () {
+ return $(
+ [
'',
- '',
- '',
+ '',
+ '',
''
- ].join(''))
- .prependTo($("." + F2.Constants.Css.APP_CONTAINER,this.$root));
+ ].join('')
+ ).prependTo($('.' + F2.Constants.Css.APP_CONTAINER, this.$root));
};
return App_Class;
-})();
\ No newline at end of file
+})();
diff --git a/examples/apps/JavaScript/CDS/app.css b/examples/apps/JavaScript/CDS/app.css
index a83c739a..03a84894 100644
--- a/examples/apps/JavaScript/CDS/app.css
+++ b/examples/apps/JavaScript/CDS/app.css
@@ -1,6 +1,11 @@
-.com_openf2_examples_javascript_cds h5 {margin-bottom: 0;}
+.com_openf2_examples_javascript_cds h5 {
+ margin-bottom: 0;
+}
-.com_openf2_examples_javascript_cds .table th{white-space: nowrap; line-height: 13px;}
+.com_openf2_examples_javascript_cds .table th {
+ white-space: nowrap;
+ line-height: 13px;
+}
.com_openf2_examples_javascript_cds .table th,
.com_openf2_examples_javascript_cds .table td {
text-align: right;
@@ -12,11 +17,11 @@
}
.com_openf2_examples_javascript_cds .pos {
- color:green;
+ color: green;
}
.com_openf2_examples_javascript_cds .neg {
- color:red;
+ color: red;
}
.com_openf2_examples_javascript_cds table table {
@@ -26,4 +31,7 @@
.com_openf2_examples_javascript_cds table table tr {
cursor: text;
}
-.com_openf2_examples_javascript_cds p {line-height: 13px; color: #8F8F8F;}
\ No newline at end of file
+.com_openf2_examples_javascript_cds p {
+ line-height: 13px;
+ color: #8f8f8f;
+}
diff --git a/examples/apps/JavaScript/CDS/appclass.js b/examples/apps/JavaScript/CDS/appclass.js
index c44ab303..c003cfaa 100644
--- a/examples/apps/JavaScript/CDS/appclass.js
+++ b/examples/apps/JavaScript/CDS/appclass.js
@@ -1,126 +1,134 @@
-F2.Apps['com_openf2_examples_javascript_cds'] = (function (appConfig, appContent, root) {
-
- (function(){
+F2.Apps['com_openf2_examples_javascript_cds'] = (function (
+ appConfig,
+ appContent,
+ root
+) {
+ (function () {
//http://javascript.crockford.com/remedial.html
- String.prototype.supplant = function(o) {
- return this.replace(/{([^{}]*)}/g,
- function(a, b) {
- var r = o[b];
- return typeof r === 'string' || typeof r === 'number' ? r : a;
- }
- );
+ String.prototype.supplant = function (o) {
+ return this.replace(/{([^{}]*)}/g, function (a, b) {
+ var r = o[b];
+ return typeof r === 'string' || typeof r === 'number' ? r : a;
+ });
};
})();
- var App = function(appConfig, appContent, root) {
- this.appConfig = appConfig;
- this.appContent = appContent;
- this.root = root;
- this.$root = $(root);
- this.$settings = $('form[data-f2-view="settings"]', this.$root);
- this.settings = {
- allowExternalAdd: false
- };
- };
-
- App.prototype.init = function() {
+ var App = function (appConfig, appContent, root) {
+ this.appConfig = appConfig;
+ this.appContent = appContent;
+ this.root = root;
+ this.$root = $(root);
+ this.$settings = $('form[data-f2-view="settings"]', this.$root);
+ this.settings = {
+ allowExternalAdd: false
+ };
+ };
+
+ App.prototype.init = function () {
this.getData();
- this.initEvents();
- };
-
- App.prototype.COOKIE_NAME = "F2_Examples_CDS";
-
- App.prototype.ROW = [
- '',
- '',
- '{name}',
- ' ',
- '{spread} ',
- '{changePct} ',
+ this.initEvents();
+ };
+
+ App.prototype.COOKIE_NAME = 'F2_Examples_CDS';
+
+ App.prototype.ROW = [
+ ' ',
+ "",
+ "{name}",
+ ' ',
+ '{spread} ',
+ '{changePct} ',
' '
].join('');
App.prototype.data = [];
- App.prototype.initEvents = function(){
-
+ App.prototype.initEvents = function () {
// bind save settings
- this.$root.on("click", "button.save", $.proxy(function(){
- this._saveSettings();
- },this));
-
+ this.$root.on(
+ 'click',
+ 'button.save',
+ $.proxy(function () {
+ this._saveSettings();
+ }, this)
+ );
};
- App.prototype._saveSettings = function(){
- this.settings.allowExternalAdd = $('input[name=allowExternalAdd]', this.$settings).is(':checked');
+ App.prototype._saveSettings = function () {
+ this.settings.allowExternalAdd = $(
+ 'input[name=allowExternalAdd]',
+ this.$settings
+ ).is(':checked');
};
- App.prototype._populateSettings = function(){
- $('input[name=allowExternalAdd]', this.$settings).attr('checked', this.settings.alltableswithkeys);
- }
+ App.prototype._populateSettings = function () {
+ $('input[name=allowExternalAdd]', this.$settings).attr(
+ 'checked',
+ this.settings.alltableswithkeys
+ );
+ };
- App.prototype._supportsLocalStorage = function(){
- return (typeof(Storage) !== "undefined");
- };
+ App.prototype._supportsLocalStorage = function () {
+ return typeof Storage !== 'undefined';
+ };
- App.prototype.drawTable = function(rTighteners, rWideners){
- var TightenerTable = [], WidenerTable = [], TableHeading = [], self = this;
+ App.prototype.drawTable = function (rTighteners, rWideners) {
+ var TightenerTable = [],
+ WidenerTable = [],
+ TableHeading = [],
+ self = this;
TableHeading.push(
- '',
- '',
- '',
- 'Name ',
- 'Spread (bps) ',
- '1 Day
% Change ',
- ' ',
- '',
- ''
+ "",
+ '',
+ '',
+ "Name ",
+ 'Spread (bps) ',
+ '1 Day
% Change ',
+ ' ',
+ '',
+ ''
);
TightenerTable = TightenerTable.concat(TableHeading);
- TightenerTable.push(
- rTighteners,
- '',
- '
'
- );
+ TightenerTable.push(rTighteners, '', '
');
WidenerTable = WidenerTable.concat(TableHeading);
- WidenerTable.push(
- rWideners,
- '',
- ''
- );
-
- $("div.cdsMovers", this.root).html([
- 'Global Daily Tighteners (five-year CDS)
',
- TightenerTable.join(''),
- 'Global Daily Wideners (five-year CDS)
',
- WidenerTable.join('')].join('')
+ WidenerTable.push(rWideners, '', '');
+
+ $('div.cdsMovers', this.root).html(
+ [
+ 'Global Daily Tighteners (five-year CDS)
',
+ TightenerTable.join(''),
+ 'Global Daily Wideners (five-year CDS)
',
+ WidenerTable.join('')
+ ].join('')
);
-
};
- App.prototype.drawCDSList = function(bTighteners, cdsData){
+ App.prototype.drawCDSList = function (bTighteners, cdsData) {
+ var label = bTighteners ? 'Tightener' : 'Widener';
+ var rRows = [],
+ self = this;
- var label = bTighteners ? "Tightener" : "Widener";
- var rRows = [], self = this;
-
- if (cdsData.length < 1){
- rRows.push('CDS '+label+' data unavailable. ')
+ if (cdsData.length < 1) {
+ rRows.push(
+ 'CDS ' +
+ label +
+ ' data unavailable. '
+ );
} else {
- $.each(cdsData, function(idx,item){
-
+ $.each(cdsData, function (idx, item) {
item = item || {};
- if(self.CloseDate == null && item.PrettyDate != null){
+ if (self.CloseDate == null && item.PrettyDate != null) {
self.CloseDate = item.PrettyDate;
$('p.cdsDate span', self.root).html(self.CloseDate);
}
var cdsData = {
- name: item.LongName,
- spread: CDSAppFormat.bps(item.ConvSpread),
- changePct: CDSAppFormat.addColorPercent(item.DailyPercentChange)
+ name: item.LongName,
+ spread: CDSAppFormat.bps(item.ConvSpread),
+ changePct: CDSAppFormat.addColorPercent(item.DailyPercentChange)
};
rRows.push(self.ROW.supplant(cdsData));
@@ -128,56 +136,61 @@ F2.Apps['com_openf2_examples_javascript_cds'] = (function (appConfig, appContent
}
return rRows.join('');
- };
+ };
App.prototype.CloseDate = null;
- App.prototype.getData = function(){
-
- var rTightenerData = [], rWidenerData = [];
- var _url = "http://dev.markitondemand.com/Api/SovereignCDSMovers/jsonp";
+ App.prototype.getData = function () {
+ var rTightenerData = [],
+ rWidenerData = [];
+ var _url = 'http://dev.markitondemand.com/Api/SovereignCDSMovers/jsonp';
$.ajax({
url: _url,
data: {
tightenersOnly: 1
},
- dataType: "jsonp",
+ dataType: 'jsonp',
context: this
- }).done(function(jqxhr){
- rTightenerData.push(this.drawCDSList(true, jqxhr.Data || []));
- $.ajax({
- url: _url,
- data: {
- tightenersOnly: 0
- },
- dataType: "jsonp",
- context: this
- }).done(function(jqxhr2){
- rWidenerData.push(this.drawCDSList(false, jqxhr2.Data || []));
- }).fail(function(jqxh2r){
- F2.log("OOPS. CDS Wideners data was unavailable.");
+ })
+ .done(function (jqxhr) {
+ rTightenerData.push(this.drawCDSList(true, jqxhr.Data || []));
+ $.ajax({
+ url: _url,
+ data: {
+ tightenersOnly: 0
+ },
+ dataType: 'jsonp',
+ context: this
+ })
+ .done(function (jqxhr2) {
+ rWidenerData.push(this.drawCDSList(false, jqxhr2.Data || []));
+ })
+ .fail(function (jqxh2r) {
+ F2.log('OOPS. CDS Wideners data was unavailable.');
+ rWidenerData.push(this.drawCDSList(false, []));
+ })
+ .always(function () {
+ this.drawTable(rTightenerData, rWidenerData);
+ });
+ })
+ .fail(function (jqxhr) {
+ F2.log('OOPS. CDS Tighteners data was unavailable.');
+ rTightenerData.push(this.drawCDSList(true, []));
rWidenerData.push(this.drawCDSList(false, []));
- }).always(function(){
- this.drawTable(rTightenerData,rWidenerData);
+ this.drawTable(rTightenerData, rWidenerData);
});
- }).fail(function(jqxhr){
- F2.log("OOPS. CDS Tighteners data was unavailable.");
- rTightenerData.push(this.drawCDSList(true,[]));
- rWidenerData.push(this.drawCDSList(false, []));
- this.drawTable(rTightenerData,rWidenerData);
- });
};
/**
* Number format helpers
*/
- CDSAppFormat = function(){
+ CDSAppFormat = function () {
this.magnitudes = {
- shortcap : ["", "K", "M", "B", "T"]
+ shortcap: ['', 'K', 'M', 'B', 'T']
};
- }
+ };
- CDSAppFormat.prototype.getMagnitude = function(numDigits,value,type) {
+ CDSAppFormat.prototype.getMagnitude = function (numDigits, value, type) {
value = Math.abs(value);
var c = 0;
while (value >= 1000 && c < 4) {
@@ -186,34 +199,34 @@ F2.Apps['com_openf2_examples_javascript_cds'] = (function (appConfig, appContent
}
value = value.toFixed(numDigits);
return value + this.magnitudes[type][c];
- }
+ };
- CDSAppFormat.prototype.lastPrice = function(value){
+ CDSAppFormat.prototype.lastPrice = function (value) {
value = Number(value);
value = value.toFixed(2);
- return "$" + value;
- }
+ return '$' + value;
+ };
- CDSAppFormat.prototype.bps = function(value){
+ CDSAppFormat.prototype.bps = function (value) {
value = Number(value);
value = value.toFixed(2);
return value;
- }
+ };
- CDSAppFormat.prototype.addColorPercent = function(value){
- if(value && !isNaN(value) && isFinite(value)){
- if (value > 0){
- return "" + value.toFixed(2) + "%";
+ CDSAppFormat.prototype.addColorPercent = function (value) {
+ if (value && !isNaN(value) && isFinite(value)) {
+ if (value > 0) {
+ return "" + value.toFixed(2) + '%';
} else {
- return "" + value.toFixed(2) + "%";
+ return "" + value.toFixed(2) + '%';
}
}
return value.toFixed(2) + '%';
- }
+ };
- CDSAppFormat.prototype.comma = function(value) {
+ CDSAppFormat.prototype.comma = function (value) {
value = String(value);
- if (value.length < 6 && value.indexOf(".") > -1) {
+ if (value.length < 6 && value.indexOf('.') > -1) {
return value;
} else {
x = value.split('.');
@@ -225,13 +238,12 @@ F2.Apps['com_openf2_examples_javascript_cds'] = (function (appConfig, appContent
}
return x1 + x2;
}
- }
+ };
CDSAppFormat = new CDSAppFormat();
/**
* end number formatting helpers
*/
- return App;
-
-})();
\ No newline at end of file
+ return App;
+})();
diff --git a/examples/apps/JavaScript/CDS/manifest.js b/examples/apps/JavaScript/CDS/manifest.js
index c2defcb2..81d18307 100644
--- a/examples/apps/JavaScript/CDS/manifest.js
+++ b/examples/apps/JavaScript/CDS/manifest.js
@@ -1,33 +1,29 @@
F2_jsonpCallback_com_openf2_examples_javascript_cds({
- "scripts":[
- "../apps/JavaScript/CDS/appclass.js"
- ],
- "styles":[
- "../apps/JavaScript/CDS/app.css"
- ],
- "apps":[
+ scripts: ['../apps/JavaScript/CDS/appclass.js'],
+ styles: ['../apps/JavaScript/CDS/app.css'],
+ apps: [
{
- "html":[
+ html: [
'',
- '',
- '',
- '',
- '
',
- '',
- '',
- 'Falling (or narrowing) spreads indicate the perceived risk of default is falling. Rising (or widening) spreads indicate the perceived risk of default is rising.',
- '
',
- '',
- 'All CDS are denominated in U.S. Dollars except U.S. sovereigns, which are in Euros.',
- '
',
- '',
- '',
+ '',
+ '',
+ '',
+ '
',
+ '',
+ '',
+ 'Falling (or narrowing) spreads indicate the perceived risk of default is falling. Rising (or widening) spreads indicate the perceived risk of default is rising.',
+ '
',
+ '',
+ 'All CDS are denominated in U.S. Dollars except U.S. sovereigns, which are in Euros.',
+ '
',
+ '',
+ '',
''
- ].join("")
+ ].join('')
}
]
-})
\ No newline at end of file
+});
diff --git a/examples/apps/JavaScript/Chart/app.css b/examples/apps/JavaScript/Chart/app.css
index 33a63594..850503ab 100644
--- a/examples/apps/JavaScript/Chart/app.css
+++ b/examples/apps/JavaScript/Chart/app.css
@@ -3,5 +3,5 @@
}
.com_openf2_examples_javascript_chart #f2-1year-chart {
- height:234px;
-}
\ No newline at end of file
+ height: 234px;
+}
diff --git a/examples/apps/JavaScript/Chart/appclass.js b/examples/apps/JavaScript/Chart/appclass.js
index 6068a44a..6c396624 100644
--- a/examples/apps/JavaScript/Chart/appclass.js
+++ b/examples/apps/JavaScript/Chart/appclass.js
@@ -1,156 +1,183 @@
-F2.Apps["com_openf2_examples_javascript_chart"] = (function(){
-
+F2.Apps['com_openf2_examples_javascript_chart'] = (function () {
var app = function (appConfig, appContent, root) {
- this.symbol = "MSFT";
+ this.symbol = 'MSFT';
this.appConfig = appConfig;
this.appContent = appContent;
this.root = root;
this.$root = $(root);
- this.$app = $("#f2-1year-chart", this.$root);
+ this.$app = $('#f2-1year-chart', this.$root);
//set configuration
this.config();
};
- app.prototype.config = function() {
-
+ app.prototype.config = function () {
var defaults = {
- backgroundColor: '#fff',
- lineColor: '#428bca',
- lineWidth: 1.5,
- gridColor: '#DDDDDD',
- gridAltColor: '#F7F7F7',
- fontColor: '#444444',
- fontFamily: 'Arial, sans-serif',
- fontSize: 12,
- lineHeight: 1.2,
- greenBar: '#2EA94F',
- redBar: '#DB411C'
- },
- styleImport = (this.appConfig.context && this.appConfig.context.style)?this.appConfig.context.style:{};
+ backgroundColor: '#fff',
+ lineColor: '#428bca',
+ lineWidth: 1.5,
+ gridColor: '#DDDDDD',
+ gridAltColor: '#F7F7F7',
+ fontColor: '#444444',
+ fontFamily: 'Arial, sans-serif',
+ fontSize: 12,
+ lineHeight: 1.2,
+ greenBar: '#2EA94F',
+ redBar: '#DB411C'
+ },
+ styleImport =
+ this.appConfig.context && this.appConfig.context.style
+ ? this.appConfig.context.style
+ : {};
/** for example purposes*/
console.group('Chart app');
- console.info('The chart app (com_openf2_examples_javascript_chart) has configuration options which can be overriden by using Context. Set a "style" property in the AppConfig\'s Context property. The current AppConfig is on the next line.');
+ console.info(
+ 'The chart app (com_openf2_examples_javascript_chart) has configuration options which can be overriden by using Context. Set a "style" property in the AppConfig\'s Context property. The current AppConfig is on the next line.'
+ );
console.info(this.appConfig);
- console.info('The chart\'s configuration parameters (defaults) are found in the following hash');
+ console.info(
+ "The chart's configuration parameters (defaults) are found in the following hash"
+ );
console.info(defaults);
console.groupEnd();
this.CHT_CONTAINER = 'f2-1year-chart';
- this.CHART_STYLES = $.extend({},defaults,styleImport);
+ this.CHART_STYLES = $.extend({}, defaults, styleImport);
};
- app.prototype.redraw = function(data) {
+ app.prototype.redraw = function (data) {
this.hc = null;
this.symbol = data.symbol;
this.getData();
};
- app.prototype.init = function() {
-
+ app.prototype.init = function () {
this.getData();
//setup container symbol change listener to draw new chart.
- F2.Events.on(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, $.proxy(function(symbolData){
+ F2.Events.on(
+ F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
+ $.proxy(function (symbolData) {
this.redraw(symbolData);
- },this)
+ }, this)
);
};
- app.prototype.getData = function() {
-
+ app.prototype.getData = function () {
$.ajax({
- data: {
- symbol: this.symbol,
- duration: 365 // Fixed to one year
+ data: {
+ symbol: this.symbol,
+ duration: 365 // Fixed to one year
},
url: 'http://dev.markitondemand.com/Api/Timeseries/jsonp',
dataType: 'jsonp',
context: this
-
- }).done(function(jqxhr,txtStatus){
- //Catch errors
- if ( !jqxhr.Data || jqxhr.Message ) {
- if ( typeof console == 'object' ) console.error('Error: ', jqxhr.Message);
+ })
+ .done(function (jqxhr, txtStatus) {
+ //Catch errors
+ if (!jqxhr.Data || jqxhr.Message) {
+ if (typeof console == 'object')
+ console.error('Error: ', jqxhr.Message);
+ this._chartError(jqxhr);
+ return;
+ }
+ this.HandleAPIData(jqxhr);
+ })
+ .fail(function (jqxhr, txtStatus) {
+ F2.log('Could not generate chart.', jqxhr);
this._chartError(jqxhr);
- return;
- }
- this.HandleAPIData(jqxhr);
-
- }).fail(function(jqxhr,txtStatus){
- F2.log('Could not generate chart.', jqxhr);
- this._chartError(jqxhr);
- });
+ });
};
- app.prototype._chartError = function(jqxhr) {
- F2.log("Price Chart Error", jqxhr);
+ app.prototype._chartError = function (jqxhr) {
+ F2.log('Price Chart Error', jqxhr);
- this.$app.html("An error occurred loading price data for " +this.symbol+ ".
");
+ this.$app.html(
+ 'An error occurred loading price data for ' + this.symbol + '.
'
+ );
};
-
-
- // Parses API data to provide HighCharts-ready data series for close values,
+ // Parses API data to provide HighCharts-ready data series for close values,
// additionally deriving up/down month indicators.
//
app.prototype.HandleAPIData = function (json) {
-
$(this.CHT_CONTAINER).empty();
// Set up vars for first data series
var apiDates = json.Data.SeriesDates,
apiValues = json.Data.Series.close.values,
- closeSeriesData = [ ];
-
+ closeSeriesData = [];
+
// Translate API JSON into a HighCharts-format data series
- for ( var i = 0; i < apiDates.length; i++ ) {
+ for (var i = 0; i < apiDates.length; i++) {
var dat = new Date(apiDates[i]);
var dateIn = Date.UTC(dat.getFullYear(), dat.getMonth(), dat.getDate());
var val = apiValues[i];
- closeSeriesData.push([dateIn,val]);
+ closeSeriesData.push([dateIn, val]);
}
// Instantiate a new chart with base configuration options (everything but the data)
var hcChartObj = new Highcharts.Chart(this.getBaselineOptions());
- hcChartObj.series[0].setData(closeSeriesData, true); // Set close-values series data
+ hcChartObj.series[0].setData(closeSeriesData, true); // Set close-values series data
//hcChartObj.setTitle({ text: ('One-year price movement for ' + json.Data.Name).toUpperCase() }); // Set title
- hcChartObj.setTitle({ text:'' });
+ hcChartObj.setTitle({ text: '' });
+
+ // No options setting is available for this, so force the price line to be rounded
+ $('.highcharts-series path:first', this.root)
+ .attr('stroke-linejoin', 'round')
+ .attr('stroke-linecap', 'round');
- // No options setting is available for this, so force the price line to be rounded
- $('.highcharts-series path:first', this.root).attr('stroke-linejoin', 'round').attr('stroke-linecap', 'round');
-
// Set up vars for up/down month data series
- var currentMonthName, currentJSDate, currentJSUTCDate, currentVal,
- upSeriesData = [ ],
- downSeriesData = [ ];
- var dataRanges = hcChartObj.yAxis[0].getExtremes(); // Will need to reset to this later
- minVal = dataRanges.min, // Will set red/green indicators to this value
- apiValues = json.Data.Series.close.values,
- apiDates = json.Data.SeriesDates,
- firstMonthName = apiDates[0].substr(4, 3), // First!
- prevMonthName = firstMonthName,
- prevJSDate = new Date(prevMonthName + ' 1, ' + apiDates[0].substr(-4)),
- prevJSUTCDate = Date.UTC(prevJSDate.getFullYear(), prevJSDate.getMonth(), prevJSDate.getDate()),
- prevVal = apiValues[0];
-
- // Now walk through all data points again (had to do it once before to get the ranges),
- // looking for month boundaries and deciding if the previous month ended up or down over
+ var currentMonthName,
+ currentJSDate,
+ currentJSUTCDate,
+ currentVal,
+ upSeriesData = [],
+ downSeriesData = [];
+ var dataRanges = hcChartObj.yAxis[0].getExtremes(); // Will need to reset to this later
+ (minVal = dataRanges.min), // Will set red/green indicators to this value
+ (apiValues = json.Data.Series.close.values),
+ (apiDates = json.Data.SeriesDates),
+ (firstMonthName = apiDates[0].substr(4, 3)), // First!
+ (prevMonthName = firstMonthName),
+ (prevJSDate = new Date(prevMonthName + ' 1, ' + apiDates[0].substr(-4))),
+ (prevJSUTCDate = Date.UTC(
+ prevJSDate.getFullYear(),
+ prevJSDate.getMonth(),
+ prevJSDate.getDate()
+ )),
+ (prevVal = apiValues[0]);
+
+ // Now walk through all data points again (had to do it once before to get the ranges),
+ // looking for month boundaries and deciding if the previous month ended up or down over
// the preceding month's close
- for ( var i = 1; i < apiDates.length; i++ ) {
+ for (var i = 1; i < apiDates.length; i++) {
currentMonthName = apiDates[i].substr(4, 3);
- if ( currentMonthName != prevMonthName ) { // Into a new month in the data
- currentVal = apiValues[i - 1]; // Last close in the preceding month
- currentJSDate = new Date(currentMonthName + ' 1, ' + apiDates[i].substr(-4));
- currentJSUTCDate = Date.UTC(currentJSDate.getFullYear(), currentJSDate.getMonth(), currentJSDate.getDate());
- if ( prevMonthName != firstMonthName ) { // Skip the first month, it's incomplete
- if ( currentVal >= prevVal ) {
- upSeriesData.push( [ prevJSUTCDate, minVal ], [ currentJSUTCDate, minVal ] );
- downSeriesData.push( [ currentJSUTCDate, null ] );
- }
- else {
- downSeriesData.push( [ prevJSUTCDate, minVal ], [ currentJSUTCDate, minVal ] );
- upSeriesData.push( [ currentJSUTCDate, null ] );
+ if (currentMonthName != prevMonthName) {
+ // Into a new month in the data
+ currentVal = apiValues[i - 1]; // Last close in the preceding month
+ currentJSDate = new Date(
+ currentMonthName + ' 1, ' + apiDates[i].substr(-4)
+ );
+ currentJSUTCDate = Date.UTC(
+ currentJSDate.getFullYear(),
+ currentJSDate.getMonth(),
+ currentJSDate.getDate()
+ );
+ if (prevMonthName != firstMonthName) {
+ // Skip the first month, it's incomplete
+ if (currentVal >= prevVal) {
+ upSeriesData.push(
+ [prevJSUTCDate, minVal],
+ [currentJSUTCDate, minVal]
+ );
+ downSeriesData.push([currentJSUTCDate, null]);
+ } else {
+ downSeriesData.push(
+ [prevJSUTCDate, minVal],
+ [currentJSUTCDate, minVal]
+ );
+ upSeriesData.push([currentJSUTCDate, null]);
}
}
prevVal = currentVal;
@@ -159,23 +186,33 @@ F2.Apps["com_openf2_examples_javascript_chart"] = (function(){
}
}
// Add one last interval for the partial month-to-date
- currentVal = apiValues[i - 1]; // Last close value in the data
+ currentVal = apiValues[i - 1]; // Last close value in the data
currentJSDate = new Date(apiDates[i - 1]);
- currentJSUTCDate = Date.UTC(currentJSDate.getFullYear(), currentJSDate.getMonth(), currentJSDate.getDate());
- if ( currentVal >= prevVal ) upSeriesData.push( [ prevJSUTCDate, minVal ], [ currentJSUTCDate, minVal ] );
- else downSeriesData.push( [ prevJSUTCDate, minVal ], [ currentJSUTCDate, minVal ] );
+ currentJSUTCDate = Date.UTC(
+ currentJSDate.getFullYear(),
+ currentJSDate.getMonth(),
+ currentJSDate.getDate()
+ );
+ if (currentVal >= prevVal)
+ upSeriesData.push([prevJSUTCDate, minVal], [currentJSUTCDate, minVal]);
+ else
+ downSeriesData.push([prevJSUTCDate, minVal], [currentJSUTCDate, minVal]);
// Add the up month/down month data to the chart's series
- hcChartObj.series[1].setData(upSeriesData, false);
- hcChartObj.series[2].setData(downSeriesData, false);
-
- hcChartObj.yAxis[0].setExtremes(dataRanges.dataMin, dataRanges.dataMax, true, false);
+ hcChartObj.series[1].setData(upSeriesData, false);
+ hcChartObj.series[2].setData(downSeriesData, false);
+ hcChartObj.yAxis[0].setExtremes(
+ dataRanges.dataMin,
+ dataRanges.dataMax,
+ true,
+ false
+ );
};
// Defines the HighCharts configuration options.
//
- app.prototype.getBaselineOptions = function () {
+ app.prototype.getBaselineOptions = function () {
return {
chart: {
borderColor: 'rgba(255, 255, 255, 0.0)',
@@ -210,20 +247,22 @@ F2.Apps["com_openf2_examples_javascript_chart"] = (function(){
}
}
},
- series: [{
- color: this.CHART_STYLES.lineColor,
- name: 'Close price'
- },
- {
- color: this.CHART_STYLES.greenBar,
- lineWidth: 6,
- name: 'Up months'
- },
- {
- color: this.CHART_STYLES.redBar,
- lineWidth: 6,
- name: 'Down months'
- }],
+ series: [
+ {
+ color: this.CHART_STYLES.lineColor,
+ name: 'Close price'
+ },
+ {
+ color: this.CHART_STYLES.greenBar,
+ lineWidth: 6,
+ name: 'Up months'
+ },
+ {
+ color: this.CHART_STYLES.redBar,
+ lineWidth: 6,
+ name: 'Down months'
+ }
+ ],
title: {
align: 'left',
style: {
@@ -238,10 +277,15 @@ F2.Apps["com_openf2_examples_javascript_chart"] = (function(){
borderRadius: 1,
crosshairs: true,
formatter: function () {
- if ( this.series.name == 'Close price' ) {
- return '' + Highcharts.dateFormat('%b %e %Y', this.x) + ': $' + Highcharts.numberFormat(this.y, 2) + '';
- }
- else return false;
+ if (this.series.name == 'Close price') {
+ return (
+ '' +
+ Highcharts.dateFormat('%b %e %Y', this.x) +
+ ': $' +
+ Highcharts.numberFormat(this.y, 2) +
+ ''
+ );
+ } else return false;
},
style: {
color: this.CHART_STYLES.fontColor,
@@ -251,89 +295,96 @@ F2.Apps["com_openf2_examples_javascript_chart"] = (function(){
padding: this.CHART_STYLES.fontSize
}
},
- xAxis: [{ // Bottom datetime axis (short intervals)
- dateTimeLabelFormats: {
- minute: '%l:%M%P',
- hour: '%l%P',
- day: '%a',
- day: '%b %e',
- week: '%b %e',
- month: '%b',
- year: '%Y'
- },
- gridLineDashStyle: 'shortdot',
- gridLineColor: this.CHART_STYLES.gridAltColor,
- gridLineWidth: 1,
- labels: {
- align: 'left',
- style: {
- color: this.CHART_STYLES.fontColor,
- fontFamily: this.CHART_STYLES.fontFamily,
- fontSize: this.CHART_STYLES.fontSize
+ xAxis: [
+ {
+ // Bottom datetime axis (short intervals)
+ dateTimeLabelFormats: {
+ minute: '%l:%M%P',
+ hour: '%l%P',
+ day: '%a',
+ day: '%b %e',
+ week: '%b %e',
+ month: '%b',
+ year: '%Y'
},
- x: (this.CHART_STYLES.fontSize / 2),
- y: (this.CHART_STYLES.fontSize * this.CHART_STYLES.lineHeight * 1.5)
- },
- lineColor: this.CHART_STYLES.gridColor,
- tickColor: this.CHART_STYLES.gridColor,
- tickInterval: (30 * 24 * 3600 * 1000), // One month
- tickLength: (this.CHART_STYLES.fontSize * this.CHART_STYLES.lineHeight * 1.5),
- type: 'datetime'
- },{ // Top datetime axis (longer intervals)
- dateTimeLabelFormats: {
- day: '%a', // Default
- week: '%a',
- month: '%b %Y',
- year: '%Y'
- },
- gridLineWidth: 1,
- gridLineColor: this.CHART_STYLES.gridColor,
- labels: {
- align: 'left',
- style: {
- color: this.CHART_STYLES.fontColor,
- fontFamily: this.CHART_STYLES.fontFamily,
- fontSize: this.CHART_STYLES.fontSize
+ gridLineDashStyle: 'shortdot',
+ gridLineColor: this.CHART_STYLES.gridAltColor,
+ gridLineWidth: 1,
+ labels: {
+ align: 'left',
+ style: {
+ color: this.CHART_STYLES.fontColor,
+ fontFamily: this.CHART_STYLES.fontFamily,
+ fontSize: this.CHART_STYLES.fontSize
+ },
+ x: this.CHART_STYLES.fontSize / 2,
+ y: this.CHART_STYLES.fontSize * this.CHART_STYLES.lineHeight * 1.5
},
- x: (this.CHART_STYLES.fontSize / 2)
+ lineColor: this.CHART_STYLES.gridColor,
+ tickColor: this.CHART_STYLES.gridColor,
+ tickInterval: 30 * 24 * 3600 * 1000, // One month
+ tickLength:
+ this.CHART_STYLES.fontSize * this.CHART_STYLES.lineHeight * 1.5,
+ type: 'datetime'
},
- lineColor: this.CHART_STYLES.gridColor,
- linkedTo: 0,
- opposite: true,
- tickColor: this.CHART_STYLES.gridColor,
- tickInterval: (365 * 24 * 3600 * 1000), // One year
- tickLength: (this.CHART_STYLES.fontSize * this.CHART_STYLES.lineHeight),
- type: 'datetime'
- }],
- yAxis: [{
- gridLineColor: this.CHART_STYLES.gridColor,
- labels: {
- align: 'left',
- formatter: function () {
- return Highcharts.numberFormat(this.value, 2);
+ {
+ // Top datetime axis (longer intervals)
+ dateTimeLabelFormats: {
+ day: '%a', // Default
+ week: '%a',
+ month: '%b %Y',
+ year: '%Y'
},
- style: {
- color: this.CHART_STYLES.fontColor,
- fontFamily: this.CHART_STYLES.fontFamily,
- fontSize: this.CHART_STYLES.fontSize
+ gridLineWidth: 1,
+ gridLineColor: this.CHART_STYLES.gridColor,
+ labels: {
+ align: 'left',
+ style: {
+ color: this.CHART_STYLES.fontColor,
+ fontFamily: this.CHART_STYLES.fontFamily,
+ fontSize: this.CHART_STYLES.fontSize
+ },
+ x: this.CHART_STYLES.fontSize / 2
},
- x: 0,
- y: (this.CHART_STYLES.fontSize + 3)
- },
- maxPadding: 0,
- minPadding: 0,
- opposite: true,
- showFirstLabel: false,
- tickColor: this.CHART_STYLES.gridColor,
- tickLength: 100, // Cropped at left of chart
- tickWidth: 1,
- title: {
- text: ''
+ lineColor: this.CHART_STYLES.gridColor,
+ linkedTo: 0,
+ opposite: true,
+ tickColor: this.CHART_STYLES.gridColor,
+ tickInterval: 365 * 24 * 3600 * 1000, // One year
+ tickLength: this.CHART_STYLES.fontSize * this.CHART_STYLES.lineHeight,
+ type: 'datetime'
}
- }]
+ ],
+ yAxis: [
+ {
+ gridLineColor: this.CHART_STYLES.gridColor,
+ labels: {
+ align: 'left',
+ formatter: function () {
+ return Highcharts.numberFormat(this.value, 2);
+ },
+ style: {
+ color: this.CHART_STYLES.fontColor,
+ fontFamily: this.CHART_STYLES.fontFamily,
+ fontSize: this.CHART_STYLES.fontSize
+ },
+ x: 0,
+ y: this.CHART_STYLES.fontSize + 3
+ },
+ maxPadding: 0,
+ minPadding: 0,
+ opposite: true,
+ showFirstLabel: false,
+ tickColor: this.CHART_STYLES.gridColor,
+ tickLength: 100, // Cropped at left of chart
+ tickWidth: 1,
+ title: {
+ text: ''
+ }
+ }
+ ]
};
};
- return app;
-
-})();
\ No newline at end of file
+ return app;
+})();
diff --git a/examples/apps/JavaScript/Chart/manifest.js b/examples/apps/JavaScript/Chart/manifest.js
index f474085a..11357539 100644
--- a/examples/apps/JavaScript/Chart/manifest.js
+++ b/examples/apps/JavaScript/Chart/manifest.js
@@ -1,18 +1,18 @@
F2_jsonpCallback_com_openf2_examples_javascript_chart({
- "scripts":[
- "http://code.highcharts.com/highcharts.js",
- "../apps/JavaScript/Chart/appclass.js"
- ],
- "styles":[
- "../apps/JavaScript/Chart/app.css"
- ],
- "apps":[{
- "html":[
- '',
+ scripts: [
+ 'http://code.highcharts.com/highcharts.js',
+ '../apps/JavaScript/Chart/appclass.js'
+ ],
+ styles: ['../apps/JavaScript/Chart/app.css'],
+ apps: [
+ {
+ html: [
+ '',
'',
- '',
+ '',
'',
- ''
- ].join("")
- }]
-})
\ No newline at end of file
+ ''
+ ].join('')
+ }
+ ]
+});
diff --git a/examples/apps/JavaScript/CompareTool/appclass.js b/examples/apps/JavaScript/CompareTool/appclass.js
index 25ed7dfd..1116a7c4 100644
--- a/examples/apps/JavaScript/CompareTool/appclass.js
+++ b/examples/apps/JavaScript/CompareTool/appclass.js
@@ -1,16 +1,14 @@
-F2.Apps["com_openf2_examples_javascript_compareTool"] = (function() {
-
- var App_Class = function(appConfig, appContent, root) {
+F2.Apps['com_openf2_examples_javascript_compareTool'] = (function () {
+ var App_Class = function (appConfig, appContent, root) {
this.appConfig = appConfig;
this.appContent = appContent;
this.$root = $(root);
};
- App_Class.prototype.init = function() {
+ App_Class.prototype.init = function () {
// Manually bootstrap angular
- angular.bootstrap(this.$root, ["compareTool"]);
+ angular.bootstrap(this.$root, ['compareTool']);
};
return App_Class;
-
-})();
\ No newline at end of file
+})();
diff --git a/examples/apps/JavaScript/CompareTool/css/compare.css b/examples/apps/JavaScript/CompareTool/css/compare.css
index 5f53e7be..2f4effba 100644
--- a/examples/apps/JavaScript/CompareTool/css/compare.css
+++ b/examples/apps/JavaScript/CompareTool/css/compare.css
@@ -7,52 +7,52 @@
margin-bottom: 10px;
}
- .compare th,
- .compare td {
- text-align: right;
- }
-
- .compare th {
- font-size: 14px;
- font-weight: bold;
- width: 17%;
- }
-
- .compare th:first-child {
- width: 15%
- }
-
- .compare th span {
- display: block;
- }
-
- .compare th a {
- font-size: 11px;
- }
-
- .compare th input[type=text] {
- font-size: 12px;
- margin-bottom: 7px;
- width: 85%;
- }
-
- .compare th input[type=submit] {
- cursor: pointer;
- font-size: 12px;
- line-height: 18px;
- }
-
- .compare td {
- border: 1px solid #ccc;
- }
-
- .compare td:first-child {
- font-weight: bold;
- text-align: left;
- }
-
-.compare input[type=text].loading {
+.compare th,
+.compare td {
+ text-align: right;
+}
+
+.compare th {
+ font-size: 14px;
+ font-weight: bold;
+ width: 17%;
+}
+
+.compare th:first-child {
+ width: 15%;
+}
+
+.compare th span {
+ display: block;
+}
+
+.compare th a {
+ font-size: 11px;
+}
+
+.compare th input[type='text'] {
+ font-size: 12px;
+ margin-bottom: 7px;
+ width: 85%;
+}
+
+.compare th input[type='submit'] {
+ cursor: pointer;
+ font-size: 12px;
+ line-height: 18px;
+}
+
+.compare td {
+ border: 1px solid #ccc;
+}
+
+.compare td:first-child {
+ font-weight: bold;
+ text-align: left;
+}
+
+.compare input[type='text'].loading {
background-image: url(../img/ajax_spinner.gif);
background-position: 107px;
background-repeat: no-repeat;
-}
\ No newline at end of file
+}
diff --git a/examples/apps/JavaScript/CompareTool/js/angular-resource.min.js b/examples/apps/JavaScript/CompareTool/js/angular-resource.min.js
index f37559c7..b39513eb 100644
--- a/examples/apps/JavaScript/CompareTool/js/angular-resource.min.js
+++ b/examples/apps/JavaScript/CompareTool/js/angular-resource.min.js
@@ -3,8 +3,180 @@
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
*/
-(function(C,d,w){'use strict';d.module("ngResource",["ng"]).factory("$resource",["$http","$parse",function(x,y){function s(b,e){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(e?null:/%20/g,"+")}function t(b,e){this.template=b+="#";this.defaults=e||{};var a=this.urlParams={};h(b.split(/\W/),function(f){f&&RegExp("(^|[^\\\\]):"+f+"\\W").test(b)&&(a[f]=!0)});this.template=b.replace(/\\:/g,":")}function u(b,e,a){function f(m,a){var b=
-{},a=o({},e,a);h(a,function(a,z){var c;a.charAt&&a.charAt(0)=="@"?(c=a.substr(1),c=y(c)(m)):c=a;b[z]=c});return b}function g(a){v(a||{},this)}var k=new t(b),a=o({},A,a);h(a,function(a,b){a.method=d.uppercase(a.method);var e=a.method=="POST"||a.method=="PUT"||a.method=="PATCH";g[b]=function(b,c,d,B){var j={},i,l=p,q=null;switch(arguments.length){case 4:q=B,l=d;case 3:case 2:if(r(c)){if(r(b)){l=b;q=c;break}l=c;q=d}else{j=b;i=c;l=d;break}case 1:r(b)?l=b:e?i=b:j=b;break;case 0:break;default:throw"Expected between 0-4 arguments [params, data, success, error], got "+
-arguments.length+" arguments.";}var n=this instanceof g?this:a.isArray?[]:new g(i);x({method:a.method,url:k.url(o({},f(i,a.params||{}),j)),data:i}).then(function(b){var c=b.data;if(c)a.isArray?(n.length=0,h(c,function(a){n.push(new g(a))})):v(c,n);(l||p)(n,b.headers)},q);return n};g.prototype["$"+b]=function(a,d,h){var m=f(this),j=p,i;switch(arguments.length){case 3:m=a;j=d;i=h;break;case 2:case 1:r(a)?(j=a,i=d):(m=a,j=d||p);case 0:break;default:throw"Expected between 1-3 arguments [params, success, error], got "+
-arguments.length+" arguments.";}g[b].call(this,m,e?this:w,j,i)}});g.bind=function(d){return u(b,o({},e,d),a)};return g}var A={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},p=d.noop,h=d.forEach,o=d.extend,v=d.copy,r=d.isFunction;t.prototype={url:function(b){var e=this,a=this.template,f,g,b=b||{};h(this.urlParams,function(h,c){f=b.hasOwnProperty(c)?b[c]:e.defaults[c];d.isDefined(f)&&f!==null?(g=s(f,!0).replace(/%26/gi,"&").replace(/%3D/gi,
-"=").replace(/%2B/gi,"+"),a=a.replace(RegExp(":"+c+"(\\W)","g"),g+"$1")):a=a.replace(RegExp("(/?):"+c+"(\\W)","g"),function(a,b,c){return c.charAt(0)=="/"?c:b+c})});var a=a.replace(/\/?#$/,""),k=[];h(b,function(a,b){e.urlParams[b]||k.push(s(b)+"="+s(a))});k.sort();a=a.replace(/\/*$/,"");return a+(k.length?"?"+k.join("&"):"")}};return u}])})(window,window.angular);
+(function (C, d, w) {
+ 'use strict';
+ d.module('ngResource', ['ng']).factory('$resource', [
+ '$http',
+ '$parse',
+ function (x, y) {
+ function s(b, e) {
+ return encodeURIComponent(b)
+ .replace(/%40/gi, '@')
+ .replace(/%3A/gi, ':')
+ .replace(/%24/g, '$')
+ .replace(/%2C/gi, ',')
+ .replace(e ? null : /%20/g, '+');
+ }
+ function t(b, e) {
+ this.template = b += '#';
+ this.defaults = e || {};
+ var a = (this.urlParams = {});
+ h(b.split(/\W/), function (f) {
+ f && RegExp('(^|[^\\\\]):' + f + '\\W').test(b) && (a[f] = !0);
+ });
+ this.template = b.replace(/\\:/g, ':');
+ }
+ function u(b, e, a) {
+ function f(m, a) {
+ var b = {},
+ a = o({}, e, a);
+ h(a, function (a, z) {
+ var c;
+ a.charAt && a.charAt(0) == '@'
+ ? ((c = a.substr(1)), (c = y(c)(m)))
+ : (c = a);
+ b[z] = c;
+ });
+ return b;
+ }
+ function g(a) {
+ v(a || {}, this);
+ }
+ var k = new t(b),
+ a = o({}, A, a);
+ h(a, function (a, b) {
+ a.method = d.uppercase(a.method);
+ var e =
+ a.method == 'POST' || a.method == 'PUT' || a.method == 'PATCH';
+ g[b] = function (b, c, d, B) {
+ var j = {},
+ i,
+ l = p,
+ q = null;
+ switch (arguments.length) {
+ case 4:
+ (q = B), (l = d);
+ case 3:
+ case 2:
+ if (r(c)) {
+ if (r(b)) {
+ l = b;
+ q = c;
+ break;
+ }
+ l = c;
+ q = d;
+ } else {
+ j = b;
+ i = c;
+ l = d;
+ break;
+ }
+ case 1:
+ r(b) ? (l = b) : e ? (i = b) : (j = b);
+ break;
+ case 0:
+ break;
+ default:
+ throw (
+ 'Expected between 0-4 arguments [params, data, success, error], got ' +
+ arguments.length +
+ ' arguments.'
+ );
+ }
+ var n = this instanceof g ? this : a.isArray ? [] : new g(i);
+ x({
+ method: a.method,
+ url: k.url(o({}, f(i, a.params || {}), j)),
+ data: i
+ }).then(function (b) {
+ var c = b.data;
+ if (c)
+ a.isArray
+ ? ((n.length = 0),
+ h(c, function (a) {
+ n.push(new g(a));
+ }))
+ : v(c, n);
+ (l || p)(n, b.headers);
+ }, q);
+ return n;
+ };
+ g.prototype['$' + b] = function (a, d, h) {
+ var m = f(this),
+ j = p,
+ i;
+ switch (arguments.length) {
+ case 3:
+ m = a;
+ j = d;
+ i = h;
+ break;
+ case 2:
+ case 1:
+ r(a) ? ((j = a), (i = d)) : ((m = a), (j = d || p));
+ case 0:
+ break;
+ default:
+ throw (
+ 'Expected between 1-3 arguments [params, success, error], got ' +
+ arguments.length +
+ ' arguments.'
+ );
+ }
+ g[b].call(this, m, e ? this : w, j, i);
+ };
+ });
+ g.bind = function (d) {
+ return u(b, o({}, e, d), a);
+ };
+ return g;
+ }
+ var A = {
+ get: { method: 'GET' },
+ save: { method: 'POST' },
+ query: { method: 'GET', isArray: !0 },
+ remove: { method: 'DELETE' },
+ delete: { method: 'DELETE' }
+ },
+ p = d.noop,
+ h = d.forEach,
+ o = d.extend,
+ v = d.copy,
+ r = d.isFunction;
+ t.prototype = {
+ url: function (b) {
+ var e = this,
+ a = this.template,
+ f,
+ g,
+ b = b || {};
+ h(this.urlParams, function (h, c) {
+ f = b.hasOwnProperty(c) ? b[c] : e.defaults[c];
+ d.isDefined(f) && f !== null
+ ? ((g = s(f, !0)
+ .replace(/%26/gi, '&')
+ .replace(/%3D/gi, '=')
+ .replace(/%2B/gi, '+')),
+ (a = a.replace(RegExp(':' + c + '(\\W)', 'g'), g + '$1')))
+ : (a = a.replace(
+ RegExp('(/?):' + c + '(\\W)', 'g'),
+ function (a, b, c) {
+ return c.charAt(0) == '/' ? c : b + c;
+ }
+ ));
+ });
+ var a = a.replace(/\/?#$/, ''),
+ k = [];
+ h(b, function (a, b) {
+ e.urlParams[b] || k.push(s(b) + '=' + s(a));
+ });
+ k.sort();
+ a = a.replace(/\/*$/, '');
+ return a + (k.length ? '?' + k.join('&') : '');
+ }
+ };
+ return u;
+ }
+ ]);
+})(window, window.angular);
diff --git a/examples/apps/JavaScript/CompareTool/js/angular.min.js b/examples/apps/JavaScript/CompareTool/js/angular.min.js
index 07ea01c5..a6a853e9 100644
--- a/examples/apps/JavaScript/CompareTool/js/angular.min.js
+++ b/examples/apps/JavaScript/CompareTool/js/angular.min.js
@@ -3,159 +3,5584 @@
(c) 2010-2012 Google, Inc. http://angularjs.org
License: MIT
*/
-(function(X,Y,q){'use strict';function n(b,a,c){var d;if(b)if(H(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==n)b.forEach(a,c);else if(!b||typeof b.length!=="number"?0:typeof b.hasOwnProperty!="function"&&typeof b.constructor!="function"||b instanceof L||ca&&b instanceof ca||xa.call(b)!=="[object Object]"||typeof b.callee==="function")for(d=0;d=0&&b.splice(c,1);return a}function U(b,a){if(pa(b)||
-b&&b.$evalAsync&&b.$watch)throw Error("Can't copy Window or Scope");if(a){if(b===a)throw Error("Can't copy equivalent objects or arrays");if(B(b))for(var c=a.length=0;c2?ha.call(arguments,2):[];return H(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ha.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}:a}function ic(b,a){var c=a;/^\$+/.test(b)?c=q:pa(a)?c="$WINDOW":a&&Y===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,ic,a?" ":null)}function ob(b){return A(b)?JSON.parse(b):b}function Va(b){b&&b.length!==
-0?(b=y(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function qa(b){b=u(b).clone();try{b.html("")}catch(a){}var c=u("").append(b).html();try{return b[0].nodeType===3?y(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+y(b)})}catch(d){return y(c)}}function Wa(b){var a={},c,d;n((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=x(c[1])?decodeURIComponent(c[1]):!0)});return a}function pb(b){var a=[];n(b,function(b,
-d){a.push(Xa(d,!0)+(b===!0?"":"="+Xa(b,!0)))});return a.length?a.join("&"):""}function Ya(b){return Xa(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Xa(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(a?null:/%20/g,"+")}function jc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,h=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;n(h,function(a){h[a]=!0;c(Y.getElementById(a));
-a=a.replace(":","\\:");b.querySelectorAll&&(n(b.querySelectorAll("."+a),c),n(b.querySelectorAll("."+a+"\\:"),c),n(b.querySelectorAll("["+a+"]"),c))});n(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):n(a.attributes,function(b){if(!e&&h[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}function qb(b,a){b=u(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=rb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",
-function(a,b,c,h){a.$apply(function(){b.data("$injector",h);c(b)(a)})}]);return c}function Za(b,a){a=a||"_";return b.replace(kc,function(b,d){return(d?a:"")+b.toLowerCase()})}function $a(b,a,c){if(!b)throw Error("Argument '"+(a||"?")+"' is "+(c||"required"));return b}function ra(b,a,c){c&&B(b)&&(b=b[b.length-1]);$a(H(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function lc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),
-"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return k}}if(!e)throw Error("No module: "+d);var b=[],c=[],i=a("$injector","invoke"),k={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider",
-"register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:i,run:function(a){c.push(a);return this}};g&&i(g);return k})}})}function sb(b){return b.replace(mc,function(a,b,d,e){return e?d.toUpperCase():d}).replace(nc,"Moz$1")}function ab(b,a){function c(){var e;for(var b=[this],c=a,h,f,j,i,k,m;b.length;){h=b.shift();f=0;for(j=h.length;f "+b;a.removeChild(a.firstChild);bb(this,a.childNodes);this.remove()}else bb(this,b)}function cb(b){return b.cloneNode(!0)}function sa(b){tb(b);for(var a=0,b=b.childNodes||[];a-1}function wb(b,a){a&&n(a.split(" "),function(a){b.className=O((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+O(a)+" "," "))})}function xb(b,a){a&&n(a.split(" "),function(a){if(!Da(b,a))b.className=O(b.className+" "+O(a))})}function bb(b,a){if(a)for(var a=!a.nodeName&&x(a.length)&&!pa(a)?a:[a],c=0;c4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(j.cookie!==
-$){$=j.cookie;d=$.split("; ");r={};for(f=0;f0&&(r[unescape(e.substring(0,i))]=unescape(e.substring(i+1)))}return r}};f.defer=function(a,b){var c;o++;c=m(function(){delete t[c];e(a)},b||0);t[c]=!0;return c};f.defer.cancel=function(a){return t[a]?(delete t[a],l(a),e(C),!0):!1}}function wc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new vc(b,d,a,c)}]}function xc(){this.$get=function(){function b(b,d){function e(a){if(a!=m){if(l){if(l==
-a)l=a.n}else l=a;g(a.n,a.p);g(a,m);m=a;m.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw Error("cacheId "+b+" taken");var h=0,f=v({},d,{id:b}),j={},i=d&&d.capacity||Number.MAX_VALUE,k={},m=null,l=null;return a[b]={put:function(a,b){var c=k[a]||(k[a]={key:a});e(c);w(b)||(a in j||h++,j[a]=b,h>i&&this.remove(l.key))},get:function(a){var b=k[a];if(b)return e(b),j[a]},remove:function(a){var b=k[a];if(b){if(b==m)m=b.p;if(b==l)l=b.n;g(b.n,b.p);delete k[a];delete j[a];h--}},removeAll:function(){j=
-{};h=0;k={};m=l=null},destroy:function(){k=f=j=null;delete a[b]},info:function(){return v({},f,{size:h})}}}var a={};b.info=function(){var b={};n(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function yc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Cb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ",h=/^\s*(https?|ftp|mailto):/;
-this.directive=function j(d,e){A(d)?($a(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];n(a[d],function(a){try{var g=b.invoke(a);if(H(g))g={compile:I(g)};else if(!g.compile&&g.link)g.compile=I(g.link);g.priority=g.priority||0;g.name=g.name||d;g.require=g.require||g.controller&&g.name;g.restrict=g.restrict||"A";e.push(g)}catch(h){c(h)}});return e}])),a[d].push(e)):n(d,nb(j));return this};this.urlSanitizationWhitelist=function(a){return x(a)?
-(h=a,this):h};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(b,i,k,m,l,t,o,p,s){function J(a,b,c){a instanceof u||(a=u(a));n(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=u(b).wrap("").parent()[0])});var d=z(a,b,a,c);return function(b,c){$a(b,"scope");for(var e=c?va.clone.call(a):a,g=0,i=e.length;gr.priority)break;if(W=r.scope)ua("isolated scope",K,r,D),M(W)&&(F(D,"ng-isolate-scope"),K=r),F(D,"ng-scope"),p=p||r;G=r.name;if(W=r.controller)x=x||{},
-ua("'"+G+"' controller",x[G],r,D),x[G]=r;if(W=r.transclude)ua("transclusion",ka,r,D),ka=r,l=r.priority,W=="element"?(S=u(b),D=c.$$element=u(Y.createComment(" "+G+": "+c[G]+" ")),b=D[0],C(e,u(S[0]),b),R=J(S,d,l)):(S=u(cb(b)).contents(),D.html(""),R=J(S,d));if(W=r.template)if(ua("template",z,r,D),z=r,W=Eb(W),r.replace){S=u(""+O(W)+"").contents();b=S[0];if(S.length!=1||b.nodeType!==1)throw Error(g+W);C(e,D,b);G={$attr:{}};a=a.concat(V(b,a.splice(v+1,a.length-(v+1)),G));$(c,G);y=a.length}else D.html(W);
-if(r.templateUrl)ua("template",z,r,D),z=r,j=P(a.splice(v,a.length-v),j,D,c,e,r.replace,R),y=a.length;else if(r.compile)try{w=r.compile(D,c,R),H(w)?i(null,w):w&&i(w.pre,w.post)}catch(E){k(E,qa(D))}if(r.terminal)j.terminal=!0,l=Math.max(l,r.priority)}j.scope=p&&p.scope;j.transclude=ka&&R;return j}function r(d,e,i,g){var h=!1;if(a.hasOwnProperty(e))for(var l,e=b.get(e+c),o=0,m=e.length;ol.priority)&&l.restrict.indexOf(i)!=-1)d.push(l),h=!0}catch(t){k(t)}return h}function $(a,
-b){var c=b.$attr,d=a.$attr,e=a.$$element;n(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});n(b,function(b,i){i=="class"?(F(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):i=="style"?e.attr("style",e.attr("style")+";"+b):i.charAt(0)!="$"&&!a.hasOwnProperty(i)&&(a[i]=b,d[i]=c[i])})}function P(a,b,c,d,e,i,h){var j=[],k,o,t=c[0],s=a.shift(),p=v({},s,{controller:null,templateUrl:null,transclude:null,scope:null});c.html("");m.get(s.templateUrl,{cache:l}).success(function(l){var m,
-s,l=Eb(l);if(i){s=u(""+O(l)+"").contents();m=s[0];if(s.length!=1||m.nodeType!==1)throw Error(g+l);l={$attr:{}};C(e,c,m);V(m,a,l);$(d,l)}else m=t,c.html(l);a.unshift(p);k=K(a,m,d,h);for(o=z(c.contents(),h);j.length;){var ia=j.pop(),l=j.pop();s=j.pop();var r=j.pop(),D=m;s!==t&&(D=cb(m),C(l,u(s),D));k(function(){b(o,r,D,e,ia)},r,D,e,ia)}j=null}).error(function(a,b,c,d){throw Error("Failed to load template: "+d.url);});return function(a,c,d,e,i){j?(j.push(c),j.push(d),j.push(e),j.push(i)):
-k(function(){b(o,c,d,e,i)},c,d,e,i)}}function G(a,b){return b.priority-a.priority}function ua(a,b,c,d){if(b)throw Error("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+qa(d));}function x(a,b){var c=i(b,!0);c&&a.push({priority:0,compile:I(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);F(d.data("$binding",e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function R(a,b,c,d){var e=i(c,!0);e&&b.push({priority:100,compile:I(function(a,b,c){b=c.$$observers||
-(c.$$observers={});d==="class"&&(e=i(c[d],!0));c[d]=q;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function C(a,b,c){var d=b[0],e=d.parentNode,i,g;if(a){i=0;for(g=a.length;i
-0){var e=P[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c,d,f){return(b=h(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),P.shift(),b):!1}function j(a){f(a)||e("is unexpected, expecting ["+a+"]",h())}function i(a,b){return function(c,d){return a(c,d,b)}}function k(a,b,c){return function(d,e){return b(d,e,a,c)}}function m(){for(var a=[];;)if(P.length>0&&!h("}",")",";","]")&&a.push(w()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e","<=",">="))a=k(a,b.fn,s());return a}function J(){for(var a=n(),b;b=f("*","/","%");)a=k(a,b.fn,n());return a}function n(){var a;return f("+")?z():(a=f("-"))?k(r,a.fn,n()):(a=f("!"))?i(a.fn,n()):z()}function z(){var a;if(f("("))a=w(),j(")");else if(f("["))a=V();else if(f("{"))a=K();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=x(a,c),c=null):b.text==="["?(c=a,a=R(a)):b.text==="."?(c=a,a=u(a)):e("IMPOSSIBLE");return a}function V(){var a=
-[];if(g().text!="]"){do a.push(G());while(f(","))}j("]");return function(b,c){for(var d=[],e=0;e1;d++){var e=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=
-c}function gb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,h=0;h7),hasEvent:function(c){if(c=="input"&&Z==9)return!1;if(w(a[c])){var e=b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Uc(){this.$get=I(X)}function Nb(b){var a={},c,d,e;if(!b)return a;n(b.split("\n"),function(b){e=b.indexOf(":");c=y(O(b.substr(0,
-e)));d=O(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Ob(b){var a=M(b)?b:q;return function(c){a||(a=Nb(b));return c?a[y(c)]||null:a}}function Pb(b,a,c){if(H(c))return c(b,a);n(c,function(c){b=c(b,a)});return b}function Vc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){A(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=ob(d,!0)));return d}],transformRequest:[function(a){return M(a)&&xa.apply(a)!=="[object File]"?da(a):a}],
-headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,j,i,k){function m(a){function c(a){var b=v({},a,{data:Pb(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:i.reject(b)}a.method=ma(a.method);var e=a.transformRequest||
-d.transformRequest,f=a.transformResponse||d.transformResponse,g=d.headers,g=v({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},g.common,g[y(a.method)],a.headers),e=Pb(a.data,Ob(g),e),j;w(a.data)&&delete g["Content-Type"];j=l(a,e,g);j=j.then(c,c);n(p,function(a){j=a(j)});j.success=function(b){j.then(function(c){b(c.data,c.status,c.headers,a)});return j};j.error=function(b){j.then(null,function(c){b(c.data,c.status,c.headers,a)});return j};return j}function l(b,c,d){function e(a,b,c){n&&(200<=a&&a<300?n.put(q,
-[a,b,Nb(c)]):n.remove(q));f(b,a,c);j.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Ob(d),config:b})}function h(){var a=Aa(m.pendingRequests,b);a!==-1&&m.pendingRequests.splice(a,1)}var k=i.defer(),l=k.promise,n,p,q=t(b.url,b.params);m.pendingRequests.push(b);l.then(h,h);b.cache&&b.method=="GET"&&(n=M(b.cache)?b.cache:o);if(n)if(p=n.get(q))if(p.then)return p.then(h,h),p;else B(p)?f(p[1],p[0],U(p[2])):f(p,200,{});else n.put(q,l);p||a(b.method,
-q,c,e,d,b.timeout,b.withCredentials);return l}function t(a,b){if(!b)return a;var c=[];fc(b,function(a,b){a==null||a==q||(M(a)&&(a=da(a)),c.push(encodeURIComponent(b)+"="+encodeURIComponent(a)))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var o=c("$http"),p=[];n(e,function(a){p.push(A(a)?k.get(a):k.invoke(a))});m.pendingRequests=[];(function(a){n(arguments,function(a){m[a]=function(b,c){return m(v(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){n(arguments,function(a){m[a]=
-function(b,c,d){return m(v(d||{},{method:a,url:b,data:c}))}})})("post","put");m.defaults=d;return m}]}function Wc(){this.$get=["$browser","$window","$document",function(b,a,c){return Xc(b,Yc,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function Xc(b,a,c,d,e,g){function h(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;Z?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=
-d;e.body.appendChild(c)}return function(e,j,i,k,m,l,t){function o(a,c,d,e){c=(j.match(Gb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(C)}b.$$incOutstandingRequestCount();j=j||b.url();if(y(e)=="jsonp"){var p="_"+(d.counter++).toString(36);d[p]=function(a){d[p].data=a};h(j.replace("JSON_CALLBACK","angular.callbacks."+p),function(){d[p].data?o(k,200,d[p].data):o(k,-2);delete d[p]})}else{var s=new a;s.open(e,j,!0);n(m,function(a,b){a&&s.setRequestHeader(b,a)});
-var q;s.onreadystatechange=function(){if(s.readyState==4){var a=s.getAllResponseHeaders(),b=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];a||(a="",n(b,function(b){var c=s.getResponseHeader(b);c&&(a+=b+": "+c+"\n")}));o(k,q||s.status,s.responseText,a)}};if(t)s.withCredentials=!0;s.send(i||"");l>0&&c(function(){q=-1;s.abort()},l)}}}function Zc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,
-maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),
-AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function $c(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,j){var i=c.defer(),k=i.promise,m=x(j)&&!j,f=a.defer(function(){try{i.resolve(e())}catch(a){i.reject(a),d(a)}m||b.$apply()},f),j=function(){delete g[k.$$timeoutId]};
-k.$$timeoutId=f;g[f]=i;k.then(j,j);return k}var g={};e.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Qb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",Rb);a("date",Sb);a("filter",ad);a("json",bd);a("limitTo",cd);a("lowercase",dd);a("number",Tb);a("orderBy",Ub);a("uppercase",ed)}function ad(){return function(b,
-a){if(!B(b))return b;var c=[];c.check=function(a){for(var b=0;b-1;case "object":for(var c in a)if(c.charAt(0)!=="$"&&d(a[c],b))return!0;return!1;case "array":for(c=0;ce+1?h="0":(f=h,i=!0)}if(!i){h=(h.split(Wb)[1]||"").length;w(e)&&(e=Math.min(Math.max(a.minFrac,h),a.maxFrac));var h=Math.pow(10,e),b=Math.round(b*h)/h,b=(""+b).split(Wb),h=b[0],b=b[1]||"",i=0,k=a.lgSize,
-m=a.gSize;if(h.length>=k+m)for(var i=h.length-k,l=0;l0||e>-c)e+=
-c;e===0&&c==-12&&(e=12);return jb(e,a,d)}}function Ka(b,a){return function(c,d){var e=c["get"+b](),g=ma(a?"SHORT"+b:b);return d[g][e]}}function Sb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),g=0,h=0;b[9]&&(g=E(b[9]+b[10]),h=E(b[9]+b[11]));a.setUTCFullYear(E(b[1]),E(b[2])-1,E(b[3]));a.setUTCHours(E(b[4]||0)-g,E(b[5]||0)-h,E(b[6]||0),E(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g=
-"",h=[],f,j,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;A(c)&&(c=fd.test(c)?E(c):a(c));Ra(c)&&(c=new Date(c));if(!oa(c))return c;for(;e;)(j=gd.exec(e))?(h=h.concat(ha.call(j,1)),e=h.pop()):(h.push(e),e=null);n(h,function(a){f=hd[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function bd(){return function(b){return da(b,!0)}}function cd(){return function(b,a){if(!(b instanceof Array))return b;var a=E(a),c=[],d,e;if(!b||!(b instanceof Array))return c;a>b.length?
-a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;dm?(d.$setValidity("maxlength",!1),q):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function kb(b,a){b="ngClass"+b;return Q(function(c,d,e){function g(b){if(a===!0||c.$index%2===a)j&&b!==j&&h(j),f(b);j=b}function h(a){M(a)&&!B(a)&&(a=Sa(a,function(a,b){if(a)return b}));d.removeClass(B(a)?
-a.join(" "):a)}function f(a){M(a)&&!B(a)&&(a=Sa(a,function(a,b){if(a)return b}));a&&d.addClass(B(a)?a.join(" "):a)}var j=q;c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,g){var j=d%2;j!==g%2&&(j==a?f(c.$eval(e[b])):h(c.$eval(e[b])))})})}var y=function(b){return A(b)?b.toLowerCase():b},ma=function(b){return A(b)?b.toUpperCase():b},Z=E((/msie (\d+)/.exec(y(navigator.userAgent))||[])[1]),u,ca,ha=[].slice,Qa=[].push,xa=Object.prototype.toString,
-Zb=X.angular||(X.angular={}),ta,fb,aa=["0","0","0"];C.$inject=[];na.$inject=[];fb=Z<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?ma(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var kc=/[A-Z]/g,id={full:"1.0.5",major:1,minor:0,dot:5,codeName:"flatulent-propulsion"},Ca=L.cache={},Ba=L.expando="ng-"+(new Date).getTime(),oc=1,$b=X.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+
-a,c)},db=X.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},mc=/([\:\-\_]+(.))/g,nc=/^moz([A-Z])/,va=L.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;this.bind("DOMContentLoaded",a);L(X).bind("load",a)},toString:function(){var b=[];n(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return b>=0?u(this[b]):u(this[this.length+b])},length:0,push:Qa,sort:[].sort,splice:[].splice},Fa={};n("multiple,selected,checked,disabled,readOnly,required".split(","),
-function(b){Fa[y(b)]=b});var Ab={};n("input,select,option,textarea,button,form".split(","),function(b){Ab[ma(b)]=!0});n({data:vb,inheritedData:Ea,scope:function(b){return Ea(b,"$scope")},controller:yb,injector:function(b){return Ea(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Da,css:function(b,a,c){a=sb(a);if(x(c))b.style[a]=c;else{var d;Z<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];Z<=8&&(d=d===""?q:d);return d}},attr:function(b,a,c){var d=
-y(a);if(Fa[d])if(x(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||C).specified?d:q;else if(x(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?q:b},prop:function(b,a,c){if(x(c))b[a]=c;else return b[a]},text:v(Z<9?function(b,a){if(b.nodeType==1){if(w(a))return b.innerText;b.innerText=a}else{if(w(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(w(a))return b.textContent;b.textContent=a},{$dv:""}),
-val:function(b,a){if(w(a))return b.value;b.value=a},html:function(b,a){if(w(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Lc=
-{n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},ib={},Yc=X.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");};Qb.$inject=["$provide"];Rb.$inject=["$locale"];Tb.$inject=["$locale"];var Wb=".",hd={yyyy:N("FullYear",4),yy:N("FullYear",2,0,!0),y:N("FullYear",1),MMMM:Ka("Month"),
-MMM:Ka("Month",!0),MM:N("Month",2,1),M:N("Month",1,1),dd:N("Date",2),d:N("Date",1),HH:N("Hours",2),H:N("Hours",1),hh:N("Hours",2,-12),h:N("Hours",1,-12),mm:N("Minutes",2),m:N("Minutes",1),ss:N("Seconds",2),s:N("Seconds",1),EEEE:Ka("Day"),EEE:Ka("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){var a=-1*a.getTimezoneOffset(),c=a>=0?"+":"";c+=jb(a/60,2)+jb(Math.abs(a%60),2);return c}},gd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,
-fd=/^\d+$/;Sb.$inject=["$locale"];var dd=I(y),ed=I(ma);Ub.$inject=["$parse"];var jd=I({restrict:"E",compile:function(a,c){Z<=8&&(!c.href&&!c.name&&c.$set("href",""),a.append(Y.createComment("IE fix")));return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),lb={};n(Fa,function(a,c){var d=ea("ng-"+c);lb[d]=function(){return{priority:100,compile:function(){return function(a,g,h){a.$watch(h[d],function(a){h.$set(c,!!a)})}}}}});n(["src","href"],function(a){var c=ea("ng-"+
-a);lb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),Z&&e.prop(a,g[a]))})}}}});var Na={$addControl:C,$removeControl:C,$setValidity:C,$setDirty:C};Xb.$inject=["$element","$attrs","$scope"];var Qa=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",controller:Xb,compile:function(){return{pre:function(a,d,h,f){if(!h.action){var j=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};$b(d[0],"submit",j);d.bind("$destroy",
-function(){c(function(){db(d[0],"submit",j)},0,!1)})}var i=d.parent().controller("form"),k=h.name||h.ngForm;k&&(a[k]=f);i&&d.bind("$destroy",function(){i.$removeControl(f);k&&(a[k]=q);v(f,Na)})}}}};return a?v(U(d),{restrict:"EAC"}):d}]},kd=Qa(),ld=Qa(!0),md=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,nd=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,od=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,bc={text:Pa,number:function(a,c,d,e,g,h){Pa(a,c,d,e,g,h);e.$parsers.push(function(a){var c=
-T(a);return c||od.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),q)});e.$formatters.push(function(a){return T(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!T(a)&&aj?(e.$setValidity("max",!1),q):(e.$setValidity("max",!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return T(a)||
-Ra(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),q)})},url:function(a,c,d,e,g,h){Pa(a,c,d,e,g,h);a=function(a){return T(a)||md.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),q)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,h){Pa(a,c,d,e,g,h);a=function(a){return T(a)||nd.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),q)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){w(d.name)&&c.attr("name",ya());c.bind("click",
-function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,h=d.ngFalseValue;A(g)||(g=!0);A(h)||(h=!1);c.bind("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a===g});e.$parsers.push(function(a){return a?g:h})},hidden:C,button:C,submit:C,reset:C},
-cc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,h){h&&(bc[y(g.type)]||bc.text)(d,e,g,h,c,a)}}}],Ma="ng-valid",La="ng-invalid",Oa="ng-pristine",Yb="ng-dirty",pd=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function h(a,c){c=c?"-"+Za(c,"-"):"";e.removeClass((a?La:Ma)+c).addClass((a?Ma:La)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=
-!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),j=f.assign;if(!j)throw Error(Db+d.ngModel+" ("+qa(e)+")");this.$render=C;var i=e.inheritedData("$formController")||Na,k=0,m=this.$error={};e.addClass(Oa);h(!0);this.$setValidity=function(a,c){if(m[a]!==!c){if(c){if(m[a]&&k--,!k)h(!0),this.$valid=!0,this.$invalid=!1}else h(!1),this.$invalid=!0,this.$valid=!1,k++;m[a]=!c;h(c,a);i.$setValidity(a,c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=
-!0,this.$pristine=!1,e.removeClass(Oa).addClass(Yb),i.$setDirty();n(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,j(a,d),n(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var l=this;a.$watch(function(){var c=f(a);if(l.$modelValue!==c){var d=l.$formatters,e=d.length;for(l.$modelValue=c;e--;)c=d[e](c);if(l.$viewValue!==c)l.$viewValue=c,l.$render()}})}],qd=function(){return{require:["ngModel","^?form"],controller:pd,link:function(a,c,d,e){var g=e[0],h=
-e[1]||Na;h.$addControl(g);c.bind("$destroy",function(){h.$removeControl(g)})}}},rd=I({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),dc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&(T(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);d.$observe("required",function(){g(e.$viewValue)})}}}},sd=function(){return{require:"ngModel",
-link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&n(a.split(g),function(a){a&&c.push(O(a))});return c});e.$formatters.push(function(a){return B(a)?a.join(", "):q})}}},td=/^(true|false|\d+)$/,ud=function(){return{priority:100,compile:function(a,c){return td.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},vd=Q(function(a,c,d){c.addClass("ng-binding").data("$binding",
-d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==q?"":a)})}),wd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],xd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe,function(a){c.html(a||"")})}}],yd=kb("",!0),zd=kb("Odd",0),Ad=kb("Even",1),Bd=Q({compile:function(a,c){c.$set("ngCloak",q);
-a.removeClass("ng-cloak")}}),Cd=[function(){return{scope:!0,controller:"@"}}],Dd=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],ec={};n("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(a){var c=ea("ng-"+a);ec[c]=["$parse",function(d){return function(e,g,h){var f=d(h[c]);g.bind(y(a),function(a){e.$apply(function(){f(e,{$event:a})})})}}]});var Ed=Q(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),
-Fd=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,h){var f=h.ngInclude||h.src,j=h.onload||"",i=h.autoscroll;return function(g,h){var l=0,n,o=function(){n&&(n.$destroy(),n=null);h.html("")};g.$watch(f,function(f){var s=++l;f?a.get(f,{cache:c}).success(function(a){s===l&&(n&&n.$destroy(),n=g.$new(),h.html(a),e(h.contents())(n),x(i)&&(!i||g.$eval(i))&&d(),n.$emit("$includeContentLoaded"),g.$eval(j))}).error(function(){s===l&&
-o()}):o()})}}}}],Gd=Q({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Hd=Q({terminal:!0,priority:1E3}),Id=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,h){var f=h.count,j=g.attr(h.$attr.when),i=h.offset||0,k=e.$eval(j),m={},l=c.startSymbol(),t=c.endSymbol();n(k,function(a,e){m[e]=c(a.replace(d,l+f+"-"+i+t))});e.$watch(function(){var c=parseFloat(e.$eval(f));return isNaN(c)?"":(k[c]||(c=a.pluralCat(c-i)),m[c](e,g,!0))},function(a){g.text(a)})}}}],
-Jd=Q({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,h){var f=h.ngRepeat,h=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),j,i,k;if(!h)throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=h[1];j=h[2];h=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!h)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+f+"'.");i=h[3]||h[1];k=h[2];var m=new eb;a.$watch(function(a){var e,f,h=a.$eval(j),
-n=c,q=new eb,x,z,u,w,r,v;if(B(h))r=h||[];else{r=[];for(u in h)h.hasOwnProperty(u)&&u.charAt(0)!="$"&&r.push(u);r.sort()}x=r.length;e=0;for(f=r.length;eA;)u.pop().element.remove()}for(;r.length>y;)r.pop()[0].element.remove()}var i;if(!(i=p.match(d)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+p+"'.");var j=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),
-n=c(i[2]?i[1]:k),t=c(i[7]),r=[[{element:f,label:""}]];s&&(a(s)(e),s.removeClass("ng-scope"),s.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=t(e)||[],d={},h,i,j,m,p,s;if(o){i=[];m=0;for(s=r.length;m@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}');
+(function (X, Y, q) {
+ 'use strict';
+ function n(b, a, c) {
+ var d;
+ if (b)
+ if (H(b))
+ for (d in b)
+ d != 'prototype' &&
+ d != 'length' &&
+ d != 'name' &&
+ b.hasOwnProperty(d) &&
+ a.call(c, b[d], d);
+ else if (b.forEach && b.forEach !== n) b.forEach(a, c);
+ else if (
+ !b || typeof b.length !== 'number'
+ ? 0
+ : (typeof b.hasOwnProperty != 'function' &&
+ typeof b.constructor != 'function') ||
+ b instanceof L ||
+ (ca && b instanceof ca) ||
+ xa.call(b) !== '[object Object]' ||
+ typeof b.callee === 'function'
+ )
+ for (d = 0; d < b.length; d++) a.call(c, b[d], d);
+ else for (d in b) b.hasOwnProperty(d) && a.call(c, b[d], d);
+ return b;
+ }
+ function mb(b) {
+ var a = [],
+ c;
+ for (c in b) b.hasOwnProperty(c) && a.push(c);
+ return a.sort();
+ }
+ function fc(b, a, c) {
+ for (var d = mb(b), e = 0; e < d.length; e++) a.call(c, b[d[e]], d[e]);
+ return d;
+ }
+ function nb(b) {
+ return function (a, c) {
+ b(c, a);
+ };
+ }
+ function ya() {
+ for (var b = aa.length, a; b; ) {
+ b--;
+ a = aa[b].charCodeAt(0);
+ if (a == 57) return (aa[b] = 'A'), aa.join('');
+ if (a == 90) aa[b] = '0';
+ else return (aa[b] = String.fromCharCode(a + 1)), aa.join('');
+ }
+ aa.unshift('0');
+ return aa.join('');
+ }
+ function v(b) {
+ n(arguments, function (a) {
+ a !== b &&
+ n(a, function (a, d) {
+ b[d] = a;
+ });
+ });
+ return b;
+ }
+ function E(b) {
+ return parseInt(b, 10);
+ }
+ function za(b, a) {
+ return v(new (v(function () {}, { prototype: b }))(), a);
+ }
+ function C() {}
+ function na(b) {
+ return b;
+ }
+ function I(b) {
+ return function () {
+ return b;
+ };
+ }
+ function w(b) {
+ return typeof b == 'undefined';
+ }
+ function x(b) {
+ return typeof b != 'undefined';
+ }
+ function M(b) {
+ return b != null && typeof b == 'object';
+ }
+ function A(b) {
+ return typeof b == 'string';
+ }
+ function Ra(b) {
+ return typeof b == 'number';
+ }
+ function oa(b) {
+ return xa.apply(b) == '[object Date]';
+ }
+ function B(b) {
+ return xa.apply(b) == '[object Array]';
+ }
+ function H(b) {
+ return typeof b == 'function';
+ }
+ function pa(b) {
+ return b && b.document && b.location && b.alert && b.setInterval;
+ }
+ function O(b) {
+ return A(b) ? b.replace(/^\s*/, '').replace(/\s*$/, '') : b;
+ }
+ function gc(b) {
+ return b && (b.nodeName || (b.bind && b.find));
+ }
+ function Sa(b, a, c) {
+ var d = [];
+ n(b, function (b, g, h) {
+ d.push(a.call(c, b, g, h));
+ });
+ return d;
+ }
+ function Aa(b, a) {
+ if (b.indexOf) return b.indexOf(a);
+ for (var c = 0; c < b.length; c++) if (a === b[c]) return c;
+ return -1;
+ }
+ function Ta(b, a) {
+ var c = Aa(b, a);
+ c >= 0 && b.splice(c, 1);
+ return a;
+ }
+ function U(b, a) {
+ if (pa(b) || (b && b.$evalAsync && b.$watch))
+ throw Error("Can't copy Window or Scope");
+ if (a) {
+ if (b === a) throw Error("Can't copy equivalent objects or arrays");
+ if (B(b)) for (var c = (a.length = 0); c < b.length; c++) a.push(U(b[c]));
+ else
+ for (c in (n(a, function (b, c) {
+ delete a[c];
+ }),
+ b))
+ a[c] = U(b[c]);
+ } else
+ (a = b) &&
+ (B(b)
+ ? (a = U(b, []))
+ : oa(b)
+ ? (a = new Date(b.getTime()))
+ : M(b) && (a = U(b, {})));
+ return a;
+ }
+ function hc(b, a) {
+ var a = a || {},
+ c;
+ for (c in b)
+ b.hasOwnProperty(c) && c.substr(0, 2) !== '$$' && (a[c] = b[c]);
+ return a;
+ }
+ function ga(b, a) {
+ if (b === a) return !0;
+ if (b === null || a === null) return !1;
+ if (b !== b && a !== a) return !0;
+ var c = typeof b,
+ d;
+ if (c == typeof a && c == 'object')
+ if (B(b)) {
+ if ((c = b.length) == a.length) {
+ for (d = 0; d < c; d++) if (!ga(b[d], a[d])) return !1;
+ return !0;
+ }
+ } else if (oa(b)) return oa(a) && b.getTime() == a.getTime();
+ else {
+ if (
+ (b && b.$evalAsync && b.$watch) ||
+ (a && a.$evalAsync && a.$watch) ||
+ pa(b) ||
+ pa(a)
+ )
+ return !1;
+ c = {};
+ for (d in b)
+ if (!(d.charAt(0) === '$' || H(b[d]))) {
+ if (!ga(b[d], a[d])) return !1;
+ c[d] = !0;
+ }
+ for (d in a)
+ if (!c[d] && d.charAt(0) !== '$' && a[d] !== q && !H(a[d])) return !1;
+ return !0;
+ }
+ return !1;
+ }
+ function Ua(b, a) {
+ var c = arguments.length > 2 ? ha.call(arguments, 2) : [];
+ return H(a) && !(a instanceof RegExp)
+ ? c.length
+ ? function () {
+ return arguments.length
+ ? a.apply(b, c.concat(ha.call(arguments, 0)))
+ : a.apply(b, c);
+ }
+ : function () {
+ return arguments.length ? a.apply(b, arguments) : a.call(b);
+ }
+ : a;
+ }
+ function ic(b, a) {
+ var c = a;
+ /^\$+/.test(b)
+ ? (c = q)
+ : pa(a)
+ ? (c = '$WINDOW')
+ : a && Y === a
+ ? (c = '$DOCUMENT')
+ : a && a.$evalAsync && a.$watch && (c = '$SCOPE');
+ return c;
+ }
+ function da(b, a) {
+ return JSON.stringify(b, ic, a ? ' ' : null);
+ }
+ function ob(b) {
+ return A(b) ? JSON.parse(b) : b;
+ }
+ function Va(b) {
+ b && b.length !== 0
+ ? ((b = y('' + b)),
+ (b = !(
+ b == 'f' ||
+ b == '0' ||
+ b == 'false' ||
+ b == 'no' ||
+ b == 'n' ||
+ b == '[]'
+ )))
+ : (b = !1);
+ return b;
+ }
+ function qa(b) {
+ b = u(b).clone();
+ try {
+ b.html('');
+ } catch (a) {}
+ var c = u('').append(b).html();
+ try {
+ return b[0].nodeType === 3
+ ? y(c)
+ : c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, function (a, b) {
+ return '<' + y(b);
+ });
+ } catch (d) {
+ return y(c);
+ }
+ }
+ function Wa(b) {
+ var a = {},
+ c,
+ d;
+ n((b || '').split('&'), function (b) {
+ b &&
+ ((c = b.split('=')),
+ (d = decodeURIComponent(c[0])),
+ (a[d] = x(c[1]) ? decodeURIComponent(c[1]) : !0));
+ });
+ return a;
+ }
+ function pb(b) {
+ var a = [];
+ n(b, function (b, d) {
+ a.push(Xa(d, !0) + (b === !0 ? '' : '=' + Xa(b, !0)));
+ });
+ return a.length ? a.join('&') : '';
+ }
+ function Ya(b) {
+ return Xa(b, !0)
+ .replace(/%26/gi, '&')
+ .replace(/%3D/gi, '=')
+ .replace(/%2B/gi, '+');
+ }
+ function Xa(b, a) {
+ return encodeURIComponent(b)
+ .replace(/%40/gi, '@')
+ .replace(/%3A/gi, ':')
+ .replace(/%24/g, '$')
+ .replace(/%2C/gi, ',')
+ .replace(a ? null : /%20/g, '+');
+ }
+ function jc(b, a) {
+ function c(a) {
+ a && d.push(a);
+ }
+ var d = [b],
+ e,
+ g,
+ h = ['ng:app', 'ng-app', 'x-ng-app', 'data-ng-app'],
+ f = /\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;
+ n(h, function (a) {
+ h[a] = !0;
+ c(Y.getElementById(a));
+ a = a.replace(':', '\\:');
+ b.querySelectorAll &&
+ (n(b.querySelectorAll('.' + a), c),
+ n(b.querySelectorAll('.' + a + '\\:'), c),
+ n(b.querySelectorAll('[' + a + ']'), c));
+ });
+ n(d, function (a) {
+ if (!e) {
+ var b = f.exec(' ' + a.className + ' ');
+ b
+ ? ((e = a), (g = (b[2] || '').replace(/\s+/g, ',')))
+ : n(a.attributes, function (b) {
+ if (!e && h[b.name]) (e = a), (g = b.value);
+ });
+ }
+ });
+ e && a(e, g ? [g] : []);
+ }
+ function qb(b, a) {
+ b = u(b);
+ a = a || [];
+ a.unshift([
+ '$provide',
+ function (a) {
+ a.value('$rootElement', b);
+ }
+ ]);
+ a.unshift('ng');
+ var c = rb(a);
+ c.invoke([
+ '$rootScope',
+ '$rootElement',
+ '$compile',
+ '$injector',
+ function (a, b, c, h) {
+ a.$apply(function () {
+ b.data('$injector', h);
+ c(b)(a);
+ });
+ }
+ ]);
+ return c;
+ }
+ function Za(b, a) {
+ a = a || '_';
+ return b.replace(kc, function (b, d) {
+ return (d ? a : '') + b.toLowerCase();
+ });
+ }
+ function $a(b, a, c) {
+ if (!b)
+ throw Error("Argument '" + (a || '?') + "' is " + (c || 'required'));
+ return b;
+ }
+ function ra(b, a, c) {
+ c && B(b) && (b = b[b.length - 1]);
+ $a(
+ H(b),
+ a,
+ 'not a function, got ' +
+ (b && typeof b == 'object' ? b.constructor.name || 'Object' : typeof b)
+ );
+ return b;
+ }
+ function lc(b) {
+ function a(a, b, e) {
+ return a[b] || (a[b] = e());
+ }
+ return a(a(b, 'angular', Object), 'module', function () {
+ var b = {};
+ return function (d, e, g) {
+ e && b.hasOwnProperty(d) && (b[d] = null);
+ return a(b, d, function () {
+ function a(c, d, e) {
+ return function () {
+ b[e || 'push']([c, d, arguments]);
+ return k;
+ };
+ }
+ if (!e) throw Error('No module: ' + d);
+ var b = [],
+ c = [],
+ i = a('$injector', 'invoke'),
+ k = {
+ _invokeQueue: b,
+ _runBlocks: c,
+ requires: e,
+ name: d,
+ provider: a('$provide', 'provider'),
+ factory: a('$provide', 'factory'),
+ service: a('$provide', 'service'),
+ value: a('$provide', 'value'),
+ constant: a('$provide', 'constant', 'unshift'),
+ filter: a('$filterProvider', 'register'),
+ controller: a('$controllerProvider', 'register'),
+ directive: a('$compileProvider', 'directive'),
+ config: i,
+ run: function (a) {
+ c.push(a);
+ return this;
+ }
+ };
+ g && i(g);
+ return k;
+ });
+ };
+ });
+ }
+ function sb(b) {
+ return b
+ .replace(mc, function (a, b, d, e) {
+ return e ? d.toUpperCase() : d;
+ })
+ .replace(nc, 'Moz$1');
+ }
+ function ab(b, a) {
+ function c() {
+ var e;
+ for (var b = [this], c = a, h, f, j, i, k, m; b.length; ) {
+ h = b.shift();
+ f = 0;
+ for (j = h.length; f < j; f++) {
+ i = u(h[f]);
+ c ? i.triggerHandler('$destroy') : (c = !c);
+ k = 0;
+ for (e = (m = i.children()).length, i = e; k < i; k++)
+ b.push(ca(m[k]));
+ }
+ }
+ return d.apply(this, arguments);
+ }
+ var d = ca.fn[b],
+ d = d.$original || d;
+ c.$original = d;
+ ca.fn[b] = c;
+ }
+ function L(b) {
+ if (b instanceof L) return b;
+ if (!(this instanceof L)) {
+ if (A(b) && b.charAt(0) != '<') throw Error('selectors not implemented');
+ return new L(b);
+ }
+ if (A(b)) {
+ var a = Y.createElement('div');
+ a.innerHTML = ' ' + b;
+ a.removeChild(a.firstChild);
+ bb(this, a.childNodes);
+ this.remove();
+ } else bb(this, b);
+ }
+ function cb(b) {
+ return b.cloneNode(!0);
+ }
+ function sa(b) {
+ tb(b);
+ for (var a = 0, b = b.childNodes || []; a < b.length; a++) sa(b[a]);
+ }
+ function ub(b, a, c) {
+ var d = ba(b, 'events');
+ ba(b, 'handle') &&
+ (w(a)
+ ? n(d, function (a, c) {
+ db(b, c, a);
+ delete d[c];
+ })
+ : w(c)
+ ? (db(b, a, d[a]), delete d[a])
+ : Ta(d[a], c));
+ }
+ function tb(b) {
+ var a = b[Ba],
+ c = Ca[a];
+ c &&
+ (c.handle && (c.events.$destroy && c.handle({}, '$destroy'), ub(b)),
+ delete Ca[a],
+ (b[Ba] = q));
+ }
+ function ba(b, a, c) {
+ var d = b[Ba],
+ d = Ca[d || -1];
+ if (x(c)) d || ((b[Ba] = d = ++oc), (d = Ca[d] = {})), (d[a] = c);
+ else return d && d[a];
+ }
+ function vb(b, a, c) {
+ var d = ba(b, 'data'),
+ e = x(c),
+ g = !e && x(a),
+ h = g && !M(a);
+ !d && !h && ba(b, 'data', (d = {}));
+ if (e) d[a] = c;
+ else if (g)
+ if (h) return d && d[a];
+ else v(d, a);
+ else return d;
+ }
+ function Da(b, a) {
+ return (
+ (' ' + b.className + ' ').replace(/[\n\t]/g, ' ').indexOf(' ' + a + ' ') >
+ -1
+ );
+ }
+ function wb(b, a) {
+ a &&
+ n(a.split(' '), function (a) {
+ b.className = O(
+ (' ' + b.className + ' ')
+ .replace(/[\n\t]/g, ' ')
+ .replace(' ' + O(a) + ' ', ' ')
+ );
+ });
+ }
+ function xb(b, a) {
+ a &&
+ n(a.split(' '), function (a) {
+ if (!Da(b, a)) b.className = O(b.className + ' ' + O(a));
+ });
+ }
+ function bb(b, a) {
+ if (a)
+ for (
+ var a = !a.nodeName && x(a.length) && !pa(a) ? a : [a], c = 0;
+ c < a.length;
+ c++
+ )
+ b.push(a[c]);
+ }
+ function yb(b, a) {
+ return Ea(b, '$' + (a || 'ngController') + 'Controller');
+ }
+ function Ea(b, a, c) {
+ b = u(b);
+ for (b[0].nodeType == 9 && (b = b.find('html')); b.length; ) {
+ if ((c = b.data(a))) return c;
+ b = b.parent();
+ }
+ }
+ function zb(b, a) {
+ var c = Fa[a.toLowerCase()];
+ return c && Ab[b.nodeName] && c;
+ }
+ function pc(b, a) {
+ var c = function (c, e) {
+ if (!c.preventDefault)
+ c.preventDefault = function () {
+ c.returnValue = !1;
+ };
+ if (!c.stopPropagation)
+ c.stopPropagation = function () {
+ c.cancelBubble = !0;
+ };
+ if (!c.target) c.target = c.srcElement || Y;
+ if (w(c.defaultPrevented)) {
+ var g = c.preventDefault;
+ c.preventDefault = function () {
+ c.defaultPrevented = !0;
+ g.call(c);
+ };
+ c.defaultPrevented = !1;
+ }
+ c.isDefaultPrevented = function () {
+ return c.defaultPrevented;
+ };
+ n(a[e || c.type], function (a) {
+ a.call(b, c);
+ });
+ Z <= 8
+ ? ((c.preventDefault = null),
+ (c.stopPropagation = null),
+ (c.isDefaultPrevented = null))
+ : (delete c.preventDefault,
+ delete c.stopPropagation,
+ delete c.isDefaultPrevented);
+ };
+ c.elem = b;
+ return c;
+ }
+ function fa(b) {
+ var a = typeof b,
+ c;
+ if (a == 'object' && b !== null)
+ if (typeof (c = b.$$hashKey) == 'function') c = b.$$hashKey();
+ else {
+ if (c === q) c = b.$$hashKey = ya();
+ }
+ else c = b;
+ return a + ':' + c;
+ }
+ function Ga(b) {
+ n(b, this.put, this);
+ }
+ function eb() {}
+ function Bb(b) {
+ var a, c;
+ if (typeof b == 'function') {
+ if (!(a = b.$inject))
+ (a = []),
+ (c = b.toString().replace(qc, '')),
+ (c = c.match(rc)),
+ n(c[1].split(sc), function (b) {
+ b.replace(tc, function (b, c, d) {
+ a.push(d);
+ });
+ }),
+ (b.$inject = a);
+ } else
+ B(b)
+ ? ((c = b.length - 1), ra(b[c], 'fn'), (a = b.slice(0, c)))
+ : ra(b, 'fn', !0);
+ return a;
+ }
+ function rb(b) {
+ function a(a) {
+ return function (b, c) {
+ if (M(b)) n(b, nb(a));
+ else return a(b, c);
+ };
+ }
+ function c(a, b) {
+ if (H(b) || B(b)) b = m.instantiate(b);
+ if (!b.$get)
+ throw Error('Provider ' + a + ' must define $get factory method.');
+ return (k[a + f] = b);
+ }
+ function d(a, b) {
+ return c(a, { $get: b });
+ }
+ function e(a) {
+ var b = [];
+ n(a, function (a) {
+ if (!i.get(a))
+ if ((i.put(a, !0), A(a))) {
+ var c = ta(a);
+ b = b.concat(e(c.requires)).concat(c._runBlocks);
+ try {
+ for (var d = c._invokeQueue, c = 0, f = d.length; c < f; c++) {
+ var g = d[c],
+ h = g[0] == '$injector' ? m : m.get(g[0]);
+ h[g[1]].apply(h, g[2]);
+ }
+ } catch (j) {
+ throw (j.message && (j.message += ' from ' + a), j);
+ }
+ } else if (H(a))
+ try {
+ b.push(m.invoke(a));
+ } catch (o) {
+ throw (o.message && (o.message += ' from ' + a), o);
+ }
+ else if (B(a))
+ try {
+ b.push(m.invoke(a));
+ } catch (k) {
+ throw (
+ (k.message && (k.message += ' from ' + String(a[a.length - 1])),
+ k)
+ );
+ }
+ else ra(a, 'module');
+ });
+ return b;
+ }
+ function g(a, b) {
+ function c(d) {
+ if (typeof d !== 'string') throw Error('Service name expected');
+ if (a.hasOwnProperty(d)) {
+ if (a[d] === h) throw Error('Circular dependency: ' + j.join(' <- '));
+ return a[d];
+ } else
+ try {
+ return j.unshift(d), (a[d] = h), (a[d] = b(d));
+ } finally {
+ j.shift();
+ }
+ }
+ function d(a, b, e) {
+ var f = [],
+ i = Bb(a),
+ g,
+ h,
+ j;
+ h = 0;
+ for (g = i.length; h < g; h++)
+ (j = i[h]), f.push(e && e.hasOwnProperty(j) ? e[j] : c(j));
+ a.$inject || (a = a[g]);
+ switch (b ? -1 : f.length) {
+ case 0:
+ return a();
+ case 1:
+ return a(f[0]);
+ case 2:
+ return a(f[0], f[1]);
+ case 3:
+ return a(f[0], f[1], f[2]);
+ case 4:
+ return a(f[0], f[1], f[2], f[3]);
+ case 5:
+ return a(f[0], f[1], f[2], f[3], f[4]);
+ case 6:
+ return a(f[0], f[1], f[2], f[3], f[4], f[5]);
+ case 7:
+ return a(f[0], f[1], f[2], f[3], f[4], f[5], f[6]);
+ case 8:
+ return a(f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]);
+ case 9:
+ return a(f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8]);
+ case 10:
+ return a(
+ f[0],
+ f[1],
+ f[2],
+ f[3],
+ f[4],
+ f[5],
+ f[6],
+ f[7],
+ f[8],
+ f[9]
+ );
+ default:
+ return a.apply(b, f);
+ }
+ }
+ return {
+ invoke: d,
+ instantiate: function (a, b) {
+ var c = function () {},
+ e;
+ c.prototype = (B(a) ? a[a.length - 1] : a).prototype;
+ c = new c();
+ e = d(a, c, b);
+ return M(e) ? e : c;
+ },
+ get: c,
+ annotate: Bb
+ };
+ }
+ var h = {},
+ f = 'Provider',
+ j = [],
+ i = new Ga(),
+ k = {
+ $provide: {
+ provider: a(c),
+ factory: a(d),
+ service: a(function (a, b) {
+ return d(a, [
+ '$injector',
+ function (a) {
+ return a.instantiate(b);
+ }
+ ]);
+ }),
+ value: a(function (a, b) {
+ return d(a, I(b));
+ }),
+ constant: a(function (a, b) {
+ k[a] = b;
+ l[a] = b;
+ }),
+ decorator: function (a, b) {
+ var c = m.get(a + f),
+ d = c.$get;
+ c.$get = function () {
+ var a = t.invoke(d, c);
+ return t.invoke(b, null, { $delegate: a });
+ };
+ }
+ }
+ },
+ m = g(k, function () {
+ throw Error('Unknown provider: ' + j.join(' <- '));
+ }),
+ l = {},
+ t = (l.$injector = g(l, function (a) {
+ a = m.get(a + f);
+ return t.invoke(a.$get, a);
+ }));
+ n(e(b), function (a) {
+ t.invoke(a || C);
+ });
+ return t;
+ }
+ function uc() {
+ var b = !0;
+ this.disableAutoScrolling = function () {
+ b = !1;
+ };
+ this.$get = [
+ '$window',
+ '$location',
+ '$rootScope',
+ function (a, c, d) {
+ function e(a) {
+ var b = null;
+ n(a, function (a) {
+ !b && y(a.nodeName) === 'a' && (b = a);
+ });
+ return b;
+ }
+ function g() {
+ var b = c.hash(),
+ d;
+ b
+ ? (d = h.getElementById(b))
+ ? d.scrollIntoView()
+ : (d = e(h.getElementsByName(b)))
+ ? d.scrollIntoView()
+ : b === 'top' && a.scrollTo(0, 0)
+ : a.scrollTo(0, 0);
+ }
+ var h = a.document;
+ b &&
+ d.$watch(
+ function () {
+ return c.hash();
+ },
+ function () {
+ d.$evalAsync(g);
+ }
+ );
+ return g;
+ }
+ ];
+ }
+ function vc(b, a, c, d) {
+ function e(a) {
+ try {
+ a.apply(null, ha.call(arguments, 1));
+ } finally {
+ if ((o--, o === 0))
+ for (; p.length; )
+ try {
+ p.pop()();
+ } catch (b) {
+ c.error(b);
+ }
+ }
+ }
+ function g(a, b) {
+ (function R() {
+ n(s, function (a) {
+ a();
+ });
+ J = b(R, a);
+ })();
+ }
+ function h() {
+ F != f.url() &&
+ ((F = f.url()),
+ n(V, function (a) {
+ a(f.url());
+ }));
+ }
+ var f = this,
+ j = a[0],
+ i = b.location,
+ k = b.history,
+ m = b.setTimeout,
+ l = b.clearTimeout,
+ t = {};
+ f.isMock = !1;
+ var o = 0,
+ p = [];
+ f.$$completeOutstandingRequest = e;
+ f.$$incOutstandingRequestCount = function () {
+ o++;
+ };
+ f.notifyWhenNoOutstandingRequests = function (a) {
+ n(s, function (a) {
+ a();
+ });
+ o === 0 ? a() : p.push(a);
+ };
+ var s = [],
+ J;
+ f.addPollFn = function (a) {
+ w(J) && g(100, m);
+ s.push(a);
+ return a;
+ };
+ var F = i.href,
+ z = a.find('base');
+ f.url = function (a, b) {
+ if (a) {
+ if (F != a)
+ return (
+ (F = a),
+ d.history
+ ? b
+ ? k.replaceState(null, '', a)
+ : (k.pushState(null, '', a), z.attr('href', z.attr('href')))
+ : b
+ ? i.replace(a)
+ : (i.href = a),
+ f
+ );
+ } else return i.href.replace(/%27/g, "'");
+ };
+ var V = [],
+ K = !1;
+ f.onUrlChange = function (a) {
+ K ||
+ (d.history && u(b).bind('popstate', h),
+ d.hashchange ? u(b).bind('hashchange', h) : f.addPollFn(h),
+ (K = !0));
+ V.push(a);
+ return a;
+ };
+ f.baseHref = function () {
+ var a = z.attr('href');
+ return a ? a.replace(/^https?\:\/\/[^\/]*/, '') : '';
+ };
+ var r = {},
+ $ = '',
+ P = f.baseHref();
+ f.cookies = function (a, b) {
+ var d, e, f, i;
+ if (a)
+ if (b === q)
+ j.cookie =
+ escape(a) +
+ '=;path=' +
+ P +
+ ';expires=Thu, 01 Jan 1970 00:00:00 GMT';
+ else {
+ if (A(b))
+ (d =
+ (j.cookie = escape(a) + '=' + escape(b) + ';path=' + P).length +
+ 1),
+ d > 4096 &&
+ c.warn(
+ "Cookie '" +
+ a +
+ "' possibly not set or overflowed because it was too large (" +
+ d +
+ ' > 4096 bytes)!'
+ );
+ }
+ else {
+ if (j.cookie !== $) {
+ $ = j.cookie;
+ d = $.split('; ');
+ r = {};
+ for (f = 0; f < d.length; f++)
+ (e = d[f]),
+ (i = e.indexOf('=')),
+ i > 0 &&
+ (r[unescape(e.substring(0, i))] = unescape(e.substring(i + 1)));
+ }
+ return r;
+ }
+ };
+ f.defer = function (a, b) {
+ var c;
+ o++;
+ c = m(function () {
+ delete t[c];
+ e(a);
+ }, b || 0);
+ t[c] = !0;
+ return c;
+ };
+ f.defer.cancel = function (a) {
+ return t[a] ? (delete t[a], l(a), e(C), !0) : !1;
+ };
+ }
+ function wc() {
+ this.$get = [
+ '$window',
+ '$log',
+ '$sniffer',
+ '$document',
+ function (b, a, c, d) {
+ return new vc(b, d, a, c);
+ }
+ ];
+ }
+ function xc() {
+ this.$get = function () {
+ function b(b, d) {
+ function e(a) {
+ if (a != m) {
+ if (l) {
+ if (l == a) l = a.n;
+ } else l = a;
+ g(a.n, a.p);
+ g(a, m);
+ m = a;
+ m.n = null;
+ }
+ }
+ function g(a, b) {
+ if (a != b) {
+ if (a) a.p = b;
+ if (b) b.n = a;
+ }
+ }
+ if (b in a) throw Error('cacheId ' + b + ' taken');
+ var h = 0,
+ f = v({}, d, { id: b }),
+ j = {},
+ i = (d && d.capacity) || Number.MAX_VALUE,
+ k = {},
+ m = null,
+ l = null;
+ return (a[b] = {
+ put: function (a, b) {
+ var c = k[a] || (k[a] = { key: a });
+ e(c);
+ w(b) || (a in j || h++, (j[a] = b), h > i && this.remove(l.key));
+ },
+ get: function (a) {
+ var b = k[a];
+ if (b) return e(b), j[a];
+ },
+ remove: function (a) {
+ var b = k[a];
+ if (b) {
+ if (b == m) m = b.p;
+ if (b == l) l = b.n;
+ g(b.n, b.p);
+ delete k[a];
+ delete j[a];
+ h--;
+ }
+ },
+ removeAll: function () {
+ j = {};
+ h = 0;
+ k = {};
+ m = l = null;
+ },
+ destroy: function () {
+ k = f = j = null;
+ delete a[b];
+ },
+ info: function () {
+ return v({}, f, { size: h });
+ }
+ });
+ }
+ var a = {};
+ b.info = function () {
+ var b = {};
+ n(a, function (a, e) {
+ b[e] = a.info();
+ });
+ return b;
+ };
+ b.get = function (b) {
+ return a[b];
+ };
+ return b;
+ };
+ }
+ function yc() {
+ this.$get = [
+ '$cacheFactory',
+ function (b) {
+ return b('templates');
+ }
+ ];
+ }
+ function Cb(b) {
+ var a = {},
+ c = 'Directive',
+ d = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,
+ e = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/,
+ g = 'Template must have exactly one root element. was: ',
+ h = /^\s*(https?|ftp|mailto):/;
+ this.directive = function j(d, e) {
+ A(d)
+ ? ($a(e, 'directive'),
+ a.hasOwnProperty(d) ||
+ ((a[d] = []),
+ b.factory(d + c, [
+ '$injector',
+ '$exceptionHandler',
+ function (b, c) {
+ var e = [];
+ n(a[d], function (a) {
+ try {
+ var g = b.invoke(a);
+ if (H(g)) g = { compile: I(g) };
+ else if (!g.compile && g.link) g.compile = I(g.link);
+ g.priority = g.priority || 0;
+ g.name = g.name || d;
+ g.require = g.require || (g.controller && g.name);
+ g.restrict = g.restrict || 'A';
+ e.push(g);
+ } catch (h) {
+ c(h);
+ }
+ });
+ return e;
+ }
+ ])),
+ a[d].push(e))
+ : n(d, nb(j));
+ return this;
+ };
+ this.urlSanitizationWhitelist = function (a) {
+ return x(a) ? ((h = a), this) : h;
+ };
+ this.$get = [
+ '$injector',
+ '$interpolate',
+ '$exceptionHandler',
+ '$http',
+ '$templateCache',
+ '$parse',
+ '$controller',
+ '$rootScope',
+ '$document',
+ function (b, i, k, m, l, t, o, p, s) {
+ function J(a, b, c) {
+ a instanceof u || (a = u(a));
+ n(a, function (b, c) {
+ b.nodeType == 3 &&
+ b.nodeValue.match(/\S+/) &&
+ (a[c] = u(b).wrap('').parent()[0]);
+ });
+ var d = z(a, b, a, c);
+ return function (b, c) {
+ $a(b, 'scope');
+ for (
+ var e = c ? va.clone.call(a) : a, g = 0, i = e.length;
+ g < i;
+ g++
+ ) {
+ var h = e[g];
+ (h.nodeType == 1 || h.nodeType == 9) && e.eq(g).data('$scope', b);
+ }
+ F(e, 'ng-scope');
+ c && c(e, b);
+ d && d(b, e, e);
+ return e;
+ };
+ }
+ function F(a, b) {
+ try {
+ a.addClass(b);
+ } catch (c) {}
+ }
+ function z(a, b, c, d) {
+ function e(a, c, d, i) {
+ var h,
+ j,
+ k,
+ o,
+ l,
+ m,
+ t,
+ s = [];
+ l = 0;
+ for (m = c.length; l < m; l++) s.push(c[l]);
+ t = l = 0;
+ for (m = g.length; l < m; t++)
+ (j = s[t]),
+ (c = g[l++]),
+ (h = g[l++]),
+ c
+ ? (c.scope
+ ? ((k = a.$new(M(c.scope))), u(j).data('$scope', k))
+ : (k = a),
+ (o = c.transclude) || (!i && b)
+ ? c(
+ h,
+ k,
+ j,
+ d,
+ (function (b) {
+ return function (c) {
+ var d = a.$new();
+ d.$$transcluded = !0;
+ return b(d, c).bind(
+ '$destroy',
+ Ua(d, d.$destroy)
+ );
+ };
+ })(o || b)
+ )
+ : c(h, k, j, q, i))
+ : h && h(a, j.childNodes, q, i);
+ }
+ for (var g = [], i, h, j, k = 0; k < a.length; k++)
+ (h = new ia()),
+ (i = V(a[k], [], h, d)),
+ (h =
+ ((i = i.length ? K(i, a[k], h, b, c) : null) && i.terminal) ||
+ !a[k].childNodes.length
+ ? null
+ : z(a[k].childNodes, i ? i.transclude : b)),
+ g.push(i),
+ g.push(h),
+ (j = j || i || h);
+ return j ? e : null;
+ }
+ function V(a, b, c, i) {
+ var g = c.$attr,
+ h;
+ switch (a.nodeType) {
+ case 1:
+ r(b, ea(fb(a).toLowerCase()), 'E', i);
+ var j, k, l;
+ h = a.attributes;
+ for (var o = 0, m = h && h.length; o < m; o++)
+ if (((j = h[o]), j.specified))
+ (k = j.name),
+ (l = ea(k.toLowerCase())),
+ (g[l] = k),
+ (c[l] = j =
+ O(
+ Z && k == 'href'
+ ? decodeURIComponent(a.getAttribute(k, 2))
+ : j.value
+ )),
+ zb(a, l) && (c[l] = !0),
+ R(a, b, j, l),
+ r(b, l, 'A', i);
+ a = a.className;
+ if (A(a) && a !== '')
+ for (; (h = e.exec(a)); )
+ (l = ea(h[2])),
+ r(b, l, 'C', i) && (c[l] = O(h[3])),
+ (a = a.substr(h.index + h[0].length));
+ break;
+ case 3:
+ x(b, a.nodeValue);
+ break;
+ case 8:
+ try {
+ if ((h = d.exec(a.nodeValue)))
+ (l = ea(h[1])), r(b, l, 'M', i) && (c[l] = O(h[2]));
+ } catch (t) {}
+ }
+ b.sort(G);
+ return b;
+ }
+ function K(a, b, c, d, e) {
+ function i(a, b) {
+ if (a) (a.require = r.require), m.push(a);
+ if (b) (b.require = r.require), s.push(b);
+ }
+ function h(a, b) {
+ var c,
+ d = 'data',
+ e = !1;
+ if (A(a)) {
+ for (; (c = a.charAt(0)) == '^' || c == '?'; )
+ (a = a.substr(1)),
+ c == '^' && (d = 'inheritedData'),
+ (e = e || c == '?');
+ c = b[d]('$' + a + 'Controller');
+ if (!c && !e) throw Error('No controller: ' + a);
+ } else
+ B(a) &&
+ ((c = []),
+ n(a, function (a) {
+ c.push(h(a, b));
+ }));
+ return c;
+ }
+ function j(a, d, e, i, g) {
+ var l, p, r, D, F;
+ l = b === e ? c : hc(c, new ia(u(e), c.$attr));
+ p = l.$$element;
+ if (K) {
+ var J = /^\s*([@=&])\s*(\w*)\s*$/,
+ ja = d.$parent || d;
+ n(K.scope, function (a, b) {
+ var c = a.match(J) || [],
+ e = c[2] || b,
+ c = c[1],
+ i,
+ g,
+ h;
+ d.$$isolateBindings[b] = c + e;
+ switch (c) {
+ case '@':
+ l.$observe(e, function (a) {
+ d[b] = a;
+ });
+ l.$$observers[e].$$scope = ja;
+ break;
+ case '=':
+ g = t(l[e]);
+ h =
+ g.assign ||
+ function () {
+ i = d[b] = g(ja);
+ throw Error(Db + l[e] + ' (directive: ' + K.name + ')');
+ };
+ i = d[b] = g(ja);
+ d.$watch(function () {
+ var a = g(ja);
+ a !== d[b] &&
+ (a !== i ? (i = d[b] = a) : h(ja, (a = i = d[b])));
+ return a;
+ });
+ break;
+ case '&':
+ g = t(l[e]);
+ d[b] = function (a) {
+ return g(ja, a);
+ };
+ break;
+ default:
+ throw Error(
+ 'Invalid isolate scope definition for directive ' +
+ K.name +
+ ': ' +
+ a
+ );
+ }
+ });
+ }
+ x &&
+ n(x, function (a) {
+ var b = { $scope: d, $element: p, $attrs: l, $transclude: g };
+ F = a.controller;
+ F == '@' && (F = l[a.name]);
+ p.data('$' + a.name + 'Controller', o(F, b));
+ });
+ i = 0;
+ for (r = m.length; i < r; i++)
+ try {
+ (D = m[i]), D(d, p, l, D.require && h(D.require, p));
+ } catch (z) {
+ k(z, qa(p));
+ }
+ a && a(d, e.childNodes, q, g);
+ i = 0;
+ for (r = s.length; i < r; i++)
+ try {
+ (D = s[i]), D(d, p, l, D.require && h(D.require, p));
+ } catch (zc) {
+ k(zc, qa(p));
+ }
+ }
+ for (
+ var l = -Number.MAX_VALUE,
+ m = [],
+ s = [],
+ p = null,
+ K = null,
+ z = null,
+ D = (c.$$element = u(b)),
+ r,
+ G,
+ S,
+ ka,
+ R = d,
+ x,
+ w,
+ W,
+ v = 0,
+ y = a.length;
+ v < y;
+ v++
+ ) {
+ r = a[v];
+ S = q;
+ if (l > r.priority) break;
+ if ((W = r.scope))
+ ua('isolated scope', K, r, D),
+ M(W) && (F(D, 'ng-isolate-scope'), (K = r)),
+ F(D, 'ng-scope'),
+ (p = p || r);
+ G = r.name;
+ if ((W = r.controller))
+ (x = x || {}),
+ ua("'" + G + "' controller", x[G], r, D),
+ (x[G] = r);
+ if ((W = r.transclude))
+ ua('transclusion', ka, r, D),
+ (ka = r),
+ (l = r.priority),
+ W == 'element'
+ ? ((S = u(b)),
+ (D = c.$$element =
+ u(Y.createComment(' ' + G + ': ' + c[G] + ' '))),
+ (b = D[0]),
+ C(e, u(S[0]), b),
+ (R = J(S, d, l)))
+ : ((S = u(cb(b)).contents()), D.html(''), (R = J(S, d)));
+ if ((W = r.template))
+ if ((ua('template', z, r, D), (z = r), (W = Eb(W)), r.replace)) {
+ S = u('' + O(W) + '').contents();
+ b = S[0];
+ if (S.length != 1 || b.nodeType !== 1) throw Error(g + W);
+ C(e, D, b);
+ G = { $attr: {} };
+ a = a.concat(V(b, a.splice(v + 1, a.length - (v + 1)), G));
+ $(c, G);
+ y = a.length;
+ } else D.html(W);
+ if (r.templateUrl)
+ ua('template', z, r, D),
+ (z = r),
+ (j = P(a.splice(v, a.length - v), j, D, c, e, r.replace, R)),
+ (y = a.length);
+ else if (r.compile)
+ try {
+ (w = r.compile(D, c, R)),
+ H(w) ? i(null, w) : w && i(w.pre, w.post);
+ } catch (E) {
+ k(E, qa(D));
+ }
+ if (r.terminal) (j.terminal = !0), (l = Math.max(l, r.priority));
+ }
+ j.scope = p && p.scope;
+ j.transclude = ka && R;
+ return j;
+ }
+ function r(d, e, i, g) {
+ var h = !1;
+ if (a.hasOwnProperty(e))
+ for (var l, e = b.get(e + c), o = 0, m = e.length; o < m; o++)
+ try {
+ if (
+ ((l = e[o]),
+ (g === q || g > l.priority) && l.restrict.indexOf(i) != -1)
+ )
+ d.push(l), (h = !0);
+ } catch (t) {
+ k(t);
+ }
+ return h;
+ }
+ function $(a, b) {
+ var c = b.$attr,
+ d = a.$attr,
+ e = a.$$element;
+ n(a, function (d, e) {
+ e.charAt(0) != '$' &&
+ (b[e] && (d += (e === 'style' ? ';' : ' ') + b[e]),
+ a.$set(e, d, !0, c[e]));
+ });
+ n(b, function (b, i) {
+ i == 'class'
+ ? (F(e, b),
+ (a['class'] = (a['class'] ? a['class'] + ' ' : '') + b))
+ : i == 'style'
+ ? e.attr('style', e.attr('style') + ';' + b)
+ : i.charAt(0) != '$' &&
+ !a.hasOwnProperty(i) &&
+ ((a[i] = b), (d[i] = c[i]));
+ });
+ }
+ function P(a, b, c, d, e, i, h) {
+ var j = [],
+ k,
+ o,
+ t = c[0],
+ s = a.shift(),
+ p = v({}, s, {
+ controller: null,
+ templateUrl: null,
+ transclude: null,
+ scope: null
+ });
+ c.html('');
+ m.get(s.templateUrl, { cache: l })
+ .success(function (l) {
+ var m,
+ s,
+ l = Eb(l);
+ if (i) {
+ s = u('' + O(l) + '').contents();
+ m = s[0];
+ if (s.length != 1 || m.nodeType !== 1) throw Error(g + l);
+ l = { $attr: {} };
+ C(e, c, m);
+ V(m, a, l);
+ $(d, l);
+ } else (m = t), c.html(l);
+ a.unshift(p);
+ k = K(a, m, d, h);
+ for (o = z(c.contents(), h); j.length; ) {
+ var ia = j.pop(),
+ l = j.pop();
+ s = j.pop();
+ var r = j.pop(),
+ D = m;
+ s !== t && ((D = cb(m)), C(l, u(s), D));
+ k(
+ function () {
+ b(o, r, D, e, ia);
+ },
+ r,
+ D,
+ e,
+ ia
+ );
+ }
+ j = null;
+ })
+ .error(function (a, b, c, d) {
+ throw Error('Failed to load template: ' + d.url);
+ });
+ return function (a, c, d, e, i) {
+ j
+ ? (j.push(c), j.push(d), j.push(e), j.push(i))
+ : k(
+ function () {
+ b(o, c, d, e, i);
+ },
+ c,
+ d,
+ e,
+ i
+ );
+ };
+ }
+ function G(a, b) {
+ return b.priority - a.priority;
+ }
+ function ua(a, b, c, d) {
+ if (b)
+ throw Error(
+ 'Multiple directives [' +
+ b.name +
+ ', ' +
+ c.name +
+ '] asking for ' +
+ a +
+ ' on: ' +
+ qa(d)
+ );
+ }
+ function x(a, b) {
+ var c = i(b, !0);
+ c &&
+ a.push({
+ priority: 0,
+ compile: I(function (a, b) {
+ var d = b.parent(),
+ e = d.data('$binding') || [];
+ e.push(c);
+ F(d.data('$binding', e), 'ng-binding');
+ a.$watch(c, function (a) {
+ b[0].nodeValue = a;
+ });
+ })
+ });
+ }
+ function R(a, b, c, d) {
+ var e = i(c, !0);
+ e &&
+ b.push({
+ priority: 100,
+ compile: I(function (a, b, c) {
+ b = c.$$observers || (c.$$observers = {});
+ d === 'class' && (e = i(c[d], !0));
+ c[d] = q;
+ (b[d] || (b[d] = [])).$$inter = !0;
+ ((c.$$observers && c.$$observers[d].$$scope) || a).$watch(
+ e,
+ function (a) {
+ c.$set(d, a);
+ }
+ );
+ })
+ });
+ }
+ function C(a, b, c) {
+ var d = b[0],
+ e = d.parentNode,
+ i,
+ g;
+ if (a) {
+ i = 0;
+ for (g = a.length; i < g; i++)
+ if (a[i] == d) {
+ a[i] = c;
+ break;
+ }
+ }
+ e && e.replaceChild(c, d);
+ c[u.expando] = d[u.expando];
+ b[0] = c;
+ }
+ var ia = function (a, b) {
+ this.$$element = a;
+ this.$attr = b || {};
+ };
+ ia.prototype = {
+ $normalize: ea,
+ $set: function (a, b, c, d) {
+ var e = zb(this.$$element[0], a),
+ i = this.$$observers;
+ e && (this.$$element.prop(a, b), (d = e));
+ this[a] = b;
+ d
+ ? (this.$attr[a] = d)
+ : (d = this.$attr[a]) || (this.$attr[a] = d = Za(a, '-'));
+ if (fb(this.$$element[0]) === 'A' && a === 'href')
+ D.setAttribute('href', b),
+ (e = D.href),
+ e.match(h) || (this[a] = b = 'unsafe:' + e);
+ c !== !1 &&
+ (b === null || b === q
+ ? this.$$element.removeAttr(d)
+ : this.$$element.attr(d, b));
+ i &&
+ n(i[a], function (a) {
+ try {
+ a(b);
+ } catch (c) {
+ k(c);
+ }
+ });
+ },
+ $observe: function (a, b) {
+ var c = this,
+ d = c.$$observers || (c.$$observers = {}),
+ e = d[a] || (d[a] = []);
+ e.push(b);
+ p.$evalAsync(function () {
+ e.$$inter || b(c[a]);
+ });
+ return b;
+ }
+ };
+ var D = s[0].createElement('a'),
+ S = i.startSymbol(),
+ ka = i.endSymbol(),
+ Eb =
+ S == '{{' || ka == '}}'
+ ? na
+ : function (a) {
+ return a.replace(/\{\{/g, S).replace(/}}/g, ka);
+ };
+ return J;
+ }
+ ];
+ }
+ function ea(b) {
+ return sb(b.replace(Ac, ''));
+ }
+ function Bc() {
+ var b = {};
+ this.register = function (a, c) {
+ M(a) ? v(b, a) : (b[a] = c);
+ };
+ this.$get = [
+ '$injector',
+ '$window',
+ function (a, c) {
+ return function (d, e) {
+ if (A(d)) {
+ var g = d,
+ d = b.hasOwnProperty(g)
+ ? b[g]
+ : gb(e.$scope, g, !0) || gb(c, g, !0);
+ ra(d, g, !0);
+ }
+ return a.instantiate(d, e);
+ };
+ }
+ ];
+ }
+ function Cc() {
+ this.$get = [
+ '$window',
+ function (b) {
+ return u(b.document);
+ }
+ ];
+ }
+ function Dc() {
+ this.$get = [
+ '$log',
+ function (b) {
+ return function (a, c) {
+ b.error.apply(b, arguments);
+ };
+ }
+ ];
+ }
+ function Ec() {
+ var b = '{{',
+ a = '}}';
+ this.startSymbol = function (a) {
+ return a ? ((b = a), this) : b;
+ };
+ this.endSymbol = function (b) {
+ return b ? ((a = b), this) : a;
+ };
+ this.$get = [
+ '$parse',
+ function (c) {
+ function d(d, f) {
+ for (var j, i, k = 0, m = [], l = d.length, t = !1, o = []; k < l; )
+ (j = d.indexOf(b, k)) != -1 && (i = d.indexOf(a, j + e)) != -1
+ ? (k != j && m.push(d.substring(k, j)),
+ m.push((k = c((t = d.substring(j + e, i))))),
+ (k.exp = t),
+ (k = i + g),
+ (t = !0))
+ : (k != l && m.push(d.substring(k)), (k = l));
+ if (!(l = m.length)) m.push(''), (l = 1);
+ if (!f || t)
+ return (
+ (o.length = l),
+ (k = function (a) {
+ for (var b = 0, c = l, d; b < c; b++) {
+ if (typeof (d = m[b]) == 'function')
+ (d = d(a)),
+ d == null || d == q
+ ? (d = '')
+ : typeof d != 'string' && (d = da(d));
+ o[b] = d;
+ }
+ return o.join('');
+ }),
+ (k.exp = d),
+ (k.parts = m),
+ k
+ );
+ }
+ var e = b.length,
+ g = a.length;
+ d.startSymbol = function () {
+ return b;
+ };
+ d.endSymbol = function () {
+ return a;
+ };
+ return d;
+ }
+ ];
+ }
+ function Fb(b) {
+ for (var b = b.split('/'), a = b.length; a--; ) b[a] = Ya(b[a]);
+ return b.join('/');
+ }
+ function wa(b, a) {
+ var c = Gb.exec(b),
+ c = {
+ protocol: c[1],
+ host: c[3],
+ port: E(c[5]) || Hb[c[1]] || null,
+ path: c[6] || '/',
+ search: c[8],
+ hash: c[10]
+ };
+ if (a)
+ (a.$$protocol = c.protocol), (a.$$host = c.host), (a.$$port = c.port);
+ return c;
+ }
+ function la(b, a, c) {
+ return b + '://' + a + (c == Hb[b] ? '' : ':' + c);
+ }
+ function Fc(b, a, c) {
+ var d = wa(b);
+ return decodeURIComponent(d.path) != a ||
+ w(d.hash) ||
+ d.hash.indexOf(c) !== 0
+ ? b
+ : la(d.protocol, d.host, d.port) +
+ a.substr(0, a.lastIndexOf('/')) +
+ d.hash.substr(c.length);
+ }
+ function Gc(b, a, c) {
+ var d = wa(b);
+ if (decodeURIComponent(d.path) == a) return b;
+ else {
+ var e = (d.search && '?' + d.search) || '',
+ g = (d.hash && '#' + d.hash) || '',
+ h = a.substr(0, a.lastIndexOf('/')),
+ f = d.path.substr(h.length);
+ if (d.path.indexOf(h) !== 0)
+ throw Error(
+ 'Invalid url "' + b + '", missing path prefix "' + h + '" !'
+ );
+ return la(d.protocol, d.host, d.port) + a + '#' + c + f + e + g;
+ }
+ }
+ function hb(b, a, c) {
+ a = a || '';
+ this.$$parse = function (b) {
+ var c = wa(b, this);
+ if (c.path.indexOf(a) !== 0)
+ throw Error(
+ 'Invalid url "' + b + '", missing path prefix "' + a + '" !'
+ );
+ this.$$path = decodeURIComponent(c.path.substr(a.length));
+ this.$$search = Wa(c.search);
+ this.$$hash = (c.hash && decodeURIComponent(c.hash)) || '';
+ this.$$compose();
+ };
+ this.$$compose = function () {
+ var b = pb(this.$$search),
+ c = this.$$hash ? '#' + Ya(this.$$hash) : '';
+ this.$$url = Fb(this.$$path) + (b ? '?' + b : '') + c;
+ this.$$absUrl =
+ la(this.$$protocol, this.$$host, this.$$port) + a + this.$$url;
+ };
+ this.$$rewriteAppUrl = function (a) {
+ if (a.indexOf(c) == 0) return a;
+ };
+ this.$$parse(b);
+ }
+ function Ha(b, a, c) {
+ var d;
+ this.$$parse = function (b) {
+ var c = wa(b, this);
+ if (c.hash && c.hash.indexOf(a) !== 0)
+ throw Error(
+ 'Invalid url "' + b + '", missing hash prefix "' + a + '" !'
+ );
+ d = c.path + (c.search ? '?' + c.search : '');
+ c = Hc.exec((c.hash || '').substr(a.length));
+ this.$$path = c[1]
+ ? (c[1].charAt(0) == '/' ? '' : '/') + decodeURIComponent(c[1])
+ : '';
+ this.$$search = Wa(c[3]);
+ this.$$hash = (c[5] && decodeURIComponent(c[5])) || '';
+ this.$$compose();
+ };
+ this.$$compose = function () {
+ var b = pb(this.$$search),
+ c = this.$$hash ? '#' + Ya(this.$$hash) : '';
+ this.$$url = Fb(this.$$path) + (b ? '?' + b : '') + c;
+ this.$$absUrl =
+ la(this.$$protocol, this.$$host, this.$$port) +
+ d +
+ (this.$$url ? '#' + a + this.$$url : '');
+ };
+ this.$$rewriteAppUrl = function (a) {
+ if (a.indexOf(c) == 0) return a;
+ };
+ this.$$parse(b);
+ }
+ function Ib(b, a, c, d) {
+ Ha.apply(this, arguments);
+ this.$$rewriteAppUrl = function (b) {
+ if (b.indexOf(c) == 0) return c + d + '#' + a + b.substr(c.length);
+ };
+ }
+ function Ia(b) {
+ return function () {
+ return this[b];
+ };
+ }
+ function Jb(b, a) {
+ return function (c) {
+ if (w(c)) return this[b];
+ this[b] = a(c);
+ this.$$compose();
+ return this;
+ };
+ }
+ function Ic() {
+ var b = '',
+ a = !1;
+ this.hashPrefix = function (a) {
+ return x(a) ? ((b = a), this) : b;
+ };
+ this.html5Mode = function (b) {
+ return x(b) ? ((a = b), this) : a;
+ };
+ this.$get = [
+ '$rootScope',
+ '$browser',
+ '$sniffer',
+ '$rootElement',
+ function (c, d, e, g) {
+ function h(a) {
+ c.$broadcast('$locationChangeSuccess', f.absUrl(), a);
+ }
+ var f,
+ j,
+ i,
+ k = d.url(),
+ m = wa(k);
+ a
+ ? ((j = d.baseHref() || '/'),
+ (i = j.substr(0, j.lastIndexOf('/'))),
+ (m = la(m.protocol, m.host, m.port) + i + '/'),
+ (f = e.history
+ ? new hb(Fc(k, j, b), i, m)
+ : new Ib(Gc(k, j, b), b, m, j.substr(i.length + 1))))
+ : ((m =
+ la(m.protocol, m.host, m.port) +
+ (m.path || '') +
+ (m.search ? '?' + m.search : '') +
+ '#' +
+ b +
+ '/'),
+ (f = new Ha(k, b, m)));
+ g.bind('click', function (a) {
+ if (!a.ctrlKey && !(a.metaKey || a.which == 2)) {
+ for (var b = u(a.target); y(b[0].nodeName) !== 'a'; )
+ if (b[0] === g[0] || !(b = b.parent())[0]) return;
+ var d = b.prop('href'),
+ e = f.$$rewriteAppUrl(d);
+ d &&
+ !b.attr('target') &&
+ e &&
+ (f.$$parse(e),
+ c.$apply(),
+ a.preventDefault(),
+ (X.angular['ff-684208-preventDefault'] = !0));
+ }
+ });
+ f.absUrl() != k && d.url(f.absUrl(), !0);
+ d.onUrlChange(function (a) {
+ f.absUrl() != a &&
+ (c.$evalAsync(function () {
+ var b = f.absUrl();
+ f.$$parse(a);
+ h(b);
+ }),
+ c.$$phase || c.$digest());
+ });
+ var l = 0;
+ c.$watch(function () {
+ var a = d.url(),
+ b = f.$$replace;
+ if (!l || a != f.absUrl())
+ l++,
+ c.$evalAsync(function () {
+ c.$broadcast('$locationChangeStart', f.absUrl(), a)
+ .defaultPrevented
+ ? f.$$parse(a)
+ : (d.url(f.absUrl(), b), h(a));
+ });
+ f.$$replace = !1;
+ return l;
+ });
+ return f;
+ }
+ ];
+ }
+ function Jc() {
+ this.$get = [
+ '$window',
+ function (b) {
+ function a(a) {
+ a instanceof Error &&
+ (a.stack
+ ? (a =
+ a.message && a.stack.indexOf(a.message) === -1
+ ? 'Error: ' + a.message + '\n' + a.stack
+ : a.stack)
+ : a.sourceURL &&
+ (a = a.message + '\n' + a.sourceURL + ':' + a.line));
+ return a;
+ }
+ function c(c) {
+ var e = b.console || {},
+ g = e[c] || e.log || C;
+ return g.apply
+ ? function () {
+ var b = [];
+ n(arguments, function (c) {
+ b.push(a(c));
+ });
+ return g.apply(e, b);
+ }
+ : function (a, b) {
+ g(a, b);
+ };
+ }
+ return {
+ log: c('log'),
+ warn: c('warn'),
+ info: c('info'),
+ error: c('error')
+ };
+ }
+ ];
+ }
+ function Kc(b, a) {
+ function c(a) {
+ return a.indexOf(s) != -1;
+ }
+ function d() {
+ return o + 1 < b.length ? b.charAt(o + 1) : !1;
+ }
+ function e(a) {
+ return '0' <= a && a <= '9';
+ }
+ function g(a) {
+ return (
+ a == ' ' ||
+ a == '\r' ||
+ a == '\t' ||
+ a == '\n' ||
+ a == '\u000b' ||
+ a == '\u00a0'
+ );
+ }
+ function h(a) {
+ return (
+ ('a' <= a && a <= 'z') || ('A' <= a && a <= 'Z') || '_' == a || a == '$'
+ );
+ }
+ function f(a) {
+ return a == '-' || a == '+' || e(a);
+ }
+ function j(a, c, d) {
+ d = d || o;
+ throw Error(
+ 'Lexer Error: ' +
+ a +
+ ' at column' +
+ (x(c)
+ ? 's ' + c + '-' + o + ' [' + b.substring(c, d) + ']'
+ : ' ' + d) +
+ ' in expression [' +
+ b +
+ '].'
+ );
+ }
+ function i() {
+ for (var a = '', c = o; o < b.length; ) {
+ var i = y(b.charAt(o));
+ if (i == '.' || e(i)) a += i;
+ else {
+ var g = d();
+ if (i == 'e' && f(g)) a += i;
+ else if (f(i) && g && e(g) && a.charAt(a.length - 1) == 'e') a += i;
+ else if (f(i) && (!g || !e(g)) && a.charAt(a.length - 1) == 'e')
+ j('Invalid exponent');
+ else break;
+ }
+ o++;
+ }
+ a *= 1;
+ l.push({
+ index: c,
+ text: a,
+ json: !0,
+ fn: function () {
+ return a;
+ }
+ });
+ }
+ function k() {
+ for (var c = '', d = o, f, i, j; o < b.length; ) {
+ var k = b.charAt(o);
+ if (k == '.' || h(k) || e(k)) k == '.' && (f = o), (c += k);
+ else break;
+ o++;
+ }
+ if (f)
+ for (i = o; i < b.length; ) {
+ k = b.charAt(i);
+ if (k == '(') {
+ j = c.substr(f - d + 1);
+ c = c.substr(0, f - d);
+ o = i;
+ break;
+ }
+ if (g(k)) i++;
+ else break;
+ }
+ d = { index: d, text: c };
+ if (Ja.hasOwnProperty(c)) d.fn = d.json = Ja[c];
+ else {
+ var m = Kb(c, a);
+ d.fn = v(
+ function (a, b) {
+ return m(a, b);
+ },
+ {
+ assign: function (a, b) {
+ return Lb(a, c, b);
+ }
+ }
+ );
+ }
+ l.push(d);
+ j &&
+ (l.push({ index: f, text: '.', json: !1 }),
+ l.push({ index: f + 1, text: j, json: !1 }));
+ }
+ function m(a) {
+ var c = o;
+ o++;
+ for (var d = '', e = a, f = !1; o < b.length; ) {
+ var i = b.charAt(o);
+ e += i;
+ if (f)
+ i == 'u'
+ ? ((i = b.substring(o + 1, o + 5)),
+ i.match(/[\da-f]{4}/i) ||
+ j('Invalid unicode escape [\\u' + i + ']'),
+ (o += 4),
+ (d += String.fromCharCode(parseInt(i, 16))))
+ : ((f = Lc[i]), (d += f ? f : i)),
+ (f = !1);
+ else if (i == '\\') f = !0;
+ else if (i == a) {
+ o++;
+ l.push({
+ index: c,
+ text: e,
+ string: d,
+ json: !0,
+ fn: function () {
+ return d;
+ }
+ });
+ return;
+ } else d += i;
+ o++;
+ }
+ j('Unterminated quote', c);
+ }
+ for (var l = [], t, o = 0, p = [], s, J = ':'; o < b.length; ) {
+ s = b.charAt(o);
+ if (c('"\'')) m(s);
+ else if (e(s) || (c('.') && e(d()))) i();
+ else if (h(s)) {
+ if (
+ (k(), '{,'.indexOf(J) != -1 && p[0] == '{' && (t = l[l.length - 1]))
+ )
+ t.json = t.text.indexOf('.') == -1;
+ } else if (c('(){}[].,;:'))
+ l.push({
+ index: o,
+ text: s,
+ json: (':[,'.indexOf(J) != -1 && c('{[')) || c('}]:,')
+ }),
+ c('{[') && p.unshift(s),
+ c('}]') && p.shift(),
+ o++;
+ else if (g(s)) {
+ o++;
+ continue;
+ } else {
+ var n = s + d(),
+ z = Ja[s],
+ V = Ja[n];
+ V
+ ? (l.push({ index: o, text: n, fn: V }), (o += 2))
+ : z
+ ? (l.push({
+ index: o,
+ text: s,
+ fn: z,
+ json: '[,:'.indexOf(J) != -1 && c('+-')
+ }),
+ (o += 1))
+ : j('Unexpected next character ', o, o + 1);
+ }
+ J = s;
+ }
+ return l;
+ }
+ function Mc(b, a, c, d) {
+ function e(a, c) {
+ throw Error(
+ "Syntax Error: Token '" +
+ c.text +
+ "' " +
+ a +
+ ' at column ' +
+ (c.index + 1) +
+ ' of the expression [' +
+ b +
+ '] starting at [' +
+ b.substring(c.index) +
+ '].'
+ );
+ }
+ function g() {
+ if (P.length === 0) throw Error('Unexpected end of expression: ' + b);
+ return P[0];
+ }
+ function h(a, b, c, d) {
+ if (P.length > 0) {
+ var e = P[0],
+ f = e.text;
+ if (f == a || f == b || f == c || f == d || (!a && !b && !c && !d))
+ return e;
+ }
+ return !1;
+ }
+ function f(b, c, d, f) {
+ return (b = h(b, c, d, f))
+ ? (a && !b.json && e('is not valid json', b), P.shift(), b)
+ : !1;
+ }
+ function j(a) {
+ f(a) || e('is unexpected, expecting [' + a + ']', h());
+ }
+ function i(a, b) {
+ return function (c, d) {
+ return a(c, d, b);
+ };
+ }
+ function k(a, b, c) {
+ return function (d, e) {
+ return b(d, e, a, c);
+ };
+ }
+ function m() {
+ for (var a = []; ; )
+ if ((P.length > 0 && !h('}', ')', ';', ']') && a.push(w()), !f(';')))
+ return a.length == 1
+ ? a[0]
+ : function (b, c) {
+ for (var d, e = 0; e < a.length; e++) {
+ var f = a[e];
+ f && (d = f(b, c));
+ }
+ return d;
+ };
+ }
+ function l() {
+ for (var a = f(), b = c(a.text), d = []; ; )
+ if ((a = f(':'))) d.push(G());
+ else {
+ var e = function (a, c, e) {
+ for (var e = [e], f = 0; f < d.length; f++) e.push(d[f](a, c));
+ return b.apply(a, e);
+ };
+ return function () {
+ return e;
+ };
+ }
+ }
+ function t() {
+ for (var a = o(), b; ; )
+ if ((b = f('||'))) a = k(a, b.fn, o());
+ else return a;
+ }
+ function o() {
+ var a = p(),
+ b;
+ if ((b = f('&&'))) a = k(a, b.fn, o());
+ return a;
+ }
+ function p() {
+ var a = s(),
+ b;
+ if ((b = f('==', '!='))) a = k(a, b.fn, p());
+ return a;
+ }
+ function s() {
+ var a;
+ a = J();
+ for (var b; (b = f('+', '-')); ) a = k(a, b.fn, J());
+ if ((b = f('<', '>', '<=', '>='))) a = k(a, b.fn, s());
+ return a;
+ }
+ function J() {
+ for (var a = n(), b; (b = f('*', '/', '%')); ) a = k(a, b.fn, n());
+ return a;
+ }
+ function n() {
+ var a;
+ return f('+')
+ ? z()
+ : (a = f('-'))
+ ? k(r, a.fn, n())
+ : (a = f('!'))
+ ? i(a.fn, n())
+ : z();
+ }
+ function z() {
+ var a;
+ if (f('(')) (a = w()), j(')');
+ else if (f('[')) a = V();
+ else if (f('{')) a = K();
+ else {
+ var b = f();
+ (a = b.fn) || e('not a primary expression', b);
+ }
+ for (var c; (b = f('(', '[', '.')); )
+ b.text === '('
+ ? ((a = x(a, c)), (c = null))
+ : b.text === '['
+ ? ((c = a), (a = R(a)))
+ : b.text === '.'
+ ? ((c = a), (a = u(a)))
+ : e('IMPOSSIBLE');
+ return a;
+ }
+ function V() {
+ var a = [];
+ if (g().text != ']') {
+ do a.push(G());
+ while (f(','));
+ }
+ j(']');
+ return function (b, c) {
+ for (var d = [], e = 0; e < a.length; e++) d.push(a[e](b, c));
+ return d;
+ };
+ }
+ function K() {
+ var a = [];
+ if (g().text != '}') {
+ do {
+ var b = f(),
+ b = b.string || b.text;
+ j(':');
+ var c = G();
+ a.push({ key: b, value: c });
+ } while (f(','));
+ }
+ j('}');
+ return function (b, c) {
+ for (var d = {}, e = 0; e < a.length; e++) {
+ var f = a[e],
+ i = f.value(b, c);
+ d[f.key] = i;
+ }
+ return d;
+ };
+ }
+ var r = I(0),
+ $,
+ P = Kc(b, d),
+ G = function () {
+ var a = t(),
+ c,
+ d;
+ return (d = f('='))
+ ? (a.assign ||
+ e(
+ 'implies assignment but [' +
+ b.substring(0, d.index) +
+ '] can not be assigned to',
+ d
+ ),
+ (c = t()),
+ function (b, d) {
+ return a.assign(b, c(b, d), d);
+ })
+ : a;
+ },
+ x = function (a, b) {
+ var c = [];
+ if (g().text != ')') {
+ do c.push(G());
+ while (f(','));
+ }
+ j(')');
+ return function (d, e) {
+ for (var f = [], i = b ? b(d, e) : d, g = 0; g < c.length; g++)
+ f.push(c[g](d, e));
+ g = a(d, e) || C;
+ return g.apply ? g.apply(i, f) : g(f[0], f[1], f[2], f[3], f[4]);
+ };
+ },
+ u = function (a) {
+ var b = f().text,
+ c = Kb(b, d);
+ return v(
+ function (b, d) {
+ return c(a(b, d), d);
+ },
+ {
+ assign: function (c, d, e) {
+ return Lb(a(c, e), b, d);
+ }
+ }
+ );
+ },
+ R = function (a) {
+ var b = G();
+ j(']');
+ return v(
+ function (c, d) {
+ var e = a(c, d),
+ f = b(c, d),
+ i;
+ if (!e) return q;
+ if ((e = e[f]) && e.then) {
+ i = e;
+ if (!('$$v' in e))
+ (i.$$v = q),
+ i.then(function (a) {
+ i.$$v = a;
+ });
+ e = e.$$v;
+ }
+ return e;
+ },
+ {
+ assign: function (c, d, e) {
+ return (a(c, e)[b(c, e)] = d);
+ }
+ }
+ );
+ },
+ w = function () {
+ for (var a = G(), b; ; )
+ if ((b = f('|'))) a = k(a, b.fn, l());
+ else return a;
+ };
+ a
+ ? ((G = t),
+ (x =
+ u =
+ R =
+ w =
+ function () {
+ e('is not valid json', { text: b, index: 0 });
+ }),
+ ($ = z()))
+ : ($ = m());
+ P.length !== 0 && e('is an unexpected token', P[0]);
+ return $;
+ }
+ function Lb(b, a, c) {
+ for (var a = a.split('.'), d = 0; a.length > 1; d++) {
+ var e = a.shift(),
+ g = b[e];
+ g || ((g = {}), (b[e] = g));
+ b = g;
+ }
+ return (b[a.shift()] = c);
+ }
+ function gb(b, a, c) {
+ if (!a) return b;
+ for (var a = a.split('.'), d, e = b, g = a.length, h = 0; h < g; h++)
+ (d = a[h]), b && (b = (e = b)[d]);
+ return !c && H(b) ? Ua(e, b) : b;
+ }
+ function Mb(b, a, c, d, e) {
+ return function (g, h) {
+ var f = h && h.hasOwnProperty(b) ? h : g,
+ j;
+ if (f === null || f === q) return f;
+ if ((f = f[b]) && f.then) {
+ if (!('$$v' in f))
+ (j = f),
+ (j.$$v = q),
+ j.then(function (a) {
+ j.$$v = a;
+ });
+ f = f.$$v;
+ }
+ if (!a || f === null || f === q) return f;
+ if ((f = f[a]) && f.then) {
+ if (!('$$v' in f))
+ (j = f),
+ (j.$$v = q),
+ j.then(function (a) {
+ j.$$v = a;
+ });
+ f = f.$$v;
+ }
+ if (!c || f === null || f === q) return f;
+ if ((f = f[c]) && f.then) {
+ if (!('$$v' in f))
+ (j = f),
+ (j.$$v = q),
+ j.then(function (a) {
+ j.$$v = a;
+ });
+ f = f.$$v;
+ }
+ if (!d || f === null || f === q) return f;
+ if ((f = f[d]) && f.then) {
+ if (!('$$v' in f))
+ (j = f),
+ (j.$$v = q),
+ j.then(function (a) {
+ j.$$v = a;
+ });
+ f = f.$$v;
+ }
+ if (!e || f === null || f === q) return f;
+ if ((f = f[e]) && f.then) {
+ if (!('$$v' in f))
+ (j = f),
+ (j.$$v = q),
+ j.then(function (a) {
+ j.$$v = a;
+ });
+ f = f.$$v;
+ }
+ return f;
+ };
+ }
+ function Kb(b, a) {
+ if (ib.hasOwnProperty(b)) return ib[b];
+ var c = b.split('.'),
+ d = c.length,
+ e;
+ if (a)
+ e =
+ d < 6
+ ? Mb(c[0], c[1], c[2], c[3], c[4])
+ : function (a, b) {
+ var e = 0,
+ i;
+ do
+ (i = Mb(c[e++], c[e++], c[e++], c[e++], c[e++])(a, b)),
+ (b = q),
+ (a = i);
+ while (e < d);
+ return i;
+ };
+ else {
+ var g = 'var l, fn, p;\n';
+ n(c, function (a, b) {
+ g +=
+ 'if(s === null || s === undefined) return s;\nl=s;\ns=' +
+ (b ? 's' : '((k&&k.hasOwnProperty("' + a + '"))?k:s)') +
+ '["' +
+ a +
+ '"];\nif (s && s.then) {\n if (!("$$v" in s)) {\n p=s;\n p.$$v = undefined;\n p.then(function(v) {p.$$v=v;});\n}\n s=s.$$v\n}\n';
+ });
+ g += 'return s;';
+ e = Function('s', 'k', g);
+ e.toString = function () {
+ return g;
+ };
+ }
+ return (ib[b] = e);
+ }
+ function Nc() {
+ var b = {};
+ this.$get = [
+ '$filter',
+ '$sniffer',
+ function (a, c) {
+ return function (d) {
+ switch (typeof d) {
+ case 'string':
+ return b.hasOwnProperty(d) ? b[d] : (b[d] = Mc(d, !1, a, c.csp));
+ case 'function':
+ return d;
+ default:
+ return C;
+ }
+ };
+ }
+ ];
+ }
+ function Oc() {
+ this.$get = [
+ '$rootScope',
+ '$exceptionHandler',
+ function (b, a) {
+ return Pc(function (a) {
+ b.$evalAsync(a);
+ }, a);
+ }
+ ];
+ }
+ function Pc(b, a) {
+ function c(a) {
+ return a;
+ }
+ function d(a) {
+ return h(a);
+ }
+ var e = function () {
+ var f = [],
+ j,
+ i;
+ return (i = {
+ resolve: function (a) {
+ if (f) {
+ var c = f;
+ f = q;
+ j = g(a);
+ c.length &&
+ b(function () {
+ for (var a, b = 0, d = c.length; b < d; b++)
+ (a = c[b]), j.then(a[0], a[1]);
+ });
+ }
+ },
+ reject: function (a) {
+ i.resolve(h(a));
+ },
+ promise: {
+ then: function (b, i) {
+ var g = e(),
+ h = function (d) {
+ try {
+ g.resolve((b || c)(d));
+ } catch (e) {
+ a(e), g.reject(e);
+ }
+ },
+ o = function (b) {
+ try {
+ g.resolve((i || d)(b));
+ } catch (c) {
+ a(c), g.reject(c);
+ }
+ };
+ f ? f.push([h, o]) : j.then(h, o);
+ return g.promise;
+ }
+ }
+ });
+ },
+ g = function (a) {
+ return a && a.then
+ ? a
+ : {
+ then: function (c) {
+ var d = e();
+ b(function () {
+ d.resolve(c(a));
+ });
+ return d.promise;
+ }
+ };
+ },
+ h = function (a) {
+ return {
+ then: function (c, i) {
+ var g = e();
+ b(function () {
+ g.resolve((i || d)(a));
+ });
+ return g.promise;
+ }
+ };
+ };
+ return {
+ defer: e,
+ reject: h,
+ when: function (f, j, i) {
+ var k = e(),
+ m,
+ l = function (b) {
+ try {
+ return (j || c)(b);
+ } catch (d) {
+ return a(d), h(d);
+ }
+ },
+ t = function (b) {
+ try {
+ return (i || d)(b);
+ } catch (c) {
+ return a(c), h(c);
+ }
+ };
+ b(function () {
+ g(f).then(
+ function (a) {
+ m || ((m = !0), k.resolve(g(a).then(l, t)));
+ },
+ function (a) {
+ m || ((m = !0), k.resolve(t(a)));
+ }
+ );
+ });
+ return k.promise;
+ },
+ all: function (a) {
+ var b = e(),
+ c = a.length,
+ d = [];
+ c
+ ? n(a, function (a, e) {
+ g(a).then(
+ function (a) {
+ e in d || ((d[e] = a), --c || b.resolve(d));
+ },
+ function (a) {
+ e in d || b.reject(a);
+ }
+ );
+ })
+ : b.resolve(d);
+ return b.promise;
+ }
+ };
+ }
+ function Qc() {
+ var b = {};
+ this.when = function (a, c) {
+ b[a] = v({ reloadOnSearch: !0 }, c);
+ if (a) {
+ var d = a[a.length - 1] == '/' ? a.substr(0, a.length - 1) : a + '/';
+ b[d] = { redirectTo: a };
+ }
+ return this;
+ };
+ this.otherwise = function (a) {
+ this.when(null, a);
+ return this;
+ };
+ this.$get = [
+ '$rootScope',
+ '$location',
+ '$routeParams',
+ '$q',
+ '$injector',
+ '$http',
+ '$templateCache',
+ function (a, c, d, e, g, h, f) {
+ function j(a, b) {
+ for (
+ var b = '^' + b.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') + '$',
+ c = '',
+ d = [],
+ e = {},
+ f = /:(\w+)/g,
+ i,
+ g = 0;
+ (i = f.exec(b)) !== null;
+
+ )
+ (c += b.slice(g, i.index)),
+ (c += '([^\\/]*)'),
+ d.push(i[1]),
+ (g = f.lastIndex);
+ c += b.substr(g);
+ var h = a.match(RegExp(c));
+ h &&
+ n(d, function (a, b) {
+ e[a] = h[b + 1];
+ });
+ return h ? e : null;
+ }
+ function i() {
+ var b = k(),
+ i = t.current;
+ if (
+ b &&
+ i &&
+ b.$route === i.$route &&
+ ga(b.pathParams, i.pathParams) &&
+ !b.reloadOnSearch &&
+ !l
+ )
+ (i.params = b.params),
+ U(i.params, d),
+ a.$broadcast('$routeUpdate', i);
+ else if (b || i)
+ (l = !1),
+ a.$broadcast('$routeChangeStart', b, i),
+ (t.current = b) &&
+ b.redirectTo &&
+ (A(b.redirectTo)
+ ? c.path(m(b.redirectTo, b.params)).search(b.params).replace()
+ : c
+ .url(b.redirectTo(b.pathParams, c.path(), c.search()))
+ .replace()),
+ e
+ .when(b)
+ .then(function () {
+ if (b) {
+ var a = [],
+ c = [],
+ d;
+ n(b.resolve || {}, function (b, d) {
+ a.push(d);
+ c.push(A(b) ? g.get(b) : g.invoke(b));
+ });
+ if (!x((d = b.template)))
+ if (x((d = b.templateUrl)))
+ d = h.get(d, { cache: f }).then(function (a) {
+ return a.data;
+ });
+ x(d) && (a.push('$template'), c.push(d));
+ return e.all(c).then(function (b) {
+ var c = {};
+ n(b, function (b, d) {
+ c[a[d]] = b;
+ });
+ return c;
+ });
+ }
+ })
+ .then(
+ function (c) {
+ if (b == t.current) {
+ if (b) (b.locals = c), U(b.params, d);
+ a.$broadcast('$routeChangeSuccess', b, i);
+ }
+ },
+ function (c) {
+ b == t.current &&
+ a.$broadcast('$routeChangeError', b, i, c);
+ }
+ );
+ }
+ function k() {
+ var a, d;
+ n(b, function (b, e) {
+ if (!d && (a = j(c.path(), e)))
+ (d = za(b, { params: v({}, c.search(), a), pathParams: a })),
+ (d.$route = b);
+ });
+ return d || (b[null] && za(b[null], { params: {}, pathParams: {} }));
+ }
+ function m(a, b) {
+ var c = [];
+ n((a || '').split(':'), function (a, d) {
+ if (d == 0) c.push(a);
+ else {
+ var e = a.match(/(\w+)(.*)/),
+ f = e[1];
+ c.push(b[f]);
+ c.push(e[2] || '');
+ delete b[f];
+ }
+ });
+ return c.join('');
+ }
+ var l = !1,
+ t = {
+ routes: b,
+ reload: function () {
+ l = !0;
+ a.$evalAsync(i);
+ }
+ };
+ a.$on('$locationChangeSuccess', i);
+ return t;
+ }
+ ];
+ }
+ function Rc() {
+ this.$get = I({});
+ }
+ function Sc() {
+ var b = 10;
+ this.digestTtl = function (a) {
+ arguments.length && (b = a);
+ return b;
+ };
+ this.$get = [
+ '$injector',
+ '$exceptionHandler',
+ '$parse',
+ function (a, c, d) {
+ function e() {
+ this.$id = ya();
+ this.$$phase =
+ this.$parent =
+ this.$$watchers =
+ this.$$nextSibling =
+ this.$$prevSibling =
+ this.$$childHead =
+ this.$$childTail =
+ null;
+ this['this'] = this.$root = this;
+ this.$$destroyed = !1;
+ this.$$asyncQueue = [];
+ this.$$listeners = {};
+ this.$$isolateBindings = {};
+ }
+ function g(a) {
+ if (j.$$phase) throw Error(j.$$phase + ' already in progress');
+ j.$$phase = a;
+ }
+ function h(a, b) {
+ var c = d(a);
+ ra(c, b);
+ return c;
+ }
+ function f() {}
+ e.prototype = {
+ $new: function (a) {
+ if (H(a))
+ throw Error(
+ 'API-CHANGE: Use $controller to instantiate controllers.'
+ );
+ a
+ ? ((a = new e()), (a.$root = this.$root))
+ : ((a = function () {}),
+ (a.prototype = this),
+ (a = new a()),
+ (a.$id = ya()));
+ a['this'] = a;
+ a.$$listeners = {};
+ a.$parent = this;
+ a.$$asyncQueue = [];
+ a.$$watchers =
+ a.$$nextSibling =
+ a.$$childHead =
+ a.$$childTail =
+ null;
+ a.$$prevSibling = this.$$childTail;
+ this.$$childHead
+ ? (this.$$childTail = this.$$childTail.$$nextSibling = a)
+ : (this.$$childHead = this.$$childTail = a);
+ return a;
+ },
+ $watch: function (a, b, c) {
+ var d = h(a, 'watch'),
+ e = this.$$watchers,
+ g = { fn: b, last: f, get: d, exp: a, eq: !!c };
+ if (!H(b)) {
+ var j = h(b || C, 'listener');
+ g.fn = function (a, b, c) {
+ j(c);
+ };
+ }
+ if (!e) e = this.$$watchers = [];
+ e.unshift(g);
+ return function () {
+ Ta(e, g);
+ };
+ },
+ $digest: function () {
+ var a,
+ d,
+ e,
+ h,
+ t,
+ o,
+ p,
+ s = b,
+ n,
+ F = [],
+ z,
+ q;
+ g('$digest');
+ do {
+ p = !1;
+ n = this;
+ do {
+ for (t = n.$$asyncQueue; t.length; )
+ try {
+ n.$eval(t.shift());
+ } catch (K) {
+ c(K);
+ }
+ if ((h = n.$$watchers))
+ for (o = h.length; o--; )
+ try {
+ if (
+ ((a = h[o]),
+ (d = a.get(n)) !== (e = a.last) &&
+ !(a.eq
+ ? ga(d, e)
+ : typeof d == 'number' &&
+ typeof e == 'number' &&
+ isNaN(d) &&
+ isNaN(e)))
+ )
+ (p = !0),
+ (a.last = a.eq ? U(d) : d),
+ a.fn(d, e === f ? d : e, n),
+ s < 5 &&
+ ((z = 4 - s),
+ F[z] || (F[z] = []),
+ (q = H(a.exp)
+ ? 'fn: ' + (a.exp.name || a.exp.toString())
+ : a.exp),
+ (q += '; newVal: ' + da(d) + '; oldVal: ' + da(e)),
+ F[z].push(q));
+ } catch (r) {
+ c(r);
+ }
+ if (!(h = n.$$childHead || (n !== this && n.$$nextSibling)))
+ for (; n !== this && !(h = n.$$nextSibling); ) n = n.$parent;
+ } while ((n = h));
+ if (p && !s--)
+ throw (
+ ((j.$$phase = null),
+ Error(
+ b +
+ ' $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: ' +
+ da(F)
+ ))
+ );
+ } while (p || t.length);
+ j.$$phase = null;
+ },
+ $destroy: function () {
+ if (!(j == this || this.$$destroyed)) {
+ var a = this.$parent;
+ this.$broadcast('$destroy');
+ this.$$destroyed = !0;
+ if (a.$$childHead == this) a.$$childHead = this.$$nextSibling;
+ if (a.$$childTail == this) a.$$childTail = this.$$prevSibling;
+ if (this.$$prevSibling)
+ this.$$prevSibling.$$nextSibling = this.$$nextSibling;
+ if (this.$$nextSibling)
+ this.$$nextSibling.$$prevSibling = this.$$prevSibling;
+ this.$parent =
+ this.$$nextSibling =
+ this.$$prevSibling =
+ this.$$childHead =
+ this.$$childTail =
+ null;
+ }
+ },
+ $eval: function (a, b) {
+ return d(a)(this, b);
+ },
+ $evalAsync: function (a) {
+ this.$$asyncQueue.push(a);
+ },
+ $apply: function (a) {
+ try {
+ return g('$apply'), this.$eval(a);
+ } catch (b) {
+ c(b);
+ } finally {
+ j.$$phase = null;
+ try {
+ j.$digest();
+ } catch (d) {
+ throw (c(d), d);
+ }
+ }
+ },
+ $on: function (a, b) {
+ var c = this.$$listeners[a];
+ c || (this.$$listeners[a] = c = []);
+ c.push(b);
+ return function () {
+ c[Aa(c, b)] = null;
+ };
+ },
+ $emit: function (a, b) {
+ var d = [],
+ e,
+ f = this,
+ g = !1,
+ h = {
+ name: a,
+ targetScope: f,
+ stopPropagation: function () {
+ g = !0;
+ },
+ preventDefault: function () {
+ h.defaultPrevented = !0;
+ },
+ defaultPrevented: !1
+ },
+ j = [h].concat(ha.call(arguments, 1)),
+ n,
+ q;
+ do {
+ e = f.$$listeners[a] || d;
+ h.currentScope = f;
+ n = 0;
+ for (q = e.length; n < q; n++)
+ if (e[n])
+ try {
+ if ((e[n].apply(null, j), g)) return h;
+ } catch (z) {
+ c(z);
+ }
+ else e.splice(n, 1), n--, q--;
+ f = f.$parent;
+ } while (f);
+ return h;
+ },
+ $broadcast: function (a, b) {
+ var d = this,
+ e = this,
+ f = {
+ name: a,
+ targetScope: this,
+ preventDefault: function () {
+ f.defaultPrevented = !0;
+ },
+ defaultPrevented: !1
+ },
+ g = [f].concat(ha.call(arguments, 1)),
+ h,
+ j;
+ do {
+ d = e;
+ f.currentScope = d;
+ e = d.$$listeners[a] || [];
+ h = 0;
+ for (j = e.length; h < j; h++)
+ if (e[h])
+ try {
+ e[h].apply(null, g);
+ } catch (n) {
+ c(n);
+ }
+ else e.splice(h, 1), h--, j--;
+ if (!(e = d.$$childHead || (d !== this && d.$$nextSibling)))
+ for (; d !== this && !(e = d.$$nextSibling); ) d = d.$parent;
+ } while ((d = e));
+ return f;
+ }
+ };
+ var j = new e();
+ return j;
+ }
+ ];
+ }
+ function Tc() {
+ this.$get = [
+ '$window',
+ function (b) {
+ var a = {},
+ c = E((/android (\d+)/.exec(y(b.navigator.userAgent)) || [])[1]);
+ return {
+ history: !(!b.history || !b.history.pushState || c < 4),
+ hashchange:
+ 'onhashchange' in b &&
+ (!b.document.documentMode || b.document.documentMode > 7),
+ hasEvent: function (c) {
+ if (c == 'input' && Z == 9) return !1;
+ if (w(a[c])) {
+ var e = b.document.createElement('div');
+ a[c] = 'on' + c in e;
+ }
+ return a[c];
+ },
+ csp: !1
+ };
+ }
+ ];
+ }
+ function Uc() {
+ this.$get = I(X);
+ }
+ function Nb(b) {
+ var a = {},
+ c,
+ d,
+ e;
+ if (!b) return a;
+ n(b.split('\n'), function (b) {
+ e = b.indexOf(':');
+ c = y(O(b.substr(0, e)));
+ d = O(b.substr(e + 1));
+ c && (a[c] ? (a[c] += ', ' + d) : (a[c] = d));
+ });
+ return a;
+ }
+ function Ob(b) {
+ var a = M(b) ? b : q;
+ return function (c) {
+ a || (a = Nb(b));
+ return c ? a[y(c)] || null : a;
+ };
+ }
+ function Pb(b, a, c) {
+ if (H(c)) return c(b, a);
+ n(c, function (c) {
+ b = c(b, a);
+ });
+ return b;
+ }
+ function Vc() {
+ var b = /^\s*(\[|\{[^\{])/,
+ a = /[\}\]]\s*$/,
+ c = /^\)\]\}',?\n/,
+ d = (this.defaults = {
+ transformResponse: [
+ function (d) {
+ A(d) &&
+ ((d = d.replace(c, '')),
+ b.test(d) && a.test(d) && (d = ob(d, !0)));
+ return d;
+ }
+ ],
+ transformRequest: [
+ function (a) {
+ return M(a) && xa.apply(a) !== '[object File]' ? da(a) : a;
+ }
+ ],
+ headers: {
+ common: {
+ Accept: 'application/json, text/plain, */*',
+ 'X-Requested-With': 'XMLHttpRequest'
+ },
+ post: { 'Content-Type': 'application/json;charset=utf-8' },
+ put: { 'Content-Type': 'application/json;charset=utf-8' }
+ }
+ }),
+ e = (this.responseInterceptors = []);
+ this.$get = [
+ '$httpBackend',
+ '$browser',
+ '$cacheFactory',
+ '$rootScope',
+ '$q',
+ '$injector',
+ function (a, b, c, j, i, k) {
+ function m(a) {
+ function c(a) {
+ var b = v({}, a, { data: Pb(a.data, a.headers, f) });
+ return 200 <= a.status && a.status < 300 ? b : i.reject(b);
+ }
+ a.method = ma(a.method);
+ var e = a.transformRequest || d.transformRequest,
+ f = a.transformResponse || d.transformResponse,
+ g = d.headers,
+ g = v(
+ { 'X-XSRF-TOKEN': b.cookies()['XSRF-TOKEN'] },
+ g.common,
+ g[y(a.method)],
+ a.headers
+ ),
+ e = Pb(a.data, Ob(g), e),
+ j;
+ w(a.data) && delete g['Content-Type'];
+ j = l(a, e, g);
+ j = j.then(c, c);
+ n(p, function (a) {
+ j = a(j);
+ });
+ j.success = function (b) {
+ j.then(function (c) {
+ b(c.data, c.status, c.headers, a);
+ });
+ return j;
+ };
+ j.error = function (b) {
+ j.then(null, function (c) {
+ b(c.data, c.status, c.headers, a);
+ });
+ return j;
+ };
+ return j;
+ }
+ function l(b, c, d) {
+ function e(a, b, c) {
+ n && (200 <= a && a < 300 ? n.put(q, [a, b, Nb(c)]) : n.remove(q));
+ f(b, a, c);
+ j.$apply();
+ }
+ function f(a, c, d) {
+ c = Math.max(c, 0);
+ (200 <= c && c < 300 ? k.resolve : k.reject)({
+ data: a,
+ status: c,
+ headers: Ob(d),
+ config: b
+ });
+ }
+ function h() {
+ var a = Aa(m.pendingRequests, b);
+ a !== -1 && m.pendingRequests.splice(a, 1);
+ }
+ var k = i.defer(),
+ l = k.promise,
+ n,
+ p,
+ q = t(b.url, b.params);
+ m.pendingRequests.push(b);
+ l.then(h, h);
+ b.cache && b.method == 'GET' && (n = M(b.cache) ? b.cache : o);
+ if (n)
+ if ((p = n.get(q)))
+ if (p.then) return p.then(h, h), p;
+ else B(p) ? f(p[1], p[0], U(p[2])) : f(p, 200, {});
+ else n.put(q, l);
+ p || a(b.method, q, c, e, d, b.timeout, b.withCredentials);
+ return l;
+ }
+ function t(a, b) {
+ if (!b) return a;
+ var c = [];
+ fc(b, function (a, b) {
+ a == null ||
+ a == q ||
+ (M(a) && (a = da(a)),
+ c.push(encodeURIComponent(b) + '=' + encodeURIComponent(a)));
+ });
+ return a + (a.indexOf('?') == -1 ? '?' : '&') + c.join('&');
+ }
+ var o = c('$http'),
+ p = [];
+ n(e, function (a) {
+ p.push(A(a) ? k.get(a) : k.invoke(a));
+ });
+ m.pendingRequests = [];
+ (function (a) {
+ n(arguments, function (a) {
+ m[a] = function (b, c) {
+ return m(v(c || {}, { method: a, url: b }));
+ };
+ });
+ })('get', 'delete', 'head', 'jsonp');
+ (function (a) {
+ n(arguments, function (a) {
+ m[a] = function (b, c, d) {
+ return m(v(d || {}, { method: a, url: b, data: c }));
+ };
+ });
+ })('post', 'put');
+ m.defaults = d;
+ return m;
+ }
+ ];
+ }
+ function Wc() {
+ this.$get = [
+ '$browser',
+ '$window',
+ '$document',
+ function (b, a, c) {
+ return Xc(
+ b,
+ Yc,
+ b.defer,
+ a.angular.callbacks,
+ c[0],
+ a.location.protocol.replace(':', '')
+ );
+ }
+ ];
+ }
+ function Xc(b, a, c, d, e, g) {
+ function h(a, b) {
+ var c = e.createElement('script'),
+ d = function () {
+ e.body.removeChild(c);
+ b && b();
+ };
+ c.type = 'text/javascript';
+ c.src = a;
+ Z
+ ? (c.onreadystatechange = function () {
+ /loaded|complete/.test(c.readyState) && d();
+ })
+ : (c.onload = c.onerror = d);
+ e.body.appendChild(c);
+ }
+ return function (e, j, i, k, m, l, t) {
+ function o(a, c, d, e) {
+ c = (j.match(Gb) || ['', g])[1] == 'file' ? (d ? 200 : 404) : c;
+ a(c == 1223 ? 204 : c, d, e);
+ b.$$completeOutstandingRequest(C);
+ }
+ b.$$incOutstandingRequestCount();
+ j = j || b.url();
+ if (y(e) == 'jsonp') {
+ var p = '_' + (d.counter++).toString(36);
+ d[p] = function (a) {
+ d[p].data = a;
+ };
+ h(j.replace('JSON_CALLBACK', 'angular.callbacks.' + p), function () {
+ d[p].data ? o(k, 200, d[p].data) : o(k, -2);
+ delete d[p];
+ });
+ } else {
+ var s = new a();
+ s.open(e, j, !0);
+ n(m, function (a, b) {
+ a && s.setRequestHeader(b, a);
+ });
+ var q;
+ s.onreadystatechange = function () {
+ if (s.readyState == 4) {
+ var a = s.getAllResponseHeaders(),
+ b = [
+ 'Cache-Control',
+ 'Content-Language',
+ 'Content-Type',
+ 'Expires',
+ 'Last-Modified',
+ 'Pragma'
+ ];
+ a ||
+ ((a = ''),
+ n(b, function (b) {
+ var c = s.getResponseHeader(b);
+ c && (a += b + ': ' + c + '\n');
+ }));
+ o(k, q || s.status, s.responseText, a);
+ }
+ };
+ if (t) s.withCredentials = !0;
+ s.send(i || '');
+ l > 0 &&
+ c(function () {
+ q = -1;
+ s.abort();
+ }, l);
+ }
+ };
+ }
+ function Zc() {
+ this.$get = function () {
+ return {
+ id: 'en-us',
+ NUMBER_FORMATS: {
+ DECIMAL_SEP: '.',
+ GROUP_SEP: ',',
+ PATTERNS: [
+ {
+ minInt: 1,
+ minFrac: 0,
+ maxFrac: 3,
+ posPre: '',
+ posSuf: '',
+ negPre: '-',
+ negSuf: '',
+ gSize: 3,
+ lgSize: 3
+ },
+ {
+ minInt: 1,
+ minFrac: 2,
+ maxFrac: 2,
+ posPre: '\u00a4',
+ posSuf: '',
+ negPre: '(\u00a4',
+ negSuf: ')',
+ gSize: 3,
+ lgSize: 3
+ }
+ ],
+ CURRENCY_SYM: '$'
+ },
+ DATETIME_FORMATS: {
+ MONTH:
+ 'January,February,March,April,May,June,July,August,September,October,November,December'.split(
+ ','
+ ),
+ SHORTMONTH: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(
+ ','
+ ),
+ DAY: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(
+ ','
+ ),
+ SHORTDAY: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),
+ AMPMS: ['AM', 'PM'],
+ medium: 'MMM d, y h:mm:ss a',
+ short: 'M/d/yy h:mm a',
+ fullDate: 'EEEE, MMMM d, y',
+ longDate: 'MMMM d, y',
+ mediumDate: 'MMM d, y',
+ shortDate: 'M/d/yy',
+ mediumTime: 'h:mm:ss a',
+ shortTime: 'h:mm a'
+ },
+ pluralCat: function (b) {
+ return b === 1 ? 'one' : 'other';
+ }
+ };
+ };
+ }
+ function $c() {
+ this.$get = [
+ '$rootScope',
+ '$browser',
+ '$q',
+ '$exceptionHandler',
+ function (b, a, c, d) {
+ function e(e, f, j) {
+ var i = c.defer(),
+ k = i.promise,
+ m = x(j) && !j,
+ f = a.defer(function () {
+ try {
+ i.resolve(e());
+ } catch (a) {
+ i.reject(a), d(a);
+ }
+ m || b.$apply();
+ }, f),
+ j = function () {
+ delete g[k.$$timeoutId];
+ };
+ k.$$timeoutId = f;
+ g[f] = i;
+ k.then(j, j);
+ return k;
+ }
+ var g = {};
+ e.cancel = function (b) {
+ return b && b.$$timeoutId in g
+ ? (g[b.$$timeoutId].reject('canceled'),
+ a.defer.cancel(b.$$timeoutId))
+ : !1;
+ };
+ return e;
+ }
+ ];
+ }
+ function Qb(b) {
+ function a(a, e) {
+ return b.factory(a + c, e);
+ }
+ var c = 'Filter';
+ this.register = a;
+ this.$get = [
+ '$injector',
+ function (a) {
+ return function (b) {
+ return a.get(b + c);
+ };
+ }
+ ];
+ a('currency', Rb);
+ a('date', Sb);
+ a('filter', ad);
+ a('json', bd);
+ a('limitTo', cd);
+ a('lowercase', dd);
+ a('number', Tb);
+ a('orderBy', Ub);
+ a('uppercase', ed);
+ }
+ function ad() {
+ return function (b, a) {
+ if (!B(b)) return b;
+ var c = [];
+ c.check = function (a) {
+ for (var b = 0; b < c.length; b++) if (!c[b](a)) return !1;
+ return !0;
+ };
+ var d = function (a, b) {
+ if (b.charAt(0) === '!') return !d(a, b.substr(1));
+ switch (typeof a) {
+ case 'boolean':
+ case 'number':
+ case 'string':
+ return ('' + a).toLowerCase().indexOf(b) > -1;
+ case 'object':
+ for (var c in a) if (c.charAt(0) !== '$' && d(a[c], b)) return !0;
+ return !1;
+ case 'array':
+ for (c = 0; c < a.length; c++) if (d(a[c], b)) return !0;
+ return !1;
+ default:
+ return !1;
+ }
+ };
+ switch (typeof a) {
+ case 'boolean':
+ case 'number':
+ case 'string':
+ a = { $: a };
+ case 'object':
+ for (var e in a)
+ e == '$'
+ ? (function () {
+ var b = ('' + a[e]).toLowerCase();
+ b &&
+ c.push(function (a) {
+ return d(a, b);
+ });
+ })()
+ : (function () {
+ var b = e,
+ f = ('' + a[e]).toLowerCase();
+ f &&
+ c.push(function (a) {
+ return d(gb(a, b), f);
+ });
+ })();
+ break;
+ case 'function':
+ c.push(a);
+ break;
+ default:
+ return b;
+ }
+ for (var g = [], h = 0; h < b.length; h++) {
+ var f = b[h];
+ c.check(f) && g.push(f);
+ }
+ return g;
+ };
+ }
+ function Rb(b) {
+ var a = b.NUMBER_FORMATS;
+ return function (b, d) {
+ if (w(d)) d = a.CURRENCY_SYM;
+ return Vb(b, a.PATTERNS[1], a.GROUP_SEP, a.DECIMAL_SEP, 2).replace(
+ /\u00A4/g,
+ d
+ );
+ };
+ }
+ function Tb(b) {
+ var a = b.NUMBER_FORMATS;
+ return function (b, d) {
+ return Vb(b, a.PATTERNS[0], a.GROUP_SEP, a.DECIMAL_SEP, d);
+ };
+ }
+ function Vb(b, a, c, d, e) {
+ if (isNaN(b) || !isFinite(b)) return '';
+ var g = b < 0,
+ b = Math.abs(b),
+ h = b + '',
+ f = '',
+ j = [],
+ i = !1;
+ if (h.indexOf('e') !== -1) {
+ var k = h.match(/([\d\.]+)e(-?)(\d+)/);
+ k && k[2] == '-' && k[3] > e + 1 ? (h = '0') : ((f = h), (i = !0));
+ }
+ if (!i) {
+ h = (h.split(Wb)[1] || '').length;
+ w(e) && (e = Math.min(Math.max(a.minFrac, h), a.maxFrac));
+ var h = Math.pow(10, e),
+ b = Math.round(b * h) / h,
+ b = ('' + b).split(Wb),
+ h = b[0],
+ b = b[1] || '',
+ i = 0,
+ k = a.lgSize,
+ m = a.gSize;
+ if (h.length >= k + m)
+ for (var i = h.length - k, l = 0; l < i; l++)
+ (i - l) % m === 0 && l !== 0 && (f += c), (f += h.charAt(l));
+ for (l = i; l < h.length; l++)
+ (h.length - l) % k === 0 && l !== 0 && (f += c), (f += h.charAt(l));
+ for (; b.length < e; ) b += '0';
+ e && e !== '0' && (f += d + b.substr(0, e));
+ }
+ j.push(g ? a.negPre : a.posPre);
+ j.push(f);
+ j.push(g ? a.negSuf : a.posSuf);
+ return j.join('');
+ }
+ function jb(b, a, c) {
+ var d = '';
+ b < 0 && ((d = '-'), (b = -b));
+ for (b = '' + b; b.length < a; ) b = '0' + b;
+ c && (b = b.substr(b.length - a));
+ return d + b;
+ }
+ function N(b, a, c, d) {
+ return function (e) {
+ e = e['get' + b]();
+ if (c > 0 || e > -c) e += c;
+ e === 0 && c == -12 && (e = 12);
+ return jb(e, a, d);
+ };
+ }
+ function Ka(b, a) {
+ return function (c, d) {
+ var e = c['get' + b](),
+ g = ma(a ? 'SHORT' + b : b);
+ return d[g][e];
+ };
+ }
+ function Sb(b) {
+ function a(a) {
+ var b;
+ if ((b = a.match(c))) {
+ var a = new Date(0),
+ g = 0,
+ h = 0;
+ b[9] && ((g = E(b[9] + b[10])), (h = E(b[9] + b[11])));
+ a.setUTCFullYear(E(b[1]), E(b[2]) - 1, E(b[3]));
+ a.setUTCHours(
+ E(b[4] || 0) - g,
+ E(b[5] || 0) - h,
+ E(b[6] || 0),
+ E(b[7] || 0)
+ );
+ }
+ return a;
+ }
+ var c =
+ /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
+ return function (c, e) {
+ var g = '',
+ h = [],
+ f,
+ j,
+ e = e || 'mediumDate',
+ e = b.DATETIME_FORMATS[e] || e;
+ A(c) && (c = fd.test(c) ? E(c) : a(c));
+ Ra(c) && (c = new Date(c));
+ if (!oa(c)) return c;
+ for (; e; )
+ (j = gd.exec(e))
+ ? ((h = h.concat(ha.call(j, 1))), (e = h.pop()))
+ : (h.push(e), (e = null));
+ n(h, function (a) {
+ f = hd[a];
+ g += f
+ ? f(c, b.DATETIME_FORMATS)
+ : a.replace(/(^'|'$)/g, '').replace(/''/g, "'");
+ });
+ return g;
+ };
+ }
+ function bd() {
+ return function (b) {
+ return da(b, !0);
+ };
+ }
+ function cd() {
+ return function (b, a) {
+ if (!(b instanceof Array)) return b;
+ var a = E(a),
+ c = [],
+ d,
+ e;
+ if (!b || !(b instanceof Array)) return c;
+ a > b.length ? (a = b.length) : a < -b.length && (a = -b.length);
+ a > 0 ? ((d = 0), (e = a)) : ((d = b.length + a), (e = b.length));
+ for (; d < e; d++) c.push(b[d]);
+ return c;
+ };
+ }
+ function Ub(b) {
+ return function (a, c, d) {
+ function e(a, b) {
+ return Va(b)
+ ? function (b, c) {
+ return a(c, b);
+ }
+ : a;
+ }
+ if (!B(a)) return a;
+ if (!c) return a;
+ for (
+ var c = B(c) ? c : [c],
+ c = Sa(c, function (a) {
+ var c = !1,
+ d = a || na;
+ if (A(a)) {
+ if (a.charAt(0) == '+' || a.charAt(0) == '-')
+ (c = a.charAt(0) == '-'), (a = a.substring(1));
+ d = b(a);
+ }
+ return e(function (a, b) {
+ var c;
+ c = d(a);
+ var e = d(b),
+ f = typeof c,
+ g = typeof e;
+ f == g
+ ? (f == 'string' && (c = c.toLowerCase()),
+ f == 'string' && (e = e.toLowerCase()),
+ (c = c === e ? 0 : c < e ? -1 : 1))
+ : (c = f < g ? -1 : 1);
+ return c;
+ }, c);
+ }),
+ g = [],
+ h = 0;
+ h < a.length;
+ h++
+ )
+ g.push(a[h]);
+ return g.sort(
+ e(function (a, b) {
+ for (var d = 0; d < c.length; d++) {
+ var e = c[d](a, b);
+ if (e !== 0) return e;
+ }
+ return 0;
+ }, d)
+ );
+ };
+ }
+ function Q(b) {
+ H(b) && (b = { link: b });
+ b.restrict = b.restrict || 'AC';
+ return I(b);
+ }
+ function Xb(b, a) {
+ function c(a, c) {
+ c = c ? '-' + Za(c, '-') : '';
+ b.removeClass((a ? La : Ma) + c).addClass((a ? Ma : La) + c);
+ }
+ var d = this,
+ e = b.parent().controller('form') || Na,
+ g = 0,
+ h = (d.$error = {});
+ d.$name = a.name;
+ d.$dirty = !1;
+ d.$pristine = !0;
+ d.$valid = !0;
+ d.$invalid = !1;
+ e.$addControl(d);
+ b.addClass(Oa);
+ c(!0);
+ d.$addControl = function (a) {
+ a.$name && !d.hasOwnProperty(a.$name) && (d[a.$name] = a);
+ };
+ d.$removeControl = function (a) {
+ a.$name && d[a.$name] === a && delete d[a.$name];
+ n(h, function (b, c) {
+ d.$setValidity(c, !0, a);
+ });
+ };
+ d.$setValidity = function (a, b, i) {
+ var k = h[a];
+ if (b) {
+ if (k && (Ta(k, i), !k.length)) {
+ g--;
+ if (!g) c(b), (d.$valid = !0), (d.$invalid = !1);
+ h[a] = !1;
+ c(!0, a);
+ e.$setValidity(a, !0, d);
+ }
+ } else {
+ g || c(b);
+ if (k) {
+ if (Aa(k, i) != -1) return;
+ } else (h[a] = k = []), g++, c(!1, a), e.$setValidity(a, !1, d);
+ k.push(i);
+ d.$valid = !1;
+ d.$invalid = !0;
+ }
+ };
+ d.$setDirty = function () {
+ b.removeClass(Oa).addClass(Yb);
+ d.$dirty = !0;
+ d.$pristine = !1;
+ e.$setDirty();
+ };
+ }
+ function T(b) {
+ return w(b) || b === '' || b === null || b !== b;
+ }
+ function Pa(b, a, c, d, e, g) {
+ var h = function () {
+ var c = O(a.val());
+ d.$viewValue !== c &&
+ b.$apply(function () {
+ d.$setViewValue(c);
+ });
+ };
+ if (e.hasEvent('input')) a.bind('input', h);
+ else {
+ var f;
+ a.bind('keydown', function (a) {
+ a = a.keyCode;
+ a === 91 ||
+ (15 < a && a < 19) ||
+ (37 <= a && a <= 40) ||
+ f ||
+ (f = g.defer(function () {
+ h();
+ f = null;
+ }));
+ });
+ a.bind('change', h);
+ }
+ d.$render = function () {
+ a.val(T(d.$viewValue) ? '' : d.$viewValue);
+ };
+ var j = c.ngPattern,
+ i = function (a, b) {
+ return T(b) || a.test(b)
+ ? (d.$setValidity('pattern', !0), b)
+ : (d.$setValidity('pattern', !1), q);
+ };
+ j &&
+ (j.match(/^\/(.*)\/$/)
+ ? ((j = RegExp(j.substr(1, j.length - 2))),
+ (e = function (a) {
+ return i(j, a);
+ }))
+ : (e = function (a) {
+ var c = b.$eval(j);
+ if (!c || !c.test)
+ throw Error('Expected ' + j + ' to be a RegExp but was ' + c);
+ return i(c, a);
+ }),
+ d.$formatters.push(e),
+ d.$parsers.push(e));
+ if (c.ngMinlength) {
+ var k = E(c.ngMinlength),
+ e = function (a) {
+ return !T(a) && a.length < k
+ ? (d.$setValidity('minlength', !1), q)
+ : (d.$setValidity('minlength', !0), a);
+ };
+ d.$parsers.push(e);
+ d.$formatters.push(e);
+ }
+ if (c.ngMaxlength) {
+ var m = E(c.ngMaxlength),
+ c = function (a) {
+ return !T(a) && a.length > m
+ ? (d.$setValidity('maxlength', !1), q)
+ : (d.$setValidity('maxlength', !0), a);
+ };
+ d.$parsers.push(c);
+ d.$formatters.push(c);
+ }
+ }
+ function kb(b, a) {
+ b = 'ngClass' + b;
+ return Q(function (c, d, e) {
+ function g(b) {
+ if (a === !0 || c.$index % 2 === a) j && b !== j && h(j), f(b);
+ j = b;
+ }
+ function h(a) {
+ M(a) &&
+ !B(a) &&
+ (a = Sa(a, function (a, b) {
+ if (a) return b;
+ }));
+ d.removeClass(B(a) ? a.join(' ') : a);
+ }
+ function f(a) {
+ M(a) &&
+ !B(a) &&
+ (a = Sa(a, function (a, b) {
+ if (a) return b;
+ }));
+ a && d.addClass(B(a) ? a.join(' ') : a);
+ }
+ var j = q;
+ c.$watch(e[b], g, !0);
+ e.$observe('class', function () {
+ var a = c.$eval(e[b]);
+ g(a, a);
+ });
+ b !== 'ngClass' &&
+ c.$watch('$index', function (d, g) {
+ var j = d % 2;
+ j !== g % 2 && (j == a ? f(c.$eval(e[b])) : h(c.$eval(e[b])));
+ });
+ });
+ }
+ var y = function (b) {
+ return A(b) ? b.toLowerCase() : b;
+ },
+ ma = function (b) {
+ return A(b) ? b.toUpperCase() : b;
+ },
+ Z = E((/msie (\d+)/.exec(y(navigator.userAgent)) || [])[1]),
+ u,
+ ca,
+ ha = [].slice,
+ Qa = [].push,
+ xa = Object.prototype.toString,
+ Zb = X.angular || (X.angular = {}),
+ ta,
+ fb,
+ aa = ['0', '0', '0'];
+ C.$inject = [];
+ na.$inject = [];
+ fb =
+ Z < 9
+ ? function (b) {
+ b = b.nodeName ? b : b[0];
+ return b.scopeName && b.scopeName != 'HTML'
+ ? ma(b.scopeName + ':' + b.nodeName)
+ : b.nodeName;
+ }
+ : function (b) {
+ return b.nodeName ? b.nodeName : b[0].nodeName;
+ };
+ var kc = /[A-Z]/g,
+ id = {
+ full: '1.0.5',
+ major: 1,
+ minor: 0,
+ dot: 5,
+ codeName: 'flatulent-propulsion'
+ },
+ Ca = (L.cache = {}),
+ Ba = (L.expando = 'ng-' + new Date().getTime()),
+ oc = 1,
+ $b = X.document.addEventListener
+ ? function (b, a, c) {
+ b.addEventListener(a, c, !1);
+ }
+ : function (b, a, c) {
+ b.attachEvent('on' + a, c);
+ },
+ db = X.document.removeEventListener
+ ? function (b, a, c) {
+ b.removeEventListener(a, c, !1);
+ }
+ : function (b, a, c) {
+ b.detachEvent('on' + a, c);
+ },
+ mc = /([\:\-\_]+(.))/g,
+ nc = /^moz([A-Z])/,
+ va = (L.prototype = {
+ ready: function (b) {
+ function a() {
+ c || ((c = !0), b());
+ }
+ var c = !1;
+ this.bind('DOMContentLoaded', a);
+ L(X).bind('load', a);
+ },
+ toString: function () {
+ var b = [];
+ n(this, function (a) {
+ b.push('' + a);
+ });
+ return '[' + b.join(', ') + ']';
+ },
+ eq: function (b) {
+ return b >= 0 ? u(this[b]) : u(this[this.length + b]);
+ },
+ length: 0,
+ push: Qa,
+ sort: [].sort,
+ splice: [].splice
+ }),
+ Fa = {};
+ n(
+ 'multiple,selected,checked,disabled,readOnly,required'.split(','),
+ function (b) {
+ Fa[y(b)] = b;
+ }
+ );
+ var Ab = {};
+ n('input,select,option,textarea,button,form'.split(','), function (b) {
+ Ab[ma(b)] = !0;
+ });
+ n(
+ {
+ data: vb,
+ inheritedData: Ea,
+ scope: function (b) {
+ return Ea(b, '$scope');
+ },
+ controller: yb,
+ injector: function (b) {
+ return Ea(b, '$injector');
+ },
+ removeAttr: function (b, a) {
+ b.removeAttribute(a);
+ },
+ hasClass: Da,
+ css: function (b, a, c) {
+ a = sb(a);
+ if (x(c)) b.style[a] = c;
+ else {
+ var d;
+ Z <= 8 &&
+ ((d = b.currentStyle && b.currentStyle[a]),
+ d === '' && (d = 'auto'));
+ d = d || b.style[a];
+ Z <= 8 && (d = d === '' ? q : d);
+ return d;
+ }
+ },
+ attr: function (b, a, c) {
+ var d = y(a);
+ if (Fa[d])
+ if (x(c))
+ c
+ ? ((b[a] = !0), b.setAttribute(a, d))
+ : ((b[a] = !1), b.removeAttribute(d));
+ else
+ return b[a] || (b.attributes.getNamedItem(a) || C).specified
+ ? d
+ : q;
+ else if (x(c)) b.setAttribute(a, c);
+ else if (b.getAttribute)
+ return (b = b.getAttribute(a, 2)), b === null ? q : b;
+ },
+ prop: function (b, a, c) {
+ if (x(c)) b[a] = c;
+ else return b[a];
+ },
+ text: v(
+ Z < 9
+ ? function (b, a) {
+ if (b.nodeType == 1) {
+ if (w(a)) return b.innerText;
+ b.innerText = a;
+ } else {
+ if (w(a)) return b.nodeValue;
+ b.nodeValue = a;
+ }
+ }
+ : function (b, a) {
+ if (w(a)) return b.textContent;
+ b.textContent = a;
+ },
+ { $dv: '' }
+ ),
+ val: function (b, a) {
+ if (w(a)) return b.value;
+ b.value = a;
+ },
+ html: function (b, a) {
+ if (w(a)) return b.innerHTML;
+ for (var c = 0, d = b.childNodes; c < d.length; c++) sa(d[c]);
+ b.innerHTML = a;
+ }
+ },
+ function (b, a) {
+ L.prototype[a] = function (a, d) {
+ var e, g;
+ if ((b.length == 2 && b !== Da && b !== yb ? a : d) === q)
+ if (M(a)) {
+ for (e = 0; e < this.length; e++)
+ if (b === vb) b(this[e], a);
+ else for (g in a) b(this[e], g, a[g]);
+ return this;
+ } else {
+ if (this.length) return b(this[0], a, d);
+ }
+ else {
+ for (e = 0; e < this.length; e++) b(this[e], a, d);
+ return this;
+ }
+ return b.$dv;
+ };
+ }
+ );
+ n(
+ {
+ removeData: tb,
+ dealoc: sa,
+ bind: function a(c, d, e) {
+ var g = ba(c, 'events'),
+ h = ba(c, 'handle');
+ g || ba(c, 'events', (g = {}));
+ h || ba(c, 'handle', (h = pc(c, g)));
+ n(d.split(' '), function (d) {
+ var j = g[d];
+ if (!j) {
+ if (d == 'mouseenter' || d == 'mouseleave') {
+ var i = 0;
+ g.mouseenter = [];
+ g.mouseleave = [];
+ a(c, 'mouseover', function (a) {
+ i++;
+ i == 1 && h(a, 'mouseenter');
+ });
+ a(c, 'mouseout', function (a) {
+ i--;
+ i == 0 && h(a, 'mouseleave');
+ });
+ } else $b(c, d, h), (g[d] = []);
+ j = g[d];
+ }
+ j.push(e);
+ });
+ },
+ unbind: ub,
+ replaceWith: function (a, c) {
+ var d,
+ e = a.parentNode;
+ sa(a);
+ n(new L(c), function (c) {
+ d ? e.insertBefore(c, d.nextSibling) : e.replaceChild(c, a);
+ d = c;
+ });
+ },
+ children: function (a) {
+ var c = [];
+ n(a.childNodes, function (a) {
+ a.nodeType === 1 && c.push(a);
+ });
+ return c;
+ },
+ contents: function (a) {
+ return a.childNodes || [];
+ },
+ append: function (a, c) {
+ n(new L(c), function (c) {
+ a.nodeType === 1 && a.appendChild(c);
+ });
+ },
+ prepend: function (a, c) {
+ if (a.nodeType === 1) {
+ var d = a.firstChild;
+ n(new L(c), function (c) {
+ d ? a.insertBefore(c, d) : (a.appendChild(c), (d = c));
+ });
+ }
+ },
+ wrap: function (a, c) {
+ var c = u(c)[0],
+ d = a.parentNode;
+ d && d.replaceChild(c, a);
+ c.appendChild(a);
+ },
+ remove: function (a) {
+ sa(a);
+ var c = a.parentNode;
+ c && c.removeChild(a);
+ },
+ after: function (a, c) {
+ var d = a,
+ e = a.parentNode;
+ n(new L(c), function (a) {
+ e.insertBefore(a, d.nextSibling);
+ d = a;
+ });
+ },
+ addClass: xb,
+ removeClass: wb,
+ toggleClass: function (a, c, d) {
+ w(d) && (d = !Da(a, c));
+ (d ? xb : wb)(a, c);
+ },
+ parent: function (a) {
+ return (a = a.parentNode) && a.nodeType !== 11 ? a : null;
+ },
+ next: function (a) {
+ if (a.nextElementSibling) return a.nextElementSibling;
+ for (a = a.nextSibling; a != null && a.nodeType !== 1; )
+ a = a.nextSibling;
+ return a;
+ },
+ find: function (a, c) {
+ return a.getElementsByTagName(c);
+ },
+ clone: cb,
+ triggerHandler: function (a, c) {
+ var d = (ba(a, 'events') || {})[c];
+ n(d, function (c) {
+ c.call(a, null);
+ });
+ }
+ },
+ function (a, c) {
+ L.prototype[c] = function (c, e) {
+ for (var g, h = 0; h < this.length; h++)
+ g == q
+ ? ((g = a(this[h], c, e)), g !== q && (g = u(g)))
+ : bb(g, a(this[h], c, e));
+ return g == q ? this : g;
+ };
+ }
+ );
+ Ga.prototype = {
+ put: function (a, c) {
+ this[fa(a)] = c;
+ },
+ get: function (a) {
+ return this[fa(a)];
+ },
+ remove: function (a) {
+ var c = this[(a = fa(a))];
+ delete this[a];
+ return c;
+ }
+ };
+ eb.prototype = {
+ push: function (a, c) {
+ var d = this[(a = fa(a))];
+ d ? d.push(c) : (this[a] = [c]);
+ },
+ shift: function (a) {
+ var c = this[(a = fa(a))];
+ if (c) return c.length == 1 ? (delete this[a], c[0]) : c.shift();
+ },
+ peek: function (a) {
+ if ((a = this[fa(a)])) return a[0];
+ }
+ };
+ var rc = /^function\s*[^\(]*\(\s*([^\)]*)\)/m,
+ sc = /,/,
+ tc = /^\s*(_?)(\S+?)\1\s*$/,
+ qc = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,
+ Db = 'Non-assignable model expression: ';
+ Cb.$inject = ['$provide'];
+ var Ac = /^(x[\:\-_]|data[\:\-_])/i,
+ Gb =
+ /^([^:]+):\/\/(\w+:{0,1}\w*@)?([\w\.-]*)(:([0-9]+))?(\/[^\?#]*)?(\?([^#]*))?(#(.*))?$/,
+ ac = /^([^\?#]*)?(\?([^#]*))?(#(.*))?$/,
+ Hc = ac,
+ Hb = { http: 80, https: 443, ftp: 21 };
+ hb.prototype = {
+ $$replace: !1,
+ absUrl: Ia('$$absUrl'),
+ url: function (a, c) {
+ if (w(a)) return this.$$url;
+ var d = ac.exec(a);
+ d[1] && this.path(decodeURIComponent(d[1]));
+ if (d[2] || d[1]) this.search(d[3] || '');
+ this.hash(d[5] || '', c);
+ return this;
+ },
+ protocol: Ia('$$protocol'),
+ host: Ia('$$host'),
+ port: Ia('$$port'),
+ path: Jb('$$path', function (a) {
+ return a.charAt(0) == '/' ? a : '/' + a;
+ }),
+ search: function (a, c) {
+ if (w(a)) return this.$$search;
+ x(c)
+ ? c === null
+ ? delete this.$$search[a]
+ : (this.$$search[a] = c)
+ : (this.$$search = A(a) ? Wa(a) : a);
+ this.$$compose();
+ return this;
+ },
+ hash: Jb('$$hash', na),
+ replace: function () {
+ this.$$replace = !0;
+ return this;
+ }
+ };
+ Ha.prototype = za(hb.prototype);
+ Ib.prototype = za(Ha.prototype);
+ var Ja = {
+ null: function () {
+ return null;
+ },
+ true: function () {
+ return !0;
+ },
+ false: function () {
+ return !1;
+ },
+ undefined: C,
+ '+': function (a, c, d, e) {
+ d = d(a, c);
+ e = e(a, c);
+ return x(d) ? (x(e) ? d + e : d) : x(e) ? e : q;
+ },
+ '-': function (a, c, d, e) {
+ d = d(a, c);
+ e = e(a, c);
+ return (x(d) ? d : 0) - (x(e) ? e : 0);
+ },
+ '*': function (a, c, d, e) {
+ return d(a, c) * e(a, c);
+ },
+ '/': function (a, c, d, e) {
+ return d(a, c) / e(a, c);
+ },
+ '%': function (a, c, d, e) {
+ return d(a, c) % e(a, c);
+ },
+ '^': function (a, c, d, e) {
+ return d(a, c) ^ e(a, c);
+ },
+ '=': C,
+ '==': function (a, c, d, e) {
+ return d(a, c) == e(a, c);
+ },
+ '!=': function (a, c, d, e) {
+ return d(a, c) != e(a, c);
+ },
+ '<': function (a, c, d, e) {
+ return d(a, c) < e(a, c);
+ },
+ '>': function (a, c, d, e) {
+ return d(a, c) > e(a, c);
+ },
+ '<=': function (a, c, d, e) {
+ return d(a, c) <= e(a, c);
+ },
+ '>=': function (a, c, d, e) {
+ return d(a, c) >= e(a, c);
+ },
+ '&&': function (a, c, d, e) {
+ return d(a, c) && e(a, c);
+ },
+ '||': function (a, c, d, e) {
+ return d(a, c) || e(a, c);
+ },
+ '&': function (a, c, d, e) {
+ return d(a, c) & e(a, c);
+ },
+ '|': function (a, c, d, e) {
+ return e(a, c)(a, c, d(a, c));
+ },
+ '!': function (a, c, d) {
+ return !d(a, c);
+ }
+ },
+ Lc = {
+ n: '\n',
+ f: '\u000c',
+ r: '\r',
+ t: '\t',
+ v: '\u000b',
+ "'": "'",
+ '"': '"'
+ },
+ ib = {},
+ Yc =
+ X.XMLHttpRequest ||
+ function () {
+ try {
+ return new ActiveXObject('Msxml2.XMLHTTP.6.0');
+ } catch (a) {}
+ try {
+ return new ActiveXObject('Msxml2.XMLHTTP.3.0');
+ } catch (c) {}
+ try {
+ return new ActiveXObject('Msxml2.XMLHTTP');
+ } catch (d) {}
+ throw Error('This browser does not support XMLHttpRequest.');
+ };
+ Qb.$inject = ['$provide'];
+ Rb.$inject = ['$locale'];
+ Tb.$inject = ['$locale'];
+ var Wb = '.',
+ hd = {
+ yyyy: N('FullYear', 4),
+ yy: N('FullYear', 2, 0, !0),
+ y: N('FullYear', 1),
+ MMMM: Ka('Month'),
+ MMM: Ka('Month', !0),
+ MM: N('Month', 2, 1),
+ M: N('Month', 1, 1),
+ dd: N('Date', 2),
+ d: N('Date', 1),
+ HH: N('Hours', 2),
+ H: N('Hours', 1),
+ hh: N('Hours', 2, -12),
+ h: N('Hours', 1, -12),
+ mm: N('Minutes', 2),
+ m: N('Minutes', 1),
+ ss: N('Seconds', 2),
+ s: N('Seconds', 1),
+ EEEE: Ka('Day'),
+ EEE: Ka('Day', !0),
+ a: function (a, c) {
+ return a.getHours() < 12 ? c.AMPMS[0] : c.AMPMS[1];
+ },
+ Z: function (a) {
+ var a = -1 * a.getTimezoneOffset(),
+ c = a >= 0 ? '+' : '';
+ c += jb(a / 60, 2) + jb(Math.abs(a % 60), 2);
+ return c;
+ }
+ },
+ gd =
+ /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,
+ fd = /^\d+$/;
+ Sb.$inject = ['$locale'];
+ var dd = I(y),
+ ed = I(ma);
+ Ub.$inject = ['$parse'];
+ var jd = I({
+ restrict: 'E',
+ compile: function (a, c) {
+ Z <= 8 &&
+ (!c.href && !c.name && c.$set('href', ''),
+ a.append(Y.createComment('IE fix')));
+ return function (a, c) {
+ c.bind('click', function (a) {
+ c.attr('href') || a.preventDefault();
+ });
+ };
+ }
+ }),
+ lb = {};
+ n(Fa, function (a, c) {
+ var d = ea('ng-' + c);
+ lb[d] = function () {
+ return {
+ priority: 100,
+ compile: function () {
+ return function (a, g, h) {
+ a.$watch(h[d], function (a) {
+ h.$set(c, !!a);
+ });
+ };
+ }
+ };
+ };
+ });
+ n(['src', 'href'], function (a) {
+ var c = ea('ng-' + a);
+ lb[c] = function () {
+ return {
+ priority: 99,
+ link: function (d, e, g) {
+ g.$observe(c, function (c) {
+ c && (g.$set(a, c), Z && e.prop(a, g[a]));
+ });
+ }
+ };
+ };
+ });
+ var Na = { $addControl: C, $removeControl: C, $setValidity: C, $setDirty: C };
+ Xb.$inject = ['$element', '$attrs', '$scope'];
+ var Qa = function (a) {
+ return [
+ '$timeout',
+ function (c) {
+ var d = {
+ name: 'form',
+ restrict: 'E',
+ controller: Xb,
+ compile: function () {
+ return {
+ pre: function (a, d, h, f) {
+ if (!h.action) {
+ var j = function (a) {
+ a.preventDefault
+ ? a.preventDefault()
+ : (a.returnValue = !1);
+ };
+ $b(d[0], 'submit', j);
+ d.bind('$destroy', function () {
+ c(
+ function () {
+ db(d[0], 'submit', j);
+ },
+ 0,
+ !1
+ );
+ });
+ }
+ var i = d.parent().controller('form'),
+ k = h.name || h.ngForm;
+ k && (a[k] = f);
+ i &&
+ d.bind('$destroy', function () {
+ i.$removeControl(f);
+ k && (a[k] = q);
+ v(f, Na);
+ });
+ }
+ };
+ }
+ };
+ return a ? v(U(d), { restrict: 'EAC' }) : d;
+ }
+ ];
+ },
+ kd = Qa(),
+ ld = Qa(!0),
+ md =
+ /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
+ nd = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,
+ od = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,
+ bc = {
+ text: Pa,
+ number: function (a, c, d, e, g, h) {
+ Pa(a, c, d, e, g, h);
+ e.$parsers.push(function (a) {
+ var c = T(a);
+ return c || od.test(a)
+ ? (e.$setValidity('number', !0),
+ a === '' ? null : c ? a : parseFloat(a))
+ : (e.$setValidity('number', !1), q);
+ });
+ e.$formatters.push(function (a) {
+ return T(a) ? '' : '' + a;
+ });
+ if (d.min) {
+ var f = parseFloat(d.min),
+ a = function (a) {
+ return !T(a) && a < f
+ ? (e.$setValidity('min', !1), q)
+ : (e.$setValidity('min', !0), a);
+ };
+ e.$parsers.push(a);
+ e.$formatters.push(a);
+ }
+ if (d.max) {
+ var j = parseFloat(d.max),
+ d = function (a) {
+ return !T(a) && a > j
+ ? (e.$setValidity('max', !1), q)
+ : (e.$setValidity('max', !0), a);
+ };
+ e.$parsers.push(d);
+ e.$formatters.push(d);
+ }
+ e.$formatters.push(function (a) {
+ return T(a) || Ra(a)
+ ? (e.$setValidity('number', !0), a)
+ : (e.$setValidity('number', !1), q);
+ });
+ },
+ url: function (a, c, d, e, g, h) {
+ Pa(a, c, d, e, g, h);
+ a = function (a) {
+ return T(a) || md.test(a)
+ ? (e.$setValidity('url', !0), a)
+ : (e.$setValidity('url', !1), q);
+ };
+ e.$formatters.push(a);
+ e.$parsers.push(a);
+ },
+ email: function (a, c, d, e, g, h) {
+ Pa(a, c, d, e, g, h);
+ a = function (a) {
+ return T(a) || nd.test(a)
+ ? (e.$setValidity('email', !0), a)
+ : (e.$setValidity('email', !1), q);
+ };
+ e.$formatters.push(a);
+ e.$parsers.push(a);
+ },
+ radio: function (a, c, d, e) {
+ w(d.name) && c.attr('name', ya());
+ c.bind('click', function () {
+ c[0].checked &&
+ a.$apply(function () {
+ e.$setViewValue(d.value);
+ });
+ });
+ e.$render = function () {
+ c[0].checked = d.value == e.$viewValue;
+ };
+ d.$observe('value', e.$render);
+ },
+ checkbox: function (a, c, d, e) {
+ var g = d.ngTrueValue,
+ h = d.ngFalseValue;
+ A(g) || (g = !0);
+ A(h) || (h = !1);
+ c.bind('click', function () {
+ a.$apply(function () {
+ e.$setViewValue(c[0].checked);
+ });
+ });
+ e.$render = function () {
+ c[0].checked = e.$viewValue;
+ };
+ e.$formatters.push(function (a) {
+ return a === g;
+ });
+ e.$parsers.push(function (a) {
+ return a ? g : h;
+ });
+ },
+ hidden: C,
+ button: C,
+ submit: C,
+ reset: C
+ },
+ cc = [
+ '$browser',
+ '$sniffer',
+ function (a, c) {
+ return {
+ restrict: 'E',
+ require: '?ngModel',
+ link: function (d, e, g, h) {
+ h && (bc[y(g.type)] || bc.text)(d, e, g, h, c, a);
+ }
+ };
+ }
+ ],
+ Ma = 'ng-valid',
+ La = 'ng-invalid',
+ Oa = 'ng-pristine',
+ Yb = 'ng-dirty',
+ pd = [
+ '$scope',
+ '$exceptionHandler',
+ '$attrs',
+ '$element',
+ '$parse',
+ function (a, c, d, e, g) {
+ function h(a, c) {
+ c = c ? '-' + Za(c, '-') : '';
+ e.removeClass((a ? La : Ma) + c).addClass((a ? Ma : La) + c);
+ }
+ this.$modelValue = this.$viewValue = Number.NaN;
+ this.$parsers = [];
+ this.$formatters = [];
+ this.$viewChangeListeners = [];
+ this.$pristine = !0;
+ this.$dirty = !1;
+ this.$valid = !0;
+ this.$invalid = !1;
+ this.$name = d.name;
+ var f = g(d.ngModel),
+ j = f.assign;
+ if (!j) throw Error(Db + d.ngModel + ' (' + qa(e) + ')');
+ this.$render = C;
+ var i = e.inheritedData('$formController') || Na,
+ k = 0,
+ m = (this.$error = {});
+ e.addClass(Oa);
+ h(!0);
+ this.$setValidity = function (a, c) {
+ if (m[a] !== !c) {
+ if (c) {
+ if ((m[a] && k--, !k))
+ h(!0), (this.$valid = !0), (this.$invalid = !1);
+ } else h(!1), (this.$invalid = !0), (this.$valid = !1), k++;
+ m[a] = !c;
+ h(c, a);
+ i.$setValidity(a, c, this);
+ }
+ };
+ this.$setViewValue = function (d) {
+ this.$viewValue = d;
+ if (this.$pristine)
+ (this.$dirty = !0),
+ (this.$pristine = !1),
+ e.removeClass(Oa).addClass(Yb),
+ i.$setDirty();
+ n(this.$parsers, function (a) {
+ d = a(d);
+ });
+ if (this.$modelValue !== d)
+ (this.$modelValue = d),
+ j(a, d),
+ n(this.$viewChangeListeners, function (a) {
+ try {
+ a();
+ } catch (d) {
+ c(d);
+ }
+ });
+ };
+ var l = this;
+ a.$watch(function () {
+ var c = f(a);
+ if (l.$modelValue !== c) {
+ var d = l.$formatters,
+ e = d.length;
+ for (l.$modelValue = c; e--; ) c = d[e](c);
+ if (l.$viewValue !== c) (l.$viewValue = c), l.$render();
+ }
+ });
+ }
+ ],
+ qd = function () {
+ return {
+ require: ['ngModel', '^?form'],
+ controller: pd,
+ link: function (a, c, d, e) {
+ var g = e[0],
+ h = e[1] || Na;
+ h.$addControl(g);
+ c.bind('$destroy', function () {
+ h.$removeControl(g);
+ });
+ }
+ };
+ },
+ rd = I({
+ require: 'ngModel',
+ link: function (a, c, d, e) {
+ e.$viewChangeListeners.push(function () {
+ a.$eval(d.ngChange);
+ });
+ }
+ }),
+ dc = function () {
+ return {
+ require: '?ngModel',
+ link: function (a, c, d, e) {
+ if (e) {
+ d.required = !0;
+ var g = function (a) {
+ if (d.required && (T(a) || a === !1))
+ e.$setValidity('required', !1);
+ else return e.$setValidity('required', !0), a;
+ };
+ e.$formatters.push(g);
+ e.$parsers.unshift(g);
+ d.$observe('required', function () {
+ g(e.$viewValue);
+ });
+ }
+ }
+ };
+ },
+ sd = function () {
+ return {
+ require: 'ngModel',
+ link: function (a, c, d, e) {
+ var g =
+ ((a = /\/(.*)\//.exec(d.ngList)) && RegExp(a[1])) ||
+ d.ngList ||
+ ',';
+ e.$parsers.push(function (a) {
+ var c = [];
+ a &&
+ n(a.split(g), function (a) {
+ a && c.push(O(a));
+ });
+ return c;
+ });
+ e.$formatters.push(function (a) {
+ return B(a) ? a.join(', ') : q;
+ });
+ }
+ };
+ },
+ td = /^(true|false|\d+)$/,
+ ud = function () {
+ return {
+ priority: 100,
+ compile: function (a, c) {
+ return td.test(c.ngValue)
+ ? function (a, c, g) {
+ g.$set('value', a.$eval(g.ngValue));
+ }
+ : function (a, c, g) {
+ a.$watch(g.ngValue, function (a) {
+ g.$set('value', a, !1);
+ });
+ };
+ }
+ };
+ },
+ vd = Q(function (a, c, d) {
+ c.addClass('ng-binding').data('$binding', d.ngBind);
+ a.$watch(d.ngBind, function (a) {
+ c.text(a == q ? '' : a);
+ });
+ }),
+ wd = [
+ '$interpolate',
+ function (a) {
+ return function (c, d, e) {
+ c = a(d.attr(e.$attr.ngBindTemplate));
+ d.addClass('ng-binding').data('$binding', c);
+ e.$observe('ngBindTemplate', function (a) {
+ d.text(a);
+ });
+ };
+ }
+ ],
+ xd = [
+ function () {
+ return function (a, c, d) {
+ c.addClass('ng-binding').data('$binding', d.ngBindHtmlUnsafe);
+ a.$watch(d.ngBindHtmlUnsafe, function (a) {
+ c.html(a || '');
+ });
+ };
+ }
+ ],
+ yd = kb('', !0),
+ zd = kb('Odd', 0),
+ Ad = kb('Even', 1),
+ Bd = Q({
+ compile: function (a, c) {
+ c.$set('ngCloak', q);
+ a.removeClass('ng-cloak');
+ }
+ }),
+ Cd = [
+ function () {
+ return { scope: !0, controller: '@' };
+ }
+ ],
+ Dd = [
+ '$sniffer',
+ function (a) {
+ return {
+ priority: 1e3,
+ compile: function () {
+ a.csp = !0;
+ }
+ };
+ }
+ ],
+ ec = {};
+ n(
+ 'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave'.split(
+ ' '
+ ),
+ function (a) {
+ var c = ea('ng-' + a);
+ ec[c] = [
+ '$parse',
+ function (d) {
+ return function (e, g, h) {
+ var f = d(h[c]);
+ g.bind(y(a), function (a) {
+ e.$apply(function () {
+ f(e, { $event: a });
+ });
+ });
+ };
+ }
+ ];
+ }
+ );
+ var Ed = Q(function (a, c, d) {
+ c.bind('submit', function () {
+ a.$apply(d.ngSubmit);
+ });
+ }),
+ Fd = [
+ '$http',
+ '$templateCache',
+ '$anchorScroll',
+ '$compile',
+ function (a, c, d, e) {
+ return {
+ restrict: 'ECA',
+ terminal: !0,
+ compile: function (g, h) {
+ var f = h.ngInclude || h.src,
+ j = h.onload || '',
+ i = h.autoscroll;
+ return function (g, h) {
+ var l = 0,
+ n,
+ o = function () {
+ n && (n.$destroy(), (n = null));
+ h.html('');
+ };
+ g.$watch(f, function (f) {
+ var s = ++l;
+ f
+ ? a
+ .get(f, { cache: c })
+ .success(function (a) {
+ s === l &&
+ (n && n.$destroy(),
+ (n = g.$new()),
+ h.html(a),
+ e(h.contents())(n),
+ x(i) && (!i || g.$eval(i)) && d(),
+ n.$emit('$includeContentLoaded'),
+ g.$eval(j));
+ })
+ .error(function () {
+ s === l && o();
+ })
+ : o();
+ });
+ };
+ }
+ };
+ }
+ ],
+ Gd = Q({
+ compile: function () {
+ return {
+ pre: function (a, c, d) {
+ a.$eval(d.ngInit);
+ }
+ };
+ }
+ }),
+ Hd = Q({ terminal: !0, priority: 1e3 }),
+ Id = [
+ '$locale',
+ '$interpolate',
+ function (a, c) {
+ var d = /{}/g;
+ return {
+ restrict: 'EA',
+ link: function (e, g, h) {
+ var f = h.count,
+ j = g.attr(h.$attr.when),
+ i = h.offset || 0,
+ k = e.$eval(j),
+ m = {},
+ l = c.startSymbol(),
+ t = c.endSymbol();
+ n(k, function (a, e) {
+ m[e] = c(a.replace(d, l + f + '-' + i + t));
+ });
+ e.$watch(
+ function () {
+ var c = parseFloat(e.$eval(f));
+ return isNaN(c)
+ ? ''
+ : (k[c] || (c = a.pluralCat(c - i)), m[c](e, g, !0));
+ },
+ function (a) {
+ g.text(a);
+ }
+ );
+ }
+ };
+ }
+ ],
+ Jd = Q({
+ transclude: 'element',
+ priority: 1e3,
+ terminal: !0,
+ compile: function (a, c, d) {
+ return function (a, c, h) {
+ var f = h.ngRepeat,
+ h = f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),
+ j,
+ i,
+ k;
+ if (!h)
+ throw Error(
+ "Expected ngRepeat in form of '_item_ in _collection_' but got '" +
+ f +
+ "'."
+ );
+ f = h[1];
+ j = h[2];
+ h = f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);
+ if (!h)
+ throw Error(
+ "'item' in 'item in collection' should be identifier or (key, value) but got '" +
+ f +
+ "'."
+ );
+ i = h[3] || h[1];
+ k = h[2];
+ var m = new eb();
+ a.$watch(function (a) {
+ var e,
+ f,
+ h = a.$eval(j),
+ n = c,
+ q = new eb(),
+ x,
+ z,
+ u,
+ w,
+ r,
+ v;
+ if (B(h)) r = h || [];
+ else {
+ r = [];
+ for (u in h)
+ h.hasOwnProperty(u) && u.charAt(0) != '$' && r.push(u);
+ r.sort();
+ }
+ x = r.length;
+ e = 0;
+ for (f = r.length; e < f; e++) {
+ u = h === r ? e : r[e];
+ w = h[u];
+ if ((v = m.shift(w))) {
+ z = v.scope;
+ q.push(w, v);
+ if (e !== v.index) (v.index = e), n.after(v.element);
+ n = v.element;
+ } else z = a.$new();
+ z[i] = w;
+ k && (z[k] = u);
+ z.$index = e;
+ z.$first = e === 0;
+ z.$last = e === x - 1;
+ z.$middle = !(z.$first || z.$last);
+ v ||
+ d(z, function (a) {
+ n.after(a);
+ v = { scope: z, element: (n = a), index: e };
+ q.push(w, v);
+ });
+ }
+ for (u in m)
+ if (m.hasOwnProperty(u))
+ for (r = m[u]; r.length; )
+ (w = r.pop()), w.element.remove(), w.scope.$destroy();
+ m = q;
+ });
+ };
+ }
+ }),
+ Kd = Q(function (a, c, d) {
+ a.$watch(d.ngShow, function (a) {
+ c.css('display', Va(a) ? '' : 'none');
+ });
+ }),
+ Ld = Q(function (a, c, d) {
+ a.$watch(d.ngHide, function (a) {
+ c.css('display', Va(a) ? 'none' : '');
+ });
+ }),
+ Md = Q(function (a, c, d) {
+ a.$watch(
+ d.ngStyle,
+ function (a, d) {
+ d &&
+ a !== d &&
+ n(d, function (a, d) {
+ c.css(d, '');
+ });
+ a && c.css(a);
+ },
+ !0
+ );
+ }),
+ Nd = I({
+ restrict: 'EA',
+ require: 'ngSwitch',
+ controller: [
+ '$scope',
+ function () {
+ this.cases = {};
+ }
+ ],
+ link: function (a, c, d, e) {
+ var g, h, f;
+ a.$watch(d.ngSwitch || d.on, function (j) {
+ h && (f.$destroy(), h.remove(), (h = f = null));
+ if ((g = e.cases['!' + j] || e.cases['?']))
+ a.$eval(d.change),
+ (f = a.$new()),
+ g(f, function (a) {
+ h = a;
+ c.append(a);
+ });
+ });
+ }
+ }),
+ Od = Q({
+ transclude: 'element',
+ priority: 500,
+ require: '^ngSwitch',
+ compile: function (a, c, d) {
+ return function (a, g, h, f) {
+ f.cases['!' + c.ngSwitchWhen] = d;
+ };
+ }
+ }),
+ Pd = Q({
+ transclude: 'element',
+ priority: 500,
+ require: '^ngSwitch',
+ compile: function (a, c, d) {
+ return function (a, c, h, f) {
+ f.cases['?'] = d;
+ };
+ }
+ }),
+ Qd = Q({
+ controller: [
+ '$transclude',
+ '$element',
+ function (a, c) {
+ a(function (a) {
+ c.append(a);
+ });
+ }
+ ]
+ }),
+ Rd = [
+ '$http',
+ '$templateCache',
+ '$route',
+ '$anchorScroll',
+ '$compile',
+ '$controller',
+ function (a, c, d, e, g, h) {
+ return {
+ restrict: 'ECA',
+ terminal: !0,
+ link: function (a, c, i) {
+ function k() {
+ var i = d.current && d.current.locals,
+ k = i && i.$template;
+ if (k) {
+ c.html(k);
+ m && (m.$destroy(), (m = null));
+ var k = g(c.contents()),
+ n = d.current;
+ m = n.scope = a.$new();
+ if (n.controller)
+ (i.$scope = m),
+ (i = h(n.controller, i)),
+ c.children().data('$ngControllerController', i);
+ k(m);
+ m.$emit('$viewContentLoaded');
+ m.$eval(l);
+ e();
+ } else c.html(''), m && (m.$destroy(), (m = null));
+ }
+ var m,
+ l = i.onload || '';
+ a.$on('$routeChangeSuccess', k);
+ k();
+ }
+ };
+ }
+ ],
+ Sd = [
+ '$templateCache',
+ function (a) {
+ return {
+ restrict: 'E',
+ terminal: !0,
+ compile: function (c, d) {
+ d.type == 'text/ng-template' && a.put(d.id, c[0].text);
+ }
+ };
+ }
+ ],
+ Td = I({ terminal: !0 }),
+ Ud = [
+ '$compile',
+ '$parse',
+ function (a, c) {
+ var d =
+ /^\s*(.*?)(?:\s+as\s+(.*?))?(?:\s+group\s+by\s+(.*))?\s+for\s+(?:([\$\w][\$\w\d]*)|(?:\(\s*([\$\w][\$\w\d]*)\s*,\s*([\$\w][\$\w\d]*)\s*\)))\s+in\s+(.*)$/,
+ e = { $setViewValue: C };
+ return {
+ restrict: 'E',
+ require: ['select', '?ngModel'],
+ controller: [
+ '$element',
+ '$scope',
+ '$attrs',
+ function (a, c, d) {
+ var j = this,
+ i = {},
+ k = e,
+ m;
+ j.databound = d.ngModel;
+ j.init = function (a, c, d) {
+ k = a;
+ m = d;
+ };
+ j.addOption = function (c) {
+ i[c] = !0;
+ k.$viewValue == c && (a.val(c), m.parent() && m.remove());
+ };
+ j.removeOption = function (a) {
+ this.hasOption(a) &&
+ (delete i[a],
+ k.$viewValue == a && this.renderUnknownOption(a));
+ };
+ j.renderUnknownOption = function (c) {
+ c = '? ' + fa(c) + ' ?';
+ m.val(c);
+ a.prepend(m);
+ a.val(c);
+ m.prop('selected', !0);
+ };
+ j.hasOption = function (a) {
+ return i.hasOwnProperty(a);
+ };
+ c.$on('$destroy', function () {
+ j.renderUnknownOption = C;
+ });
+ }
+ ],
+ link: function (e, h, f, j) {
+ function i(a, c, d, e) {
+ d.$render = function () {
+ var a = d.$viewValue;
+ e.hasOption(a)
+ ? (y.parent() && y.remove(),
+ c.val(a),
+ a === '' && v.prop('selected', !0))
+ : w(a) && v
+ ? c.val('')
+ : e.renderUnknownOption(a);
+ };
+ c.bind('change', function () {
+ a.$apply(function () {
+ y.parent() && y.remove();
+ d.$setViewValue(c.val());
+ });
+ });
+ }
+ function k(a, c, d) {
+ var e;
+ d.$render = function () {
+ var a = new Ga(d.$viewValue);
+ n(c.find('option'), function (c) {
+ c.selected = x(a.get(c.value));
+ });
+ };
+ a.$watch(function () {
+ ga(e, d.$viewValue) || ((e = U(d.$viewValue)), d.$render());
+ });
+ c.bind('change', function () {
+ a.$apply(function () {
+ var a = [];
+ n(c.find('option'), function (c) {
+ c.selected && a.push(c.value);
+ });
+ d.$setViewValue(a);
+ });
+ });
+ }
+ function m(e, f, g) {
+ function h() {
+ var a = { '': [] },
+ c = [''],
+ d,
+ i,
+ p,
+ u,
+ v;
+ p = g.$modelValue;
+ u = t(e) || [];
+ var w = l ? mb(u) : u,
+ x,
+ y,
+ A;
+ y = {};
+ v = !1;
+ var B, E;
+ if (o) v = new Ga(p);
+ else if (p === null || s)
+ a[''].push({ selected: p === null, id: '', label: '' }),
+ (v = !0);
+ for (A = 0; (x = w.length), A < x; A++) {
+ y[k] = u[l ? (y[l] = w[A]) : A];
+ d = m(e, y) || '';
+ if (!(i = a[d])) (i = a[d] = []), c.push(d);
+ o
+ ? (d = v.remove(n(e, y)) != q)
+ : ((d = p === n(e, y)), (v = v || d));
+ B = j(e, y);
+ B = B === q ? '' : B;
+ i.push({ id: l ? w[A] : A, label: B, selected: d });
+ }
+ !o && !v && a[''].unshift({ id: '?', label: '', selected: !0 });
+ y = 0;
+ for (w = c.length; y < w; y++) {
+ d = c[y];
+ i = a[d];
+ if (r.length <= y)
+ (p = {
+ element: z.clone().attr('label', d),
+ label: i.label
+ }),
+ (u = [p]),
+ r.push(u),
+ f.append(p.element);
+ else if (((u = r[y]), (p = u[0]), p.label != d))
+ p.element.attr('label', (p.label = d));
+ B = null;
+ A = 0;
+ for (x = i.length; A < x; A++)
+ if (((d = i[A]), (v = u[A + 1]))) {
+ B = v.element;
+ if (v.label !== d.label) B.text((v.label = d.label));
+ if (v.id !== d.id) B.val((v.id = d.id));
+ if (v.element.selected !== d.selected)
+ B.prop('selected', (v.selected = d.selected));
+ } else
+ d.id === '' && s
+ ? (E = s)
+ : (E = C.clone())
+ .val(d.id)
+ .attr('selected', d.selected)
+ .text(d.label),
+ u.push({
+ element: E,
+ label: d.label,
+ id: d.id,
+ selected: d.selected
+ }),
+ B ? B.after(E) : p.element.append(E),
+ (B = E);
+ for (A++; u.length > A; ) u.pop().element.remove();
+ }
+ for (; r.length > y; ) r.pop()[0].element.remove();
+ }
+ var i;
+ if (!(i = p.match(d)))
+ throw Error(
+ "Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '" +
+ p +
+ "'."
+ );
+ var j = c(i[2] || i[1]),
+ k = i[4] || i[6],
+ l = i[5],
+ m = c(i[3] || ''),
+ n = c(i[2] ? i[1] : k),
+ t = c(i[7]),
+ r = [[{ element: f, label: '' }]];
+ s && (a(s)(e), s.removeClass('ng-scope'), s.remove());
+ f.html('');
+ f.bind('change', function () {
+ e.$apply(function () {
+ var a,
+ c = t(e) || [],
+ d = {},
+ h,
+ i,
+ j,
+ m,
+ p,
+ s;
+ if (o) {
+ i = [];
+ m = 0;
+ for (s = r.length; m < s; m++) {
+ a = r[m];
+ j = 1;
+ for (p = a.length; j < p; j++)
+ if ((h = a[j].element)[0].selected)
+ (h = h.val()),
+ l && (d[l] = h),
+ (d[k] = c[h]),
+ i.push(n(e, d));
+ }
+ } else (h = f.val()), h == '?' ? (i = q) : h == '' ? (i = null) : ((d[k] = c[h]), l && (d[l] = h), (i = n(e, d)));
+ g.$setViewValue(i);
+ });
+ });
+ g.$render = h;
+ e.$watch(h);
+ }
+ if (j[1]) {
+ for (
+ var l = j[0],
+ t = j[1],
+ o = f.multiple,
+ p = f.ngOptions,
+ s = !1,
+ v,
+ C = u(Y.createElement('option')),
+ z = u(Y.createElement('optgroup')),
+ y = C.clone(),
+ j = 0,
+ A = h.children(),
+ r = A.length;
+ j < r;
+ j++
+ )
+ if (A[j].value == '') {
+ v = s = A.eq(j);
+ break;
+ }
+ l.init(t, s, y);
+ if (o && (f.required || f.ngRequired)) {
+ var B = function (a) {
+ t.$setValidity('required', !f.required || (a && a.length));
+ return a;
+ };
+ t.$parsers.push(B);
+ t.$formatters.unshift(B);
+ f.$observe('required', function () {
+ B(t.$viewValue);
+ });
+ }
+ p ? m(e, h, t) : o ? k(e, h, t) : i(e, h, t, l);
+ }
+ }
+ };
+ }
+ ],
+ Vd = [
+ '$interpolate',
+ function (a) {
+ var c = { addOption: C, removeOption: C };
+ return {
+ restrict: 'E',
+ priority: 100,
+ compile: function (d, e) {
+ if (w(e.value)) {
+ var g = a(d.text(), !0);
+ g || e.$set('value', d.text());
+ }
+ return function (a, d, e) {
+ var i = d.parent(),
+ k =
+ i.data('$selectController') ||
+ i.parent().data('$selectController');
+ k && k.databound ? d.prop('selected', !1) : (k = c);
+ g
+ ? a.$watch(g, function (a, c) {
+ e.$set('value', a);
+ a !== c && k.removeOption(c);
+ k.addOption(a);
+ })
+ : k.addOption(e.value);
+ d.bind('$destroy', function () {
+ k.removeOption(e.value);
+ });
+ };
+ }
+ };
+ }
+ ],
+ Wd = I({ restrict: 'E', terminal: !0 });
+ (ca = X.jQuery)
+ ? ((u = ca),
+ v(ca.fn, {
+ scope: va.scope,
+ controller: va.controller,
+ injector: va.injector,
+ inheritedData: va.inheritedData
+ }),
+ ab('remove', !0),
+ ab('empty'),
+ ab('html'))
+ : (u = L);
+ Zb.element = u;
+ (function (a) {
+ v(a, {
+ bootstrap: qb,
+ copy: U,
+ extend: v,
+ equals: ga,
+ element: u,
+ forEach: n,
+ injector: rb,
+ noop: C,
+ bind: Ua,
+ toJson: da,
+ fromJson: ob,
+ identity: na,
+ isUndefined: w,
+ isDefined: x,
+ isString: A,
+ isFunction: H,
+ isObject: M,
+ isNumber: Ra,
+ isElement: gc,
+ isArray: B,
+ version: id,
+ isDate: oa,
+ lowercase: y,
+ uppercase: ma,
+ callbacks: { counter: 0 }
+ });
+ ta = lc(X);
+ try {
+ ta('ngLocale');
+ } catch (c) {
+ ta('ngLocale', []).provider('$locale', Zc);
+ }
+ ta(
+ 'ng',
+ ['ngLocale'],
+ [
+ '$provide',
+ function (a) {
+ a.provider('$compile', Cb)
+ .directive({
+ a: jd,
+ input: cc,
+ textarea: cc,
+ form: kd,
+ script: Sd,
+ select: Ud,
+ style: Wd,
+ option: Vd,
+ ngBind: vd,
+ ngBindHtmlUnsafe: xd,
+ ngBindTemplate: wd,
+ ngClass: yd,
+ ngClassEven: Ad,
+ ngClassOdd: zd,
+ ngCsp: Dd,
+ ngCloak: Bd,
+ ngController: Cd,
+ ngForm: ld,
+ ngHide: Ld,
+ ngInclude: Fd,
+ ngInit: Gd,
+ ngNonBindable: Hd,
+ ngPluralize: Id,
+ ngRepeat: Jd,
+ ngShow: Kd,
+ ngSubmit: Ed,
+ ngStyle: Md,
+ ngSwitch: Nd,
+ ngSwitchWhen: Od,
+ ngSwitchDefault: Pd,
+ ngOptions: Td,
+ ngView: Rd,
+ ngTransclude: Qd,
+ ngModel: qd,
+ ngList: sd,
+ ngChange: rd,
+ required: dc,
+ ngRequired: dc,
+ ngValue: ud
+ })
+ .directive(lb)
+ .directive(ec);
+ a.provider({
+ $anchorScroll: uc,
+ $browser: wc,
+ $cacheFactory: xc,
+ $controller: Bc,
+ $document: Cc,
+ $exceptionHandler: Dc,
+ $filter: Qb,
+ $interpolate: Ec,
+ $http: Vc,
+ $httpBackend: Wc,
+ $location: Ic,
+ $log: Jc,
+ $parse: Nc,
+ $route: Qc,
+ $routeParams: Rc,
+ $rootScope: Sc,
+ $q: Oc,
+ $sniffer: Tc,
+ $templateCache: yc,
+ $timeout: $c,
+ $window: Uc
+ });
+ }
+ ]
+ );
+ })(Zb);
+ u(Y).ready(function () {
+ jc(Y, qb);
+ });
+})(window, document);
+angular
+ .element(document)
+ .find('head')
+ .append(
+ ''
+ );
diff --git a/examples/apps/JavaScript/CompareTool/js/compare.js b/examples/apps/JavaScript/CompareTool/js/compare.js
index b92adf3b..644d1958 100644
--- a/examples/apps/JavaScript/CompareTool/js/compare.js
+++ b/examples/apps/JavaScript/CompareTool/js/compare.js
@@ -1,13 +1,13 @@
-(function() {
-
+(function () {
// Filters
// --------------------
- angular.module("filters", []).
+ angular
+ .module('filters', [])
// Add a range of indexes to a collection
// e.g., ng-repeat="indexes in [] | range:10"
- filter("range", function() {
- return function(input, num) {
+ .filter('range', function () {
+ return function (input, num) {
for (var i = 0; i < num; i++) {
input.push(i);
}
@@ -18,33 +18,37 @@
// Services
// --------------------
- angular.module("services", ["ngResource"]).
+ angular
+ .module('services', ['ngResource'])
// Retrieve quote data for a symbol
- service("companyService", function($resource) {
- var defaultCallbacks = { success: function() {}, error: function() {}, complete: function() {} };
+ .service('companyService', function ($resource) {
+ var defaultCallbacks = {
+ success: function () {},
+ error: function () {},
+ complete: function () {}
+ };
return {
- getBySymbol: function(symbol, cbs) {
+ getBySymbol: function (symbol, cbs) {
cbs = angular.extend({}, defaultCallbacks, cbs);
var query = $resource(
- "http://dev.markitondemand.com/Api/Quote/:action",
- { action: "jsonp", callback: "JSON_CALLBACK", symbol: symbol },
- { get: { method: "jsonp" } }
+ 'http://dev.markitondemand.com/Api/Quote/:action',
+ { action: 'jsonp', callback: 'JSON_CALLBACK', symbol: symbol },
+ { get: { method: 'jsonp' } }
);
query.get(
- function(response) {
+ function (response) {
if (response.Data) {
cbs.success(response.Data);
- }
- else {
- cbs.error("Invalid symbol");
+ } else {
+ cbs.error('Invalid symbol');
}
cbs.complete();
},
- function() {
+ function () {
cbs.error();
cbs.complete();
}
@@ -56,27 +60,26 @@
// Controller
// --------------------
- var app = angular.module("compareTool", ["filters", "services"]);
+ var app = angular.module('compareTool', ['filters', 'services']);
// Compare Controller
- app.controller("CompareCtrl", function($scope, $filter, companyService) {
-
+ app.controller('CompareCtrl', function ($scope, $filter, companyService) {
// The max number of companies the user can compare
var maxSymbols = 5;
// Define what will be displayed
$scope.dataPoints = [
- { label: "Last Price", field: "LastPrice", format: "currency" },
- { label: "High", field: "High", format: "currency" },
- { label: "Low", field: "Low", format: "currency" },
- { label: "Open", field: "Open", format: "currency" },
- { label: "Market Cap", field: "MarketCap", format: "number" },
- { label: "Volume", field: "Volume", format: "number" },
- { label: "Change", field: "Change", format: "currency" },
- { label: "Change %", field: "ChangePercent", format: "percent:2" },
- { label: "Change YTD", field: "ChangeYTD", format: "currency" },
- { label: "Change % YTD", field: "ChangePercentYTD", format: "percent:2" },
- { label: "Data Refreshed On", field: "Timestamp", format: "date" }
+ { label: 'Last Price', field: 'LastPrice', format: 'currency' },
+ { label: 'High', field: 'High', format: 'currency' },
+ { label: 'Low', field: 'Low', format: 'currency' },
+ { label: 'Open', field: 'Open', format: 'currency' },
+ { label: 'Market Cap', field: 'MarketCap', format: 'number' },
+ { label: 'Volume', field: 'Volume', format: 'number' },
+ { label: 'Change', field: 'Change', format: 'currency' },
+ { label: 'Change %', field: 'ChangePercent', format: 'percent:2' },
+ { label: 'Change YTD', field: 'ChangeYTD', format: 'currency' },
+ { label: 'Change % YTD', field: 'ChangePercentYTD', format: 'percent:2' },
+ { label: 'Data Refreshed On', field: 'Timestamp', format: 'date' }
];
// List of symbols we're comparing
@@ -84,12 +87,12 @@
$scope.issues = [];
// Get the number of empty compare slots
- $scope.numRemaining = function() {
+ $scope.numRemaining = function () {
return maxSymbols - $scope.issues.length;
};
// Lookup the specified company
- $scope.addCompany = function(ticker) {
+ $scope.addCompany = function (ticker) {
if ($scope.issues.length < maxSymbols) {
var self = this;
@@ -99,26 +102,25 @@
// Grab the symbol data from the service
companyService.getBySymbol(ticker, {
- success: function(data) {
+ success: function (data) {
$scope.issues.push(data);
- self.searchSymbol = "";
+ self.searchSymbol = '';
},
- error: function(msg) {
+ error: function (msg) {
msg = msg || "Sorry, that didn't work for some reason";
alert(msg);
},
- complete: function() {
+ complete: function () {
self.isLoading = false;
}
});
- }
- else {
+ } else {
alert("You're already comparing the maximum number of companies");
}
};
// Pull the company out of comparison
- $scope.removeCompany = function(ticker) {
+ $scope.removeCompany = function (ticker) {
// Remove the symbol
for (var i = 0; i < $scope.issues.length; i++) {
if ($scope.issues[i].Symbol === ticker) {
@@ -129,22 +131,22 @@
};
// Multi-purpose format func
- $scope.format = function(value, type) {
+ $scope.format = function (value, type) {
var out = value;
if (type) {
- var params = type.split(":");
+ var params = type.split(':');
type = params[0];
switch (type) {
- case "percent":
- out = value.toFixed(params[1] || 0) + "%";
+ case 'percent':
+ out = value.toFixed(params[1] || 0) + '%';
break;
- case "number":
- out = value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+ case 'number':
+ out = value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
break;
- case "date":
- out = moment(value).format("M/DD/YYYY h:mm:ss A");
+ case 'date':
+ out = moment(value).format('M/DD/YYYY h:mm:ss A');
break;
default:
// Use the default angular filter
@@ -155,7 +157,5 @@
return out;
};
-
});
-
-})();
\ No newline at end of file
+})();
diff --git a/examples/apps/JavaScript/CompareTool/js/moment.min.js b/examples/apps/JavaScript/CompareTool/js/moment.min.js
index 4e8497a9..0b40a856 100644
--- a/examples/apps/JavaScript/CompareTool/js/moment.min.js
+++ b/examples/apps/JavaScript/CompareTool/js/moment.min.js
@@ -3,4 +3,910 @@
// author : Tim Wood
// license : MIT
// momentjs.com
-(function(e){function O(e,t){return function(n){return j(e.call(this,n),t)}}function M(e){return function(t){return this.lang().ordinal(e.call(this,t))}}function _(){}function D(e){H(this,e)}function P(e){var t=this._data={},n=e.years||e.year||e.y||0,r=e.months||e.month||e.M||0,i=e.weeks||e.week||e.w||0,s=e.days||e.day||e.d||0,o=e.hours||e.hour||e.h||0,u=e.minutes||e.minute||e.m||0,a=e.seconds||e.second||e.s||0,f=e.milliseconds||e.millisecond||e.ms||0;this._milliseconds=f+a*1e3+u*6e4+o*36e5,this._days=s+i*7,this._months=r+n*12,t.milliseconds=f%1e3,a+=B(f/1e3),t.seconds=a%60,u+=B(a/60),t.minutes=u%60,o+=B(u/60),t.hours=o%24,s+=B(o/24),s+=i*7,t.days=s%30,r+=B(s/30),t.months=r%12,n+=B(r/12),t.years=n}function H(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function B(e){return e<0?Math.ceil(e):Math.floor(e)}function j(e,t){var n=e+"";while(n.length68?1900:2e3);break;case"YYYY":case"YYYYY":s[0]=~~t;break;case"a":case"A":n._isPm=(t+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":s[3]=~~t;break;case"m":case"mm":s[4]=~~t;break;case"s":case"ss":s[5]=~~t;break;case"S":case"SS":case"SSS":s[6]=~~(("0."+t)*1e3);break;case"X":n._d=new Date(parseFloat(t)*1e3);break;case"Z":case"ZZ":n._useUTC=!0,r=(t+"").match(x),r&&r[1]&&(n._tzh=~~r[1]),r&&r[2]&&(n._tzm=~~r[2]),r&&r[0]==="+"&&(n._tzh=-n._tzh,n._tzm=-n._tzm)}t==null&&(n._isValid=!1)}function J(e){var t,n,r=[];if(e._d)return;for(t=0;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];r[3]+=e._tzh||0,r[4]+=e._tzm||0,n=new Date(0),e._useUTC?(n.setUTCFullYear(r[0],r[1],r[2]),n.setUTCHours(r[3],r[4],r[5],r[6])):(n.setFullYear(r[0],r[1],r[2]),n.setHours(r[3],r[4],r[5],r[6])),e._d=n}function K(e){var t=e._f.match(a),n=e._i,r,i;e._a=[];for(r=0;r0,f[4]=n,Z.apply({},f)}function tt(e,n,r){var i=r-n,s=r-e.day();return s>i&&(s-=7),s11?n?"pm":"PM":n?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},calendar:function(e,t){var n=this._calendar[e];return typeof n=="function"?n.apply(t):n},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(e,t,n,r){var i=this._relativeTime[n];return typeof i=="function"?i(e,t,n,r):i.replace(/%d/i,e)},pastFuture:function(e,t){var n=this._relativeTime[e>0?"future":"past"];return typeof n=="function"?n(t):n.replace(/%s/i,t)},ordinal:function(e){return this._ordinal.replace("%d",e)},_ordinal:"%d",preparse:function(e){return e},postformat:function(e){return e},week:function(e){return tt(e,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},t=function(e,t,n){return nt({_i:e,_f:t,_l:n,_isUTC:!1})},t.utc=function(e,t,n){return nt({_useUTC:!0,_isUTC:!0,_l:n,_i:e,_f:t})},t.unix=function(e){return t(e*1e3)},t.duration=function(e,n){var r=t.isDuration(e),i=typeof e=="number",s=r?e._data:i?{}:e,o;return i&&(n?s[n]=e:s.milliseconds=e),o=new P(s),r&&e.hasOwnProperty("_lang")&&(o._lang=e._lang),o},t.version=n,t.defaultFormat=E,t.lang=function(e,n){var r;if(!e)return t.fn._lang._abbr;n?R(e,n):s[e]||U(e),t.duration.fn._lang=t.fn._lang=U(e)},t.langData=function(e){return e&&e._lang&&e._lang._abbr&&(e=e._lang._abbr),U(e)},t.isMoment=function(e){return e instanceof D},t.isDuration=function(e){return e instanceof P},t.fn=D.prototype={clone:function(){return t(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return t.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var e=this;return[e.year(),e.month(),e.date(),e.hours(),e.minutes(),e.seconds(),e.milliseconds()]},isValid:function(){return this._isValid==null&&(this._a?this._isValid=!q(this._a,(this._isUTC?t.utc(this._a):t(this._a)).toArray()):this._isValid=!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(e){var n=X(this,e||t.defaultFormat);return this.lang().postformat(n)},add:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),F(this,r,1),this},subtract:function(e,n){var r;return typeof e=="string"?r=t.duration(+n,e):r=t.duration(e,n),F(this,r,-1),this},diff:function(e,n,r){var i=this._isUTC?t(e).utc():t(e).local(),s=(this.zone()-i.zone())*6e4,o,u;return n&&(n=n.replace(/s$/,"")),n==="year"||n==="month"?(o=(this.daysInMonth()+i.daysInMonth())*432e5,u=(this.year()-i.year())*12+(this.month()-i.month()),u+=(this-t(this).startOf("month")-(i-t(i).startOf("month")))/o,n==="year"&&(u/=12)):(o=this-i-s,u=n==="second"?o/1e3:n==="minute"?o/6e4:n==="hour"?o/36e5:n==="day"?o/864e5:n==="week"?o/6048e5:o),r?u:B(u)},from:function(e,n){return t.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!n)},fromNow:function(e){return this.from(t(),e)},calendar:function(){var e=this.diff(t().startOf("day"),"days",!0),n=e<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse";return this.format(this.lang().calendar(n,this))},isLeapYear:function(){var e=this.year();return e%4===0&&e%100!==0||e%400===0},isDST:function(){return this.zone()+t(e).startOf(n)},isBefore:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)<+t(e).startOf(n)},isSame:function(e,n){return n=typeof n!="undefined"?n:"millisecond",+this.clone().startOf(n)===+t(e).startOf(n)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return t.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(e){var n=r((t(this).startOf("day")-t(this).startOf("year"))/864e5)+1;return e==null?n:this.add("d",e-n)},isoWeek:function(e){var t=tt(this,1,4);return e==null?t:this.add("d",(e-t)*7)},week:function(e){var t=this.lang().week(this);return e==null?t:this.add("d",(e-t)*7)},lang:function(t){return t===e?this._lang:(this._lang=U(t),this)}};for(i=0;i 68 ? 1900 : 2e3);
+ break;
+ case 'YYYY':
+ case 'YYYYY':
+ s[0] = ~~t;
+ break;
+ case 'a':
+ case 'A':
+ n._isPm = (t + '').toLowerCase() === 'pm';
+ break;
+ case 'H':
+ case 'HH':
+ case 'h':
+ case 'hh':
+ s[3] = ~~t;
+ break;
+ case 'm':
+ case 'mm':
+ s[4] = ~~t;
+ break;
+ case 's':
+ case 'ss':
+ s[5] = ~~t;
+ break;
+ case 'S':
+ case 'SS':
+ case 'SSS':
+ s[6] = ~~(('0.' + t) * 1e3);
+ break;
+ case 'X':
+ n._d = new Date(parseFloat(t) * 1e3);
+ break;
+ case 'Z':
+ case 'ZZ':
+ (n._useUTC = !0),
+ (r = (t + '').match(x)),
+ r && r[1] && (n._tzh = ~~r[1]),
+ r && r[2] && (n._tzm = ~~r[2]),
+ r && r[0] === '+' && ((n._tzh = -n._tzh), (n._tzm = -n._tzm));
+ }
+ t == null && (n._isValid = !1);
+ }
+ function J(e) {
+ var t,
+ n,
+ r = [];
+ if (e._d) return;
+ for (t = 0; t < 7; t++)
+ e._a[t] = r[t] = e._a[t] == null ? (t === 2 ? 1 : 0) : e._a[t];
+ (r[3] += e._tzh || 0),
+ (r[4] += e._tzm || 0),
+ (n = new Date(0)),
+ e._useUTC
+ ? (n.setUTCFullYear(r[0], r[1], r[2]),
+ n.setUTCHours(r[3], r[4], r[5], r[6]))
+ : (n.setFullYear(r[0], r[1], r[2]), n.setHours(r[3], r[4], r[5], r[6])),
+ (e._d = n);
+ }
+ function K(e) {
+ var t = e._f.match(a),
+ n = e._i,
+ r,
+ i;
+ e._a = [];
+ for (r = 0; r < t.length; r++)
+ (i = (V(t[r]).exec(n) || [])[0]),
+ i && (n = n.slice(n.indexOf(i) + i.length)),
+ A[t[r]] && $(t[r], i, e);
+ e._isPm && e._a[3] < 12 && (e._a[3] += 12),
+ e._isPm === !1 && e._a[3] === 12 && (e._a[3] = 0),
+ J(e);
+ }
+ function Q(e) {
+ var t,
+ n,
+ r,
+ i = 99,
+ s,
+ o,
+ u;
+ while (e._f.length) {
+ (t = H({}, e)), (t._f = e._f.pop()), K(t), (n = new D(t));
+ if (n.isValid()) {
+ r = n;
+ break;
+ }
+ (u = q(t._a, n.toArray())), u < i && ((i = u), (r = n));
+ }
+ H(e, r);
+ }
+ function G(e) {
+ var t,
+ n = e._i;
+ if (w.exec(n)) {
+ e._f = 'YYYY-MM-DDT';
+ for (t = 0; t < 4; t++)
+ if (S[t][1].exec(n)) {
+ e._f += S[t][0];
+ break;
+ }
+ g.exec(n) && (e._f += ' Z'), K(e);
+ } else e._d = new Date(n);
+ }
+ function Y(t) {
+ var n = t._i,
+ r = u.exec(n);
+ n === e
+ ? (t._d = new Date())
+ : r
+ ? (t._d = new Date(+r[1]))
+ : typeof n == 'string'
+ ? G(t)
+ : I(n)
+ ? ((t._a = n.slice(0)), J(t))
+ : (t._d = n instanceof Date ? new Date(+n) : new Date(n));
+ }
+ function Z(e, t, n, r, i) {
+ return i.relativeTime(t || 1, !!n, e, r);
+ }
+ function et(e, t, n) {
+ var i = r(Math.abs(e) / 1e3),
+ s = r(i / 60),
+ o = r(s / 60),
+ u = r(o / 24),
+ a = r(u / 365),
+ f = (i < 45 && ['s', i]) ||
+ (s === 1 && ['m']) ||
+ (s < 45 && ['mm', s]) ||
+ (o === 1 && ['h']) ||
+ (o < 22 && ['hh', o]) ||
+ (u === 1 && ['d']) ||
+ (u <= 25 && ['dd', u]) ||
+ (u <= 45 && ['M']) ||
+ (u < 345 && ['MM', r(u / 30)]) ||
+ (a === 1 && ['y']) || ['yy', a];
+ return (f[2] = t), (f[3] = e > 0), (f[4] = n), Z.apply({}, f);
+ }
+ function tt(e, n, r) {
+ var i = r - n,
+ s = r - e.day();
+ return (
+ s > i && (s -= 7),
+ s < i - 7 && (s += 7),
+ Math.ceil(t(e).add('d', s).dayOfYear() / 7)
+ );
+ }
+ function nt(e) {
+ var n = e._i,
+ r = e._f;
+ return n === null || n === ''
+ ? null
+ : (typeof n == 'string' && (e._i = n = U().preparse(n)),
+ t.isMoment(n)
+ ? ((e = H({}, n)), (e._d = new Date(+n._d)))
+ : r
+ ? I(r)
+ ? Q(e)
+ : K(e)
+ : Y(e),
+ new D(e));
+ }
+ function rt(e, n) {
+ t.fn[e] = t.fn[e + 's'] = function (e) {
+ var t = this._isUTC ? 'UTC' : '';
+ return e != null
+ ? (this._d['set' + t + n](e), this)
+ : this._d['get' + t + n]();
+ };
+ }
+ function it(e) {
+ t.duration.fn[e] = function () {
+ return this._data[e];
+ };
+ }
+ function st(e, n) {
+ t.duration.fn['as' + e] = function () {
+ return +this / n;
+ };
+ }
+ var t,
+ n = '2.0.0',
+ r = Math.round,
+ i,
+ s = {},
+ o = typeof module != 'undefined' && module.exports,
+ u = /^\/?Date\((\-?\d+)/i,
+ a =
+ /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,
+ f = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,
+ l = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,
+ c = /\d\d?/,
+ h = /\d{1,3}/,
+ p = /\d{3}/,
+ d = /\d{1,4}/,
+ v = /[+\-]?\d{1,6}/,
+ m =
+ /[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,
+ g = /Z|[\+\-]\d\d:?\d\d/i,
+ y = /T/i,
+ b = /[\+\-]?\d+(\.\d{1,3})?/,
+ w =
+ /^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,
+ E = 'YYYY-MM-DDTHH:mm:ssZ',
+ S = [
+ ['HH:mm:ss.S', /(T| )\d\d:\d\d:\d\d\.\d{1,3}/],
+ ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/],
+ ['HH:mm', /(T| )\d\d:\d\d/],
+ ['HH', /(T| )\d\d/]
+ ],
+ x = /([\+\-]|\d\d)/gi,
+ T = 'Month|Date|Hours|Minutes|Seconds|Milliseconds'.split('|'),
+ N = {
+ Milliseconds: 1,
+ Seconds: 1e3,
+ Minutes: 6e4,
+ Hours: 36e5,
+ Days: 864e5,
+ Months: 2592e6,
+ Years: 31536e6
+ },
+ C = {},
+ k = 'DDD w W M D d'.split(' '),
+ L = 'M D H h m s w W'.split(' '),
+ A = {
+ M: function () {
+ return this.month() + 1;
+ },
+ MMM: function (e) {
+ return this.lang().monthsShort(this, e);
+ },
+ MMMM: function (e) {
+ return this.lang().months(this, e);
+ },
+ D: function () {
+ return this.date();
+ },
+ DDD: function () {
+ return this.dayOfYear();
+ },
+ d: function () {
+ return this.day();
+ },
+ dd: function (e) {
+ return this.lang().weekdaysMin(this, e);
+ },
+ ddd: function (e) {
+ return this.lang().weekdaysShort(this, e);
+ },
+ dddd: function (e) {
+ return this.lang().weekdays(this, e);
+ },
+ w: function () {
+ return this.week();
+ },
+ W: function () {
+ return this.isoWeek();
+ },
+ YY: function () {
+ return j(this.year() % 100, 2);
+ },
+ YYYY: function () {
+ return j(this.year(), 4);
+ },
+ YYYYY: function () {
+ return j(this.year(), 5);
+ },
+ a: function () {
+ return this.lang().meridiem(this.hours(), this.minutes(), !0);
+ },
+ A: function () {
+ return this.lang().meridiem(this.hours(), this.minutes(), !1);
+ },
+ H: function () {
+ return this.hours();
+ },
+ h: function () {
+ return this.hours() % 12 || 12;
+ },
+ m: function () {
+ return this.minutes();
+ },
+ s: function () {
+ return this.seconds();
+ },
+ S: function () {
+ return ~~(this.milliseconds() / 100);
+ },
+ SS: function () {
+ return j(~~(this.milliseconds() / 10), 2);
+ },
+ SSS: function () {
+ return j(this.milliseconds(), 3);
+ },
+ Z: function () {
+ var e = -this.zone(),
+ t = '+';
+ return (
+ e < 0 && ((e = -e), (t = '-')),
+ t + j(~~(e / 60), 2) + ':' + j(~~e % 60, 2)
+ );
+ },
+ ZZ: function () {
+ var e = -this.zone(),
+ t = '+';
+ return e < 0 && ((e = -e), (t = '-')), t + j(~~((10 * e) / 6), 4);
+ },
+ X: function () {
+ return this.unix();
+ }
+ };
+ while (k.length) (i = k.pop()), (A[i + 'o'] = M(A[i]));
+ while (L.length) (i = L.pop()), (A[i + i] = O(A[i], 2));
+ (A.DDDD = O(A.DDD, 3)),
+ (_.prototype = {
+ set: function (e) {
+ var t, n;
+ for (n in e)
+ (t = e[n]),
+ typeof t == 'function' ? (this[n] = t) : (this['_' + n] = t);
+ },
+ _months:
+ 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
+ '_'
+ ),
+ months: function (e) {
+ return this._months[e.month()];
+ },
+ _monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
+ '_'
+ ),
+ monthsShort: function (e) {
+ return this._monthsShort[e.month()];
+ },
+ monthsParse: function (e) {
+ var n, r, i, s;
+ this._monthsParse || (this._monthsParse = []);
+ for (n = 0; n < 12; n++) {
+ this._monthsParse[n] ||
+ ((r = t([2e3, n])),
+ (i = '^' + this.months(r, '') + '|^' + this.monthsShort(r, '')),
+ (this._monthsParse[n] = new RegExp(i.replace('.', ''), 'i')));
+ if (this._monthsParse[n].test(e)) return n;
+ }
+ },
+ _weekdays:
+ 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdays: function (e) {
+ return this._weekdays[e.day()];
+ },
+ _weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysShort: function (e) {
+ return this._weekdaysShort[e.day()];
+ },
+ _weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ weekdaysMin: function (e) {
+ return this._weekdaysMin[e.day()];
+ },
+ _longDateFormat: {
+ LT: 'h:mm A',
+ L: 'MM/DD/YYYY',
+ LL: 'MMMM D YYYY',
+ LLL: 'MMMM D YYYY LT',
+ LLLL: 'dddd, MMMM D YYYY LT'
+ },
+ longDateFormat: function (e) {
+ var t = this._longDateFormat[e];
+ return (
+ !t &&
+ this._longDateFormat[e.toUpperCase()] &&
+ ((t = this._longDateFormat[e.toUpperCase()].replace(
+ /MMMM|MM|DD|dddd/g,
+ function (e) {
+ return e.slice(1);
+ }
+ )),
+ (this._longDateFormat[e] = t)),
+ t
+ );
+ },
+ meridiem: function (e, t, n) {
+ return e > 11 ? (n ? 'pm' : 'PM') : n ? 'am' : 'AM';
+ },
+ _calendar: {
+ sameDay: '[Today at] LT',
+ nextDay: '[Tomorrow at] LT',
+ nextWeek: 'dddd [at] LT',
+ lastDay: '[Yesterday at] LT',
+ lastWeek: '[last] dddd [at] LT',
+ sameElse: 'L'
+ },
+ calendar: function (e, t) {
+ var n = this._calendar[e];
+ return typeof n == 'function' ? n.apply(t) : n;
+ },
+ _relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ },
+ relativeTime: function (e, t, n, r) {
+ var i = this._relativeTime[n];
+ return typeof i == 'function' ? i(e, t, n, r) : i.replace(/%d/i, e);
+ },
+ pastFuture: function (e, t) {
+ var n = this._relativeTime[e > 0 ? 'future' : 'past'];
+ return typeof n == 'function' ? n(t) : n.replace(/%s/i, t);
+ },
+ ordinal: function (e) {
+ return this._ordinal.replace('%d', e);
+ },
+ _ordinal: '%d',
+ preparse: function (e) {
+ return e;
+ },
+ postformat: function (e) {
+ return e;
+ },
+ week: function (e) {
+ return tt(e, this._week.dow, this._week.doy);
+ },
+ _week: { dow: 0, doy: 6 }
+ }),
+ (t = function (e, t, n) {
+ return nt({ _i: e, _f: t, _l: n, _isUTC: !1 });
+ }),
+ (t.utc = function (e, t, n) {
+ return nt({ _useUTC: !0, _isUTC: !0, _l: n, _i: e, _f: t });
+ }),
+ (t.unix = function (e) {
+ return t(e * 1e3);
+ }),
+ (t.duration = function (e, n) {
+ var r = t.isDuration(e),
+ i = typeof e == 'number',
+ s = r ? e._data : i ? {} : e,
+ o;
+ return (
+ i && (n ? (s[n] = e) : (s.milliseconds = e)),
+ (o = new P(s)),
+ r && e.hasOwnProperty('_lang') && (o._lang = e._lang),
+ o
+ );
+ }),
+ (t.version = n),
+ (t.defaultFormat = E),
+ (t.lang = function (e, n) {
+ var r;
+ if (!e) return t.fn._lang._abbr;
+ n ? R(e, n) : s[e] || U(e), (t.duration.fn._lang = t.fn._lang = U(e));
+ }),
+ (t.langData = function (e) {
+ return e && e._lang && e._lang._abbr && (e = e._lang._abbr), U(e);
+ }),
+ (t.isMoment = function (e) {
+ return e instanceof D;
+ }),
+ (t.isDuration = function (e) {
+ return e instanceof P;
+ }),
+ (t.fn = D.prototype =
+ {
+ clone: function () {
+ return t(this);
+ },
+ valueOf: function () {
+ return +this._d;
+ },
+ unix: function () {
+ return Math.floor(+this._d / 1e3);
+ },
+ toString: function () {
+ return this.format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
+ },
+ toDate: function () {
+ return this._d;
+ },
+ toJSON: function () {
+ return t.utc(this).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ },
+ toArray: function () {
+ var e = this;
+ return [
+ e.year(),
+ e.month(),
+ e.date(),
+ e.hours(),
+ e.minutes(),
+ e.seconds(),
+ e.milliseconds()
+ ];
+ },
+ isValid: function () {
+ return (
+ this._isValid == null &&
+ (this._a
+ ? (this._isValid = !q(
+ this._a,
+ (this._isUTC ? t.utc(this._a) : t(this._a)).toArray()
+ ))
+ : (this._isValid = !isNaN(this._d.getTime()))),
+ !!this._isValid
+ );
+ },
+ utc: function () {
+ return (this._isUTC = !0), this;
+ },
+ local: function () {
+ return (this._isUTC = !1), this;
+ },
+ format: function (e) {
+ var n = X(this, e || t.defaultFormat);
+ return this.lang().postformat(n);
+ },
+ add: function (e, n) {
+ var r;
+ return (
+ typeof e == 'string'
+ ? (r = t.duration(+n, e))
+ : (r = t.duration(e, n)),
+ F(this, r, 1),
+ this
+ );
+ },
+ subtract: function (e, n) {
+ var r;
+ return (
+ typeof e == 'string'
+ ? (r = t.duration(+n, e))
+ : (r = t.duration(e, n)),
+ F(this, r, -1),
+ this
+ );
+ },
+ diff: function (e, n, r) {
+ var i = this._isUTC ? t(e).utc() : t(e).local(),
+ s = (this.zone() - i.zone()) * 6e4,
+ o,
+ u;
+ return (
+ n && (n = n.replace(/s$/, '')),
+ n === 'year' || n === 'month'
+ ? ((o = (this.daysInMonth() + i.daysInMonth()) * 432e5),
+ (u =
+ (this.year() - i.year()) * 12 + (this.month() - i.month())),
+ (u +=
+ (this -
+ t(this).startOf('month') -
+ (i - t(i).startOf('month'))) /
+ o),
+ n === 'year' && (u /= 12))
+ : ((o = this - i - s),
+ (u =
+ n === 'second'
+ ? o / 1e3
+ : n === 'minute'
+ ? o / 6e4
+ : n === 'hour'
+ ? o / 36e5
+ : n === 'day'
+ ? o / 864e5
+ : n === 'week'
+ ? o / 6048e5
+ : o)),
+ r ? u : B(u)
+ );
+ },
+ from: function (e, n) {
+ return t.duration(this.diff(e)).lang(this.lang()._abbr).humanize(!n);
+ },
+ fromNow: function (e) {
+ return this.from(t(), e);
+ },
+ calendar: function () {
+ var e = this.diff(t().startOf('day'), 'days', !0),
+ n =
+ e < -6
+ ? 'sameElse'
+ : e < -1
+ ? 'lastWeek'
+ : e < 0
+ ? 'lastDay'
+ : e < 1
+ ? 'sameDay'
+ : e < 2
+ ? 'nextDay'
+ : e < 7
+ ? 'nextWeek'
+ : 'sameElse';
+ return this.format(this.lang().calendar(n, this));
+ },
+ isLeapYear: function () {
+ var e = this.year();
+ return (e % 4 === 0 && e % 100 !== 0) || e % 400 === 0;
+ },
+ isDST: function () {
+ return (
+ this.zone() < t([this.year()]).zone() ||
+ this.zone() < t([this.year(), 5]).zone()
+ );
+ },
+ day: function (e) {
+ var t = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+ return e == null ? t : this.add({ d: e - t });
+ },
+ startOf: function (e) {
+ e = e.replace(/s$/, '');
+ switch (e) {
+ case 'year':
+ this.month(0);
+ case 'month':
+ this.date(1);
+ case 'week':
+ case 'day':
+ this.hours(0);
+ case 'hour':
+ this.minutes(0);
+ case 'minute':
+ this.seconds(0);
+ case 'second':
+ this.milliseconds(0);
+ }
+ return e === 'week' && this.day(0), this;
+ },
+ endOf: function (e) {
+ return this.startOf(e)
+ .add(e.replace(/s?$/, 's'), 1)
+ .subtract('ms', 1);
+ },
+ isAfter: function (e, n) {
+ return (
+ (n = typeof n != 'undefined' ? n : 'millisecond'),
+ +this.clone().startOf(n) > +t(e).startOf(n)
+ );
+ },
+ isBefore: function (e, n) {
+ return (
+ (n = typeof n != 'undefined' ? n : 'millisecond'),
+ +this.clone().startOf(n) < +t(e).startOf(n)
+ );
+ },
+ isSame: function (e, n) {
+ return (
+ (n = typeof n != 'undefined' ? n : 'millisecond'),
+ +this.clone().startOf(n) === +t(e).startOf(n)
+ );
+ },
+ zone: function () {
+ return this._isUTC ? 0 : this._d.getTimezoneOffset();
+ },
+ daysInMonth: function () {
+ return t.utc([this.year(), this.month() + 1, 0]).date();
+ },
+ dayOfYear: function (e) {
+ var n =
+ r((t(this).startOf('day') - t(this).startOf('year')) / 864e5) + 1;
+ return e == null ? n : this.add('d', e - n);
+ },
+ isoWeek: function (e) {
+ var t = tt(this, 1, 4);
+ return e == null ? t : this.add('d', (e - t) * 7);
+ },
+ week: function (e) {
+ var t = this.lang().week(this);
+ return e == null ? t : this.add('d', (e - t) * 7);
+ },
+ lang: function (t) {
+ return t === e ? this._lang : ((this._lang = U(t)), this);
+ }
+ });
+ for (i = 0; i < T.length; i++) rt(T[i].toLowerCase().replace(/s$/, ''), T[i]);
+ rt('year', 'FullYear'),
+ (t.fn.days = t.fn.day),
+ (t.fn.weeks = t.fn.week),
+ (t.fn.isoWeeks = t.fn.isoWeek),
+ (t.duration.fn = P.prototype =
+ {
+ weeks: function () {
+ return B(this.days() / 7);
+ },
+ valueOf: function () {
+ return (
+ this._milliseconds + this._days * 864e5 + this._months * 2592e6
+ );
+ },
+ humanize: function (e) {
+ var t = +this,
+ n = et(t, !e, this.lang());
+ return (
+ e && (n = this.lang().pastFuture(t, n)), this.lang().postformat(n)
+ );
+ },
+ lang: t.fn.lang
+ });
+ for (i in N) N.hasOwnProperty(i) && (st(i, N[i]), it(i.toLowerCase()));
+ st('Weeks', 6048e5),
+ t.lang('en', {
+ ordinal: function (e) {
+ var t = e % 10,
+ n =
+ ~~((e % 100) / 10) === 1
+ ? 'th'
+ : t === 1
+ ? 'st'
+ : t === 2
+ ? 'nd'
+ : t === 3
+ ? 'rd'
+ : 'th';
+ return e + n;
+ }
+ }),
+ o && (module.exports = t),
+ typeof ender == 'undefined' && (this.moment = t),
+ typeof define == 'function' &&
+ define.amd &&
+ define('moment', [], function () {
+ return t;
+ });
+}.call(this));
diff --git a/examples/apps/JavaScript/CompareTool/manifest.js b/examples/apps/JavaScript/CompareTool/manifest.js
index b4ab9807..71ca6f86 100644
--- a/examples/apps/JavaScript/CompareTool/manifest.js
+++ b/examples/apps/JavaScript/CompareTool/manifest.js
@@ -1,52 +1,50 @@
F2_jsonpCallback_com_openf2_examples_javascript_compareTool({
- "scripts":[
- "../apps/JavaScript/CompareTool/js/angular.min.js",
- "../apps/JavaScript/CompareTool/js/angular-resource.min.js",
- "../apps/JavaScript/CompareTool/js/moment.min.js",
- "../apps/JavaScript/CompareTool/js/compare.js",
- "../apps/JavaScript/CompareTool/appclass.js"
+ scripts: [
+ '../apps/JavaScript/CompareTool/js/angular.min.js',
+ '../apps/JavaScript/CompareTool/js/angular-resource.min.js',
+ '../apps/JavaScript/CompareTool/js/moment.min.js',
+ '../apps/JavaScript/CompareTool/js/compare.js',
+ '../apps/JavaScript/CompareTool/appclass.js'
],
- "styles":[
- "../apps/JavaScript/CompareTool/css/compare.css"
- ],
- "apps":[
+ styles: ['../apps/JavaScript/CompareTool/css/compare.css'],
+ apps: [
{
- "html": [
+ html: [
'',
- '',
- 'Examples: ',
- '',
- '{{symbol | uppercase}}{{$last && " " || ", "}}',
- '',
- '
',
- '',
- '',
- '',
- ' ',
- '',
- '{{issue.Name}}',
- '{{issue.Symbol}}',
- 'Remove',
- ' ',
- '',
- '',
- ' ',
- ' ',
- '',
- '',
- '',
- '{{point.label}} ',
- '{{format(issue[point.field], point.format)}} ',
- ' ',
- ' ',
- '',
- '
',
- 'Quotes provided by http://dev.markitondemand.com/
',
+ '',
+ 'Examples: ',
+ "",
+ '{{symbol | uppercase}}{{$last && " " || ", "}}',
+ '',
+ '
',
+ '',
+ '',
+ '',
+ ' ',
+ '',
+ '{{issue.Name}}',
+ '{{issue.Symbol}}',
+ 'Remove',
+ ' ',
+ '',
+ '',
+ ' ',
+ ' ',
+ '',
+ '',
+ '',
+ '{{point.label}} ',
+ '{{format(issue[point.field], point.format)}} ',
+ ' ',
+ ' ',
+ '',
+ '
',
+ 'Quotes provided by http://dev.markitondemand.com/
',
''
].join('')
}
]
-});
\ No newline at end of file
+});
diff --git a/examples/apps/JavaScript/HelloWorld/appclass.js b/examples/apps/JavaScript/HelloWorld/appclass.js
index 6b7af6c4..fed27393 100644
--- a/examples/apps/JavaScript/HelloWorld/appclass.js
+++ b/examples/apps/JavaScript/HelloWorld/appclass.js
@@ -1,5 +1,4 @@
-F2.Apps["com_openf2_examples_javascript_helloworld"] = (function() {
-
+F2.Apps['com_openf2_examples_javascript_helloworld'] = (function () {
var App_Class = function (appConfig, appContent, root) {
this.appConfig = appConfig;
this.appContent = appContent;
@@ -7,48 +6,54 @@ F2.Apps["com_openf2_examples_javascript_helloworld"] = (function() {
};
App_Class.prototype.init = function () {
-
this.$root
- .on('click', 'a.testAlert', $.proxy(function() {
- alert("Hello World!")
- F2.log('callback fired!');
- }, this))
- .on('click', 'a.testConfirm', $.proxy(function() {
- let r = confirm('Hello World!');
- if (r == true) {
- F2.log('ok callback fired!');
- } else {
- F2.log('cancel callback fired!');
- }
- }, this))
- ;
+ .on(
+ 'click',
+ 'a.testAlert',
+ $.proxy(function () {
+ alert('Hello World!');
+ F2.log('callback fired!');
+ }, this)
+ )
+ .on(
+ 'click',
+ 'a.testConfirm',
+ $.proxy(function () {
+ let r = confirm('Hello World!');
+ if (r == true) {
+ F2.log('ok callback fired!');
+ } else {
+ F2.log('cancel callback fired!');
+ }
+ }, this)
+ );
-
// bind symbol change event
- F2.Events.on(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, $.proxy(this._handleSymbolChange, this));
+ F2.Events.on(
+ F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
+ $.proxy(this._handleSymbolChange, this)
+ );
};
App_Class.prototype._handleSymbolChange = function (data) {
-
- var symbolAlert = $("div.symbolAlert", this.$root);
- symbolAlert = (symbolAlert.length)
- ? symbolAlert
- : this._renderSymbolAlert();
-
- $("span:first", symbolAlert).text("The symbol has been changed to " + data.symbol);
+ var symbolAlert = $('div.symbolAlert', this.$root);
+ symbolAlert = symbolAlert.length ? symbolAlert : this._renderSymbolAlert();
+ $('span:first', symbolAlert).text(
+ 'The symbol has been changed to ' + data.symbol
+ );
};
- App_Class.prototype._renderSymbolAlert = function() {
-
- return $([
+ App_Class.prototype._renderSymbolAlert = function () {
+ return $(
+ [
'',
- '',
- '',
+ '',
+ '',
''
- ].join(''))
- .prependTo($("." + F2.Constants.Css.APP_CONTAINER,this.$root));
+ ].join('')
+ ).prependTo($('.' + F2.Constants.Css.APP_CONTAINER, this.$root));
};
return App_Class;
-})();
\ No newline at end of file
+})();
diff --git a/examples/apps/JavaScript/HelloWorld/manifest.js b/examples/apps/JavaScript/HelloWorld/manifest.js
index f1481522..240e81db 100644
--- a/examples/apps/JavaScript/HelloWorld/manifest.js
+++ b/examples/apps/JavaScript/HelloWorld/manifest.js
@@ -1,19 +1,17 @@
F2_jsonpCallback_com_openf2_examples_javascript_helloworld({
- "scripts":[
- "../apps/JavaScript/HelloWorld/appclass.js"
- ],
- "styles":[],
- "apps":[
+ scripts: ['../apps/JavaScript/HelloWorld/appclass.js'],
+ styles: [],
+ apps: [
{
- "html":[
+ html: [
'',
- '',
+ '',
''
- ].join("")
+ ].join('')
}
]
-})
\ No newline at end of file
+});
diff --git a/examples/apps/JavaScript/HelloWorldLocale/appclass.js b/examples/apps/JavaScript/HelloWorldLocale/appclass.js
index 7709f239..4361a968 100644
--- a/examples/apps/JavaScript/HelloWorldLocale/appclass.js
+++ b/examples/apps/JavaScript/HelloWorldLocale/appclass.js
@@ -1,5 +1,4 @@
-F2.Apps["com_openf2_examples_javascript_helloworldlocale"] = (function() {
-
+F2.Apps['com_openf2_examples_javascript_helloworldlocale'] = (function () {
var App_Class = function (appConfig, appContent, root) {
this.appConfig = appConfig;
this.appContent = appContent;
@@ -8,36 +7,46 @@ F2.Apps["com_openf2_examples_javascript_helloworldlocale"] = (function() {
App_Class.prototype.init = function () {
//set current locale
- $('#current_locale',this.$root).html( this.appConfig.containerLocale || 'Not defined in F2.init()' );
- $('#current_locale_date',this.$root).text( this._setCurrentDate(this.appConfig.containerLocale) );
+ $('#current_locale', this.$root).html(
+ this.appConfig.containerLocale || 'Not defined in F2.init()'
+ );
+ $('#current_locale_date', this.$root).text(
+ this._setCurrentDate(this.appConfig.containerLocale)
+ );
// bind symbol change event
- F2.Events.on(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, $.proxy(this._handleSymbolChange, this));
- F2.Events.on(F2.Constants.Events.CONTAINER_LOCALE_CHANGE, $.proxy(this._handleLocaleChange, this));
+ F2.Events.on(
+ F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
+ $.proxy(this._handleSymbolChange, this)
+ );
+ F2.Events.on(
+ F2.Constants.Events.CONTAINER_LOCALE_CHANGE,
+ $.proxy(this._handleLocaleChange, this)
+ );
};
App_Class.prototype._handleSymbolChange = function (data) {
-
- var symbolAlert = $("div.symbolAlert", this.$root);
- symbolAlert = (symbolAlert.length)
- ? symbolAlert
- : this._renderSymbolAlert();
-
- $("span:first", symbolAlert).text("The symbol has been changed to " + data.symbol);
+ var symbolAlert = $('div.symbolAlert', this.$root);
+ symbolAlert = symbolAlert.length ? symbolAlert : this._renderSymbolAlert();
+ $('span:first', symbolAlert).text(
+ 'The symbol has been changed to ' + data.symbol
+ );
};
App_Class.prototype._handleLocaleChange = function (data) {
-
//set current locale
- $('#current_locale',this.$root).text( data.locale );
-
- $('#current_locale_date',this.$root).text( this._setCurrentDate(data.locale) );
+ $('#current_locale', this.$root).text(data.locale);
+ $('#current_locale_date', this.$root).text(
+ this._setCurrentDate(data.locale)
+ );
};
- App_Class.prototype._setCurrentDate = function(locale) {
- var d = new Date(), formattedDate, month = [];
+ App_Class.prototype._setCurrentDate = function (locale) {
+ var d = new Date(),
+ formattedDate,
+ month = [];
month[0] = 'January';
month[1] = 'February';
month[2] = 'March';
@@ -51,13 +60,15 @@ F2.Apps["com_openf2_examples_javascript_helloworldlocale"] = (function() {
month[10] = 'November';
month[11] = 'December';
- if ('en-gb' == locale){
- formattedDate = d.getDate() + ' ' + month[ d.getMonth() ] + ' ' + d.getFullYear();
+ if ('en-gb' == locale) {
+ formattedDate =
+ d.getDate() + ' ' + month[d.getMonth()] + ' ' + d.getFullYear();
} else {
- formattedDate = month[ d.getMonth() ] + ' ' + d.getDate() + ', ' + d.getFullYear();
+ formattedDate =
+ month[d.getMonth()] + ' ' + d.getDate() + ', ' + d.getFullYear();
}
return formattedDate;
};
return App_Class;
-})();
\ No newline at end of file
+})();
diff --git a/examples/apps/JavaScript/HelloWorldLocale/manifest.js b/examples/apps/JavaScript/HelloWorldLocale/manifest.js
index 534b150a..982ee40d 100644
--- a/examples/apps/JavaScript/HelloWorldLocale/manifest.js
+++ b/examples/apps/JavaScript/HelloWorldLocale/manifest.js
@@ -1,21 +1,19 @@
F2_jsonpCallback_com_openf2_examples_javascript_helloworldlocale({
- "scripts":[
- "../apps/JavaScript/HelloWorldLocale/appclass.js"
- ],
- "styles":[],
- "apps":[
+ scripts: ['../apps/JavaScript/HelloWorldLocale/appclass.js'],
+ styles: [],
+ apps: [
{
- "html":[
+ html: [
'',
- '',
- 'A simple app demonstrating internationalization (i18n) support in F2.
',
- 'Current locale: ',
- 'Today\'s date—properly formatted for the current locale—is:
',
- '',
- 'Change region in the "locale" dropdown in the menubar.
',
- '',
+ '',
+ 'A simple app demonstrating internationalization (i18n) support in F2.
',
+ 'Current locale: ',
+ "Today's date—properly formatted for the current locale—is:
",
+ '',
+ 'Change region in the "locale" dropdown in the menubar.
',
+ '',
''
- ].join("")
+ ].join('')
}
]
-})
\ No newline at end of file
+});
diff --git a/examples/apps/JavaScript/Quote/app.css b/examples/apps/JavaScript/Quote/app.css
index b0c632ae..e6be6000 100644
--- a/examples/apps/JavaScript/Quote/app.css
+++ b/examples/apps/JavaScript/Quote/app.css
@@ -1,5 +1,5 @@
.com_openf2_examples_javascript_quote table {
- margin:0;
+ margin: 0;
}
.com_openf2_examples_javascript_quote .table th {
width: 75px;
@@ -9,10 +9,9 @@
white-space: nowrap;
}
.com_openf2_examples_javascript_quote .last {
-
}
.com_openf2_examples_javascript_quote .last-change {
- font-size:80%;
+ font-size: 80%;
}
.com_openf2_examples_javascript_quote .positive {
color: green;
@@ -22,6 +21,6 @@
}
.com_openf2_examples_javascript_quote .input-append {
- padding-bottom:7px;
- padding-top:7px;
-}
\ No newline at end of file
+ padding-bottom: 7px;
+ padding-top: 7px;
+}
diff --git a/examples/apps/JavaScript/Quote/appclass.js b/examples/apps/JavaScript/Quote/appclass.js
index 17f6ec09..9a02b0e5 100644
--- a/examples/apps/JavaScript/Quote/appclass.js
+++ b/examples/apps/JavaScript/Quote/appclass.js
@@ -1,5 +1,8 @@
-F2.Apps['com_openf2_examples_javascript_quote'] = function (appConfig, appContent, root) {
-
+F2.Apps['com_openf2_examples_javascript_quote'] = function (
+ appConfig,
+ appContent,
+ root
+) {
var $root = $(root);
var $caption = $('caption', $root);
var $tbody = $('tbody', $root);
@@ -11,16 +14,15 @@ F2.Apps['com_openf2_examples_javascript_quote'] = function (appConfig, appConten
};
var _autoRefreshInterval = false;
- var _getQuote = function(symbolData) {
-
+ var _getQuote = function (symbolData) {
appConfig.context = appConfig.context || {};
- if (!!symbolData){
+ if (!!symbolData) {
appConfig.context.symbol = symbolData.symbol;
- } else if(appConfig.context.symbol) {
+ } else if (appConfig.context.symbol) {
appConfig.context.symbol = appConfig.context.symbol;
} else {
- appConfig.context.symbol = 'MSFT';//default to Microsoft
+ appConfig.context.symbol = 'MSFT'; //default to Microsoft
}
$.ajax({
@@ -28,36 +30,35 @@ F2.Apps['com_openf2_examples_javascript_quote'] = function (appConfig, appConten
data: { symbol: appConfig.context.symbol },
dataType: 'jsonp',
success: _renderQuote,
- error: function() {
-
- }
+ error: function () {}
});
- _getWatchListSymbols()
+ _getWatchListSymbols();
};
- var _hasWatchListApp = function() {
- return !!$("div.com_openf2_examples_javascript_watchlist").length;
+ var _hasWatchListApp = function () {
+ return !!$('div.com_openf2_examples_javascript_watchlist').length;
};
- var _watchListHasSymbol = function(){
+ var _watchListHasSymbol = function () {
return F2.inArray(appConfig.context.symbol, _getWatchListSymbols());
};
- var _getWatchListSymbols = function(){
+ var _getWatchListSymbols = function () {
var list = [];
- $('div.com_openf2_examples_javascript_watchlist tr[data-row]').each(function(idx,item){
- list.push($(item).attr('data-row'))
- });
+ $('div.com_openf2_examples_javascript_watchlist tr[data-row]').each(
+ function (idx, item) {
+ list.push($(item).attr('data-row'));
+ }
+ );
return list;
- }
-
- var _initQuoteButton = function() {
+ };
- $('button.get-quote', $root).on('click', function(){
+ var _initQuoteButton = function () {
+ $('button.get-quote', $root).on('click', function () {
var symbol = $('.ui-autocomplete-input', $root).val();
- if(!symbol || !symbol.length){
+ if (!symbol || !symbol.length) {
return;
}
@@ -70,126 +71,173 @@ F2.Apps['com_openf2_examples_javascript_quote'] = function (appConfig, appConten
input: symbol
},
success: function (data) {
- var result = $.grep(data, function(item){
- return item.Symbol == symbol;
+ var result = $.grep(data, function (item) {
+ return item.Symbol == symbol;
});
- if(!result.length){
+ if (!result.length) {
return;
}
- _getQuote({symbol: symbol});
+ _getQuote({ symbol: symbol });
}
});
});
};
- var _initTypeahead = function() {
-
- $('input[name=lookup]', $root)
- .autocomplete({
- autoFocus:true,
- minLength: 0,
- select: function (event, ui) {
- //F2.Events.emit(F2.Constants.Events.APP_SYMBOL_CHANGE, { symbol: ui.item.value, name: ui.item.label });
- _getQuote({ symbol: ui.item.value });
- },
- source: function (request, response) {
-
- $.ajax({
- url: '//dev.markitondemand.com/api/Lookup/jsonp',
- dataType: 'jsonp',
- data: {
- input: request.term
- },
- success: function (data) {
- response($.map(data, function (item) {
+ var _initTypeahead = function () {
+ $('input[name=lookup]', $root).autocomplete({
+ autoFocus: true,
+ minLength: 0,
+ select: function (event, ui) {
+ //F2.Events.emit(F2.Constants.Events.APP_SYMBOL_CHANGE, { symbol: ui.item.value, name: ui.item.label });
+ _getQuote({ symbol: ui.item.value });
+ },
+ source: function (request, response) {
+ $.ajax({
+ url: '//dev.markitondemand.com/api/Lookup/jsonp',
+ dataType: 'jsonp',
+ data: {
+ input: request.term
+ },
+ success: function (data) {
+ response(
+ $.map(data, function (item) {
return {
- label: item.Symbol + ' - ' + item.Name + ' (' + item.Exchange + ')',
+ label:
+ item.Symbol +
+ ' - ' +
+ item.Name +
+ ' (' +
+ item.Exchange +
+ ')',
value: item.Symbol
- }
- }));
- }
- });
+ };
+ })
+ );
+ }
+ });
}
});
};
- var _populateSettings = function() {
- $('input[name=refreshMode][value=' + _config.refreshMode + ']', $settings).prop('checked', true);
- $('input[name=autoRefresh]', $settings).prop('checked', _config.autoRefresh);
+ var _populateSettings = function () {
+ $(
+ 'input[name=refreshMode][value=' + _config.refreshMode + ']',
+ $settings
+ ).prop('checked', true);
+ $('input[name=autoRefresh]', $settings).prop(
+ 'checked',
+ _config.autoRefresh
+ );
};
- var _renderQuote = function(quoteData) {
-
- if (quoteData && quoteData.Data && quoteData.Data.Status == F2.Constants.AppStatus.SUCCESS) {
-
- $caption.promise().done(function() {
+ var _renderQuote = function (quoteData) {
+ if (
+ quoteData &&
+ quoteData.Data &&
+ quoteData.Data.Status == F2.Constants.AppStatus.SUCCESS
+ ) {
+ $caption.promise().done(function () {
$(this)
.empty()
- .append([
- '',
- '', Format.number(quoteData.Data.LastPrice, 2), '',
- '', Format.number(quoteData.Data.Change, {precision:2, withColors:true}), ' ', Format.number(quoteData.Data.ChangePercent, {precision:2, withColors:true, prefix:'(', suffix:'%)'}), '',
- '
'
- ].join(''));
+ .append(
+ [
+ '',
+ '',
+ Format.number(quoteData.Data.LastPrice, 2),
+ '',
+ '',
+ Format.number(quoteData.Data.Change, {
+ precision: 2,
+ withColors: true
+ }),
+ ' ',
+ Format.number(quoteData.Data.ChangePercent, {
+ precision: 2,
+ withColors: true,
+ prefix: '(',
+ suffix: '%)'
+ }),
+ '',
+ '
'
+ ].join('')
+ );
});
- $tbody.promise().done(function() {
+ $tbody.promise().done(function () {
$(this)
.empty()
- .append([
- '',
+ .append(
+ [
+ ' ',
'Range ',
- '', Format.number(quoteData.Data.Low), ' - ', Format.number(quoteData.Data.High), ' ',
- ' ',
- '',
+ '',
+ Format.number(quoteData.Data.Low),
+ ' - ',
+ Format.number(quoteData.Data.High),
+ ' ',
+ ' ',
+ '',
'Open ',
- '', Format.number(quoteData.Data.Open), ' ',
- ' ',
- '',
+ '',
+ Format.number(quoteData.Data.Open),
+ ' ',
+ ' ',
+ '',
'Volume ',
- '', Format.number(quoteData.Data.Volume, {withMagnitude:true,precision:1}), ' ',
- ' ',
- '',
+ '',
+ Format.number(quoteData.Data.Volume, {
+ withMagnitude: true,
+ precision: 1
+ }),
+ ' ',
+ ' ',
+ '',
'Market Cap ',
- '', Format.number(quoteData.Data.MarketCap, {withMagnitude:true,precision:1}), ' ',
- ' '
- ].join(''));
+ '',
+ Format.number(quoteData.Data.MarketCap, {
+ withMagnitude: true,
+ precision: 1
+ }),
+ ' ',
+ ''
+ ].join('')
+ );
});
$('span', $addToWatchlist).text(quoteData.Data.Symbol);
$addToWatchlist
.data('watchlist-add', quoteData.Data.Symbol)
- .closest('tr').toggleClass('hide', (!_hasWatchListApp() || _watchListHasSymbol()));
-
+ .closest('tr')
+ .toggleClass('hide', !_hasWatchListApp() || _watchListHasSymbol());
} else {
F2.log('Un problemo!');
}
};
- var _saveSettings = function() {
-
+ var _saveSettings = function () {
clearInterval(_autoRefreshInterval);
_config.refreshMode = $('input[name=refreshMode]:checked', $settings).val();
- _config.autoRefresh = $('input[name=autoRefresh]', $settings).prop('checked');
+ _config.autoRefresh = $('input[name=autoRefresh]', $settings).prop(
+ 'checked'
+ );
if (_config.autoRefresh) {
F2.log('beginning refresh');
- _autoRefreshInterval = setInterval(function() {
+ _autoRefreshInterval = setInterval(function () {
F2.log('refreshed');
_getQuote();
}, 30000);
}
-
};
/**
* @class Format
* @static
*/
- var Format = (function() {
+ var Format = (function () {
var _defaultOptions = {
precision: 2,
withColors: false,
@@ -198,7 +246,7 @@ F2.Apps['com_openf2_examples_javascript_quote'] = function (appConfig, appConten
suffix: ''
};
var _magnitudes = {
- 'shortcap': ['', 'K', 'M', 'B', 'T']
+ shortcap: ['', 'K', 'M', 'B', 'T']
};
return {
@@ -209,10 +257,13 @@ F2.Apps['com_openf2_examples_javascript_quote'] = function (appConfig, appConten
* @param {object|int} [options] If int, formats to X precision. If
* object, formats according to options passed
*/
- number:function(raw, options) {
- if (!raw) { return '--'; }
+ number: function (raw, options) {
+ if (!raw) {
+ return '--';
+ }
- options = typeof options === 'number' ? { precision: options } : options;
+ options =
+ typeof options === 'number' ? { precision: options } : options;
options = $.extend({}, _defaultOptions, options);
var val;
@@ -227,23 +278,27 @@ F2.Apps['com_openf2_examples_javascript_quote'] = function (appConfig, appConten
options.magnitudeType = options.magnitudeType || 'shortcap';
options.suffix = _magnitudes[options.magnitudeType][c];
}
-
+
val = raw.toFixed(options.precision);
val = options.prefix + val + options.suffix;
return !!options.withColors
- ? ('' + val + '')
+ ? '' +
+ val +
+ ''
: val;
}
};
})();
return {
- init: function() {
+ init: function () {
// bind container symbol change
F2.Events.on(
F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
- function(symbolData) {
+ function (symbolData) {
if (_config.refreshMode == 'page') {
_getQuote(symbolData);
}
@@ -253,36 +308,32 @@ F2.Apps['com_openf2_examples_javascript_quote'] = function (appConfig, appConten
// bind app symbol change
F2.Events.on(
F2.Constants.Events.APP_SYMBOL_CHANGE,
- function(symbolData) {
+ function (symbolData) {
if (_config.refreshMode == 'app') {
_getQuote(symbolData);
}
}
);
-
//Talk to External Watchlist App
- $root.on("click", "a[data-watchlist-add]", function(e){
-
- if (!_hasWatchListApp()){
- alert("The Watchlist App is not on this container.");
+ $root.on('click', 'a[data-watchlist-add]', function (e) {
+ if (!_hasWatchListApp()) {
+ alert('The Watchlist App is not on this container.');
} else {
-
- F2.Events.emit(
- "F2_Examples_Watchlist_Add",
- { symbol: $(this).data("watchlist-add") }
- );
+ F2.Events.emit('F2_Examples_Watchlist_Add', {
+ symbol: $(this).data('watchlist-add')
+ });
$(this).closest('tr').addClass('hide');
}
- });
+ });
// bind save settings
- $root.on("click", "button.save", _saveSettings);
+ $root.on('click', 'button.save', _saveSettings);
// init typeahead
_initTypeahead();
-
+
// init quote button
_initQuoteButton();
diff --git a/examples/apps/JavaScript/Quote/manifest.js b/examples/apps/JavaScript/Quote/manifest.js
index 59a145ae..695aa60e 100644
--- a/examples/apps/JavaScript/Quote/manifest.js
+++ b/examples/apps/JavaScript/Quote/manifest.js
@@ -1,64 +1,60 @@
F2_jsonpCallback_com_openf2_examples_javascript_quote({
- "scripts":[
- "../apps/JavaScript/Quote/appclass.js"
- ],
- "styles":[
- "../apps/JavaScript/Quote/app.css"
- ],
- "apps":[
+ scripts: ['../apps/JavaScript/Quote/appclass.js'],
+ styles: ['../apps/JavaScript/Quote/app.css'],
+ apps: [
{
- "html":[
+ html: [
'',
- '',
- '',
- ' ',
- '',
- '',
- '',
- '',
- '+Add to Watchlist',
- ' ',
- ' ',
- '',
- '',
- '',
- '',
- '',
- '',
- ' ',
- ' ',
- '',
- '
',
- '',
- '',
- '',
+ '',
+ '',
+ ' ',
+ '',
+ '',
+ '',
+ '',
+ '+Add to Watchlist',
+ ' ',
+ ' ',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ ' ',
+ ' ',
+ '',
+ '
',
+ '',
+ '',
+ '',
''
- ].join("")
+ ].join('')
}
]
-})
\ No newline at end of file
+});
diff --git a/examples/apps/JavaScript/Watchlist/appclass.js b/examples/apps/JavaScript/Watchlist/appclass.js
index 6d0b380c..089097ca 100644
--- a/examples/apps/JavaScript/Watchlist/appclass.js
+++ b/examples/apps/JavaScript/Watchlist/appclass.js
@@ -1,163 +1,192 @@
-F2.Apps['com_openf2_examples_javascript_watchlist'] = (function (appConfig, appContent, root) {
-
- (function(){
+F2.Apps['com_openf2_examples_javascript_watchlist'] = (function (
+ appConfig,
+ appContent,
+ root
+) {
+ (function () {
//http://javascript.crockford.com/remedial.html
- String.prototype.supplant = function(o) {
- return this.replace(/{([^{}]*)}/g,
- function(a, b) {
- var r = o[b];
- return typeof r === 'string' || typeof r === 'number' ? r : a;
- }
- );
+ String.prototype.supplant = function (o) {
+ return this.replace(/{([^{}]*)}/g, function (a, b) {
+ var r = o[b];
+ return typeof r === 'string' || typeof r === 'number' ? r : a;
+ });
};
})();
- var App = function(appConfig, appContent, root) {
- this.appConfig = appConfig;
- this.appContent = appContent;
- this.root = root;
- this.$root = $(root);
- this.$settings = $('form[data-f2-view="settings"]', this.$root);
- this.settings = {
- allowExternalAdd: true
- };
- }
-
- App.prototype.init = function() {
+ var App = function (appConfig, appContent, root) {
+ this.appConfig = appConfig;
+ this.appContent = appContent;
+ this.root = root;
+ this.$root = $(root);
+ this.$settings = $('form[data-f2-view="settings"]', this.$root);
+ this.settings = {
+ allowExternalAdd: true
+ };
+ };
+
+ App.prototype.init = function () {
this.initLocalStorage();
this.getData();
- this.initEvents();
- }
-
- App.prototype.DEFAULT_SYMBOLS = ["BA","BAC","GE","GS","INTC","CSCO"];
- App.prototype.COOKIE_NAME = "F2_Examples_Watchlist";
-
- App.prototype.ROW = ["",
- "",
- "{symbol}",
- " ",
- "{price} ",
- "{change} ({changePct}) ",
- "{volume} ",
- " ",
- " ",
- "",
- "",
- "",
- "",
- "",
- "Bid ",
- "Ask ",
- "Mkt Cap ",
- "Last Trade ",
- " ",
- "",
- "",
- "",
- "{bid} ",
- "{ask} ",
- "{cap} ",
- "{asOfDate} {asOf} ",
- " ",
- "",
- "
",
- " ",
- " "
- ].join("");
+ this.initEvents();
+ };
- App.prototype.data = [];
+ App.prototype.DEFAULT_SYMBOLS = ['BA', 'BAC', 'GE', 'GS', 'INTC', 'CSCO'];
+ App.prototype.COOKIE_NAME = 'F2_Examples_Watchlist';
+
+ App.prototype.ROW = [
+ "",
+ "",
+ "{symbol}",
+ ' ',
+ '{price} ',
+ '{change} ({changePct}) ',
+ '{volume} ',
+ " ",
+ ' ',
+ "",
+ "",
+ "",
+ '',
+ '',
+ 'Bid ',
+ 'Ask ',
+ 'Mkt Cap ',
+ 'Last Trade ',
+ ' ',
+ '',
+ '',
+ '',
+ '{bid} ',
+ '{ask} ',
+ '{cap} ',
+ '{asOfDate} {asOf} ',
+ ' ',
+ '',
+ '
',
+ ' ',
+ ' '
+ ].join('');
- App.prototype.initEvents = function(){
+ App.prototype.data = [];
+ App.prototype.initEvents = function () {
//remove sym
- this.$root.on("click", "a[data-remove]", $.proxy(function(e){
- e.preventDefault();
- this.deleteSymbol($(e.currentTarget).attr("data-remove"));
- }, this));
+ this.$root.on(
+ 'click',
+ 'a[data-remove]',
+ $.proxy(function (e) {
+ e.preventDefault();
+ this.deleteSymbol($(e.currentTarget).attr('data-remove'));
+ }, this)
+ );
//add sym
- this.$root.on("click", "button.add", $.proxy(function(e){
- this.addSymbol($("input[name='lookup']", this.$root).val());
- }, this));
+ this.$root.on(
+ 'click',
+ 'button.add',
+ $.proxy(function (e) {
+ this.addSymbol($("input[name='lookup']", this.$root).val());
+ }, this)
+ );
//expand row
- this.$root.on("click", "tr[data-row]", $.proxy(function(e){
- var $this = $(e.currentTarget);
- $this.next().toggle();
- }, this));
-
- //change container context
- this.$root.on("click", "a[data-context]", $.proxy(function(e){
- e.preventDefault();
- F2.Events.emit(
- F2.Constants.Events.APP_SYMBOL_CHANGE, {
- symbol: $(e.currentTarget).attr("data-context"),
- name: $(e.currentTarget).attr("data-context-name")
- }
- );
- }, this));
-
- //listen for this event from other apps who may send symbols
- if (this.settings.allowExternalAdd){
- F2.Events.on("F2_Examples_Watchlist_Add", $.proxy(function(data){
- var symbolAlert = $("div.symbolAlert", this.$root);
- symbolAlert = (symbolAlert.length)
- ? symbolAlert
- : this._renderSymbolAlert();
-
- $("span:first", symbolAlert).text(data.symbol + " has been added.");
-
- this.addSymbol(data.symbol);
- },this));
+ this.$root.on(
+ 'click',
+ 'tr[data-row]',
+ $.proxy(function (e) {
+ var $this = $(e.currentTarget);
+ $this.next().toggle();
+ }, this)
+ );
+
+ //change container context
+ this.$root.on(
+ 'click',
+ 'a[data-context]',
+ $.proxy(function (e) {
+ e.preventDefault();
+ F2.Events.emit(F2.Constants.Events.APP_SYMBOL_CHANGE, {
+ symbol: $(e.currentTarget).attr('data-context'),
+ name: $(e.currentTarget).attr('data-context-name')
+ });
+ }, this)
+ );
+
+ //listen for this event from other apps who may send symbols
+ if (this.settings.allowExternalAdd) {
+ F2.Events.on(
+ 'F2_Examples_Watchlist_Add',
+ $.proxy(function (data) {
+ var symbolAlert = $('div.symbolAlert', this.$root);
+ symbolAlert = symbolAlert.length
+ ? symbolAlert
+ : this._renderSymbolAlert();
+
+ $('span:first', symbolAlert).text(data.symbol + ' has been added.');
+
+ this.addSymbol(data.symbol);
+ }, this)
+ );
}
// bind save settings
- this.$root.on("click", "button.save", $.proxy(function(){
- this._saveSettings();
- },this));
-
- }
+ this.$root.on(
+ 'click',
+ 'button.save',
+ $.proxy(function () {
+ this._saveSettings();
+ }, this)
+ );
+ };
- App.prototype._saveSettings = function(){
- this.settings.allowExternalAdd = $('input[name=allowExternalAdd]', this.$settings).is(':checked');
- }
+ App.prototype._saveSettings = function () {
+ this.settings.allowExternalAdd = $(
+ 'input[name=allowExternalAdd]',
+ this.$settings
+ ).is(':checked');
+ };
- App.prototype._populateSettings = function(){
- $('input[name=allowExternalAdd]', this.$settings).attr('checked', this.settings.alltableswithkeys);
- }
+ App.prototype._populateSettings = function () {
+ $('input[name=allowExternalAdd]', this.$settings).attr(
+ 'checked',
+ this.settings.alltableswithkeys
+ );
+ };
- App.prototype.getSymbols = function(){
+ App.prototype.getSymbols = function () {
return this._retrieveStoredSymbols();
- }
+ };
- App.prototype.setSymbols = function(syms){
+ App.prototype.setSymbols = function (syms) {
this._storeSymbols(syms);
- }
+ };
- App.prototype.addSymbol = function(sym){
- if (sym){
+ App.prototype.addSymbol = function (sym) {
+ if (sym) {
var s = this.getSymbols();
s.push(sym.toUpperCase());
this.setSymbols(s);
- $("input[name='lookup']", this.$root).val("").focus();
+ $("input[name='lookup']", this.$root).val('').focus();
this.getData();
} else {
- alert("Please enter a symbol.");
- }
- }
-
- App.prototype.deleteSymbol = function(sym){
+ alert('Please enter a symbol.');
+ }
+ };
- var curr = this.getSymbols(), updated = [];
- $.each(curr,function(idx,item){
- if (sym != item){
+ App.prototype.deleteSymbol = function (sym) {
+ var curr = this.getSymbols(),
+ updated = [];
+ $.each(curr, function (idx, item) {
+ if (sym != item) {
updated.push(item);
}
});
if (!updated.length) {
- alert("You have deleted all the symbols in your watchlist. For the purposes of this example app, the default symbols have been re-added to your list.")
+ alert(
+ 'You have deleted all the symbols in your watchlist. For the purposes of this example app, the default symbols have been re-added to your list.'
+ );
updated = this.DEFAULT_SYMBOLS;
}
@@ -165,179 +194,183 @@ F2.Apps['com_openf2_examples_javascript_watchlist'] = (function (appConfig, appC
this.data = [];
this.getData();
- }
-
- App.prototype._supportsLocalStorage = function(){
- return (typeof(Storage) !== "undefined");
- }
+ };
- App.prototype.initLocalStorage = function(){
- if(this._supportsLocalStorage()){
+ App.prototype._supportsLocalStorage = function () {
+ return typeof Storage !== 'undefined';
+ };
- if (localStorage.F2_Examples_Watchlist == undefined || localStorage.F2_Examples_Watchlist == "" || !localStorage.F2_Examples_Watchlist){
- localStorage.F2_Examples_Watchlist = this.DEFAULT_SYMBOLS.join(",");
+ App.prototype.initLocalStorage = function () {
+ if (this._supportsLocalStorage()) {
+ if (
+ localStorage.F2_Examples_Watchlist == undefined ||
+ localStorage.F2_Examples_Watchlist == '' ||
+ !localStorage.F2_Examples_Watchlist
+ ) {
+ localStorage.F2_Examples_Watchlist = this.DEFAULT_SYMBOLS.join(',');
}
-
} else {
- if (!$.cookie(this.COOKIE_NAME) || $.cookie(this.COOKIE_NAME) == undefined || $.cookie(this.COOKIE_NAME) == ""){
- $.cookie(this.COOKIE_NAME, this.DEFAULT_SYMBOLS.join(","), { expires: 10 });
+ if (
+ !$.cookie(this.COOKIE_NAME) ||
+ $.cookie(this.COOKIE_NAME) == undefined ||
+ $.cookie(this.COOKIE_NAME) == ''
+ ) {
+ $.cookie(this.COOKIE_NAME, this.DEFAULT_SYMBOLS.join(','), {
+ expires: 10
+ });
}
}
+ };
- }
-
- App.prototype._storeSymbols = function(syms){
-
- if(this._supportsLocalStorage()){
- localStorage.F2_Examples_Watchlist = syms.join(",");
+ App.prototype._storeSymbols = function (syms) {
+ if (this._supportsLocalStorage()) {
+ localStorage.F2_Examples_Watchlist = syms.join(',');
} else {
- $.cookie(this.COOKIE_NAME, syms.join(","), { expires: 10 });
+ $.cookie(this.COOKIE_NAME, syms.join(','), { expires: 10 });
}
- }
+ };
- App.prototype._retrieveStoredSymbols = function(){
- if(this._supportsLocalStorage()){
- return localStorage.F2_Examples_Watchlist.split(",") || [];
- }
- else {
- return $.cookie(this.COOKIE_NAME).split(",") || [];
+ App.prototype._retrieveStoredSymbols = function () {
+ if (this._supportsLocalStorage()) {
+ return localStorage.F2_Examples_Watchlist.split(',') || [];
+ } else {
+ return $.cookie(this.COOKIE_NAME).split(',') || [];
}
- }
-
- App.prototype.drawSymbolList = function(){
+ };
+ App.prototype.drawSymbolList = function () {
var table = [];
table.push(
'',
- '',
- '',
- 'Symbol ',
- 'Last ',
- 'Change / Pct ',
- 'Volume ',
- ' ',
- ' ',
- '',
- ''
+ '',
+ '',
+ 'Symbol ',
+ 'Last ',
+ 'Change / Pct ',
+ 'Volume ',
+ ' ',
+ ' ',
+ '',
+ ''
);
- if (this.data.length < 1){
- table.push('No symbols (or the Yahoo! API failed). ')
+ if (this.data.length < 1) {
+ table.push(
+ 'No symbols (or the Yahoo! API failed). '
+ );
} else {
- $.each(this.data, $.proxy(function(idx,item){
-
- item = item || {};
-
- var quoteData = {
- name: item.Name,
- symbol: item.Symbol,
- price: AppFormat.lastPrice(item.LastTradePriceOnly),
- change: AppFormat.addColor(item.Change),
- changePct: AppFormat.addColor(item.ChangeinPercent),
- volume: AppFormat.getMagnitude(1,item.Volume,"shortcap"),
- asOf: item.LastTradeTime,
- asOfDate: item.LastTradeDate,
- bid: AppFormat.lastPrice(item.BidRealtime),
- ask: AppFormat.lastPrice(item.AskRealtime),
- cap: item.MarketCapitalization
- };
-
- table.push(this.ROW.supplant(quoteData));
-
- },this));
- }
-
- table.push(
- '',
- '
'
- );
+ $.each(
+ this.data,
+ $.proxy(function (idx, item) {
+ item = item || {};
+
+ var quoteData = {
+ name: item.Name,
+ symbol: item.Symbol,
+ price: AppFormat.lastPrice(item.LastTradePriceOnly),
+ change: AppFormat.addColor(item.Change),
+ changePct: AppFormat.addColor(item.ChangeinPercent),
+ volume: AppFormat.getMagnitude(1, item.Volume, 'shortcap'),
+ asOf: item.LastTradeTime,
+ asOfDate: item.LastTradeDate,
+ bid: AppFormat.lastPrice(item.BidRealtime),
+ ask: AppFormat.lastPrice(item.AskRealtime),
+ cap: item.MarketCapitalization
+ };
+
+ table.push(this.ROW.supplant(quoteData));
+ }, this)
+ );
+ }
- $("div.watchlist", this.root).html(table.join(''));
- }
+ table.push('', '');
- App.prototype._renderSymbolAlert = function() {
+ $('div.watchlist', this.root).html(table.join(''));
+ };
- return $([
+ App.prototype._renderSymbolAlert = function () {
+ return $(
+ [
'',
- '',
- '',
+ '',
+ '',
''
- ].join(''))
- .prependTo($("." + F2.Constants.Css.APP_CONTAINER,this.root));
+ ].join('')
+ ).prependTo($('.' + F2.Constants.Css.APP_CONTAINER, this.root));
};
- App.prototype.getData = function(){
-
- var symInput = [], oData;
+ App.prototype.getData = function () {
+ var symInput = [],
+ oData;
//no symbols? bail out.
- if (!this.getSymbols().length){
+ if (!this.getSymbols().length) {
this.drawSymbolList();
return;
}
- $.each(this.getSymbols(),function(idx,item){
- symInput.push('"'+item+'"');
+ $.each(this.getSymbols(), function (idx, item) {
+ symInput.push('"' + item + '"');
});
oData = {
- q: 'select * from yahoo.finance.quotes where symbol in ('+ symInput.join(",") +')',
+ q:
+ 'select * from yahoo.finance.quotes where symbol in (' +
+ symInput.join(',') +
+ ')',
format: 'json',
env: 'store://datatables.org/alltableswithkeys'
- }
+ };
//F2.log("data requested = ", oData);
$.ajax({
- url: "http://query.yahooapis.com/v1/public/yql",
+ url: 'http://query.yahooapis.com/v1/public/yql',
data: oData,
- dataType: "jsonp",
+ dataType: 'jsonp',
context: this
- }).done(function(jqxhr,txtStatus){
-
- //pretty bad response from yahoo when it fails.
- //jqxhr = {"query":{"count":0,"created":"2012-10-15T21:23:19Z","lang":"en-US","results":null}};
-
- //trap failed yahoo api
- if (jqxhr.query.results === null){
- jqxhr.query.results = {
- quote:{}
+ })
+ .done(function (jqxhr, txtStatus) {
+ //pretty bad response from yahoo when it fails.
+ //jqxhr = {"query":{"count":0,"created":"2012-10-15T21:23:19Z","lang":"en-US","results":null}};
+
+ //trap failed yahoo api
+ if (jqxhr.query.results === null) {
+ jqxhr.query.results = {
+ quote: {}
+ };
}
- }
- this.data = [];
-
- //yahoo's API returns an array of objects if you ask for multiple symbols
- //but a single object if you only ask for 1 symbol
- if (jqxhr.query.count !== 0){
- if (jqxhr.query.count < 2){
- this.data = [jqxhr.query.results.quote] || this.data;
- } else {
- this.data = jqxhr.query.results.quote || this.data;
- }
- }
+ this.data = [];
- this.drawSymbolList();
-
- }).fail(function(jqxhr,txtStatus){
-
- F2.log("OOPS. Yahoo! didn't work.");
- alert("Your watchlist failed to load. Refresh.");
-
- });
- }
+ //yahoo's API returns an array of objects if you ask for multiple symbols
+ //but a single object if you only ask for 1 symbol
+ if (jqxhr.query.count !== 0) {
+ if (jqxhr.query.count < 2) {
+ this.data = [jqxhr.query.results.quote] || this.data;
+ } else {
+ this.data = jqxhr.query.results.quote || this.data;
+ }
+ }
+ this.drawSymbolList();
+ })
+ .fail(function (jqxhr, txtStatus) {
+ F2.log("OOPS. Yahoo! didn't work.");
+ alert('Your watchlist failed to load. Refresh.');
+ });
+ };
/**
* Number format helpers
*/
- AppFormat = function(){
+ AppFormat = function () {
this.magnitudes = {
- shortcap : ["", "K", "M", "B", "T"]
+ shortcap: ['', 'K', 'M', 'B', 'T']
};
- }
+ };
- AppFormat.prototype.getMagnitude = function(numDigits,value,type) {
+ AppFormat.prototype.getMagnitude = function (numDigits, value, type) {
value = Math.abs(value);
var c = 0;
while (value >= 1000 && c < 4) {
@@ -346,27 +379,27 @@ F2.Apps['com_openf2_examples_javascript_watchlist'] = (function (appConfig, appC
}
value = value.toFixed(numDigits);
return value + this.magnitudes[type][c];
- }
+ };
- AppFormat.prototype.lastPrice = function(value){
+ AppFormat.prototype.lastPrice = function (value) {
value = Number(value);
value = value.toFixed(2);
- return "$" + value;
- }
-
- AppFormat.prototype.addColor = function(value){
- if (value && value.length && value.charAt(0) == "+"){
- return "" + value + "";
- } else if (value && value.length && value.charAt(0) == "-"){
- return "" + value + "";
+ return '$' + value;
+ };
+
+ AppFormat.prototype.addColor = function (value) {
+ if (value && value.length && value.charAt(0) == '+') {
+ return "" + value + '';
+ } else if (value && value.length && value.charAt(0) == '-') {
+ return "" + value + '';
} else {
return value;
}
- }
+ };
- AppFormat.prototype.comma = function(value) {
+ AppFormat.prototype.comma = function (value) {
value = String(value);
- if (value.length < 6 && value.indexOf(".") > -1) {
+ if (value.length < 6 && value.indexOf('.') > -1) {
return value;
} else {
x = value.split('.');
@@ -378,13 +411,12 @@ F2.Apps['com_openf2_examples_javascript_watchlist'] = (function (appConfig, appC
}
return x1 + x2;
}
- }
+ };
AppFormat = new AppFormat();
/**
* end number formatting helpers
*/
- return App;
-
-})();
\ No newline at end of file
+ return App;
+})();
diff --git a/examples/apps/JavaScript/Watchlist/jquery.cookie.js b/examples/apps/JavaScript/Watchlist/jquery.cookie.js
index 4bd3da19..745e1550 100644
--- a/examples/apps/JavaScript/Watchlist/jquery.cookie.js
+++ b/examples/apps/JavaScript/Watchlist/jquery.cookie.js
@@ -9,7 +9,6 @@
* http://www.opensource.org/licenses/GPL-2.0
*/
(function ($, document, undefined) {
-
var pluses = /\+/g;
function raw(s) {
@@ -20,8 +19,7 @@
return decodeURIComponent(s.replace(pluses, ' '));
}
- var config = $.cookie = function (key, value, options) {
-
+ var config = ($.cookie = function (key, value, options) {
// write
if (value !== undefined) {
options = $.extend({}, config.defaults, options);
@@ -31,18 +29,21 @@
}
if (typeof options.expires === 'number') {
- var days = options.expires, t = options.expires = new Date();
+ var days = options.expires,
+ t = (options.expires = new Date());
t.setDate(t.getDate() + days);
}
value = config.json ? JSON.stringify(value) : String(value);
return (document.cookie = [
- encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
+ encodeURIComponent(key),
+ '=',
+ config.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
- options.path ? '; path=' + options.path : '',
- options.domain ? '; domain=' + options.domain : '',
- options.secure ? '; secure' : ''
+ options.path ? '; path=' + options.path : '',
+ options.domain ? '; domain=' + options.domain : '',
+ options.secure ? '; secure' : ''
].join(''));
}
@@ -57,7 +58,7 @@
}
return null;
- };
+ });
config.defaults = {};
@@ -68,5 +69,4 @@
}
return false;
};
-
-})(jQuery, document);
\ No newline at end of file
+})(jQuery, document);
diff --git a/examples/apps/JavaScript/Watchlist/manifest.js b/examples/apps/JavaScript/Watchlist/manifest.js
index d0dedfec..00750ad4 100644
--- a/examples/apps/JavaScript/Watchlist/manifest.js
+++ b/examples/apps/JavaScript/Watchlist/manifest.js
@@ -1,45 +1,43 @@
F2_jsonpCallback_com_openf2_examples_javascript_watchlist({
- "scripts":[
- "../apps/JavaScript/Watchlist/jquery.cookie.js",
- "../apps/JavaScript/Watchlist/moment.1.7.0.min.js",
- "../apps/JavaScript/Watchlist/appclass.js"
+ scripts: [
+ '../apps/JavaScript/Watchlist/jquery.cookie.js',
+ '../apps/JavaScript/Watchlist/moment.1.7.0.min.js',
+ '../apps/JavaScript/Watchlist/appclass.js'
],
- "styles":[
- "../apps/JavaScript/Watchlist/watchlist.css"
- ],
- "apps":[
+ styles: ['../apps/JavaScript/Watchlist/watchlist.css'],
+ apps: [
{
- "html":[
+ html: [
+ '',
'',
+ '',
+ '',
''
- ].join("")
+ ].join('')
}
]
-})
\ No newline at end of file
+});
diff --git a/examples/apps/JavaScript/Watchlist/moment.1.7.0.min.js b/examples/apps/JavaScript/Watchlist/moment.1.7.0.min.js
index 4c359231..cad336e1 100644
--- a/examples/apps/JavaScript/Watchlist/moment.1.7.0.min.js
+++ b/examples/apps/JavaScript/Watchlist/moment.1.7.0.min.js
@@ -3,4 +3,709 @@
// author : Tim Wood
// license : MIT
// momentjs.com
-(function(a,b){function G(a,b,c){this._d=a,this._isUTC=!!b,this._a=a._a||null,a._a=null,this._lang=c||!1}function H(a){var b=this._data={},c=a.years||a.y||0,d=a.months||a.M||0,e=a.weeks||a.w||0,f=a.days||a.d||0,g=a.hours||a.h||0,h=a.minutes||a.m||0,i=a.seconds||a.s||0,j=a.milliseconds||a.ms||0;this._milliseconds=j+i*1e3+h*6e4+g*36e5,this._days=f+e*7,this._months=d+c*12,b.milliseconds=j%1e3,i+=I(j/1e3),b.seconds=i%60,h+=I(i/60),b.minutes=h%60,g+=I(h/60),b.hours=g%24,f+=I(g/24),f+=e*7,b.days=f%30,d+=I(f/30),b.months=d%12,c+=I(d/12),b.years=c,this._lang=!1}function I(a){return a<0?Math.ceil(a):Math.floor(a)}function J(a,b){var c=a+"";while(c.length70?1900:2e3);break;case"YYYY":c[0]=~~Math.abs(b);break;case"a":case"A":d.isPm=(b+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":c[3]=~~b;break;case"m":case"mm":c[4]=~~b;break;case"s":case"ss":c[5]=~~b;break;case"S":case"SS":case"SSS":c[6]=~~(("0."+b)*1e3);break;case"Z":case"ZZ":d.isUTC=!0,e=(b+"").match(z),e&&e[1]&&(d.tzh=~~e[1]),e&&e[2]&&(d.tzm=~~e[2]),e&&e[0]==="+"&&(d.tzh=-d.tzh,d.tzm=-d.tzm)}}function X(a,b){var c=[0,0,1,0,0,0,0],d={tzh:0,tzm:0},e=b.match(l),f,g;for(f=0;f0,j[4]=c,$.apply({},j)}function ab(a,b){c.fn[a]=function(a){var c=this._isUTC?"UTC":"";return a!=null?(this._d["set"+c+b](a),this):this._d["get"+c+b]()}}function bb(a){c.duration.fn[a]=function(){return this._data[a]}}function cb(a,b){c.duration.fn["as"+a]=function(){return+this/b}}var c,d="1.7.0",e=Math.round,f,g={},h="en",i=typeof module!="undefined"&&module.exports,j="months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),k=/^\/?Date\((\-?\d+)/i,l=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?)/g,m=/(LT|LL?L?L?)/g,n=/(^\[)|(\\)|\]$/g,o=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,p=/\d\d?/,q=/\d{1,3}/,r=/\d{3}/,s=/\d{1,4}/,t=/[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,u=/Z|[\+\-]\d\d:?\d\d/i,v=/T/i,w=/^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,x="YYYY-MM-DDTHH:mm:ssZ",y=[["HH:mm:ss.S",/T\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/T\d\d:\d\d:\d\d/],["HH:mm",/T\d\d:\d\d/],["HH",/T\d\d/]],z=/([\+\-]|\d\d)/gi,A="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),B={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},C={},D={M:"(a=t.month()+1)",MMM:'v("monthsShort",t.month())',MMMM:'v("months",t.month())',D:"(a=t.date())",DDD:"(a=new Date(t.year(),t.month(),t.date()),b=new Date(t.year(),0,1),a=~~(((a-b)/864e5)+1.5))",d:"(a=t.day())",dd:'v("weekdaysMin",t.day())',ddd:'v("weekdaysShort",t.day())',dddd:'v("weekdays",t.day())',w:"(a=new Date(t.year(),t.month(),t.date()-t.day()+5),b=new Date(a.getFullYear(),0,4),a=~~((a-b)/864e5/7+1.5))",YY:"p(t.year()%100,2)",YYYY:"p(t.year(),4)",a:"m(t.hours(),t.minutes(),!0)",A:"m(t.hours(),t.minutes(),!1)",H:"t.hours()",h:"t.hours()%12||12",m:"t.minutes()",s:"t.seconds()",S:"~~(t.milliseconds()/100)",SS:"p(~~(t.milliseconds()/10),2)",SSS:"p(t.milliseconds(),3)",Z:'((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(a/60),2)+":"+p(~~a%60,2)',ZZ:'((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(10*a/6),4)'},E="DDD w M D d".split(" "),F="M D H h m s w".split(" ");while(E.length)f=E.pop(),D[f+"o"]=D[f]+"+o(a)";while(F.length)f=F.pop(),D[f+f]="p("+D[f]+",2)";D.DDDD="p("+D.DDD+",3)",c=function(d,e){if(d===null||d==="")return null;var f,g;return c.isMoment(d)?new G(new a(+d._d),d._isUTC,d._lang):(e?L(e)?f=Y(d,e):f=X(d,e):(g=k.exec(d),f=d===b?new a:g?new a(+g[1]):d instanceof a?d:L(d)?N(d):typeof d=="string"?Z(d):new a(d)),new G(f))},c.utc=function(a,b){return L(a)?new G(N(a,!0),!0):(typeof a=="string"&&!u.exec(a)&&(a+=" +0000",b&&(b+=" Z")),c(a,b).utc())},c.unix=function(a){return c(a*1e3)},c.duration=function(a,b){var d=c.isDuration(a),e=typeof a=="number",f=d?a._data:e?{}:a,g;return e&&(b?f[b]=a:f.milliseconds=a),g=new H(f),d&&(g._lang=a._lang),g},c.humanizeDuration=function(a,b,d){return c.duration(a,b===!0?null:b).humanize(b===!0?!0:d)},c.version=d,c.defaultFormat=x,c.lang=function(a,b){var d;if(!a)return h;(b||!g[a])&&O(a,b);if(g[a]){for(d=0;d11?c?"pm":"PM":c?"am":"AM"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),c.fn=G.prototype={clone:function(){return c(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this._d.toString()},toDate:function(){return this._d},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds(),!!this._isUTC]},isValid:function(){return this._a?!M(this._a,(this._a[7]?c.utc(this):this).toArray()):!isNaN(this._d.getTime())},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(a){return U(this,a?a:c.defaultFormat)},add:function(a,b){var d=b?c.duration(+b,a):c.duration(a);return K(this,d,1),this},subtract:function(a,b){var d=b?c.duration(+b,a):c.duration(a);return K(this,d,-1),this},diff:function(a,b,d){var f=this._isUTC?c(a).utc():c(a).local(),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return b==="months"?l=i*12+j+k/30:b==="years"?l=i+(j+k/30)/12:l=b==="seconds"?h/1e3:b==="minutes"?h/6e4:b==="hours"?h/36e5:b==="days"?h/864e5:b==="weeks"?h/6048e5:h,d?l:e(l)},from:function(a,b){return c.duration(this.diff(a)).lang(this._lang).humanize(!b)},fromNow:function(a){return this.from(c(),a)},calendar:function(){var a=this.diff(c().sod(),"days",!0),b=this.lang().calendar,d=b.sameElse,e=a<-6?d:a<-1?b.lastWeek:a<0?b.lastDay:a<1?b.sameDay:a<2?b.nextDay:a<7?b.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone() 70 ? 1900 : 2e3));
+ break;
+ case 'YYYY':
+ c[0] = ~~Math.abs(b);
+ break;
+ case 'a':
+ case 'A':
+ d.isPm = (b + '').toLowerCase() === 'pm';
+ break;
+ case 'H':
+ case 'HH':
+ case 'h':
+ case 'hh':
+ c[3] = ~~b;
+ break;
+ case 'm':
+ case 'mm':
+ c[4] = ~~b;
+ break;
+ case 's':
+ case 'ss':
+ c[5] = ~~b;
+ break;
+ case 'S':
+ case 'SS':
+ case 'SSS':
+ c[6] = ~~(('0.' + b) * 1e3);
+ break;
+ case 'Z':
+ case 'ZZ':
+ (d.isUTC = !0),
+ (e = (b + '').match(z)),
+ e && e[1] && (d.tzh = ~~e[1]),
+ e && e[2] && (d.tzm = ~~e[2]),
+ e && e[0] === '+' && ((d.tzh = -d.tzh), (d.tzm = -d.tzm));
+ }
+ }
+ function X(a, b) {
+ var c = [0, 0, 1, 0, 0, 0, 0],
+ d = { tzh: 0, tzm: 0 },
+ e = b.match(l),
+ f,
+ g;
+ for (f = 0; f < e.length; f++)
+ (g = (V(e[f]).exec(a) || [])[0]),
+ (a = a.replace(V(e[f]), '')),
+ W(e[f], g, c, d);
+ return (
+ d.isPm && c[3] < 12 && (c[3] += 12),
+ d.isPm === !1 && c[3] === 12 && (c[3] = 0),
+ (c[3] += d.tzh),
+ (c[4] += d.tzm),
+ N(c, d.isUTC)
+ );
+ }
+ function Y(a, b) {
+ var c,
+ d = a.match(o) || [],
+ e,
+ f = 99,
+ g,
+ h,
+ i;
+ for (g = 0; g < b.length; g++)
+ (h = X(a, b[g])),
+ (e = U(new G(h), b[g]).match(o) || []),
+ (i = M(d, e)),
+ i < f && ((f = i), (c = h));
+ return c;
+ }
+ function Z(b) {
+ var c = 'YYYY-MM-DDT',
+ d;
+ if (w.exec(b)) {
+ for (d = 0; d < 4; d++)
+ if (y[d][1].exec(b)) {
+ c += y[d][0];
+ break;
+ }
+ return u.exec(b) ? X(b, c + ' Z') : X(b, c);
+ }
+ return new a(b);
+ }
+ function $(a, b, c, d, e) {
+ var f = e.relativeTime[a];
+ return typeof f == 'function'
+ ? f(b || 1, !!c, a, d)
+ : f.replace(/%d/i, b || 1);
+ }
+ function _(a, b, c) {
+ var d = e(Math.abs(a) / 1e3),
+ f = e(d / 60),
+ g = e(f / 60),
+ h = e(g / 24),
+ i = e(h / 365),
+ j = (d < 45 && ['s', d]) ||
+ (f === 1 && ['m']) ||
+ (f < 45 && ['mm', f]) ||
+ (g === 1 && ['h']) ||
+ (g < 22 && ['hh', g]) ||
+ (h === 1 && ['d']) ||
+ (h <= 25 && ['dd', h]) ||
+ (h <= 45 && ['M']) ||
+ (h < 345 && ['MM', e(h / 30)]) ||
+ (i === 1 && ['y']) || ['yy', i];
+ return (j[2] = b), (j[3] = a > 0), (j[4] = c), $.apply({}, j);
+ }
+ function ab(a, b) {
+ c.fn[a] = function (a) {
+ var c = this._isUTC ? 'UTC' : '';
+ return a != null
+ ? (this._d['set' + c + b](a), this)
+ : this._d['get' + c + b]();
+ };
+ }
+ function bb(a) {
+ c.duration.fn[a] = function () {
+ return this._data[a];
+ };
+ }
+ function cb(a, b) {
+ c.duration.fn['as' + a] = function () {
+ return +this / b;
+ };
+ }
+ var c,
+ d = '1.7.0',
+ e = Math.round,
+ f,
+ g = {},
+ h = 'en',
+ i = typeof module != 'undefined' && module.exports,
+ j =
+ 'months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem'.split(
+ '|'
+ ),
+ k = /^\/?Date\((\-?\d+)/i,
+ l =
+ /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?)/g,
+ m = /(LT|LL?L?L?)/g,
+ n = /(^\[)|(\\)|\]$/g,
+ o = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,
+ p = /\d\d?/,
+ q = /\d{1,3}/,
+ r = /\d{3}/,
+ s = /\d{1,4}/,
+ t = /[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,
+ u = /Z|[\+\-]\d\d:?\d\d/i,
+ v = /T/i,
+ w =
+ /^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,
+ x = 'YYYY-MM-DDTHH:mm:ssZ',
+ y = [
+ ['HH:mm:ss.S', /T\d\d:\d\d:\d\d\.\d{1,3}/],
+ ['HH:mm:ss', /T\d\d:\d\d:\d\d/],
+ ['HH:mm', /T\d\d:\d\d/],
+ ['HH', /T\d\d/]
+ ],
+ z = /([\+\-]|\d\d)/gi,
+ A = 'Month|Date|Hours|Minutes|Seconds|Milliseconds'.split('|'),
+ B = {
+ Milliseconds: 1,
+ Seconds: 1e3,
+ Minutes: 6e4,
+ Hours: 36e5,
+ Days: 864e5,
+ Months: 2592e6,
+ Years: 31536e6
+ },
+ C = {},
+ D = {
+ M: '(a=t.month()+1)',
+ MMM: 'v("monthsShort",t.month())',
+ MMMM: 'v("months",t.month())',
+ D: '(a=t.date())',
+ DDD: '(a=new Date(t.year(),t.month(),t.date()),b=new Date(t.year(),0,1),a=~~(((a-b)/864e5)+1.5))',
+ d: '(a=t.day())',
+ dd: 'v("weekdaysMin",t.day())',
+ ddd: 'v("weekdaysShort",t.day())',
+ dddd: 'v("weekdays",t.day())',
+ w: '(a=new Date(t.year(),t.month(),t.date()-t.day()+5),b=new Date(a.getFullYear(),0,4),a=~~((a-b)/864e5/7+1.5))',
+ YY: 'p(t.year()%100,2)',
+ YYYY: 'p(t.year(),4)',
+ a: 'm(t.hours(),t.minutes(),!0)',
+ A: 'm(t.hours(),t.minutes(),!1)',
+ H: 't.hours()',
+ h: 't.hours()%12||12',
+ m: 't.minutes()',
+ s: 't.seconds()',
+ S: '~~(t.milliseconds()/100)',
+ SS: 'p(~~(t.milliseconds()/10),2)',
+ SSS: 'p(t.milliseconds(),3)',
+ Z: '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(a/60),2)+":"+p(~~a%60,2)',
+ ZZ: '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(10*a/6),4)'
+ },
+ E = 'DDD w M D d'.split(' '),
+ F = 'M D H h m s w'.split(' ');
+ while (E.length) (f = E.pop()), (D[f + 'o'] = D[f] + '+o(a)');
+ while (F.length) (f = F.pop()), (D[f + f] = 'p(' + D[f] + ',2)');
+ (D.DDDD = 'p(' + D.DDD + ',3)'),
+ (c = function (d, e) {
+ if (d === null || d === '') return null;
+ var f, g;
+ return c.isMoment(d)
+ ? new G(new a(+d._d), d._isUTC, d._lang)
+ : (e
+ ? L(e)
+ ? (f = Y(d, e))
+ : (f = X(d, e))
+ : ((g = k.exec(d)),
+ (f =
+ d === b
+ ? new a()
+ : g
+ ? new a(+g[1])
+ : d instanceof a
+ ? d
+ : L(d)
+ ? N(d)
+ : typeof d == 'string'
+ ? Z(d)
+ : new a(d))),
+ new G(f));
+ }),
+ (c.utc = function (a, b) {
+ return L(a)
+ ? new G(N(a, !0), !0)
+ : (typeof a == 'string' &&
+ !u.exec(a) &&
+ ((a += ' +0000'), b && (b += ' Z')),
+ c(a, b).utc());
+ }),
+ (c.unix = function (a) {
+ return c(a * 1e3);
+ }),
+ (c.duration = function (a, b) {
+ var d = c.isDuration(a),
+ e = typeof a == 'number',
+ f = d ? a._data : e ? {} : a,
+ g;
+ return (
+ e && (b ? (f[b] = a) : (f.milliseconds = a)),
+ (g = new H(f)),
+ d && (g._lang = a._lang),
+ g
+ );
+ }),
+ (c.humanizeDuration = function (a, b, d) {
+ return c.duration(a, b === !0 ? null : b).humanize(b === !0 ? !0 : d);
+ }),
+ (c.version = d),
+ (c.defaultFormat = x),
+ (c.lang = function (a, b) {
+ var d;
+ if (!a) return h;
+ (b || !g[a]) && O(a, b);
+ if (g[a]) {
+ for (d = 0; d < j.length; d++) c[j[d]] = g[a][j[d]];
+ (c.monthsParse = g[a].monthsParse), (h = a);
+ }
+ }),
+ (c.langData = P),
+ (c.isMoment = function (a) {
+ return a instanceof G;
+ }),
+ (c.isDuration = function (a) {
+ return a instanceof H;
+ }),
+ c.lang('en', {
+ months:
+ 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
+ '_'
+ ),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdays:
+ 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ longDateFormat: {
+ LT: 'h:mm A',
+ L: 'MM/DD/YYYY',
+ LL: 'MMMM D YYYY',
+ LLL: 'MMMM D YYYY LT',
+ LLLL: 'dddd, MMMM D YYYY LT'
+ },
+ meridiem: function (a, b, c) {
+ return a > 11 ? (c ? 'pm' : 'PM') : c ? 'am' : 'AM';
+ },
+ calendar: {
+ sameDay: '[Today at] LT',
+ nextDay: '[Tomorrow at] LT',
+ nextWeek: 'dddd [at] LT',
+ lastDay: '[Yesterday at] LT',
+ lastWeek: '[last] dddd [at] LT',
+ sameElse: 'L'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ },
+ ordinal: function (a) {
+ var b = a % 10;
+ return ~~((a % 100) / 10) === 1
+ ? 'th'
+ : b === 1
+ ? 'st'
+ : b === 2
+ ? 'nd'
+ : b === 3
+ ? 'rd'
+ : 'th';
+ }
+ }),
+ (c.fn = G.prototype =
+ {
+ clone: function () {
+ return c(this);
+ },
+ valueOf: function () {
+ return +this._d;
+ },
+ unix: function () {
+ return Math.floor(+this._d / 1e3);
+ },
+ toString: function () {
+ return this._d.toString();
+ },
+ toDate: function () {
+ return this._d;
+ },
+ toArray: function () {
+ var a = this;
+ return [
+ a.year(),
+ a.month(),
+ a.date(),
+ a.hours(),
+ a.minutes(),
+ a.seconds(),
+ a.milliseconds(),
+ !!this._isUTC
+ ];
+ },
+ isValid: function () {
+ return this._a
+ ? !M(this._a, (this._a[7] ? c.utc(this) : this).toArray())
+ : !isNaN(this._d.getTime());
+ },
+ utc: function () {
+ return (this._isUTC = !0), this;
+ },
+ local: function () {
+ return (this._isUTC = !1), this;
+ },
+ format: function (a) {
+ return U(this, a ? a : c.defaultFormat);
+ },
+ add: function (a, b) {
+ var d = b ? c.duration(+b, a) : c.duration(a);
+ return K(this, d, 1), this;
+ },
+ subtract: function (a, b) {
+ var d = b ? c.duration(+b, a) : c.duration(a);
+ return K(this, d, -1), this;
+ },
+ diff: function (a, b, d) {
+ var f = this._isUTC ? c(a).utc() : c(a).local(),
+ g = (this.zone() - f.zone()) * 6e4,
+ h = this._d - f._d - g,
+ i = this.year() - f.year(),
+ j = this.month() - f.month(),
+ k = this.date() - f.date(),
+ l;
+ return (
+ b === 'months'
+ ? (l = i * 12 + j + k / 30)
+ : b === 'years'
+ ? (l = i + (j + k / 30) / 12)
+ : (l =
+ b === 'seconds'
+ ? h / 1e3
+ : b === 'minutes'
+ ? h / 6e4
+ : b === 'hours'
+ ? h / 36e5
+ : b === 'days'
+ ? h / 864e5
+ : b === 'weeks'
+ ? h / 6048e5
+ : h),
+ d ? l : e(l)
+ );
+ },
+ from: function (a, b) {
+ return c.duration(this.diff(a)).lang(this._lang).humanize(!b);
+ },
+ fromNow: function (a) {
+ return this.from(c(), a);
+ },
+ calendar: function () {
+ var a = this.diff(c().sod(), 'days', !0),
+ b = this.lang().calendar,
+ d = b.sameElse,
+ e =
+ a < -6
+ ? d
+ : a < -1
+ ? b.lastWeek
+ : a < 0
+ ? b.lastDay
+ : a < 1
+ ? b.sameDay
+ : a < 2
+ ? b.nextDay
+ : a < 7
+ ? b.nextWeek
+ : d;
+ return this.format(typeof e == 'function' ? e.apply(this) : e);
+ },
+ isLeapYear: function () {
+ var a = this.year();
+ return (a % 4 === 0 && a % 100 !== 0) || a % 400 === 0;
+ },
+ isDST: function () {
+ return (
+ this.zone() < c([this.year()]).zone() ||
+ this.zone() < c([this.year(), 5]).zone()
+ );
+ },
+ day: function (a) {
+ var b = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+ return a == null ? b : this.add({ d: a - b });
+ },
+ startOf: function (a) {
+ switch (a.replace(/s$/, '')) {
+ case 'year':
+ this.month(0);
+ case 'month':
+ this.date(1);
+ case 'day':
+ this.hours(0);
+ case 'hour':
+ this.minutes(0);
+ case 'minute':
+ this.seconds(0);
+ case 'second':
+ this.milliseconds(0);
+ }
+ return this;
+ },
+ endOf: function (a) {
+ return this.startOf(a)
+ .add(a.replace(/s?$/, 's'), 1)
+ .subtract('ms', 1);
+ },
+ sod: function () {
+ return this.clone().startOf('day');
+ },
+ eod: function () {
+ return this.clone().endOf('day');
+ },
+ zone: function () {
+ return this._isUTC ? 0 : this._d.getTimezoneOffset();
+ },
+ daysInMonth: function () {
+ return c.utc([this.year(), this.month() + 1, 0]).date();
+ },
+ lang: function (a) {
+ return a === b ? P(this) : ((this._lang = a), this);
+ }
+ });
+ for (f = 0; f < A.length; f++) ab(A[f].toLowerCase(), A[f]);
+ ab('year', 'FullYear'),
+ (c.duration.fn = H.prototype =
+ {
+ weeks: function () {
+ return I(this.days() / 7);
+ },
+ valueOf: function () {
+ return (
+ this._milliseconds + this._days * 864e5 + this._months * 2592e6
+ );
+ },
+ humanize: function (a) {
+ var b = +this,
+ c = this.lang().relativeTime,
+ d = _(b, !a, this.lang());
+ return a && (d = (b <= 0 ? c.past : c.future).replace(/%s/i, d)), d;
+ },
+ lang: c.fn.lang
+ });
+ for (f in B) B.hasOwnProperty(f) && (cb(f, B[f]), bb(f.toLowerCase()));
+ cb('Weeks', 6048e5),
+ i && (module.exports = c),
+ typeof ender == 'undefined' && (this.moment = c),
+ typeof define == 'function' &&
+ define.amd &&
+ define('moment', [], function () {
+ return c;
+ });
+}.call(this, Date));
diff --git a/examples/apps/JavaScript/Watchlist/watchlist.css b/examples/apps/JavaScript/Watchlist/watchlist.css
index ed8da78f..02c780a5 100644
--- a/examples/apps/JavaScript/Watchlist/watchlist.css
+++ b/examples/apps/JavaScript/Watchlist/watchlist.css
@@ -9,11 +9,11 @@
}
.com_openf2_examples_javascript_watchlist .pos {
- color:green;
+ color: green;
}
.com_openf2_examples_javascript_watchlist .neg {
- color:red;
+ color: red;
}
.com_openf2_examples_javascript_watchlist table table {
@@ -26,4 +26,4 @@
.com_openf2_examples_javascript_watchlist table table tr {
cursor: text;
-}
\ No newline at end of file
+}
diff --git a/examples/apps/PHP/F2wits/app.css b/examples/apps/PHP/F2wits/app.css
index 45bfa5a6..e0137340 100644
--- a/examples/apps/PHP/F2wits/app.css
+++ b/examples/apps/PHP/F2wits/app.css
@@ -12,6 +12,6 @@
.com_openf2_examples_php_f2wits time {
display: block;
- font-size:12px;
+ font-size: 12px;
color: #8f8f8f;
-}
\ No newline at end of file
+}
diff --git a/examples/apps/PHP/F2wits/app.js b/examples/apps/PHP/F2wits/app.js
index 30250a63..31c5b655 100644
--- a/examples/apps/PHP/F2wits/app.js
+++ b/examples/apps/PHP/F2wits/app.js
@@ -1,125 +1,152 @@
-F2.Apps["com_openf2_examples_php_f2wits"] = (function() {
-
- var App_Class = function(appConfig, appContent, root) {
+F2.Apps['com_openf2_examples_php_f2wits'] = (function () {
+ var App_Class = function (appConfig, appContent, root) {
// constructor
this.appConfig = appConfig;
this.appContent = appContent;
this.$root = $(root); //if you're using jQuery.
this.$app = $("[data-f2-view='home']", this.$root);
- this.symbol = "MSFT";//default to MSFT
+ this.symbol = 'MSFT'; //default to MSFT
this.setupEvents();
- }
+ };
- App_Class.prototype.init = function() {
+ App_Class.prototype.init = function () {
this.getTwits();
- }
-
- App_Class.prototype.setupEvents = function(){
+ };
+ App_Class.prototype.setupEvents = function () {
F2.Events.on(
- F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,$.proxy(function(data){
+ F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
+ $.proxy(function (data) {
this.symbol = data.symbol;
this.init();
- },this)
+ }, this)
);
- }
+ };
- App_Class.prototype.getTwits = function(){
+ App_Class.prototype.getTwits = function () {
$.ajax({
- url: "../apps/PHP/F2wits/stocktwits.php",
+ url: '../apps/PHP/F2wits/stocktwits.php',
data: {
symbol: this.symbol
},
- type:"GET",
- dataType: "JSON",
+ type: 'GET',
+ dataType: 'JSON',
context: this
- }).done(function(jqxhr,txtStatus){
- //F2.log(jqxhr)
- this.data = jqxhr;
- this.draw();
- }).fail(function(jqxhr,txtStatus){
- console.error("F2wits failed to load StockTwits data.", jqxhr, txtStatus);
- this.$app.html("An error occurred loading StockTwits data for " +this.symbol+ ".
");
- });
- }
-
- App_Class.prototype.draw = function(){
-
+ })
+ .done(function (jqxhr, txtStatus) {
+ //F2.log(jqxhr)
+ this.data = jqxhr;
+ this.draw();
+ })
+ .fail(function (jqxhr, txtStatus) {
+ console.error(
+ 'F2wits failed to load StockTwits data.',
+ jqxhr,
+ txtStatus
+ );
+ this.$app.html(
+ 'An error occurred loading StockTwits data for ' +
+ this.symbol +
+ '.
'
+ );
+ });
+ };
+ App_Class.prototype.draw = function () {
var html = [];
html.push('');
- $.each(this.data.messages,$.proxy(function(idx, item){
- //body, created_at, source, symbols, user
-
- if (idx > 4) { return true; }//only show 5
-
- var body = item.body,
- created_at = moment(new Date(item.created_at)).startOf('hour').fromNow(),
- id = item.id,
- source = item.source,
- symbols = item.symbols,
- user = item.user,
- symList = [];
-
- body = this.replaceURLWithHTMLLinks(body);
- body = this.replaceDollarSigns(body);
-
- //build list of symbols
- $.each(symbols,function(idx,item){
- symList.push(
- '',
+ $.each(
+ this.data.messages,
+ $.proxy(function (idx, item) {
+ //body, created_at, source, symbols, user
+
+ if (idx > 4) {
+ return true;
+ } //only show 5
+
+ var body = item.body,
+ created_at = moment(new Date(item.created_at))
+ .startOf('hour')
+ .fromNow(),
+ id = item.id,
+ source = item.source,
+ symbols = item.symbols,
+ user = item.user,
+ symList = [];
+
+ body = this.replaceURLWithHTMLLinks(body);
+ body = this.replaceDollarSigns(body);
+
+ //build list of symbols
+ $.each(symbols, function (idx, item) {
+ symList.push(
+ ' ',
//'$',item.symbol,'',
//' | ',
- '',item.symbol,'',
- ' '
- );
- });
-
- html.push(
- '',
- '
',
+ '',
+ item.symbol,
+ '',
+ ''
+ );
+ });
+
+ html.push(
+ ' ',
+ '
',
'',
- body,
- '',
- '',
- '',
+ body,
+ '',
+ '',
+ '',
' ',
- ' '
- );
- },this));
+ ''
+ );
+ }, this)
+ );
html.push('
');
this.$app.html(html.join(''));
//assign event to change container focus
- $("a.focus",this.$app).click(function(){
- F2.Events.emit(
- F2.Constants.Events.APP_SYMBOL_CHANGE,
- {
- symbol: $(this).attr("data-symbol"),
- name: $(this).attr("data-symbol")
- }
- );
+ $('a.focus', this.$app).click(function () {
+ F2.Events.emit(F2.Constants.Events.APP_SYMBOL_CHANGE, {
+ symbol: $(this).attr('data-symbol'),
+ name: $(this).attr('data-symbol')
+ });
});
- }
+ };
//http://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links
- App_Class.prototype.replaceURLWithHTMLLinks = function(text){
- var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
- return text.replace(exp,"$1");
- }
-
- App_Class.prototype.replaceDollarSigns = function(text){
- var exp = /\$([A-Za-z0-9_]+)/ig;
+ App_Class.prototype.replaceURLWithHTMLLinks = function (text) {
+ var exp =
+ /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;
+ return text.replace(exp, "$1");
+ };
+
+ App_Class.prototype.replaceDollarSigns = function (text) {
+ var exp = /\$([A-Za-z0-9_]+)/gi;
//use this to link to StockTwits.com
//return text.replace(exp,"$$$1");
//use this to apply focus to container
- return text.replace(exp,"$$$1");
- }
+ return text.replace(
+ exp,
+ "$$$1"
+ );
+ };
return App_Class;
-})();
\ No newline at end of file
+})();
diff --git a/examples/apps/PHP/F2wits/manifest.js b/examples/apps/PHP/F2wits/manifest.js
index a3df8602..5ed497f1 100644
--- a/examples/apps/PHP/F2wits/manifest.js
+++ b/examples/apps/PHP/F2wits/manifest.js
@@ -1,14 +1,12 @@
F2_jsonpCallback_com_openf2_examples_php_f2wits({
- "scripts":[
- "../apps/PHP/F2wits/moment.1.7.0.min.js",
- "../apps/PHP/F2wits/app.js"
- ],
- "styles":[
- "../apps/PHP/F2wits/app.css"
- ],
- "apps":[{
- "html":[
- ''
- ].join("")
- }]
-})
\ No newline at end of file
+ scripts: [
+ '../apps/PHP/F2wits/moment.1.7.0.min.js',
+ '../apps/PHP/F2wits/app.js'
+ ],
+ styles: ['../apps/PHP/F2wits/app.css'],
+ apps: [
+ {
+ html: [''].join('')
+ }
+ ]
+});
diff --git a/examples/apps/PHP/F2wits/moment.1.7.0.min.js b/examples/apps/PHP/F2wits/moment.1.7.0.min.js
index 4c359231..cad336e1 100644
--- a/examples/apps/PHP/F2wits/moment.1.7.0.min.js
+++ b/examples/apps/PHP/F2wits/moment.1.7.0.min.js
@@ -3,4 +3,709 @@
// author : Tim Wood
// license : MIT
// momentjs.com
-(function(a,b){function G(a,b,c){this._d=a,this._isUTC=!!b,this._a=a._a||null,a._a=null,this._lang=c||!1}function H(a){var b=this._data={},c=a.years||a.y||0,d=a.months||a.M||0,e=a.weeks||a.w||0,f=a.days||a.d||0,g=a.hours||a.h||0,h=a.minutes||a.m||0,i=a.seconds||a.s||0,j=a.milliseconds||a.ms||0;this._milliseconds=j+i*1e3+h*6e4+g*36e5,this._days=f+e*7,this._months=d+c*12,b.milliseconds=j%1e3,i+=I(j/1e3),b.seconds=i%60,h+=I(i/60),b.minutes=h%60,g+=I(h/60),b.hours=g%24,f+=I(g/24),f+=e*7,b.days=f%30,d+=I(f/30),b.months=d%12,c+=I(d/12),b.years=c,this._lang=!1}function I(a){return a<0?Math.ceil(a):Math.floor(a)}function J(a,b){var c=a+"";while(c.length70?1900:2e3);break;case"YYYY":c[0]=~~Math.abs(b);break;case"a":case"A":d.isPm=(b+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":c[3]=~~b;break;case"m":case"mm":c[4]=~~b;break;case"s":case"ss":c[5]=~~b;break;case"S":case"SS":case"SSS":c[6]=~~(("0."+b)*1e3);break;case"Z":case"ZZ":d.isUTC=!0,e=(b+"").match(z),e&&e[1]&&(d.tzh=~~e[1]),e&&e[2]&&(d.tzm=~~e[2]),e&&e[0]==="+"&&(d.tzh=-d.tzh,d.tzm=-d.tzm)}}function X(a,b){var c=[0,0,1,0,0,0,0],d={tzh:0,tzm:0},e=b.match(l),f,g;for(f=0;f0,j[4]=c,$.apply({},j)}function ab(a,b){c.fn[a]=function(a){var c=this._isUTC?"UTC":"";return a!=null?(this._d["set"+c+b](a),this):this._d["get"+c+b]()}}function bb(a){c.duration.fn[a]=function(){return this._data[a]}}function cb(a,b){c.duration.fn["as"+a]=function(){return+this/b}}var c,d="1.7.0",e=Math.round,f,g={},h="en",i=typeof module!="undefined"&&module.exports,j="months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),k=/^\/?Date\((\-?\d+)/i,l=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?)/g,m=/(LT|LL?L?L?)/g,n=/(^\[)|(\\)|\]$/g,o=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,p=/\d\d?/,q=/\d{1,3}/,r=/\d{3}/,s=/\d{1,4}/,t=/[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,u=/Z|[\+\-]\d\d:?\d\d/i,v=/T/i,w=/^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,x="YYYY-MM-DDTHH:mm:ssZ",y=[["HH:mm:ss.S",/T\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/T\d\d:\d\d:\d\d/],["HH:mm",/T\d\d:\d\d/],["HH",/T\d\d/]],z=/([\+\-]|\d\d)/gi,A="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),B={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},C={},D={M:"(a=t.month()+1)",MMM:'v("monthsShort",t.month())',MMMM:'v("months",t.month())',D:"(a=t.date())",DDD:"(a=new Date(t.year(),t.month(),t.date()),b=new Date(t.year(),0,1),a=~~(((a-b)/864e5)+1.5))",d:"(a=t.day())",dd:'v("weekdaysMin",t.day())',ddd:'v("weekdaysShort",t.day())',dddd:'v("weekdays",t.day())',w:"(a=new Date(t.year(),t.month(),t.date()-t.day()+5),b=new Date(a.getFullYear(),0,4),a=~~((a-b)/864e5/7+1.5))",YY:"p(t.year()%100,2)",YYYY:"p(t.year(),4)",a:"m(t.hours(),t.minutes(),!0)",A:"m(t.hours(),t.minutes(),!1)",H:"t.hours()",h:"t.hours()%12||12",m:"t.minutes()",s:"t.seconds()",S:"~~(t.milliseconds()/100)",SS:"p(~~(t.milliseconds()/10),2)",SSS:"p(t.milliseconds(),3)",Z:'((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(a/60),2)+":"+p(~~a%60,2)',ZZ:'((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(10*a/6),4)'},E="DDD w M D d".split(" "),F="M D H h m s w".split(" ");while(E.length)f=E.pop(),D[f+"o"]=D[f]+"+o(a)";while(F.length)f=F.pop(),D[f+f]="p("+D[f]+",2)";D.DDDD="p("+D.DDD+",3)",c=function(d,e){if(d===null||d==="")return null;var f,g;return c.isMoment(d)?new G(new a(+d._d),d._isUTC,d._lang):(e?L(e)?f=Y(d,e):f=X(d,e):(g=k.exec(d),f=d===b?new a:g?new a(+g[1]):d instanceof a?d:L(d)?N(d):typeof d=="string"?Z(d):new a(d)),new G(f))},c.utc=function(a,b){return L(a)?new G(N(a,!0),!0):(typeof a=="string"&&!u.exec(a)&&(a+=" +0000",b&&(b+=" Z")),c(a,b).utc())},c.unix=function(a){return c(a*1e3)},c.duration=function(a,b){var d=c.isDuration(a),e=typeof a=="number",f=d?a._data:e?{}:a,g;return e&&(b?f[b]=a:f.milliseconds=a),g=new H(f),d&&(g._lang=a._lang),g},c.humanizeDuration=function(a,b,d){return c.duration(a,b===!0?null:b).humanize(b===!0?!0:d)},c.version=d,c.defaultFormat=x,c.lang=function(a,b){var d;if(!a)return h;(b||!g[a])&&O(a,b);if(g[a]){for(d=0;d11?c?"pm":"PM":c?"am":"AM"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),c.fn=G.prototype={clone:function(){return c(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this._d.toString()},toDate:function(){return this._d},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds(),!!this._isUTC]},isValid:function(){return this._a?!M(this._a,(this._a[7]?c.utc(this):this).toArray()):!isNaN(this._d.getTime())},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(a){return U(this,a?a:c.defaultFormat)},add:function(a,b){var d=b?c.duration(+b,a):c.duration(a);return K(this,d,1),this},subtract:function(a,b){var d=b?c.duration(+b,a):c.duration(a);return K(this,d,-1),this},diff:function(a,b,d){var f=this._isUTC?c(a).utc():c(a).local(),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return b==="months"?l=i*12+j+k/30:b==="years"?l=i+(j+k/30)/12:l=b==="seconds"?h/1e3:b==="minutes"?h/6e4:b==="hours"?h/36e5:b==="days"?h/864e5:b==="weeks"?h/6048e5:h,d?l:e(l)},from:function(a,b){return c.duration(this.diff(a)).lang(this._lang).humanize(!b)},fromNow:function(a){return this.from(c(),a)},calendar:function(){var a=this.diff(c().sod(),"days",!0),b=this.lang().calendar,d=b.sameElse,e=a<-6?d:a<-1?b.lastWeek:a<0?b.lastDay:a<1?b.sameDay:a<2?b.nextDay:a<7?b.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone() 70 ? 1900 : 2e3));
+ break;
+ case 'YYYY':
+ c[0] = ~~Math.abs(b);
+ break;
+ case 'a':
+ case 'A':
+ d.isPm = (b + '').toLowerCase() === 'pm';
+ break;
+ case 'H':
+ case 'HH':
+ case 'h':
+ case 'hh':
+ c[3] = ~~b;
+ break;
+ case 'm':
+ case 'mm':
+ c[4] = ~~b;
+ break;
+ case 's':
+ case 'ss':
+ c[5] = ~~b;
+ break;
+ case 'S':
+ case 'SS':
+ case 'SSS':
+ c[6] = ~~(('0.' + b) * 1e3);
+ break;
+ case 'Z':
+ case 'ZZ':
+ (d.isUTC = !0),
+ (e = (b + '').match(z)),
+ e && e[1] && (d.tzh = ~~e[1]),
+ e && e[2] && (d.tzm = ~~e[2]),
+ e && e[0] === '+' && ((d.tzh = -d.tzh), (d.tzm = -d.tzm));
+ }
+ }
+ function X(a, b) {
+ var c = [0, 0, 1, 0, 0, 0, 0],
+ d = { tzh: 0, tzm: 0 },
+ e = b.match(l),
+ f,
+ g;
+ for (f = 0; f < e.length; f++)
+ (g = (V(e[f]).exec(a) || [])[0]),
+ (a = a.replace(V(e[f]), '')),
+ W(e[f], g, c, d);
+ return (
+ d.isPm && c[3] < 12 && (c[3] += 12),
+ d.isPm === !1 && c[3] === 12 && (c[3] = 0),
+ (c[3] += d.tzh),
+ (c[4] += d.tzm),
+ N(c, d.isUTC)
+ );
+ }
+ function Y(a, b) {
+ var c,
+ d = a.match(o) || [],
+ e,
+ f = 99,
+ g,
+ h,
+ i;
+ for (g = 0; g < b.length; g++)
+ (h = X(a, b[g])),
+ (e = U(new G(h), b[g]).match(o) || []),
+ (i = M(d, e)),
+ i < f && ((f = i), (c = h));
+ return c;
+ }
+ function Z(b) {
+ var c = 'YYYY-MM-DDT',
+ d;
+ if (w.exec(b)) {
+ for (d = 0; d < 4; d++)
+ if (y[d][1].exec(b)) {
+ c += y[d][0];
+ break;
+ }
+ return u.exec(b) ? X(b, c + ' Z') : X(b, c);
+ }
+ return new a(b);
+ }
+ function $(a, b, c, d, e) {
+ var f = e.relativeTime[a];
+ return typeof f == 'function'
+ ? f(b || 1, !!c, a, d)
+ : f.replace(/%d/i, b || 1);
+ }
+ function _(a, b, c) {
+ var d = e(Math.abs(a) / 1e3),
+ f = e(d / 60),
+ g = e(f / 60),
+ h = e(g / 24),
+ i = e(h / 365),
+ j = (d < 45 && ['s', d]) ||
+ (f === 1 && ['m']) ||
+ (f < 45 && ['mm', f]) ||
+ (g === 1 && ['h']) ||
+ (g < 22 && ['hh', g]) ||
+ (h === 1 && ['d']) ||
+ (h <= 25 && ['dd', h]) ||
+ (h <= 45 && ['M']) ||
+ (h < 345 && ['MM', e(h / 30)]) ||
+ (i === 1 && ['y']) || ['yy', i];
+ return (j[2] = b), (j[3] = a > 0), (j[4] = c), $.apply({}, j);
+ }
+ function ab(a, b) {
+ c.fn[a] = function (a) {
+ var c = this._isUTC ? 'UTC' : '';
+ return a != null
+ ? (this._d['set' + c + b](a), this)
+ : this._d['get' + c + b]();
+ };
+ }
+ function bb(a) {
+ c.duration.fn[a] = function () {
+ return this._data[a];
+ };
+ }
+ function cb(a, b) {
+ c.duration.fn['as' + a] = function () {
+ return +this / b;
+ };
+ }
+ var c,
+ d = '1.7.0',
+ e = Math.round,
+ f,
+ g = {},
+ h = 'en',
+ i = typeof module != 'undefined' && module.exports,
+ j =
+ 'months|monthsShort|weekdays|weekdaysShort|weekdaysMin|longDateFormat|calendar|relativeTime|ordinal|meridiem'.split(
+ '|'
+ ),
+ k = /^\/?Date\((\-?\d+)/i,
+ l =
+ /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?)/g,
+ m = /(LT|LL?L?L?)/g,
+ n = /(^\[)|(\\)|\]$/g,
+ o = /([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,
+ p = /\d\d?/,
+ q = /\d{1,3}/,
+ r = /\d{3}/,
+ s = /\d{1,4}/,
+ t = /[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,
+ u = /Z|[\+\-]\d\d:?\d\d/i,
+ v = /T/i,
+ w =
+ /^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,
+ x = 'YYYY-MM-DDTHH:mm:ssZ',
+ y = [
+ ['HH:mm:ss.S', /T\d\d:\d\d:\d\d\.\d{1,3}/],
+ ['HH:mm:ss', /T\d\d:\d\d:\d\d/],
+ ['HH:mm', /T\d\d:\d\d/],
+ ['HH', /T\d\d/]
+ ],
+ z = /([\+\-]|\d\d)/gi,
+ A = 'Month|Date|Hours|Minutes|Seconds|Milliseconds'.split('|'),
+ B = {
+ Milliseconds: 1,
+ Seconds: 1e3,
+ Minutes: 6e4,
+ Hours: 36e5,
+ Days: 864e5,
+ Months: 2592e6,
+ Years: 31536e6
+ },
+ C = {},
+ D = {
+ M: '(a=t.month()+1)',
+ MMM: 'v("monthsShort",t.month())',
+ MMMM: 'v("months",t.month())',
+ D: '(a=t.date())',
+ DDD: '(a=new Date(t.year(),t.month(),t.date()),b=new Date(t.year(),0,1),a=~~(((a-b)/864e5)+1.5))',
+ d: '(a=t.day())',
+ dd: 'v("weekdaysMin",t.day())',
+ ddd: 'v("weekdaysShort",t.day())',
+ dddd: 'v("weekdays",t.day())',
+ w: '(a=new Date(t.year(),t.month(),t.date()-t.day()+5),b=new Date(a.getFullYear(),0,4),a=~~((a-b)/864e5/7+1.5))',
+ YY: 'p(t.year()%100,2)',
+ YYYY: 'p(t.year(),4)',
+ a: 'm(t.hours(),t.minutes(),!0)',
+ A: 'm(t.hours(),t.minutes(),!1)',
+ H: 't.hours()',
+ h: 't.hours()%12||12',
+ m: 't.minutes()',
+ s: 't.seconds()',
+ S: '~~(t.milliseconds()/100)',
+ SS: 'p(~~(t.milliseconds()/10),2)',
+ SSS: 'p(t.milliseconds(),3)',
+ Z: '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(a/60),2)+":"+p(~~a%60,2)',
+ ZZ: '((a=-t.zone())<0?((a=-a),"-"):"+")+p(~~(10*a/6),4)'
+ },
+ E = 'DDD w M D d'.split(' '),
+ F = 'M D H h m s w'.split(' ');
+ while (E.length) (f = E.pop()), (D[f + 'o'] = D[f] + '+o(a)');
+ while (F.length) (f = F.pop()), (D[f + f] = 'p(' + D[f] + ',2)');
+ (D.DDDD = 'p(' + D.DDD + ',3)'),
+ (c = function (d, e) {
+ if (d === null || d === '') return null;
+ var f, g;
+ return c.isMoment(d)
+ ? new G(new a(+d._d), d._isUTC, d._lang)
+ : (e
+ ? L(e)
+ ? (f = Y(d, e))
+ : (f = X(d, e))
+ : ((g = k.exec(d)),
+ (f =
+ d === b
+ ? new a()
+ : g
+ ? new a(+g[1])
+ : d instanceof a
+ ? d
+ : L(d)
+ ? N(d)
+ : typeof d == 'string'
+ ? Z(d)
+ : new a(d))),
+ new G(f));
+ }),
+ (c.utc = function (a, b) {
+ return L(a)
+ ? new G(N(a, !0), !0)
+ : (typeof a == 'string' &&
+ !u.exec(a) &&
+ ((a += ' +0000'), b && (b += ' Z')),
+ c(a, b).utc());
+ }),
+ (c.unix = function (a) {
+ return c(a * 1e3);
+ }),
+ (c.duration = function (a, b) {
+ var d = c.isDuration(a),
+ e = typeof a == 'number',
+ f = d ? a._data : e ? {} : a,
+ g;
+ return (
+ e && (b ? (f[b] = a) : (f.milliseconds = a)),
+ (g = new H(f)),
+ d && (g._lang = a._lang),
+ g
+ );
+ }),
+ (c.humanizeDuration = function (a, b, d) {
+ return c.duration(a, b === !0 ? null : b).humanize(b === !0 ? !0 : d);
+ }),
+ (c.version = d),
+ (c.defaultFormat = x),
+ (c.lang = function (a, b) {
+ var d;
+ if (!a) return h;
+ (b || !g[a]) && O(a, b);
+ if (g[a]) {
+ for (d = 0; d < j.length; d++) c[j[d]] = g[a][j[d]];
+ (c.monthsParse = g[a].monthsParse), (h = a);
+ }
+ }),
+ (c.langData = P),
+ (c.isMoment = function (a) {
+ return a instanceof G;
+ }),
+ (c.isDuration = function (a) {
+ return a instanceof H;
+ }),
+ c.lang('en', {
+ months:
+ 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
+ '_'
+ ),
+ monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
+ weekdays:
+ 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
+ weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
+ weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
+ longDateFormat: {
+ LT: 'h:mm A',
+ L: 'MM/DD/YYYY',
+ LL: 'MMMM D YYYY',
+ LLL: 'MMMM D YYYY LT',
+ LLLL: 'dddd, MMMM D YYYY LT'
+ },
+ meridiem: function (a, b, c) {
+ return a > 11 ? (c ? 'pm' : 'PM') : c ? 'am' : 'AM';
+ },
+ calendar: {
+ sameDay: '[Today at] LT',
+ nextDay: '[Tomorrow at] LT',
+ nextWeek: 'dddd [at] LT',
+ lastDay: '[Yesterday at] LT',
+ lastWeek: '[last] dddd [at] LT',
+ sameElse: 'L'
+ },
+ relativeTime: {
+ future: 'in %s',
+ past: '%s ago',
+ s: 'a few seconds',
+ m: 'a minute',
+ mm: '%d minutes',
+ h: 'an hour',
+ hh: '%d hours',
+ d: 'a day',
+ dd: '%d days',
+ M: 'a month',
+ MM: '%d months',
+ y: 'a year',
+ yy: '%d years'
+ },
+ ordinal: function (a) {
+ var b = a % 10;
+ return ~~((a % 100) / 10) === 1
+ ? 'th'
+ : b === 1
+ ? 'st'
+ : b === 2
+ ? 'nd'
+ : b === 3
+ ? 'rd'
+ : 'th';
+ }
+ }),
+ (c.fn = G.prototype =
+ {
+ clone: function () {
+ return c(this);
+ },
+ valueOf: function () {
+ return +this._d;
+ },
+ unix: function () {
+ return Math.floor(+this._d / 1e3);
+ },
+ toString: function () {
+ return this._d.toString();
+ },
+ toDate: function () {
+ return this._d;
+ },
+ toArray: function () {
+ var a = this;
+ return [
+ a.year(),
+ a.month(),
+ a.date(),
+ a.hours(),
+ a.minutes(),
+ a.seconds(),
+ a.milliseconds(),
+ !!this._isUTC
+ ];
+ },
+ isValid: function () {
+ return this._a
+ ? !M(this._a, (this._a[7] ? c.utc(this) : this).toArray())
+ : !isNaN(this._d.getTime());
+ },
+ utc: function () {
+ return (this._isUTC = !0), this;
+ },
+ local: function () {
+ return (this._isUTC = !1), this;
+ },
+ format: function (a) {
+ return U(this, a ? a : c.defaultFormat);
+ },
+ add: function (a, b) {
+ var d = b ? c.duration(+b, a) : c.duration(a);
+ return K(this, d, 1), this;
+ },
+ subtract: function (a, b) {
+ var d = b ? c.duration(+b, a) : c.duration(a);
+ return K(this, d, -1), this;
+ },
+ diff: function (a, b, d) {
+ var f = this._isUTC ? c(a).utc() : c(a).local(),
+ g = (this.zone() - f.zone()) * 6e4,
+ h = this._d - f._d - g,
+ i = this.year() - f.year(),
+ j = this.month() - f.month(),
+ k = this.date() - f.date(),
+ l;
+ return (
+ b === 'months'
+ ? (l = i * 12 + j + k / 30)
+ : b === 'years'
+ ? (l = i + (j + k / 30) / 12)
+ : (l =
+ b === 'seconds'
+ ? h / 1e3
+ : b === 'minutes'
+ ? h / 6e4
+ : b === 'hours'
+ ? h / 36e5
+ : b === 'days'
+ ? h / 864e5
+ : b === 'weeks'
+ ? h / 6048e5
+ : h),
+ d ? l : e(l)
+ );
+ },
+ from: function (a, b) {
+ return c.duration(this.diff(a)).lang(this._lang).humanize(!b);
+ },
+ fromNow: function (a) {
+ return this.from(c(), a);
+ },
+ calendar: function () {
+ var a = this.diff(c().sod(), 'days', !0),
+ b = this.lang().calendar,
+ d = b.sameElse,
+ e =
+ a < -6
+ ? d
+ : a < -1
+ ? b.lastWeek
+ : a < 0
+ ? b.lastDay
+ : a < 1
+ ? b.sameDay
+ : a < 2
+ ? b.nextDay
+ : a < 7
+ ? b.nextWeek
+ : d;
+ return this.format(typeof e == 'function' ? e.apply(this) : e);
+ },
+ isLeapYear: function () {
+ var a = this.year();
+ return (a % 4 === 0 && a % 100 !== 0) || a % 400 === 0;
+ },
+ isDST: function () {
+ return (
+ this.zone() < c([this.year()]).zone() ||
+ this.zone() < c([this.year(), 5]).zone()
+ );
+ },
+ day: function (a) {
+ var b = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+ return a == null ? b : this.add({ d: a - b });
+ },
+ startOf: function (a) {
+ switch (a.replace(/s$/, '')) {
+ case 'year':
+ this.month(0);
+ case 'month':
+ this.date(1);
+ case 'day':
+ this.hours(0);
+ case 'hour':
+ this.minutes(0);
+ case 'minute':
+ this.seconds(0);
+ case 'second':
+ this.milliseconds(0);
+ }
+ return this;
+ },
+ endOf: function (a) {
+ return this.startOf(a)
+ .add(a.replace(/s?$/, 's'), 1)
+ .subtract('ms', 1);
+ },
+ sod: function () {
+ return this.clone().startOf('day');
+ },
+ eod: function () {
+ return this.clone().endOf('day');
+ },
+ zone: function () {
+ return this._isUTC ? 0 : this._d.getTimezoneOffset();
+ },
+ daysInMonth: function () {
+ return c.utc([this.year(), this.month() + 1, 0]).date();
+ },
+ lang: function (a) {
+ return a === b ? P(this) : ((this._lang = a), this);
+ }
+ });
+ for (f = 0; f < A.length; f++) ab(A[f].toLowerCase(), A[f]);
+ ab('year', 'FullYear'),
+ (c.duration.fn = H.prototype =
+ {
+ weeks: function () {
+ return I(this.days() / 7);
+ },
+ valueOf: function () {
+ return (
+ this._milliseconds + this._days * 864e5 + this._months * 2592e6
+ );
+ },
+ humanize: function (a) {
+ var b = +this,
+ c = this.lang().relativeTime,
+ d = _(b, !a, this.lang());
+ return a && (d = (b <= 0 ? c.past : c.future).replace(/%s/i, d)), d;
+ },
+ lang: c.fn.lang
+ });
+ for (f in B) B.hasOwnProperty(f) && (cb(f, B[f]), bb(f.toLowerCase()));
+ cb('Weeks', 6048e5),
+ i && (module.exports = c),
+ typeof ender == 'undefined' && (this.moment = c),
+ typeof define == 'function' &&
+ define.amd &&
+ define('moment', [], function () {
+ return c;
+ });
+}.call(this, Date));
diff --git a/examples/apps/PHP/HelloWorld/appclass.js b/examples/apps/PHP/HelloWorld/appclass.js
index 4f520b13..eb59f6da 100644
--- a/examples/apps/PHP/HelloWorld/appclass.js
+++ b/examples/apps/PHP/HelloWorld/appclass.js
@@ -1,5 +1,4 @@
-F2.Apps["com_openf2_examples_php_helloworld"] = (function() {
-
+F2.Apps['com_openf2_examples_php_helloworld'] = (function () {
var App_Class = function (appConfig, appContent, root) {
this.appConfig = appConfig;
this.appContent = appContent;
@@ -7,45 +6,52 @@ F2.Apps["com_openf2_examples_php_helloworld"] = (function() {
};
App_Class.prototype.init = function () {
-
- $('a.testAlert', this.$root).on('click', $.proxy(function() {
- alert("Hello World!");
- F2.log('callback fired!');
- }, this));
-
- $('a.testConfirm', this.$root).on('click', $.proxy(function() {
- let r = confirm('Hello World!');
- if (r == true) {
- F2.log('ok callback fired!');
- } else {
- F2.log('cancel callback fired!');
- }
- }, this));
+ $('a.testAlert', this.$root).on(
+ 'click',
+ $.proxy(function () {
+ alert('Hello World!');
+ F2.log('callback fired!');
+ }, this)
+ );
+
+ $('a.testConfirm', this.$root).on(
+ 'click',
+ $.proxy(function () {
+ let r = confirm('Hello World!');
+ if (r == true) {
+ F2.log('ok callback fired!');
+ } else {
+ F2.log('cancel callback fired!');
+ }
+ }, this)
+ );
// bind symbol change event
- F2.Events.on(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, $.proxy(this._handleSymbolChange, this));
+ F2.Events.on(
+ F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
+ $.proxy(this._handleSymbolChange, this)
+ );
};
App_Class.prototype._handleSymbolChange = function (data) {
-
- var symbolAlert = $("div.symbolAlert", this.$root);
- symbolAlert = (symbolAlert.length)
- ? symbolAlert
- : this._renderSymbolAlert();
+ var symbolAlert = $('div.symbolAlert', this.$root);
+ symbolAlert = symbolAlert.length ? symbolAlert : this._renderSymbolAlert();
- $("span:first", symbolAlert).text("The symbol has been changed to " + data.symbol);
+ $('span:first', symbolAlert).text(
+ 'The symbol has been changed to ' + data.symbol
+ );
};
- App_Class.prototype._renderSymbolAlert = function() {
-
- return $([
+ App_Class.prototype._renderSymbolAlert = function () {
+ return $(
+ [
'',
- '',
- '',
+ '',
+ '',
''
- ].join(''))
- .prependTo($("." + F2.Constants.Css.APP_CONTAINER,this.$root));
+ ].join('')
+ ).prependTo($('.' + F2.Constants.Css.APP_CONTAINER, this.$root));
};
return App_Class;
-})();
\ No newline at end of file
+})();
diff --git a/examples/apps/PHP/MarketNews/app.css b/examples/apps/PHP/MarketNews/app.css
index 7eb299cb..b6e38f16 100644
--- a/examples/apps/PHP/MarketNews/app.css
+++ b/examples/apps/PHP/MarketNews/app.css
@@ -1,29 +1,29 @@
.com_openf2_examples_php_marketnews li {
- border-bottom:1px solid #DDD;
- padding:0 3px 10px;
+ border-bottom: 1px solid #ddd;
+ padding: 0 3px 10px;
}
.com_openf2_examples_php_marketnews li + li {
- padding-top:10px;
+ padding-top: 10px;
}
.com_openf2_examples_php_marketnews header a {
- font-size:18px;
- padding-bottom:10px;
+ font-size: 18px;
+ padding-bottom: 10px;
}
.com_openf2_examples_php_marketnews header time {
- color:#8F8F8F;
- display:block;
- font-size:11px;
+ color: #8f8f8f;
+ display: block;
+ font-size: 11px;
}
.com_openf2_examples_php_marketnews summary {
- margin-top:5px;
+ margin-top: 5px;
}
.com_openf2_examples_php_marketnews p {
- margin-bottom:0;
+ margin-bottom: 0;
}
.com_openf2_examples_php_marketnews img {
- padding-right:15px;
+ padding-right: 15px;
}
.com_openf2_examples_php_marketnews footer {
- font-size:10px;
- padding:0 3px 10px;
+ font-size: 10px;
+ padding: 0 3px 10px;
}
diff --git a/examples/apps/PHP/MarketNews/appclass.js b/examples/apps/PHP/MarketNews/appclass.js
index cc9ffef8..425ab860 100644
--- a/examples/apps/PHP/MarketNews/appclass.js
+++ b/examples/apps/PHP/MarketNews/appclass.js
@@ -1,5 +1,4 @@
-F2.Apps["com_openf2_examples_php_marketnews"] = (function() {
-
+F2.Apps['com_openf2_examples_php_marketnews'] = (function () {
var App_Class = function (appConfig, appContent, root) {
this.appConfig = appConfig;
this.appContent = appContent;
@@ -7,24 +6,32 @@ F2.Apps["com_openf2_examples_php_marketnews"] = (function() {
};
App_Class.prototype.init = function () {
+ $('button.save', this.$root).on(
+ 'click',
+ $.proxy(function (e) {
+ if (
+ $('form.f2-app-view input[name="autoRefresh"]', this.$root).prop(
+ 'checked'
+ )
+ ) {
+ alert('Auto refresh in 30 seconds enabled');
+ } else alert('Auto refresh in 30 seconds disabled');
- $('button.save', this.$root).on('click', $.proxy(function(e) {
- if($('form.f2-app-view input[name="autoRefresh"]', this.$root).prop('checked'))
- { alert("Auto refresh in 30 seconds enabled")
- }
- else
- alert('Auto refresh in 30 seconds disabled')
-
- this._handleSaveSettings();
-
- }, this));
+ this._handleSaveSettings();
+ }, this)
+ );
};
- App_Class.prototype._handleSaveSettings = function() {
-
+ App_Class.prototype._handleSaveSettings = function () {
this.appConfig.context = this.appConfig.context || {};
- this.appConfig.context.autoRefresh = $('form.f2-app-view input[name="autoRefresh"]', this.$root).prop('checked');
- this.appConfig.context.provider = $('form.f2-app-view input[name="provider"]:checked', this.$root).val();
+ this.appConfig.context.autoRefresh = $(
+ 'form.f2-app-view input[name="autoRefresh"]',
+ this.$root
+ ).prop('checked');
+ this.appConfig.context.provider = $(
+ 'form.f2-app-view input[name="provider"]:checked',
+ this.$root
+ ).val();
clearInterval(this._refreshInterval);
if (this.appConfig.context.autoRefresh) {
@@ -35,25 +42,24 @@ F2.Apps["com_openf2_examples_php_marketnews"] = (function() {
};
App_Class.prototype._refresh = function () {
-
-
$.ajax({
url: this.appConfig.manifestUrl,
data: {
params: JSON.stringify([this.appConfig], F2.appConfigReplacer)
},
- type: "post",
- dataType: "jsonp",
- jsonp:false,
- jsonpCallback:F2.Constants.JSONP_CALLBACK + this.appConfig.appId,
- context:this,
- success:function (data) {
- $("div.f2-app-view", this.$root).replaceWith($(data.apps[0].html).find("div.f2-app-view"));
+ type: 'post',
+ dataType: 'jsonp',
+ jsonp: false,
+ jsonpCallback: F2.Constants.JSONP_CALLBACK + this.appConfig.appId,
+ context: this,
+ success: function (data) {
+ $('div.f2-app-view', this.$root).replaceWith(
+ $(data.apps[0].html).find('div.f2-app-view')
+ );
},
- complete:function() {
- }
- })
+ complete: function () {}
+ });
};
return App_Class;
-})();
\ No newline at end of file
+})();
diff --git a/examples/apps/PHP/News/app.css b/examples/apps/PHP/News/app.css
index 037b3ee5..1138d583 100644
--- a/examples/apps/PHP/News/app.css
+++ b/examples/apps/PHP/News/app.css
@@ -1,16 +1,16 @@
.com_openf2_examples_php_news li {
- border-bottom:1px solid #DDD;
- padding:0 3px 10px;
+ border-bottom: 1px solid #ddd;
+ padding: 0 3px 10px;
}
.com_openf2_examples_php_news li + li {
- padding-top:10px;
+ padding-top: 10px;
}
.com_openf2_examples_php_news li time {
- color:#8F8F8F;
- display:block;
- font-size:11px;
+ color: #8f8f8f;
+ display: block;
+ font-size: 11px;
}
.com_openf2_examples_php_news footer {
- font-size:10px;
- padding:0 3px 10px;
-}
\ No newline at end of file
+ font-size: 10px;
+ padding: 0 3px 10px;
+}
diff --git a/examples/apps/PHP/News/appclass.js b/examples/apps/PHP/News/appclass.js
index f3d007c4..fec9976e 100644
--- a/examples/apps/PHP/News/appclass.js
+++ b/examples/apps/PHP/News/appclass.js
@@ -1,7 +1,5 @@
-F2.Apps["com_openf2_examples_php_news"] = (function() {
-
+F2.Apps['com_openf2_examples_php_news'] = (function () {
var App_Class = function (appConfig, appContent, root) {
-
this.appConfig = appConfig;
this.appContent = appContent;
this.$root = $(root);
@@ -10,20 +8,29 @@ F2.Apps["com_openf2_examples_php_news"] = (function() {
};
App_Class.prototype.init = function () {
-
// bind symbol change event
- F2.Events.on(F2.Constants.Events.CONTAINER_SYMBOL_CHANGE, $.proxy(this._refresh, this));
-
+ F2.Events.on(
+ F2.Constants.Events.CONTAINER_SYMBOL_CHANGE,
+ $.proxy(this._refresh, this)
+ );
// save settings
- $(this.$root).on("click", "button.save", $.proxy(this._handleSaveSettings, this));
-
+ $(this.$root).on(
+ 'click',
+ 'button.save',
+ $.proxy(this._handleSaveSettings, this)
+ );
};
- App_Class.prototype._handleSaveSettings = function() {
-
- this.appConfig.context.autoRefresh = $('form.f2-app-view input[name="autoRefresh"]', this.$root).prop('checked');
- this.appConfig.context.provider = $('form.f2-app-view input[name="provider"]:checked', this.$root).val();
+ App_Class.prototype._handleSaveSettings = function () {
+ this.appConfig.context.autoRefresh = $(
+ 'form.f2-app-view input[name="autoRefresh"]',
+ this.$root
+ ).prop('checked');
+ this.appConfig.context.provider = $(
+ 'form.f2-app-view input[name="provider"]:checked',
+ this.$root
+ ).val();
clearInterval(this._refreshInterval);
if (this.appConfig.context.autoRefresh) {
@@ -34,37 +41,37 @@ F2.Apps["com_openf2_examples_php_news"] = (function() {
};
App_Class.prototype._refresh = function (data) {
-
data = data || {};
- this.appConfig.context.symbol = data.symbol || this.appConfig.context.symbol;
-
+ this.appConfig.context.symbol =
+ data.symbol || this.appConfig.context.symbol;
$.ajax({
url: this.appConfig.manifestUrl,
data: {
params: JSON.stringify([this.appConfig], F2.appConfigReplacer)
},
- type: "post",
- dataType: "jsonp",
- jsonp:false,
- jsonpCallback:F2.Constants.JSONP_CALLBACK + this.appConfig.appId,
- context:this,
- success:function (data) {
- $("div.f2-app-view", this.$root).replaceWith($(data.apps[0].html).find("div.f2-app-view"));
+ type: 'post',
+ dataType: 'jsonp',
+ jsonp: false,
+ jsonpCallback: F2.Constants.JSONP_CALLBACK + this.appConfig.appId,
+ context: this,
+ success: function (data) {
+ $('div.f2-app-view', this.$root).replaceWith(
+ $(data.apps[0].html).find('div.f2-app-view')
+ );
},
- complete:function() {
- }
- })
+ complete: function () {}
+ });
};
- App_Class.prototype._populateSettings = function() {
-
- $.each(this.appConfig.context, $.proxy(function(key, value) {
-
- $('form.f2-app-view input[name="' + key + '"]', this.$root).val(value);
-
- }, this));
+ App_Class.prototype._populateSettings = function () {
+ $.each(
+ this.appConfig.context,
+ $.proxy(function (key, value) {
+ $('form.f2-app-view input[name="' + key + '"]', this.$root).val(value);
+ }, this)
+ );
};
return App_Class;
-})();
\ No newline at end of file
+})();
diff --git a/examples/container-amd/css/README.md b/examples/container-amd/css/README.md
index 45d10e38..7be5649c 100644
--- a/examples/container-amd/css/README.md
+++ b/examples/container-amd/css/README.md
@@ -4,7 +4,7 @@ F2 Containers can (and should) namespace their CSS so that the Container and App
```css
.f2-example-container {
- @import "bootstrap/bootstrap.less";
- @import "your-custom-css.less";
+ @import 'bootstrap/bootstrap.less';
+ @import 'your-custom-css.less';
}
-```
\ No newline at end of file
+```
diff --git a/examples/container-amd/css/container.css b/examples/container-amd/css/container.css
index f7e03405..6841a6a7 100644
--- a/examples/container-amd/css/container.css
+++ b/examples/container-amd/css/container.css
@@ -1,5 +1,5 @@
.f2-app {
- margin-bottom:20px;
+ margin-bottom: 20px;
}
.f2-app-wrapper {
@@ -9,7 +9,7 @@
.f2-app-wrapper > header {
padding: 10px;
- background-color: #f8f8f8
+ background-color: #f8f8f8;
}
.f2-app header .glyphicon {
@@ -23,7 +23,7 @@
line-height: normal;
}
-.f2-app header .btn-group{
+.f2-app header .btn-group {
padding: 5px;
}
@@ -35,4 +35,4 @@
.f2-app .f2-app-view h3 {
margin-top: 0;
-}
\ No newline at end of file
+}
diff --git a/examples/container-amd/index.html b/examples/container-amd/index.html
index 2ae32f37..d6e9945a 100644
--- a/examples/container-amd/index.html
+++ b/examples/container-amd/index.html
@@ -1,104 +1,149 @@
-
-
-
-
-
-
-
- F2 - Container (AMD) Example
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ F2 - Container (AMD) Example
+
+
+
+
+
+
+
+
+
-
+
+
-
+
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
diff --git a/examples/container-amd/js/appSelector.js b/examples/container-amd/js/appSelector.js
index 2a930184..1d0fb636 100644
--- a/examples/container-amd/js/appSelector.js
+++ b/examples/container-amd/js/appSelector.js
@@ -1,95 +1,88 @@
-define(
- [
- 'jquery',
- 'F2',
- 'storage',
- 'bootstrap'
- ],
- function($, F2, Storage) {
-
- return function() {
+define(['jquery', 'F2', 'storage', 'bootstrap'], function ($, F2, Storage) {
+ return function () {
+ // grab apps from storage
+ var requestedApps = Storage.getItem('requestedApps') || [];
+
+ // setup modal
+ var $modal = $('#languageSelect').modal({
+ backdrop: 'static',
+ keyboard: false,
+ show: false
+ });
+
+ // bind select apps
+ $('#btnSelectApps').on('click', function () {
+ $modal.modal('show');
+ });
+
+ // bind checkbox events
+ $modal.on('change', 'input:checkbox', function () {
+ if ($('input:checkbox:checked', $modal).length) {
+ $('button.btn-primary', $modal).removeClass('disabled');
+ } else {
+ $('button.btn-primary', $modal).addClass('disabled');
+ }
+ });
- // grab apps from storage
- var requestedApps = Storage.getItem('requestedApps') || [];
+ // bind save button
+ $modal.on('click', 'button.btn-primary:not(.disabled)', function () {
+ var apps = [];
+ var storageItems = [];
- // setup modal
- var $modal = $('#languageSelect').modal({
- backdrop: 'static',
- keyboard: false,
- show: false
+ $('input:checked', $modal).map(function (i, el) {
+ apps.push($(el).data('f2-app'));
+ storageItems.push($(el).val());
});
- // bind select apps
- $('#btnSelectApps').on('click', function() {
- $modal.modal('show');
+ $modal.modal('hide');
+
+ // save apps to storage
+ Storage.setItem('requestedApps', storageItems);
+
+ // remove all apps and add only the selected ones
+ F2.removeAllApps();
+ F2.registerApps(apps);
+ });
+
+ // show a loading mask and the modal if there were no requested apps
+ if (!requestedApps.length) {
+ $modal.modal('show');
+ }
+
+ // load in app json
+ $.getJSON('./js/sampleApps.json', function (allApps) {
+ $.each(allApps, function (language, apps) {
+ $('[data-language="' + language + '"]', $modal).append(
+ $.map(apps, function (app, i) {
+ var $d = $(''),
+ $lbl = $(''),
+ $ck = $(
+ ''
+ ).data('f2-app', app),
+ name = ' ' + app.name + (app.isSecure ? ' (Secure)' : '');
+ $lbl.append($ck).append(name);
+
+ return $d.append($lbl);
+ })
+ );
});
- // bind checkbox events
- $modal.on('change', 'input:checkbox', function() {
- if ($('input:checkbox:checked', $modal).length) {
- $('button.btn-primary', $modal).removeClass('disabled');
- } else {
- $('button.btn-primary', $modal).addClass('disabled');
- }
- });
-
- // bind save button
- $modal.on('click', 'button.btn-primary:not(.disabled)', function() {
- var apps = [];
- var storageItems = [];
-
- $('input:checked', $modal).map(function(i, el) {
- apps.push($(el).data('f2-app'));
- storageItems.push($(el).val());
+ // if no requested apps, hide the loader, otherwise register the apps
+ if (requestedApps.length > 0) {
+ // check the appropriate boxes
+ $.each(requestedApps, function (i, a) {
+ $('input[name="app"][value="' + a + '"]', $modal).prop(
+ 'checked',
+ true
+ );
});
- $modal.modal('hide');
-
- // save apps to storage
- Storage.setItem('requestedApps', storageItems);
-
- // remove all apps and add only the selected ones
- F2.removeAllApps();
- F2.registerApps(apps);
- });
+ // fire change event which should enable the Save button
+ $('input:checkbox:first', $modal).change();
- // show a loading mask and the modal if there were no requested apps
- if (!requestedApps.length) {
- $modal.modal('show');
+ // click the Save button
+ $('button.btn-primary', $modal).click();
}
-
- // load in app json
- $.getJSON('./js/sampleApps.js', function(allApps) {
- $.each(allApps, function(language, apps) {
- $('[data-language="' + language + '"]', $modal).append(
- $.map(apps, function(app, i) {
- var $d = $(''),
- $lbl = $(''),
- $ck = $('').data('f2-app', app),
- name = ' ' + app.name + (app.isSecure ? ' (Secure)' : '')
- ;
-
- $lbl.append($ck).append(name);
-
- return $d.append($lbl);
- })
- );
- })
-
- // if no requested apps, hide the loader, otherwise register the apps
- if (requestedApps.length > 0) {
- // check the appropriate boxes
- $.each(requestedApps, function(i, a) {
- $('input[name="app"][value="' + a + '"]', $modal).prop('checked', true);
- });
-
- // fire change event which should enable the Save button
- $('input:checkbox:first', $modal).change();
-
- // click the Save button
- $('button.btn-primary', $modal).click();
- }
- });
- };
- }
-);
\ No newline at end of file
+ });
+ };
+});
diff --git a/examples/container-amd/js/main.js b/examples/container-amd/js/main.js
index 5a0294ad..ffbf2b74 100644
--- a/examples/container-amd/js/main.js
+++ b/examples/container-amd/js/main.js
@@ -1,190 +1,215 @@
-require(
- {
- basePath: 'js',
- paths: {
- 'jquery': '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min',
- 'jquery-ui': '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min',
- 'bootstrap': '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min',
- 'F2': '../../../dist/f2'
- },
- shim: {
- 'bootstrap': ['jquery'],
- 'jquery-ui': ['jquery']
- }
+require({
+ basePath: 'js',
+ paths: {
+ jquery: '//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min',
+ 'jquery-ui':
+ '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min',
+ bootstrap: '//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min',
+ F2: '../../../dist/f2'
},
- [
- 'jquery',
- 'F2',
- 'appSelector',
- 'jquery-ui',
- 'bootstrap'
- ],
- function($, F2, AppSelector) {
-
- //simple console log helper for IE
- var log = $.noop; //function() { };
- if (!window["console"]) {
- window.console = {};
- }
-
- var logFns = {
- log: log,
- warn: log,
- error: log,
- info: log,
- group: log,
- groupEnd: log
- };
-
- for (var i in logFns) {
- if (!window.console[i]) {
- window.console[i] = logFns[i];
- }
- }
-
- // wait for DOM ready
- $(function() {
-
- //can't run this container from a file:// protocol
- if (location.protocol === "file:"){
- var $m = $("#notice").modal();
- // bind save button
- $m.on('click', 'button.btn', function() {
- $m.modal('hide');
- window.close();
- });
- return;
- }
+ shim: {
+ bootstrap: ['jquery'],
+ 'jquery-ui': ['jquery']
+ }
+}, ['jquery', 'F2', 'appSelector', 'jquery-ui', 'bootstrap'], function (
+ $,
+ F2,
+ AppSelector
+) {
+ //simple console log helper for IE
+ var log = $.noop; //function() { };
+ if (!window['console']) {
+ window.console = {};
+ }
- // init the app selector
- new AppSelector();
+ var logFns = {
+ log: log,
+ warn: log,
+ error: log,
+ info: log,
+ group: log,
+ groupEnd: log
+ };
+
+ for (var i in logFns) {
+ if (!window.console[i]) {
+ window.console[i] = logFns[i];
+ }
+ }
- var containerAppHandlerToken = F2.AppHandlers.getToken();
+ // wait for DOM ready
+ $(function () {
+ //can't run this container from a file:// protocol
+ if (location.protocol === 'file:') {
+ var $m = $('#notice').modal();
+ // bind save button
+ $m.on('click', 'button.btn', function () {
+ $m.modal('hide');
+ window.close();
+ });
+ return;
+ }
- var appCreateRootFunc = function(appConfig) {
- var gridWidth = appConfig.minGridSize || 3;
- appConfig.root = $([
- '',
- '',
- '',
- '', appConfig.name, '
',
- ' ',
- '',
+ // init the app selector
+ new AppSelector();
+
+ var containerAppHandlerToken = F2.AppHandlers.getToken();
+
+ var appCreateRootFunc = function (appConfig) {
+ var gridWidth = appConfig.minGridSize || 3;
+ appConfig.root = $(
+ [
+ '',
+ '',
+ '',
+ '',
+ appConfig.name,
+ '
',
+ ' ',
+ '',
' '
- ].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;
- }
+ ].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'));
});
- // create a new row if one wasn't found
- if (row === undefined) {
- row = $('').appendTo('#mainContent');
+ 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)
- .addClass(F2.Constants.Css.APP)
- .find('.f2-app-wrapper')
- .append(app)
- .parent()
- .appendTo(row);
- };
-
- 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.');
- }
+ // append app to app root and also to row
+ $(appConfig.root)
+ .addClass(F2.Constants.Css.APP)
+ .find('.f2-app-wrapper')
+ .append(app)
+ .parent()
+ .appendTo(row);
+ };
+
+ var appDestroyFunc = function (appInstance) {
+ if (!appInstance) {
+ return;
+ }
- // fade out and remove the root
- $(appInstance.config.root).fadeOut(250, function() {
- $(this).remove();
- });
- };
- /**
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- */
-
- /**
- * Init Container
- */
- F2.init();
-
- // 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_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 || "" });
- }
+ // 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
+ $(appInstance.config.root).fadeOut(250, function () {
+ $(this).remove();
+ });
+ };
+ /**
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ */
+
+ /**
+ * Init Container
+ */
+ F2.init();
+
+ // 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_DESTROY,
+ appDestroyFunc
);
- /**
- * 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) {
+ //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 + ")",
+ 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");
- }
- });
- }
- });
- });
- }
-);
+ };
+ })
+ );
+ },
+ open: function () {
+ $(this).removeClass('ui-corner-all').addClass('ui-corner-top');
+ },
+ close: function () {
+ $(this).removeClass('ui-corner-top').addClass('ui-corner-all');
+ }
+ });
+ }
+ });
+ });
+});
diff --git a/examples/container-amd/js/sampleApps.js b/examples/container-amd/js/sampleApps.json
similarity index 98%
rename from examples/container-amd/js/sampleApps.js
rename to examples/container-amd/js/sampleApps.json
index f56b3618..645f7cad 100644
--- a/examples/container-amd/js/sampleApps.js
+++ b/examples/container-amd/js/sampleApps.json
@@ -55,7 +55,7 @@
"minGridSize": 6,
"manifestUrl": "../apps/PHP/F2wits/manifest.js",
"name": "F2wits",
- "views": ["home","about"]
+ "views": ["home", "about"]
},
{
"appId": "com_openf2_examples_php_news",
@@ -76,4 +76,4 @@
"name": "Hello World (PHP)"
}
]
-}
\ No newline at end of file
+}
diff --git a/examples/container-amd/js/storage.js b/examples/container-amd/js/storage.js
index 324d3455..c4ca50ab 100644
--- a/examples/container-amd/js/storage.js
+++ b/examples/container-amd/js/storage.js
@@ -1,82 +1,86 @@
-define(
+define(['F2'], function (F2) {
+ var _hasLocalStorage =
+ typeof Storage !== 'undefined' && !!window.localStorage;
+ var _getKey = function (key) {
+ return 'F2-' + key;
+ };
- [
- 'F2'
- ],
+ return {
+ /**
+ * @method getItem
+ * @param {string} key The key of the item to retrieve
+ */
+ getItem: function (key) {
+ var value = null;
- function(F2) {
- var _hasLocalStorage = typeof Storage !== 'undefined' && !!window.localStorage;
- var _getKey = function(key) {
- return 'F2-' + key;
- };
-
- return {
- /**
- * @method getItem
- * @param {string} key The key of the item to retrieve
- */
- getItem:function(key) {
-
- var value = null;
-
- if (!key) { return; }
+ if (!key) {
+ return;
+ }
- key = _getKey(key);
+ key = _getKey(key);
- if (_hasLocalStorage) {
- value = localStorage.getItem(key);
- } else {
- var cookies = document.cookie.split(/\s*;\s*/);
- for (var i = 0, len = cookies.length; i < len; i++) {
- var parts = cookies[i].split(/\s*=\s*/);
- if (parts.length > 1 && unescape(parts[0]) == key) {
- value = unescape(parts[1]);
- }
+ if (_hasLocalStorage) {
+ value = localStorage.getItem(key);
+ } else {
+ var cookies = document.cookie.split(/\s*;\s*/);
+ for (var i = 0, len = cookies.length; i < len; i++) {
+ var parts = cookies[i].split(/\s*=\s*/);
+ if (parts.length > 1 && unescape(parts[0]) == key) {
+ value = unescape(parts[1]);
}
}
+ }
- if (!!value) {
- value = F2.parse(value);
- }
-
- return value;
- },
- /**
- * @method removeItem
- * @param {string} key The key of the item to remove
- */
- removeItem:function(key) {
-
- if (!key) { return; }
+ if (!!value) {
+ value = F2.parse(value);
+ }
- key = _getKey(key);
+ return value;
+ },
+ /**
+ * @method removeItem
+ * @param {string} key The key of the item to remove
+ */
+ removeItem: function (key) {
+ if (!key) {
+ return;
+ }
- if (_hasLocalStorage) {
- localStorage.removeItem(key);
- } else {
- document.cookie = escape(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
- }
- },
- /**
- * @method setItem
- * @param {string} key The key of the item to set
- * @param {object} value The value to be stored
- */
- setItem:function(key, value) {
+ key = _getKey(key);
- if (!key || !value) { return; }
+ if (_hasLocalStorage) {
+ localStorage.removeItem(key);
+ } else {
+ document.cookie =
+ escape(key) + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
+ }
+ },
+ /**
+ * @method setItem
+ * @param {string} key The key of the item to set
+ * @param {object} value The value to be stored
+ */
+ setItem: function (key, value) {
+ if (!key || !value) {
+ return;
+ }
- key = _getKey(key);
- value = F2.stringify(value);
+ key = _getKey(key);
+ value = F2.stringify(value);
- if (_hasLocalStorage) {
- localStorage.setItem(key, value);
- } else {
- var exp = new Date();
- exp.setFullYear((new Date()).getFullYear() + 100);
- document.cookie = escape(key) + '=' + escape(value) + '; expires=' + exp.toUTCString() + '; path=/';
- }
+ if (_hasLocalStorage) {
+ localStorage.setItem(key, value);
+ } else {
+ var exp = new Date();
+ exp.setFullYear(new Date().getFullYear() + 100);
+ document.cookie =
+ escape(key) +
+ '=' +
+ escape(value) +
+ '; expires=' +
+ exp.toUTCString() +
+ '; path=/';
}
- };
- }
-);
+ }
+ };
+});
diff --git a/examples/container-autoload/index.html b/examples/container-autoload/index.html
index ae440a9d..65a0026a 100644
--- a/examples/container-autoload/index.html
+++ b/examples/container-autoload/index.html
@@ -1,56 +1,85 @@
-
-
-
-
-
-
-
- F2 - Container Autoload Example
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ F2 - Container Autoload Example
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
\ No newline at end of file
+