diff --git a/.gitignore b/.gitignore index 719d95cd..df193ec2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ node_modules .vscode .gitattributes .well-known -package-lock.json -/views/archive/gfiles/rarch/roms \ No newline at end of file +package-lock.json \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 1856eb97..00a21f33 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,31 @@ -[submodule "views/archive"] - path = views/archive - url = https://github.com/QuiteAFancyEmerald/HU-Archive +[submodule "views/archive/g/house"] + path = views/archive/g/house + url = https://github.com/razh/game-off-2013 + +[submodule "views/archive/g/househorror"] + path = views/archive/g/househorror + url = https://github.com/arturkot/the-house-game + +[submodule "views/archive/g/pond"] + path = views/archive/g/pond + url = https://github.com/Zolmeister/pond + +[submodule "views/archive/g/particle-clicker"] + path = views/archive/g/particle-clicker + url = https://github.com/particle-clicker/particle-clicker + +[submodule "views/archive/g/nsshaft"] + path = views/archive/g/nsshaft + url = https://github.com/iPel/NS-SHAFT + +[submodule "views/archive/g/adarkroom"] + path = views/archive/g/adarkroom + url = https://github.com/doublespeakgames/adarkroom + +[submodule "views/archive/g/trimps"] + path = views/archive/g/trimps + url = https://github.com/Trimps/Trimps.github.io + +[submodule "views/archive/g/zork1"] + path = views/archive/g/zork1 + url = https://github.com/jessicalevine/Adventure.js \ No newline at end of file diff --git a/.replit b/.replit new file mode 100644 index 00000000..69324f56 --- /dev/null +++ b/.replit @@ -0,0 +1,2 @@ +language = "nodejs" +run = "node --max_old_space_size=2560 ./backend.js" diff --git a/README.md b/README.md index 107fee2b..fb94ce51 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,13 @@ - + # Holy Unblocker -#### Titanium Network is sponsored by: - - - Holy Unblocker, an official flagship Titanium Network site, can bypass web filters regardless of whether it is an extension or network-based. Being a secure web proxy service, it supports numerous sites while being updated frequently and concentrating on detail with design, mechanics, and features. -Works with a large number of sites, including YouTube, Discord, and more! +Works with a large number of sites, including YouTube, Discord, and more! -Read below for information if the official site is blocked or for obtaining more links. +Also has a good amount of locally hosted games featured on the site. + +**Read below for information if the official site is blocked or for obtaining more links.** #### Supports - Youtube.com @@ -17,266 +15,264 @@ Read below for information if the official site is blocked or for obtaining more - Google.com - Reddit.com - Bing.com -- And more! +- And more sites! #### Features: - Tab customization using the Options menu for improved stealth - Considerable variety with the open selection of proxy types -- Game library with moderately decent titles like A Dark Room +- Game library with moderately decent titles - Has frequent support articles for issues relating to the various proxy instances -Be sure to join Titanium Network's Discord for more official site links: https://discord.gg/unblock +Note: EmuLibrary is not featured in the public version. -Do %proxy hu for more Holy Unblocker links on the Titanium Network Discord server. +Official Site: https://holyubofficial.net -**Official Site:** https://www.holyubofficial.net +**Be sure to join Titanium Network's Discord for more official site links:** https://discord.gg/unblock -**Site Documentation:** Documentation +Simply do `%proxy hu` in `#proxy-commands` for more Holy Unblocker links on the TN Discord server. - + + +### Deploy Holy Unblocker + +[![Deploy to Heroku](https://raw.githubusercontent.com/BinBashBanana/deploy-buttons/master/buttons/remade/heroku.svg)](https://heroku.com/deploy/?template=https://github.com/titaniumnetwork-dev/Holy-Unblocker) +[![Run on Replit](https://raw.githubusercontent.com/BinBashBanana/deploy-buttons/master/buttons/remade/replit.svg)](https://replit.com/github/titaniumnetwork-dev/Holy-Unblocker) +[![Remix on Glitch](https://raw.githubusercontent.com/BinBashBanana/deploy-buttons/master/buttons/remade/glitch.svg)](https://glitch.com/edit/#!/import/github/titaniumnetwork-dev/Holy-Unblocker) +[![Deploy to Azure](https://raw.githubusercontent.com/BinBashBanana/deploy-buttons/master/buttons/remade/azure.svg)](https://deploy.azure.com/?repository=https://github.com/titaniumnetwork-dev/Holy-Unblocker) +[![Deploy to IBM Cloud](https://raw.githubusercontent.com/BinBashBanana/deploy-buttons/master/buttons/remade/ibmcloud.svg)](https://cloud.ibm.com/devops/setup/deploy?repository=https://github.com/titaniumnetwork-dev/Holy-Unblocker) +[![Deploy to Amplify Console](https://raw.githubusercontent.com/BinBashBanana/deploy-buttons/master/buttons/remade/amplifyconsole.svg)](https://console.aws.amazon.com/amplify/home#/deploy?repo=https://github.com/titaniumnetwork-dev/Holy-Unblocker) +[![Run on Google Cloud](https://raw.githubusercontent.com/BinBashBanana/deploy-buttons/master/buttons/remade/googlecloud.svg)](https://deploy.cloud.run/?git_repo=https://github.com/titaniumnetwork-dev/Holy-Unblocker) -Deploy to Heroku -  -Deploy to Azure -  -Run on Repl.it -  -Remix on glitch - ## Table of contents: -- [Setup](#how-to-install) - - [Structure](#structure) - - [Structure Information](#structure) - - [Static Files](#details-of-views) - - [Proxy Scripts](#scripts-located-in-expr) - - [Future Additions](#future-additions) - - [Beginner's Explanation](#vauge-explanation-for-beginners-with-external-proxies-and-hosting) - - [Hosting Providers](#list-of-some-good-hosting-options) - - [Heroku Setup](#heroku-steps) - - [Domain Setup](#freenomdomain-steps) - - [Cloudflare Setup](#cloudflare-steps) - - [Workspace Configurations](#workspace-configurations) - - [Detailed FAQ](#detailed-faq) - - [More Information](#more-information) +- [Setup](#how-to-setup) + - [Structure](#structure) + - [Structure Information](#structure-information) + - [Static Files](#details-of-views) + - [Scripts](#scripts-located-in-viewsassetsjs) + - [Future Additions](#future-additions) + - [Beginner's Explanation](#vauge-explanation-for-beginners-with-external-proxies-and-hosting) + - [Hosting Providers](#list-of-some-good-hosting-options) + - [Heroku Setup](#heroku-steps) + - [Domain Setup](#freenomdomain-steps) + - [Cloudflare Setup](#cloudflare-steps) + - [Workspace Configurations](#workspace-configurations) + - [Detailed FAQ](#detailed-faq) + - [More Information](#more-information) ## How to Setup + Either use the button above to deploy to Heroku or do the below: -``` -$ git clone https://github.com/titaniumnetwork-dev/Holy-Unblocker.git -$ cd HolyUnblockerPublic -$ npm install -``` -Afterward, run: -``` -$ npm start -``` -For more detailed documentation on workspace setup, please view this. -The default place for the proxy when it started is `http://localhost:8080`, but it can be changed if needed in config.json +``` +git clone https://github.com/titaniumnetwork-dev/Holy-Unblocker.git + +cd Holy-Unblocker + +npm install + +npm start +``` + +The default place for the proxy when its started is `http://localhost:8080` but you can change it if needed in config.json + +This website is hosted locally with Corrosion built-in. More more information go to the Corrosion repository below. -This website has been hosted locally with Corrosion, a powerful web proxy made by Titanium Network. For more information, head over to the Corrosion repository below. ## Structure -- `index.html` : The official homepage of the site. -- `404.html` : The 404 page. -- `error.html` : Other misc errors that are not 404. -- `info.html` : Documentation (This page!) -- `faq.html` : Frequently asked questions page. -- `status.html` : Has 3 backup Holy Unblocker links. -- `hidden.html` : Fake "Site not Found" page (unused) -- `frame.html` : Handles any pages under stealth. -- `surf.html` : Web Proxies page, page offers to be redirected to any proxies you would like to add. In this case Corrosion, Womginx, and PyDodgeB. -- `credits.html` : List of all contributors to the site. -- `bookmarklets.html` : Bookmarklets page to be worked on more in the future. -- `icons.html` : Information regarding Settings Menu page. Added this in for standard users. -- `terms.html` : Terms of Services, AUP and Privacy Policy page. -- `gtools.html` : Games page, help from @BinBashBanana and @kinglalu. -- `games5.html` : HTML5 game navigation page. -- `emulators.html` : Emulator navigation page, using [webretro](https://github.com/BinBashBanana/webretro). -- `flash.html` : Games page for flash games, credits given to @BinBashBanana and Titanium Network for its assets. -- `corrosion.html` : Official page for Corrosion. -- `womginx.html` : Womginx Proxy page. Script links to a subdomain for Womginx, a highly fast proxy with reCaptcha and discord support. -- `pmprox.html` : SysYa Proxy page. Script links to a subdomain for SysYa, a flexible secondary proxy. -- `pydodge.html` : Via Unblocker page. Links to a subdomain with PyDodge or Via. -- `youtube.html` : An proxied version of Youtube running off of the locally hosted Corrosion Proxy. -- `discordhub.html` : Hub for the Discord proxy (Currently Womginx only). +- `index.html`: The homepage of the site. +- `404.html`: The 404 page. +- `error.html`: Other errors that are not 404. +- `info.html`: Documentation (This page!) +- `faq.html`: Frequently asked questions page. +- `hidden.html`: Fake "Site not Found" page (unused) +- `frame.html`: Handles any pages under stealth. +- `surf.html`: Web Proxies page, page offers to be redirected to any proxies you would like to add. In this case, Corrosion, Womginx, and Palladium. +- `credits.html`: List of all contributors to the site. +- `bookmarklets.html`: Bookmarklets page, to be worked on more in the future. +- `icons.html`: Information regarding Settings Menu page. Added this in for standard users. +- `terms.html`: Terms of Services, AUP and Privacy Policy page. +- `gtools.html`: Games page, help from @BinBashBanana and @kinglalu. +- `games5.html`: HTML5 game navigation page. +- `emulators.html`: Emulator navigation page, using webretro. +- `emulibrary.html`: Games page for emulated games (not included in public release) +- `flash.html`: Games page for flash games, credits given to @BinBashBanana and Titanium Network for its assets. +- `corrosion.html`: Corrosion Proxy page which features Corrosion hosted locally but can be configured to redirect to an external instance. +- `womginx.html`: Womginx Proxy page. Script links to a subdomain for Womginx, a highly fast proxy with reCaptcha and discord support. +- `palladium.html`: Palladium Proxy page. +- `youtube.html`: An proxied version of Youtube running off of the locally hosted Corrosion. +- `discord.html`: Hub for the Discord proxy. +- `reddit.html`: Hub for the Reddit proxy. + ### Structure Information -- `/views/` : The physical site base of Holy Unblocker goes here where static assets are served. -- `/src/` : For future implementation of obfuscation and keyword removing features. +- `/views/`: The physical site base of Holy Unblocker goes here where static assets are served. +- `/src/`: For future implementation of obfuscation and keyword removing features. #### Details of `/views/` -- `/pages/` is used for important pages for the site. -- `/expr/` is used for important proxy scripts. -- `/archive/` is used for game related assets and pages. -- `/assets/` is used for various assets for CSS, JS and Bootstrap. -- `/vibeOS/` is used for vibeOS, an in-browser OS enviroment. +- `/archive/` is used for game pages and vibeOS. +- `/pages/` is used for the HTML for the site. +- `/assets/` is used for various assets for CSS, JS, and images. -#### Scripts located in `/expr` +#### Scripts located in `/views/assets/js/` - `common.js` is used on all of the pages for common useful functions. -- `surf.js` is used for proxy navigation; both stealth mode and classic mode. -- `h5-nav.js`, `emu-nav.js`, `flash-nav.js` are used for navigation on the games pages. +- `prset.js` is used on the proxy pages for proxy form functionality. +- `header.js` inserts the header into every page using javascript. +- `csel.js` manages the settings menu on the header. +- `footer.js` inserts the footer into every page using javascript. +- `gnav/*.js` are used for navigation on the games pages. ## Future Additions -- Prevent large layout shifts and improve CLS. - Expansive game library - Various parity changes. -## An explanation for Beginners With External Proxies and Hosting +## Vauge Explanation for Beginners With External Proxies and Hosting You will first want to host your proxies locally or externally. -**Proxies that you will need for a complete setup for Holy Unblocker:** +#### List of some good hosting options: +- Dedipath (Paid and Dedicated) +- Heroku (Free) +- NodeClusters (Paid) +- Glitch (Free) +- Repl.it (Free) +- Azure (Free and Paid) -Womginx - https://github.com/binary-person/womginx +Out of the list of hosting providers Heroku and NodeClusters rank first as a preference. You may also self-host. -Via Unblocker/PyDodge -https://github.com/BinBashBanana/PyDodge +After you have selected a decent VPS, use Cloudflare for the DNS records for both the site and the subdomains for the proxies. -Corrosion - https://github.com/titaniumnetwork-dev/Corrosion +This is an example of DNS records involving Heroku. Self-hosting will require `A records` preferably. + -The source used for Via Unblocker on the official sites is not public. +- `@` and `www.deepsoil.ml` are being used for the local Corrosion proxy. +- `p.deepsoil.ml` is being used for Palladium. +- `a.deepsoil.ml` is being used for womginx. +- `cdn.deepsoil.ml` is being used for a private Corrosion host on the official sites. -**List of some good hosting options:** +As stated previously, Holy Unblocker is hosted locally with Corrosion. -- Dedipath (Paid and Dedicated) -- Heroku (Free) -- NodeClusters (Paid) -- Glitch (Free) -- Repl.it (Free) -- Azure (Free and Paid) +#### Heroku Steps +So you chose to use Heroku to host. I personally favor it as a free choice. -Out of the list of hosting providers Heroku and Dedipath rank first as a preference. +- First obtain a card; (Prepaid, Debit, and Credit Cards work). You need this to add custom domains to your Heroku instance. -You may also self-host. Currently, at this time, Dedipath is used to host the official Holy Unblocker sites. +Make sure you connect your Heroku app to your GitHub and enable automatic deploys. Will make things easier. :) -After you have selected a decent VPS, use Cloudflare for DNS records for both the site and the subdomains for the proxies. -The image below is an example of DNS records involving Heroku. Self-hosting will require A records, preferably. +#### Freenom/Domain Steps +For beginners, Freenom is a good provider for obtaining domains for free. However the catch is that you can only use properly "Freenom" domains for free being .cf, .ml, .gq, ga and .tk. However these can be blocked rather easily. - +- Get some Freenom domains then add them to your Heroku instance (Personal > [App Name] > Settings > Domains) +Add a domain for both `www.youdomainhere.cf` and `yourdomainhere.cf` with .cf being interchangeable with other Freenom domain names. +- If you prefer to obtain premium domains (TLDs) then use Porkbun, which offers domains for amazing prices. Literally a `.net` domain normally costs around $10. On Porkbun for the first year it costs $3 so its definitely a deal. -**The configuration being used on the official sites currently are the below:** +#### Cloudflare Steps +- Use Cloudflare (make an account), add your site (Freenom Domain or other) and then add your various DNS targets to Cloudflare. Make sure you add Cloudflare's Nameservers which will be given later when you are adding your site. -- `a.example.com` is used for Womginx. -- `c.example.com` is used for SysYA Proxy, Via Unblocker, and the Chatbox. -- `cdn.example.com` is used for a private, updated Corrosion instance. -### Heroku Steps -So use Heroku to host. I favor it as a free choice. +Make sure they are CNAME although A records also work and try to follow this structure: -- First, obtain a card; (Prepaid, Debit, and Credit Cards work). It would be best if you had this to add custom domains to your Heroku instance. -- Make sure you connect your Heroku app to your GitHub and enable automatic deploys. It will make things easier. :) +**Type | Name | Target** -### Freenom/Domain Steps -For beginners, Freenom is a good provider for obtaining domains for free. However, the catch is that you can only use properly "Freenom" domains for free, being .cf, .ml, .gq, ga, and .tk. However, these can be blocked relatively easily. +`CNAME | @ | your-main-heroku-target-here.herokudns.com` +`CNAME | www | your-main-heroku-target-here.herokudns.com` -- Get some Freenom domains, then add them to your Heroku instance (Personal > [App Name] > Settings > Domains). -- Add a domain for both www.youdomainhere.cf and yourdomainhere.cf with .cf being interchangeable with other Freedom domain names. +**Below are if you want external proxies also with your site:** -If you prefer to obtain premium domains (TLDs), then use Porkbun, which offers domains for excellent prices. A .net domain typically costs around $10. On Porkbun for the first year, it costs $3, so it is a deal. +`CNAME | p | your-palladium-instance-here.herokudns.com` +`CNAME | a | your-womginx-instance-here.herokudns.com` +`CNAME | pd | your-pydodgeb-instance-here.herokudns.com` -### Cloudflare Steps -Use Cloudflare (make an account), add your site (Freenom Domain or Domain), and then add your various DNS targets to Cloudflare. Make sure you add Cloudflare's Nameservers which will be specified more when you are adding your site. +Make sure HTTPS is forced and have SSL set to Flexible for Heroku. Otherwise you can have SSL set to Full. -Lastly, for targets, make sure they are either a CNAME, AAAA, or A records and try to follow this structure: +#### Workspace Configurations +Preferably if you have your own device use Visual Studio Code. Pretty much the best option you can get but obviously this is an opinion. Also make sure you have Node.JS installed on your machine. -Type | Name | Target +Not going to go too in depth with this part but first fork this repository. The clone it locally through a Terminal of some sort depending on what OS you are on. Make sure you navigate to the folder you want to set this up in. -`CNAME | @ | yourherokudnstargethere.herokudns.com` or `CNAME | @ | example.com` - -`CNAME | www | yourherokutargethere.herokudns.com` or `CNAME | www | example.com` - -Below are if you want external proxies also with your site: - -`CNAME | a | yourwomginxinstance.herokudns.com` or `CNAME | a | example.com` -`CNAME | c | yoursysyaproxyinstancehere.herokudns.com` or `CNAME | c | example.com` - -(You get the idea.) - -Make sure HTTPS is forced and have SSL set to Flexible for Heroku. Otherwise, you may have SSL set to Full. Use LetsEncrypt for SSL certificates or Cloudflare. - -## Workspace Configurations -Preferably use Visual Studio Code for an IDE. Pretty much the best option you can get, but obviously, this is an opinion. Also, make sure you have Node.JS installed on your machine. - -Not going to go too in-depth with this part but first, fork or clone this repository. Clone it locally through a terminal of some sort, depending on what OS you are on. - -Make sure you navigate to the folder you want to set this up in. ``` -$ git clone https://github.com/QuiteAFancyEmerald/HolyUnblockerPublic.git -$ cd HolyUnblockerPublic -$ npm install +git clone https://github.com/titaniumnetwork-dev/Holy-Unblocker.git + +cd Holy-Unblocker + +npm install ``` -Setup pm2 (Optional - Node.js Process Manager) + +Now simply add the folder you cloned this repo in in VSC. Then run `npm install`. I recommend that if you are releasing this publically on GitHub that you add a `.gitignore` in your root directory with the following exclusions: + ``` -$ npm install pm2@latest -g -$ pm2 start app.js +node_modules ``` -Useful pm2 Flags -``` -# Specify an app name ---name -# Watch and Restart app when files change ---watch +Now you have your following workspace environment setup. To deploy the following workspace you just created you will need to look up depending on your hosting provider. -# Set memory threshold for app reload ---max-memory-restart <200MB> -``` -For more information, view the official pm2 documentation here. +For an online IDE that you can use on your school computer and/or chromebook use GitPod. Basically the equivalent of Visual Studio Code but with in-browser support. +- Make an account: `https://gitpod.io/` +- Fork this repo and enter in this URL to setup your workspace: `https://gitpod.io#https://github.com/YourNameHere/Holy-Unblocker/` -#### Workspace Setup (continued) -Now add the folder you cloned in VSC. Then run npm install. It is recommended that if you are releasing this publically on GitHub that you add a .gitignore in your root directory with the following exclusions: - -`node_modules` - -Now you have your following workspace environment setup. To deploy the following workspace you just created, you will need to lookup depending on your hosting provider. - -- For an online IDE that you can use on your school computer or Chromebook, use GitPod. The equivalent of Visual Studio Code but with in-browser support. -- Make an account: https://gitpod.io/. -- Fork this repo and enter in this URL to set up your workspace: `https://gitpod.io#https://github.com/YourNameHere/HolyUnblockerPublic/` - -Use the same steps above by running npm install in your repository and adding a .gitignore in your root directory specifying to exclude `node_modules`. +Use the same steps above by running `npm install` in your repository and adding a `.gitignore` in your root directory specifying to exclude `node_modules`. ## Detailed FAQ -A detailed FAQ with common issues and solutions can be found here or on any official HU site on the FAQ page. +A detailed FAQ with common issues and solutions can be found here or on any official HU site on the FAQ page. -**Why are YouTube videos not working?** - -If you have persistent issues even after doing the steps above, the instance is down temporarily, especially if large groups of people are also having the issue. The latest release of Corrosion does have support for YouTube. You may want to try doing a Hard Reload (Ctrl+Shift+R) +
+Quick FAQ **Why is the site I am on not working correctly or having CAPTCHA errors?** -Captcha has limited support on Womginx. However, support is not available on some of the older proxies, sadly. Therefore some sites may not work with any of the sites. Read below for issues with links on sites. +Captcha support is currently not available on all of the current proxies sadly. Therefore some sites may not work with any of the sites. Read below for issues with links on sites. -**When using YouTube on any of the proxy sites, why does the page not load entirely, or the video just white?** +**Why are some page links not working or leading to 404 pages?** + +This is an issue with the latest release of Alloy proxy but it may also occur with other proxies. + +In this case manually entering the URL of the page you would like to view can solve this or try navigating using the home button. (Reddit, Twitter) The next release of Alloy may fix this also. + +**When using YouTube on any of the proxy sites, why does the page not load fully or the video is just white?** There are two methods for fixing this: -- Reloading the page usually when the error above happens should load the video. -- Alternatively, right-clicking the page and doing Reload Frame if you are using some form of Stealth Mode may work. -**On the official sites, I am getting 502 errors. What do I do?** +- Reloading the page normally when the error above happens should load the video. +- Or right-clicking the page and doing Reload Frame if you are using some form of Stealth Mode. -The proxy may be down, being worked on, or is under high load. -When this happens, you may either switch sites to fix the error or wait a bit. Sometimes clearing your cache can help by doing Ctrl+Shift+R or reloading the page usually. (Hard Reload, which purges cache.) +**When using Discord under Alloy or SysYa, why does the page stay gray/white or the QR code not load?** + +Once again do the same steps above: +- Reloading the page normally when the error above happens should load the video +- Or right-clicking the page and doing Reload Frame if you are using some form of Stealth Mode. + +Make sure you are also doing the steps correctly. Simply view link above for extended Discord proxy information/steps. + +**I am getting 502 errors. What do I do?** + +When this happens you may either switch sites to fix the error or wait a bit. Sometimes clearing your cache can help. + +If you still have any questions feel free to ask them in the discord linked here. + +
## More Information This project is maintained by Quite A Fancy Emerald with massive help from BinBashBanana (OlyB) and is an official flagship Titanium Network proxy site. -- https://titaniumnetwork.org/ -- https://github.com/titaniumnetwork-dev/ +- https://github.com/titaniumnetwork-dev/ +- https://titaniumnetwork.org/ -View the official website for more details or credits. +View the official website for more detail and credits. ### Proxy Sources: -This project currently uses Corrosion, Womginx, and PyDodgeB, linked below. +This project currently uses Corrosion, Womginx, and Palladium, linked below. -- https://github.com/titaniumnetwork-dev/Corrosion (Corrosion) -- https://github.com/binary-person/womginx (Womginx) -- https://github.com/BinBashBanana/PyDodge (PyDodge)** -- https://github.com/BlaNKtext/web-osu (webosu or owu!) +- Corrosion +- Womginx +- Palladium +- PyDodge + +### Other: + +- vibeOS +- webretro +- Ruffle +- webosu ### Notable Mentions: -- https://dedipath.com (Hosting Provider) -### Footnotes: -- The official Holy Unblocker sites use a private, modified version of Via and goes under the name PyDodge for any modified version. -- Node Unblocker is no longer used on any of the official Titanium Network flagship sites. +- SoYouStart / OVH (Hosting Provider) Thanks :D diff --git a/app.json b/app.json index ecf57956..fcf52ef5 100644 --- a/app.json +++ b/app.json @@ -2,6 +2,6 @@ "name": "Holy Unblocker", "description": "Holy Unblocker is a secure web proxy service supporting numerous sites while concentrating on detail with design, mechanics, and features. Bypass web filters regardless of whether it is an extension or network-based.", "repository": "https://github.com/titaniumnetwork-dev/Holy-Unblocker", - "logo": "https://github.com/titaniumnetwork-dev/Holy-Unblocker/blob/master/views/assets/img/i.png?raw=true", + "logo": "https://raw.githubusercontent.com/titaniumnetwork-dev/Holy-Unblocker/master/views/assets/img/icon.png", "keywords": ["holyunblocker", "womginx", "corrosion", "titaniumnetwork", "node", "proxy", "unblocker", "webproxy", "games"] } \ No newline at end of file diff --git a/backend.js b/backend.js index f3951689..ad2a9585 100644 --- a/backend.js +++ b/backend.js @@ -1,6 +1,6 @@ /* ----------------------------------------------- * Authors: QuiteAFancyEmerald, BinBashBanana (OlyB), YÖCTDÖNALD'S and the lime - * Additional help from Divide and SexyDuceDuce >:D test aaaa + * Additional help from Divide and SexyDuceDuce >:D * ----------------------------------------------- */ const fs = require('fs'); const path = require('path'); @@ -12,7 +12,7 @@ const config = require('./config.json'); const insert = require('./randomization.json'); const app = express(); const port = process.env.PORT || config.port; -const server = config.ssl ? https.createServer({ key: fs.readFileSync('./ssl/ssl.key'), cert: fs.readFileSync('./ssl/ssl.cert') }, app) : http.createServer(app); +const server = http.createServer(app); btoa = (str) => { return new Buffer.from(str).toString('base64'); @@ -22,80 +22,83 @@ atob = (str) => { return new Buffer.from(str, 'base64').toString('utf-8'); } -const text404 = fs.readFileSync(path.normalize(__dirname + '/views/404.html'), 'utf8'), - pages = { - 'index': 'index.html', - /* Main */ - 'in': 'info.html', - 'faq': 'faq.html', - 'j': 'hidden.html', - 's': 'pages/frame.html', - 'z': 'pages/surf.html', - 'c': 'pages/nav/credits.html', - 'x': 'pages/nav/bookmarklets.html', - 'i': 'pages/nav/icons.html', - 't': 'pages/nav/terms.html', - /* Games */ - 'g': 'pages/nav/gtools.html', - 'h': 'pages/nav/games5.html', - 'el': 'pages/nav/emulators.html', - 'f': 'pages/nav/flash.html', - 'm': 'pages/nav/emulibrary.html', - /* Proxies */ - 'q': 'pages/proxnav/corrosion.html', - 'w': 'pages/proxnav/womginx.html', - 'y': 'pages/proxnav/youtube.html', - 'd': 'pages/proxnav/discordhub.html', - /* Ruffle and Webretro */ - 'fg': 'archive/gfiles/flash/index.html', - 'eg': 'archive/gfiles/rarch/index.html' - }; +const text404 = fs.readFileSync(path.normalize(__dirname + '/views/404.html'), 'utf8'); +const pages = { + 'index': 'index.html', + /* Main */ + 'in': 'docs.html', + 'faq': 'faq.html', + 'j': 'hidden.html', + 's': 'pages/frame.html', + 'z': 'pages/surf.html', + 'c': 'pages/nav/credits.html', + 'x': 'pages/nav/bookmarklets.html', + 'i': 'pages/nav/icons.html', + 't': 'pages/nav/terms.html', + /* Games */ + 'g': 'pages/nav/gtools.html', + 'h': 'pages/nav/games5.html', + 'el': 'pages/nav/emulators.html', + 'f': 'pages/nav/flash.html', + 'm': 'pages/nav/emulibrary.html', + /* Proxies */ + 'q': 'pages/proxnav/corrosion.html', + 'w': 'pages/proxnav/womginx.html', + /* Proxy Presets */ + 'y': 'pages/proxnav/preset/youtube.html', + 'd': 'pages/proxnav/preset/discord.html', + 'r': 'pages/proxnav/preset/reddit.html', + /* Misc */ + 'fg': 'archive/gfiles/flash/index.html', + 'eg': 'archive/gfiles/rarch/index.html', + 'vos': 'archive/vibeOS/index.html' +}; const cookingInserts = insert.content; const vegetables = insert.keywords; const charRandom = insert.chars; +const cacheBustList = { + // "styles.css": "styles-1642900360.min.css", + "common.js": "common-1643838852.js", + "links.js": "links-1642900360.js" +}; function randomListItem(lis) { return lis[Math.floor(Math.random() * lis.length)]; } -function redditFix(str) { - return str.replace(/Ch­a­tbo­x/g, 'Re­dd­it'); -} - function insertCharset(str) { - return str.replace(/­|​|/g, function() { return randomListItem(charRandom); }); + return str.replace(/­|​|­|/g, function() { return randomListItem(charRandom); }); // this needs to be inside a function, so that not every string is the same } function insertCooking(str) { - return str.replace(//g, function() { return '' + randomListItem(cookingInserts) + ''; }); + return str.replace(//g, function() { return '' + randomListItem(cookingInserts) + ''; }); // this needs to be inside a function, so that not every string is the same +} + +function splashPublic(str) { + return str.replace(//g, function() { return '

Jo‌­in t‌he T⁡­N Di‌s­co⁡­rd for more pr­iva️te sit‌e lin­ks. Note that this is the public version of HU which is not official. Things may not work or are unsecure.

'; }); // this needs to be inside a function, so that not every string is the same } function cacheBusting(str) { - return str.replace(/styles.min.css/g, 'styles-1636936688.min.css'); -} - -function cacheBusting2(str) { - return str.replace(/common.js/g, 'common-1628457888.js'); -} - -function cacheBusting3(str) { - return str.replace(/surf.js/g, 'surf-1628130462.js'); + for (var item of Object.entries(cacheBustList)) { + str = str.replace(new RegExp(item[0], "g"), item[1]); + } + return str; } function insertAll(str) { - return insertCharset(insertCooking(redditFix(cacheBusting(cacheBusting2(cacheBusting3(str)))))); + return insertCharset(insertCooking(splashPublic(cacheBusting(str)))); } function tryReadFile(file) { return fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : text404; } +let blacklist; + const fetch = (...args) => import ('node-fetch').then(({ default: fetch }) => fetch(...args)); -let blacklist; - fetch("https://blocklistproject.github.io/Lists/alt-version/everything-nl.txt").then(response => response.text()).then(data => { blacklist = data.split("\n") && config.blacklist; }); @@ -103,7 +106,6 @@ fetch("https://blocklistproject.github.io/Lists/alt-version/everything-nl.txt"). const proxy = new corrosion({ title: config.title, prefix: config.prefix || '/search/', - forceHttps: true, codec: config.codec || 'xor', ws: config.ws, requestMiddleware: [ @@ -120,7 +122,7 @@ app.get('/', async(req, res) => res.send(insertAll(tryReadFile(path.normalize(__ app.use(express.static(path.normalize(__dirname + '/views'))); app.use((req, res) => { if (req.url.startsWith(proxy.prefix)) return proxy.request(req, res); - res.status(404, res.send(insertAll(text404))) + res.status(404).send(insertAll(text404)); }); server.listen(port); diff --git a/config.json b/config.json index 6d1d668a..ecd29f8a 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "title": "Untitled Document", + "title": "HU OSS", "port": "8080", "ssl": false, "ws": true, diff --git a/ecosystem.config.js b/ecosystem.config.js index f494b6d9..ecdffd90 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -1,6 +1,6 @@ module.exports = { apps: [{ - name: 'HolyUB', + name: 'HolyUnblockerPublic', script: './backend.js', env: { PORT: 8080, diff --git a/package.json b/package.json index 64868905..df93977a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "holyub", - "version": "4.8.0", + "version": "5.0.0", "repository": "https://github.com/QuiteAFancyEmerald/Holy-Unblocker", "description": "Holy Unblocker is a secure web proxy service with support for many sites.", "main": "backend.js", @@ -18,7 +18,10 @@ "corrosion": "^1.0.0", "express": "^4.17.1", "mime-types": "^2.1.27", - "ws": "^7.5.3", - "node-fetch": "^3.1.0" + "node-fetch": "^3.2.0", + "ws": "^7.5.3" + }, + "engines": { + "node": ">=12.20.0" } -} \ No newline at end of file +} diff --git a/randomization.json b/randomization.json index 7c104e45..8b74319f 100644 --- a/randomization.json +++ b/randomization.json @@ -1,16 +1,35 @@ { "chars": [ - "­", "​" + "", "⁤", "‌", "️", "⁦", "", "", "", "‌", "", "⁢", "⁡", "‭", "️" ], "keywords": [ - "RandomTerm1", "RandomTerm2", "RandomTerm3", "RandomTerm4", "RandomTerm5", "RandomTerm6" + "Thanksgiving", "Science", "Reading", "Physics", "Academic", "Algebra", "Geometry", "Onion", "Asparagus", "Rhubarb", "Celery", "Lettuce", "Spinach", "Kale", "Cabbage", "Arugula", "Broccoli", "Artichoke", "Cauliflower", "Tomato", "Avocado", "Pepper", "Squash", "Pumpkin", "Zucchini" ], "content": [ - "RandomTermRandomTermRandomTermRandomTermRandomTermRandomTermRandomTermRandomTermRandomTermRandomTermRandomTermRandomTerm", - "RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2RandomTerm2", - "RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3RandomTerm3", - "RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4RandomTerm4", - "RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5RandomTerm5", - "RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6RandomTerm6" + "Cooking is something that most people are doing or try to do. Some do it as a profession, some do it for fun, and some do it because they have to do it. People are going to cooking, because some food is raw that people cannot eat it, because it is not tasty.", + "Olive Garden opened in 1982 specializing in Italian based food. They have pasta, breadsticks, and soup. Zuppa Toscana is a soup that is one of their most popular soups. Its spicy kick, and creamy tasting is the best part about it. This recipe is very easy to make, but is the best at Olive Garden.", + "Homemade chicken avocados lime soup, doesn’t that sound Delicious! This simple, yet filling dish can serve a family of six. The preparation time takes roughly fifteen minutes and cook time is approximately twenty minutes.", + "Let’s discuss their Food Quality. They're very well known for their wide mixture of pizzas from pepperoni, pepperoni and sausage, Colby classic, and bourbon street.", + "The dinner menu I will be preparing to celebrate a special occasion will include: a nice juicy steak, fresh corn on the cob, hash brown with bacon casserole, and for the dessert peanut butter pie.", + "Enter the spice aisle and grab one bottle of onion powder and one of... hamburger seasoning. Also, go to the vegetable area and pick up one regular onion. Then, walk back to the meat section and pick up a package of ground meat. Go to the bread aisle and grab a pack of the original Hawaiian sub-rolls and a pan that the rolls will fit into. Everybody knows that cheese is what tops off a good cheeseburger slider, so go pick up a pack of the favorite type of.", + "Entertaining for Thanksgiving can be very rewarding, and very exhausting. Over the years I have found that planning and preparing for the big day is essential. I love to cook. I enjoy preparing a wonderful Thanksgiving meal for my loved ones. Peel tomatoes with ease! Cut an X in the top, and then simmer in a pot of hot water for 15 to 30 seconds. Cool down and the skin will fall right off.", + "To create an egg wash, whisk together a large egg with one tablespoon of water until smooth. Use as a glue to seal pastries, then brush on top for a glossy appearance.", + "Embrace salt. Don’t be afraid to use salt; it pulls the flavors out of your dishes. Cook with kosher salt and season with sea salt.", + "For a great hard boiled egg every time, bring your pot to a boil and then turn off the heat. Let your eggs sit in the heated pot for 12 minutes and then transfer to cold water.", + "From the beginning of times people have relied and survived on past educators. There are many people that contribute to a individual's education. Starting off as a young child most of the information retrieved comes from home through parents, and loved ones.", + "Education is the process of acquiring knowledge. True education comes in many different forms. Granted it is important to study the basic academic courses including reading, writing, arithmetic, science, and social studies which all will help set a strong foundation for the student.", + "Education is a transforming journey of an individual. It is a journey that accompanies achievements, struggles, success, failures, importance, and efforts. Education begins at home, with parents, and continue the lifelong journey till death. It is through education, an individual’s quality life gets determined.", + "A Formal Education teaches an individual to learn academic skills, and this Education begins at the elementary level and continues until college. The process follows a set of rules and regulations for the completion of a formal degree.", + "Informal Type: Informal Education uses no specific tools to understand learning. A person attains Informal Education though reading books, learning bicycle, playing chess, etc. Informal Education holds equal importance in life. Non-Formal Type: Non-Formal Education uses awareness programs such as adult literacy and basic education programs to promote Education. It has no time table, syllabus, and age limit and can be adjustable.", + "The parent function of the quadratic family is f(x) = x 2 . A transformation of the graph of the parent function is represented by the function g(x) = a(x − h) 2+ k, where a ≠ 0. Match each quadratic function with its graph. Explain your reasoning. Then use a graphing calculator to verify that your answer is correct.", + "A quadratic function is a function that can be written in the form f(x) = a(x − h) 2+ k, where a ≠ 0. The U-shaped graph of a quadratic function is called a parabola. In Section 1.1, you graphed quadratic functions using tables of values. You can also graph quadratic functions by applying transformations to the graph of the parent function f(x) = x 2 .", + "In Example 2b, notice that g(x) = 4x 2+ 1. So, you can also describe the graph of g as a vertical stretch by a factor of 4 followed by a translation 1 unit up of the graph of f. So, the graph of g is a reflection in the x-axis and a vertical shrink by a factor of 1 — 2 of the graph of f. Notice that the function is of the form g(x) = (ax) 2 + k, where a = 2 and k = 1.", + "Linear equations in one variable have huge number of applications and are used in calculation of various types of problems. Some of the most common and prevalent applications of Linear equations in one variable are: 1) They are used in solving problems involving relationships between real numbers. 2) They are used in geometry for problems involving calculation of perimeter or sides. 3) They are very commonly used in problems involving Money and Percents. 4) They are used extensively in time, distance and speed problems.", + "Formula / General method to solve Linear Equations: 1) Clear Fractions: It involves multiplying both sides of the equation by Least Common Denominator. 2) Simplifying each side separately: This step uses distributive property to clear parentheses and combine like terms. 3) Isolating variable terms on one side 4) Substituting the proposed solution into the original equation. This formula is a generic and can be used to solve all the linear equations in one variable. Linear Inequalities: A linear inequality involves a linear expression in two variables by using any of the relational symbols such as <, >, <= or >= (IcoachMath, n.d.).", + "What is Science? When it comes to the word ‘science’ most of the people have some kind of knowledge about science or when they think of it there is some kind of image related to it, a theory, scientific words or scientific research (Beyond Conservation, n.d.). Many different sorts of ideas float into an individual’s mind. Every individual has a different perception about science and how he/she perceives it. It illustrates that each person can identify science in some form. It indicates that the...", + "We discover scientific knowledge in various natural science fields such as biology or chemistry. A common misconception about the natural sciences is that both the knowledge they reveal to us and the scientific method used in discovering this are purely analytical. This means that these sciences are rigid in facts and do not contain any subjectivity or creativity. However, the scientific method is not a rigid system of pursuing measurable facts. It contains fallacies and biases. In testing hypotheses...", + "It more than seconds or minutes or even hours? Since the definition of time is duration and duration is just the passage of time, so the curiosity to know exactly what time is entranced my interest in Physics.", + "The book “Physics of the Impossible” was written by Japanese American theoretical physicist Michio Kaku. Kaku generally writes books about physics or physics related topics. Among his three New Work Times best seller, Physics of Impossible is one in which Kaku utilizes discourse of theoretical advancements to acquaint themes of basic material science with the reader. In this book, Kaku represents physics in various ways so that the reader understands the significance of physics and implement in his/her...", + "A Century of Physics By the end of the nineteenth century after more than two thousand years of intellectual struggle that began with the Greek philosophers, physical scientists had reason to believe that they were beginning to understand the universe. Their theories of matter and energy, of electricity and magnetism, of heat and sound and light were confirmed in laboratories throughout the world with increasing precision. Experimentation was the method and mathematics the language of a..." ] } \ No newline at end of file diff --git a/ssl/ssl.cert b/ssl/ssl.cert deleted file mode 100644 index f87b9e0f..00000000 --- a/ssl/ssl.cert +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDqzCCApOgAwIBAgIJAJnCkScWtmL0MA0GCSqGSIb3DQEBCwUAMGwxCzAJBgNV -BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMRgwFgYDVQQKDA9UaXRhbml1bU5l -dHdvcmsxDjAMBgNVBAsMBWdhbWVyMR4wHAYDVQQDDBUqLnRpdGFuaXVtbmV0d29y -ay5vcmcwHhcNMjAwNjEzMTg0OTU2WhcNMjEwNjEzMTg0OTU2WjBsMQswCQYDVQQG -EwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEYMBYGA1UECgwPVGl0YW5pdW1OZXR3 -b3JrMQ4wDAYDVQQLDAVnYW1lcjEeMBwGA1UEAwwVKi50aXRhbml1bW5ldHdvcmsu -b3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwPL69+RE6r8RrFh4 -njzC8ZRnLB+yNtuGw14C0dvNb5JwgdLl5g9/wK/s0V5NGlqwxlQlxQ/gUSuYEcUR -6MYjcnaUmZZe/gaKVV0fkfkuigOWhLnI5AQxx7rhkzx1ujuyJ9D2pkDtZpSvv0yn -2yrvWhJMtjuxGYip8jaLuRpbXoafvR7nrlDaNcE/GwIjnCCxsRnY2bGbxYK840mN -fuMfF2nz+fXKPuQ/9PT48e3wOo9vM5s7yKhiHYwrogqzGN4cH4sSr1FE8C7flFyT -Yw101u7fUaopfeGCo9Pg6IrfzyzE5Qb7OlqlVk2IkvXx7pPqVc6lZCJEhOX/qF9o -n3mFqwIDAQABo1AwTjAdBgNVHQ4EFgQUC561ob2kGtFQ4az6y64b98+Fy+IwHwYD -VR0jBBgwFoAUC561ob2kGtFQ4az6y64b98+Fy+IwDAYDVR0TBAUwAwEB/zANBgkq -hkiG9w0BAQsFAAOCAQEAotvUsSLSzFyxQz329tEPyH6Tmi19FQoA5ZbLg6EqeTI9 -08qOByDGkSYJi0npaIlPO1I557NxRzdO0PxK3ybol6lnzuSlqCJP5nb1dr0z2Eax -wgKht9P+ap/yozU5ye05ah2nkpcaeDPnwnnWFmfsnYNfgu62EshOS+5FETWEKVUb -LXQhGInOdJq8KZvhoLZWJoUhyAqxBfW4oVvaqs+Ff96A2NNKrvbiAVYX30rVa+x0 -KIl0/DoVvDx2Q6TiL396cAXdKUW7edRQcSsGFcxwIrU5lePm0V05aN+oCoEBvXBG -ArPN+a5kpGjJwfcpcBVf9cJ6IsvptGS9de3eTHoTyw== ------END CERTIFICATE----- \ No newline at end of file diff --git a/ssl/ssl.key b/ssl/ssl.key deleted file mode 100644 index a878bfd4..00000000 --- a/ssl/ssl.key +++ /dev/null @@ -1,28 +0,0 @@ ------BEGIN PRIVATE KEY----- -MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDA8vr35ETqvxGs -WHiePMLxlGcsH7I224bDXgLR281vknCB0uXmD3/Ar+zRXk0aWrDGVCXFD+BRK5gR -xRHoxiNydpSZll7+BopVXR+R+S6KA5aEucjkBDHHuuGTPHW6O7In0PamQO1mlK+/ -TKfbKu9aEky2O7EZiKnyNou5Gltehp+9HueuUNo1wT8bAiOcILGxGdjZsZvFgrzj -SY1+4x8XafP59co+5D/09Pjx7fA6j28zmzvIqGIdjCuiCrMY3hwfixKvUUTwLt+U -XJNjDXTW7t9Rqil94YKj0+Doit/PLMTlBvs6WqVWTYiS9fHuk+pVzqVkIkSE5f+o -X2ifeYWrAgMBAAECggEAbihK8Ev6rKr5RBQeiPjXs2SuoppV/MvIXLHHmliLKS/J -29S0PGyM202VPtM/4dP1KMXR6nft8WmaIEsKtoKoqijZHfajtRO21pWb+JLy5wi1 -XoFTGBrs8MLZFl5mODTsuZ6rsq9O2kn5LJZvHsmcbSgVc9UQfytvG0HY840ArS3g -kSDtUFb1xRui6wtCBKzHVvCT+FXhSBbwkHalmbqP6BefhJ3lW2VonkOcHDrdXPfW -CEN18IJ2v8QYgXqZP6VUlAweNXLJ33ZOl+jXGdygcOG24MFqdw0VtP0XFGk0jnSS -W6dX67BZKeZ71EKaTy02jw5LpQNXA70ismPJHQ2uQQKBgQDuROawnBIW1fC3xOle -m+JmP0eMe0eIQycxRsMXsXhYAA0wV3qYZSLZrNK2eRhmSNt+ODSmZ2Vt11dwOv5u -bo8WONrRlM097SmitS2S+8o7ASem2VKQzyRE72Y9517Q+aNBdLRVtjrRNSw/hfSu -ayLuG36+yukSH7wq7mfoUX34ZwKBgQDPTrgyyw8n5XhZT/qTTRnQJ2GTvPxDzNoJ -IAGhGJGFAb6wgLoSpGx6BC122vuRxcTjkjAiMDci5N2zNW+YZVni+F0KTVvNFfU2 -pOTJUg3luRTygCra6O02PxwpbP/9KCBAKq/kYw/eBW+gxhPwP3ZrbAirvBjgBh0I -kIrFijNOHQKBgGUUAbFGZD4fwCCVflLOWnr5uUaVPcFGi6fR1w2EEgNy8iVh1vYz -YVdqg3E5aepqWgLvoRY+or64LbXEsQ70A+tvbxSdxXvR0mnd5lmGS0JAuSuE4gvg -dAhybrMwJf8NB/7KnX4G8mix3/WKxEQB2y2bqGcT+U/g+phTzuy1NXVdAoGBAIrl -jVjK4J60iswcYCEteWwT1rbr2oF60WNnxG+xTF63apJLzWAMNnoSLnwCAKgMv/xR -yFo/v9FrUnduCBUtYupFyeDLMATa/27bUEbq6VDPjw9jfFMr2TONWUsQMvvlVKZp -c2wsS0dQkRhBXr6LZsZWngCiiHAg6HcCkVgFXpapAoGBAJ/8oLGt0Ar+0MTl+gyk -xSqgHnsc5jgqhix3nIoI5oEAbfibdGmRD1S3rtWD9YsnPxMIl+6E5bOAHrmd+Zr8 -O7EP+CLvbz4JXidaaa85h9ThXSG5xk1A1UTtSFrp+KolLE1Vvmjjd+R844XsM2wZ -OAHbihzk0iPPphjEWR4lU4Av ------END PRIVATE KEY----- \ No newline at end of file diff --git a/views/401.html b/views/401.html new file mode 100644 index 00000000..4878aac2 --- /dev/null +++ b/views/401.html @@ -0,0 +1,44 @@ + + + + + + + + H­o­ly Un­blo­ck­er | Error + + + + + + + + + + + +
+
+
+

401 Error | Authorization Required

+

Please access this page from the official site or view the FAQ page for help.

+
+

This mainly serves as bot protection. Navigating to this page through the official site will resolve this or try doing Ctrl+Shift+R.

+

The site may have been updated recently and changes have not been made universal yet due to cache.

+
+
+ + + + + + + + \ No newline at end of file diff --git a/views/404.html b/views/404.html index db6c82d3..fb5b49e9 100644 --- a/views/404.html +++ b/views/404.html @@ -1,71 +1,36 @@ - + - - - - H​oly Unb​loc​ke​r | 404 - + + + + H­o­ly Un­blo­ck­er | 404 + + - - - - - - - - - - - + + - -
-

404 Error

-

The requested file was not found on this server!

-

View the FAQ page for help?

-
- ',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:Cn,popperConfig:null},Fn="show",Mn="out",Wn={HIDE:"hide"+Nn,HIDDEN:"hidden"+Nn,SHOW:"show"+Nn,SHOWN:"shown"+Nn,INSERTED:"inserted"+Nn,CLICK:"click"+Nn,FOCUSIN:"focusin"+Nn,FOCUSOUT:"focusout"+Nn,MOUSEENTER:"mouseenter"+Nn,MOUSELEAVE:"mouseleave"+Nn},Un="fade",Bn="show",qn=".tooltip-inner",Kn=".arrow",Qn="hover",Vn="focus",Yn="click",zn="manual",Xn=function(){function i(e,t){if("undefined"==typeof St)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=e,this.config=this._getConfig(t),this.tip=null,this._setListeners()}var e=i.prototype;return e.enable=function(){this._isEnabled=!0},e.disable=function(){this._isEnabled=!1},e.toggleEnabled=function(){this._isEnabled=!this._isEnabled},e.toggle=function(e){if(this._isEnabled)if(e){var t=this.constructor.DATA_KEY,n=p(e.currentTarget).data(t);n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),p(e.currentTarget).data(t,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(p(this.getTipElement()).hasClass(Bn))return void this._leave(null,this);this._enter(null,this)}},e.dispose=function(){clearTimeout(this._timeout),p.removeData(this.element,this.constructor.DATA_KEY),p(this.element).off(this.constructor.EVENT_KEY),p(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&p(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},e.show=function(){var t=this;if("none"===p(this.element).css("display"))throw new Error("Please use show on visible elements");var e=p.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){p(this.element).trigger(e);var n=m.findShadowRoot(this.element),i=p.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(e.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=m.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&p(o).addClass(Un);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();p(o).data(this.constructor.DATA_KEY,this),p.contains(this.element.ownerDocument.documentElement,this.tip)||p(o).appendTo(l),p(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new St(this.element,o,this._getPopperConfig(a)),p(o).addClass(Bn),"ontouchstart"in document.documentElement&&p(document.body).children().on("mouseover",null,p.noop);var c=function(){t.config.animation&&t._fixTransition();var e=t._hoverState;t._hoverState=null,p(t.element).trigger(t.constructor.Event.SHOWN),e===Mn&&t._leave(null,t)};if(p(this.tip).hasClass(Un)){var h=m.getTransitionDurationFromElement(this.tip);p(this.tip).one(m.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},e.hide=function(e){function t(){n._hoverState!==Fn&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),p(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()}var n=this,i=this.getTipElement(),o=p.Event(this.constructor.Event.HIDE);if(p(this.element).trigger(o),!o.isDefaultPrevented()){if(p(i).removeClass(Bn),"ontouchstart"in document.documentElement&&p(document.body).children().off("mouseover",null,p.noop),this._activeTrigger[Yn]=!1,this._activeTrigger[Vn]=!1,this._activeTrigger[Qn]=!1,p(this.tip).hasClass(Un)){var r=m.getTransitionDurationFromElement(i);p(i).one(m.TRANSITION_END,t).emulateTransitionEnd(r)}else t();this._hoverState=""}},e.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},e.isWithContent=function(){return Boolean(this.getTitle())},e.addAttachmentClass=function(e){p(this.getTipElement()).addClass(Ln+"-"+e)},e.getTipElement=function(){return this.tip=this.tip||p(this.config.template)[0],this.tip},e.setContent=function(){var e=this.getTipElement();this.setElementContent(p(e.querySelectorAll(qn)),this.getTitle()),p(e).removeClass(Un+" "+Bn)},e.setElementContent=function(e,t){"object"!=typeof t||!t.nodeType&&!t.jquery?this.config.html?(this.config.sanitize&&(t=In(t,this.config.whiteList,this.config.sanitizeFn)),e.html(t)):e.text(t):this.config.html?p(t).parent().is(e)||e.empty().append(t):e.text(p(t).text())},e.getTitle=function(){var e=this.element.getAttribute("data-original-title");return e=e||("function"==typeof this.config.title?this.config.title.call(this.element):this.config.title)},e._getPopperConfig=function(e){var t=this;return l({},{placement:e,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:Kn},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(e){e.originalPlacement!==e.placement&&t._handlePopperPlacementChange(e)},onUpdate:function(e){return t._handlePopperPlacementChange(e)}},{},this.config.popperConfig)},e._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=l({},e.offsets,{},t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},e._getContainer=function(){return!1===this.config.container?document.body:m.isElement(this.config.container)?p(this.config.container):p(document).find(this.config.container)},e._getAttachment=function(e){return Hn[e.toUpperCase()]},e._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(e){if("click"===e)p(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(e){return i.toggle(e)});else if(e!==zn){var t=e===Qn?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=e===Qn?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;p(i.element).on(t,i.config.selector,function(e){return i._enter(e)}).on(n,i.config.selector,function(e){return i._leave(e)})}}),this._hideModalHandler=function(){i.element&&i.hide()},p(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},e._fixTitle=function(){var e=typeof this.element.getAttribute("data-original-title");!this.element.getAttribute("title")&&"string"==e||(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},e._enter=function(e,t){var n=this.constructor.DATA_KEY;(t=t||p(e.currentTarget).data(n))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),p(e.currentTarget).data(n,t)),e&&(t._activeTrigger["focusin"===e.type?Vn:Qn]=!0),p(t.getTipElement()).hasClass(Bn)||t._hoverState===Fn?t._hoverState=Fn:(clearTimeout(t._timeout),t._hoverState=Fn,t.config.delay&&t.config.delay.show?t._timeout=setTimeout(function(){t._hoverState===Fn&&t.show()},t.config.delay.show):t.show())},e._leave=function(e,t){var n=this.constructor.DATA_KEY;(t=t||p(e.currentTarget).data(n))||(t=new this.constructor(e.currentTarget,this._getDelegateConfig()),p(e.currentTarget).data(n,t)),e&&(t._activeTrigger["focusout"===e.type?Vn:Qn]=!1),t._isWithActiveTrigger()||(clearTimeout(t._timeout),t._hoverState=Mn,t.config.delay&&t.config.delay.hide?t._timeout=setTimeout(function(){t._hoverState===Mn&&t.hide()},t.config.delay.hide):t.hide())},e._isWithActiveTrigger=function(){for(var e in this._activeTrigger)if(this._activeTrigger[e])return!0;return!1},e._getConfig=function(e){var t=p(this.element).data();return Object.keys(t).forEach(function(e){-1!==xn.indexOf(e)&&delete t[e]}),"number"==typeof(e=l({},this.constructor.Default,{},t,{},"object"==typeof e&&e?e:{})).delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),m.typeCheckConfig(An,e,this.constructor.DefaultType),e.sanitize&&(e.template=In(e.template,e.whiteList,e.sanitizeFn)),e},e._getDelegateConfig=function(){var e={};if(this.config)for(var t in this.config)this.constructor.Default[t]!==this.config[t]&&(e[t]=this.config[t]);return e},e._cleanTipClass=function(){var e=p(this.getTipElement()),t=e.attr("class").match(Pn);null!==t&&t.length&&e.removeClass(t.join(""))},e._handlePopperPlacementChange=function(e){var t=e.instance;this.tip=t.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(e.placement))},e._fixTransition=function(){var e=this.getTipElement(),t=this.config.animation;null===e.getAttribute("x-placement")&&(p(e).removeClass(Un),this.config.animation=!1,this.hide(),this.show(),this.config.animation=t)},i._jQueryInterface=function(n){return this.each(function(){var e=p(this).data(On),t="object"==typeof n&&n;if((e||!/dispose|hide/.test(n))&&(e||(e=new i(this,t),p(this).data(On,e)),"string"==typeof n)){if("undefined"==typeof e[n])throw new TypeError('No method named "'+n+'"');e[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.4.1"}},{key:"Default",get:function(){return Rn}},{key:"NAME",get:function(){return An}},{key:"DATA_KEY",get:function(){return On}},{key:"Event",get:function(){return Wn}},{key:"EVENT_KEY",get:function(){return Nn}},{key:"DefaultType",get:function(){return jn}}]),i}();p.fn[An]=Xn._jQueryInterface,p.fn[An].Constructor=Xn,p.fn[An].noConflict=function(){return p.fn[An]=kn,Xn._jQueryInterface};var Gn="popover",$n="bs.popover",Jn="."+$n,Zn=p.fn[Gn],ei="bs-popover",ti=new RegExp("(^|\\s)"+ei+"\\S+","g"),ni=l({},Xn.Default,{placement:"right",trigger:"click",content:"",template:''}),ii=l({},Xn.DefaultType,{content:"(string|element|function)"}),oi="fade",ri="show",si=".popover-header",ai=".popover-body",li={HIDE:"hide"+Jn,HIDDEN:"hidden"+Jn,SHOW:"show"+Jn,SHOWN:"shown"+Jn,INSERTED:"inserted"+Jn,CLICK:"click"+Jn,FOCUSIN:"focusin"+Jn,FOCUSOUT:"focusout"+Jn,MOUSEENTER:"mouseenter"+Jn,MOUSELEAVE:"mouseleave"+Jn},ci=function(e){function i(){return e.apply(this,arguments)||this}!function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}(i,e);var t=i.prototype;return t.isWithContent=function(){return this.getTitle()||this._getContent()},t.addAttachmentClass=function(e){p(this.getTipElement()).addClass(ei+"-"+e)},t.getTipElement=function(){return this.tip=this.tip||p(this.config.template)[0],this.tip},t.setContent=function(){var e=p(this.getTipElement());this.setElementContent(e.find(si),this.getTitle());var t=this._getContent();"function"==typeof t&&(t=t.call(this.element)),this.setElementContent(e.find(ai),t),e.removeClass(oi+" "+ri)},t._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},t._cleanTipClass=function(){var e=p(this.getTipElement()),t=e.attr("class").match(ti);null!==t&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||e {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n}\n\nfunction setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''\n }\n\n try {\n return document.querySelector(selector) ? selector : null\n } catch (err) {\n return null\n }\n },\n\n getTransitionDurationFromElement(element) {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let transitionDuration = $(element).css('transition-duration')\n let transitionDelay = $(element).css('transition-delay')\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END)\n },\n\n // TODO: Remove in v5\n supportsTransitionEnd() {\n return Boolean(TRANSITION_END)\n },\n\n isElement(obj) {\n return (obj[0] || obj).nodeType\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && Util.isElement(value)\n ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n },\n\n findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return Util.findShadowRoot(element.parentNode)\n },\n\n jQueryDetection() {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n }\n}\n\nUtil.jQueryDetection()\nsetTransitionEndSupport()\n\nexport default Util\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'alert'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Selector = {\n DISMISS : '[data-dismiss=\"alert\"]'\n}\n\nconst Event = {\n CLOSE : `close${EVENT_KEY}`,\n CLOSED : `closed${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n ALERT : 'alert',\n FADE : 'fade',\n SHOW : 'show'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Alert {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n close(element) {\n let rootElement = this._element\n if (element) {\n rootElement = this._getRootElement(element)\n }\n\n const customEvent = this._triggerCloseEvent(rootElement)\n\n if (customEvent.isDefaultPrevented()) {\n return\n }\n\n this._removeElement(rootElement)\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Private\n\n _getRootElement(element) {\n const selector = Util.getSelectorFromElement(element)\n let parent = false\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n if (!parent) {\n parent = $(element).closest(`.${ClassName.ALERT}`)[0]\n }\n\n return parent\n }\n\n _triggerCloseEvent(element) {\n const closeEvent = $.Event(Event.CLOSE)\n\n $(element).trigger(closeEvent)\n return closeEvent\n }\n\n _removeElement(element) {\n $(element).removeClass(ClassName.SHOW)\n\n if (!$(element).hasClass(ClassName.FADE)) {\n this._destroyElement(element)\n return\n }\n\n const transitionDuration = Util.getTransitionDurationFromElement(element)\n\n $(element)\n .one(Util.TRANSITION_END, (event) => this._destroyElement(element, event))\n .emulateTransitionEnd(transitionDuration)\n }\n\n _destroyElement(element) {\n $(element)\n .detach()\n .trigger(Event.CLOSED)\n .remove()\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $element = $(this)\n let data = $element.data(DATA_KEY)\n\n if (!data) {\n data = new Alert(this)\n $element.data(DATA_KEY, data)\n }\n\n if (config === 'close') {\n data[config](this)\n }\n })\n }\n\n static _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault()\n }\n\n alertInstance.close(this)\n }\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(\n Event.CLICK_DATA_API,\n Selector.DISMISS,\n Alert._handleDismiss(new Alert())\n)\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Alert._jQueryInterface\n$.fn[NAME].Constructor = Alert\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Alert._jQueryInterface\n}\n\nexport default Alert\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'button'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst ClassName = {\n ACTIVE : 'active',\n BUTTON : 'btn',\n FOCUS : 'focus'\n}\n\nconst Selector = {\n DATA_TOGGLE_CARROT : '[data-toggle^=\"button\"]',\n DATA_TOGGLES : '[data-toggle=\"buttons\"]',\n DATA_TOGGLE : '[data-toggle=\"button\"]',\n DATA_TOGGLES_BUTTONS : '[data-toggle=\"buttons\"] .btn',\n INPUT : 'input:not([type=\"hidden\"])',\n ACTIVE : '.active',\n BUTTON : '.btn'\n}\n\nconst Event = {\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n FOCUS_BLUR_DATA_API : `focus${EVENT_KEY}${DATA_API_KEY} ` +\n `blur${EVENT_KEY}${DATA_API_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Button {\n constructor(element) {\n this._element = element\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n // Public\n\n toggle() {\n let triggerChangeEvent = true\n let addAriaPressed = true\n const rootElement = $(this._element).closest(\n Selector.DATA_TOGGLES\n )[0]\n\n if (rootElement) {\n const input = this._element.querySelector(Selector.INPUT)\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked &&\n this._element.classList.contains(ClassName.ACTIVE)) {\n triggerChangeEvent = false\n } else {\n const activeElement = rootElement.querySelector(Selector.ACTIVE)\n\n if (activeElement) {\n $(activeElement).removeClass(ClassName.ACTIVE)\n }\n }\n } else if (input.type === 'checkbox') {\n if (this._element.tagName === 'LABEL' && input.checked === this._element.classList.contains(ClassName.ACTIVE)) {\n triggerChangeEvent = false\n }\n } else {\n // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input\n triggerChangeEvent = false\n }\n\n if (triggerChangeEvent) {\n input.checked = !this._element.classList.contains(ClassName.ACTIVE)\n $(input).trigger('change')\n }\n\n input.focus()\n addAriaPressed = false\n }\n }\n\n if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed',\n !this._element.classList.contains(ClassName.ACTIVE))\n }\n\n if (triggerChangeEvent) {\n $(this._element).toggleClass(ClassName.ACTIVE)\n }\n }\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n this._element = null\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n\n if (!data) {\n data = new Button(this)\n $(this).data(DATA_KEY, data)\n }\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n let button = event.target\n\n if (!$(button).hasClass(ClassName.BUTTON)) {\n button = $(button).closest(Selector.BUTTON)[0]\n }\n\n if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {\n event.preventDefault() // work around Firefox bug #1540995\n } else {\n const inputBtn = button.querySelector(Selector.INPUT)\n\n if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {\n event.preventDefault() // work around Firefox bug #1540995\n return\n }\n\n Button._jQueryInterface.call($(button), 'toggle')\n }\n })\n .on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, (event) => {\n const button = $(event.target).closest(Selector.BUTTON)[0]\n $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type))\n })\n\n$(window).on(Event.LOAD_DATA_API, () => {\n // ensure correct active class is set to match the controls' actual values/states\n\n // find all checkboxes/readio buttons inside data-toggle groups\n let buttons = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLES_BUTTONS))\n for (let i = 0, len = buttons.length; i < len; i++) {\n const button = buttons[i]\n const input = button.querySelector(Selector.INPUT)\n if (input.checked || input.hasAttribute('checked')) {\n button.classList.add(ClassName.ACTIVE)\n } else {\n button.classList.remove(ClassName.ACTIVE)\n }\n }\n\n // find all button toggles\n buttons = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n for (let i = 0, len = buttons.length; i < len; i++) {\n const button = buttons[i]\n if (button.getAttribute('aria-pressed') === 'true') {\n button.classList.add(ClassName.ACTIVE)\n } else {\n button.classList.remove(ClassName.ACTIVE)\n }\n }\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Button._jQueryInterface\n$.fn[NAME].Constructor = Button\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Button._jQueryInterface\n}\n\nexport default Button\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'carousel'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ARROW_LEFT_KEYCODE = 37 // KeyboardEvent.which value for left arrow key\nconst ARROW_RIGHT_KEYCODE = 39 // KeyboardEvent.which value for right arrow key\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n interval : 5000,\n keyboard : true,\n slide : false,\n pause : 'hover',\n wrap : true,\n touch : true\n}\n\nconst DefaultType = {\n interval : '(number|boolean)',\n keyboard : 'boolean',\n slide : '(boolean|string)',\n pause : '(string|boolean)',\n wrap : 'boolean',\n touch : 'boolean'\n}\n\nconst Direction = {\n NEXT : 'next',\n PREV : 'prev',\n LEFT : 'left',\n RIGHT : 'right'\n}\n\nconst Event = {\n SLIDE : `slide${EVENT_KEY}`,\n SLID : `slid${EVENT_KEY}`,\n KEYDOWN : `keydown${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`,\n TOUCHSTART : `touchstart${EVENT_KEY}`,\n TOUCHMOVE : `touchmove${EVENT_KEY}`,\n TOUCHEND : `touchend${EVENT_KEY}`,\n POINTERDOWN : `pointerdown${EVENT_KEY}`,\n POINTERUP : `pointerup${EVENT_KEY}`,\n DRAG_START : `dragstart${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n CAROUSEL : 'carousel',\n ACTIVE : 'active',\n SLIDE : 'slide',\n RIGHT : 'carousel-item-right',\n LEFT : 'carousel-item-left',\n NEXT : 'carousel-item-next',\n PREV : 'carousel-item-prev',\n ITEM : 'carousel-item',\n POINTER_EVENT : 'pointer-event'\n}\n\nconst Selector = {\n ACTIVE : '.active',\n ACTIVE_ITEM : '.active.carousel-item',\n ITEM : '.carousel-item',\n ITEM_IMG : '.carousel-item img',\n NEXT_PREV : '.carousel-item-next, .carousel-item-prev',\n INDICATORS : '.carousel-indicators',\n DATA_SLIDE : '[data-slide], [data-slide-to]',\n DATA_RIDE : '[data-ride=\"carousel\"]'\n}\n\nconst PointerType = {\n TOUCH : 'touch',\n PEN : 'pen'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\nclass Carousel {\n constructor(element, config) {\n this._items = null\n this._interval = null\n this._activeElement = null\n this._isPaused = false\n this._isSliding = false\n this.touchTimeout = null\n this.touchStartX = 0\n this.touchDeltaX = 0\n\n this._config = this._getConfig(config)\n this._element = element\n this._indicatorsElement = this._element.querySelector(Selector.INDICATORS)\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent)\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n next() {\n if (!this._isSliding) {\n this._slide(Direction.NEXT)\n }\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden &&\n ($(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden')) {\n this.next()\n }\n }\n\n prev() {\n if (!this._isSliding) {\n this._slide(Direction.PREV)\n }\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if (this._element.querySelector(Selector.NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)\n\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n $(this._element).one(Event.SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const direction = index > activeIndex\n ? Direction.NEXT\n : Direction.PREV\n\n this._slide(direction, this._items[index])\n }\n\n dispose() {\n $(this._element).off(EVENT_KEY)\n $.removeData(this._element, DATA_KEY)\n\n this._items = null\n this._config = null\n this._element = null\n this._interval = null\n this._isPaused = null\n this._isSliding = null\n this._activeElement = null\n this._indicatorsElement = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _handleSwipe() {\n const absDeltax = Math.abs(this.touchDeltaX)\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return\n }\n\n const direction = absDeltax / this.touchDeltaX\n\n this.touchDeltaX = 0\n\n // swipe left\n if (direction > 0) {\n this.prev()\n }\n\n // swipe right\n if (direction < 0) {\n this.next()\n }\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n $(this._element)\n .on(Event.KEYDOWN, (event) => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n $(this._element)\n .on(Event.MOUSEENTER, (event) => this.pause(event))\n .on(Event.MOUSELEAVE, (event) => this.cycle(event))\n }\n\n if (this._config.touch) {\n this._addTouchEventListeners()\n }\n }\n\n _addTouchEventListeners() {\n if (!this._touchSupported) {\n return\n }\n\n const start = (event) => {\n if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n this.touchStartX = event.originalEvent.clientX\n } else if (!this._pointerEvent) {\n this.touchStartX = event.originalEvent.touches[0].clientX\n }\n }\n\n const move = (event) => {\n // ensure swiping with one touch and not pinching\n if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {\n this.touchDeltaX = 0\n } else {\n this.touchDeltaX = event.originalEvent.touches[0].clientX - this.touchStartX\n }\n }\n\n const end = (event) => {\n if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n this.touchDeltaX = event.originalEvent.clientX - this.touchStartX\n }\n\n this._handleSwipe()\n if (this._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n this.touchTimeout = setTimeout((event) => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n }\n }\n\n $(this._element.querySelectorAll(Selector.ITEM_IMG)).on(Event.DRAG_START, (e) => e.preventDefault())\n if (this._pointerEvent) {\n $(this._element).on(Event.POINTERDOWN, (event) => start(event))\n $(this._element).on(Event.POINTERUP, (event) => end(event))\n\n this._element.classList.add(ClassName.POINTER_EVENT)\n } else {\n $(this._element).on(Event.TOUCHSTART, (event) => start(event))\n $(this._element).on(Event.TOUCHMOVE, (event) => move(event))\n $(this._element).on(Event.TOUCHEND, (event) => end(event))\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault()\n this.prev()\n break\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault()\n this.next()\n break\n default:\n }\n }\n\n _getItemIndex(element) {\n this._items = element && element.parentNode\n ? [].slice.call(element.parentNode.querySelectorAll(Selector.ITEM))\n : []\n return this._items.indexOf(element)\n }\n\n _getItemByDirection(direction, activeElement) {\n const isNextDirection = direction === Direction.NEXT\n const isPrevDirection = direction === Direction.PREV\n const activeIndex = this._getItemIndex(activeElement)\n const lastItemIndex = this._items.length - 1\n const isGoingToWrap = isPrevDirection && activeIndex === 0 ||\n isNextDirection && activeIndex === lastItemIndex\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement\n }\n\n const delta = direction === Direction.PREV ? -1 : 1\n const itemIndex = (activeIndex + delta) % this._items.length\n\n return itemIndex === -1\n ? this._items[this._items.length - 1] : this._items[itemIndex]\n }\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget)\n const fromIndex = this._getItemIndex(this._element.querySelector(Selector.ACTIVE_ITEM))\n const slideEvent = $.Event(Event.SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n })\n\n $(this._element).trigger(slideEvent)\n\n return slideEvent\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n const indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector.ACTIVE))\n $(indicators)\n .removeClass(ClassName.ACTIVE)\n\n const nextIndicator = this._indicatorsElement.children[\n this._getItemIndex(element)\n ]\n\n if (nextIndicator) {\n $(nextIndicator).addClass(ClassName.ACTIVE)\n }\n }\n }\n\n _slide(direction, element) {\n const activeElement = this._element.querySelector(Selector.ACTIVE_ITEM)\n const activeElementIndex = this._getItemIndex(activeElement)\n const nextElement = element || activeElement &&\n this._getItemByDirection(direction, activeElement)\n const nextElementIndex = this._getItemIndex(nextElement)\n const isCycling = Boolean(this._interval)\n\n let directionalClassName\n let orderClassName\n let eventDirectionName\n\n if (direction === Direction.NEXT) {\n directionalClassName = ClassName.LEFT\n orderClassName = ClassName.NEXT\n eventDirectionName = Direction.LEFT\n } else {\n directionalClassName = ClassName.RIGHT\n orderClassName = ClassName.PREV\n eventDirectionName = Direction.RIGHT\n }\n\n if (nextElement && $(nextElement).hasClass(ClassName.ACTIVE)) {\n this._isSliding = false\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.isDefaultPrevented()) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n\n const slidEvent = $.Event(Event.SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n })\n\n if ($(this._element).hasClass(ClassName.SLIDE)) {\n $(nextElement).addClass(orderClassName)\n\n Util.reflow(nextElement)\n\n $(activeElement).addClass(directionalClassName)\n $(nextElement).addClass(directionalClassName)\n\n const nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10)\n if (nextElementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval\n this._config.interval = nextElementInterval\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval\n }\n\n const transitionDuration = Util.getTransitionDurationFromElement(activeElement)\n\n $(activeElement)\n .one(Util.TRANSITION_END, () => {\n $(nextElement)\n .removeClass(`${directionalClassName} ${orderClassName}`)\n .addClass(ClassName.ACTIVE)\n\n $(activeElement).removeClass(`${ClassName.ACTIVE} ${orderClassName} ${directionalClassName}`)\n\n this._isSliding = false\n\n setTimeout(() => $(this._element).trigger(slidEvent), 0)\n })\n .emulateTransitionEnd(transitionDuration)\n } else {\n $(activeElement).removeClass(ClassName.ACTIVE)\n $(nextElement).addClass(ClassName.ACTIVE)\n\n this._isSliding = false\n $(this._element).trigger(slidEvent)\n }\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n let _config = {\n ...Default,\n ...$(this).data()\n }\n\n if (typeof config === 'object') {\n _config = {\n ..._config,\n ...config\n }\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (!data) {\n data = new Carousel(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(`No method named \"${action}\"`)\n }\n data[action]()\n } else if (_config.interval && _config.ride) {\n data.pause()\n data.cycle()\n }\n })\n }\n\n static _dataApiClickHandler(event) {\n const selector = Util.getSelectorFromElement(this)\n\n if (!selector) {\n return\n }\n\n const target = $(selector)[0]\n\n if (!target || !$(target).hasClass(ClassName.CAROUSEL)) {\n return\n }\n\n const config = {\n ...$(target).data(),\n ...$(this).data()\n }\n const slideIndex = this.getAttribute('data-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel._jQueryInterface.call($(target), config)\n\n if (slideIndex) {\n $(target).data(DATA_KEY).to(slideIndex)\n }\n\n event.preventDefault()\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler)\n\n$(window).on(Event.LOAD_DATA_API, () => {\n const carousels = [].slice.call(document.querySelectorAll(Selector.DATA_RIDE))\n for (let i = 0, len = carousels.length; i < len; i++) {\n const $carousel = $(carousels[i])\n Carousel._jQueryInterface.call($carousel, $carousel.data())\n }\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Carousel._jQueryInterface\n$.fn[NAME].Constructor = Carousel\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Carousel._jQueryInterface\n}\n\nexport default Carousel\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'collapse'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Default = {\n toggle : true,\n parent : ''\n}\n\nconst DefaultType = {\n toggle : 'boolean',\n parent : '(string|element)'\n}\n\nconst Event = {\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n SHOW : 'show',\n COLLAPSE : 'collapse',\n COLLAPSING : 'collapsing',\n COLLAPSED : 'collapsed'\n}\n\nconst Dimension = {\n WIDTH : 'width',\n HEIGHT : 'height'\n}\n\nconst Selector = {\n ACTIVES : '.show, .collapsing',\n DATA_TOGGLE : '[data-toggle=\"collapse\"]'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Collapse {\n constructor(element, config) {\n this._isTransitioning = false\n this._element = element\n this._config = this._getConfig(config)\n this._triggerArray = [].slice.call(document.querySelectorAll(\n `[data-toggle=\"collapse\"][href=\"#${element.id}\"],` +\n `[data-toggle=\"collapse\"][data-target=\"#${element.id}\"]`\n ))\n\n const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n for (let i = 0, len = toggleList.length; i < len; i++) {\n const elem = toggleList[i]\n const selector = Util.getSelectorFromElement(elem)\n const filterElement = [].slice.call(document.querySelectorAll(selector))\n .filter((foundElem) => foundElem === element)\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector\n this._triggerArray.push(elem)\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray)\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle() {\n if ($(this._element).hasClass(ClassName.SHOW)) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning ||\n $(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n let actives\n let activesData\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(Selector.ACTIVES))\n .filter((elem) => {\n if (typeof this._config.parent === 'string') {\n return elem.getAttribute('data-parent') === this._config.parent\n }\n\n return elem.classList.contains(ClassName.COLLAPSE)\n })\n\n if (actives.length === 0) {\n actives = null\n }\n }\n\n if (actives) {\n activesData = $(actives).not(this._selector).data(DATA_KEY)\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = $.Event(Event.SHOW)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide')\n if (!activesData) {\n $(actives).data(DATA_KEY, null)\n }\n }\n\n const dimension = this._getDimension()\n\n $(this._element)\n .removeClass(ClassName.COLLAPSE)\n .addClass(ClassName.COLLAPSING)\n\n this._element.style[dimension] = 0\n\n if (this._triggerArray.length) {\n $(this._triggerArray)\n .removeClass(ClassName.COLLAPSED)\n .attr('aria-expanded', true)\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .addClass(ClassName.SHOW)\n\n this._element.style[dimension] = ''\n\n this.setTransitioning(false)\n\n $(this._element).trigger(Event.SHOWN)\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning ||\n !$(this._element).hasClass(ClassName.SHOW)) {\n return\n }\n\n const startEvent = $.Event(Event.HIDE)\n $(this._element).trigger(startEvent)\n if (startEvent.isDefaultPrevented()) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n Util.reflow(this._element)\n\n $(this._element)\n .addClass(ClassName.COLLAPSING)\n .removeClass(ClassName.COLLAPSE)\n .removeClass(ClassName.SHOW)\n\n const triggerArrayLength = this._triggerArray.length\n if (triggerArrayLength > 0) {\n for (let i = 0; i < triggerArrayLength; i++) {\n const trigger = this._triggerArray[i]\n const selector = Util.getSelectorFromElement(trigger)\n\n if (selector !== null) {\n const $elem = $([].slice.call(document.querySelectorAll(selector)))\n if (!$elem.hasClass(ClassName.SHOW)) {\n $(trigger).addClass(ClassName.COLLAPSED)\n .attr('aria-expanded', false)\n }\n }\n }\n }\n\n this.setTransitioning(true)\n\n const complete = () => {\n this.setTransitioning(false)\n $(this._element)\n .removeClass(ClassName.COLLAPSING)\n .addClass(ClassName.COLLAPSE)\n .trigger(Event.HIDDEN)\n }\n\n this._element.style[dimension] = ''\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n }\n\n setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._parent = null\n this._element = null\n this._triggerArray = null\n this._isTransitioning = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n config.toggle = Boolean(config.toggle) // Coerce string values\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n const hasWidth = $(this._element).hasClass(Dimension.WIDTH)\n return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT\n }\n\n _getParent() {\n let parent\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent\n\n // It's a jQuery object\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0]\n }\n } else {\n parent = document.querySelector(this._config.parent)\n }\n\n const selector =\n `[data-toggle=\"collapse\"][data-parent=\"${this._config.parent}\"]`\n\n const children = [].slice.call(parent.querySelectorAll(selector))\n $(children).each((i, element) => {\n this._addAriaAndCollapsedClass(\n Collapse._getTargetFromElement(element),\n [element]\n )\n })\n\n return parent\n }\n\n _addAriaAndCollapsedClass(element, triggerArray) {\n const isOpen = $(element).hasClass(ClassName.SHOW)\n\n if (triggerArray.length) {\n $(triggerArray)\n .toggleClass(ClassName.COLLAPSED, !isOpen)\n .attr('aria-expanded', isOpen)\n }\n }\n\n // Static\n\n static _getTargetFromElement(element) {\n const selector = Util.getSelectorFromElement(element)\n return selector ? document.querySelector(selector) : null\n }\n\n static _jQueryInterface(config) {\n return this.each(function () {\n const $this = $(this)\n let data = $this.data(DATA_KEY)\n const _config = {\n ...Default,\n ...$this.data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data && _config.toggle && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n if (!data) {\n data = new Collapse(this, _config)\n $this.data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n // preventDefault only for elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault()\n }\n\n const $trigger = $(this)\n const selector = Util.getSelectorFromElement(this)\n const selectors = [].slice.call(document.querySelectorAll(selector))\n\n $(selectors).each(function () {\n const $target = $(this)\n const data = $target.data(DATA_KEY)\n const config = data ? 'toggle' : $trigger.data()\n Collapse._jQueryInterface.call($target, config)\n })\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Collapse._jQueryInterface\n$.fn[NAME].Constructor = Collapse\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Collapse._jQueryInterface\n}\n\nexport default Collapse\n","/**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.16.0\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n\nvar timeoutDuration = function () {\n var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n return 1;\n }\n }\n return 0;\n}();\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n window.Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var window = element.ownerDocument.defaultView;\n var css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\n/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nfunction getReferenceNode(reference) {\n return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n\nvar isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nvar isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nfunction isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n var noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);\n}\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);\n}\n\nfunction getWindowSizes(document) {\n var body = document.body;\n var html = document.documentElement;\n var computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } else {\n rect = element.getBoundingClientRect();\n }\n } catch (e) {}\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n var width = sizes.width || element.clientWidth || result.width;\n var height = sizes.height || element.clientHeight || result.height;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var isIE10 = isIE(10);\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = parseFloat(styles.borderTopWidth, 10);\n var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if (fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = parseFloat(styles.marginTop, 10);\n var marginLeft = parseFloat(styles.marginLeft, 10);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = !excludeScroll ? getScroll(html) : 0;\n var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n var parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nfunction getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n var el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n // NOTE: 1 DOM access here\n\n var boundaries = { top: 0, left: 0 };\n var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(popper.ownerDocument),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n var isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0;\n boundaries.top += isPaddingNumber ? padding : padding.top || 0;\n boundaries.right -= isPaddingNumber ? padding : padding.right || 0;\n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var window = element.ownerDocument.defaultView;\n var styles = window.getComputedStyle(element);\n var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.
\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicitly asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nfunction getRoundedOffsets(data, shouldRound) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var round = Math.round,\n floor = Math.floor;\n\n var noRound = function noRound(v) {\n return v;\n };\n\n var referenceWidth = round(reference.width);\n var popperWidth = round(popper.width);\n\n var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n var isVariation = data.placement.indexOf('-') !== -1;\n var sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;\n var verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right)\n };\n}\n\nvar isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n // when offsetParent is the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.
\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n var _data$offsets$arrow;\n\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var css = getStyleComputedProperty(data.instance.popper);\n var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);\n var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);\n var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.
\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.
\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n // flips variation if reference element overflows boundaries\n var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n // flips variation if popper content overflows boundaries\n var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);\n\n var flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n var transformProp = getSupportedPropertyName('transform');\n var popperStyles = data.instance.popper.style; // assignment to help minification\n var top = popperStyles.top,\n left = popperStyles.left,\n transform = popperStyles[transformProp];\n\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.
\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.
\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.
\n * It will read the variation of the `placement` property.
\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.
\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.
\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.
\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.
\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".
\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport',\n /**\n * @prop {Boolean} flipVariations=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the reference element overlaps its boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariations: false,\n /**\n * @prop {Boolean} flipVariationsByContent=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the popper element overlaps its reference boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariationsByContent: false\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.
\n * These can be overridden using the `options` argument of Popper.js.
\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.
\n * By default, it is set to no-op.
\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {Element|referenceObject} reference - The reference element used to position the popper\n * @param {Element} popper - The HTML / XML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.
\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\nexport default Popper;\n//# sourceMappingURL=popper.js.map\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'dropdown'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\nconst SPACE_KEYCODE = 32 // KeyboardEvent.which value for space key\nconst TAB_KEYCODE = 9 // KeyboardEvent.which value for tab key\nconst ARROW_UP_KEYCODE = 38 // KeyboardEvent.which value for up arrow key\nconst ARROW_DOWN_KEYCODE = 40 // KeyboardEvent.which value for down arrow key\nconst RIGHT_MOUSE_BUTTON_WHICH = 3 // MouseEvent.which value for the right button (assuming a right-handed mouse)\nconst REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEYCODE}|${ARROW_DOWN_KEYCODE}|${ESCAPE_KEYCODE}`)\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`,\n KEYDOWN_DATA_API : `keydown${EVENT_KEY}${DATA_API_KEY}`,\n KEYUP_DATA_API : `keyup${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DISABLED : 'disabled',\n SHOW : 'show',\n DROPUP : 'dropup',\n DROPRIGHT : 'dropright',\n DROPLEFT : 'dropleft',\n MENURIGHT : 'dropdown-menu-right',\n MENULEFT : 'dropdown-menu-left',\n POSITION_STATIC : 'position-static'\n}\n\nconst Selector = {\n DATA_TOGGLE : '[data-toggle=\"dropdown\"]',\n FORM_CHILD : '.dropdown form',\n MENU : '.dropdown-menu',\n NAVBAR_NAV : '.navbar-nav',\n VISIBLE_ITEMS : '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n}\n\nconst AttachmentMap = {\n TOP : 'top-start',\n TOPEND : 'top-end',\n BOTTOM : 'bottom-start',\n BOTTOMEND : 'bottom-end',\n RIGHT : 'right-start',\n RIGHTEND : 'right-end',\n LEFT : 'left-start',\n LEFTEND : 'left-end'\n}\n\nconst Default = {\n offset : 0,\n flip : true,\n boundary : 'scrollParent',\n reference : 'toggle',\n display : 'dynamic',\n popperConfig : null\n}\n\nconst DefaultType = {\n offset : '(number|string|function)',\n flip : 'boolean',\n boundary : '(string|element)',\n reference : '(string|element)',\n display : 'string',\n popperConfig : '(null|object)'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Dropdown {\n constructor(element, config) {\n this._element = element\n this._popper = null\n this._config = this._getConfig(config)\n this._menu = this._getMenuElement()\n this._inNavbar = this._detectNavbar()\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n toggle() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const isActive = $(this._menu).hasClass(ClassName.SHOW)\n\n Dropdown._clearMenus()\n\n if (isActive) {\n return\n }\n\n this.show(true)\n }\n\n show(usePopper = false) {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || $(this._menu).hasClass(ClassName.SHOW)) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n const showEvent = $.Event(Event.SHOW, relatedTarget)\n const parent = Dropdown._getParentFromElement(this._element)\n\n $(parent).trigger(showEvent)\n\n if (showEvent.isDefaultPrevented()) {\n return\n }\n\n // Disable totally Popper.js for Dropdown in Navbar\n if (!this._inNavbar && usePopper) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper.js (https://popper.js.org/)')\n }\n\n let referenceElement = this._element\n\n if (this._config.reference === 'parent') {\n referenceElement = parent\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference\n\n // Check if it's jQuery element\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0]\n }\n }\n\n // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n if (this._config.boundary !== 'scrollParent') {\n $(parent).addClass(ClassName.POSITION_STATIC)\n }\n this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig())\n }\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement &&\n $(parent).closest(Selector.NAVBAR_NAV).length === 0) {\n $(document.body).children().on('mouseover', null, $.noop)\n }\n\n this._element.focus()\n this._element.setAttribute('aria-expanded', true)\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.SHOWN, relatedTarget))\n }\n\n hide() {\n if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED) || !$(this._menu).hasClass(ClassName.SHOW)) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n const parent = Dropdown._getParentFromElement(this._element)\n\n $(parent).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n if (this._popper) {\n this._popper.destroy()\n }\n\n $(this._menu).toggleClass(ClassName.SHOW)\n $(parent)\n .toggleClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._element).off(EVENT_KEY)\n this._element = null\n this._menu = null\n if (this._popper !== null) {\n this._popper.destroy()\n this._popper = null\n }\n }\n\n update() {\n this._inNavbar = this._detectNavbar()\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // Private\n\n _addEventListeners() {\n $(this._element).on(Event.CLICK, (event) => {\n event.preventDefault()\n event.stopPropagation()\n this.toggle()\n })\n }\n\n _getConfig(config) {\n config = {\n ...this.constructor.Default,\n ...$(this._element).data(),\n ...config\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n return config\n }\n\n _getMenuElement() {\n if (!this._menu) {\n const parent = Dropdown._getParentFromElement(this._element)\n\n if (parent) {\n this._menu = parent.querySelector(Selector.MENU)\n }\n }\n return this._menu\n }\n\n _getPlacement() {\n const $parentDropdown = $(this._element.parentNode)\n let placement = AttachmentMap.BOTTOM\n\n // Handle dropup\n if ($parentDropdown.hasClass(ClassName.DROPUP)) {\n placement = AttachmentMap.TOP\n if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.TOPEND\n }\n } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {\n placement = AttachmentMap.RIGHT\n } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {\n placement = AttachmentMap.LEFT\n } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {\n placement = AttachmentMap.BOTTOMEND\n }\n return placement\n }\n\n _detectNavbar() {\n return $(this._element).closest('.navbar').length > 0\n }\n\n _getOffset() {\n const offset = {}\n\n if (typeof this._config.offset === 'function') {\n offset.fn = (data) => {\n data.offsets = {\n ...data.offsets,\n ...this._config.offset(data.offsets, this._element) || {}\n }\n\n return data\n }\n } else {\n offset.offset = this._config.offset\n }\n\n return offset\n }\n\n _getPopperConfig() {\n const popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: this._getOffset(),\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n }\n }\n\n // Disable Popper.js if we have a static display\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n }\n }\n\n return {\n ...popperConfig,\n ...this._config.popperConfig\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data) {\n data = new Dropdown(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n\n static _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH ||\n event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return\n }\n\n const toggles = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))\n\n for (let i = 0, len = toggles.length; i < len; i++) {\n const parent = Dropdown._getParentFromElement(toggles[i])\n const context = $(toggles[i]).data(DATA_KEY)\n const relatedTarget = {\n relatedTarget: toggles[i]\n }\n\n if (event && event.type === 'click') {\n relatedTarget.clickEvent = event\n }\n\n if (!context) {\n continue\n }\n\n const dropdownMenu = context._menu\n if (!$(parent).hasClass(ClassName.SHOW)) {\n continue\n }\n\n if (event && (event.type === 'click' &&\n /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) &&\n $.contains(parent, event.target)) {\n continue\n }\n\n const hideEvent = $.Event(Event.HIDE, relatedTarget)\n $(parent).trigger(hideEvent)\n if (hideEvent.isDefaultPrevented()) {\n continue\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop)\n }\n\n toggles[i].setAttribute('aria-expanded', 'false')\n\n if (context._popper) {\n context._popper.destroy()\n }\n\n $(dropdownMenu).removeClass(ClassName.SHOW)\n $(parent)\n .removeClass(ClassName.SHOW)\n .trigger($.Event(Event.HIDDEN, relatedTarget))\n }\n }\n\n static _getParentFromElement(element) {\n let parent\n const selector = Util.getSelectorFromElement(element)\n\n if (selector) {\n parent = document.querySelector(selector)\n }\n\n return parent || element.parentNode\n }\n\n // eslint-disable-next-line complexity\n static _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName)\n ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE &&\n (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE ||\n $(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (this.disabled || $(this).hasClass(ClassName.DISABLED)) {\n return\n }\n\n const parent = Dropdown._getParentFromElement(this)\n const isActive = $(parent).hasClass(ClassName.SHOW)\n\n if (!isActive && event.which === ESCAPE_KEYCODE) {\n return\n }\n\n if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {\n if (event.which === ESCAPE_KEYCODE) {\n const toggle = parent.querySelector(Selector.DATA_TOGGLE)\n $(toggle).trigger('focus')\n }\n\n $(this).trigger('click')\n return\n }\n\n const items = [].slice.call(parent.querySelectorAll(Selector.VISIBLE_ITEMS))\n .filter((item) => $(item).is(':visible'))\n\n if (items.length === 0) {\n return\n }\n\n let index = items.indexOf(event.target)\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) { // Up\n index--\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { // Down\n index++\n }\n\n if (index < 0) {\n index = 0\n }\n\n items[index].focus()\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document)\n .on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler)\n .on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler)\n .on(`${Event.CLICK_DATA_API} ${Event.KEYUP_DATA_API}`, Dropdown._clearMenus)\n .on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n event.preventDefault()\n event.stopPropagation()\n Dropdown._jQueryInterface.call($(this), 'toggle')\n })\n .on(Event.CLICK_DATA_API, Selector.FORM_CHILD, (e) => {\n e.stopPropagation()\n })\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Dropdown._jQueryInterface\n$.fn[NAME].Constructor = Dropdown\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Dropdown._jQueryInterface\n}\n\n\nexport default Dropdown\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'modal'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst ESCAPE_KEYCODE = 27 // KeyboardEvent.which value for Escape (Esc) key\n\nconst Default = {\n backdrop : true,\n keyboard : true,\n focus : true,\n show : true\n}\n\nconst DefaultType = {\n backdrop : '(boolean|string)',\n keyboard : 'boolean',\n focus : 'boolean',\n show : 'boolean'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDE_PREVENTED : `hidePrevented${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n RESIZE : `resize${EVENT_KEY}`,\n CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,\n KEYDOWN_DISMISS : `keydown.dismiss${EVENT_KEY}`,\n MOUSEUP_DISMISS : `mouseup.dismiss${EVENT_KEY}`,\n MOUSEDOWN_DISMISS : `mousedown.dismiss${EVENT_KEY}`,\n CLICK_DATA_API : `click${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n SCROLLABLE : 'modal-dialog-scrollable',\n SCROLLBAR_MEASURER : 'modal-scrollbar-measure',\n BACKDROP : 'modal-backdrop',\n OPEN : 'modal-open',\n FADE : 'fade',\n SHOW : 'show',\n STATIC : 'modal-static'\n}\n\nconst Selector = {\n DIALOG : '.modal-dialog',\n MODAL_BODY : '.modal-body',\n DATA_TOGGLE : '[data-toggle=\"modal\"]',\n DATA_DISMISS : '[data-dismiss=\"modal\"]',\n FIXED_CONTENT : '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',\n STICKY_CONTENT : '.sticky-top'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Modal {\n constructor(element, config) {\n this._config = this._getConfig(config)\n this._element = element\n this._dialog = element.querySelector(Selector.DIALOG)\n this._backdrop = null\n this._isShown = false\n this._isBodyOverflowing = false\n this._ignoreBackdropClick = false\n this._isTransitioning = false\n this._scrollbarWidth = 0\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n this._isTransitioning = true\n }\n\n const showEvent = $.Event(Event.SHOW, {\n relatedTarget\n })\n\n $(this._element).trigger(showEvent)\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = true\n\n this._checkScrollbar()\n this._setScrollbar()\n\n this._adjustDialog()\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(this._element).on(\n Event.CLICK_DISMISS,\n Selector.DATA_DISMISS,\n (event) => this.hide(event)\n )\n\n $(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {\n $(this._element).one(Event.MOUSEUP_DISMISS, (event) => {\n if ($(event.target).is(this._element)) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide(event) {\n if (event) {\n event.preventDefault()\n }\n\n if (!this._isShown || this._isTransitioning) {\n return\n }\n\n const hideEvent = $.Event(Event.HIDE)\n\n $(this._element).trigger(hideEvent)\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return\n }\n\n this._isShown = false\n const transition = $(this._element).hasClass(ClassName.FADE)\n\n if (transition) {\n this._isTransitioning = true\n }\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n $(document).off(Event.FOCUSIN)\n\n $(this._element).removeClass(ClassName.SHOW)\n\n $(this._element).off(Event.CLICK_DISMISS)\n $(this._dialog).off(Event.MOUSEDOWN_DISMISS)\n\n\n if (transition) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element)\n .one(Util.TRANSITION_END, (event) => this._hideModal(event))\n .emulateTransitionEnd(transitionDuration)\n } else {\n this._hideModal()\n }\n }\n\n dispose() {\n [window, this._element, this._dialog]\n .forEach((htmlElement) => $(htmlElement).off(EVENT_KEY))\n\n /**\n * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`\n * Do not move `document` in `htmlElements` array\n * It will remove `Event.CLICK_DATA_API` event that should remain\n */\n $(document).off(Event.FOCUSIN)\n\n $.removeData(this._element, DATA_KEY)\n\n this._config = null\n this._element = null\n this._dialog = null\n this._backdrop = null\n this._isShown = null\n this._isBodyOverflowing = null\n this._ignoreBackdropClick = null\n this._isTransitioning = null\n this._scrollbarWidth = null\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...config\n }\n Util.typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _triggerBackdropTransition() {\n if (this._config.backdrop === 'static') {\n const hideEventPrevented = $.Event(Event.HIDE_PREVENTED)\n\n $(this._element).trigger(hideEventPrevented)\n if (hideEventPrevented.defaultPrevented) {\n return\n }\n\n this._element.classList.add(ClassName.STATIC)\n\n const modalTransitionDuration = Util.getTransitionDurationFromElement(this._element)\n\n $(this._element).one(Util.TRANSITION_END, () => {\n this._element.classList.remove(ClassName.STATIC)\n })\n .emulateTransitionEnd(modalTransitionDuration)\n this._element.focus()\n } else {\n this.hide()\n }\n }\n\n _showElement(relatedTarget) {\n const transition = $(this._element).hasClass(ClassName.FADE)\n const modalBody = this._dialog ? this._dialog.querySelector(Selector.MODAL_BODY) : null\n\n if (!this._element.parentNode ||\n this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.setAttribute('aria-modal', true)\n\n if ($(this._dialog).hasClass(ClassName.SCROLLABLE) && modalBody) {\n modalBody.scrollTop = 0\n } else {\n this._element.scrollTop = 0\n }\n\n if (transition) {\n Util.reflow(this._element)\n }\n\n $(this._element).addClass(ClassName.SHOW)\n\n if (this._config.focus) {\n this._enforceFocus()\n }\n\n const shownEvent = $.Event(Event.SHOWN, {\n relatedTarget\n })\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._element.focus()\n }\n this._isTransitioning = false\n $(this._element).trigger(shownEvent)\n }\n\n if (transition) {\n const transitionDuration = Util.getTransitionDurationFromElement(this._dialog)\n\n $(this._dialog)\n .one(Util.TRANSITION_END, transitionComplete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n transitionComplete()\n }\n }\n\n _enforceFocus() {\n $(document)\n .off(Event.FOCUSIN) // Guard against infinite focus loop\n .on(Event.FOCUSIN, (event) => {\n if (document !== event.target &&\n this._element !== event.target &&\n $(this._element).has(event.target).length === 0) {\n this._element.focus()\n }\n })\n }\n\n _setEscapeEvent() {\n if (this._isShown && this._config.keyboard) {\n $(this._element).on(Event.KEYDOWN_DISMISS, (event) => {\n if (event.which === ESCAPE_KEYCODE) {\n this._triggerBackdropTransition()\n }\n })\n } else if (!this._isShown) {\n $(this._element).off(Event.KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n $(window).on(Event.RESIZE, (event) => this.handleUpdate(event))\n } else {\n $(window).off(Event.RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._element.removeAttribute('aria-modal')\n this._isTransitioning = false\n this._showBackdrop(() => {\n $(document.body).removeClass(ClassName.OPEN)\n this._resetAdjustments()\n this._resetScrollbar()\n $(this._element).trigger(Event.HIDDEN)\n })\n }\n\n _removeBackdrop() {\n if (this._backdrop) {\n $(this._backdrop).remove()\n this._backdrop = null\n }\n }\n\n _showBackdrop(callback) {\n const animate = $(this._element).hasClass(ClassName.FADE)\n ? ClassName.FADE : ''\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div')\n this._backdrop.className = ClassName.BACKDROP\n\n if (animate) {\n this._backdrop.classList.add(animate)\n }\n\n $(this._backdrop).appendTo(document.body)\n\n $(this._element).on(Event.CLICK_DISMISS, (event) => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n if (event.target !== event.currentTarget) {\n return\n }\n\n this._triggerBackdropTransition()\n })\n\n if (animate) {\n Util.reflow(this._backdrop)\n }\n\n $(this._backdrop).addClass(ClassName.SHOW)\n\n if (!callback) {\n return\n }\n\n if (!animate) {\n callback()\n return\n }\n\n const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callback)\n .emulateTransitionEnd(backdropTransitionDuration)\n } else if (!this._isShown && this._backdrop) {\n $(this._backdrop).removeClass(ClassName.SHOW)\n\n const callbackRemove = () => {\n this._removeBackdrop()\n if (callback) {\n callback()\n }\n }\n\n if ($(this._element).hasClass(ClassName.FADE)) {\n const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)\n\n $(this._backdrop)\n .one(Util.TRANSITION_END, callbackRemove)\n .emulateTransitionEnd(backdropTransitionDuration)\n } else {\n callbackRemove()\n }\n } else if (callback) {\n callback()\n }\n }\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n\n _adjustDialog() {\n const isModalOverflowing =\n this._element.scrollHeight > document.documentElement.clientHeight\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = `${this._scrollbarWidth}px`\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = `${this._scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n _checkScrollbar() {\n const rect = document.body.getBoundingClientRect()\n this._isBodyOverflowing = rect.left + rect.right < window.innerWidth\n this._scrollbarWidth = this._getScrollbarWidth()\n }\n\n _setScrollbar() {\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))\n const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT))\n\n // Adjust fixed content padding\n $(fixedContent).each((index, element) => {\n const actualPadding = element.style.paddingRight\n const calculatedPadding = $(element).css('padding-right')\n $(element)\n .data('padding-right', actualPadding)\n .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n })\n\n // Adjust sticky content margin\n $(stickyContent).each((index, element) => {\n const actualMargin = element.style.marginRight\n const calculatedMargin = $(element).css('margin-right')\n $(element)\n .data('margin-right', actualMargin)\n .css('margin-right', `${parseFloat(calculatedMargin) - this._scrollbarWidth}px`)\n })\n\n // Adjust body padding\n const actualPadding = document.body.style.paddingRight\n const calculatedPadding = $(document.body).css('padding-right')\n $(document.body)\n .data('padding-right', actualPadding)\n .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`)\n }\n\n $(document.body).addClass(ClassName.OPEN)\n }\n\n _resetScrollbar() {\n // Restore fixed content padding\n const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT))\n $(fixedContent).each((index, element) => {\n const padding = $(element).data('padding-right')\n $(element).removeData('padding-right')\n element.style.paddingRight = padding ? padding : ''\n })\n\n // Restore sticky content\n const elements = [].slice.call(document.querySelectorAll(`${Selector.STICKY_CONTENT}`))\n $(elements).each((index, element) => {\n const margin = $(element).data('margin-right')\n if (typeof margin !== 'undefined') {\n $(element).css('margin-right', margin).removeData('margin-right')\n }\n })\n\n // Restore body padding\n const padding = $(document.body).data('padding-right')\n $(document.body).removeData('padding-right')\n document.body.style.paddingRight = padding ? padding : ''\n }\n\n _getScrollbarWidth() { // thx d.walsh\n const scrollDiv = document.createElement('div')\n scrollDiv.className = ClassName.SCROLLBAR_MEASURER\n document.body.appendChild(scrollDiv)\n const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth\n document.body.removeChild(scrollDiv)\n return scrollbarWidth\n }\n\n // Static\n\n static _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = {\n ...Default,\n ...$(this).data(),\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (!data) {\n data = new Modal(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config](relatedTarget)\n } else if (_config.show) {\n data.show(relatedTarget)\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {\n let target\n const selector = Util.getSelectorFromElement(this)\n\n if (selector) {\n target = document.querySelector(selector)\n }\n\n const config = $(target).data(DATA_KEY)\n ? 'toggle' : {\n ...$(target).data(),\n ...$(this).data()\n }\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault()\n }\n\n const $target = $(target).one(Event.SHOW, (showEvent) => {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return\n }\n\n $target.one(Event.HIDDEN, () => {\n if ($(this).is(':visible')) {\n this.focus()\n }\n })\n })\n\n Modal._jQueryInterface.call($(target), config, this)\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Modal._jQueryInterface\n$.fn[NAME].Constructor = Modal\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Modal._jQueryInterface\n}\n\nexport default Modal\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): tools/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst uriAttrs = [\n 'background',\n 'cite',\n 'href',\n 'itemtype',\n 'longdesc',\n 'poster',\n 'src',\n 'xlink:href'\n]\n\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\nexport const DefaultWhitelist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n}\n\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\nconst SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi\n\n/**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\nconst DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i\n\nfunction allowedAttribute(attr, allowedAttributeList) {\n const attrName = attr.nodeName.toLowerCase()\n\n if (allowedAttributeList.indexOf(attrName) !== -1) {\n if (uriAttrs.indexOf(attrName) !== -1) {\n return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))\n }\n\n return true\n }\n\n const regExp = allowedAttributeList.filter((attrRegex) => attrRegex instanceof RegExp)\n\n // Check if a regular expression validates the attribute.\n for (let i = 0, l = regExp.length; i < l; i++) {\n if (attrName.match(regExp[i])) {\n return true\n }\n }\n\n return false\n}\n\nexport function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {\n if (unsafeHtml.length === 0) {\n return unsafeHtml\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml)\n }\n\n const domParser = new window.DOMParser()\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n const whitelistKeys = Object.keys(whiteList)\n const elements = [].slice.call(createdDocument.body.querySelectorAll('*'))\n\n for (let i = 0, len = elements.length; i < len; i++) {\n const el = elements[i]\n const elName = el.nodeName.toLowerCase()\n\n if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {\n el.parentNode.removeChild(el)\n\n continue\n }\n\n const attributeList = [].slice.call(el.attributes)\n const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])\n\n attributeList.forEach((attr) => {\n if (!allowedAttribute(attr, whitelistedAttributes)) {\n el.removeAttribute(attr.nodeName)\n }\n })\n }\n\n return createdDocument.body.innerHTML\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n DefaultWhitelist,\n sanitizeHtml\n} from './tools/sanitizer'\nimport $ from 'jquery'\nimport Popper from 'popper.js'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'tooltip'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.tooltip'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst CLASS_PREFIX = 'bs-tooltip'\nconst BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\nconst DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']\n\nconst DefaultType = {\n animation : 'boolean',\n template : 'string',\n title : '(string|element|function)',\n trigger : 'string',\n delay : '(number|object)',\n html : 'boolean',\n selector : '(string|boolean)',\n placement : '(string|function)',\n offset : '(number|string|function)',\n container : '(string|element|boolean)',\n fallbackPlacement : '(string|array)',\n boundary : '(string|element)',\n sanitize : 'boolean',\n sanitizeFn : '(null|function)',\n whiteList : 'object',\n popperConfig : '(null|object)'\n}\n\nconst AttachmentMap = {\n AUTO : 'auto',\n TOP : 'top',\n RIGHT : 'right',\n BOTTOM : 'bottom',\n LEFT : 'left'\n}\n\nconst Default = {\n animation : true,\n template : '
' +\n '
' +\n '
',\n trigger : 'hover focus',\n title : '',\n delay : 0,\n html : false,\n selector : false,\n placement : 'top',\n offset : 0,\n container : false,\n fallbackPlacement : 'flip',\n boundary : 'scrollParent',\n sanitize : true,\n sanitizeFn : null,\n whiteList : DefaultWhitelist,\n popperConfig : null\n}\n\nconst HoverState = {\n SHOW : 'show',\n OUT : 'out'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n}\n\nconst ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n TOOLTIP : '.tooltip',\n TOOLTIP_INNER : '.tooltip-inner',\n ARROW : '.arrow'\n}\n\nconst Trigger = {\n HOVER : 'hover',\n FOCUS : 'focus',\n CLICK : 'click',\n MANUAL : 'manual'\n}\n\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Tooltip {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper.js (https://popper.js.org/)')\n }\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._popper = null\n\n // Protected\n this.element = element\n this.config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (!this._isEnabled) {\n return\n }\n\n if (event) {\n const dataKey = this.constructor.DATA_KEY\n let context = $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n } else {\n if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n $.removeData(this.element, this.constructor.DATA_KEY)\n\n $(this.element).off(this.constructor.EVENT_KEY)\n $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler)\n\n if (this.tip) {\n $(this.tip).remove()\n }\n\n this._isEnabled = null\n this._timeout = null\n this._hoverState = null\n this._activeTrigger = null\n if (this._popper) {\n this._popper.destroy()\n }\n\n this._popper = null\n this.element = null\n this.config = null\n this.tip = null\n }\n\n show() {\n if ($(this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n const showEvent = $.Event(this.constructor.Event.SHOW)\n if (this.isWithContent() && this._isEnabled) {\n $(this.element).trigger(showEvent)\n\n const shadowRoot = Util.findShadowRoot(this.element)\n const isInTheDom = $.contains(\n shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement,\n this.element\n )\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return\n }\n\n const tip = this.getTipElement()\n const tipId = Util.getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this.element.setAttribute('aria-describedby', tipId)\n\n this.setContent()\n\n if (this.config.animation) {\n $(tip).addClass(ClassName.FADE)\n }\n\n const placement = typeof this.config.placement === 'function'\n ? this.config.placement.call(this, tip, this.element)\n : this.config.placement\n\n const attachment = this._getAttachment(placement)\n this.addAttachmentClass(attachment)\n\n const container = this._getContainer()\n $(tip).data(this.constructor.DATA_KEY, this)\n\n if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {\n $(tip).appendTo(container)\n }\n\n $(this.element).trigger(this.constructor.Event.INSERTED)\n\n this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment))\n\n $(tip).addClass(ClassName.SHOW)\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().on('mouseover', null, $.noop)\n }\n\n const complete = () => {\n if (this.config.animation) {\n this._fixTransition()\n }\n const prevHoverState = this._hoverState\n this._hoverState = null\n\n $(this.element).trigger(this.constructor.Event.SHOWN)\n\n if (prevHoverState === HoverState.OUT) {\n this._leave(null, this)\n }\n }\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n const transitionDuration = Util.getTransitionDurationFromElement(this.tip)\n\n $(this.tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n }\n }\n\n hide(callback) {\n const tip = this.getTipElement()\n const hideEvent = $.Event(this.constructor.Event.HIDE)\n const complete = () => {\n if (this._hoverState !== HoverState.SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip)\n }\n\n this._cleanTipClass()\n this.element.removeAttribute('aria-describedby')\n $(this.element).trigger(this.constructor.Event.HIDDEN)\n if (this._popper !== null) {\n this._popper.destroy()\n }\n\n if (callback) {\n callback()\n }\n }\n\n $(this.element).trigger(hideEvent)\n\n if (hideEvent.isDefaultPrevented()) {\n return\n }\n\n $(tip).removeClass(ClassName.SHOW)\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n $(document.body).children().off('mouseover', null, $.noop)\n }\n\n this._activeTrigger[Trigger.CLICK] = false\n this._activeTrigger[Trigger.FOCUS] = false\n this._activeTrigger[Trigger.HOVER] = false\n\n if ($(this.tip).hasClass(ClassName.FADE)) {\n const transitionDuration = Util.getTransitionDurationFromElement(tip)\n\n $(tip)\n .one(Util.TRANSITION_END, complete)\n .emulateTransitionEnd(transitionDuration)\n } else {\n complete()\n }\n\n this._hoverState = ''\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate()\n }\n }\n\n // Protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n this.tip = this.tip || $(this.config.template)[0]\n return this.tip\n }\n\n setContent() {\n const tip = this.getTipElement()\n this.setElementContent($(tip.querySelectorAll(Selector.TOOLTIP_INNER)), this.getTitle())\n $(tip).removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n setElementContent($element, content) {\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (this.config.html) {\n if (!$(content).parent().is($element)) {\n $element.empty().append(content)\n }\n } else {\n $element.text($(content).text())\n }\n\n return\n }\n\n if (this.config.html) {\n if (this.config.sanitize) {\n content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn)\n }\n\n $element.html(content)\n } else {\n $element.text(content)\n }\n }\n\n getTitle() {\n let title = this.element.getAttribute('data-original-title')\n\n if (!title) {\n title = typeof this.config.title === 'function'\n ? this.config.title.call(this.element)\n : this.config.title\n }\n\n return title\n }\n\n // Private\n\n _getPopperConfig(attachment) {\n const defaultBsConfig = {\n placement: attachment,\n modifiers: {\n offset: this._getOffset(),\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: Selector.ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: (data) => {\n if (data.originalPlacement !== data.placement) {\n this._handlePopperPlacementChange(data)\n }\n },\n onUpdate: (data) => this._handlePopperPlacementChange(data)\n }\n\n return {\n ...defaultBsConfig,\n ...this.config.popperConfig\n }\n }\n\n _getOffset() {\n const offset = {}\n\n if (typeof this.config.offset === 'function') {\n offset.fn = (data) => {\n data.offsets = {\n ...data.offsets,\n ...this.config.offset(data.offsets, this.element) || {}\n }\n\n return data\n }\n } else {\n offset.offset = this.config.offset\n }\n\n return offset\n }\n\n _getContainer() {\n if (this.config.container === false) {\n return document.body\n }\n\n if (Util.isElement(this.config.container)) {\n return $(this.config.container)\n }\n\n return $(document).find(this.config.container)\n }\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n const triggers = this.config.trigger.split(' ')\n\n triggers.forEach((trigger) => {\n if (trigger === 'click') {\n $(this.element).on(\n this.constructor.Event.CLICK,\n this.config.selector,\n (event) => this.toggle(event)\n )\n } else if (trigger !== Trigger.MANUAL) {\n const eventIn = trigger === Trigger.HOVER\n ? this.constructor.Event.MOUSEENTER\n : this.constructor.Event.FOCUSIN\n const eventOut = trigger === Trigger.HOVER\n ? this.constructor.Event.MOUSELEAVE\n : this.constructor.Event.FOCUSOUT\n\n $(this.element)\n .on(\n eventIn,\n this.config.selector,\n (event) => this._enter(event)\n )\n .on(\n eventOut,\n this.config.selector,\n (event) => this._leave(event)\n )\n }\n })\n\n this._hideModalHandler = () => {\n if (this.element) {\n this.hide()\n }\n }\n\n $(this.element).closest('.modal').on(\n 'hide.bs.modal',\n this._hideModalHandler\n )\n\n if (this.config.selector) {\n this.config = {\n ...this.config,\n trigger: 'manual',\n selector: ''\n }\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const titleType = typeof this.element.getAttribute('data-original-title')\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute(\n 'data-original-title',\n this.element.getAttribute('title') || ''\n )\n\n this.element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n const dataKey = this.constructor.DATA_KEY\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER\n ] = true\n }\n\n if ($(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {\n context._hoverState = HoverState.SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.SHOW\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.SHOW) {\n context.show()\n }\n }, context.config.delay.show)\n }\n\n _leave(event, context) {\n const dataKey = this.constructor.DATA_KEY\n context = context || $(event.currentTarget).data(dataKey)\n\n if (!context) {\n context = new this.constructor(\n event.currentTarget,\n this._getDelegateConfig()\n )\n $(event.currentTarget).data(dataKey, context)\n }\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER\n ] = false\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HoverState.OUT\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HoverState.OUT) {\n context.hide()\n }\n }, context.config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n const dataAttributes = $(this.element).data()\n\n Object.keys(dataAttributes)\n .forEach((dataAttr) => {\n if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {\n delete dataAttributes[dataAttr]\n }\n })\n\n config = {\n ...this.constructor.Default,\n ...dataAttributes,\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n }\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n Util.typeCheckConfig(\n NAME,\n config,\n this.constructor.DefaultType\n )\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn)\n }\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n if (this.config) {\n for (const key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key]\n }\n }\n }\n\n return config\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n _handlePopperPlacementChange(popperData) {\n const popperInstance = popperData.instance\n this.tip = popperInstance.popper\n this._cleanTipClass()\n this.addAttachmentClass(this._getAttachment(popperData.placement))\n }\n\n _fixTransition() {\n const tip = this.getTipElement()\n const initConfigAnimation = this.config.animation\n\n if (tip.getAttribute('x-placement') !== null) {\n return\n }\n\n $(tip).removeClass(ClassName.FADE)\n this.config.animation = false\n this.hide()\n this.show()\n this.config.animation = initConfigAnimation\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' && config\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Tooltip(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Tooltip._jQueryInterface\n$.fn[NAME].Constructor = Tooltip\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Tooltip._jQueryInterface\n}\n\nexport default Tooltip\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Tooltip from './tooltip'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'popover'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.popover'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\nconst CLASS_PREFIX = 'bs-popover'\nconst BSCLS_PREFIX_REGEX = new RegExp(`(^|\\\\s)${CLASS_PREFIX}\\\\S+`, 'g')\n\nconst Default = {\n ...Tooltip.Default,\n placement : 'right',\n trigger : 'click',\n content : '',\n template : '
' +\n '
' +\n '

' +\n '
'\n}\n\nconst DefaultType = {\n ...Tooltip.DefaultType,\n content : '(string|element|function)'\n}\n\nconst ClassName = {\n FADE : 'fade',\n SHOW : 'show'\n}\n\nconst Selector = {\n TITLE : '.popover-header',\n CONTENT : '.popover-body'\n}\n\nconst Event = {\n HIDE : `hide${EVENT_KEY}`,\n HIDDEN : `hidden${EVENT_KEY}`,\n SHOW : `show${EVENT_KEY}`,\n SHOWN : `shown${EVENT_KEY}`,\n INSERTED : `inserted${EVENT_KEY}`,\n CLICK : `click${EVENT_KEY}`,\n FOCUSIN : `focusin${EVENT_KEY}`,\n FOCUSOUT : `focusout${EVENT_KEY}`,\n MOUSEENTER : `mouseenter${EVENT_KEY}`,\n MOUSELEAVE : `mouseleave${EVENT_KEY}`\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Popover extends Tooltip {\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get DATA_KEY() {\n return DATA_KEY\n }\n\n static get Event() {\n return Event\n }\n\n static get EVENT_KEY() {\n return EVENT_KEY\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n addAttachmentClass(attachment) {\n $(this.getTipElement()).addClass(`${CLASS_PREFIX}-${attachment}`)\n }\n\n getTipElement() {\n this.tip = this.tip || $(this.config.template)[0]\n return this.tip\n }\n\n setContent() {\n const $tip = $(this.getTipElement())\n\n // We use append for html objects to maintain js events\n this.setElementContent($tip.find(Selector.TITLE), this.getTitle())\n let content = this._getContent()\n if (typeof content === 'function') {\n content = content.call(this.element)\n }\n this.setElementContent($tip.find(Selector.CONTENT), content)\n\n $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)\n }\n\n // Private\n\n _getContent() {\n return this.element.getAttribute('data-content') ||\n this.config.content\n }\n\n _cleanTipClass() {\n const $tip = $(this.getTipElement())\n const tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX)\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''))\n }\n }\n\n // Static\n\n static _jQueryInterface(config) {\n return this.each(function () {\n let data = $(this).data(DATA_KEY)\n const _config = typeof config === 'object' ? config : null\n\n if (!data && /dispose|hide/.test(config)) {\n return\n }\n\n if (!data) {\n data = new Popover(this, _config)\n $(this).data(DATA_KEY, data)\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n$.fn[NAME] = Popover._jQueryInterface\n$.fn[NAME].Constructor = Popover\n$.fn[NAME].noConflict = () => {\n $.fn[NAME] = JQUERY_NO_CONFLICT\n return Popover._jQueryInterface\n}\n\nexport default Popover\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.4.1): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\nimport Util from './util'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'scrollspy'\nconst VERSION = '4.4.1'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst JQUERY_NO_CONFLICT = $.fn[NAME]\n\nconst Default = {\n offset : 10,\n method : 'auto',\n target : ''\n}\n\nconst DefaultType = {\n offset : 'number',\n method : 'string',\n target : '(string|element)'\n}\n\nconst Event = {\n ACTIVATE : `activate${EVENT_KEY}`,\n SCROLL : `scroll${EVENT_KEY}`,\n LOAD_DATA_API : `load${EVENT_KEY}${DATA_API_KEY}`\n}\n\nconst ClassName = {\n DROPDOWN_ITEM : 'dropdown-item',\n DROPDOWN_MENU : 'dropdown-menu',\n ACTIVE : 'active'\n}\n\nconst Selector = {\n DATA_SPY : '[data-spy=\"scroll\"]',\n ACTIVE : '.active',\n NAV_LIST_GROUP : '.nav, .list-group',\n NAV_LINKS : '.nav-link',\n NAV_ITEMS : '.nav-item',\n LIST_ITEMS : '.list-group-item',\n DROPDOWN : '.dropdown',\n DROPDOWN_ITEMS : '.dropdown-item',\n DROPDOWN_TOGGLE : '.dropdown-toggle'\n}\n\nconst OffsetMethod = {\n OFFSET : 'offset',\n POSITION : 'position'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass ScrollSpy {\n constructor(element, config) {\n this._element = element\n this._scrollElement = element.tagName === 'BODY' ? window : element\n this._config = this._getConfig(config)\n this._selector = `${this._config.target} ${Selector.NAV_LINKS},` +\n `${this._config.target} ${Selector.LIST_ITEMS},` +\n `${this._config.target} ${Selector.DROPDOWN_ITEMS}`\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n $(this._scrollElement).on(Event.SCROLL, (event) => this._process(event))\n\n this.refresh()\n this._process()\n }\n\n // Getters\n\n static get VERSION() {\n return VERSION\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n refresh() {\n const autoMethod = this._scrollElement === this._scrollElement.window\n ? OffsetMethod.OFFSET : OffsetMethod.POSITION\n\n const offsetMethod = this._config.method === 'auto'\n ? autoMethod : this._config.method\n\n const offsetBase = offsetMethod === OffsetMethod.POSITION\n ? this._getScrollTop() : 0\n\n this._offsets = []\n this._targets = []\n\n this._scrollHeight = this._getScrollHeight()\n\n const targets = [].slice.call(document.querySelectorAll(this._selector))\n\n targets\n .map((element) => {\n let target\n const targetSelector = Util.getSelectorFromElement(element)\n\n if (targetSelector) {\n target = document.querySelector(targetSelector)\n }\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [\n $(target)[offsetMethod]().top + offsetBase,\n targetSelector\n ]\n }\n }\n return null\n })\n .filter((item) => item)\n .sort((a, b) => a[0] - b[0])\n .forEach((item) => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n $.removeData(this._element, DATA_KEY)\n $(this._scrollElement).off(EVENT_KEY)\n\n this._element = null\n this._scrollElement = null\n this._config = null\n this._selector = null\n this._offsets = null\n this._targets = null\n this._activeTarget = null\n this._scrollHeight = null\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...typeof config === 'object' && config ? config : {}\n }\n\n if (typeof config.target !== 'string') {\n let id = $(config.target).attr('id')\n if (!id) {\n id = Util.getUID(NAME)\n $(config.target).attr('id', id)\n }\n config.target = `#${id}`\n }\n\n Util.typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window\n ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window\n ? window.innerHeight : this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset +\n scrollHeight -\n this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n const offsetLength = this._offsets.length\n for (let i = offsetLength; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i] &&\n scrollTop >= this._offsets[i] &&\n (typeof this._offsets[i + 1] === 'undefined' ||\n scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n const queries = this._selector\n .split(',')\n .map((selector) => `${selector}[data-target=\"${target}\"],${selector}[href=\"${target}\"]`)\n\n const $link = $([].slice.call(document.querySelectorAll(queries.join(','))))\n\n if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {\n $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE)\n $link.addClass(ClassName.ACTIVE)\n } else {\n // Set triggered link as active\n $link.addClass(ClassName.ACTIVE)\n // Set triggered links parents as active\n // With both
- - - - - - - +
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/views/pages/proxnav/corrosion.html b/views/pages/proxnav/corrosion.html index fd27aba0..a49adc16 100644 --- a/views/pages/proxnav/corrosion.html +++ b/views/pages/proxnav/corrosion.html @@ -4,156 +4,61 @@ - H​oly Unb​loc​ke​r - + H­o­ly Un­blo­ck­er + + - - - - - - - - - - - + + -
-
- - -
-
- - -
-
- -
-

Co​rrosi​on

-

Th​e mai​n pro​xy f​or Ti​tan​ium Ne​two​rk wi​th en​hanc​ed suppo​rt for a lar​ge major​ity o​f si​tes wi​th su​ppo​rt - for hCA​PTCH​A.

-
-
-
- - -
-
-

- More Information:

-

Works with YouTube, Discord, various game sites (.io sites included) and more! -
Corr​osi​on is curre​ntly the m​ost reco​mmen​ded pro​xy with​ a hi​gh libr​ary of support​ed si​tes. -
Sites with given support for logging in are Twitter, Reddit and Discord. YouTube allows for nearly full functionality. -

Common Errors with Solutions: -
- Try using Classic mode or doing 'Reload Frame'. ("cdn.example.com" cannot be reached.) -
- You cannot login normally into the majority sites. Phone verification on a select number of sites may occur also with no real soluion. -

GitHub:  https://github​.com/ti​taniumnetwork-​dev/cor​rosio​n -

-
- -
-
-
+ +
+
+
+
+ +
+

Co­rrosi­on

+

Th­e mai­n pro­xy f­or Ti­tan­ium Ne­two­rk wi­th en­hanc­ed suppo­rt for a lar­ge major­ity o­f si­tes wi­th su­ppo­rt for hCA­PTCH­A.

+
+ + Classic + Stealth +
+

More Inf­ormation:

+
+

+ Wo­rks with YouT­ube, Di­scord, various game sites (.io sites included) and more! +
Corr­osi­on is curre­ntly the m­ost reco­mmen­ded pro­xy with­ a hi­gh libr­ary of support­ed si­tes. +
Si­tes with g­iven sup­port for log­ging in are Twi­tter, Red­dit and Disco­rd. YouTu­be a­llows fo­r ne­arly fu­ll functio­nality. +

+

+ Co­mmo­n Err­o­rs wi­th So­luti­ons: +
- Try using Clas­sic mode or doing 'Reload Frame'. ("cdn.example.com" cannot be reached.) +
- You cannot log­in normally into the majority of sites. Pho­ne verifica­tion o­n a sele­ct num­ber of si­tes m­ay oc­cur al­so w­ith no r­eal solu­ion. +

+

Git­Hub: https://github­.com/ti­taniumnetwork-­dev/Cor­rosio­n

+ - - - + - - - - + + + + + + \ No newline at end of file diff --git a/views/pages/proxnav/discordhub.html b/views/pages/proxnav/discordhub.html deleted file mode 100644 index 0ac62668..00000000 --- a/views/pages/proxnav/discordhub.html +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - H​oly Unb​loc​ke​r - - - - - - - - - - - - - - - - - - - -
-
- - -
-
- - - -
-
-
-

Discord Proxy

-

-
If you wish for a pro​xy with better support for Disc​ord, be sure to join the T​N Disco​rd and check out our Patreo​n! -
Each of the various P​atre​on tiers helps out significan​tly wi​th ser​ver expens​es and do​main rest​ocks. -
Although you can continue supporting H​oly Unb​lo​ck​er for free with Ar​c (by simply using HU​ more), do​nati​ng helps a lot more when upgradi​ng or maintain​ing - its serv​ces. -

Rough summary of possible benef​its ($2-10): -
• Su​bscr​iber Lib​rary Ac​cess (Subscriber D​isc​ord Pro​x​y) -
• Be​ta Mem​bersh​ip for H​U -
• Feat​ure Requests -
• Monthly shout-outs in announcements -
• Personal​ized Domai​ns (Can requ​est for your own doma​in with H​U) -
• Excl​usive rol​e (Su​pport​er and Sub​scri​ber) -

The prem​ium Di​sco​rd p​r​ox​y is outside of these issues: -
• Being prompted to ve​rify by ema​il or via pho​ne numb​er -
• S​low mess​aging or in​valid invit​es -
• Sites getting bl​ock​ed often -
• And more! -

- -
-
-
-
-
-
-
- - - - - - - - - - - - - \ No newline at end of file diff --git a/views/pages/proxnav/preset/discord.html b/views/pages/proxnav/preset/discord.html new file mode 100644 index 00000000..29ed114a --- /dev/null +++ b/views/pages/proxnav/preset/discord.html @@ -0,0 +1,69 @@ + + + + + + + H­o­ly Un­blo­ck­er + + + + + + + + + + + + +
+
+
+
+ +
+

Di­sc­ord Pr­oxy

+
+

+ If you wish for a pro­xy with better support for Disc­ord, be sure to join the T­N Disco­rd and check out our Patreo­n! +
Each of the various P­atre­on tiers helps out significan­tly wi­th ser­ver expens­es and do­main rest­ocks. +
Although you can continue supporting H­oly Unb­lo­ck­er for free with Ar­c/Ads (by simply using HU­ more), do­nati­ng helps a lot more when upgradi­ng or maintain­ing its serv­ces. +

+

Rough summary of possible benef­its ($2-10):

+
    +
  • Su­bscr­iber Lib­rary Ac­cess (Subscriber D­isc­ord Pro­x­y)
  • +
  • Be­ta Mem­bersh­ip for H­U
  • +
  • Feat­ure Requests
  • +
  • Monthly shout-outs in announcements
  • +
  • Personal­ized Domai­ns (Can requ­est for your own doma­in with H­U)
  • +
  • Excl­usive rol­e (Su­pport­er and Sub­scri­ber)
  • +
+

The prem­ium Di­sco­rd p­r­ox­y is outside of these issues:

+
    +
  • Being prompted to ve­rify by ema­il or via pho­ne numb­er
  • +
  • S­low mess­aging or in­valid invit­es
  • +
  • Si­tes getting bl­ock­ed often
  • +
  • And more!
  • +
+
+ +
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/views/pages/proxnav/preset/reddit.html b/views/pages/proxnav/preset/reddit.html new file mode 100644 index 00000000..9247a854 --- /dev/null +++ b/views/pages/proxnav/preset/reddit.html @@ -0,0 +1,49 @@ + + + + + + + H­o­ly Un­blo­ck­er + + + + + + + + + + + + +
+
+
+
+ +
+

Re­dd­it Pr­oxy

+

+ Using the local libreddit instance is reccomended. +

+ +
+
+ + + + + + + + + + \ No newline at end of file diff --git a/views/pages/proxnav/preset/youtube.html b/views/pages/proxnav/preset/youtube.html new file mode 100644 index 00000000..4f9e89f0 --- /dev/null +++ b/views/pages/proxnav/preset/youtube.html @@ -0,0 +1,55 @@ + + + + + + + H­o­ly Un­blo­ck­er + + + + + + + + + + + + +
+
+
+
+ +
+

Yout­ube Pr­oxy

+

+ Choose which pr­oxy you would like to use. Below is some information. +
Yo­uTube n­ow ha­s enha­nced sup­port wi­th onsi­te na­vigat­ion w/ Co­rro­sion! Sim­ply u­se th­e but­tons belo­w to a­cce­ss YouT­ube + vi­a Cor­rosi­on. +

+

Having Issues?

+

+ Read the FAQ page for more information. +
Sometimes the pro­xie­s are under high load so things may be s­low, sorry. In that case simply wait for the pa­ge to load. +

+ +
+
+ + + + + + + + + + \ No newline at end of file diff --git a/views/pages/proxnav/womginx.html b/views/pages/proxnav/womginx.html index 0370f627..ad08fbc9 100644 --- a/views/pages/proxnav/womginx.html +++ b/views/pages/proxnav/womginx.html @@ -4,160 +4,57 @@ - - H​oly Unb​loc​ke​r - + H­o­ly Un­blo­ck­er + + - - - - - - - - - - - + + -
-
- - -
-
- - -
-
- -
- -
- -
-

Inc​red​i​bly fa​st p​r​oxy us​ing only ngi​nx as the ba​cke​nd se​rv​er.

-
-
-
- - -
-
-

- More Information:

-

Has decent supp​ort for a large amount of sit​es. Has decent support for Discord and reC​APTC​HA. -
Some limi​tation​s would be that with some fil​ter​s, pag​es may be still bl​oc​ked. -
In the ca​se of iss​ues be sure to wait for the page to fully load before navigati​ng the site you are o​n. -
Please read the FAQ page regarding issues with reC​APTC​HA on W​omgi​nx. -

GitHub:  https://github.com/binary-person/womginx
-

-


Wo​mgi​nx, created by Bina​ry Per​son. -

-
-
-
-
+ +
+
+
+
+ +
+ +

Inc­red­i­bly fa­st p­r­oxy us­ing only ngi­nx as the ba­cke­nd se­rv­er.

+
+ + Classic + Stealth +
+

More Inf­ormation:

+
+

+ Has decent supp­ort for a large amount of sit­es. Has decent support for Di­scord and reC­APTC­HA. +
Some limi­tation­s would be that with some fil­ter­s, pag­es may be still bl­oc­ked. +
In the ca­se of iss­ues be sure to wait for the page to fully load before navigati­ng the site you are o­n. +
Please read the FAQ page regarding issues with reC­APTC­HA on W­omgi­nx. +

+

Git­Hub: https://github­.com/b­inary-person/womgi­nx

- - - - - - - - - - +
+ + + + + + + + + + \ No newline at end of file diff --git a/views/pages/proxnav/youtube.html b/views/pages/proxnav/youtube.html deleted file mode 100644 index 8c3c4fda..00000000 --- a/views/pages/proxnav/youtube.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - H​oly Unb​loc​ke​r - - - - - - - - - - - - - - - - - - - -
-
- - -
-
- - - -
-
-
-

Youtube Proxy

-

Choose which pr​oxy you would like to use. Below is some information.
Yo​uTube n​ow ha​s enha​nced sup​port wi​th onsi​te na​vigat​ion w/ Co​rro​sion! - Sim​ply u​se th​e but​tons belo​w to a​cce​ss YouT​ube vi​a Cor​rosi​on.

-

Having Issues?: -

-

-
Read the FAQ page for more information. -

Common Issu​es and Solut​ions: -
Sometimes the pro​xie​s are under high load so things may be s​low, sorry. In that case simply wait for the pa​ge to load. -
Use the full U​RL of the vi​deo you want to watch with All​oy or Wo​mgi​nx if you have any issues. -
If you need to find the full URL of the video you want to watch on Alloy I would suggest using something like DuckDuckGo or Google on another pr​oxy. -

- -
-
-
-
-
-
-
- - - - - - - - - - - - - \ No newline at end of file diff --git a/views/pages/surf.html b/views/pages/surf.html index 92cb16df..caf0a0c5 100644 --- a/views/pages/surf.html +++ b/views/pages/surf.html @@ -4,161 +4,52 @@ - Web Pr­oxi­es - - - + H­o­ly Un­blo­ck­er + + - - - - - - - - - - - + + -
-
- - -
-
- - - -
-
-
-

Web Proxies

-

Choo­se which prox­y you would like to use.
St­ea­lth mod­e h­ides y­our bro­ws­er histor­y whi­le Cla­ssic mo­de is th­e sta­nda­rd - f­orm of na­viga­tion.

-
- - Corrosion - Womginx -
-

More Information:

-

Cor​rosion: Of​fici​al pro​xy o​f Ti​tan​ium Ne​two​rk wi​th en​hanc​ed suppo​rt for a lar​ge major​ity o​f si​tes and - Y​ouTub​e. -
Womgi­nx: Useful for sites which use reCAPTCHA or hCaptcha. Also faster. - - -

-

If you get any errors please check the FAQ page! -
Join the TN discor­d for upd­ated Holy Unblocker site links and better services. -

- https://discord.gg/unblock - -
-
-
+ +
+
+
+
+ +
+

W­eb P­ro­xi­es

+

Choo­se which pr­ox­y you would like to use.
St­ea­lth mod­e h­ides y­our bro­ws­er histor­y whi­le Cla­ssic mo­de is th­e sta­nda­rd f­orm of na­viga­tion.

+
+

More Information:

+
+

+ Cor­rosion: Of­fici­al pro­xy o­f Ti­tan­ium Ne­two­rk wi­th en­hanc­ed suppo­rt for a lar­ge major­ity o­f si­tes and Y­ouTub­e. +
Pal­ladi­um: The fast­est pr­oxy, seve­rely beating Cor­rosi­on by 3x a­nd 1.4x for W­omg­inx wh­en i­t com­es t­o Di­scor­d. +
Wo­mgi­­nx: Useful for sites which use reC­APTC­HA or hCaptcha. Also faster. +

+

If you get any errors please check the FAQ page!
Join the T­N disc­or­d for upd­ated H­ol­y Un­blo­cke­r sit­e li­nks and b­et­ter ser­vic­es.

+ h­ttp­s://di­scor­d.g­g/unb­lo­ck
+ - - - - - - - - + + + + + + \ No newline at end of file diff --git a/views/particles.js b/views/particles.js deleted file mode 100644 index 61839958..00000000 --- a/views/particles.js +++ /dev/null @@ -1,6 +0,0 @@ -/* ----------------------------------------------- -/* Author : Vincent Garreau - vincentgarreau.com -/* MIT license: http://opensource.org/licenses/MIT -/* v2.0.0 FPS Limit Version -/* ----------------------------------------------- */ -var pJS=function(e,t){var a=document.querySelector("#"+e+" > .particles-js-canvas-el");this.pJS={fps_limit:0,canvas:{el:a,w:a.offsetWidth,h:a.offsetHeight},particles:{number:{value:400,density:{enable:!0,value_area:800}},color:{value:"#fff"},shape:{type:"circle",stroke:{width:0,color:"#ff0000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:1,random:!1,anim:{enable:!1,speed:2,opacity_min:0,sync:!1}},size:{value:20,random:!1,anim:{enable:!1,speed:20,size_min:0,sync:!1}},line_linked:{enable:!0,distance:100,color:"#fff",opacity:1,width:1},move:{enable:!0,speed:2,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:3e3,rotateY:3e3}},array:[]},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:100,line_linked:{opacity:1}},bubble:{distance:200,size:80,duration:.4},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}},mouse:{}},retina_detect:!1,fn:{interact:{},modes:{},vendors:{}},tmp:{}};var i=this.pJS;t&&Object.deepExtend(i,t),i.tmp.obj={size_value:i.particles.size.value,size_anim_speed:i.particles.size.anim.speed,move_speed:i.particles.move.speed,line_linked_distance:i.particles.line_linked.distance,line_linked_width:i.particles.line_linked.width,mode_grab_distance:i.interactivity.modes.grab.distance,mode_bubble_distance:i.interactivity.modes.bubble.distance,mode_bubble_size:i.interactivity.modes.bubble.size,mode_repulse_distance:i.interactivity.modes.repulse.distance},i.fn.retinaInit=function(){i.retina_detect&&window.devicePixelRatio>1?(i.canvas.pxratio=window.devicePixelRatio,i.tmp.retina=!0):(i.canvas.pxratio=1,i.tmp.retina=!1),i.canvas.w=i.canvas.el.offsetWidth*i.canvas.pxratio,i.canvas.h=i.canvas.el.offsetHeight*i.canvas.pxratio,i.particles.size.value=i.tmp.obj.size_value*i.canvas.pxratio,i.particles.size.anim.speed=i.tmp.obj.size_anim_speed*i.canvas.pxratio,i.particles.move.speed=i.tmp.obj.move_speed*i.canvas.pxratio,i.particles.line_linked.distance=i.tmp.obj.line_linked_distance*i.canvas.pxratio,i.interactivity.modes.grab.distance=i.tmp.obj.mode_grab_distance*i.canvas.pxratio,i.interactivity.modes.bubble.distance=i.tmp.obj.mode_bubble_distance*i.canvas.pxratio,i.particles.line_linked.width=i.tmp.obj.line_linked_width*i.canvas.pxratio,i.interactivity.modes.bubble.size=i.tmp.obj.mode_bubble_size*i.canvas.pxratio,i.interactivity.modes.repulse.distance=i.tmp.obj.mode_repulse_distance*i.canvas.pxratio},i.fn.canvasInit=function(){i.canvas.ctx=i.canvas.el.getContext("2d")},i.fn.canvasSize=function(){i.canvas.el.width=i.canvas.w,i.canvas.el.height=i.canvas.h,i&&i.interactivity.events.resize&&window.addEventListener("resize",function(){i.canvas.w=i.canvas.el.offsetWidth,i.canvas.h=i.canvas.el.offsetHeight,i.tmp.retina&&(i.canvas.w*=i.canvas.pxratio,i.canvas.h*=i.canvas.pxratio),i.canvas.el.width=i.canvas.w,i.canvas.el.height=i.canvas.h,i.particles.move.enable||(i.fn.particlesEmpty(),i.fn.particlesCreate(),i.fn.particlesDraw(),i.fn.vendors.densityAutoParticles()),i.fn.vendors.densityAutoParticles()})},i.fn.canvasPaint=function(){i.canvas.ctx.fillRect(0,0,i.canvas.w,i.canvas.h)},i.fn.canvasClear=function(){i.canvas.ctx.clearRect(0,0,i.canvas.w,i.canvas.h)},i.fn.particle=function(e,t,a){if(this.radius=(i.particles.size.random?Math.random():1)*i.particles.size.value,i.particles.size.anim.enable&&(this.size_status=!1,this.vs=i.particles.size.anim.speed/100,i.particles.size.anim.sync||(this.vs=this.vs*Math.random())),this.x=a?a.x:Math.random()*i.canvas.w,this.y=a?a.y:Math.random()*i.canvas.h,this.x>i.canvas.w-2*this.radius?this.x=this.x-this.radius:this.x<2*this.radius&&(this.x=this.x+this.radius),this.y>i.canvas.h-2*this.radius?this.y=this.y-this.radius:this.y<2*this.radius&&(this.y=this.y+this.radius),i.particles.move.bounce&&i.fn.vendors.checkOverlap(this,a),this.color={},"object"==typeof e.value)if(e.value instanceof Array){var s=e.value[Math.floor(Math.random()*i.particles.color.value.length)];this.color.rgb=hexToRgb(s)}else null!=e.value.r&&null!=e.value.g&&null!=e.value.b&&(this.color.rgb={r:e.value.r,g:e.value.g,b:e.value.b}),null!=e.value.h&&null!=e.value.s&&null!=e.value.l&&(this.color.hsl={h:e.value.h,s:e.value.s,l:e.value.l});else"random"==e.value?this.color.rgb={r:Math.floor(256*Math.random())+0,g:Math.floor(256*Math.random())+0,b:Math.floor(256*Math.random())+0}:"string"==typeof e.value&&(this.color=e,this.color.rgb=hexToRgb(this.color.value));this.opacity=(i.particles.opacity.random?Math.random():1)*i.particles.opacity.value,i.particles.opacity.anim.enable&&(this.opacity_status=!1,this.vo=i.particles.opacity.anim.speed/100,i.particles.opacity.anim.sync||(this.vo=this.vo*Math.random()));var n={};switch(i.particles.move.direction){case"top":n={x:0,y:-1};break;case"top-right":n={x:.5,y:-.5};break;case"right":n={x:1,y:-0};break;case"bottom-right":n={x:.5,y:.5};break;case"bottom":n={x:0,y:1};break;case"bottom-left":n={x:-.5,y:1};break;case"left":n={x:-1,y:0};break;case"top-left":n={x:-.5,y:-.5};break;default:n={x:0,y:0}}i.particles.move.straight?(this.vx=n.x,this.vy=n.y,i.particles.move.random&&(this.vx=this.vx*Math.random(),this.vy=this.vy*Math.random())):(this.vx=n.x+Math.random()-.5,this.vy=n.y+Math.random()-.5),this.vx_i=this.vx,this.vy_i=this.vy;var r=i.particles.shape.type;if("object"==typeof r){if(r instanceof Array){var c=r[Math.floor(Math.random()*r.length)];this.shape=c}}else this.shape=r;if("image"==this.shape){var o=i.particles.shape;this.img={src:o.image.src,ratio:o.image.width/o.image.height},this.img.ratio||(this.img.ratio=1),"svg"==i.tmp.img_type&&null!=i.tmp.source_svg&&(i.fn.vendors.createSvgImg(this),i.tmp.pushing&&(this.img.loaded=!1))}},i.fn.particle.prototype.draw=function(){var e=this;if(null!=e.radius_bubble)var t=e.radius_bubble;else t=e.radius;if(null!=e.opacity_bubble)var a=e.opacity_bubble;else a=e.opacity;if(e.color.rgb)var s="rgba("+e.color.rgb.r+","+e.color.rgb.g+","+e.color.rgb.b+","+a+")";else s="hsla("+e.color.hsl.h+","+e.color.hsl.s+"%,"+e.color.hsl.l+"%,"+a+")";switch(i.canvas.ctx.fillStyle=s,i.canvas.ctx.beginPath(),e.shape){case"circle":i.canvas.ctx.arc(e.x,e.y,t,0,2*Math.PI,!1);break;case"edge":i.canvas.ctx.rect(e.x-t,e.y-t,2*t,2*t);break;case"triangle":i.fn.vendors.drawShape(i.canvas.ctx,e.x-t,e.y+t/1.66,2*t,3,2);break;case"polygon":i.fn.vendors.drawShape(i.canvas.ctx,e.x-t/(i.particles.shape.polygon.nb_sides/3.5),e.y-t/.76,2.66*t/(i.particles.shape.polygon.nb_sides/3),i.particles.shape.polygon.nb_sides,1);break;case"star":i.fn.vendors.drawShape(i.canvas.ctx,e.x-2*t/(i.particles.shape.polygon.nb_sides/4),e.y-t/1.52,2*t*2.66/(i.particles.shape.polygon.nb_sides/3),i.particles.shape.polygon.nb_sides,2);break;case"image":;if("svg"==i.tmp.img_type)var n=e.img.obj;else n=i.tmp.img_obj;n&&i.canvas.ctx.drawImage(n,e.x-t,e.y-t,2*t,2*t/e.img.ratio)}i.canvas.ctx.closePath(),i.particles.shape.stroke.width>0&&(i.canvas.ctx.strokeStyle=i.particles.shape.stroke.color,i.canvas.ctx.lineWidth=i.particles.shape.stroke.width,i.canvas.ctx.stroke()),i.canvas.ctx.fill()},i.fn.particlesCreate=function(){for(var e=0;e=i.particles.opacity.value&&(t.opacity_status=!1),t.opacity+=t.vo):(t.opacity<=i.particles.opacity.anim.opacity_min&&(t.opacity_status=!0),t.opacity-=t.vo),t.opacity<0&&(t.opacity=0)),i.particles.size.anim.enable&&(1==t.size_status?(t.radius>=i.particles.size.value&&(t.size_status=!1),t.radius+=t.vs):(t.radius<=i.particles.size.anim.size_min&&(t.size_status=!0),t.radius-=t.vs),t.radius<0&&(t.radius=0)),"bounce"==i.particles.move.out_mode)var s={x_left:t.radius,x_right:i.canvas.w,y_top:t.radius,y_bottom:i.canvas.h};else s={x_left:-t.radius,x_right:i.canvas.w+t.radius,y_top:-t.radius,y_bottom:i.canvas.h+t.radius};switch(t.x-t.radius>i.canvas.w?(t.x=s.x_left,t.y=Math.random()*i.canvas.h):t.x+t.radius<0&&(t.x=s.x_right,t.y=Math.random()*i.canvas.h),t.y-t.radius>i.canvas.h?(t.y=s.y_top,t.x=Math.random()*i.canvas.w):t.y+t.radius<0&&(t.y=s.y_bottom,t.x=Math.random()*i.canvas.w),i.particles.move.out_mode){case"bounce":t.x+t.radius>i.canvas.w?t.vx=-t.vx:t.x-t.radius<0&&(t.vx=-t.vx),t.y+t.radius>i.canvas.h?t.vy=-t.vy:t.y-t.radius<0&&(t.vy=-t.vy)}if(isInArray("grab",i.interactivity.events.onhover.mode)&&i.fn.modes.grabParticle(t),(isInArray("bubble",i.interactivity.events.onhover.mode)||isInArray("bubble",i.interactivity.events.onclick.mode))&&i.fn.modes.bubbleParticle(t),(isInArray("repulse",i.interactivity.events.onhover.mode)||isInArray("repulse",i.interactivity.events.onclick.mode))&&i.fn.modes.repulseParticle(t),i.particles.line_linked.enable||i.particles.move.attract.enable)for(var n=e+1;n0){var c=i.particles.line_linked.color_rgb_line;i.canvas.ctx.strokeStyle="rgba("+c.r+","+c.g+","+c.b+","+r+")",i.canvas.ctx.lineWidth=i.particles.line_linked.width,i.canvas.ctx.beginPath(),i.canvas.ctx.moveTo(e.x,e.y),i.canvas.ctx.lineTo(t.x,t.y),i.canvas.ctx.stroke(),i.canvas.ctx.closePath()}}},i.fn.interact.attractParticles=function(e,t){var a=e.x-t.x,s=e.y-t.y;if(Math.sqrt(a*a+s*s)<=i.particles.line_linked.distance){var n=a/(1e3*i.particles.move.attract.rotateX),r=s/(1e3*i.particles.move.attract.rotateY);e.vx-=n,e.vy-=r,t.vx+=n,t.vy+=r}},i.fn.interact.bounceParticles=function(e,t){var a=e.x-t.x,i=e.y-t.y;Math.sqrt(a*a+i*i)<=e.radius+t.radius&&(e.vx=-e.vx,e.vy=-e.vy,t.vx=-t.vx,t.vy=-t.vy)},i.fn.modes.pushParticles=function(e,t){i.tmp.pushing=!0;for(var a=0;a=0&&"mousemove"==i.interactivity.status){if(i.interactivity.modes.bubble.size!=i.particles.size.value)if(i.interactivity.modes.bubble.size>i.particles.size.value){(c=e.radius+i.interactivity.modes.bubble.size*s)>=0&&(e.radius_bubble=c)}else{var r=e.radius-i.interactivity.modes.bubble.size,c=e.radius-r*s;e.radius_bubble=c>0?c:0}var o;if(i.interactivity.modes.bubble.opacity!=i.particles.opacity.value)if(i.interactivity.modes.bubble.opacity>i.particles.opacity.value)(o=i.interactivity.modes.bubble.opacity*s)>e.opacity&&o<=i.interactivity.modes.bubble.opacity&&(e.opacity_bubble=o);else(o=e.opacity-(i.particles.opacity.value-i.interactivity.modes.bubble.opacity)*s)=i.interactivity.modes.bubble.opacity&&(e.opacity_bubble=o)}}else n();"mouseleave"==i.interactivity.status&&n()}else if(i.interactivity.events.onclick.enable&&isInArray("bubble",i.interactivity.events.onclick.mode)){if(i.tmp.bubble_clicking){t=e.x-i.interactivity.mouse.click_pos_x,a=e.y-i.interactivity.mouse.click_pos_y;var l=Math.sqrt(t*t+a*a),v=((new Date).getTime()-i.interactivity.mouse.click_time)/1e3;v>i.interactivity.modes.bubble.duration&&(i.tmp.bubble_duration_end=!0),v>2*i.interactivity.modes.bubble.duration&&(i.tmp.bubble_clicking=!1,i.tmp.bubble_duration_end=!1)}function p(t,a,s,n,r){if(t!=a)if(i.tmp.bubble_duration_end)null!=s&&(o=t+(t-(n-v*(n-t)/i.interactivity.modes.bubble.duration)),"size"==r&&(e.radius_bubble=o),"opacity"==r&&(e.opacity_bubble=o));else if(l<=i.interactivity.modes.bubble.distance){if(null!=s)var c=s;else c=n;if(c!=t){var o=n-v*(n-t)/i.interactivity.modes.bubble.duration;"size"==r&&(e.radius_bubble=o),"opacity"==r&&(e.opacity_bubble=o)}}else"size"==r&&(e.radius_bubble=void 0),"opacity"==r&&(e.opacity_bubble=void 0)}i.tmp.bubble_clicking&&(p(i.interactivity.modes.bubble.size,i.particles.size.value,e.radius_bubble,e.radius,"size"),p(i.interactivity.modes.bubble.opacity,i.particles.opacity.value,e.opacity_bubble,e.opacity,"opacity"))}},i.fn.modes.repulseParticle=function(e){if(i.interactivity.events.onhover.enable&&isInArray("repulse",i.interactivity.events.onhover.mode)&&"mousemove"==i.interactivity.status){var t=e.x-i.interactivity.mouse.pos_x,a=e.y-i.interactivity.mouse.pos_y,s=Math.sqrt(t*t+a*a),n=t/s,r=a/s,c=clamp(1/(l=i.interactivity.modes.repulse.distance)*(-1*Math.pow(s/l,2)+1)*l*100,0,50),o={x:e.x+n*c,y:e.y+r*c};"bounce"==i.particles.move.out_mode?(o.x-e.radius>0&&o.x+e.radius0&&o.y+e.radiusi.canvas.w?e.vx=-e.vx:a-e.radius<0&&(e.vx=-e.vx),s+e.radius>i.canvas.h?e.vy=-e.vy:s-e.radius<0&&(e.vy=-e.vy)}}()}else 0==i.tmp.repulse_clicking&&(e.vx=e.vx_i,e.vy=e.vy_i)},i.fn.modes.grabParticle=function(e){if(i.interactivity.events.onhover.enable&&"mousemove"==i.interactivity.status){var t=e.x-i.interactivity.mouse.pos_x,a=e.y-i.interactivity.mouse.pos_y,s=Math.sqrt(t*t+a*a);if(s<=i.interactivity.modes.grab.distance){var n=i.interactivity.modes.grab.line_linked.opacity-s/(1/i.interactivity.modes.grab.line_linked.opacity)/i.interactivity.modes.grab.distance;if(n>0){var r=i.particles.line_linked.color_rgb_line;i.canvas.ctx.strokeStyle="rgba("+r.r+","+r.g+","+r.b+","+n+")",i.canvas.ctx.lineWidth=i.particles.line_linked.width,i.canvas.ctx.beginPath(),i.canvas.ctx.moveTo(e.x,e.y),i.canvas.ctx.lineTo(i.interactivity.mouse.pos_x,i.interactivity.mouse.pos_y),i.canvas.ctx.stroke(),i.canvas.ctx.closePath()}}}},i.fn.vendors.eventsListeners=function(){"window"==i.interactivity.detect_on?i.interactivity.el=window:i.interactivity.el=i.canvas.el,(i.interactivity.events.onhover.enable||i.interactivity.events.onclick.enable)&&(i.interactivity.el.addEventListener("mousemove",function(e){if(i.interactivity.el==window)var t=e.clientX,a=e.clientY;else t=e.offsetX||e.clientX,a=e.offsetY||e.clientY;i.interactivity.mouse.pos_x=t,i.interactivity.mouse.pos_y=a,i.tmp.retina&&(i.interactivity.mouse.pos_x*=i.canvas.pxratio,i.interactivity.mouse.pos_y*=i.canvas.pxratio),i.interactivity.status="mousemove"}),i.interactivity.el.addEventListener("mouseleave",function(e){i.interactivity.mouse.pos_x=null,i.interactivity.mouse.pos_y=null,i.interactivity.status="mouseleave"})),i.interactivity.events.onclick.enable&&i.interactivity.el.addEventListener("click",function(){if(i.interactivity.mouse.click_pos_x=i.interactivity.mouse.pos_x,i.interactivity.mouse.click_pos_y=i.interactivity.mouse.pos_y,i.interactivity.mouse.click_time=(new Date).getTime(),i.interactivity.events.onclick.enable)switch(i.interactivity.events.onclick.mode){case"push":i.particles.move.enable?i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb,i.interactivity.mouse):1==i.interactivity.modes.push.particles_nb?i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb,i.interactivity.mouse):i.interactivity.modes.push.particles_nb>1&&i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb);break;case"remove":i.fn.modes.removeParticles(i.interactivity.modes.remove.particles_nb);break;case"bubble":i.tmp.bubble_clicking=!0;break;case"repulse":i.tmp.repulse_clicking=!0,i.tmp.repulse_count=0,i.tmp.repulse_finish=!1,setTimeout(function(){i.tmp.repulse_clicking=!1},1e3*i.interactivity.modes.repulse.duration)}})},i.fn.vendors.densityAutoParticles=function(){if(i.particles.number.density.enable){var e=i.canvas.el.width*i.canvas.el.height/1e3;i.tmp.retina&&(e/=2*i.canvas.pxratio);var t=e*i.particles.number.value/i.particles.number.density.value_area,a=i.particles.array.length-t;a<0?i.fn.modes.pushParticles(Math.abs(a)):i.fn.modes.removeParticles(a)}},i.fn.vendors.checkOverlap=function(e,t){for(var a=0;a=i.particles.number.value?(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame)):i.tmp.img_error||(i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw)):null!=i.tmp.img_obj?(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame)):i.tmp.img_error||(i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw)):(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame))},1e3/e)},i.fn.vendors.checkBeforeDraw=function(){"image"==i.particles.shape.type?"svg"==i.tmp.img_type&&null==i.tmp.source_svg?i.tmp.checkAnimFrame=requestAnimFrame(check):(cancelRequestAnimFrame(i.tmp.checkAnimFrame),i.tmp.img_error||(i.fn.vendors.init(),i.fn.vendors.draw())):(i.fn.vendors.init(),i.fn.vendors.draw())},i.fn.vendors.init=function(){i.fn.retinaInit(),i.fn.canvasInit(),i.fn.canvasSize(),i.fn.canvasPaint(),i.fn.particlesCreate(),i.fn.vendors.densityAutoParticles(),i.particles.line_linked.color_rgb_line=hexToRgb(i.particles.line_linked.color)},i.fn.vendors.start=function(){isInArray("image",i.particles.shape.type)?(i.tmp.img_type=i.particles.shape.image.src.substr(i.particles.shape.image.src.length-3),i.fn.vendors.loadImg(i.tmp.img_type)):i.fn.vendors.checkBeforeDraw()},i.fn.vendors.eventsListeners(),i.fn.vendors.start()};function hexToRgb(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(e,t,a,i){return t+t+a+a+i+i});var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function clamp(e,t,a){return Math.min(Math.max(e,t),a)}function isInArray(e,t){return t.indexOf(e)>-1}Object.deepExtend=function(e,t){for(var a in t)t[a]&&t[a].constructor&&t[a].constructor===Object?(e[a]=e[a]||{},arguments.callee(e[a],t[a])):e[a]=t[a];return e},window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)},window.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout,window.pJSDom=[],window.particlesJS=function(e,t){"string"!=typeof e&&(t=e,e="particles-js"),e||(e="particles-js");var a=document.getElementById(e),i="particles-js-canvas-el",s=a.getElementsByClassName(i);if(s.length)for(;s.length>0;)a.removeChild(s[0]);var n=document.createElement("canvas");n.className=i,n.style.width="100%",n.style.height="100%",null!=document.getElementById(e).appendChild(n)&&pJSDom.push(new pJS(e,t))},window.particlesJS.load=function(e,t,a){var i=new XMLHttpRequest;i.open("GET",t),i.onreadystatechange=function(t){if(4==i.readyState)if(200==i.status){var s=JSON.parse(t.currentTarget.response);window.particlesJS(e,s),a&&a()}else console.log("Error pJS - XMLHttpRequest status: "+i.status),console.log("Error pJS - File config not found")},i.send()}; \ No newline at end of file diff --git a/views/particles.json b/views/particles.json deleted file mode 100644 index 297cf03d..00000000 --- a/views/particles.json +++ /dev/null @@ -1 +0,0 @@ -{"particles":{"fps_limit":65,"number":{"value":80,"density":{"enable":true,"value_area":950}},"color":{"value":"#ffffff"},"shape":{"type":"circle","stroke":{"width":2,"color":"#000000"},"polygon":{"nb_sides":8},"image":{"src":"img/github.svg","width":100,"height":100}},"opacity":{"value":0.5,"random":false,"anim":{"enable":false,"speed":1,"opacity_min":0.1,"sync":false}},"size":{"value":3,"random":true,"anim":{"enable":true,"speed":1,"size_min":0.1,"sync":false}},"line_linked":{"enable":true,"distance":125,"color":"#ffffff","opacity":0.5,"width":1},"move":{"enable":true,"speed":6,"direction":"none","random":false,"straight":false,"out_mode":"out","bounce":false,"attract":{"enable":false,"rotateX":600,"rotateY":1200}}},"interactivity":{"detect_on":"canvas","events":{"onhover":{"enable":false,"mode":"repulse"},"onclick":{"enable":false,"mode":"push"},"resize":true},"modes":{"grab":{"distance":400,"line_linked":{"opacity":1}},"bubble":{"distance":400,"size":40,"duration":2,"opacity":8,"speed":3},"repulse":{"distance":200,"duration":0.4},"push":{"particles_nb":4},"remove":{"particles_nb":2}}},"retina_detect":true} \ No newline at end of file diff --git a/views/vibeOS/README.md b/views/vibeOS/README.md deleted file mode 100644 index 739458ba..00000000 --- a/views/vibeOS/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# vibeOS - -### GitHub Link -https://github.com/vibedivide/vibeOS - -![Screenshot](/public/vibeOS/preview/readmecover.png?raw=true) -*Pictured: vibeOS PrD running at 1080p.* - ---- - -vibeOS is a JavaScript based Desktop Enviornment that runs in your browser. It can run applications made in JavaScript using our custom Constructor or load web applications with our WebView soulution. - -This repository contains the current source code for vibeOS. It does not need to be compiled, just extracted and `index.html` opened. It can also be deployed on a Web Server, for easy access. **vibeOS is entirely portable, requiring no server backend.** - -| Prod. Codename | Description | Status | -|---------------- |--------------------- |----------------- | -| PrD | Private Development | Finished | -| PrB1 | Private Beta 1 | Finished | -| PrB2 | Private Beta 2 | Finished | -| PuB | Public Beta | Current | -| PuPre | Public Pre-Release | Not in Scope | -| Pure | Public Release | Not in Scope | ---- - -## Documentation - -Some documentation is avaiable inside vibeOS (under System Docs) however full documentation is yet to be written. - ---- - -## Contributing - -If you would like to contribute to vibeOS, feel free to make a Pull Request with your changes and we will take a look. If you want to join our team, get in touch. - -## Bug Reports & Feedback - -If you encounter a bug or problem with vibeOS, do not hesitate to open an [Issue](https://github.com/vibedivde/vibeOS/issues). If said bug is of a critical nature, please get in touch as soon as possible. - -Feedback & Suggestions are welcome! - ---- - -## Contact - -The easiest way to get in touch is via Discord. Send a friend request to `ctaetcsh#8411`. - -Additionally, you can email `contact@ctaetcsh.xyz`. Communications are managed by ctaetcsh under Divide. - ---- - -## Credits - -| GitHub | Name | Title | -|------------ |----------------------- |------------------------------- | -| @vibedivde | The Mysterious Divide | Creator & Lead Developer | -| @ctaetcsh | Nathan M. (ctaetcsh) | Developer, Designer & Manager | -| @deopdeop | Ryan W. (LinuxTerm) | Developer | - -Additionally, thank you to our Beta Testers: -``` -Alfias -ShadowFr0st -IStealYourMemes -Nautica -Hat -``` diff --git a/views/vibeOS/appfiles/2048/index.html b/views/vibeOS/appfiles/2048/index.html deleted file mode 100644 index 39e1c990..00000000 --- a/views/vibeOS/appfiles/2048/index.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - 2048 - - - - - - - - - - - - - - -
-
-

2048

-
-
0
-
0
-
-
- -
-

Join the numbers and get to the 2048 tile!

- New Game -
- -
-
-

- -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- -
-
- -

- How to play: Use your arrow keys to move the tiles. When two tiles with the same number touch, they merge into one! -

-
- -

- Created by Gabriele Cirulli. Based on 1024 by Veewo Studio and conceptually similar to Threes by Asher Vollmer. Ported to vibeOS by ctaetcsh. -

-
- - - - - - - - - - - - - diff --git a/views/vibeOS/appfiles/2048/js/animframe_polyfill.js b/views/vibeOS/appfiles/2048/js/animframe_polyfill.js deleted file mode 100644 index c524a994..00000000 --- a/views/vibeOS/appfiles/2048/js/animframe_polyfill.js +++ /dev/null @@ -1,28 +0,0 @@ -(function () { - var lastTime = 0; - var vendors = ['webkit', 'moz']; - for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { - window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || - window[vendors[x] + 'CancelRequestAnimationFrame']; - } - - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function (callback) { - var currTime = new Date().getTime(); - var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function () { - callback(currTime + timeToCall); - }, - timeToCall); - lastTime = currTime + timeToCall; - return id; - }; - } - - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function (id) { - clearTimeout(id); - }; - } -}()); diff --git a/views/vibeOS/appfiles/2048/js/application.js b/views/vibeOS/appfiles/2048/js/application.js deleted file mode 100644 index 2c1108e7..00000000 --- a/views/vibeOS/appfiles/2048/js/application.js +++ /dev/null @@ -1,4 +0,0 @@ -// Wait till the browser is ready to render the game (avoids glitches) -window.requestAnimationFrame(function () { - new GameManager(4, KeyboardInputManager, HTMLActuator, LocalStorageManager); -}); diff --git a/views/vibeOS/appfiles/2048/js/bind_polyfill.js b/views/vibeOS/appfiles/2048/js/bind_polyfill.js deleted file mode 100644 index 8d9c4a48..00000000 --- a/views/vibeOS/appfiles/2048/js/bind_polyfill.js +++ /dev/null @@ -1,9 +0,0 @@ -Function.prototype.bind = Function.prototype.bind || function (target) { - var self = this; - return function (args) { - if (!(args instanceof Array)) { - args = [args]; - } - self.apply(target, args); - }; -}; diff --git a/views/vibeOS/appfiles/2048/js/classlist_polyfill.js b/views/vibeOS/appfiles/2048/js/classlist_polyfill.js deleted file mode 100644 index 1789ae78..00000000 --- a/views/vibeOS/appfiles/2048/js/classlist_polyfill.js +++ /dev/null @@ -1,71 +0,0 @@ -(function () { - if (typeof window.Element === "undefined" || - "classList" in document.documentElement) { - return; - } - - var prototype = Array.prototype, - push = prototype.push, - splice = prototype.splice, - join = prototype.join; - - function DOMTokenList(el) { - this.el = el; - // The className needs to be trimmed and split on whitespace - // to retrieve a list of classes. - var classes = el.className.replace(/^\s+|\s+$/g, '').split(/\s+/); - for (var i = 0; i < classes.length; i++) { - push.call(this, classes[i]); - } - } - - DOMTokenList.prototype = { - add: function (token) { - if (this.contains(token)) return; - push.call(this, token); - this.el.className = this.toString(); - }, - contains: function (token) { - return this.el.className.indexOf(token) != -1; - }, - item: function (index) { - return this[index] || null; - }, - remove: function (token) { - if (!this.contains(token)) return; - for (var i = 0; i < this.length; i++) { - if (this[i] == token) break; - } - splice.call(this, i, 1); - this.el.className = this.toString(); - }, - toString: function () { - return join.call(this, ' '); - }, - toggle: function (token) { - if (!this.contains(token)) { - this.add(token); - } else { - this.remove(token); - } - - return this.contains(token); - } - }; - - window.DOMTokenList = DOMTokenList; - - function defineElementGetter(obj, prop, getter) { - if (Object.defineProperty) { - Object.defineProperty(obj, prop, { - get: getter - }); - } else { - obj.__defineGetter__(prop, getter); - } - } - - defineElementGetter(HTMLElement.prototype, 'classList', function () { - return new DOMTokenList(this); - }); -})(); diff --git a/views/vibeOS/appfiles/2048/js/game_manager.js b/views/vibeOS/appfiles/2048/js/game_manager.js deleted file mode 100644 index 1c13d15b..00000000 --- a/views/vibeOS/appfiles/2048/js/game_manager.js +++ /dev/null @@ -1,272 +0,0 @@ -function GameManager(size, InputManager, Actuator, StorageManager) { - this.size = size; // Size of the grid - this.inputManager = new InputManager; - this.storageManager = new StorageManager; - this.actuator = new Actuator; - - this.startTiles = 2; - - this.inputManager.on("move", this.move.bind(this)); - this.inputManager.on("restart", this.restart.bind(this)); - this.inputManager.on("keepPlaying", this.keepPlaying.bind(this)); - - this.setup(); -} - -// Restart the game -GameManager.prototype.restart = function () { - this.storageManager.clearGameState(); - this.actuator.continueGame(); // Clear the game won/lost message - this.setup(); -}; - -// Keep playing after winning (allows going over 2048) -GameManager.prototype.keepPlaying = function () { - this.keepPlaying = true; - this.actuator.continueGame(); // Clear the game won/lost message -}; - -// Return true if the game is lost, or has won and the user hasn't kept playing -GameManager.prototype.isGameTerminated = function () { - return this.over || (this.won && !this.keepPlaying); -}; - -// Set up the game -GameManager.prototype.setup = function () { - var previousState = this.storageManager.getGameState(); - - // Reload the game from a previous game if present - if (previousState) { - this.grid = new Grid(previousState.grid.size, - previousState.grid.cells); // Reload grid - this.score = previousState.score; - this.over = previousState.over; - this.won = previousState.won; - this.keepPlaying = previousState.keepPlaying; - } else { - this.grid = new Grid(this.size); - this.score = 0; - this.over = false; - this.won = false; - this.keepPlaying = false; - - // Add the initial tiles - this.addStartTiles(); - } - - // Update the actuator - this.actuate(); -}; - -// Set up the initial tiles to start the game with -GameManager.prototype.addStartTiles = function () { - for (var i = 0; i < this.startTiles; i++) { - this.addRandomTile(); - } -}; - -// Adds a tile in a random position -GameManager.prototype.addRandomTile = function () { - if (this.grid.cellsAvailable()) { - var value = Math.random() < 0.9 ? 2 : 4; - var tile = new Tile(this.grid.randomAvailableCell(), value); - - this.grid.insertTile(tile); - } -}; - -// Sends the updated grid to the actuator -GameManager.prototype.actuate = function () { - if (this.storageManager.getBestScore() < this.score) { - this.storageManager.setBestScore(this.score); - } - - // Clear the state when the game is over (game over only, not win) - if (this.over) { - this.storageManager.clearGameState(); - } else { - this.storageManager.setGameState(this.serialize()); - } - - this.actuator.actuate(this.grid, { - score: this.score, - over: this.over, - won: this.won, - bestScore: this.storageManager.getBestScore(), - terminated: this.isGameTerminated() - }); - -}; - -// Represent the current game as an object -GameManager.prototype.serialize = function () { - return { - grid: this.grid.serialize(), - score: this.score, - over: this.over, - won: this.won, - keepPlaying: this.keepPlaying - }; -}; - -// Save all tile positions and remove merger info -GameManager.prototype.prepareTiles = function () { - this.grid.eachCell(function (x, y, tile) { - if (tile) { - tile.mergedFrom = null; - tile.savePosition(); - } - }); -}; - -// Move a tile and its representation -GameManager.prototype.moveTile = function (tile, cell) { - this.grid.cells[tile.x][tile.y] = null; - this.grid.cells[cell.x][cell.y] = tile; - tile.updatePosition(cell); -}; - -// Move tiles on the grid in the specified direction -GameManager.prototype.move = function (direction) { - // 0: up, 1: right, 2: down, 3: left - var self = this; - - if (this.isGameTerminated()) return; // Don't do anything if the game's over - - var cell, tile; - - var vector = this.getVector(direction); - var traversals = this.buildTraversals(vector); - var moved = false; - - // Save the current tile positions and remove merger information - this.prepareTiles(); - - // Traverse the grid in the right direction and move tiles - traversals.x.forEach(function (x) { - traversals.y.forEach(function (y) { - cell = { x: x, y: y }; - tile = self.grid.cellContent(cell); - - if (tile) { - var positions = self.findFarthestPosition(cell, vector); - var next = self.grid.cellContent(positions.next); - - // Only one merger per row traversal? - if (next && next.value === tile.value && !next.mergedFrom) { - var merged = new Tile(positions.next, tile.value * 2); - merged.mergedFrom = [tile, next]; - - self.grid.insertTile(merged); - self.grid.removeTile(tile); - - // Converge the two tiles' positions - tile.updatePosition(positions.next); - - // Update the score - self.score += merged.value; - - // The mighty 2048 tile - if (merged.value === 2048) self.won = true; - } else { - self.moveTile(tile, positions.farthest); - } - - if (!self.positionsEqual(cell, tile)) { - moved = true; // The tile moved from its original cell! - } - } - }); - }); - - if (moved) { - this.addRandomTile(); - - if (!this.movesAvailable()) { - this.over = true; // Game over! - } - - this.actuate(); - } -}; - -// Get the vector representing the chosen direction -GameManager.prototype.getVector = function (direction) { - // Vectors representing tile movement - var map = { - 0: { x: 0, y: -1 }, // Up - 1: { x: 1, y: 0 }, // Right - 2: { x: 0, y: 1 }, // Down - 3: { x: -1, y: 0 } // Left - }; - - return map[direction]; -}; - -// Build a list of positions to traverse in the right order -GameManager.prototype.buildTraversals = function (vector) { - var traversals = { x: [], y: [] }; - - for (var pos = 0; pos < this.size; pos++) { - traversals.x.push(pos); - traversals.y.push(pos); - } - - // Always traverse from the farthest cell in the chosen direction - if (vector.x === 1) traversals.x = traversals.x.reverse(); - if (vector.y === 1) traversals.y = traversals.y.reverse(); - - return traversals; -}; - -GameManager.prototype.findFarthestPosition = function (cell, vector) { - var previous; - - // Progress towards the vector direction until an obstacle is found - do { - previous = cell; - cell = { x: previous.x + vector.x, y: previous.y + vector.y }; - } while (this.grid.withinBounds(cell) && - this.grid.cellAvailable(cell)); - - return { - farthest: previous, - next: cell // Used to check if a merge is required - }; -}; - -GameManager.prototype.movesAvailable = function () { - return this.grid.cellsAvailable() || this.tileMatchesAvailable(); -}; - -// Check for available matches between tiles (more expensive check) -GameManager.prototype.tileMatchesAvailable = function () { - var self = this; - - var tile; - - for (var x = 0; x < this.size; x++) { - for (var y = 0; y < this.size; y++) { - tile = this.grid.cellContent({ x: x, y: y }); - - if (tile) { - for (var direction = 0; direction < 4; direction++) { - var vector = self.getVector(direction); - var cell = { x: x + vector.x, y: y + vector.y }; - - var other = self.grid.cellContent(cell); - - if (other && other.value === tile.value) { - return true; // These two tiles can be merged - } - } - } - } - } - - return false; -}; - -GameManager.prototype.positionsEqual = function (first, second) { - return first.x === second.x && first.y === second.y; -}; diff --git a/views/vibeOS/appfiles/2048/js/grid.js b/views/vibeOS/appfiles/2048/js/grid.js deleted file mode 100644 index 29f0821e..00000000 --- a/views/vibeOS/appfiles/2048/js/grid.js +++ /dev/null @@ -1,117 +0,0 @@ -function Grid(size, previousState) { - this.size = size; - this.cells = previousState ? this.fromState(previousState) : this.empty(); -} - -// Build a grid of the specified size -Grid.prototype.empty = function () { - var cells = []; - - for (var x = 0; x < this.size; x++) { - var row = cells[x] = []; - - for (var y = 0; y < this.size; y++) { - row.push(null); - } - } - - return cells; -}; - -Grid.prototype.fromState = function (state) { - var cells = []; - - for (var x = 0; x < this.size; x++) { - var row = cells[x] = []; - - for (var y = 0; y < this.size; y++) { - var tile = state[x][y]; - row.push(tile ? new Tile(tile.position, tile.value) : null); - } - } - - return cells; -}; - -// Find the first available random position -Grid.prototype.randomAvailableCell = function () { - var cells = this.availableCells(); - - if (cells.length) { - return cells[Math.floor(Math.random() * cells.length)]; - } -}; - -Grid.prototype.availableCells = function () { - var cells = []; - - this.eachCell(function (x, y, tile) { - if (!tile) { - cells.push({ x: x, y: y }); - } - }); - - return cells; -}; - -// Call callback for every cell -Grid.prototype.eachCell = function (callback) { - for (var x = 0; x < this.size; x++) { - for (var y = 0; y < this.size; y++) { - callback(x, y, this.cells[x][y]); - } - } -}; - -// Check if there are any cells available -Grid.prototype.cellsAvailable = function () { - return !!this.availableCells().length; -}; - -// Check if the specified cell is taken -Grid.prototype.cellAvailable = function (cell) { - return !this.cellOccupied(cell); -}; - -Grid.prototype.cellOccupied = function (cell) { - return !!this.cellContent(cell); -}; - -Grid.prototype.cellContent = function (cell) { - if (this.withinBounds(cell)) { - return this.cells[cell.x][cell.y]; - } else { - return null; - } -}; - -// Inserts a tile at its position -Grid.prototype.insertTile = function (tile) { - this.cells[tile.x][tile.y] = tile; -}; - -Grid.prototype.removeTile = function (tile) { - this.cells[tile.x][tile.y] = null; -}; - -Grid.prototype.withinBounds = function (position) { - return position.x >= 0 && position.x < this.size && - position.y >= 0 && position.y < this.size; -}; - -Grid.prototype.serialize = function () { - var cellState = []; - - for (var x = 0; x < this.size; x++) { - var row = cellState[x] = []; - - for (var y = 0; y < this.size; y++) { - row.push(this.cells[x][y] ? this.cells[x][y].serialize() : null); - } - } - - return { - size: this.size, - cells: cellState - }; -}; diff --git a/views/vibeOS/appfiles/2048/js/html_actuator.js b/views/vibeOS/appfiles/2048/js/html_actuator.js deleted file mode 100644 index 6b31f2d1..00000000 --- a/views/vibeOS/appfiles/2048/js/html_actuator.js +++ /dev/null @@ -1,139 +0,0 @@ -function HTMLActuator() { - this.tileContainer = document.querySelector(".tile-container"); - this.scoreContainer = document.querySelector(".score-container"); - this.bestContainer = document.querySelector(".best-container"); - this.messageContainer = document.querySelector(".game-message"); - - this.score = 0; -} - -HTMLActuator.prototype.actuate = function (grid, metadata) { - var self = this; - - window.requestAnimationFrame(function () { - self.clearContainer(self.tileContainer); - - grid.cells.forEach(function (column) { - column.forEach(function (cell) { - if (cell) { - self.addTile(cell); - } - }); - }); - - self.updateScore(metadata.score); - self.updateBestScore(metadata.bestScore); - - if (metadata.terminated) { - if (metadata.over) { - self.message(false); // You lose - } else if (metadata.won) { - self.message(true); // You win! - } - } - - }); -}; - -// Continues the game (both restart and keep playing) -HTMLActuator.prototype.continueGame = function () { - this.clearMessage(); -}; - -HTMLActuator.prototype.clearContainer = function (container) { - while (container.firstChild) { - container.removeChild(container.firstChild); - } -}; - -HTMLActuator.prototype.addTile = function (tile) { - var self = this; - - var wrapper = document.createElement("div"); - var inner = document.createElement("div"); - var position = tile.previousPosition || { x: tile.x, y: tile.y }; - var positionClass = this.positionClass(position); - - // We can't use classlist because it somehow glitches when replacing classes - var classes = ["tile", "tile-" + tile.value, positionClass]; - - if (tile.value > 2048) classes.push("tile-super"); - - this.applyClasses(wrapper, classes); - - inner.classList.add("tile-inner"); - inner.textContent = tile.value; - - if (tile.previousPosition) { - // Make sure that the tile gets rendered in the previous position first - window.requestAnimationFrame(function () { - classes[2] = self.positionClass({ x: tile.x, y: tile.y }); - self.applyClasses(wrapper, classes); // Update the position - }); - } else if (tile.mergedFrom) { - classes.push("tile-merged"); - this.applyClasses(wrapper, classes); - - // Render the tiles that merged - tile.mergedFrom.forEach(function (merged) { - self.addTile(merged); - }); - } else { - classes.push("tile-new"); - this.applyClasses(wrapper, classes); - } - - // Add the inner part of the tile to the wrapper - wrapper.appendChild(inner); - - // Put the tile on the board - this.tileContainer.appendChild(wrapper); -}; - -HTMLActuator.prototype.applyClasses = function (element, classes) { - element.setAttribute("class", classes.join(" ")); -}; - -HTMLActuator.prototype.normalizePosition = function (position) { - return { x: position.x + 1, y: position.y + 1 }; -}; - -HTMLActuator.prototype.positionClass = function (position) { - position = this.normalizePosition(position); - return "tile-position-" + position.x + "-" + position.y; -}; - -HTMLActuator.prototype.updateScore = function (score) { - this.clearContainer(this.scoreContainer); - - var difference = score - this.score; - this.score = score; - - this.scoreContainer.textContent = this.score; - - if (difference > 0) { - var addition = document.createElement("div"); - addition.classList.add("score-addition"); - addition.textContent = "+" + difference; - - this.scoreContainer.appendChild(addition); - } -}; - -HTMLActuator.prototype.updateBestScore = function (bestScore) { - this.bestContainer.textContent = bestScore; -}; - -HTMLActuator.prototype.message = function (won) { - var type = won ? "game-won" : "game-over"; - var message = won ? "You win!" : "Game over!"; - - this.messageContainer.classList.add(type); - this.messageContainer.getElementsByTagName("p")[0].textContent = message; -}; - -HTMLActuator.prototype.clearMessage = function () { - // IE only takes one value to remove at a time. - this.messageContainer.classList.remove("game-won"); - this.messageContainer.classList.remove("game-over"); -}; diff --git a/views/vibeOS/appfiles/2048/js/keyboard_input_manager.js b/views/vibeOS/appfiles/2048/js/keyboard_input_manager.js deleted file mode 100644 index ca01b3ce..00000000 --- a/views/vibeOS/appfiles/2048/js/keyboard_input_manager.js +++ /dev/null @@ -1,144 +0,0 @@ -function KeyboardInputManager() { - this.events = {}; - - if (window.navigator.msPointerEnabled) { - //Internet Explorer 10 style - this.eventTouchstart = "MSPointerDown"; - this.eventTouchmove = "MSPointerMove"; - this.eventTouchend = "MSPointerUp"; - } else { - this.eventTouchstart = "touchstart"; - this.eventTouchmove = "touchmove"; - this.eventTouchend = "touchend"; - } - - this.listen(); -} - -KeyboardInputManager.prototype.on = function (event, callback) { - if (!this.events[event]) { - this.events[event] = []; - } - this.events[event].push(callback); -}; - -KeyboardInputManager.prototype.emit = function (event, data) { - var callbacks = this.events[event]; - if (callbacks) { - callbacks.forEach(function (callback) { - callback(data); - }); - } -}; - -KeyboardInputManager.prototype.listen = function () { - var self = this; - - var map = { - 38: 0, // Up - 39: 1, // Right - 40: 2, // Down - 37: 3, // Left - 75: 0, // Vim up - 76: 1, // Vim right - 74: 2, // Vim down - 72: 3, // Vim left - 87: 0, // W - 68: 1, // D - 83: 2, // S - 65: 3 // A - }; - - // Respond to direction keys - document.addEventListener("keydown", function (event) { - var modifiers = event.altKey || event.ctrlKey || event.metaKey || - event.shiftKey; - var mapped = map[event.which]; - - if (!modifiers) { - if (mapped !== undefined) { - event.preventDefault(); - self.emit("move", mapped); - } - } - - // R key restarts the game - if (!modifiers && event.which === 82) { - self.restart.call(self, event); - } - }); - - // Respond to button presses - this.bindButtonPress(".retry-button", this.restart); - this.bindButtonPress(".restart-button", this.restart); - this.bindButtonPress(".keep-playing-button", this.keepPlaying); - - // Respond to swipe events - var touchStartClientX, touchStartClientY; - var gameContainer = document.getElementsByClassName("game-container")[0]; - - gameContainer.addEventListener(this.eventTouchstart, function (event) { - if ((!window.navigator.msPointerEnabled && event.touches.length > 1) || - event.targetTouches.length > 1) { - return; // Ignore if touching with more than 1 finger - } - - if (window.navigator.msPointerEnabled) { - touchStartClientX = event.pageX; - touchStartClientY = event.pageY; - } else { - touchStartClientX = event.touches[0].clientX; - touchStartClientY = event.touches[0].clientY; - } - - event.preventDefault(); - }); - - gameContainer.addEventListener(this.eventTouchmove, function (event) { - event.preventDefault(); - }); - - gameContainer.addEventListener(this.eventTouchend, function (event) { - if ((!window.navigator.msPointerEnabled && event.touches.length > 0) || - event.targetTouches.length > 0) { - return; // Ignore if still touching with one or more fingers - } - - var touchEndClientX, touchEndClientY; - - if (window.navigator.msPointerEnabled) { - touchEndClientX = event.pageX; - touchEndClientY = event.pageY; - } else { - touchEndClientX = event.changedTouches[0].clientX; - touchEndClientY = event.changedTouches[0].clientY; - } - - var dx = touchEndClientX - touchStartClientX; - var absDx = Math.abs(dx); - - var dy = touchEndClientY - touchStartClientY; - var absDy = Math.abs(dy); - - if (Math.max(absDx, absDy) > 10) { - // (right : left) : (down : up) - self.emit("move", absDx > absDy ? (dx > 0 ? 1 : 3) : (dy > 0 ? 2 : 0)); - } - }); -}; - -KeyboardInputManager.prototype.restart = function (event) { - event.preventDefault(); - this.emit("restart"); -}; - -KeyboardInputManager.prototype.keepPlaying = function (event) { - event.preventDefault(); - this.emit("keepPlaying"); -}; - -KeyboardInputManager.prototype.bindButtonPress = function (selector, fn) { - var button = document.querySelector(selector); - button.addEventListener("click", fn.bind(this)); - button.addEventListener(this.eventTouchend, fn.bind(this)); -}; diff --git a/views/vibeOS/appfiles/2048/js/local_storage_manager.js b/views/vibeOS/appfiles/2048/js/local_storage_manager.js deleted file mode 100644 index 2ca9cc30..00000000 --- a/views/vibeOS/appfiles/2048/js/local_storage_manager.js +++ /dev/null @@ -1,63 +0,0 @@ -window.fakeStorage = { - _data: {}, - - setItem: function (id, val) { - return this._data[id] = String(val); - }, - - getItem: function (id) { - return this._data.hasOwnProperty(id) ? this._data[id] : undefined; - }, - - removeItem: function (id) { - return delete this._data[id]; - }, - - clear: function () { - return this._data = {}; - } -}; - -function LocalStorageManager() { - this.bestScoreKey = "bestScore"; - this.gameStateKey = "gameState"; - - var supported = this.localStorageSupported(); - this.storage = supported ? window.localStorage : window.fakeStorage; -} - -LocalStorageManager.prototype.localStorageSupported = function () { - var testKey = "test"; - - try { - var storage = window.localStorage; - storage.setItem(testKey, "1"); - storage.removeItem(testKey); - return true; - } catch (error) { - return false; - } -}; - -// Best score getters/setters -LocalStorageManager.prototype.getBestScore = function () { - return this.storage.getItem(this.bestScoreKey) || 0; -}; - -LocalStorageManager.prototype.setBestScore = function (score) { - this.storage.setItem(this.bestScoreKey, score); -}; - -// Game state getters/setters and clearing -LocalStorageManager.prototype.getGameState = function () { - var stateJSON = this.storage.getItem(this.gameStateKey); - return stateJSON ? JSON.parse(stateJSON) : null; -}; - -LocalStorageManager.prototype.setGameState = function (gameState) { - this.storage.setItem(this.gameStateKey, JSON.stringify(gameState)); -}; - -LocalStorageManager.prototype.clearGameState = function () { - this.storage.removeItem(this.gameStateKey); -}; diff --git a/views/vibeOS/appfiles/2048/js/tile.js b/views/vibeOS/appfiles/2048/js/tile.js deleted file mode 100644 index 92a670a5..00000000 --- a/views/vibeOS/appfiles/2048/js/tile.js +++ /dev/null @@ -1,27 +0,0 @@ -function Tile(position, value) { - this.x = position.x; - this.y = position.y; - this.value = value || 2; - - this.previousPosition = null; - this.mergedFrom = null; // Tracks tiles that merged together -} - -Tile.prototype.savePosition = function () { - this.previousPosition = { x: this.x, y: this.y }; -}; - -Tile.prototype.updatePosition = function (position) { - this.x = position.x; - this.y = position.y; -}; - -Tile.prototype.serialize = function () { - return { - position: { - x: this.x, - y: this.y - }, - value: this.value - }; -}; diff --git a/views/vibeOS/appfiles/2048/meta/apple-touch-icon.png b/views/vibeOS/appfiles/2048/meta/apple-touch-icon.png deleted file mode 100644 index 3fd20f60..00000000 Binary files a/views/vibeOS/appfiles/2048/meta/apple-touch-icon.png and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/meta/apple-touch-startup-image-640x1096.png b/views/vibeOS/appfiles/2048/meta/apple-touch-startup-image-640x1096.png deleted file mode 100644 index 5a68ba0b..00000000 Binary files a/views/vibeOS/appfiles/2048/meta/apple-touch-startup-image-640x1096.png and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/meta/apple-touch-startup-image-640x920.png b/views/vibeOS/appfiles/2048/meta/apple-touch-startup-image-640x920.png deleted file mode 100644 index 17bc9d83..00000000 Binary files a/views/vibeOS/appfiles/2048/meta/apple-touch-startup-image-640x920.png and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.eot b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.eot deleted file mode 100644 index 3678ef2a..00000000 Binary files a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.eot and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.svg b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.svg deleted file mode 100644 index aa985aeb..00000000 --- a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.svg +++ /dev/null @@ -1,640 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.woff b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.woff deleted file mode 100644 index 184a945d..00000000 Binary files a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Bold-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.eot b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.eot deleted file mode 100644 index 0dc609d1..00000000 Binary files a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.eot and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.svg b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.svg deleted file mode 100644 index 1d5d2ece..00000000 --- a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.svg +++ /dev/null @@ -1,670 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.woff b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.woff deleted file mode 100644 index 44555e04..00000000 Binary files a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Light-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.eot b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.eot deleted file mode 100644 index b020e058..00000000 Binary files a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.eot and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.svg b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.svg deleted file mode 100644 index 1e2cffdc..00000000 --- a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.svg +++ /dev/null @@ -1,669 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.woff b/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.woff deleted file mode 100644 index 9d58858d..00000000 Binary files a/views/vibeOS/appfiles/2048/style/fonts/ClearSans-Regular-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/2048/style/fonts/clear-sans.css b/views/vibeOS/appfiles/2048/style/fonts/clear-sans.css deleted file mode 100644 index de2811db..00000000 --- a/views/vibeOS/appfiles/2048/style/fonts/clear-sans.css +++ /dev/null @@ -1,30 +0,0 @@ -@font-face { - font-family: "Clear Sans"; - src: url("ClearSans-Light-webfont.eot"); - src: url("ClearSans-Light-webfont.eot?#iefix") format("embedded-opentype"), - url("ClearSans-Light-webfont.svg#clear_sans_lightregular") format("svg"), - url("ClearSans-Light-webfont.woff") format("woff"); - font-weight: 200; - font-style: normal; -} - -@font-face { - font-family: "Clear Sans"; - src: url("ClearSans-Regular-webfont.eot"); - src: url("ClearSans-Regular-webfont.eot?#iefix") format("embedded-opentype"), - url("ClearSans-Regular-webfont.svg#clear_sansregular") format("svg"), - url("ClearSans-Regular-webfont.woff") format("woff"); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: "Clear Sans"; - src: url("ClearSans-Bold-webfont.eot"); - src: url("ClearSans-Bold-webfont.eot?#iefix") format("embedded-opentype"), - url("ClearSans-Bold-webfont.svg#clear_sansbold") format("svg"), - url("ClearSans-Bold-webfont.woff") format("woff"); - font-weight: 700; - font-style: normal; -} - diff --git a/views/vibeOS/appfiles/2048/style/helpers.scss b/views/vibeOS/appfiles/2048/style/helpers.scss deleted file mode 100644 index 72693ee2..00000000 --- a/views/vibeOS/appfiles/2048/style/helpers.scss +++ /dev/null @@ -1,82 +0,0 @@ -// Exponent -// From: https://github.com/Team-Sass/Sassy-math/blob/master/sass/math.scss#L36 - -@function exponent($base, $exponent) { - // reset value - $value: $base; - // positive intergers get multiplied - @if $exponent > 1 { - @for $i from 2 through $exponent { - $value: $value * $base; } } - // negitive intergers get divided. A number divided by itself is 1 - @if $exponent < 1 { - @for $i from 0 through -$exponent { - $value: $value / $base; } } - // return the last value written - @return $value; -} - -@function pow($base, $exponent) { - @return exponent($base, $exponent); -} - -// Transition mixins -@mixin transition($args...) { - -webkit-transition: $args; - -moz-transition: $args; - transition: $args; -} - -@mixin transition-property($args...) { - -webkit-transition-property: $args; - -moz-transition-property: $args; - transition-property: $args; -} - -@mixin animation($args...) { - -webkit-animation: $args; - -moz-animation: $args; - animation: $args; -} - -@mixin animation-fill-mode($args...) { - -webkit-animation-fill-mode: $args; - -moz-animation-fill-mode: $args; - animation-fill-mode: $args; -} - -@mixin transform($args...) { - -webkit-transform: $args; - -moz-transform: $args; - -ms-transform: $args; - transform: $args; -} - -// Keyframe animations -@mixin keyframes($animation-name) { - @-webkit-keyframes $animation-name { - @content; - } - @-moz-keyframes $animation-name { - @content; - } - @keyframes $animation-name { - @content; - } -} - -// Media queries -@mixin smaller($width) { - @media screen and (max-width: $width) { - @content; - } -} - -// Clearfix -@mixin clearfix { - &:after { - content: ""; - display: block; - clear: both; - } -} diff --git a/views/vibeOS/appfiles/2048/style/main.css b/views/vibeOS/appfiles/2048/style/main.css deleted file mode 100644 index ea3cb19f..00000000 --- a/views/vibeOS/appfiles/2048/style/main.css +++ /dev/null @@ -1,758 +0,0 @@ -@import url(fonts/clear-sans.css); -html, body { - margin: 0; - padding: 0; - background: #faf8ef; - color: #776e65; - font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif; - font-size: 18px; } - -body { - margin: 80px 0; } - -.heading:after { - content: ""; - display: block; - clear: both; } - -h1.title { - font-size: 80px; - font-weight: bold; - margin: 0; - display: block; - float: left; } - -@-webkit-keyframes move-up { - 0% { - top: 25px; - opacity: 1; } - - 100% { - top: -50px; - opacity: 0; } } -@-moz-keyframes move-up { - 0% { - top: 25px; - opacity: 1; } - - 100% { - top: -50px; - opacity: 0; } } -@keyframes move-up { - 0% { - top: 25px; - opacity: 1; } - - 100% { - top: -50px; - opacity: 0; } } -.scores-container { - float: right; - text-align: right; } - -.score-container, .best-container { - position: relative; - display: inline-block; - background: #bbada0; - padding: 15px 25px; - font-size: 25px; - height: 25px; - line-height: 47px; - font-weight: bold; - border-radius: 3px; - color: white; - margin-top: 8px; - text-align: center; } - .score-container:after, .best-container:after { - position: absolute; - width: 100%; - top: 10px; - left: 0; - text-transform: uppercase; - font-size: 13px; - line-height: 13px; - text-align: center; - color: #eee4da; } - .score-container .score-addition, .best-container .score-addition { - position: absolute; - right: 30px; - color: red; - font-size: 25px; - line-height: 25px; - font-weight: bold; - color: rgba(119, 110, 101, 0.9); - z-index: 100; - -webkit-animation: move-up 600ms ease-in; - -moz-animation: move-up 600ms ease-in; - animation: move-up 600ms ease-in; - -webkit-animation-fill-mode: both; - -moz-animation-fill-mode: both; - animation-fill-mode: both; } - -.score-container:after { - content: "Score"; } - -.best-container:after { - content: "Best"; } - -p { - margin-top: 0; - margin-bottom: 10px; - line-height: 1.65; } - -a { - color: #776e65; - font-weight: bold; - text-decoration: underline; - cursor: pointer; } - -strong.important { - text-transform: uppercase; } - -hr { - border: none; - border-bottom: 1px solid #d8d4d0; - margin-top: 20px; - margin-bottom: 30px; } - -.container { - width: 500px; - margin: 0 auto; } - -@-webkit-keyframes fade-in { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } -@-moz-keyframes fade-in { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } -@keyframes fade-in { - 0% { - opacity: 0; } - - 100% { - opacity: 1; } } -.game-container { - margin-top: 40px; - position: relative; - padding: 15px; - cursor: default; - -webkit-touch-callout: none; - -ms-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -ms-touch-action: none; - touch-action: none; - background: #bbada0; - border-radius: 6px; - width: 500px; - height: 500px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .game-container .game-message { - display: none; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: rgba(238, 228, 218, 0.5); - z-index: 100; - text-align: center; - -webkit-animation: fade-in 800ms ease 1200ms; - -moz-animation: fade-in 800ms ease 1200ms; - animation: fade-in 800ms ease 1200ms; - -webkit-animation-fill-mode: both; - -moz-animation-fill-mode: both; - animation-fill-mode: both; } - .game-container .game-message p { - font-size: 60px; - font-weight: bold; - height: 60px; - line-height: 60px; - margin-top: 222px; } - .game-container .game-message .lower { - display: block; - margin-top: 59px; } - .game-container .game-message a { - display: inline-block; - background: #8f7a66; - border-radius: 3px; - padding: 0 20px; - text-decoration: none; - color: #f9f6f2; - height: 40px; - line-height: 42px; - margin-left: 9px; } - .game-container .game-message a.keep-playing-button { - display: none; } - .game-container .game-message.game-won { - background: rgba(237, 194, 46, 0.5); - color: #f9f6f2; } - .game-container .game-message.game-won a.keep-playing-button { - display: inline-block; } - .game-container .game-message.game-won, .game-container .game-message.game-over { - display: block; } - -.grid-container { - position: absolute; - z-index: 1; } - -.grid-row { - margin-bottom: 15px; } - .grid-row:last-child { - margin-bottom: 0; } - .grid-row:after { - content: ""; - display: block; - clear: both; } - -.grid-cell { - width: 106.25px; - height: 106.25px; - margin-right: 15px; - float: left; - border-radius: 3px; - background: rgba(238, 228, 218, 0.35); } - .grid-cell:last-child { - margin-right: 0; } - -.tile-container { - position: absolute; - z-index: 2; } - -.tile, .tile .tile-inner { - width: 107px; - height: 107px; - line-height: 107px; } -.tile.tile-position-1-1 { - -webkit-transform: translate(0px, 0px); - -moz-transform: translate(0px, 0px); - -ms-transform: translate(0px, 0px); - transform: translate(0px, 0px); } -.tile.tile-position-1-2 { - -webkit-transform: translate(0px, 121px); - -moz-transform: translate(0px, 121px); - -ms-transform: translate(0px, 121px); - transform: translate(0px, 121px); } -.tile.tile-position-1-3 { - -webkit-transform: translate(0px, 242px); - -moz-transform: translate(0px, 242px); - -ms-transform: translate(0px, 242px); - transform: translate(0px, 242px); } -.tile.tile-position-1-4 { - -webkit-transform: translate(0px, 363px); - -moz-transform: translate(0px, 363px); - -ms-transform: translate(0px, 363px); - transform: translate(0px, 363px); } -.tile.tile-position-2-1 { - -webkit-transform: translate(121px, 0px); - -moz-transform: translate(121px, 0px); - -ms-transform: translate(121px, 0px); - transform: translate(121px, 0px); } -.tile.tile-position-2-2 { - -webkit-transform: translate(121px, 121px); - -moz-transform: translate(121px, 121px); - -ms-transform: translate(121px, 121px); - transform: translate(121px, 121px); } -.tile.tile-position-2-3 { - -webkit-transform: translate(121px, 242px); - -moz-transform: translate(121px, 242px); - -ms-transform: translate(121px, 242px); - transform: translate(121px, 242px); } -.tile.tile-position-2-4 { - -webkit-transform: translate(121px, 363px); - -moz-transform: translate(121px, 363px); - -ms-transform: translate(121px, 363px); - transform: translate(121px, 363px); } -.tile.tile-position-3-1 { - -webkit-transform: translate(242px, 0px); - -moz-transform: translate(242px, 0px); - -ms-transform: translate(242px, 0px); - transform: translate(242px, 0px); } -.tile.tile-position-3-2 { - -webkit-transform: translate(242px, 121px); - -moz-transform: translate(242px, 121px); - -ms-transform: translate(242px, 121px); - transform: translate(242px, 121px); } -.tile.tile-position-3-3 { - -webkit-transform: translate(242px, 242px); - -moz-transform: translate(242px, 242px); - -ms-transform: translate(242px, 242px); - transform: translate(242px, 242px); } -.tile.tile-position-3-4 { - -webkit-transform: translate(242px, 363px); - -moz-transform: translate(242px, 363px); - -ms-transform: translate(242px, 363px); - transform: translate(242px, 363px); } -.tile.tile-position-4-1 { - -webkit-transform: translate(363px, 0px); - -moz-transform: translate(363px, 0px); - -ms-transform: translate(363px, 0px); - transform: translate(363px, 0px); } -.tile.tile-position-4-2 { - -webkit-transform: translate(363px, 121px); - -moz-transform: translate(363px, 121px); - -ms-transform: translate(363px, 121px); - transform: translate(363px, 121px); } -.tile.tile-position-4-3 { - -webkit-transform: translate(363px, 242px); - -moz-transform: translate(363px, 242px); - -ms-transform: translate(363px, 242px); - transform: translate(363px, 242px); } -.tile.tile-position-4-4 { - -webkit-transform: translate(363px, 363px); - -moz-transform: translate(363px, 363px); - -ms-transform: translate(363px, 363px); - transform: translate(363px, 363px); } - -.tile { - position: absolute; - -webkit-transition: 100ms ease-in-out; - -moz-transition: 100ms ease-in-out; - transition: 100ms ease-in-out; - -webkit-transition-property: -webkit-transform; - -moz-transition-property: -moz-transform; - transition-property: transform; } - .tile .tile-inner { - border-radius: 3px; - background: #eee4da; - text-align: center; - font-weight: bold; - z-index: 10; - font-size: 55px; } - .tile.tile-2 .tile-inner { - background: #eee4da; - box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0); } - .tile.tile-4 .tile-inner { - background: #ede0c8; - box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0), inset 0 0 0 1px rgba(255, 255, 255, 0); } - .tile.tile-8 .tile-inner { - color: #f9f6f2; - background: #f2b179; } - .tile.tile-16 .tile-inner { - color: #f9f6f2; - background: #f59563; } - .tile.tile-32 .tile-inner { - color: #f9f6f2; - background: #f67c5f; } - .tile.tile-64 .tile-inner { - color: #f9f6f2; - background: #f65e3b; } - .tile.tile-128 .tile-inner { - color: #f9f6f2; - background: #edcf72; - box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.2381), inset 0 0 0 1px rgba(255, 255, 255, 0.14286); - font-size: 45px; } - @media screen and (max-width: 520px) { - .tile.tile-128 .tile-inner { - font-size: 25px; } } - .tile.tile-256 .tile-inner { - color: #f9f6f2; - background: #edcc61; - box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.31746), inset 0 0 0 1px rgba(255, 255, 255, 0.19048); - font-size: 45px; } - @media screen and (max-width: 520px) { - .tile.tile-256 .tile-inner { - font-size: 25px; } } - .tile.tile-512 .tile-inner { - color: #f9f6f2; - background: #edc850; - box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.39683), inset 0 0 0 1px rgba(255, 255, 255, 0.2381); - font-size: 45px; } - @media screen and (max-width: 520px) { - .tile.tile-512 .tile-inner { - font-size: 25px; } } - .tile.tile-1024 .tile-inner { - color: #f9f6f2; - background: #edc53f; - box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.47619), inset 0 0 0 1px rgba(255, 255, 255, 0.28571); - font-size: 35px; } - @media screen and (max-width: 520px) { - .tile.tile-1024 .tile-inner { - font-size: 15px; } } - .tile.tile-2048 .tile-inner { - color: #f9f6f2; - background: #edc22e; - box-shadow: 0 0 30px 10px rgba(243, 215, 116, 0.55556), inset 0 0 0 1px rgba(255, 255, 255, 0.33333); - font-size: 35px; } - @media screen and (max-width: 520px) { - .tile.tile-2048 .tile-inner { - font-size: 15px; } } - .tile.tile-super .tile-inner { - color: #f9f6f2; - background: #3c3a32; - font-size: 30px; } - @media screen and (max-width: 520px) { - .tile.tile-super .tile-inner { - font-size: 10px; } } - -@-webkit-keyframes appear { - 0% { - opacity: 0; - -webkit-transform: scale(0); - -moz-transform: scale(0); - -ms-transform: scale(0); - transform: scale(0); } - - 100% { - opacity: 1; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); } } -@-moz-keyframes appear { - 0% { - opacity: 0; - -webkit-transform: scale(0); - -moz-transform: scale(0); - -ms-transform: scale(0); - transform: scale(0); } - - 100% { - opacity: 1; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); } } -@keyframes appear { - 0% { - opacity: 0; - -webkit-transform: scale(0); - -moz-transform: scale(0); - -ms-transform: scale(0); - transform: scale(0); } - - 100% { - opacity: 1; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); } } -.tile-new .tile-inner { - -webkit-animation: appear 200ms ease 100ms; - -moz-animation: appear 200ms ease 100ms; - animation: appear 200ms ease 100ms; - -webkit-animation-fill-mode: backwards; - -moz-animation-fill-mode: backwards; - animation-fill-mode: backwards; } - -@-webkit-keyframes pop { - 0% { - -webkit-transform: scale(0); - -moz-transform: scale(0); - -ms-transform: scale(0); - transform: scale(0); } - - 50% { - -webkit-transform: scale(1.2); - -moz-transform: scale(1.2); - -ms-transform: scale(1.2); - transform: scale(1.2); } - - 100% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); } } -@-moz-keyframes pop { - 0% { - -webkit-transform: scale(0); - -moz-transform: scale(0); - -ms-transform: scale(0); - transform: scale(0); } - - 50% { - -webkit-transform: scale(1.2); - -moz-transform: scale(1.2); - -ms-transform: scale(1.2); - transform: scale(1.2); } - - 100% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); } } -@keyframes pop { - 0% { - -webkit-transform: scale(0); - -moz-transform: scale(0); - -ms-transform: scale(0); - transform: scale(0); } - - 50% { - -webkit-transform: scale(1.2); - -moz-transform: scale(1.2); - -ms-transform: scale(1.2); - transform: scale(1.2); } - - 100% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); } } -.tile-merged .tile-inner { - z-index: 20; - -webkit-animation: pop 200ms ease 100ms; - -moz-animation: pop 200ms ease 100ms; - animation: pop 200ms ease 100ms; - -webkit-animation-fill-mode: backwards; - -moz-animation-fill-mode: backwards; - animation-fill-mode: backwards; } - -.above-game:after { - content: ""; - display: block; - clear: both; } - -.game-intro { - float: left; - line-height: 42px; - margin-bottom: 0; } - -.restart-button { - display: inline-block; - background: #8f7a66; - border-radius: 3px; - padding: 0 20px; - text-decoration: none; - color: #f9f6f2; - height: 40px; - line-height: 42px; - display: block; - text-align: center; - float: right; } - -.game-explanation { - margin-top: 50px; } - -@media screen and (max-width: 520px) { - html, body { - font-size: 15px; } - - body { - margin: 20px 0; - padding: 0 20px; } - - h1.title { - font-size: 27px; - margin-top: 15px; } - - .container { - width: 280px; - margin: 0 auto; } - - .score-container, .best-container { - margin-top: 0; - padding: 15px 10px; - min-width: 40px; } - - .heading { - margin-bottom: 10px; } - - .game-intro { - width: 55%; - display: block; - box-sizing: border-box; - line-height: 1.65; } - - .restart-button { - width: 42%; - padding: 0; - display: block; - box-sizing: border-box; - margin-top: 2px; } - - .game-container { - margin-top: 17px; - position: relative; - padding: 10px; - cursor: default; - -webkit-touch-callout: none; - -ms-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -ms-touch-action: none; - touch-action: none; - background: #bbada0; - border-radius: 6px; - width: 280px; - height: 280px; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; } - .game-container .game-message { - display: none; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: rgba(238, 228, 218, 0.5); - z-index: 100; - text-align: center; - -webkit-animation: fade-in 800ms ease 1200ms; - -moz-animation: fade-in 800ms ease 1200ms; - animation: fade-in 800ms ease 1200ms; - -webkit-animation-fill-mode: both; - -moz-animation-fill-mode: both; - animation-fill-mode: both; } - .game-container .game-message p { - font-size: 60px; - font-weight: bold; - height: 60px; - line-height: 60px; - margin-top: 222px; } - .game-container .game-message .lower { - display: block; - margin-top: 59px; } - .game-container .game-message a { - display: inline-block; - background: #8f7a66; - border-radius: 3px; - padding: 0 20px; - text-decoration: none; - color: #f9f6f2; - height: 40px; - line-height: 42px; - margin-left: 9px; } - .game-container .game-message a.keep-playing-button { - display: none; } - .game-container .game-message.game-won { - background: rgba(237, 194, 46, 0.5); - color: #f9f6f2; } - .game-container .game-message.game-won a.keep-playing-button { - display: inline-block; } - .game-container .game-message.game-won, .game-container .game-message.game-over { - display: block; } - - .grid-container { - position: absolute; - z-index: 1; } - - .grid-row { - margin-bottom: 10px; } - .grid-row:last-child { - margin-bottom: 0; } - .grid-row:after { - content: ""; - display: block; - clear: both; } - - .grid-cell { - width: 57.5px; - height: 57.5px; - margin-right: 10px; - float: left; - border-radius: 3px; - background: rgba(238, 228, 218, 0.35); } - .grid-cell:last-child { - margin-right: 0; } - - .tile-container { - position: absolute; - z-index: 2; } - - .tile, .tile .tile-inner { - width: 58px; - height: 58px; - line-height: 58px; } - .tile.tile-position-1-1 { - -webkit-transform: translate(0px, 0px); - -moz-transform: translate(0px, 0px); - -ms-transform: translate(0px, 0px); - transform: translate(0px, 0px); } - .tile.tile-position-1-2 { - -webkit-transform: translate(0px, 67px); - -moz-transform: translate(0px, 67px); - -ms-transform: translate(0px, 67px); - transform: translate(0px, 67px); } - .tile.tile-position-1-3 { - -webkit-transform: translate(0px, 135px); - -moz-transform: translate(0px, 135px); - -ms-transform: translate(0px, 135px); - transform: translate(0px, 135px); } - .tile.tile-position-1-4 { - -webkit-transform: translate(0px, 202px); - -moz-transform: translate(0px, 202px); - -ms-transform: translate(0px, 202px); - transform: translate(0px, 202px); } - .tile.tile-position-2-1 { - -webkit-transform: translate(67px, 0px); - -moz-transform: translate(67px, 0px); - -ms-transform: translate(67px, 0px); - transform: translate(67px, 0px); } - .tile.tile-position-2-2 { - -webkit-transform: translate(67px, 67px); - -moz-transform: translate(67px, 67px); - -ms-transform: translate(67px, 67px); - transform: translate(67px, 67px); } - .tile.tile-position-2-3 { - -webkit-transform: translate(67px, 135px); - -moz-transform: translate(67px, 135px); - -ms-transform: translate(67px, 135px); - transform: translate(67px, 135px); } - .tile.tile-position-2-4 { - -webkit-transform: translate(67px, 202px); - -moz-transform: translate(67px, 202px); - -ms-transform: translate(67px, 202px); - transform: translate(67px, 202px); } - .tile.tile-position-3-1 { - -webkit-transform: translate(135px, 0px); - -moz-transform: translate(135px, 0px); - -ms-transform: translate(135px, 0px); - transform: translate(135px, 0px); } - .tile.tile-position-3-2 { - -webkit-transform: translate(135px, 67px); - -moz-transform: translate(135px, 67px); - -ms-transform: translate(135px, 67px); - transform: translate(135px, 67px); } - .tile.tile-position-3-3 { - -webkit-transform: translate(135px, 135px); - -moz-transform: translate(135px, 135px); - -ms-transform: translate(135px, 135px); - transform: translate(135px, 135px); } - .tile.tile-position-3-4 { - -webkit-transform: translate(135px, 202px); - -moz-transform: translate(135px, 202px); - -ms-transform: translate(135px, 202px); - transform: translate(135px, 202px); } - .tile.tile-position-4-1 { - -webkit-transform: translate(202px, 0px); - -moz-transform: translate(202px, 0px); - -ms-transform: translate(202px, 0px); - transform: translate(202px, 0px); } - .tile.tile-position-4-2 { - -webkit-transform: translate(202px, 67px); - -moz-transform: translate(202px, 67px); - -ms-transform: translate(202px, 67px); - transform: translate(202px, 67px); } - .tile.tile-position-4-3 { - -webkit-transform: translate(202px, 135px); - -moz-transform: translate(202px, 135px); - -ms-transform: translate(202px, 135px); - transform: translate(202px, 135px); } - .tile.tile-position-4-4 { - -webkit-transform: translate(202px, 202px); - -moz-transform: translate(202px, 202px); - -ms-transform: translate(202px, 202px); - transform: translate(202px, 202px); } - - .tile .tile-inner { - font-size: 35px; } - - .game-message p { - font-size: 30px !important; - height: 30px !important; - line-height: 30px !important; - margin-top: 90px !important; } - .game-message .lower { - margin-top: 30px !important; } } diff --git a/views/vibeOS/appfiles/2048/style/main.scss b/views/vibeOS/appfiles/2048/style/main.scss deleted file mode 100644 index b0ec8da9..00000000 --- a/views/vibeOS/appfiles/2048/style/main.scss +++ /dev/null @@ -1,549 +0,0 @@ -@import "helpers"; -@import "fonts/clear-sans.css"; - -$field-width: 500px; -$grid-spacing: 15px; -$grid-row-cells: 4; -$tile-size: ($field-width - $grid-spacing * ($grid-row-cells + 1)) / $grid-row-cells; -$tile-border-radius: 3px; - -$mobile-threshold: $field-width + 20px; - -$text-color: #776E65; -$bright-text-color: #f9f6f2; - -$tile-color: #eee4da; -$tile-gold-color: #edc22e; -$tile-gold-glow-color: lighten($tile-gold-color, 15%); - -$game-container-margin-top: 40px; -$game-container-background: #bbada0; - -$transition-speed: 100ms; - -html, body { - margin: 0; - padding: 0; - - background: #faf8ef; - color: $text-color; - font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif; - font-size: 18px; -} - -body { - margin: 80px 0; -} - -.heading { - @include clearfix; -} - -h1.title { - font-size: 80px; - font-weight: bold; - margin: 0; - display: block; - float: left; -} - -@include keyframes(move-up) { - 0% { - top: 25px; - opacity: 1; - } - - 100% { - top: -50px; - opacity: 0; - } -} - -.scores-container { - float: right; - text-align: right; -} - -.score-container, .best-container { - $height: 25px; - - position: relative; - display: inline-block; - background: $game-container-background; - padding: 15px 25px; - font-size: $height; - height: $height; - line-height: $height + 22px; - font-weight: bold; - border-radius: 3px; - color: white; - margin-top: 8px; - text-align: center; - - &:after { - position: absolute; - width: 100%; - top: 10px; - left: 0; - text-transform: uppercase; - font-size: 13px; - line-height: 13px; - text-align: center; - color: $tile-color; - } - - .score-addition { - position: absolute; - right: 30px; - color: red; - font-size: $height; - line-height: $height; - font-weight: bold; - color: rgba($text-color, .9); - z-index: 100; - @include animation(move-up 600ms ease-in); - @include animation-fill-mode(both); - } -} - -.score-container:after { - content: "Score"; -} - -.best-container:after { - content: "Best"; -} - -p { - margin-top: 0; - margin-bottom: 10px; - line-height: 1.65; -} - -a { - color: $text-color; - font-weight: bold; - text-decoration: underline; - cursor: pointer; -} - -strong { - &.important { - text-transform: uppercase; - } -} - -hr { - border: none; - border-bottom: 1px solid lighten($text-color, 40%); - margin-top: 20px; - margin-bottom: 30px; -} - -.container { - width: $field-width; - margin: 0 auto; -} - -@include keyframes(fade-in) { - 0% { - opacity: 0; - } - - 100% { - opacity: 1; - } -} - -// Styles for buttons -@mixin button { - display: inline-block; - background: darken($game-container-background, 20%); - border-radius: 3px; - padding: 0 20px; - text-decoration: none; - color: $bright-text-color; - height: 40px; - line-height: 42px; -} - -// Game field mixin used to render CSS at different width -@mixin game-field { - .game-container { - margin-top: $game-container-margin-top; - position: relative; - padding: $grid-spacing; - - cursor: default; - -webkit-touch-callout: none; - -ms-touch-callout: none; - - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - - -ms-touch-action: none; - touch-action: none; - - background: $game-container-background; - border-radius: $tile-border-radius * 2; - width: $field-width; - height: $field-width; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - - .game-message { - display: none; - - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: rgba($tile-color, .5); - z-index: 100; - - text-align: center; - - p { - font-size: 60px; - font-weight: bold; - height: 60px; - line-height: 60px; - margin-top: 222px; - // height: $field-width; - // line-height: $field-width; - } - - .lower { - display: block; - margin-top: 59px; - } - - a { - @include button; - margin-left: 9px; - // margin-top: 59px; - - &.keep-playing-button { - display: none; - } - } - - @include animation(fade-in 800ms ease $transition-speed * 12); - @include animation-fill-mode(both); - - &.game-won { - background: rgba($tile-gold-color, .5); - color: $bright-text-color; - - a.keep-playing-button { - display: inline-block; - } - } - - &.game-won, &.game-over { - display: block; - } - } - } - - .grid-container { - position: absolute; - z-index: 1; - } - - .grid-row { - margin-bottom: $grid-spacing; - - &:last-child { - margin-bottom: 0; - } - - &:after { - content: ""; - display: block; - clear: both; - } - } - - .grid-cell { - width: $tile-size; - height: $tile-size; - margin-right: $grid-spacing; - float: left; - - border-radius: $tile-border-radius; - - background: rgba($tile-color, .35); - - &:last-child { - margin-right: 0; - } - } - - .tile-container { - position: absolute; - z-index: 2; - } - - .tile { - &, .tile-inner { - width: ceil($tile-size); - height: ceil($tile-size); - line-height: ceil($tile-size); - } - - // Build position classes - @for $x from 1 through $grid-row-cells { - @for $y from 1 through $grid-row-cells { - &.tile-position-#{$x}-#{$y} { - $xPos: floor(($tile-size + $grid-spacing) * ($x - 1)); - $yPos: floor(($tile-size + $grid-spacing) * ($y - 1)); - @include transform(translate($xPos, $yPos)); - } - } - } - } -} - -// End of game-field mixin -@include game-field; - -.tile { - position: absolute; // Makes transforms relative to the top-left corner - - .tile-inner { - border-radius: $tile-border-radius; - - background: $tile-color; - text-align: center; - font-weight: bold; - z-index: 10; - - font-size: 55px; - } - - // Movement transition - @include transition($transition-speed ease-in-out); - -webkit-transition-property: -webkit-transform; - -moz-transition-property: -moz-transform; - transition-property: transform; - - $base: 2; - $exponent: 1; - $limit: 11; - - // Colors for all 11 states, false = no special color - $special-colors: false false, // 2 - false false, // 4 - #f78e48 true, // 8 - #fc5e2e true, // 16 - #ff3333 true, // 32 - #ff0000 true, // 64 - false true, // 128 - false true, // 256 - false true, // 512 - false true, // 1024 - false true; // 2048 - - // Build tile colors - @while $exponent <= $limit { - $power: pow($base, $exponent); - - &.tile-#{$power} .tile-inner { - // Calculate base background color - $gold-percent: ($exponent - 1) / ($limit - 1) * 100; - $mixed-background: mix($tile-gold-color, $tile-color, $gold-percent); - - $nth-color: nth($special-colors, $exponent); - - $special-background: nth($nth-color, 1); - $bright-color: nth($nth-color, 2); - - @if $special-background { - $mixed-background: mix($special-background, $mixed-background, 55%); - } - - @if $bright-color { - color: $bright-text-color; - } - - // Set background - background: $mixed-background; - - // Add glow - $glow-opacity: max($exponent - 4, 0) / ($limit - 4); - - @if not $special-background { - box-shadow: 0 0 30px 10px rgba($tile-gold-glow-color, $glow-opacity / 1.8), - inset 0 0 0 1px rgba(white, $glow-opacity / 3); - } - - // Adjust font size for bigger numbers - @if $power >= 100 and $power < 1000 { - font-size: 45px; - - // Media queries placed here to avoid carrying over the rest of the logic - @include smaller($mobile-threshold) { - font-size: 25px; - } - } @else if $power >= 1000 { - font-size: 35px; - - @include smaller($mobile-threshold) { - font-size: 15px; - } - } - } - - $exponent: $exponent + 1; - } - - // Super tiles (above 2048) - &.tile-super .tile-inner { - color: $bright-text-color; - background: mix(#333, $tile-gold-color, 95%); - - font-size: 30px; - - @include smaller($mobile-threshold) { - font-size: 10px; - } - } -} - -@include keyframes(appear) { - 0% { - opacity: 0; - @include transform(scale(0)); - } - - 100% { - opacity: 1; - @include transform(scale(1)); - } -} - -.tile-new .tile-inner { - @include animation(appear 200ms ease $transition-speed); - @include animation-fill-mode(backwards); -} - -@include keyframes(pop) { - 0% { - @include transform(scale(0)); - } - - 50% { - @include transform(scale(1.2)); - } - - 100% { - @include transform(scale(1)); - } -} - -.tile-merged .tile-inner { - z-index: 20; - @include animation(pop 200ms ease $transition-speed); - @include animation-fill-mode(backwards); -} - -.above-game { - @include clearfix; -} - -.game-intro { - float: left; - line-height: 42px; - margin-bottom: 0; -} - -.restart-button { - @include button; - display: block; - text-align: center; - float: right; -} - -.game-explanation { - margin-top: 50px; -} - -@include smaller($mobile-threshold) { - // Redefine variables for smaller screens - $field-width: 280px; - $grid-spacing: 10px; - $grid-row-cells: 4; - $tile-size: ($field-width - $grid-spacing * ($grid-row-cells + 1)) / $grid-row-cells; - $tile-border-radius: 3px; - $game-container-margin-top: 17px; - - html, body { - font-size: 15px; - } - - body { - margin: 20px 0; - padding: 0 20px; - } - - h1.title { - font-size: 27px; - margin-top: 15px; - } - - .container { - width: $field-width; - margin: 0 auto; - } - - .score-container, .best-container { - margin-top: 0; - padding: 15px 10px; - min-width: 40px; - } - - .heading { - margin-bottom: 10px; - } - - // Show intro and restart button side by side - .game-intro { - width: 55%; - display: block; - box-sizing: border-box; - line-height: 1.65; - } - - .restart-button { - width: 42%; - padding: 0; - display: block; - box-sizing: border-box; - margin-top: 2px; - } - - // Render the game field at the right width - @include game-field; - - // Rest of the font-size adjustments in the tile class - .tile .tile-inner { - font-size: 35px; - } - - .game-message { - p { - font-size: 30px !important; - height: 30px !important; - line-height: 30px !important; - margin-top: 90px !important; - } - - .lower { - margin-top: 30px !important; - } - } -} diff --git a/views/vibeOS/appfiles/breakout/LICENSE b/views/vibeOS/appfiles/breakout/LICENSE deleted file mode 100644 index 1fcbfc26..00000000 --- a/views/vibeOS/appfiles/breakout/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016 Jake Gordon and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -=============================================================================== - -All sounds come from The Freesound Project (www.freesound.org) and are licensed -under the creative commons license (http://creativecommons.org/licenses/by-nd/2.0/) - -A list of sounds and authors attribution can be found here: - - http://www.freesound.org/usersAttribution.php?id=2227288 - - diff --git a/views/vibeOS/appfiles/breakout/breakout.css b/views/vibeOS/appfiles/breakout/breakout.css deleted file mode 100644 index 9bf860fa..00000000 --- a/views/vibeOS/appfiles/breakout/breakout.css +++ /dev/null @@ -1,101 +0,0 @@ -/*******************************/ -/* global document body styles */ -/*******************************/ - -body { - font: 12pt Arial, Helvetica, sans-serif; - padding: 0; - margin: 0; -} - -/**************************/ -/* unique id-based styles */ -/**************************/ - -#breakout { - position: relative; -} - -#canvas { - -webkit-transform: translateZ(0); /* force hardware acceleration in chrome */ -} - -#levels { - position: absolute; - left: 10px; - top: 10px; - color: #666; - line-height: 20px; -} - -#levels #next { position: absolute; } -#levels #prev { position: absolute; top: 14px; } -#levels #label { padding-left: 20px; } -#levels #level { font-size: 14pt; padding-left: 5px; font-weight: bold; color: black; } - -#levels img { cursor: pointer; } -#levels img.disabled { opacity: 0.3; cursor: default; } -#levels img:active { margin-top: 1px; margin-left: 1px; } -#levels img.disabled:active { margin-top: 0; margin-left: 0; } - -#instructions { - background: #DDD; - border: 2px solid #333; - color: #555; - padding: 0.5em 1em; - white-space: nowrap; - text-align: center; - width: 18em; - margin: 0 auto; - position: relative; - top: -16em; -} -#instructions b { color: black; } - -#instructions .keyboard { display: block; } -#instructions .touch { display: none; } -#instructions.touch .keyboard { display: none; } -#instructions.touch .touch { display: block; } - -#controls { - position: absolute; - bottom: 0.5em; - left: 0.5em; -} -#controls input, -#controls label { vertical-align: middle; } - -/********************************/ -/* re-usable class-based styles */ -/********************************/ - -.unsupported { - border: 1px solid yellow; - color: black; - background-color: #FFFFAD; - padding: 2em; - margin: 5em; - display: inline-block; -} - -/*****************************/ -/* @media query based layout */ -/*****************************/ - -@media screen and (min-width: 0px) { - #breakout { display: block; width: 640px; height: 480px; margin: 1em auto; border: 1px solid #AAA; } - #canvas { display: block; width: 640px; height: 480px; } - #instructions { font-size: 8pt; } -} - -@media screen and (min-width: 1200px) { - #breakout { width: 800px; height: 600px; } - #canvas { width: 800px; height: 600px; } - #instructions { font-size: 10pt; } -} - -@media screen and (min-width: 1600px) { - #breakout { width: 1024px; height: 768px; } - #canvas { width: 1024px; height: 768px; } - #instructions { font-size: 11pt; } -} diff --git a/views/vibeOS/appfiles/breakout/breakout.js b/views/vibeOS/appfiles/breakout/breakout.js deleted file mode 100644 index a16fb2a3..00000000 --- a/views/vibeOS/appfiles/breakout/breakout.js +++ /dev/null @@ -1,699 +0,0 @@ -//============================================================================= -// Breakout -//============================================================================= - -Breakout = { - - Defaults: { - - fps: 60, - stats: false, - - score: { - lives: { - initial: 3, - max: 5 - } - }, - - court: { - xchunks: 30, - ychunks: 25 - }, - - ball: { - radius: 0.3, - speed: 15, - labels: { - 3: { text: 'ready...', fill: '#D82800', stroke: 'black', font: 'bold 28pt arial' }, - 2: { text: 'set..', fill: '#FC9838', stroke: 'black', font: 'bold 28pt arial' }, - 1: { text: 'go!', fill: '#80D010', stroke: 'black', font: 'bold 28pt arial' } - } - }, - - paddle: { - width: 6, - height: 1, - speed: 20 - }, - - color: { - background: 'rgba(200, 200, 200, 0.5)', - foreground: 'green', - border: '#222', - wall: '#333', - ball: 'black', - paddle: 'rgb(245,111,37)', - score: "#EFD279", - highscore: "#AFD775" - }, - - state: { - initial: 'menu', - events: [ - { name: 'play', from: 'menu', to: 'game' }, - { name: 'abandon', from: 'game', to: 'menu' }, - { name: 'lose', from: 'game', to: 'menu' } - ]}, - - keys: [ - { keys: [Game.KEY.LEFT, Game.KEY.A], mode: 'down', action: function() { this.paddle.moveLeft(); } }, - { keys: [Game.KEY.RIGHT, Game.KEY.D], mode: 'down', action: function() { this.paddle.moveRight(); } }, - { keys: [Game.KEY.LEFT, Game.KEY.A], action: function() { this.paddle.stopMovingLeft(); } }, - { keys: [Game.KEY.RIGHT, Game.KEY.D], action: function() { this.paddle.stopMovingRight(); } }, - { keys: [Game.KEY.SPACE, Game.KEY.RETURN], state: 'menu', action: function() { this.play(); } }, - { keys: [Game.KEY.SPACE, Game.KEY.RETURN], state: 'game', action: function() { this.ball.launchNow(); } }, - { key: Game.KEY.ESC, state: 'game', action: function() { this.abandon(); } }, - { key: Game.KEY.UP, state: 'menu', action: function() { this.nextLevel(); } }, - { key: Game.KEY.DOWN, state: 'menu', action: function() { this.prevLevel(); } } - ], - - sounds: { - brick: '/sound/breakout/brick.mp3', - paddle: '/sound/breakout/paddle.mp3', - go: '/sound/breakout/go.mp3', - levelup: '/sound/breakout/levelup.mp3', - loselife: '/sound/breakout/loselife.mp3', - gameover: '/sound/breakout/gameover.mp3' - } - - }, - - //----------------------------------------------------------------------------- - - initialize: function(runner, cfg) { - this.cfg = cfg; - this.runner = runner; - this.width = runner.width; - this.height = runner.height; - this.storage = runner.storage(); - this.color = cfg.color; - this.sound = (this.storage.sound == "true"); - this.court = Object.construct(Breakout.Court, this, cfg.court); - this.paddle = Object.construct(Breakout.Paddle, this, cfg.paddle); - this.ball = Object.construct(Breakout.Ball, this, cfg.ball); - this.score = Object.construct(Breakout.Score, this, cfg.score); - Game.loadSounds({sounds: cfg.sounds}); - }, - - onstartup: function() { // the event that fires the initial state transition occurs when Game.Runner constructs our StateMachine - this.addEvents(); - this.runner.start(); // start the 60fps update/draw game loop - }, - - addEvents: function() { - Game.addEvent('prev', 'click', this.prevLevel.bind(this, false)); - Game.addEvent('next', 'click', this.nextLevel.bind(this, false)); - Game.addEvent('sound', 'change', this.toggleSound.bind(this, false)); - - Game.addEvent('instructions', 'touchstart', this.play.bind(this)); - Game.addEvent(this.runner.canvas, 'touchmove', this.ontouchmove.bind(this)); - Game.addEvent(document.body, 'touchmove', function(event) { event.preventDefault(); }); // prevent ipad bouncing up and down when finger scrolled - }, - - toggleSound: function() { - this.storage.sound = this.sound = !this.sound; - }, - - update: function(dt) { - this.court.update(dt); - this.paddle.update(dt); - this.ball.update(dt); - this.score.update(dt); - }, - - draw: function(ctx) { - ctx.save(); - ctx.clearRect(0, 0, this.width, this.height); - ctx.fillStyle = this.color.background; - ctx.fillRect(0, 0, this.width, this.height); - this.court.draw(ctx); - this.paddle.draw(ctx); - this.ball.draw(ctx); - this.score.draw(ctx); - ctx.restore(); - }, - - onresize: function(width, height) { - this.width = width; - this.height = height; - this.court.resize(); - this.paddle.reset(); - this.ball.reset(); - }, - - onmenu: function() { - this.resetLevel(); - this.paddle.reset(); - this.ball.reset(); - this.refreshDOM(); - }, - - ongame: function() { - this.refreshDOM(); - this.score.reset(); - this.ball.reset({launch: true}); - }, - - onlose: function() { - this.playSound('gameover'); - }, - - onleavegame: function() { - this.score.save(); - this.score.resetLives(); - }, - - onbeforeabandon: function() { - return this.runner.confirm("Abandon game?") - }, - - loseBall: function() { - this.playSound('loselife'); - if (this.score.loseLife()) - this.lose(); - else { - this.ball.reset({launch: true}); - } - }, - - winLevel: function() { - this.playSound('levelup'); - this.score.gainLife(); - this.nextLevel(true); - this.ball.reset({launch: true}); - }, - - hitBrick: function(brick) { - this.playSound('brick'); - this.court.remove(brick); - this.score.increase(brick.score); - this.ball.speed += 10 * (1 - (this.ball.speed / this.ball.maxspeed)); // decay curve - speed increases less the faster the ball is (otherwise game becomes impossible) - if (this.court.empty()) - this.winLevel(); - }, - - resetLevel: function() { this.setLevel(); }, - setLevel: function(level) { - level = (typeof level == 'undefined') ? (this.storage.level ? parseInt(this.storage.level) : 0) : level; - level = level < Breakout.Levels.length ? level : 0; - this.court.reset(level); - this.storage.level = this.level = level; - this.refreshDOM(); - }, - - canPrevLevel: function() { return this.is('menu') && (this.level > 0); }, - canNextLevel: function() { return this.is('menu') && (this.level < (Breakout.Levels.length-1)); }, - prevLevel: function(force) { if (force || this.canPrevLevel()) this.setLevel(this.level - 1); }, - nextLevel: function(force) { if (force || this.canNextLevel()) this.setLevel(this.level + 1); }, - - initCanvas: function(ctx) { // called by Game.Runner whenever the canvas is reset (on init and on resize) - ctx.fillStyle = this.color.foreground; - ctx.strokeStyle = this.color.foreground; - ctx.lineWidth = 1; - this.score.measure(ctx); // score needs to measure itself - }, - - refreshDOM: function() { - $('instructions').className = Game.ua.hasTouch ? 'touch' : 'keyboard'; - $('instructions').showIf(this.is('menu')); - $('prev').toggleClassName('disabled', !this.canPrevLevel()); - $('next').toggleClassName('disabled', !this.canNextLevel()); - $('level').update(this.level + 1); - $('sound').checked = this.sound; - }, - - playSound: function(id) { - if (soundManager && this.sound) { - soundManager.play(id); - } - }, - - ontouchmove: function(ev) { - if (ev.targetTouches.length == 1) { - this.paddle.place(ev.targetTouches[0].pageX - this.runner.bounds.left - this.paddle.w/2); // clientX only works in ios, not on android - must use pageX - yuck - } - }, - - //============================================================================= - - Score: { - - initialize: function(game, cfg) { - this.game = game; - this.cfg = cfg; - this.load(); - this.reset(); - }, - - reset: function() { this.set(0); this.resetLives(); }, - set: function(n) { this.score = this.vscore = n; this.rerender = true; }, - increase: function(n) { this.score = this.score + n; this.rerender = true; }, - format: function(n) { return ("0000000" + n).slice(-7); }, - load: function() { this.highscore = this.game.storage.highscore ? parseInt(this.game.storage.highscore) : 1000; }, - save: function() { if (this.score > this.highscore) this.game.storage.highscore = this.highscore = this.score; }, - - resetLives: function() { this.setLives(this.cfg.lives.initial); }, - setLives: function(n) { this.lives = n; this.rerender = true; }, - gainLife: function() { this.setLives(Math.min(this.cfg.lives.max, this.lives + 1)); }, - loseLife: function() { this.setLives(this.lives-1); return (this.lives == 0); }, - - update: function(dt) { - if (this.vscore < this.score) { - this.vscore = Math.min(this.score, this.vscore + 10); - this.rerender = true; - } - }, - - measure: function(ctx) { - this.left = this.game.court.left; - this.top = this.game.court.top - this.game.court.wall.size*2; - this.width = this.game.court.width; - this.height = this.game.court.wall.size*2; - this.scorefont = "bold " + Math.max(9, this.game.court.wall.size - 2) + "pt arial"; - this.highfont = "" + Math.max(9, this.game.court.wall.size - 8) + "pt arial"; - ctx.save(); - ctx.font = this.scorefont; - this.scorewidth = ctx.measureText(this.format(0)).width; - ctx.font = this.highfont; - this.highwidth = ctx.measureText("HIGH SCORE: " + this.format(0)).width; - ctx.restore(); - this.rerender = true; - }, - - draw: function(ctx) { - if (this.rerender) { - this.canvas = Game.renderToCanvas(this.width, this.height, this.render.bind(this), this.canvas); - this.rerender = false; - } - ctx.drawImage(this.canvas, this.left, this.top); - }, - - render: function(ctx) { - var text, width, paddle; - var ishigh = this.game.is('game') && (this.score > this.highscore); - - ctx.textBaseline = "middle"; - ctx.fillStyle = this.game.color.score; - ctx.font = this.scorefont; - text = this.format(this.vscore); - ctx.fillText(text, 0, this.height/2); - - ctx.fillStyle = ishigh ? this.game.color.score : this.game.color.highscore; - text = "HIGH SCORE: " + this.format(ishigh ? this.score : this.highscore); - ctx.font = this.highfont; - width = ctx.measureText(text).width; - ctx.fillText(text, this.width - width, this.height/2); - - paddle = { - game: this.game, - w: this.game.court.chunk * 1.5, - h: this.game.court.chunk * 2/3 - } - ctx.translate(this.scorewidth + 20, (this.height-paddle.h) / 2); - for(var n = 0 ; n < this.lives ; n++) { - this.game.paddle.render.call(paddle, ctx); - ctx.translate(paddle.w + 5, 0); - } - - } - - }, - - //============================================================================= - - Court: { - - initialize: function(game, cfg) { - this.game = game; - this.cfg = cfg; - }, - - reset: function(level) { - var layout = Breakout.Levels[level]; - var line, brick, score, c, n, x, y, nx, ny = Math.min(layout.bricks.length, this.cfg.ychunks); - this.bricks = []; - for(y = 0 ; y < ny ; y++) { - score = (this.cfg.ychunks - y) * 5; - line = layout.bricks[y] + " "; // extra space simplifies loop - brick = null; - nx = Math.min(line.length, this.cfg.xchunks + 1); - for(x = 0 ; x < nx ; x++) { - c = line[x]; - if (brick && (brick.c == c)) { - brick.pos.x2 = x; - } - else if (brick && (brick.c != c)) { - this.bricks.push(brick); - brick = null; - } - - if (!brick && (c != ' ')) - brick = { isbrick: true, hit: false, c: c, pos: { x1: x, x2: x, y: y }, score: score, color: layout.colors[c.toLowerCase()] }; - } - } - this.numbricks = this.bricks.length; - this.numhits = 0; - this.resize(); - }, - - resize: function() { - - this.chunk = Math.floor(Math.min(this.game.width, this.game.height) / (Math.max(this.cfg.xchunks, this.cfg.ychunks) + 4)); // room for court plus 2 chunk wall either side - this.width = this.cfg.xchunks * this.chunk; - this.height = this.cfg.ychunks * this.chunk; - this.left = Math.floor((this.game.width - this.width) / 2); - this.top = Math.floor((this.game.height - this.height) / 2); - this.right = this.left + this.width; - this.bottom = this.top + this.height; - - this.wall = {} - this.wall.size = this.chunk; - this.wall.top = Game.Math.bound({x: this.left - this.wall.size, y: this.top - this.wall.size*2, w: this.width + this.wall.size*2, h: this.wall.size*2 }); - this.wall.left = Game.Math.bound({x: this.left - this.wall.size, y: this.top - this.wall.size*2, w: this.wall.size, h: this.wall.size*2 + this.height }); - this.wall.right = Game.Math.bound({x: this.right, y: this.top - this.wall.size*2, w: this.wall.size, h: this.wall.size*2 + this.height }); - - for(n = 0 ; n < this.numbricks ; n++) { - brick = this.bricks[n]; - brick.x = this.left + (brick.pos.x1 * this.chunk); - brick.y = this.top + (brick.pos.y * this.chunk); - brick.w = (brick.pos.x2 - brick.pos.x1 + 1) * this.chunk; - brick.h = this.chunk; - Game.Math.bound(brick); - } - - this.rerender = true; - }, - - update: function(dt) { - }, - - draw: function(ctx) { - if (this.rerender) { - this.canvas = Game.renderToCanvas(this.game.width, this.game.height, this.render.bind(this), this.canvas); - this.rerender = false; - } - ctx.drawImage(this.canvas, 0, 0); - }, - - render: function(ctx) { - var n, brick; - - ctx.translate(0.5, 0.5); // crisp 1px lines for the brick borders - ctx.strokeStyle = this.game.color.border; - ctx.lineWidth = 1; - for(n = 0 ; n < this.numbricks ; n++) { - brick = this.bricks[n]; - if (!brick.hit) { - ctx.fillStyle = brick.color; - ctx.fillRect(brick.x, brick.y, brick.w, brick.h); - ctx.strokeRect(brick.x, brick.y, brick.w, brick.h); - } - } - - ctx.fillStyle = this.game.color.wall; - ctx.lineWidth = 2; - ctx.beginPath(); - ctx.moveTo(this.wall.top.left, this.wall.top.top); - ctx.lineTo(this.wall.top.right, this.wall.top.top); - ctx.lineTo(this.wall.top.right, this.wall.right.bottom); - ctx.lineTo(this.wall.right.left, this.wall.right.bottom); - ctx.lineTo(this.wall.right.left, this.wall.top.bottom); - ctx.lineTo(this.wall.left.right, this.wall.top.bottom); - ctx.lineTo(this.wall.left.right, this.wall.left.bottom); - ctx.lineTo(this.wall.left.left, this.wall.left.bottom); - ctx.lineTo(this.wall.top.left, this.wall.top.top); - ctx.fill(); - ctx.stroke(); - ctx.closePath(); - }, - - remove: function(brick) { - brick.hit = true; - this.numhits++; - this.rerender = true; - }, - - empty: function() { - return (this.numhits == this.numbricks); - } - - }, - - //============================================================================= - - Ball: { - - initialize: function(game, cfg) { - this.game = game; - this.cfg = cfg; - }, - - reset: function(options) { - this.radius = this.cfg.radius * this.game.court.chunk; - this.speed = this.cfg.speed * this.game.court.chunk; - this.maxspeed = this.speed * 1.5; - this.color = this.game.color.ball; - this.moveToPaddle(); - this.setdir(0, 0); - this.clearLaunch(); - this.hitTargets = [ - this.game.paddle, - this.game.court.wall.top, - this.game.court.wall.left, - this.game.court.wall.right, - ].concat(this.game.court.bricks); - if (options && options.launch) - this.launch(); - }, - - moveToPaddle: function() { - this.setpos(this.game.paddle.left + (this.game.paddle.w/2), this.game.court.bottom - this.game.paddle.h - this.radius); - }, - - setpos: function(x, y) { - this.x = x; - this.y = y; - Game.Math.bound(this); - }, - - setdir: function(dx, dy) { - var dir = Game.Math.normalize({ x: dx, y: dy }); - this.dx = dir.x; - this.dy = dir.y; - this.moving = dir.m != 0; - }, - - launch: function() { - if (!this.moving || this.countdown) { - this.countdown = (typeof this.countdown == 'undefined') || (this.countdown == null) ? 3 : this.countdown - 1; - if (this.countdown > 0) { - this.label = this.launchLabel(this.countdown); - this.delayTimer = setTimeout(this.launch.bind(this), 1000); - if (this.countdown == 1) - this.setdir(1, -1); // launch on 'go' - } - else { - this.clearLaunch(); - } - } - }, - - launchNow: function() { // key can override countdown launch - if (!this.moving) { - this.clearLaunch(); - this.setdir(1, -1); - } - }, - - launchLabel: function(count) { - var label = this.cfg.labels[count]; - var ctx = this.game.runner.front2d; // dodgy getting the context this way, should probably have a Game.Runner.ctx() method ? - ctx.save(); - ctx.font = label.font; - ctx.fillStyle = label.fill; - ctx.strokeStyle = label.stroke; - ctx.lineWidth = 0.5; - var width = ctx.measureText(label.text).width; - ctx.restore(); - label.x = this.game.court.left + (this.game.court.width - width)/2; - label.y = this.game.paddle.top - 60; - return label; - }, - - clearLaunch: function() { - if (this.delayTimer) { - clearTimeout(this.delayTimer); - this.delayTimer = this.label = this.countdown = null; - } - }, - - update: function(dt) { - - if (!this.moving) - return this.moveToPaddle(); - - var p2 = Game.Math.move(this.x, this.y, this.dx * this.speed, this.dy * this.speed, dt); - - var mCurrent, mClosest = Infinity, point, item, closest = null; - for (var n = 0 ; n < this.hitTargets.length ; n++) { - item = this.hitTargets[n]; - if (!item.hit) { - point = Game.Math.ballIntercept(this, item, p2.nx, p2.ny); - if (point) { - mCurrent = Game.Math.magnitude(point.x - this.x, point.y - this.y); - if (mCurrent < mClosest) { - mClosest = mCurrent; - closest = {item: item, point: point}; - } - } - } - } - - if (closest) { - - if (closest.item.isbrick) { - this.game.hitBrick(closest.item); - if (!this.moving) // if hitBrick caused game to end we dont want to continue updating our state - return; - } - - if ((closest.item == this.game.paddle) && (closest.point.d == 'top')) { - p2.dx = this.speed * (closest.point.x - (this.game.paddle.left + this.game.paddle.w/2)) / (this.game.paddle.w/2); - this.game.playSound('paddle'); - } - - this.setpos(closest.point.x, closest.point.y); - - switch(closest.point.d) { - case 'left': - case 'right': - this.setdir(-p2.dx, p2.dy); - break; - - case 'top': - case 'bottom': - this.setdir(p2.dx, -p2.dy); - break; - } - - var udt = dt * (mClosest / Game.Math.magnitude(p2.nx, p2.ny)); // how far along did we get before intercept ? - return this.update(dt - udt); // so we can update for time remaining - } - - if ((p2.x < 0) || (p2.y < 0) || (p2.x > this.game.width) || (p2.y > this.game.height)) { - this.game.loseBall(); - } - else { - this.setpos(p2.x, p2.y); - this.setdir(p2.dx, p2.dy); - } - - }, - - draw: function(ctx) { - ctx.fillStyle = this.color; - ctx.beginPath(); - ctx.arc(this.x, this.y, this.radius, 0, Game.THREESIXTY, true); - ctx.fill(); - ctx.stroke(); - ctx.closePath(); - - if (this.label) { - ctx.font = this.label.font; - ctx.fillStyle = this.label.fill; - ctx.strokeStyle = this.label.stroke; - ctx.lineWidth = 0.5; - ctx.fillText(this.label.text, this.label.x, this.label.y); - ctx.strokeText(this.label.text, this.label.x, this.label.y); - } - } - - }, - - //============================================================================= - - Paddle: { - initialize: function(game, cfg) { - this.game = game; - this.cfg = cfg; - }, - - reset: function() { - this.speed = this.cfg.speed * this.game.court.chunk; - this.w = this.cfg.width * this.game.court.chunk; - this.h = this.cfg.height * this.game.court.chunk; - this.minX = this.game.court.left; - this.maxX = this.game.court.right - this.w; - this.setpos(Game.random(this.minX, this.maxX), this.game.court.bottom - this.h); - this.setdir(0); - this.rerender = true; - }, - - setpos: function(x, y) { - this.x = x; - this.y = y; - Game.Math.bound(this); - }, - - setdir: function(dx) { - this.dleft = (dx < 0 ? -dx : 0); - this.dright = (dx > 0 ? dx : 0); - }, - - place: function(x) { - this.setpos(Math.min(this.maxX, Math.max(this.minX, x)), this.y); - }, - - update: function(dt) { - var amount = this.dright - this.dleft; - if (amount != 0) - this.place(this.x + (amount * dt * this.speed)); - }, - - draw: function(ctx) { - if (this.rerender) { - this.canvas = Game.renderToCanvas(this.w, this.h, this.render.bind(this)); - this.rerender = false; - } - ctx.drawImage(this.canvas, this.x, this.y); - }, - - render: function(ctx) { - - var gradient = ctx.createLinearGradient(0, this.h, 0, 0); - gradient.addColorStop(0.36, 'rgb(245,111,37)'); - gradient.addColorStop(0.68, 'rgb(255,145,63)'); - gradient.addColorStop(0.84, 'rgb(255,174,95)'); - - var r = this.h/2; - - ctx.fillStyle = gradient; - ctx.strokeStyle = this.game.color.border; - ctx.beginPath(); - ctx.moveTo(r, 0); - ctx.lineTo(this.w - r, 0); - ctx.arcTo(this.w, 0, this.w, r, r); - ctx.lineTo(this.w, this.h - r); - ctx.arcTo(this.w, this.h, this.w - r, this.h, r); - ctx.lineTo(r, this.h); - ctx.arcTo(0, this.h, 0, this.h - r, r); - ctx.lineTo(0, r); - ctx.arcTo(0, 0, r, 0, r); - ctx.fill(); - ctx.stroke(); - ctx.closePath(); - - }, - - moveLeft: function() { this.dleft = 1; }, - moveRight: function() { this.dright = 1; }, - stopMovingLeft: function() { this.dleft = 0; }, - stopMovingRight: function() { this.dright = 0; } - - } - - //============================================================================= - -}; // Breakout - diff --git a/views/vibeOS/appfiles/breakout/game.js b/views/vibeOS/appfiles/breakout/game.js deleted file mode 100644 index f1f04980..00000000 --- a/views/vibeOS/appfiles/breakout/game.js +++ /dev/null @@ -1,676 +0,0 @@ -//============================================================================= -// -// We need some ECMAScript 5 methods but we need to implement them ourselves -// for older browsers (compatibility: http://kangax.github.com/es5-compat-table/) -// -// Function.bind: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind -// Object.create: http://javascript.crockford.com/prototypal.html -// Object.extend: (defacto standard like jquery $.extend or prototype's Object.extend) -// -// Object.construct: our own wrapper around Object.create that ALSO calls -// an initialize constructor method if one exists -// -//============================================================================= - -if (!Function.prototype.bind) { - Function.prototype.bind = function(obj) { - var slice = [].slice, - args = slice.call(arguments, 1), - self = this, - nop = function () {}, - bound = function () { - return self.apply(this instanceof nop ? this : (obj || {}), args.concat(slice.call(arguments))); - }; - nop.prototype = self.prototype; - bound.prototype = new nop(); - return bound; - }; -} - -if (!Object.create) { - Object.create = function(base) { - function F() {}; - F.prototype = base; - return new F(); - } -} - -if (!Object.construct) { - Object.construct = function(base) { - var instance = Object.create(base); - if (instance.initialize) - instance.initialize.apply(instance, [].slice.call(arguments, 1)); - return instance; - } -} - -if (!Object.extend) { - Object.extend = function(destination, source) { - for (var property in source) { - if (source.hasOwnProperty(property)) - destination[property] = source[property]; - } - return destination; - }; -} - -/* NOT READY FOR PRIME TIME -if (!window.requestAnimationFrame) {// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ - window.requestAnimationFrame = window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || - function(callback, element) { - window.setTimeout(callback, 1000 / 60); - } -} -*/ - -//============================================================================= -// Minimal DOM Library ($) -//============================================================================= - -Element = function() { - - var instance = { - - _extended: true, - - showIf: function(on) { if (on) this.show(); else this.hide(); }, - show: function() { this.style.display = ''; }, - hide: function() { this.style.display = 'none'; }, - update: function(content) { this.innerHTML = content; }, - - hasClassName: function(name) { return (new RegExp("(^|\s*)" + name + "(\s*|$)")).test(this.className) }, - addClassName: function(name) { this.toggleClassName(name, true); }, - removeClassName: function(name) { this.toggleClassName(name, false); }, - toggleClassName: function(name, on) { - var classes = this.className.split(' '); - var n = classes.indexOf(name); - on = (typeof on == 'undefined') ? (n < 0) : on; - if (on && (n < 0)) - classes.push(name); - else if (!on && (n >= 0)) - classes.splice(n, 1); - this.className = classes.join(' '); - } - }; - - var get = function(ele) { - if (typeof ele == 'string') - ele = document.getElementById(ele); - if (!ele._extended) - Object.extend(ele, instance); - return ele; - }; - - return get; - -}(); - -$ = Element; - -//============================================================================= -// State Machine -//============================================================================= - -StateMachine = { - - //--------------------------------------------------------------------------- - - create: function(cfg) { - - var target = cfg.target || {}; - var events = cfg.events; - - var n, event, name, can = {}; - for(n = 0 ; n < events.length ; n++) { - event = events[n]; - name = event.name; - can[name] = (can[name] || []).concat(event.from); - target[name] = this.buildEvent(name, event.from, event.to, target); - } - - target.current = 'none'; - target.is = function(state) { return this.current == state; }; - target.can = function(event) { return can[event].indexOf(this.current) >= 0; }; - target.cannot = function(event) { return !this.can(event); }; - - if (cfg.initial) { // see "initial" qunit tests for examples - var initial = (typeof cfg.initial == 'string') ? { state: cfg.initial } : cfg.initial; // allow single string to represent initial state, or complex object to configure { state: 'first', event: 'init', defer: true|false } - name = initial.event || 'startup'; - can[name] = ['none']; - event = this.buildEvent(name, 'none', initial.state, target); - if (initial.defer) - target[name] = event; // allow caller to trigger initial transition event - else - event.call(target); - } - - return target; - }, - - //--------------------------------------------------------------------------- - - buildEvent: function(name, from, to, target) { - - return function() { - - if (this.cannot(name)) - throw "event " + name + " innapropriate in current state " + this.current; - - var beforeEvent = this['onbefore' + name]; - if (beforeEvent && (false === beforeEvent.apply(this, arguments))) - return; - - if (this.current != to) { - - var exitState = this['onleave' + this.current]; - if (exitState) - exitState.apply(this, arguments); - - this.current = to; - - var enterState = this['onenter' + to] || this['on' + to]; - if (enterState) - enterState.apply(this, arguments); - } - - var afterEvent = this['onafter' + name] || this['on' + name]; - if (afterEvent) - afterEvent.apply(this, arguments); - } - - } - - //--------------------------------------------------------------------------- - -}; - -//============================================================================= -// GAME -//============================================================================= - -Game = { - - compatible: function() { - return Object.create && - Object.extend && - Function.bind && - document.addEventListener && // HTML5 standard, all modern browsers that support canvas should also support add/removeEventListener - Game.ua.hasCanvas - }, - - start: function(id, game, cfg) { - if (Game.compatible()) - return Game.current = Object.construct(Game.Runner, id, game, cfg).game; // return the game instance, not the runner (caller can always get at the runner via game.runner) - }, - - ua: function() { // should avoid user agent sniffing... but sometimes you just gotta do what you gotta do - var ua = navigator.userAgent.toLowerCase(); - var key = ((ua.indexOf("opera") > -1) ? "opera" : null); - key = key || ((ua.indexOf("firefox") > -1) ? "firefox" : null); - key = key || ((ua.indexOf("chrome") > -1) ? "chrome" : null); - key = key || ((ua.indexOf("safari") > -1) ? "safari" : null); - key = key || ((ua.indexOf("msie") > -1) ? "ie" : null); - - try { - var re = (key == "ie") ? "msie (\\d)" : key + "\\/(\\d\\.\\d)" - var matches = ua.match(new RegExp(re, "i")); - var version = matches ? parseFloat(matches[1]) : null; - } catch (e) {} - - return { - full: ua, - name: key + (version ? " " + version.toString() : ""), - version: version, - isFirefox: (key == "firefox"), - isChrome: (key == "chrome"), - isSafari: (key == "safari"), - isOpera: (key == "opera"), - isIE: (key == "ie"), - hasCanvas: (document.createElement('canvas').getContext), - hasAudio: (typeof(Audio) != 'undefined'), - hasTouch: ('ontouchstart' in window) - } - }(), - - addEvent: function(obj, type, fn) { $(obj).addEventListener(type, fn, false); }, - removeEvent: function(obj, type, fn) { $(obj).removeEventListener(type, fn, false); }, - - windowWidth: function() { return window.innerWidth || /* ie */ document.documentElement.offsetWidth; }, - windowHeight: function() { return window.innerHeight || /* ie */ document.documentElement.offsetHeight; }, - - ready: function(fn) { - if (Game.compatible()) - Game.addEvent(document, 'DOMContentLoaded', fn); - }, - - renderToCanvas: function(width, height, render, canvas) { // http://kaioa.com/node/103 - canvas = canvas || document.createElement('canvas'); - canvas.width = width; - canvas.height = height; - render(canvas.getContext('2d')); - return canvas; - }, - - loadScript: function(src, cb) { - var head = document.getElementsByTagName('head')[0]; - var s = document.createElement('script'); - head.appendChild(s); - if (Game.ua.isIE) { - s.onreadystatechange = function(e) { - if (e.currentTarget.readyState == 'loaded') - cb(e.currentTarget); - } - } - else { - s.onload = function(e) { cb(e.currentTarget); } - } - s.type = 'text/javascript'; - s.src = src; - }, - - loadImages: function(sources, callback) { /* load multiple images and callback when ALL have finished loading */ - var images = {}; - var count = sources ? sources.length : 0; - if (count == 0) { - callback(images); - } - else { - for(var n = 0 ; n < sources.length ; n++) { - var source = sources[n]; - var image = document.createElement('img'); - images[source] = image; - Game.addEvent(image, 'load', function() { if (--count == 0) callback(images); }); - image.src = source; - } - } - }, - - loadSounds: function(cfg) { - cfg = cfg || {}; - if (typeof soundManager == 'undefined') { - var path = cfg.path || 'sound/soundmanager2-nodebug-jsmin.js'; - var swf = cfg.swf || 'sound/swf'; - window.SM2_DEFER = true; - Game.loadScript(path, function() { - window.soundManager = new SoundManager(); - soundManager.useHighPerformance = true; - soundManager.useFastPolling = true; - soundManager.url = swf; - soundManager.defaultOptions.volume = 50; // shhh! - soundManager.onready(function() { - Game.loadSounds(cfg); - }); - soundManager.beginDelayedInit(); - }); - } - else { - var sounds = []; - for(var id in cfg.sounds) { - sounds.push(soundManager.createSound({id: id, url: cfg.sounds[id]})); - } - if (cfg.onload) - cfg.onload(sounds); - } - }, - - random: function(min, max) { - return (min + (Math.random() * (max - min))); - }, - - randomChoice: function(choices) { - return choices[Math.round(Game.random(0, choices.length-1))]; - }, - - randomBool: function() { - return Game.randomChoice([true, false]); - }, - - timestamp: function() { - return new Date().getTime(); - }, - - THREESIXTY: Math.PI * 2, - - KEY: { - BACKSPACE: 8, - TAB: 9, - RETURN: 13, - ESC: 27, - SPACE: 32, - LEFT: 37, - UP: 38, - RIGHT: 39, - DOWN: 40, - DELETE: 46, - HOME: 36, - END: 35, - PAGEUP: 33, - PAGEDOWN: 34, - INSERT: 45, - ZERO: 48, - ONE: 49, - TWO: 50, - A: 65, - D: 68, - L: 76, - P: 80, - Q: 81, - TILDA: 192 - }, - - //----------------------------------------------------------------------------- - - Math: { - - bound: function(box) { - if (box.radius) { - box.w = 2 * box.radius; - box.h = 2 * box.radius; - box.left = box.x - box.radius; - box.right = box.x + box.radius; - box.top = box.y - box.radius; - box.bottom = box.y + box.radius; - } - else { - box.left = box.x; - box.right = box.x + box.w; - box.top = box.y; - box.bottom = box.y + box.h; - } - return box; - }, - - overlap: function(box1, box2, returnOverlap) { - if ((box1.right < box2.left) || - (box1.left > box2.right) || - (box1.top > box2.bottom) || - (box1.bottom < box2.top)) { - return false; - } - else { - if (returnOverlap) { - var left = Math.max(box1.left, box2.left); - var right = Math.min(box1.right, box2.right); - var top = Math.max(box1.top, box2.top); - var bottom = Math.min(box1.bottom, box2.bottom); - return {x: left, y: top, w: right-left, h: bottom-top, left: left, right: right, top: top, bottom: bottom }; - } - else { - return true; - } - } - }, - - normalize: function(vec, m) { - vec.m = this.magnitude(vec.x, vec.y); - if (vec.m == 0) { - vec.x = vec.y = vec.m = 0; - } - else { - vec.m = vec.m / (m || 1); - vec.x = vec.x / vec.m; - vec.y = vec.y / vec.m; - vec.m = vec.m / vec.m; - } - return vec; - }, - - magnitude: function(x, y) { - return Math.sqrt(x*x + y*y); - }, - - move: function(x, y, dx, dy, dt) { - var nx = dx * dt; - var ny = dy * dt; - return { x: x + nx, y: y + ny, dx: dx, dy: dy, nx: nx, ny: ny }; - }, - - accelerate: function(x, y, dx, dy, accel, dt) { - var x2 = x + (dt * dx) + (accel * dt * dt * 0.5); - var y2 = y + (dt * dy) + (accel * dt * dt * 0.5); - var dx2 = dx + (accel * dt) * (dx > 0 ? 1 : -1); - var dy2 = dy + (accel * dt) * (dy > 0 ? 1 : -1); - return { nx: (x2-x), ny: (y2-y), x: x2, y: y2, dx: dx2, dy: dy2 }; - }, - - intercept: function(x1, y1, x2, y2, x3, y3, x4, y4, d) { - var denom = ((y4-y3) * (x2-x1)) - ((x4-x3) * (y2-y1)); - if (denom != 0) { - var ua = (((x4-x3) * (y1-y3)) - ((y4-y3) * (x1-x3))) / denom; - if ((ua >= 0) && (ua <= 1)) { - var ub = (((x2-x1) * (y1-y3)) - ((y2-y1) * (x1-x3))) / denom; - if ((ub >= 0) && (ub <= 1)) { - var x = x1 + (ua * (x2-x1)); - var y = y1 + (ua * (y2-y1)); - return { x: x, y: y, d: d}; - } - } - } - return null; - }, - - ballIntercept: function(ball, rect, nx, ny) { - var pt; - if (nx < 0) { - pt = Game.Math.intercept(ball.x, ball.y, ball.x + nx, ball.y + ny, - rect.right + ball.radius, - rect.top - ball.radius, - rect.right + ball.radius, - rect.bottom + ball.radius, - "right"); - } - else if (nx > 0) { - pt = Game.Math.intercept(ball.x, ball.y, ball.x + nx, ball.y + ny, - rect.left - ball.radius, - rect.top - ball.radius, - rect.left - ball.radius, - rect.bottom + ball.radius, - "left"); - } - if (!pt) { - if (ny < 0) { - pt = Game.Math.intercept(ball.x, ball.y, ball.x + nx, ball.y + ny, - rect.left - ball.radius, - rect.bottom + ball.radius, - rect.right + ball.radius, - rect.bottom + ball.radius, - "bottom"); - } - else if (ny > 0) { - pt = Game.Math.intercept(ball.x, ball.y, ball.x + nx, ball.y + ny, - rect.left - ball.radius, - rect.top - ball.radius, - rect.right + ball.radius, - rect.top - ball.radius, - "top"); - } - } - return pt; - } - - }, - - //----------------------------------------------------------------------------- - - Runner: { - - initialize: function(id, game, cfg) { - this.cfg = Object.extend(game.Defaults || {}, cfg || {}); // use game defaults (if any) and extend with custom cfg (if any) - this.fps = this.cfg.fps || 60; - this.interval = 1000.0 / this.fps; - this.canvas = $(id); - this.bounds = this.canvas.getBoundingClientRect(); - this.width = this.cfg.width || this.canvas.offsetWidth; - this.height = this.cfg.height || this.canvas.offsetHeight; - this.front = this.canvas; - this.front.width = this.width; - this.front.height = this.height; - this.front2d = this.front.getContext('2d'); - this.addEvents(); - this.resetStats(); - this.resize(); - - this.game = Object.construct(game, this, this.cfg); // finally construct the game object itself - - if (this.cfg.state) - StateMachine.create(Object.extend({target: this.game}, this.cfg.state)); - - this.initCanvas(); - }, - - start: function() { // game instance should call runner.start() when its finished initializing and is ready to start the game loop - this.lastFrame = Game.timestamp(); - this.timer = setInterval(this.loop.bind(this), this.interval); - }, - - stop: function() { - clearInterval(this.timer); - }, - - loop: function() { - this._start = Game.timestamp(); this.update((this._start - this.lastFrame)/1000.0); // send dt as seconds - this._middle = Game.timestamp(); this.draw(); - this._end = Game.timestamp(); - this.updateStats(this._middle - this._start, this._end - this._middle); - this.lastFrame = this._start; - }, - - initCanvas: function() { - if (this.game && this.game.initCanvas) - this.game.initCanvas(this.front2d); - }, - - update: function(dt) { - this.game.update(dt); - }, - - draw: function() { - this.game.draw(this.front2d); - this.drawStats(this.front2d); - }, - - resetStats: function() { - this.stats = { - count: 0, - fps: 0, - update: 0, - draw: 0, - frame: 0 // update + draw - }; - }, - - updateStats: function(update, draw) { - if (this.cfg.stats) { - this.stats.update = Math.max(1, update); - this.stats.draw = Math.max(1, draw); - this.stats.frame = this.stats.update + this.stats.draw; - this.stats.count = this.stats.count == this.fps ? 0 : this.stats.count + 1; - this.stats.fps = Math.min(this.fps, 1000 / this.stats.frame); - } - }, - - strings: { - frame: "frame: ", - fps: "fps: ", - update: "update: ", - draw: "draw: ", - ms: "ms" - }, - - drawStats: function(ctx) { - if (this.cfg.stats) { - ctx.fillText(this.strings.frame + Math.round(this.stats.count), this.width - 100, this.height - 60); - ctx.fillText(this.strings.fps + Math.round(this.stats.fps), this.width - 100, this.height - 50); - ctx.fillText(this.strings.update + Math.round(this.stats.update) + this.strings.ms, this.width - 100, this.height - 40); - ctx.fillText(this.strings.draw + Math.round(this.stats.draw) + this.strings.ms, this.width - 100, this.height - 30); - } - }, - - addEvents: function() { - Game.addEvent(document, 'keydown', this.onkeydown.bind(this)); - Game.addEvent(document, 'keyup', this.onkeyup.bind(this)); - Game.addEvent(window, 'resize', this.onresize.bind(this)); - }, - - onresize: function() { - this.stop(); - if (this.onresizeTimer) - clearTimeout(this.onresizeTimer); - this.onresizeTimer = setTimeout(this.onresizeend.bind(this), 50); // dont fire resize event until 50ms after user has stopped resizing (avoid flickering) - }, - - onresizeend: function() { - this.resize(); - this.start(); - }, - - resize: function() { - if ((this.width != this.canvas.offsetWidth) || (this.height != this.front.offsetHeight)) { - // console.log("CANVAS RESIZED " + this.front.offsetWidth + ", " + this.front.offsetHeight); - this.width = this.front.width = this.front.offsetWidth; - this.height = this.front.height = this.front.offsetHeight; - if (this.game && this.game.onresize) - this.game.onresize(this.width, this.height); - this.initCanvas(); // when canvas is really resized, its state is reset so we need to re-initialize - } - }, - - onkeydown: function(ev) { - if (this.game.onkeydown) - return this.game.onkeydown(ev.keyCode); - else if (this.cfg.keys) - return this.onkey(ev.keyCode, 'down'); - }, - - onkeyup: function(ev) { - if (this.game.onkeyup) - return this.game.onkeyup(ev.keyCode); - else if (this.cfg.keys) - return this.onkey(ev.keyCode, 'up'); - }, - - onkey: function(keyCode, mode) { - var n, k, i, state = this.game.current; // avoid same key event triggering in 2 different states by remembering current state so that even if an earlier keyhandler changes state, the later keyhandler wont kick in. - for(n = 0 ; n < this.cfg.keys.length ; n++) { - k = this.cfg.keys[n]; - k.mode = k.mode || 'up'; - if ((k.key == keyCode) || (k.keys && (k.keys.indexOf(keyCode) >= 0))) { - if (!k.state || (k.state == state)) { - if (k.mode == mode) { - k.action.call(this.game); - } - } - } - } - }, - - storage: function() { - try { - return this.localStorage = this.localStorage || window.localStorage || {}; - } - catch(e) { // IE localStorage throws exceptions when using non-standard port (e.g. during development) - return this.localStorage = {}; - } - }, - - alert: function(msg) { - this.stop(); // alert blocks thread, so need to stop game loop in order to avoid sending huge dt values to next update - result = window.alert(msg); - this.start(); - return result; - }, - - confirm: function(msg) { - this.stop(); // alert blocks thread, so need to stop game loop in order to avoid sending huge dt values to next update - result = window.confirm(msg); - this.start(); - return result; - } - - //------------------------------------------------------------------------- - - } // Game.Runner -} // Game diff --git a/views/vibeOS/appfiles/breakout/images/down.png b/views/vibeOS/appfiles/breakout/images/down.png deleted file mode 100644 index 11de0639..00000000 Binary files a/views/vibeOS/appfiles/breakout/images/down.png and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/images/up.png b/views/vibeOS/appfiles/breakout/images/up.png deleted file mode 100644 index e04a732c..00000000 Binary files a/views/vibeOS/appfiles/breakout/images/up.png and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/index.html b/views/vibeOS/appfiles/breakout/index.html deleted file mode 100644 index 671e6c2d..00000000 --- a/views/vibeOS/appfiles/breakout/index.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - Javascript Breakout - - - - - - - - -
- -
- Sorry, this example cannot be run because your browser does not support the <canvas> element -
-
-
- - - level: -
-
- - -
- -
- - - - - - - - diff --git a/views/vibeOS/appfiles/breakout/levels.js b/views/vibeOS/appfiles/breakout/levels.js deleted file mode 100644 index 05457193..00000000 --- a/views/vibeOS/appfiles/breakout/levels.js +++ /dev/null @@ -1,271 +0,0 @@ -Breakout.Colors = { - - arkanoid: { - w: "#FCFCFC", // white - o: "#FC7460", // orange - l: "#3CBCFC", // light blue - g: "#80D010", // green - r: "#D82800", // red - b: "#0070EC", // blue - p: "#FC74B4", // pink - y: "#FC9838", // yellow - s: "#BCBCBC", // silver - d: "#F0BC3C" // gold - }, - - pastel: { - y: "#FFF7A5", // yellow - p: "#FFA5E0", // pink - b: "#A5B3FF", // blue - g: "#BFFFA5", // green - o: "#FFCBA5" // orange - }, - - vintage: { - a: "#EFD279", // yellow - b: "#95CBE9", // light blue - c: "#024769", // dark blue - d: "#AFD775", // light green - e: "#2C5700", // grass - f: "#DE9D7F", // red - g: "#7F9DDE", // purple - h: "#00572C", // dark green - i: "#75D7AF", // mint - j: "#694702", // brown - k: "#E9CB95", // peach - l: "#79D2EF" // blue - }, - - liquidplanner: { - a: '#62C4E7', // light blue - b: '#00A5DE', // dark blue - x: '#969699', // light gray - y: '#7B797E' // dark gray - }, - - -}; - -Breakout.Levels = [ - - { colors: Breakout.Colors.pastel, - bricks: [ - "", "", "", "", "", "", - "yyyyyYYYYYyyyyyYYYYYyyyyyYYYYY", - "pppppPPPPPpppppPPPPPpppppPPPPP", - "bbbbbBBBBBbbbbbBBBBBbbbbbBBBBB", - "gggggGGGGGgggggGGGGGgggggGGGGG", - "oooooOOOOOoooooOOOOOoooooOOOOO" - ] - }, - - { colors: Breakout.Colors.arkanoid, - bricks: [ - "", "", - " yy yy ", - " yy yy ", - " yy yy ", - " ssSSssSSss ", - " ssSSssSSss ", - " SSsswwsswwssSS ", - " SSsswwsswwssSS ", - " ssSSssSSssSSssSSss ", - " ssSSssSSssSSssSSss ", - " ss ssSSssSSss ss ", - " ss ss ss ss ", - " ss ss ss ss ", - " ss ss ", - " ss ss ", - ] - }, - - { colors: Breakout.Colors.arkanoid, - bricks: [ - "", - "oo", - "ooll", - "oollgg", - "oollggbb", - "oollggbbrr", - "oollggbbrroo", - "oollggbbrrooll", - "oollggbbrroollgg", - "oollggbbrroollggbb", - "oollggbbrroollggbbrr", - "oollggbbrroollggbbrroo", - "oollggbbrroollggbbrrooll", - "oollggbbrroollggbbrroollgg", - "oollggbbrroollggbbrroollggbb", - "ssSSssSSssSSssSSssSSssSSssSSrr" - ] - }, - - { colors: Breakout.Colors.arkanoid, - bricks: [ - "", "", - " ss ", - " bbBBssggGG ", - " BBbbWWwwWWGGgg ", - " bbBBwwWWwwWWwwggGG ", - " bbBBwwWWwwWWwwggGG ", - " bbBBwwWWwwWWwwggGG ", - " ss ss ss ss ss ", - " ss ", - " ss ", - " oo oo ", - " ooOOoo ", - " OO " - ] - }, - - { colors: Breakout.Colors.pastel, - bricks: [ - "", "", - " yyYYyyYYyyYY YYyyYYyyYYyy ", - " bbBBbbBBbbBB BBbbBBbbBBbb ", - " ggGGggGGggGG GGggGGggGGgg ", - " ooOOooOOooOO OOooOOooOOoo ", - "", "", - " yyYYyyYYyyYY YYyyYYyyYYyy ", - " bbBBbbBBbbBB BBbbBBbbBBbb ", - " ggGGggGGggGG GGggGGggGGgg ", - " ooOOooOOooOO OOooOOooOOoo ", - "", "", - " yyYYyyYYyyYY YYyyYYyyYYyy ", - " bbBBbbBBbbBB BBbbBBbbBBbb ", - " ggGGggGGggGG GGggGGggGGgg ", - " ooOOooOOooOO OOooOOooOOoo " - ] - }, - - { colors: Breakout.Colors.vintage, - bricks: [ - "", "", "", - " AAaaAAaaAAaaAAaaAAaaAAaa ", - " BBbbBBbbBBbbBBbbBBbbBB ", - " CCccCCccCCccCCccCCcc ", - " DDddDDddDDddDDddDD ", - " EEeeEEeeEEeeEEee ", - " FFffFFffFFffFF ", - " GGggGGggGGgg ", - " HHhhHHhhHH ", - " IIiiIIii ", - " JJjjJJ ", - " KKkk ", - " LL " - ] - }, - - { colors: Breakout.Colors.vintage, - bricks: [ - "", "", - " aabbccddeeffggFFEEDDCCBBAA ", - " aabbccddeeffFFEEDDCCBBAA ", - " aabbccddeeffEEDDCCBBAA ", - " aabbccddeeEEDDCCBBAA ", - " aabbccddeeDDCCBBAA ", - " aabbccddDDCCBBAA ", - " aabbccddCCBBAA ", - " aabbccCCBBAA ", - " aabbccBBAA ", - " hh aabbCCAA hh ", - " hhHH aabbAA hhHH ", - " hhiiHH aaAA hhiiHH ", - " hhiiIIHH aa hhiiIIHH ", - " hhiijjIIHH hhiijjIIHH ", - " hhiijjJJIIHH hhiijjJJIIHH " - ] - }, - - { colors: Breakout.Colors.pastel, - bricks: [ - " ", - " ", - " bbBBbbBBbbBBbbBBbbBBbbBBbb ", - " ooggGGggGGggGGggGGggGGggoo ", - " ooggGGggGGggGGggGGggGGggoo ", - " ooppPPppPPppPPppPPppPPppoo ", - " ooppPPppPPppBBppPPppPPppoo ", - " ooppPPppPPbbBBbbPPppPPppoo ", - " ooppPPppBBbbOObbBBppPPppoo ", - " ooppPPbbBBooOOooBBbbPPppoo ", - " ooppBBbbOOooYYooOObbBBppoo ", - " oobbBBOOooyyYYyyooOOBBbboo ", - " oobbooOOYYyyYYyyYYOOoobboo ", - " ooOOooyyYYyyYYyyYYyyooOOoo ", - " ooOOYYyyYYyyYYyyYYyyYYOOoo ", - " ooyyYYyyYYyyYYyyYYyyYYyyoo ", - " ooyyYYyyYYyyYYyyYYyyYYyyoo ", - " bbBBbbBBbbBBbbBBbbBBbbBBbb " - ] - }, - - { colors: { - b: '#111111', // black, - w: '#EEEEEE', // white, - c: '#EC7150', // cherry, - s: '#B33A2F' // shadow, - }, - - bricks: [ - "", - " bBb ", - " BcCcB ", - " bCwCcsb b ", - " bCcCcsb b ", - " BcCsB B ", - " BbBsSsBbB bBb ", - " bcCcbBbcCcb BcCcB ", - " bcwcCsbcwcCsb bCwCcsb b ", - " bcCcCsbcCcCsb bCcCcsb b ", - " bcCcsSbcCcsSb BcCsB B ", - " bsSsb bsSsb BbBsSsBbB ", - " bBb bBb bcCcbBbcCcb ", - " bcwcCsbcwcCsb ", - " bcCcCsbcCcCsb ", - " bcCcsSbcCcsSb ", - " bsSsb bsSsb ", - " bBb bBb ", - " ", - " ", - " ", - " ", - ] - }, - - { colors: { - r: '#D80000', // red - b: '#706800', // brown - o: '#F8AB00', // orange - f: '#F83800', // fire - w: '#FFFFFF', // white - e: '#FFE0A8' // beige - }, - - bricks: [ - "", - " rRrRr ", - " RrRrRrRrR ", - " BbBoObo ", - " boboOoboOo F f f ", - " bobBoOoboOo f e ", - " bBoOoObBbB F f e ", - " oOoOoOo Ff E ", - " bBrbBb E f fF F f ", - " bBbrbBrbBb FfFfFf F ", - " bBbBrRrRbBbB fFeFeFfFf ", - " oObrorRorboO FfEeEeEfF ", - " oOorRrRrRoOo FeEeWwEeFf ", - " oOrRrRrRrRoO fFeFwWfEeFf ", - " rRr RrR fFeFwWfEeFf ", - " bBb bBb fFeEwWeEeFf ", - " bBbB bBbB fFfEeEeEfF ", - " FfFfFfFfF ", - " FfFfF " - ] - } - - -]; - - diff --git a/views/vibeOS/appfiles/breakout/sound/breakout/brick.mp3 b/views/vibeOS/appfiles/breakout/sound/breakout/brick.mp3 deleted file mode 100644 index 33a343e7..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/breakout/brick.mp3 and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/breakout/gameover.mp3 b/views/vibeOS/appfiles/breakout/sound/breakout/gameover.mp3 deleted file mode 100644 index b5effa8b..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/breakout/gameover.mp3 and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/breakout/go.mp3 b/views/vibeOS/appfiles/breakout/sound/breakout/go.mp3 deleted file mode 100644 index 4ead930f..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/breakout/go.mp3 and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/breakout/levelup.mp3 b/views/vibeOS/appfiles/breakout/sound/breakout/levelup.mp3 deleted file mode 100644 index 666b1287..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/breakout/levelup.mp3 and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/breakout/loselife.mp3 b/views/vibeOS/appfiles/breakout/sound/breakout/loselife.mp3 deleted file mode 100644 index 9eba8cc8..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/breakout/loselife.mp3 and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/breakout/paddle.mp3 b/views/vibeOS/appfiles/breakout/sound/breakout/paddle.mp3 deleted file mode 100644 index 255bcd20..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/breakout/paddle.mp3 and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/license.txt b/views/vibeOS/appfiles/breakout/sound/license.txt deleted file mode 100644 index 4aebf4cf..00000000 --- a/views/vibeOS/appfiles/breakout/sound/license.txt +++ /dev/null @@ -1,29 +0,0 @@ -Software License Agreement (BSD License) - -Copyright (c) 2007, Scott Schiller (schillmania.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, this - list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. - -* Neither the name of schillmania.com nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission from schillmania.com. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/views/vibeOS/appfiles/breakout/sound/soundmanager2-jsmin.js b/views/vibeOS/appfiles/breakout/sound/soundmanager2-jsmin.js deleted file mode 100644 index 429911c7..00000000 --- a/views/vibeOS/appfiles/breakout/sound/soundmanager2-jsmin.js +++ /dev/null @@ -1,100 +0,0 @@ -/** @license* @license - - SoundManager 2: JavaScript Sound for the Web - ---------------------------------------------- - http://schillmania.com/projects/soundmanager2/ - - Copyright (c) 2007, Scott Schiller. All rights reserved. - Code provided under the BSD License: - http://schillmania.com/projects/soundmanager2/license.txt - - V2.97a.20110424 -*/ -(function(R){function S(S,da){function l(c){return function(a){return!this._t||!this._t._a?(this._t&&this._t.sID?b._wD(k+"ignoring "+a.type+": "+this._t.sID):b._wD(k+"ignoring "+a.type),null):c.call(this,a)}}function wa(){if(b.debugURLParam.test(D))b.debugMode=!0;if(r(b.debugID))return!1;var c,a,e,f;if(b.debugMode&&!r(b.debugID)&&(!ea||!b.useConsole||b.useConsole&&ea&&!b.consoleOnly)){c=g.createElement("div");c.id=b.debugID+"-toggle";a={position:"fixed",bottom:"0px",right:"0px",width:"1.2em",height:"1.2em", -lineHeight:"1.2em",margin:"2px",textAlign:"center",border:"1px solid #999",cursor:"pointer",background:"#fff",color:"#333",zIndex:10001};c.appendChild(g.createTextNode("-"));c.onclick=xa;c.title="Toggle SM2 debug console";if(s.match(/msie 6/i))c.style.position="absolute",c.style.cursor="hand";for(f in a)a.hasOwnProperty(f)&&(c.style[f]=a[f]);a=g.createElement("div");a.id=b.debugID;a.style.display=b.debugMode?"block":"none";if(b.debugMode&&!r(c.id)){try{e=T(),e.appendChild(c)}catch(d){throw Error(o("appXHTML")); -}e.appendChild(a)}}}this.flashVersion=8;this.debugMode=!0;this.debugFlash=!1;this.useConsole=!0;this.waitForWindowLoad=this.consoleOnly=!1;this.nullURL="about:blank";this.allowPolling=!0;this.useFastPolling=!1;this.useMovieStar=!0;this.bgColor="#ffffff";this.useHighPerformance=!1;this.flashPollingInterval=null;this.flashLoadTimeout=1E3;this.wmode=null;this.allowScriptAccess="always";this.useHTML5Audio=this.useFlashBlock=!1;this.html5Test=/^probably$/i;this.useGlobalHTML5Audio=!0;this.requireFlash= -!1;this.audioFormats={mp3:{type:['audio/mpeg; codecs="mp3"',"audio/mpeg","audio/mp3","audio/MPA","audio/mpa-robust"],required:!0},mp4:{related:["aac","m4a"],type:['audio/mp4; codecs="mp4a.40.2"',"audio/aac","audio/x-m4a","audio/MP4A-LATM","audio/mpeg4-generic"],required:!0},ogg:{type:["audio/ogg; codecs=vorbis"],required:!1},wav:{type:['audio/wav; codecs="1"',"audio/wav","audio/wave","audio/x-wav"],required:!1}};this.defaultOptions={autoLoad:!1,stream:!0,autoPlay:!1,loops:1,onid3:null,onload:null, -whileloading:null,onplay:null,onpause:null,onresume:null,whileplaying:null,onstop:null,onfailure:null,onfinish:null,onbeforefinish:null,onbeforefinishtime:5E3,onbeforefinishcomplete:null,onjustbeforefinish:null,onjustbeforefinishtime:200,multiShot:!0,multiShotEvents:!1,position:null,pan:0,type:null,usePolicyFile:!1,volume:100};this.flash9Options={isMovieStar:null,usePeakData:!1,useWaveformData:!1,useEQData:!1,onbufferchange:null,ondataerror:null};this.movieStarOptions={bufferTime:3,serverURL:null, -onconnect:null,duration:null};this.version=null;this.versionNumber="V2.97a.20110424";this.movieURL=null;this.url=S||null;this.altURL=null;this.enabled=this.swfLoaded=!1;this.o=null;this.movieID="sm2-container";this.id=da||"sm2movie";this.swfCSS={swfBox:"sm2-object-box",swfDefault:"movieContainer",swfError:"swf_error",swfTimedout:"swf_timedout",swfLoaded:"swf_loaded",swfUnblocked:"swf_unblocked",sm2Debug:"sm2_debug",highPerf:"high_performance",flashDebug:"flash_debug"};this.oMC=null;this.sounds={}; -this.soundIDs=[];this.muted=!1;this.debugID="soundmanager-debug";this.debugURLParam=/([#?&])debug=1/i;this.didFlashBlock=this.specialWmodeCase=!1;this.filePattern=null;this.filePatterns={flash8:/\.mp3(\?.*)?$/i,flash9:/\.mp3(\?.*)?$/i};this.baseMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamMimeTypes=/^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i;this.netStreamTypes=["aac","flv","mov","mp4","m4v","f4v","m4a","mp4v","3gp","3g2"];this.netStreamPattern=RegExp("\\.("+this.netStreamTypes.join("|")+ -")(\\?.*)?$","i");this.mimePattern=this.baseMimeTypes;this.features={buffering:!1,peakData:!1,waveformData:!1,eqData:!1,movieStar:!1};this.sandbox={type:null,types:{remote:"remote (domain-based) rules",localWithFile:"local with file access (no internet access)",localWithNetwork:"local with network (internet access only, no local access)",localTrusted:"local, trusted (local+internet access)"},description:null,noRemote:null,noLocal:null};this.hasHTML5=null;this.html5={usingFlash:null};this.ignoreFlash= -!1;var fa,b=this,k="HTML5::",r,s=navigator.userAgent,h=R,D=h.location.href.toString(),i=this.flashVersion,g=document,ga,U,y=[],ha=!0,v,E=!1,K=!1,m=!1,w=!1,ia=!1,j,La=0,L,t,ja,A,F,ka,V,ya,la,B,za,W,M,G,ma,T,X,na,Aa,Ma=["log","info","warn","error"],Ba,Y,Ca,N=null,oa=null,o,pa,H,xa,Z,$,qa,p,aa=!1,ra=!1,Da,Ea,C=null,Fa,ba,u=!1,O,z,sa,Ga,q,Ha=Array.prototype.slice,P=!1,ca,I,Ia,Ja=s.match(/pre\//i),Na=s.match(/(ipad|iphone|ipod)/i);s.match(/mobile/i);var x=s.match(/msie/i),Oa=s.match(/webkit/i),Q=s.match(/safari/i)&& -!s.match(/chrome/i),Pa=s.match(/opera/i),ta=!D.match(/usehtml5audio/i)&&!D.match(/sm2\-ignorebadua/i)&&Q&&s.match(/OS X 10_6_([3-9])/i),ea=typeof console!=="undefined"&&typeof console.log!=="undefined",ua=typeof g.hasFocus!=="undefined"?g.hasFocus():null,J=typeof g.hasFocus==="undefined"&&Q,Ka=!J;this._use_maybe=D.match(/sm2\-useHTML5Maybe\=1/i);this._overHTTP=g.location?g.location.protocol.match(/http/i):null;this._http=!this._overHTTP?"http:":"";this.useAltURL=!this._overHTTP;this._global_a=null; -if(Na||Ja)b.useHTML5Audio=!0,b.ignoreFlash=!0,b.useGlobalHTML5Audio&&(P=!0);if(Ja||this._use_maybe)b.html5Test=/^(probably|maybe)$/i;(function(){var c=D,a=null;if(c.indexOf("#sm2-usehtml5audio=")!==-1)a=c.charAt(c.indexOf("#sm2-usehtml5audio=")+19)==="1",typeof console!=="undefined"&&typeof console.log!=="undefined"&&console.log((a?"Enabling ":"Disabling ")+"useHTML5Audio via URL parameter"),b.useHTML5Audio=a})();this.supported=this.ok=function(){return C?m&&!w:b.useHTML5Audio&&b.hasHTML5};this.getMovie= -function(b){return x?h[b]:Q?r(b)||g[b]:r(b)};this.createSound=function(c){function a(){e=Z(e);b.sounds[d.id]=new fa(d);b.soundIDs.push(d.id);return b.sounds[d.id]}var e=null,f=null,d=null;if(!m||!b.ok())return qa("soundManager.createSound(): "+o(!m?"notReady":"notOK")),!1;arguments.length===2&&(c={id:arguments[0],url:arguments[1]});d=e=t(c);d.id.toString().charAt(0).match(/^[0-9]$/)&&b._wD("soundManager.createSound(): "+o("badID",d.id),2);b._wD("soundManager.createSound(): "+d.id+" ("+d.url+")",1); -if(p(d.id,!0))return b._wD("soundManager.createSound(): "+d.id+" exists",1),b.sounds[d.id];if(ba(d))f=a(),b._wD("Loading sound "+d.id+" via HTML5"),f._setup_html5(d);else{if(i>8&&b.useMovieStar){if(d.isMovieStar===null)d.isMovieStar=d.serverURL||d.type&&d.type.match(b.netStreamPattern)||d.url.match(b.netStreamPattern)?!0:!1;d.isMovieStar&&b._wD("soundManager.createSound(): using MovieStar handling");if(d.isMovieStar){if(d.usePeakData)j("noPeak"),d.usePeakData=!1;d.loops>1&&j("noNSLoop")}}d=$(d,"soundManager.createSound(): "); -f=a();if(i===8)b.o._createSound(d.id,d.onjustbeforefinishtime,d.loops||1,d.usePolicyFile);else if(b.o._createSound(d.id,d.url,d.onjustbeforefinishtime,d.usePeakData,d.useWaveformData,d.useEQData,d.isMovieStar,d.isMovieStar?d.bufferTime:!1,d.loops||1,d.serverURL,d.duration||null,d.autoPlay,!0,d.autoLoad,d.usePolicyFile),!d.serverURL)f.connected=!0,d.onconnect&&d.onconnect.apply(f);(d.autoLoad||d.autoPlay)&&!d.serverURL&&f.load(d)}d.autoPlay&&!d.serverURL&&f.play();return f};this.destroySound=function(c, -a){if(!p(c))return!1;var e=b.sounds[c],f;e._iO={};e.stop();e.unload();for(f=0;f=2)d.style.fontWeight="bold";if(a===3)d.style.color="#ff3333"}f.insertBefore(d,f.firstChild)}catch(n){}return!0};this._debug= -function(){j("currentObj",1);for(var c=0,a=b.soundIDs.length;c1){f=[];e=e.length;for(a=0;a0)b._wD('SMSound.play(): "'+a.sID+'" is resuming from paused state',1),a.resume();else{b._wD('SMSound.play(): "'+ -a.sID+'" is starting to play');a.playState=1;a.paused=!1;(!a.instanceCount||a._iO.multiShotEvents||i>8&&!a.isHTML5&&!a.getAutoPlay())&&a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;if(!a.isHTML5)a._iO=$(Z(a._iO));if(a._iO.onplay&&e)a._iO.onplay.apply(a),a._onplay_called=!0;a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?(d(),a._setup_html5().play()):b.o._start(a.sID,a._iO.loops||1,i===9?a.position:a.position/1E3)}return a}; -this.stop=function(c){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=!1;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(a._a)a.setPosition(0),a._a.pause(),a.playState=0,a._onTimer(),f(),a.unload()}else b.o._stop(a.sID,c),a._iO.serverURL&&a.unload();a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(c){b._wD("sound "+a.sID+" turned autoplay "+(c?"on":"off"));a._iO.autoPlay=c;a.isHTML5?a._a&&c&&a.play():b.o._setAutoPlay(a.sID,c);c&& -!a.instanceCount&&a.readyState===1&&(a.instanceCount++,b._wD("sound "+a.sID+" incremented instance count to "+a.instanceCount))};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(c){c===void 0&&(c=0);var d=a.isHTML5?Math.max(c,0):Math.min(a.duration||a._iO.duration,Math.max(c,0));a.position=d;c=a.position/1E3;a.resetOnPosition(a.position);a._iO.position=d;if(a.isHTML5){if(a._a)if(a._html5_canplay){if(a._a.currentTime!==c){b._wD("setPosition("+c+"): setting position");try{a._a.currentTime= -c}catch(e){b._wD("setPosition("+c+"): setting position failed: "+e.message,2)}}}else b._wD("setPosition("+c+"): delaying, sound not ready")}else c=i===9?a.position:c,a.readyState&&a.readyState!==2&&b.o._setPosition(a.sID,c,a.paused||!a.playState);a.isHTML5&&a.paused&&a._onTimer(!0);return a};this.pause=function(c){if(a.paused||a.playState===0&&a.readyState!==1)return a;b._wD("SMSound.pause()");a.paused=!0;a.isHTML5?(a._setup_html5().pause(),f()):(c||c===void 0)&&b.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a); -return a};this.resume=function(){if(!a.paused)return a;b._wD("SMSound.resume()");a.paused=!1;a.playState=1;a.isHTML5?(a._setup_html5().play(),d()):(a._iO.isMovieStar&&a.setPosition(a.position),b.o._pause(a.sID));!a._onplay_called&&a._iO.onplay?(a._iO.onplay.apply(a),a._onplay_called=!0):a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){b._wD("SMSound.togglePause()");if(a.playState===0)return a.play({position:i===9&&!a.isHTML5?a.position:a.position/1E3}),a;a.paused?a.resume(): -a.pause();return a};this.setPan=function(c,d){typeof c==="undefined"&&(c=0);typeof d==="undefined"&&(d=!1);a.isHTML5||b.o._setPan(a.sID,c);a._iO.pan=c;if(!d)a.pan=c,a.options.pan=c;return a};this.setVolume=function(c,d){typeof c==="undefined"&&(c=100);typeof d==="undefined"&&(d=!1);if(a.isHTML5){if(a._a)a._a.volume=Math.max(0,Math.min(1,c/100))}else b.o._setVolume(a.sID,b.muted&&!a.muted||a.muted?0:c);a._iO.volume=c;if(!d)a.volume=c,a.options.volume=c;return a};this.mute=function(){a.muted=!0;if(a.isHTML5){if(a._a)a._a.muted= -!0}else b.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=!1;var c=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(a._a)a._a.muted=!1}else b.o._setVolume(a.sID,c?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=function(b,c,d){a._onPositionItems.push({position:b,method:c,scope:typeof d!=="undefined"?d:a,fired:!1});return a};this.processOnPosition=function(){var c,d;c=a._onPositionItems.length;if(!c||!a.playState|| -a._onPositionFired>=c)return!1;for(;c--;)if(d=a._onPositionItems[c],!d.fired&&a.position>=d.position)d.method.apply(d.scope,[d.position]),d.fired=!0,b._onPositionFired++;return!0};this.resetOnPosition=function(c){var d,e;d=a._onPositionItems.length;if(!d)return!1;for(;d--;)if(e=a._onPositionItems[d],e.fired&&c<=e.position)e.fired=!1,b._onPositionFired--;return!0};this._onTimer=function(c){var d={};if(a._hasTimer||c)return a._a&&(c||(a.playState>0||a.readyState===1)&&!a.paused)?(a.duration=a._get_html5_duration(), -a.durationEstimate=a.duration,c=a._a.currentTime?a._a.currentTime*1E3:0,a._whileplaying(c,d,d,d,d),!0):(b._wD('_onTimer: Warn for "'+a.sID+'": '+(!a._a?"Could not find element. ":"")+(a.playState===0?"playState bad, 0?":"playState = "+a.playState+", OK")),!1)};this._get_html5_duration=function(){var b=a._a?a._a.duration*1E3:a._iO?a._iO.duration:void 0;return b&&!isNaN(b)&&b!==Infinity?b:a._iO?a._iO.duration:null};d=function(){a.isHTML5&&Da(a)};f=function(){a.isHTML5&&Ea(a)};e=function(){a._onPositionItems= -[];a._onPositionFired=0;a._hasTimer=null;a._onplay_called=!1;a._a=null;a._html5_canplay=!1;a.bytesLoaded=null;a.bytesTotal=null;a.position=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.failures=0;a.loaded=!1;a.playState=0;a.paused=!1;a.readyState=0;a.muted=!1;a.didBeforeFinish=!1;a.didJustBeforeFinish=!1;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.eqData=[];a.eqData.left=[];a.eqData.right= -[]};e();this._setup_html5=function(c){var c=t(a._iO,c),d=P?b._global_a:a._a,f=decodeURI(c.url),g=d&&d._t?d._t.instanceOptions:null;if(d){if(d._t&&g.url===c.url&&(!a._lastURL||a._lastURL===g.url))return d;b._wD("setting new URL on existing object: "+f+(a._lastURL?", old URL: "+a._lastURL:""));P&&d._t&&d._t.playState&&c.url!==g.url&&d._t.stop();e();d.src=c.url;a.url=c.url;a._lastURL=c.url;d._called_load=!1}else if(b._wD("creating HTML5 Audio() element with URL: "+f),d=new Audio(c.url),d._called_load= -!1,P)b._global_a=d;a.isHTML5=!0;a._a=d;d._t=a;a._add_html5_events();d.loop=c.loops>1?"loop":"";c.autoLoad||c.autoPlay?(d.autobuffer="auto",d.preload="auto",a.load(),d._called_load=!0):(d.autobuffer=!1,d.preload="none");d.loop=c.loops>1?"loop":"";return d};this._add_html5_events=function(){if(a._a._added_events)return!1;var c;b._wD(k+"adding event listeners: "+a.sID);a._a._added_events=!0;for(c in b._html5_events)b._html5_events.hasOwnProperty(c)&&a._a&&a._a.addEventListener(c,b._html5_events[c],!1); -return!0};this._remove_html5_events=function(){b._wD(k+"removing event listeners: "+a.sID);a._a._added_events=!1;for(var c in b._html5_events)b._html5_events.hasOwnProperty(c)&&a._a&&a._a.removeEventListener(c,b._html5_events[c],!1)};this._whileloading=function(b,c,d,e){a.bytesLoaded=b;a.bytesTotal=c;a.duration=Math.floor(d);a.bufferLength=e;if(a._iO.isMovieStar)a.durationEstimate=a.duration;else if(a.durationEstimate=a._iO.duration?a.duration>a._iO.duration?a.duration:a._iO.duration:parseInt(a.bytesTotal/ -a.bytesLoaded*a.duration,10),a.durationEstimate===void 0)a.durationEstimate=a.duration;a.readyState!==3&&a._iO.whileloading&&a._iO.whileloading.apply(a)};this._onid3=function(c,d){b._wD('SMSound._onid3(): "'+this.sID+'" ID3 data received.');var e=[],f,g;f=0;for(g=c.length;f0&&(c=0);a.position=c;a.processOnPosition();if(i>8&&!a.isHTML5){if(a._iO.usePeakData&& -typeof d!=="undefined"&&d)a.peakData={left:d.leftPeak,right:d.rightPeak};if(a._iO.useWaveformData&&typeof e!=="undefined"&&e)a.waveformData={left:e.split(","),right:f.split(",")};if(a._iO.useEQData&&typeof g!=="undefined"&&g&&g.leftEQ&&(c=g.leftEQ.split(","),a.eqData=c,a.eqData.left=c,typeof g.rightEQ!=="undefined"&&g.rightEQ))a.eqData.right=g.rightEQ.split(",")}a.playState===1&&(!a.isHTML5&&b.flashVersion===8&&!a.position&&a.isBuffering&&a._onbufferchange(0),a._iO.whileplaying&&a._iO.whileplaying.apply(a), -(a.loaded||!a.loaded&&a._iO.isMovieStar)&&a._iO.onbeforefinish&&a._iO.onbeforefinishtime&&!a.didBeforeFinish&&a.duration-a.position<=a._iO.onbeforefinishtime&&a._onbeforefinish());return!0};this._onconnect=function(c){c=c===1;b._wD('SMSound._onconnect(): "'+a.sID+'"'+(c?" connected.":" failed to connect? - "+a.url),c?1:2);if(a.connected=c)a.failures=0,p(a.sID)&&(a.getAutoPlay()?a.play(void 0,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[c])};this._onload=function(c){c= -c?!0:!1;b._wD('SMSound._onload(): "'+a.sID+'"'+(c?" loaded.":" failed to load? - "+a.url),c?1:2);!c&&!a.isHTML5&&(b.sandbox.noRemote===!0&&b._wD("SMSound._onload(): "+o("noNet"),1),b.sandbox.noLocal===!0&&b._wD("SMSound._onload(): "+o("noLocal"),1));a.loaded=c;a.readyState=c?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a,[c]);return!0};this._onfailure=function(c,d,e){a.failures++;b._wD('SMSound._onfailure(): "'+a.sID+'" count '+a.failures);if(a._iO.onfailure&&a.failures===1)a._iO.onfailure(a, -c,d,e);else b._wD("SMSound._onfailure(): ignoring")};this._onbeforefinish=function(){if(!a.didBeforeFinish)a.didBeforeFinish=!0,a._iO.onbeforefinish&&(b._wD('SMSound._onbeforefinish(): "'+a.sID+'"'),a._iO.onbeforefinish.apply(a))};this._onjustbeforefinish=function(){if(!a.didJustBeforeFinish)a.didJustBeforeFinish=!0,a._iO.onjustbeforefinish&&(b._wD('SMSound._onjustbeforefinish(): "'+a.sID+'"'),a._iO.onjustbeforefinish.apply(a))};this._onfinish=function(){var c=a._iO.onfinish;a._onbufferchange(0); -a.resetOnPosition(0);a._iO.onbeforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBeforeFinish=!1;a.didJustBeforeFinish=!1;if(a.instanceCount){a.instanceCount--;if(!a.instanceCount)a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},f();if((!a.instanceCount||a._iO.multiShotEvents)&&c)b._wD('SMSound._onfinish(): "'+a.sID+'"'),c.apply(a)}};this._onbufferchange=function(c){if(a.playState===0)return!1;if(c&&a.isBuffering||!c&&!a.isBuffering)return!1;a.isBuffering=c=== -1;a._iO.onbufferchange&&(b._wD("SMSound._onbufferchange(): "+c),a._iO.onbufferchange.apply(a));return!0};this._ondataerror=function(c){a.playState>0&&(b._wD("SMSound._ondataerror(): "+c),a._iO.ondataerror&&a._iO.ondataerror.apply(a))}};T=function(){return g.body?g.body:g._docElement?g.documentElement:g.getElementsByTagName("div")[0]};r=function(b){return g.getElementById(b)};t=function(c,a){var e={},f,d;for(f in c)c.hasOwnProperty(f)&&(e[f]=c[f]);f=typeof a==="undefined"?b.defaultOptions:a;for(d in f)f.hasOwnProperty(d)&& -typeof e[d]==="undefined"&&(e[d]=f[d]);return e};q=function(){function b(a){var a=Ha.call(a),c=a.length;e?(a[1]="on"+a[1],c>3&&a.pop()):c===3&&a.push(!1);return a}function a(a,b){var c=a.shift(),g=[f[b]];if(e)c[g](a[0],a[1]);else c[g].apply(c,a)}var e=h.attachEvent,f={add:e?"attachEvent":"addEventListener",remove:e?"detachEvent":"removeEventListener"};return{add:function(){a(b(arguments),"add")},remove:function(){a(b(arguments),"remove")}}}();ba=function(b){return!b.serverURL&&(b.type?O({type:b.type}): -O(b.url)||u)};O=function(c){if(!b.useHTML5Audio||!b.hasHTML5)return!1;var a,e=b.audioFormats;if(!z){z=[];for(a in e)e.hasOwnProperty(a)&&(z.push(a),e[a].related&&(z=z.concat(e[a].related)));z=RegExp("\\.("+z.join("|")+")","i")}a=typeof c.type!=="undefined"?c.type:null;c=typeof c==="string"?c.toLowerCase().match(z):null;if(!c||!c.length)if(a)c=a.indexOf(";"),c=(c!==-1?a.substr(0,c):a).substr(6);else return!1;else c=c[0].substr(1);if(c&&typeof b.html5[c]!=="undefined")return b.html5[c];else{if(!a)if(c&& -b.html5[c])return b.html5[c];else a="audio/"+c;a=b.html5.canPlayType(a);return b.html5[c]=a}};Ga=function(){function c(c){var d,e,f=!1;if(!a||typeof a.canPlayType!=="function")return!1;if(c instanceof Array){d=0;for(e=c.length;d1&&b.stream)j("as2loop"),b.stream=!1;return b};$=function(c,a){if(c&&!c.usePolicyFile&&(c.onid3||c.usePeakData||c.useWaveformData||c.useEQData))b._wD((a?a+":":"")+o("policy")),c.usePolicyFile=!0;return c};qa=function(c){typeof console!=="undefined"&&typeof console.warn!=="undefined"?console.warn(c):b._wD(c)};ga=function(){return!1}; -Ba=function(b){for(var a in b)b.hasOwnProperty(a)&&typeof b[a]==="function"&&(b[a]=ga)};Y=function(c){typeof c==="undefined"&&(c=!1);if(w||c)j("smFail",2),b.disable(c)};Ca=function(c){var a=null;if(c)if(c.match(/\.swf(\?.*)?$/i)){if(a=c.substr(c.toLowerCase().lastIndexOf(".swf?")+4))return c}else c.lastIndexOf("/")!==c.length-1&&(c+="/");return(c&&c.lastIndexOf("/")!==-1?c.substr(0,c.lastIndexOf("/")+1):"./")+b.movieURL};la=function(){if(i!==8&&i!==9)b._wD(o("badFV",i,8)),b.flashVersion=8;var c=b.debugMode|| -b.debugFlash?"_debug.swf":".swf";if(b.useHTML5Audio&&!u&&b.audioFormats.mp4.required&&b.flashVersion<9)b._wD(o("needfl9")),b.flashVersion=9;i=b.flashVersion;b.version=b.versionNumber+(u?" (HTML5-only mode)":i===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(i>8)b.defaultOptions=t(b.defaultOptions,b.flash9Options),b.features.buffering=!0;i>8&&b.useMovieStar?(b.defaultOptions=t(b.defaultOptions,b.movieStarOptions),b.filePatterns.flash9=RegExp("\\.(mp3|"+b.netStreamTypes.join("|")+")(\\?.*)?$","i"),b.mimePattern= -b.netStreamMimeTypes,b.features.movieStar=!0):(b.useMovieStar=!1,b.features.movieStar=!1);b.filePattern=b.filePatterns[i!==8?"flash9":"flash8"];b.movieURL=(i===8?"soundmanager2.swf":"soundmanager2_flash9.swf").replace(".swf",c);b.features.peakData=b.features.waveformData=b.features.eqData=i>8};Aa=function(c,a){if(!b.o||!b.allowPolling)return!1;b.o._setPolling(c,a)};X=function(c,a){function e(){b._wD("-- SoundManager 2 "+b.version+(!u&&b.useHTML5Audio?b.hasHTML5?" + HTML5 audio":", no HTML5 audio support": -"")+(!u?(b.useMovieStar?", MovieStar mode":"")+(b.useHighPerformance?", high performance mode, ":", ")+((b.flashPollingInterval?"custom ("+b.flashPollingInterval+"ms)":b.useFastPolling?"fast":"normal")+" polling")+(b.wmode?", wmode: "+b.wmode:"")+(b.debugFlash?", flash debug mode":"")+(b.useFlashBlock?", flashBlock mode":""):"")+" --",1)}var f=a?a:b.url,d=b.altURL?b.altURL:f,n;n=T();var h,k,i=H(),l,m=null,m=(m=g.getElementsByTagName("html")[0])&&m.dir&&m.dir.match(/rtl/i),c=typeof c==="undefined"? -b.id:c;if(E&&K)return!1;if(u)return la(),e(),b.oMC=r(b.movieID),U(),K=E=!0,!1;E=!0;la();b.url=Ca(b._overHTTP?f:d);a=b.url;b.wmode=!b.wmode&&b.useHighPerformance&&!b.useMovieStar?"transparent":b.wmode;if(b.wmode!==null&&(s.match(/msie 8/i)||!x&&!b.useHighPerformance)&&navigator.platform.match(/win32|win64/i))b.specialWmodeCase=!0,j("spcWmode"),b.wmode=null;n={name:c,id:c,src:a,width:"100%",height:"100%",quality:"high",allowScriptAccess:b.allowScriptAccess,bgcolor:b.bgColor,pluginspage:b._http+"//www.macromedia.com/go/getflashplayer", -type:"application/x-shockwave-flash",wmode:b.wmode,hasPriority:"true"};if(b.debugFlash)n.FlashVars="debug=1";b.wmode||delete n.wmode;if(x)f=g.createElement("div"),k=''+(b.wmode?' ':"")+''+(b.debugFlash?'':"")+"";else for(h in f=g.createElement("embed"),n)n.hasOwnProperty(h)&&f.setAttribute(h,n[h]);wa();i=H();if(n=T())if(b.oMC=r(b.movieID)?r(b.movieID):g.createElement("div"),b.oMC.id){l=b.oMC.className;b.oMC.className=(l?l+" ":b.swfCSS.swfDefault)+(i?" "+i:"");b.oMC.appendChild(f); -if(x)h=b.oMC.appendChild(g.createElement("div")),h.className=b.swfCSS.swfBox,h.innerHTML=k;K=!0}else{b.oMC.id=b.movieID;b.oMC.className=b.swfCSS.swfDefault+" "+i;h=i=null;if(!b.useFlashBlock)if(b.useHighPerformance)i={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"};else if(i={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},m)i.left=Math.abs(parseInt(i.left,10))+"px";if(Oa)b.oMC.style.zIndex=1E4;if(!b.debugFlash)for(l in i)i.hasOwnProperty(l)&& -(b.oMC.style[l]=i[l]);try{x||b.oMC.appendChild(f);n.appendChild(b.oMC);if(x)h=b.oMC.appendChild(g.createElement("div")),h.className=b.swfCSS.swfBox,h.innerHTML=k;K=!0}catch(p){throw Error(o("appXHTML"));}}e();b._wD("soundManager::createMovie(): Trying to load "+a+(!b._overHTTP&&b.altURL?" (alternate URL)":""),1);return!0};p=this.getSoundById;M=function(){if(u)return X(),!1;if(b.o)return!1;b.o=b.getMovie(b.id);if(!b.o)N?(x?b.oMC.innerHTML=oa:b.oMC.appendChild(N),N=null,E=!0):X(b.id,b.url),b.o=b.getMovie(b.id); -b.o&&(b._wD("soundManager::initMovie(): Got "+b.o.nodeName+" element ("+(E?"created via JS":"static HTML")+")"),j("waitEI"));b.oninitmovie instanceof Function&&setTimeout(b.oninitmovie,1);return!0};ka=function(c){if(c)b.url=c;M()};V=function(){setTimeout(ya,500)};ya=function(){if(aa)return!1;aa=!0;q.remove(h,"load",V);if(J&&!ua)return j("waitFocus"),!1;var c;m||(c=b.getMoviePercent(),b._wD(o("waitImpatient",c===100?" (SWF loaded)":c>0?" (SWF "+c+"% loaded)":"")));setTimeout(function(){c=b.getMoviePercent(); -m||(b._wD("soundManager: No Flash response within expected time.\nLikely causes: "+(c===0?"Loading "+b.movieURL+" may have failed (and/or Flash "+i+"+ not present?), ":"")+"Flash blocked or JS-Flash security error."+(b.debugFlash?" "+o("checkSWF"):""),2),!b._overHTTP&&c&&(j("localFail",2),b.debugFlash||j("tryDebug",2)),c===0&&b._wD(o("swf404",b.url)),v("flashtojs",!1,": Timed out"+b._overHTTP?" (Check flash security or flash blockers)":" (No plugin/missing SWF?)"));!m&&Ka&&(c===null?b.useFlashBlock|| -b.flashLoadTimeout===0?(b.useFlashBlock&&pa(),j("waitForever")):Y(!0):b.flashLoadTimeout===0?j("waitForever"):Y(!0))},b.flashLoadTimeout)};ka=function(c){if(c)b.url=c;M()};j=function(c,a){return c?b._wD(o(c),a):""};if(D.indexOf("debug=alert")+1&&b.debugMode)b._wD=function(b){R.alert(b)};xa=function(){var c=r(b.debugID),a=r(b.debugID+"-toggle");if(!c)return!1;ha?(a.innerHTML="+",c.style.display="none"):(a.innerHTML="-",c.style.display="block");ha=!ha};v=function(b,a,e){if(typeof sm2Debugger!=="undefined")try{sm2Debugger.handleEvent(b, -a,e)}catch(f){}return!0};H=function(){var c=[];b.debugMode&&c.push(b.swfCSS.sm2Debug);b.debugFlash&&c.push(b.swfCSS.flashDebug);b.useHighPerformance&&c.push(b.swfCSS.highPerf);return c.join(" ")};pa=function(){var c=o("fbHandler"),a=b.getMoviePercent(),e=b.swfCSS;if(b.ok()){if(b.didFlashBlock&&b._wD(c+": Unblocked"),b.oMC)b.oMC.className=[H(),e.swfDefault,e.swfLoaded+(b.didFlashBlock?" "+e.swfUnblocked:"")].join(" ")}else{if(C)b.oMC.className=H()+" "+e.swfDefault+" "+(a===null?e.swfTimedout:e.swfError), -b._wD(c+": "+o("fbTimeout")+(a?" ("+o("fbLoaded")+")":""));b.didFlashBlock=!0;A({type:"ontimeout",ignoreInit:!0});b.onerror instanceof Function&&b.onerror.apply(h)}};B=function(){function c(){q.remove(h,"focus",B);q.remove(h,"load",B)}if(ua||!J)return c(),!0;ua=Ka=!0;b._wD("soundManager::handleFocus()");Q&&J&&q.remove(h,"mousemove",B);aa=!1;c();return!0};L=function(c){if(m)return!1;if(u)return b._wD("-- SoundManager 2: loaded --"),m=!0,A(),F(),!0;b.useFlashBlock&&b.flashLoadTimeout&&!b.getMoviePercent()|| -(m=!0);b._wD("-- SoundManager 2 "+(w?"failed to load":"loaded")+" ("+(w?"security/load error":"OK")+") --",1);if(w||c){if(b.useFlashBlock)b.oMC.className=H()+" "+(b.getMoviePercent()===null?b.swfCSS.swfTimedout:b.swfCSS.swfError);A({type:"ontimeout"});v("onload",!1);b.onerror instanceof Function&&b.onerror.apply(h);return!1}else v("onload",!0);q.add(h,"unload",ga);if(b.waitForWindowLoad&&!ia)return j("waitOnload"),q.add(h,"load",F),!1;else b.waitForWindowLoad&&ia&&j("docLoaded"),F();return!0};ja= -function(b,a,e){typeof y[b]==="undefined"&&(y[b]=[]);y[b].push({method:a,scope:e||null,fired:!1})};A=function(c){c||(c={type:"onready"});if(!m&&c&&!c.ignoreInit)return!1;var a={success:c&&c.ignoreInit?b.ok():!w},e=c&&c.type?y[c.type]||[]:[],f=[],d,g=C&&b.useFlashBlock&&!b.ok();for(d=0;d8&&c.useMovieStar){if(d.isMovieStar===null)d.isMovieStar=d.serverURL||d.type&&d.type.match(c.netStreamPattern)||d.url.match(c.netStreamPattern)?!0:!1;if(d.isMovieStar&&d.usePeakData)d.usePeakData= -!1}d=T(d,"soundManager.createSound(): ");f=a();if(k===8)c.o._createSound(d.id,d.onjustbeforefinishtime,d.loops||1,d.usePolicyFile);else if(c.o._createSound(d.id,d.url,d.onjustbeforefinishtime,d.usePeakData,d.useWaveformData,d.useEQData,d.isMovieStar,d.isMovieStar?d.bufferTime:!1,d.loops||1,d.serverURL,d.duration||null,d.autoPlay,!0,d.autoLoad,d.usePolicyFile),!d.serverURL)f.connected=!0,d.onconnect&&d.onconnect.apply(f);(d.autoLoad||d.autoPlay)&&!d.serverURL&&f.load(d)}d.autoPlay&&!d.serverURL&&f.play(); -return f};this.destroySound=function(b,a){if(!j(b))return!1;var e=c.sounds[b],f;e._iO={};e.stop();e.unload();for(f=0;f0)a.resume();else{a.playState=1;a.paused=!1;(!a.instanceCount||a._iO.multiShotEvents||k>8&&!a.isHTML5&&!a.getAutoPlay())&&a.instanceCount++;a.position=typeof a._iO.position!=="undefined"&&!isNaN(a._iO.position)?a._iO.position:0;if(!a.isHTML5)a._iO=T(S(a._iO));if(a._iO.onplay&& -W)a._iO.onplay.apply(a),a._onplay_called=!0;a.setVolume(a._iO.volume,!0);a.setPan(a._iO.pan,!0);a.isHTML5?(d(),a._setup_html5().play()):c.o._start(a.sID,a._iO.loops||1,k===9?a.position:a.position/1E3)}return a};this.stop=function(b){if(a.playState===1){a._onbufferchange(0);a.resetOnPosition(0);if(!a.isHTML5)a.playState=0;a.paused=!1;a._iO.onstop&&a._iO.onstop.apply(a);if(a.isHTML5){if(a._a)a.setPosition(0),a._a.pause(),a.playState=0,a._onTimer(),f(),a.unload()}else c.o._stop(a.sID,b),a._iO.serverURL&& -a.unload();a.instanceCount=0;a._iO={}}return a};this.setAutoPlay=function(b){a._iO.autoPlay=b;a.isHTML5?a._a&&b&&a.play():c.o._setAutoPlay(a.sID,b);b&&!a.instanceCount&&a.readyState===1&&a.instanceCount++};this.getAutoPlay=function(){return a._iO.autoPlay};this.setPosition=function(b){b===void 0&&(b=0);var d=a.isHTML5?Math.max(b,0):Math.min(a.duration||a._iO.duration,Math.max(b,0));a.position=d;b=a.position/1E3;a.resetOnPosition(a.position);a._iO.position=d;if(a.isHTML5){if(a._a&&a._html5_canplay&& -a._a.currentTime!==b)try{a._a.currentTime=b}catch(e){}}else b=k===9?a.position:b,a.readyState&&a.readyState!==2&&c.o._setPosition(a.sID,b,a.paused||!a.playState);a.isHTML5&&a.paused&&a._onTimer(!0);return a};this.pause=function(b){if(a.paused||a.playState===0&&a.readyState!==1)return a;a.paused=!0;a.isHTML5?(a._setup_html5().pause(),f()):(b||b===void 0)&&c.o._pause(a.sID);a._iO.onpause&&a._iO.onpause.apply(a);return a};this.resume=function(){if(!a.paused)return a;a.paused=!1;a.playState=1;a.isHTML5? -(a._setup_html5().play(),d()):(a._iO.isMovieStar&&a.setPosition(a.position),c.o._pause(a.sID));!a._onplay_called&&a._iO.onplay?(a._iO.onplay.apply(a),a._onplay_called=!0):a._iO.onresume&&a._iO.onresume.apply(a);return a};this.togglePause=function(){if(a.playState===0)return a.play({position:k===9&&!a.isHTML5?a.position:a.position/1E3}),a;a.paused?a.resume():a.pause();return a};this.setPan=function(b,d){typeof b==="undefined"&&(b=0);typeof d==="undefined"&&(d=!1);a.isHTML5||c.o._setPan(a.sID,b);a._iO.pan= -b;if(!d)a.pan=b,a.options.pan=b;return a};this.setVolume=function(b,d){typeof b==="undefined"&&(b=100);typeof d==="undefined"&&(d=!1);if(a.isHTML5){if(a._a)a._a.volume=Math.max(0,Math.min(1,b/100))}else c.o._setVolume(a.sID,c.muted&&!a.muted||a.muted?0:b);a._iO.volume=b;if(!d)a.volume=b,a.options.volume=b;return a};this.mute=function(){a.muted=!0;if(a.isHTML5){if(a._a)a._a.muted=!0}else c.o._setVolume(a.sID,0);return a};this.unmute=function(){a.muted=!1;var b=typeof a._iO.volume!=="undefined";if(a.isHTML5){if(a._a)a._a.muted= -!1}else c.o._setVolume(a.sID,b?a._iO.volume:a.options.volume);return a};this.toggleMute=function(){return a.muted?a.unmute():a.mute()};this.onposition=function(c,b,d){a._onPositionItems.push({position:c,method:b,scope:typeof d!=="undefined"?d:a,fired:!1});return a};this.processOnPosition=function(){var b,d;b=a._onPositionItems.length;if(!b||!a.playState||a._onPositionFired>=b)return!1;for(;b--;)if(d=a._onPositionItems[b],!d.fired&&a.position>=d.position)d.method.apply(d.scope,[d.position]),d.fired= -!0,c._onPositionFired++;return!0};this.resetOnPosition=function(b){var d,e;d=a._onPositionItems.length;if(!d)return!1;for(;d--;)if(e=a._onPositionItems[d],e.fired&&b<=e.position)e.fired=!1,c._onPositionFired--;return!0};this._onTimer=function(c){var b={};if(a._hasTimer||c)return a._a&&(c||(a.playState>0||a.readyState===1)&&!a.paused)?(a.duration=a._get_html5_duration(),a.durationEstimate=a.duration,c=a._a.currentTime?a._a.currentTime*1E3:0,a._whileplaying(c,b,b,b,b),!0):!1};this._get_html5_duration= -function(){var c=a._a?a._a.duration*1E3:a._iO?a._iO.duration:void 0;return c&&!isNaN(c)&&c!==Infinity?c:a._iO?a._iO.duration:null};d=function(){a.isHTML5&&wa(a)};f=function(){a.isHTML5&&xa(a)};e=function(){a._onPositionItems=[];a._onPositionFired=0;a._hasTimer=null;a._onplay_called=!1;a._a=null;a._html5_canplay=!1;a.bytesLoaded=null;a.bytesTotal=null;a.position=null;a.duration=a._iO&&a._iO.duration?a._iO.duration:null;a.durationEstimate=null;a.failures=0;a.loaded=!1;a.playState=0;a.paused=!1;a.readyState= -0;a.muted=!1;a.didBeforeFinish=!1;a.didJustBeforeFinish=!1;a.isBuffering=!1;a.instanceOptions={};a.instanceCount=0;a.peakData={left:0,right:0};a.waveformData={left:[],right:[]};a.eqData=[];a.eqData.left=[];a.eqData.right=[]};e();this._setup_html5=function(b){var b=o(a._iO,b),d=K?c._global_a:a._a;decodeURI(b.url);var f=d&&d._t?d._t.instanceOptions:null;if(d){if(d._t&&f.url===b.url&&(!a._lastURL||a._lastURL===f.url))return d;K&&d._t&&d._t.playState&&b.url!==f.url&&d._t.stop();e();d.src=b.url;a.url= -b.url;a._lastURL=b.url;d._called_load=!1}else if(d=new Audio(b.url),d._called_load=!1,K)c._global_a=d;a.isHTML5=!0;a._a=d;d._t=a;a._add_html5_events();d.loop=b.loops>1?"loop":"";b.autoLoad||b.autoPlay?(d.autobuffer="auto",d.preload="auto",a.load(),d._called_load=!0):(d.autobuffer=!1,d.preload="none");d.loop=b.loops>1?"loop":"";return d};this._add_html5_events=function(){if(a._a._added_events)return!1;var b;a._a._added_events=!0;for(b in c._html5_events)c._html5_events.hasOwnProperty(b)&&a._a&&a._a.addEventListener(b, -c._html5_events[b],!1);return!0};this._remove_html5_events=function(){a._a._added_events=!1;for(var b in c._html5_events)c._html5_events.hasOwnProperty(b)&&a._a&&a._a.removeEventListener(b,c._html5_events[b],!1)};this._whileloading=function(c,b,d,e){a.bytesLoaded=c;a.bytesTotal=b;a.duration=Math.floor(d);a.bufferLength=e;if(a._iO.isMovieStar)a.durationEstimate=a.duration;else if(a.durationEstimate=a._iO.duration?a.duration>a._iO.duration?a.duration:a._iO.duration:parseInt(a.bytesTotal/a.bytesLoaded* -a.duration,10),a.durationEstimate===void 0)a.durationEstimate=a.duration;a.readyState!==3&&a._iO.whileloading&&a._iO.whileloading.apply(a)};this._onid3=function(c,b){var d=[],e,f;e=0;for(f=c.length;e0&&(b=0);a.position=b;a.processOnPosition();if(k>8&&!a.isHTML5){if(a._iO.usePeakData&&typeof d!=="undefined"&&d)a.peakData={left:d.leftPeak,right:d.rightPeak}; -if(a._iO.useWaveformData&&typeof e!=="undefined"&&e)a.waveformData={left:e.split(","),right:f.split(",")};if(a._iO.useEQData&&typeof g!=="undefined"&&g&&g.leftEQ&&(b=g.leftEQ.split(","),a.eqData=b,a.eqData.left=b,typeof g.rightEQ!=="undefined"&&g.rightEQ))a.eqData.right=g.rightEQ.split(",")}a.playState===1&&(!a.isHTML5&&c.flashVersion===8&&!a.position&&a.isBuffering&&a._onbufferchange(0),a._iO.whileplaying&&a._iO.whileplaying.apply(a),(a.loaded||!a.loaded&&a._iO.isMovieStar)&&a._iO.onbeforefinish&& -a._iO.onbeforefinishtime&&!a.didBeforeFinish&&a.duration-a.position<=a._iO.onbeforefinishtime&&a._onbeforefinish());return!0};this._onconnect=function(b){b=b===1;if(a.connected=b)a.failures=0,j(a.sID)&&(a.getAutoPlay()?a.play(void 0,a.getAutoPlay()):a._iO.autoLoad&&a.load()),a._iO.onconnect&&a._iO.onconnect.apply(a,[b])};this._onload=function(b){b=b?!0:!1;a.loaded=b;a.readyState=b?3:2;a._onbufferchange(0);a._iO.onload&&a._iO.onload.apply(a,[b]);return!0};this._onfailure=function(b,c,d){a.failures++; -if(a._iO.onfailure&&a.failures===1)a._iO.onfailure(a,b,c,d)};this._onbeforefinish=function(){if(!a.didBeforeFinish)a.didBeforeFinish=!0,a._iO.onbeforefinish&&a._iO.onbeforefinish.apply(a)};this._onjustbeforefinish=function(){if(!a.didJustBeforeFinish)a.didJustBeforeFinish=!0,a._iO.onjustbeforefinish&&a._iO.onjustbeforefinish.apply(a)};this._onfinish=function(){var b=a._iO.onfinish;a._onbufferchange(0);a.resetOnPosition(0);a._iO.onbeforefinishcomplete&&a._iO.onbeforefinishcomplete.apply(a);a.didBeforeFinish= -!1;a.didJustBeforeFinish=!1;if(a.instanceCount){a.instanceCount--;if(!a.instanceCount)a.playState=0,a.paused=!1,a.instanceCount=0,a.instanceOptions={},a._iO={},f();(!a.instanceCount||a._iO.multiShotEvents)&&b&&b.apply(a)}};this._onbufferchange=function(b){if(a.playState===0)return!1;if(b&&a.isBuffering||!b&&!a.isBuffering)return!1;a.isBuffering=b===1;a._iO.onbufferchange&&a._iO.onbufferchange.apply(a);return!0};this._ondataerror=function(){a.playState>0&&a._iO.ondataerror&&a._iO.ondataerror.apply(a)}}; -ea=function(){return g.body?g.body:g._docElement?g.documentElement:g.getElementsByTagName("div")[0]};y=function(b){return g.getElementById(b)};o=function(b,a){var e={},f,d;for(f in b)b.hasOwnProperty(f)&&(e[f]=b[f]);f=typeof a==="undefined"?c.defaultOptions:a;for(d in f)f.hasOwnProperty(d)&&typeof e[d]==="undefined"&&(e[d]=f[d]);return e};l=function(){function b(a){var a=Da.call(a),b=a.length;c?(a[1]="on"+a[1],b>3&&a.pop()):b===3&&a.push(!1);return a}function a(a,b){var g=a.shift(),h=[f[b]];if(c)g[h](a[0], -a[1]);else g[h].apply(g,a)}var c=h.attachEvent,f={add:c?"attachEvent":"addEventListener",remove:c?"detachEvent":"removeEventListener"};return{add:function(){a(b(arguments),"add")},remove:function(){a(b(arguments),"remove")}}}();V=function(b){return!b.serverURL&&(b.type?J({type:b.type}):J(b.url)||p)};J=function(b){if(!c.useHTML5Audio||!c.hasHTML5)return!1;var a,e=c.audioFormats;if(!s){s=[];for(a in e)e.hasOwnProperty(a)&&(s.push(a),e[a].related&&(s=s.concat(e[a].related)));s=RegExp("\\.("+s.join("|")+ -")","i")}a=typeof b.type!=="undefined"?b.type:null;b=typeof b==="string"?b.toLowerCase().match(s):null;if(!b||!b.length)if(a)b=a.indexOf(";"),b=(b!==-1?a.substr(0,b):a).substr(6);else return!1;else b=b[0].substr(1);if(b&&typeof c.html5[b]!=="undefined")return c.html5[b];else{if(!a)if(b&&c.html5[b])return c.html5[b];else a="audio/"+b;a=c.html5.canPlayType(a);return c.html5[b]=a}};za=function(){function b(b){var d,e,f=!1;if(!a||typeof a.canPlayType!=="function")return!1;if(b instanceof Array){d=0;for(e= -b.length;d1&&b.stream)b.stream=!1;return b};T=function(b){if(b&&!b.usePolicyFile&&(b.onid3||b.usePeakData||b.useWaveformData||b.useEQData))b.usePolicyFile=!0;return b};ia=function(b){typeof console!=="undefined"&&typeof console.warn!=="undefined"&&console.warn(b)};$=function(){return!1};ua=function(b){for(var a in b)b.hasOwnProperty(a)&&typeof b[a]==="function"&&(b[a]=$)};R=function(b){typeof b==="undefined"&& -(b=!1);(t||b)&&c.disable(b)};va=function(b){var a=null;if(b)if(b.match(/\.swf(\?.*)?$/i)){if(a=b.substr(b.toLowerCase().lastIndexOf(".swf?")+4))return b}else b.lastIndexOf("/")!==b.length-1&&(b+="/");return(b&&b.lastIndexOf("/")!==-1?b.substr(0,b.lastIndexOf("/")+1):"./")+c.movieURL};ca=function(){if(k!==8&&k!==9)c.flashVersion=8;var b=c.debugMode||c.debugFlash?"_debug.swf":".swf";if(c.useHTML5Audio&&!p&&c.audioFormats.mp4.required&&c.flashVersion<9)c.flashVersion=9;k=c.flashVersion;c.version=c.versionNumber+ -(p?" (HTML5-only mode)":k===9?" (AS3/Flash 9)":" (AS2/Flash 8)");if(k>8)c.defaultOptions=o(c.defaultOptions,c.flash9Options),c.features.buffering=!0;k>8&&c.useMovieStar?(c.defaultOptions=o(c.defaultOptions,c.movieStarOptions),c.filePatterns.flash9=RegExp("\\.(mp3|"+c.netStreamTypes.join("|")+")(\\?.*)?$","i"),c.mimePattern=c.netStreamMimeTypes,c.features.movieStar=!0):(c.useMovieStar=!1,c.features.movieStar=!1);c.filePattern=c.filePatterns[k!==8?"flash9":"flash8"];c.movieURL=(k===8?"soundmanager2.swf": -"soundmanager2_flash9.swf").replace(".swf",b);c.features.peakData=c.features.waveformData=c.features.eqData=k>8};ta=function(b,a){if(!c.o||!c.allowPolling)return!1;c.o._setPolling(b,a)};Q=function(b,a){var e=a?a:c.url,f=c.altURL?c.altURL:e,d;d=ea();var h,k,i=B(),j,l=null,l=(l=g.getElementsByTagName("html")[0])&&l.dir&&l.dir.match(/rtl/i),b=typeof b==="undefined"?c.id:b;if(E&&F)return!1;if(p)return ca(),c.oMC=y(c.movieID),O(),F=E=!0,!1;E=!0;ca();c.url=va(c._overHTTP?e:f);a=c.url;c.wmode=!c.wmode&& -c.useHighPerformance&&!c.useMovieStar?"transparent":c.wmode;if(c.wmode!==null&&(n.match(/msie 8/i)||!q&&!c.useHighPerformance)&&navigator.platform.match(/win32|win64/i))c.specialWmodeCase=!0,c.wmode=null;d={name:b,id:b,src:a,width:"100%",height:"100%",quality:"high",allowScriptAccess:c.allowScriptAccess,bgcolor:c.bgColor,pluginspage:c._http+"//www.macromedia.com/go/getflashplayer",type:"application/x-shockwave-flash",wmode:c.wmode,hasPriority:"true"};if(c.debugFlash)d.FlashVars="debug=1";c.wmode|| -delete d.wmode;if(q)e=g.createElement("div"),k=''+(c.wmode?' ':"")+ -''+(c.debugFlash?'':"")+"";else for(h in e=g.createElement("embed"),d)d.hasOwnProperty(h)&&e.setAttribute(h,d[h]);pa();i=B();if(d=ea())if(c.oMC=y(c.movieID)?y(c.movieID):g.createElement("div"),c.oMC.id){j=c.oMC.className;c.oMC.className=(j?j+" ":c.swfCSS.swfDefault)+(i?" "+i:"");c.oMC.appendChild(e);if(q)h=c.oMC.appendChild(g.createElement("div")),h.className=c.swfCSS.swfBox,h.innerHTML=k;F=!0}else{c.oMC.id= -c.movieID;c.oMC.className=c.swfCSS.swfDefault+" "+i;h=i=null;if(!c.useFlashBlock)if(c.useHighPerformance)i={position:"fixed",width:"8px",height:"8px",bottom:"0px",left:"0px",overflow:"hidden"};else if(i={position:"absolute",width:"6px",height:"6px",top:"-9999px",left:"-9999px"},l)i.left=Math.abs(parseInt(i.left,10))+"px";if(Fa)c.oMC.style.zIndex=1E4;if(!c.debugFlash)for(j in i)i.hasOwnProperty(j)&&(c.oMC.style[j]=i[j]);try{q||c.oMC.appendChild(e);d.appendChild(c.oMC);if(q)h=c.oMC.appendChild(g.createElement("div")), -h.className=c.swfCSS.swfBox,h.innerHTML=k;F=!0}catch(m){throw Error(w("appXHTML"));}}return!0};j=this.getSoundById;H=function(){if(p)return Q(),!1;if(c.o)return!1;c.o=c.getMovie(c.id);if(!c.o)I?(q?c.oMC.innerHTML=ga:c.oMC.appendChild(I),I=null,E=!0):Q(c.id,c.url),c.o=c.getMovie(c.id);c.oninitmovie instanceof Function&&setTimeout(c.oninitmovie,1);return!0};ba=function(b){if(b)c.url=b;H()};P=function(){setTimeout(ra,500)};ra=function(){if(U)return!1;U=!0;l.remove(h,"load",P);if(D&&!na)return!1;var b; -m||(b=c.getMoviePercent());setTimeout(function(){b=c.getMoviePercent();!m&&Ca&&(b===null?c.useFlashBlock||c.flashLoadTimeout===0?c.useFlashBlock&&ha():R(!0):c.flashLoadTimeout!==0&&R(!0))},c.flashLoadTimeout)};ba=function(b){if(b)c.url=b;H()};B=function(){var b=[];c.debugMode&&b.push(c.swfCSS.sm2Debug);c.debugFlash&&b.push(c.swfCSS.flashDebug);c.useHighPerformance&&b.push(c.swfCSS.highPerf);return b.join(" ")};ha=function(){w("fbHandler");var b=c.getMoviePercent(),a=c.swfCSS;if(c.ok()){if(c.oMC)c.oMC.className= -[B(),a.swfDefault,a.swfLoaded+(c.didFlashBlock?" "+a.swfUnblocked:"")].join(" ")}else{if(x)c.oMC.className=B()+" "+a.swfDefault+" "+(b===null?a.swfTimedout:a.swfError);c.didFlashBlock=!0;u({type:"ontimeout",ignoreInit:!0});c.onerror instanceof Function&&c.onerror.apply(h)}};v=function(){function b(){l.remove(h,"focus",v);l.remove(h,"load",v)}if(na||!D)return b(),!0;na=Ca=!0;L&&D&&l.remove(h,"mousemove",v);U=!1;b();return!0};G=function(b){if(m)return!1;if(p)return m=!0,u(),z(),!0;c.useFlashBlock&& -c.flashLoadTimeout&&!c.getMoviePercent()||(m=!0);if(t||b){if(c.useFlashBlock)c.oMC.className=B()+" "+(c.getMoviePercent()===null?c.swfCSS.swfTimedout:c.swfCSS.swfError);u({type:"ontimeout"});c.onerror instanceof Function&&c.onerror.apply(h);return!1}l.add(h,"unload",$);if(c.waitForWindowLoad&&!qa)return l.add(h,"load",z),!1;else z();return!0};aa=function(b,a,c){typeof r[b]==="undefined"&&(r[b]=[]);r[b].push({method:a,scope:c||null,fired:!1})};u=function(b){b||(b={type:"onready"});if(!m&&b&&!b.ignoreInit)return!1; -var a={success:b&&b.ignoreInit?c.ok():!t},e=b&&b.type?r[b.type]||[]:[],b=[],f,d=x&&c.useFlashBlock&&!c.ok();for(f=0;f0) - 'onid3': null, // callback function for "ID3 data is added/available" - 'onload': null, // callback function for "load finished" - 'whileloading': null, // callback function for "download progress update" (X of Y bytes received) - 'onplay': null, // callback for "play" start - 'onpause': null, // callback for "pause" - 'onresume': null, // callback for "resume" (pause toggle) - 'whileplaying': null, // callback during play (position update) - 'onstop': null, // callback for "user stop" - 'onfailure': null, // callback function for when playing fails - 'onfinish': null, // callback function for "sound finished playing" - 'onbeforefinish': null, // callback for "before sound finished playing (at [time])" - 'onbeforefinishtime': 5000, // offset (milliseconds) before end of sound to trigger beforefinish (eg. 1000 msec = 1 second) - 'onbeforefinishcomplete': null,// function to call when said sound finishes playing - 'onjustbeforefinish': null, // callback for [n] msec before end of current sound - 'onjustbeforefinishtime': 200, // [n] - if not using, set to 0 (or null handler) and event will not fire. - 'multiShot': true, // let sounds "restart" or layer on top of each other when played multiple times, rather than one-shot/one at a time - 'multiShotEvents': false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled - 'position': null, // offset (milliseconds) to seek to within loaded sound data. - 'pan': 0, // "pan" settings, left-to-right, -100 to 100 - 'type': null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3 - 'usePolicyFile': false, // enable crossdomain.xml request for audio on remote domains (for ID3/waveform access) - 'volume': 100 // self-explanatory. 0-100, the latter being the max. - }; - - this.flash9Options = { // flash 9-only options, merged into defaultOptions if flash 9 is being used - 'isMovieStar': null, // "MovieStar" MPEG4 audio mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL - 'usePeakData': false, // enable left/right channel peak (level) data - 'useWaveformData': false, // enable sound spectrum (raw waveform data) - WARNING: CPU-INTENSIVE: may set CPUs on fire. - 'useEQData': false, // enable sound EQ (frequency spectrum data) - WARNING: Also CPU-intensive. - 'onbufferchange': null, // callback for "isBuffering" property change - 'ondataerror': null // callback for waveform/eq data access error (flash playing audio in other tabs/domains) - }; - - this.movieStarOptions = { // flash 9.0r115+ MPEG4 audio options, merged into defaultOptions if flash 9+movieStar mode is enabled - 'bufferTime': 3, // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try increasing.) - 'serverURL': null, // rtmp: FMS or FMIS server to connect to, required when requesting media via RTMP or one of its variants - 'onconnect': null, // rtmp: callback for connection to flash media server - 'duration': null // rtmp: song duration (msec) - }; - - this.version = null; - this.versionNumber = 'V2.97a.20110424'; - this.movieURL = null; - this.url = (smURL || null); - this.altURL = null; - this.swfLoaded = false; - this.enabled = false; - this.o = null; - this.movieID = 'sm2-container'; - this.id = (smID || 'sm2movie'); - this.swfCSS = { - 'swfBox': 'sm2-object-box', - 'swfDefault': 'movieContainer', - 'swfError': 'swf_error', // SWF loaded, but SM2 couldn't start (other error) - 'swfTimedout': 'swf_timedout', - 'swfLoaded': 'swf_loaded', - 'swfUnblocked': 'swf_unblocked', // or loaded OK - 'sm2Debug': 'sm2_debug', - 'highPerf': 'high_performance', - 'flashDebug': 'flash_debug' - }; - this.oMC = null; - this.sounds = {}; - this.soundIDs = []; - this.muted = false; - this.debugID = 'soundmanager-debug'; - this.debugURLParam = /([#?&])debug=1/i; - this.specialWmodeCase = false; - this.didFlashBlock = false; - - this.filePattern = null; - this.filePatterns = { - 'flash8': /\.mp3(\?.*)?$/i, - 'flash9': /\.mp3(\?.*)?$/i - }; - - this.baseMimeTypes = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i; // mp3 - this.netStreamMimeTypes = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i; // mp3, mp4, aac etc. - this.netStreamTypes = ['aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'mp4v', '3gp', '3g2']; // Flash v9.0r115+ "moviestar" formats - this.netStreamPattern = new RegExp('\\.(' + this.netStreamTypes.join('|') + ')(\\?.*)?$', 'i'); - this.mimePattern = this.baseMimeTypes; - - this.features = { - 'buffering': false, - 'peakData': false, - 'waveformData': false, - 'eqData': false, - 'movieStar': false - }; - - this.sandbox = { - /* - 'type': null, - 'types': { - 'remote': 'remote (domain-based) rules', - 'localWithFile': 'local with file access (no internet access)', - 'localWithNetwork': 'local with network (internet access only, no local access)', - 'localTrusted': 'local, trusted (local+internet access)' - }, - 'description': null, - 'noRemote': null, - 'noLocal': null - */ - }; - - this.hasHTML5 = null; // switch for handling logic - this.html5 = { // stores canPlayType() results, etc. treat as read-only. - // mp3: boolean - // mp4: boolean - 'usingFlash': null // set if/when flash fallback is needed - }; - this.ignoreFlash = false; // used for special cases (eg. iPad/iPhone/palm OS?) - - // --- private SM2 internals --- - - var SMSound, - _s = this, _sm = 'soundManager', _smc = _sm+'::', _h5 = 'HTML5::', _id, _ua = navigator.userAgent, _win = window, _wl = _win.location.href.toString(), _fV = this.flashVersion, _doc = document, _doNothing, _init, _on_queue = [], _debugOpen = true, _debugTS, _didAppend = false, _appendSuccess = false, _didInit = false, _disabled = false, _windowLoaded = false, _wDS, _wdCount = 0, _initComplete, _mixin, _addOnEvent, _processOnEvents, _initUserOnload, _go, _delayWaitForEI, _waitForEI, _setVersionInfo, _handleFocus, _beginInit, _strings, _initMovie, _dcLoaded, _didDCLoaded, _getDocument, _createMovie, _die, _setPolling, _debugLevels = ['log', 'info', 'warn', 'error'], _defaultFlashVersion = 8, _disableObject, _failSafely, _normalizeMovieURL, _oRemoved = null, _oRemovedHTML = null, _str, _flashBlockHandler, _getSWFCSS, _toggleDebug, _loopFix, _policyFix, _complain, _idCheck, _waitingForEI = false, _initPending = false, _smTimer, _onTimer, _startTimer, _stopTimer, _needsFlash = null, _featureCheck, _html5OK, _html5Only = false, _html5CanPlay, _html5Ext, _dcIE, _testHTML5, _event, _slice = Array.prototype.slice, _useGlobalHTML5Audio = false, _hasFlash, _detectFlash, _badSafariFix, - _is_pre = _ua.match(/pre\//i), _is_iDevice = _ua.match(/(ipad|iphone|ipod)/i), _isMobile = (_ua.match(/mobile/i) || _is_pre || _is_iDevice), _isIE = _ua.match(/msie/i), _isWebkit = _ua.match(/webkit/i), _isSafari = (_ua.match(/safari/i) && !_ua.match(/chrome/i)), _isOpera = (_ua.match(/opera/i)), - _isBadSafari = (!_wl.match(/usehtml5audio/i) && !_wl.match(/sm2\-ignorebadua/i) && _isSafari && _ua.match(/OS X 10_6_([3-9])/i)), // Safari 4 and 5 occasionally fail to load/play HTML5 audio on Snow Leopard due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Known Apple "radar" bug. https://bugs.webkit.org/show_bug.cgi?id=32159 - _hasConsole = (typeof console !== 'undefined' && typeof console.log !== 'undefined'), _isFocused = (typeof _doc.hasFocus !== 'undefined'?_doc.hasFocus():null), _tryInitOnFocus = (typeof _doc.hasFocus === 'undefined' && _isSafari), _okToDisable = !_tryInitOnFocus; - - this._use_maybe = (_wl.match(/sm2\-useHTML5Maybe\=1/i)); // temporary feature: #sm2-useHTML5Maybe=1 forces loose canPlay() check - this._overHTTP = (_doc.location?_doc.location.protocol.match(/http/i):null); - this._http = (!this._overHTTP ? 'http:' : ''); - this.useAltURL = !this._overHTTP; // use altURL if not "online" - this._global_a = null; - - if (_is_iDevice || _is_pre) { - // during HTML5 beta period (off by default), may as well force it on Apple + Palm, flash support unlikely - _s.useHTML5Audio = true; - _s.ignoreFlash = true; - if (_s.useGlobalHTML5Audio) { - _useGlobalHTML5Audio = true; - } - } - - if (_is_pre || this._use_maybe) { - // less-strict canPlayType() checking option - _s.html5Test = /^(probably|maybe)$/i; - } - - // Temporary feature: allow force of HTML5 via URL: #sm2-usehtml5audio=0 or 1 - /* - (function(){ - var a = '#sm2-usehtml5audio=', l = _wl, b = null; - if (l.indexOf(a) !== -1) { - b = (l.charAt(l.indexOf(a)+a.length) === '1'); - if (typeof console !== 'undefined' && typeof console.log !== 'undefined') { - console.log((b?'Enabling ':'Disabling ')+'useHTML5Audio via URL parameter'); - } - _s.useHTML5Audio = b; - } - }()); - */ - - // --- public API methods --- - - this.ok = function() { - return (_needsFlash?(_didInit && !_disabled):(_s.useHTML5Audio && _s.hasHTML5)); - }; - - this.supported = this.ok; // legacy - - this.getMovie = function(smID) { - return _isIE?_win[smID]:(_isSafari?_id(smID) || _doc[smID]:_id(smID)); - }; - - this.createSound = function(oOptions) { - var _cs = _sm+'.createSound(): ', - thisOptions = null, oSound = null, _tO = null; - if (!_didInit || !_s.ok()) { - _complain(_cs + _str(!_didInit?'notReady':'notOK')); - return false; - } - if (arguments.length === 2) { - // function overloading in JS! :) ..assume simple createSound(id,url) use case - oOptions = { - 'id': arguments[0], - 'url': arguments[1] - }; - } - thisOptions = _mixin(oOptions); // inherit from defaultOptions - _tO = thisOptions; // alias - /* - if (_tO.id.toString().charAt(0).match(/^[0-9]$/)) { - //_s._wD(_cs + _str('badID', _tO.id), 2); - } - //_s._wD(_cs + _tO.id + ' (' + _tO.url + ')', 1); - */ - if (_idCheck(_tO.id, true)) { - //_s._wD(_cs + _tO.id + ' exists', 1); - return _s.sounds[_tO.id]; - } - - function make() { - thisOptions = _loopFix(thisOptions); - _s.sounds[_tO.id] = new SMSound(_tO); - _s.soundIDs.push(_tO.id); - return _s.sounds[_tO.id]; - } - - if (_html5OK(_tO)) { - oSound = make(); - //_s._wD('Loading sound '+_tO.id+' via HTML5'); - oSound._setup_html5(_tO); - } else { - if (_fV > 8 && _s.useMovieStar) { - if (_tO.isMovieStar === null) { - _tO.isMovieStar = ((_tO.serverURL || (_tO.type?_tO.type.match(_s.netStreamPattern):false)||_tO.url.match(_s.netStreamPattern))?true:false); - } - if (_tO.isMovieStar) { - //_s._wD(_cs + 'using MovieStar handling'); - } - if (_tO.isMovieStar) { - if (_tO.usePeakData) { - //_wDS('noPeak'); - _tO.usePeakData = false; - } - if (_tO.loops > 1) { - //_wDS('noNSLoop'); - } - } - } - _tO = _policyFix(_tO, _cs); - oSound = make(); - if (_fV === 8) { - _s.o._createSound(_tO.id, _tO.onjustbeforefinishtime, _tO.loops||1, _tO.usePolicyFile); - } else { - _s.o._createSound(_tO.id, _tO.url, _tO.onjustbeforefinishtime, _tO.usePeakData, _tO.useWaveformData, _tO.useEQData, _tO.isMovieStar, (_tO.isMovieStar?_tO.bufferTime:false), _tO.loops||1, _tO.serverURL, _tO.duration||null, _tO.autoPlay, true, _tO.autoLoad, _tO.usePolicyFile); - if (!_tO.serverURL) { - // We are connected immediately - oSound.connected = true; - if (_tO.onconnect) { - _tO.onconnect.apply(oSound); - } - } - } - - if ((_tO.autoLoad || _tO.autoPlay) && !_tO.serverURL) { - oSound.load(_tO); // call load for non-rtmp streams - } - } - - if (_tO.autoPlay && !_tO.serverURL) { // rtmp will play in onconnect - oSound.play(); - } - return oSound; - }; - - this.destroySound = function(sID, _bFromSound) { - // explicitly destroy a sound before normal page unload, etc. - if (!_idCheck(sID)) { - return false; - } - var oS = _s.sounds[sID], i; - oS._iO = {}; // Disable all callbacks while the sound is being destroyed - oS.stop(); - oS.unload(); - for (i = 0; i < _s.soundIDs.length; i++) { - if (_s.soundIDs[i] === sID) { - _s.soundIDs.splice(i, 1); - break; - } - } - if (!_bFromSound) { - // ignore if being called from SMSound instance - oS.destruct(true); - } - oS = null; - delete _s.sounds[sID]; - return true; - }; - - this.load = function(sID, oOptions) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].load(oOptions); - }; - - this.unload = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].unload(); - }; - - this.play = function(sID, oOptions) { - var fN = _sm+'.play(): '; - if (!_didInit || !_s.ok()) { - _complain(fN + _str(!_didInit?'notReady':'notOK')); - return false; - } - if (!_idCheck(sID)) { - if (!(oOptions instanceof Object)) { - oOptions = { - url: oOptions - }; // overloading use case: play('mySound','/path/to/some.mp3'); - } - if (oOptions && oOptions.url) { - // overloading use case, create+play: .play('someID',{url:'/path/to.mp3'}); - //_s._wD(fN + 'attempting to create "' + sID + '"', 1); - oOptions.id = sID; - return _s.createSound(oOptions).play(); - } else { - return false; - } - } - return _s.sounds[sID].play(oOptions); - }; - - this.start = this.play; // just for convenience - - this.setPosition = function(sID, nMsecOffset) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].setPosition(nMsecOffset); - }; - - this.stop = function(sID) { - if (!_idCheck(sID)) { - return false; - } - //_s._wD(_sm+'.stop(' + sID + ')', 1); - return _s.sounds[sID].stop(); - }; - - this.stopAll = function() { - //_s._wD(_sm+'.stopAll()', 1); - for (var oSound in _s.sounds) { - if (_s.sounds[oSound] instanceof SMSound) { - _s.sounds[oSound].stop(); // apply only to sound objects - } - } - }; - - this.pause = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].pause(); - }; - - this.pauseAll = function() { - for (var i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].pause(); - } - }; - - this.resume = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].resume(); - }; - - this.resumeAll = function() { - for (var i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].resume(); - } - }; - - this.togglePause = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].togglePause(); - }; - - this.setPan = function(sID, nPan) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].setPan(nPan); - }; - - this.setVolume = function(sID, nVol) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].setVolume(nVol); - }; - - this.mute = function(sID) { - var fN = _sm+'.mute(): ', - i = 0; - if (typeof sID !== 'string') { - sID = null; - } - if (!sID) { - //_s._wD(fN + 'Muting all sounds'); - for (i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].mute(); - } - _s.muted = true; - } else { - if (!_idCheck(sID)) { - return false; - } - //_s._wD(fN + 'Muting "' + sID + '"'); - return _s.sounds[sID].mute(); - } - return true; - }; - - this.muteAll = function() { - _s.mute(); - }; - - this.unmute = function(sID) { - var fN = _sm+'.unmute(): ', i; - if (typeof sID !== 'string') { - sID = null; - } - if (!sID) { - //_s._wD(fN + 'Unmuting all sounds'); - for (i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].unmute(); - } - _s.muted = false; - } else { - if (!_idCheck(sID)) { - return false; - } - //_s._wD(fN + 'Unmuting "' + sID + '"'); - return _s.sounds[sID].unmute(); - } - return true; - }; - - this.unmuteAll = function() { - _s.unmute(); - }; - - this.toggleMute = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].toggleMute(); - }; - - this.getMemoryUse = function() { - if (_fV === 8) { - return 0; - } - if (_s.o) { - return parseInt(_s.o._getMemoryUse(), 10); - } - }; - - this.disable = function(bNoDisable) { - // destroy all functions - if (typeof bNoDisable === 'undefined') { - bNoDisable = false; - } - if (_disabled) { - return false; - } - _disabled = true; - //_wDS('shutdown', 1); - for (var i = _s.soundIDs.length; i--;) { - _disableObject(_s.sounds[_s.soundIDs[i]]); - } - _initComplete(bNoDisable); // fire "complete", despite fail - _event.remove(_win, 'load', _initUserOnload); - return true; - }; - - this.canPlayMIME = function(sMIME) { - var result; - if (_s.hasHTML5) { - result = _html5CanPlay({type:sMIME}); - } - if (!_needsFlash || result) { - // no flash, or OK - return result; - } else { - return (sMIME?(sMIME.match(_s.mimePattern)?true:false):null); - } - }; - - this.canPlayURL = function(sURL) { - var result; - if (_s.hasHTML5) { - result = _html5CanPlay(sURL); - } - if (!_needsFlash || result) { - // no flash, or OK - return result; - } else { - return (sURL?(sURL.match(_s.filePattern)?true:false):null); - } - }; - - this.canPlayLink = function(oLink) { - if (typeof oLink.type !== 'undefined' && oLink.type) { - if (_s.canPlayMIME(oLink.type)) { - return true; - } - } - return _s.canPlayURL(oLink.href); - }; - - this.getSoundById = function(sID, suppressDebug) { - if (!sID) { - throw new Error(_sm+'.getSoundById(): sID is null/undefined'); - } - var result = _s.sounds[sID]; - if (!result && !suppressDebug) { - //_s._wD('"' + sID + '" is an invalid sound ID.', 2); - } - return result; - }; - - this.onready = function(oMethod, oScope) { - var sType = 'onready'; - if (oMethod && oMethod instanceof Function) { - if (_didInit) { - //_wDS('queue', sType); - } - if (!oScope) { - oScope = _win; - } - _addOnEvent(sType, oMethod, oScope); - _processOnEvents(); - return true; - } else { - throw _str('needFunction', sType); - } - }; - - this.ontimeout = function(oMethod, oScope) { - var sType = 'ontimeout'; - if (oMethod && oMethod instanceof Function) { - if (_didInit) { - //_wDS('queue'); - } - if (!oScope) { - oScope = _win; - } - _addOnEvent(sType, oMethod, oScope); - _processOnEvents({type:sType}); - return true; - } else { - throw _str('needFunction', sType); - } - }; - - this.getMoviePercent = function() { - return (_s.o && typeof _s.o.PercentLoaded !== 'undefined'?_s.o.PercentLoaded():null); - }; - - this._writeDebug = function(sText, sType, bTimestamp) { - // pseudo-private console.log()-style output - /* - var sDID = 'soundmanager-debug', o, oItem, sMethod; - if (!_s.debugMode) { - return false; - } - if (typeof bTimestamp !== 'undefined' && bTimestamp) { - sText = sText + ' | ' + new Date().getTime(); - } - if (_hasConsole && _s.useConsole) { - sMethod = _debugLevels[sType]; - if (typeof console[sMethod] !== 'undefined') { - console[sMethod](sText); - } else { - console.log(sText); - } - if (_s.useConsoleOnly) { - return true; - } - } - try { - o = _id(sDID); - if (!o) { - return false; - } - oItem = _doc.createElement('div'); - if (++_wdCount % 2 === 0) { - oItem.className = 'sm2-alt'; - } - if (typeof sType === 'undefined') { - sType = 0; - } else { - sType = parseInt(sType, 10); - } - oItem.appendChild(_doc.createTextNode(sText)); - if (sType) { - if (sType >= 2) { - oItem.style.fontWeight = 'bold'; - } - if (sType === 3) { - oItem.style.color = '#ff3333'; - } - } - // o.appendChild(oItem); // top-to-bottom - o.insertBefore(oItem, o.firstChild); // bottom-to-top - } catch(e) { - // oh well - } - o = null; - */ - return true; - }; - this._wD = this._writeDebug; // alias - - this._debug = function() { - /* - //_wDS('currentObj', 1); - for (var i = 0, j = _s.soundIDs.length; i < j; i++) { - _s.sounds[_s.soundIDs[i]]._debug(); - } - */ - }; - - this.reboot = function() { - // attempt to reset and init SM2 - //_s._wD(_sm+'.reboot()'); - if (_s.soundIDs.length) { - //_s._wD('Destroying ' + _s.soundIDs.length + ' SMSound objects...'); - } - var i, j; - for (i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].destruct(); - } - // trash ze flash - try { - if (_isIE) { - _oRemovedHTML = _s.o.innerHTML; - } - _oRemoved = _s.o.parentNode.removeChild(_s.o); - //_s._wD('Flash movie removed.'); - } catch(e) { - // uh-oh. - //_wDS('badRemove', 2); - } - // actually, force recreate of movie. - _oRemovedHTML = _oRemoved = null; - _s.enabled = _didInit = _waitingForEI = _initPending = _didAppend = _appendSuccess = _disabled = _s.swfLoaded = false; - _s.soundIDs = _s.sounds = []; - _s.o = null; - for (i in _on_queue) { - if (_on_queue.hasOwnProperty(i)) { - for (j = _on_queue[i].length; j--;) { - _on_queue[i][j].fired = false; - } - } - } - //_s._wD(_sm + ': Rebooting...'); - _win.setTimeout(function() { - _s.beginDelayedInit(); - }, 20); - }; - - this.destruct = function() { - //_s._wD(_sm+'.destruct()'); - _s.disable(true); - }; - - this.beginDelayedInit = function() { - // //_s._wD(_sm+'.beginDelayedInit()'); - _windowLoaded = true; - _dcLoaded(); - setTimeout(_beginInit, 20); - _delayWaitForEI(); - }; - - - // Wrap html5 event handlers so we don't call them on destroyed sounds - function _html5_event(oFn) { - return function(e) { - if (!this._t || !this._t._a) { - if (this._t && this._t.sID) { - //_s._wD(_h5+'ignoring '+e.type+': '+this._t.sID); - } else { - //_s._wD(_h5+'ignoring '+e.type); - } - return null; - } else { - return oFn.call(this, e); - } - }; - } - - this._html5_events = { - - // HTML5 event-name-to-handler map - abort: _html5_event(function(e) { - //_s._wD(_h5+'abort: '+this._t.sID); - }), - - // enough has loaded to play - canplay: _html5_event(function(e) { - //_s._wD(_h5+'canplay: '+this._t.sID+', '+this._t.url); - this._t._onbufferchange(0); - var position1K = (!isNaN(this._t.position)?this._t.position/1000:null); - // set the position if position was set before the sound loaded - this._t._html5_canplay = true; - if (this._t.position && this.currentTime !== position1K) { - //_s._wD(_h5+'canplay: setting position to '+position1K+''); - try { - this.currentTime = position1K; - } catch(ee) { - //_s._wD(_h5+'setting position failed: '+ee.message, 2); - } - } - }), - - load: _html5_event(function(e) { - if (!this._t.loaded) { - this._t._onbufferchange(0); - // should be 1, and the same - this._t._whileloading(this._t.bytesTotal, this._t.bytesTotal, this._t._get_html5_duration()); - this._t._onload(true); - } - }), - - emptied: _html5_event(function(e) { - //_s._wD(_h5+'emptied: '+this._t.sID); - }), - - ended: _html5_event(function(e) { - //_s._wD(_h5+'ended: '+this._t.sID); - this._t._onfinish(); - }), - - error: _html5_event(function(e) { - //_s._wD(_h5+'error: '+this.error.code); - // call load with error state? - this._t._onload(false); - }), - - loadeddata: _html5_event(function(e) { - //_s._wD(_h5+'loadeddata: '+this._t.sID); - }), - - loadedmetadata: _html5_event(function(e) { - //_s._wD(_h5+'loadedmetadata: '+this._t.sID); - }), - - loadstart: _html5_event(function(e) { - //_s._wD(_h5+'loadstart: '+this._t.sID); - // assume buffering at first - this._t._onbufferchange(1); - }), - - play: _html5_event(function(e) { - //_s._wD(_h5+'play: '+this._t.sID+', '+this._t.url); - // once play starts, no buffering - this._t._onbufferchange(0); - }), - - // TODO: verify if this is actually implemented anywhere yet. - playing: _html5_event(function(e) { - //_s._wD(_h5+'playing: '+this._t.sID+', '+this._t.url); - // once play starts, no buffering - this._t._onbufferchange(0); - }), - - progress: _html5_event(function(e) { - - if (this._t.loaded) { - return false; - } - - var i, j, str, loadSum = 0, buffered = 0, - isProgress = (e.type === 'progress'), - ranges = e.target.buffered, - loaded = (e.loaded||0), // firefox 3.6 implements e.loaded/total (bytes) - total = (e.total||1); - - if (ranges && ranges.length) { - - // if loaded is 0, try TimeRanges implementation as % of load - // https://developer.mozilla.org/en/DOM/TimeRanges - for (i=ranges.length; i--;) { - buffered = (ranges.end(i) - ranges.start(i)); - } - - // linear case, buffer sum; does not account for seeking and HTTP partials / byte ranges - loaded = buffered/e.target.duration; - - /* - if (isProgress && ranges.length > 1) { - str = []; - j = ranges.length; - for (i=0; i 0. - // Another reason is because options like volume won't have been applied yet. - if (_t.paused && _t.position && _t.position > 0) { // https://gist.github.com/37b17df75cc4d7a90bf6 - //_s._wD(fN + '"' + _t.sID + '" is resuming from paused state',1); - _t.resume(); - } else { - //_s._wD(fN+'"'+ _t.sID+'" is starting to play'); - _t.playState = 1; - _t.paused = false; - if (!_t.instanceCount || _t._iO.multiShotEvents || (_fV > 8 && !_t.isHTML5 && !_t.getAutoPlay())) { - _t.instanceCount++; - } - _t.position = (typeof _t._iO.position !== 'undefined' && !isNaN(_t._iO.position)?_t._iO.position:0); - if (!_t.isHTML5) { - _t._iO = _policyFix(_loopFix(_t._iO)); - } - if (_t._iO.onplay && _updatePlayState) { - _t._iO.onplay.apply(_t); - _t._onplay_called = true; - } - _t.setVolume(_t._iO.volume, true); - _t.setPan(_t._iO.pan, true); - if (!_t.isHTML5) { - _s.o._start(_t.sID, _t._iO.loops || 1, (_fV === 9?_t.position:_t.position / 1000)); - } else { - _start_html5_timer(); - _t._setup_html5().play(); - } - } - return _t; - }; - - this.start = this.play; // just for convenience - - this.stop = function(bAll) { - if (_t.playState === 1) { - _t._onbufferchange(0); - _t.resetOnPosition(0); - if (!_t.isHTML5) { - _t.playState = 0; - } - _t.paused = false; - if (_t._iO.onstop) { - _t._iO.onstop.apply(_t); - } - if (!_t.isHTML5) { - _s.o._stop(_t.sID, bAll); - // hack for netStream: just unload - if (_t._iO.serverURL) { - _t.unload(); - } - } else { - if (_t._a) { - _t.setPosition(0); // act like Flash, though - _t._a.pause(); // html5 has no stop() - _t.playState = 0; - _t._onTimer(); // and update UI - _stop_html5_timer(); - _t.unload(); - } - } - _t.instanceCount = 0; - _t._iO = {}; - } - return _t; - }; - - this.setAutoPlay = function(autoPlay) { - //_s._wD('sound '+_t.sID+' turned autoplay ' + (autoPlay ? 'on' : 'off')); - _t._iO.autoPlay = autoPlay; - if (_t.isHTML5) { - if (_t._a && autoPlay) { - _t.play(); // HTML5 onload isn't reliable - } - } else { - _s.o._setAutoPlay(_t.sID, autoPlay); - } - if (autoPlay) { - // only increment the instanceCount if the sound isn't loaded (TODO: verify RTMP) - if (!_t.instanceCount && _t.readyState === 1) { - _t.instanceCount++; - //_s._wD('sound '+_t.sID+' incremented instance count to '+_t.instanceCount); - } - } - }; - - this.getAutoPlay = function() { - return _t._iO.autoPlay; - }; - - this.setPosition = function(nMsecOffset, bNoDebug) { - if (nMsecOffset === undefined) { - nMsecOffset = 0; - } - // Use the duration from the instance options, if we don't have a track duration yet. - var original_pos, position, position1K, offset = (_t.isHTML5 ? Math.max(nMsecOffset,0) : Math.min(_t.duration || _t._iO.duration, Math.max(nMsecOffset, 0))); // position >= 0 and <= current available (loaded) duration - original_pos = _t.position; - _t.position = offset; - position1K = _t.position/1000; - _t.resetOnPosition(_t.position); - _t._iO.position = offset; - if (!_t.isHTML5) { - position = _fV === 9 ? _t.position : position1K; - if (_t.readyState && _t.readyState !== 2) { - _s.o._setPosition(_t.sID, position, (_t.paused || !_t.playState)); // if paused or not playing, will not resume (by playing) - } - } else if (_t._a) { - // Set the position in the canplay handler if the sound is not ready yet - if (_t._html5_canplay) { - if (_t._a.currentTime !== position1K) { - // Only set the position if we need to. - // DOM/JS errors/exceptions to watch out for: - // if seek is beyond (loaded?) position, "DOM exception 11" - // "INDEX_SIZE_ERR": DOM exception 1 - //_s._wD('setPosition('+position1K+'): setting position'); - try { - _t._a.currentTime = position1K; - } catch(e) { - //_s._wD('setPosition('+position1K+'): setting position failed: '+e.message, 2); - } - } - } else { - //_s._wD('setPosition('+position1K+'): delaying, sound not ready'); - } - } - if (_t.isHTML5) { - if (_t.paused) { // if paused, refresh UI right away - _t._onTimer(true); // force update - } - } - return _t; - }; - - this.pause = function(bCallFlash) { - if (_t.paused || (_t.playState === 0 && _t.readyState !== 1)) { - return _t; - } - //_s._wD('SMSound.pause()'); - _t.paused = true; - if (!_t.isHTML5) { - if (bCallFlash || bCallFlash === undefined) { - _s.o._pause(_t.sID); - } - } else { - _t._setup_html5().pause(); - _stop_html5_timer(); - } - if (_t._iO.onpause) { - _t._iO.onpause.apply(_t); - } - return _t; - }; - - // When auto-loaded streams pause on buffer full they have a playState of 0. - // We need to make sure that the playState is set to 1 when these streams "resume". - // - // When a paused stream is resumed, we need to trigger the onplay() callback if it - // hasn't been called already. In this case since the sound is being played for the - // first time, I think it's more appropriate to call onplay() rather than onresume(). - this.resume = function() { - if (!_t.paused) { - return _t; - } - //_s._wD('SMSound.resume()'); - _t.paused = false; - _t.playState = 1; - if (!_t.isHTML5) { - if (_t._iO.isMovieStar) { - // Bizarre Webkit bug (Chrome reported via 8tracks.com dudes): AAC content paused for 30+ seconds(?) will not resume without a reposition. - _t.setPosition(_t.position); - } - _s.o._pause(_t.sID); // flash method is toggle-based (pause/resume) - } else { - _t._setup_html5().play(); - _start_html5_timer(); - } - if (!_t._onplay_called && _t._iO.onplay) { - _t._iO.onplay.apply(_t); - _t._onplay_called = true; - } else if (_t._iO.onresume) { - _t._iO.onresume.apply(_t); - } - return _t; - }; - - this.togglePause = function() { - //_s._wD('SMSound.togglePause()'); - if (_t.playState === 0) { - _t.play({ - position: (_fV === 9 && !_t.isHTML5 ? _t.position:_t.position / 1000) - }); - return _t; - } - if (_t.paused) { - _t.resume(); - } else { - _t.pause(); - } - return _t; - }; - - this.setPan = function(nPan, bInstanceOnly) { - if (typeof nPan === 'undefined') { - nPan = 0; - } - if (typeof bInstanceOnly === 'undefined') { - bInstanceOnly = false; - } - if (!_t.isHTML5) { - _s.o._setPan(_t.sID, nPan); - } // else { no HTML5 pan? } - _t._iO.pan = nPan; - if (!bInstanceOnly) { - _t.pan = nPan; - _t.options.pan = nPan; - } - return _t; - }; - - this.setVolume = function(nVol, bInstanceOnly) { - if (typeof nVol === 'undefined') { - nVol = 100; - } - if (typeof bInstanceOnly === 'undefined') { - bInstanceOnly = false; - } - if (!_t.isHTML5) { - _s.o._setVolume(_t.sID, (_s.muted && !_t.muted) || _t.muted?0:nVol); - } else if (_t._a) { - _t._a.volume = Math.max(0, Math.min(1, nVol/100)); // valid range: 0-1 - } - _t._iO.volume = nVol; - if (!bInstanceOnly) { - _t.volume = nVol; - _t.options.volume = nVol; - } - return _t; - }; - - this.mute = function() { - _t.muted = true; - if (!_t.isHTML5) { - _s.o._setVolume(_t.sID, 0); - } else if (_t._a) { - _t._a.muted = true; - } - return _t; - }; - - this.unmute = function() { - _t.muted = false; - var hasIO = typeof _t._iO.volume !== 'undefined'; - if (!_t.isHTML5) { - _s.o._setVolume(_t.sID, hasIO?_t._iO.volume:_t.options.volume); - } else if (_t._a) { - _t._a.muted = false; - } - return _t; - }; - - this.toggleMute = function() { - return (_t.muted?_t.unmute():_t.mute()); - }; - - this.onposition = function(nPosition, oMethod, oScope) { - // TODO: allow for ranges, too? eg. (nPosition instanceof Array) - _t._onPositionItems.push({ - position: nPosition, - method: oMethod, - scope: (typeof oScope !== 'undefined'?oScope:_t), - fired: false - }); - return _t; - }; - - this.processOnPosition = function() { - var i, item, j = _t._onPositionItems.length; - if (!j || !_t.playState || _t._onPositionFired >= j) { - return false; - } - for (i=j; i--;) { - item = _t._onPositionItems[i]; - if (!item.fired && _t.position >= item.position) { - item.method.apply(item.scope,[item.position]); - item.fired = true; - _s._onPositionFired++; - } - } - return true; - }; - - this.resetOnPosition = function(nPosition) { - // reset "fired" for items interested in this position - var i, item, j = _t._onPositionItems.length; - if (!j) { - return false; - } - for (i=j; i--;) { - item = _t._onPositionItems[i]; - if (item.fired && nPosition <= item.position) { - item.fired = false; - _s._onPositionFired--; - } - } - return true; - }; - - // pseudo-private soundManager reference - - this._onTimer = function(bForce) { - // HTML5-only _whileplaying() etc. - var time, x = {}; - if (_t._hasTimer || bForce) { - if (_t._a && (bForce || ((_t.playState > 0 || _t.readyState === 1) && !_t.paused))) { // TODO: May not need to track readyState (1 = loading) - _t.duration = _t._get_html5_duration(); - _t.durationEstimate = _t.duration; - time = _t._a.currentTime?_t._a.currentTime*1000:0; - _t._whileplaying(time,x,x,x,x); - return true; - } else { - //_s._wD('_onTimer: Warn for "'+_t.sID+'": '+(!_t._a?'Could not find element. ':'')+(_t.playState === 0?'playState bad, 0?':'playState = '+_t.playState+', OK')); - return false; - } - } - }; - - // --- private internals --- - - this._get_html5_duration = function() { - var d = (_t._a ? _t._a.duration*1000 : (_t._iO ? _t._iO.duration : undefined)); - return (d && !isNaN(d) && d !== Infinity ? d : (_t._iO ? _t._iO.duration : null)); - }; - - _start_html5_timer = function() { - if (_t.isHTML5) { - _startTimer(_t); - } - }; - - _stop_html5_timer = function() { - if (_t.isHTML5) { - _stopTimer(_t); - } - }; - - _resetProperties = function(bLoaded) { - _t._onPositionItems = []; - _t._onPositionFired = 0; - _t._hasTimer = null; - _t._onplay_called = false; - _t._a = null; - _t._html5_canplay = false; - _t.bytesLoaded = null; - _t.bytesTotal = null; - _t.position = null; - _t.duration = (_t._iO && _t._iO.duration?_t._iO.duration:null); - _t.durationEstimate = null; - _t.failures = 0; - _t.loaded = false; - _t.playState = 0; - _t.paused = false; - _t.readyState = 0; // 0 = uninitialised, 1 = loading, 2 = failed/error, 3 = loaded/success - _t.muted = false; - _t.didBeforeFinish = false; - _t.didJustBeforeFinish = false; - _t.isBuffering = false; - _t.instanceOptions = {}; - _t.instanceCount = 0; - _t.peakData = { - left: 0, - right: 0 - }; - _t.waveformData = { - left: [], - right: [] - }; - _t.eqData = []; // legacy: 1D array - _t.eqData.left = []; - _t.eqData.right = []; - }; - - _resetProperties(); - - // pseudo-private methods used by soundManager - - this._setup_html5 = function(oOptions) { - var _iO = _mixin(_t._iO, oOptions), d = decodeURI, - _a = _useGlobalHTML5Audio ? _s._global_a : _t._a, - _dURL = d(_iO.url), - _oldIO = (_a && _a._t ? _a._t.instanceOptions : null); - if (_a) { - if (_a._t && _oldIO.url === _iO.url && (!_t._lastURL || (_t._lastURL === _oldIO.url))) { - return _a; // same url, ignore request - } - //_s._wD('setting new URL on existing object: ' + _dURL + (_t._lastURL ? ', old URL: ' + _t._lastURL : '')); - /* - * "First things first, I, Poppa.." (reset the previous state of the old sound, if playing) - * Fixes case with devices that can only play one sound at a time - * Otherwise, other sounds in mid-play will be terminated without warning and in a stuck state - */ - if (_useGlobalHTML5Audio && _a._t && _a._t.playState && _iO.url !== _oldIO.url) { - _a._t.stop(); - } - _resetProperties(); // new URL, so reset load/playstate and so on - _a.src = _iO.url; - _t.url = _iO.url; - _t._lastURL = _iO.url; - _a._called_load = false; - } else { - //_s._wD('creating HTML5 Audio() element with URL: '+_dURL); - _a = new Audio(_iO.url); - _a._called_load = false; - if (_useGlobalHTML5Audio) { - _s._global_a = _a; - } - } - _t.isHTML5 = true; - _t._a = _a; // store a ref on the track - _a._t = _t; // store a ref on the audio - _t._add_html5_events(); - _a.loop = (_iO.loops>1?'loop':''); - if (_iO.autoLoad || _iO.autoPlay) { - _a.autobuffer = 'auto'; // early HTML5 implementation (non-standard) - _a.preload = 'auto'; // standard - _t.load(); - _a._called_load = true; - } else { - _a.autobuffer = false; // early HTML5 implementation (non-standard) - _a.preload = 'none'; // standard - } - _a.loop = (_iO.loops>1?'loop':''); // boolean instead of "loop", for webkit? - spec says string. http://www.w3.org/TR/html-markup/audio.html#audio.attrs.loop - return _a; - }; - - // related private methods - - this._add_html5_events = function() { - if (_t._a._added_events) { - return false; - } - - var f; - - function add(oEvt, oFn, bCapture) { - return _t._a ? _t._a.addEventListener(oEvt, oFn, bCapture||false) : null; - } - - //_s._wD(_h5+'adding event listeners: '+_t.sID); - _t._a._added_events = true; - - for (f in _s._html5_events) { - if (_s._html5_events.hasOwnProperty(f)) { - add(f, _s._html5_events[f]); - } - } - - return true; - }; - - // Keep this externally accessible - this._remove_html5_events = function() { - // Remove event listeners - function remove(oEvt, oFn, bCapture) { - return (_t._a ? _t._a.removeEventListener(oEvt, oFn, bCapture||false) : null); - } - //_s._wD(_h5+'removing event listeners: '+_t.sID); - _t._a._added_events = false; - - for (var f in _s._html5_events) { - if (_s._html5_events.hasOwnProperty(f)) { - remove(f, _s._html5_events[f]); - } - } - }; - - // --- "private" methods called by Flash --- - - this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) { - _t.bytesLoaded = nBytesLoaded; - _t.bytesTotal = nBytesTotal; - _t.duration = Math.floor(nDuration); - _t.bufferLength = nBufferLength; - if (!_t._iO.isMovieStar) { - if (_t._iO.duration) { - // use options, if specified and larger - _t.durationEstimate = (_t.duration > _t._iO.duration) ? _t.duration : _t._iO.duration; - } else { - _t.durationEstimate = parseInt((_t.bytesTotal / _t.bytesLoaded) * _t.duration, 10); - } - if (_t.durationEstimate === undefined) { - _t.durationEstimate = _t.duration; - } - if (_t.readyState !== 3 && _t._iO.whileloading) { - _t._iO.whileloading.apply(_t); - } - } else { - _t.durationEstimate = _t.duration; - if (_t.readyState !== 3 && _t._iO.whileloading) { - _t._iO.whileloading.apply(_t); - } - } - }; - - this._onid3 = function(oID3PropNames, oID3Data) { - // oID3PropNames: string array (names) - // ID3Data: string array (data) - //_s._wD('SMSound._onid3(): "' + this.sID + '" ID3 data received.'); - var oData = [], i, j; - for (i = 0, j = oID3PropNames.length; i < j; i++) { - oData[oID3PropNames[i]] = oID3Data[i]; - } - _t.id3 = _mixin(_t.id3, oData); - if (_t._iO.onid3) { - _t._iO.onid3.apply(_t); - } - }; - - this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) { - if (isNaN(nPosition) || nPosition === null) { - return false; // flash safety net - } - if (_t.playState === 0 && nPosition > 0) { - // invalid position edge case for end/stop - nPosition = 0; - } - _t.position = nPosition; - _t.processOnPosition(); - if (_fV > 8 && !_t.isHTML5) { - if (_t._iO.usePeakData && typeof oPeakData !== 'undefined' && oPeakData) { - _t.peakData = { - left: oPeakData.leftPeak, - right: oPeakData.rightPeak - }; - } - if (_t._iO.useWaveformData && typeof oWaveformDataLeft !== 'undefined' && oWaveformDataLeft) { - _t.waveformData = { - left: oWaveformDataLeft.split(','), - right: oWaveformDataRight.split(',') - }; - } - if (_t._iO.useEQData) { - if (typeof oEQData !== 'undefined' && oEQData && oEQData.leftEQ) { - var eqLeft = oEQData.leftEQ.split(','); - _t.eqData = eqLeft; - _t.eqData.left = eqLeft; - if (typeof oEQData.rightEQ !== 'undefined' && oEQData.rightEQ) { - _t.eqData.right = oEQData.rightEQ.split(','); - } - } - } - } - if (_t.playState === 1) { - // special case/hack: ensure buffering is false if loading from cache (and not yet started) - if (!_t.isHTML5 && _s.flashVersion === 8 && !_t.position && _t.isBuffering) { - _t._onbufferchange(0); - } - if (_t._iO.whileplaying) { - _t._iO.whileplaying.apply(_t); // flash may call after actual finish - } - if ((_t.loaded || (!_t.loaded && _t._iO.isMovieStar)) && _t._iO.onbeforefinish && _t._iO.onbeforefinishtime && !_t.didBeforeFinish && _t.duration - _t.position <= _t._iO.onbeforefinishtime) { - _t._onbeforefinish(); - } - } - return true; - }; - - // Only applies to RTMP - this._onconnect = function(bSuccess) { - var fN = 'SMSound._onconnect(): '; - bSuccess = (bSuccess === 1); - //_s._wD(fN+'"'+_t.sID+'"'+(bSuccess?' connected.':' failed to connect? - '+_t.url), (bSuccess?1:2)); - _t.connected = bSuccess; - if (bSuccess) { - _t.failures = 0; - if (_idCheck(_t.sID)) { - if (_t.getAutoPlay()) { - _t.play(undefined, _t.getAutoPlay()); // only update the play state if auto playing - } else if (_t._iO.autoLoad) { - _t.load(); - } - } - if (_t._iO.onconnect) { - _t._iO.onconnect.apply(_t,[bSuccess]); - } - } - }; - - this._onload = function(nSuccess) { - var fN = 'SMSound._onload(): ', loadOK = (nSuccess?true:false); - //_s._wD(fN + '"' + _t.sID + '"' + (loadOK?' loaded.':' failed to load? - ' + _t.url), (loadOK?1:2)); - /* - if (!loadOK && !_t.isHTML5) { - if (_s.sandbox.noRemote === true) { - //_s._wD(fN + _str('noNet'), 1); - } - if (_s.sandbox.noLocal === true) { - //_s._wD(fN + _str('noLocal'), 1); - } - } - */ - _t.loaded = loadOK; - _t.readyState = loadOK?3:2; - _t._onbufferchange(0); - if (_t._iO.onload) { - _t._iO.onload.apply(_t, [loadOK]); - } - return true; - }; - - // fire onfailure() only once at most - // at this point we just recreate failed sounds rather than trying to reconnect. - this._onfailure = function(msg, level, code) { - _t.failures++; - //_s._wD('SMSound._onfailure(): "'+_t.sID+'" count '+_t.failures); - if (_t._iO.onfailure && _t.failures === 1) { - _t._iO.onfailure(_t, msg, level, code); - } else { - //_s._wD('SMSound._onfailure(): ignoring'); - } - }; - - this._onbeforefinish = function() { - if (!_t.didBeforeFinish) { - _t.didBeforeFinish = true; - if (_t._iO.onbeforefinish) { - //_s._wD('SMSound._onbeforefinish(): "' + _t.sID + '"'); - _t._iO.onbeforefinish.apply(_t); - } - } - }; - - this._onjustbeforefinish = function(msOffset) { - if (!_t.didJustBeforeFinish) { - _t.didJustBeforeFinish = true; - if (_t._iO.onjustbeforefinish) { - //_s._wD('SMSound._onjustbeforefinish(): "' + _t.sID + '"'); - _t._iO.onjustbeforefinish.apply(_t); - } - } - }; - - this._onfinish = function() { - // //_s._wD('SMSound._onfinish(): "' + _t.sID + '" got instanceCount '+_t.instanceCount); - var _io_onfinish = _t._iO.onfinish; // store local copy before it gets trashed.. - _t._onbufferchange(0); - _t.resetOnPosition(0); - if (_t._iO.onbeforefinishcomplete) { - _t._iO.onbeforefinishcomplete.apply(_t); - } - // reset some state items - _t.didBeforeFinish = false; - _t.didJustBeforeFinish = false; - if (_t.instanceCount) { - _t.instanceCount--; - if (!_t.instanceCount) { - // reset instance options - _t.playState = 0; - _t.paused = false; - _t.instanceCount = 0; - _t.instanceOptions = {}; - _t._iO = {}; - _stop_html5_timer(); - } - if (!_t.instanceCount || _t._iO.multiShotEvents) { - // fire onfinish for last, or every instance - if (_io_onfinish) { - //_s._wD('SMSound._onfinish(): "' + _t.sID + '"'); - _io_onfinish.apply(_t); - } - } - } - }; - - this._onbufferchange = function(nIsBuffering) { - var fN = 'SMSound._onbufferchange()'; - if (_t.playState === 0) { - // ignore if not playing - return false; - } - if ((nIsBuffering && _t.isBuffering) || (!nIsBuffering && !_t.isBuffering)) { - return false; - } - _t.isBuffering = (nIsBuffering === 1); - if (_t._iO.onbufferchange) { - //_s._wD(fN + ': ' + nIsBuffering); - _t._iO.onbufferchange.apply(_t); - } - return true; - }; - - this._ondataerror = function(sError) { - // flash 9 wave/eq data handler - if (_t.playState > 0) { // hack: called at start, and end from flash at/after onfinish() - //_s._wD('SMSound._ondataerror(): ' + sError); - if (_t._iO.ondataerror) { - _t._iO.ondataerror.apply(_t); - } - } - }; - - }; // SMSound() - - // --- private SM2 internals --- - - _getDocument = function() { - return (_doc.body?_doc.body:(_doc._docElement?_doc.documentElement:_doc.getElementsByTagName('div')[0])); - }; - - _id = function(sID) { - return _doc.getElementById(sID); - }; - - _mixin = function(oMain, oAdd) { - // non-destructive merge - var o1 = {}, i, o2, o; - for (i in oMain) { // clone c1 - if (oMain.hasOwnProperty(i)) { - o1[i] = oMain[i]; - } - } - o2 = (typeof oAdd === 'undefined'?_s.defaultOptions:oAdd); - for (o in o2) { - if (o2.hasOwnProperty(o) && typeof o1[o] === 'undefined') { - o1[o] = o2[o]; - } - } - return o1; - }; - - _event = (function() { - - var old = (_win.attachEvent), - evt = { - add: (old?'attachEvent':'addEventListener'), - remove: (old?'detachEvent':'removeEventListener') - }; - - function getArgs(oArgs) { - var args = _slice.call(oArgs), len = args.length; - if (old) { - args[1] = 'on' + args[1]; // prefix - if (len > 3) { - args.pop(); // no capture - } - } else if (len === 3) { - args.push(false); - } - return args; - } - - function apply(args, sType) { - var element = args.shift(), - method = [evt[sType]]; - if (old) { - element[method](args[0], args[1]); - } else { - element[method].apply(element, args); - } - } - - function add() { - apply(getArgs(arguments), 'add'); - } - - function remove() { - apply(getArgs(arguments), 'remove'); - } - - return { - 'add': add, - 'remove': remove - }; - - }()); - - _html5OK = function(iO) { - return (!iO.serverURL && (iO.type?_html5CanPlay({type:iO.type}):_html5CanPlay(iO.url)||_html5Only)); // Use type, if specified. If HTML5-only mode, no other options, so just give 'er - }; - - _html5CanPlay = function(sURL) { - // try to find MIME, test and return truthiness - if (!_s.useHTML5Audio || !_s.hasHTML5) { - return false; - } - var result, mime, offset, fileExt, item, aF = _s.audioFormats; - if (!_html5Ext) { - _html5Ext = []; - for (item in aF) { - if (aF.hasOwnProperty(item)) { - _html5Ext.push(item); - if (aF[item].related) { - _html5Ext = _html5Ext.concat(aF[item].related); - } - } - } - _html5Ext = new RegExp('\\.('+_html5Ext.join('|')+')','i'); - } - mime = (typeof sURL.type !== 'undefined'?sURL.type:null); - fileExt = (typeof sURL === 'string'?sURL.toLowerCase().match(_html5Ext):null); // TODO: Strip URL queries, etc. - if (!fileExt || !fileExt.length) { - if (!mime) { - return false; - } else { - // audio/mp3 -> mp3, result should be known - offset = mime.indexOf(';'); - fileExt = (offset !== -1?mime.substr(0,offset):mime).substr(6); // strip "audio/X; codecs.." - } - } else { - fileExt = fileExt[0].substr(1); // "mp3", for example - } - if (fileExt && typeof _s.html5[fileExt] !== 'undefined') { - // result known - return _s.html5[fileExt]; - } else { - if (!mime) { - if (fileExt && _s.html5[fileExt]) { - return _s.html5[fileExt]; - } else { - // best-case guess, audio/whatever-dot-filename-format-you're-playing - mime = 'audio/'+fileExt; - } - } - result = _s.html5.canPlayType(mime); - _s.html5[fileExt] = result; - // //_s._wD('canPlayType, found result: '+result); - return result; - } - }; - - _testHTML5 = function() { - if (!_s.useHTML5Audio || typeof Audio === 'undefined') { - return false; - } - // double-whammy: Opera 9.64 throws WRONG_ARGUMENTS_ERR if no parameter passed to Audio(), and Webkit + iOS happily tries to load "null" as a URL. :/ - var a = (typeof Audio !== 'undefined' ? (_isOpera ? new Audio(null) : new Audio()) : null), item, support = {}, aF, i, _hasFlash = _detectFlash(); - function _cp(m) { - var canPlay, i, j, isOK = false; - if (!a || typeof a.canPlayType !== 'function') { - return false; - } - if (m instanceof Array) { - // iterate through all mime types, return any successes - for (i=0, j=m.length; i 1 && sOpt.stream) { - //_wDS('as2loop'); - sOpt.stream = false; - } - return sOpt; - }; - - _policyFix = function(sOpt, sPre) { - if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) { - //_s._wD((sPre?sPre+':':'') + _str('policy')); - sOpt.usePolicyFile = true; - } - return sOpt; - }; - - _complain = function(sMsg) { - if (typeof console !== 'undefined' && typeof console.warn !== 'undefined') { - console.warn(sMsg); - } else { - //_s._wD(sMsg); - } - }; - - _doNothing = function() { - return false; - }; - - _disableObject = function(o) { - for (var oProp in o) { - if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') { - o[oProp] = _doNothing; - } - } - oProp = null; - }; - - _failSafely = function(bNoDisable) { - // general failure exception handler - if (typeof bNoDisable === 'undefined') { - bNoDisable = false; - } - if (_disabled || bNoDisable) { - //_wDS('smFail', 2); - _s.disable(bNoDisable); - } - }; - - _normalizeMovieURL = function(smURL) { - var urlParams = null; - if (smURL) { - if (smURL.match(/\.swf(\?.*)?$/i)) { - urlParams = smURL.substr(smURL.toLowerCase().lastIndexOf('.swf?') + 4); - if (urlParams) { - return smURL; // assume user knows what they're doing - } - } else if (smURL.lastIndexOf('/') !== smURL.length - 1) { - smURL = smURL + '/'; - } - } - return (smURL && smURL.lastIndexOf('/') !== - 1?smURL.substr(0, smURL.lastIndexOf('/') + 1):'./') + _s.movieURL; - }; - - _setVersionInfo = function() { - if (_fV !== 8 && _fV !== 9) { - //_s._wD(_str('badFV', _fV, _defaultFlashVersion)); - _s.flashVersion = _defaultFlashVersion; - } - var isDebug = (_s.debugMode || _s.debugFlash?'_debug.swf':'.swf'); // debug flash movie, if applicable - if (_s.useHTML5Audio && !_html5Only && _s.audioFormats.mp4.required && _s.flashVersion < 9) { - //_s._wD(_str('needfl9')); - _s.flashVersion = 9; - } - _fV = _s.flashVersion; // short-hand for internal use - _s.version = _s.versionNumber + (_html5Only?' (HTML5-only mode)':(_fV === 9?' (AS3/Flash 9)':' (AS2/Flash 8)')); - // set up default options - if (_fV > 8) { - _s.defaultOptions = _mixin(_s.defaultOptions, _s.flash9Options); - _s.features.buffering = true; - } - if (_fV > 8 && _s.useMovieStar) { - // flash 9+ support for movieStar formats as well as MP3 - _s.defaultOptions = _mixin(_s.defaultOptions, _s.movieStarOptions); - _s.filePatterns.flash9 = new RegExp('\\.(mp3|' + _s.netStreamTypes.join('|') + ')(\\?.*)?$', 'i'); - _s.mimePattern = _s.netStreamMimeTypes; - _s.features.movieStar = true; - } else { - _s.useMovieStar = false; - _s.features.movieStar = false; - } - _s.filePattern = _s.filePatterns[(_fV !== 8?'flash9':'flash8')]; - _s.movieURL = (_fV === 8?'soundmanager2.swf':'soundmanager2_flash9.swf').replace('.swf',isDebug); - _s.features.peakData = _s.features.waveformData = _s.features.eqData = (_fV > 8); - }; - - _setPolling = function(bPolling, bHighPerformance) { - if (!_s.o || !_s.allowPolling) { - return false; - } - _s.o._setPolling(bPolling, bHighPerformance); - }; - - function _initDebug() { - if (_s.debugURLParam.test(_wl)) { - _s.debugMode = true; // allow force of debug mode via URL - } - /* - if (_id(_s.debugID)) { - return false; - } - var oD, oDebug, oTarget, oToggle, tmp; - if (_s.debugMode && !_id(_s.debugID) && ((!_hasConsole || !_s.useConsole) || (_s.useConsole && _hasConsole && !_s.consoleOnly))) { - oD = _doc.createElement('div'); - oD.id = _s.debugID + '-toggle'; - oToggle = { - 'position': 'fixed', - 'bottom': '0px', - 'right': '0px', - 'width': '1.2em', - 'height': '1.2em', - 'lineHeight': '1.2em', - 'margin': '2px', - 'textAlign': 'center', - 'border': '1px solid #999', - 'cursor': 'pointer', - 'background': '#fff', - 'color': '#333', - 'zIndex': 10001 - }; - oD.appendChild(_doc.createTextNode('-')); - oD.onclick = _toggleDebug; - oD.title = 'Toggle SM2 debug console'; - if (_ua.match(/msie 6/i)) { - oD.style.position = 'absolute'; - oD.style.cursor = 'hand'; - } - for (tmp in oToggle) { - if (oToggle.hasOwnProperty(tmp)) { - oD.style[tmp] = oToggle[tmp]; - } - } - oDebug = _doc.createElement('div'); - oDebug.id = _s.debugID; - oDebug.style.display = (_s.debugMode?'block':'none'); - if (_s.debugMode && !_id(oD.id)) { - try { - oTarget = _getDocument(); - oTarget.appendChild(oD); - } catch(e2) { - throw new Error(_str('appXHTML')); - } - oTarget.appendChild(oDebug); - } - } - oTarget = null; - */ - } - - _createMovie = function(smID, smURL) { - - var specialCase = null, - remoteURL = (smURL?smURL:_s.url), - localURL = (_s.altURL?_s.altURL:remoteURL), - oEmbed, oMovie, oTarget = _getDocument(), tmp, movieHTML, oEl, extraClass = _getSWFCSS(), s, x, sClass, side = '100%', isRTL = null, html = _doc.getElementsByTagName('html')[0]; - isRTL = (html && html.dir && html.dir.match(/rtl/i)); - smID = (typeof smID === 'undefined'?_s.id:smID); - - if (_didAppend && _appendSuccess) { - return false; // ignore if already succeeded - } - - function _initMsg() { - //_s._wD('-- SoundManager 2 ' + _s.version + (!_html5Only && _s.useHTML5Audio?(_s.hasHTML5?' + HTML5 audio':', no HTML5 audio support'):'') + (!_html5Only ? (_s.useMovieStar?', MovieStar mode':'') + (_s.useHighPerformance?', high performance mode, ':', ') + (( _s.flashPollingInterval ? 'custom (' + _s.flashPollingInterval + 'ms)' : (_s.useFastPolling?'fast':'normal')) + ' polling') + (_s.wmode?', wmode: ' + _s.wmode:'') + (_s.debugFlash?', flash debug mode':'') + (_s.useFlashBlock?', flashBlock mode':'') : '') + ' --', 1); - } - - if (_html5Only) { - _setVersionInfo(); - _initMsg(); - _s.oMC = _id(_s.movieID); - _init(); - // prevent multiple init attempts - _didAppend = true; - _appendSuccess = true; - return false; - } - - _didAppend = true; - - // safety check for legacy (change to Flash 9 URL) - _setVersionInfo(); - _s.url = _normalizeMovieURL(_s._overHTTP?remoteURL:localURL); - smURL = _s.url; - - _s.wmode = (!_s.wmode && _s.useHighPerformance && !_s.useMovieStar?'transparent':_s.wmode); - - if (_s.wmode !== null && (_ua.match(/msie 8/i) || (!_isIE && !_s.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) { - _s.specialWmodeCase = true; - // extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here - // does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout - // wmode breaks IE 8 on Vista + Win7 too in some cases, as of Jan.2011 (?) - //_wDS('spcWmode'); - _s.wmode = null; - } - - oEmbed = { - 'name': smID, - 'id': smID, - 'src': smURL, - 'width': side, - 'height': side, - 'quality': 'high', - 'allowScriptAccess': _s.allowScriptAccess, - 'bgcolor': _s.bgColor, - 'pluginspage': _s._http+'//www.macromedia.com/go/getflashplayer', - 'type': 'application/x-shockwave-flash', - 'wmode': _s.wmode, - 'hasPriority': 'true' // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html - }; - - if (_s.debugFlash) { - oEmbed.FlashVars = 'debug=1'; - } - - if (!_s.wmode) { - delete oEmbed.wmode; // don't write empty attribute - } - - if (_isIE) { - // IE is "special". - oMovie = _doc.createElement('div'); - movieHTML = '' + (_s.wmode?' ':'') + '' + (_s.debugFlash?'':'') + ''; - } else { - oMovie = _doc.createElement('embed'); - for (tmp in oEmbed) { - if (oEmbed.hasOwnProperty(tmp)) { - oMovie.setAttribute(tmp, oEmbed[tmp]); - } - } - } - - _initDebug(); - extraClass = _getSWFCSS(); - oTarget = _getDocument(); - - if (oTarget) { - _s.oMC = _id(_s.movieID)?_id(_s.movieID):_doc.createElement('div'); - if (!_s.oMC.id) { - _s.oMC.id = _s.movieID; - _s.oMC.className = _s.swfCSS.swfDefault + ' ' + extraClass; - // "hide" flash movie - s = null; - oEl = null; - if (!_s.useFlashBlock) { - if (_s.useHighPerformance) { - s = { - 'position': 'fixed', - 'width': '8px', - 'height': '8px', - // >= 6px for flash to run fast, >= 8px to start up under Firefox/win32 in some cases. odd? yes. - 'bottom': '0px', - 'left': '0px', - 'overflow': 'hidden' - }; - } else { - s = { - 'position': 'absolute', - 'width': '6px', - 'height': '6px', - 'top': '-9999px', - 'left': '-9999px' - }; - if (isRTL) { - s.left = Math.abs(parseInt(s.left,10))+'px'; - } - } - } - if (_isWebkit) { - _s.oMC.style.zIndex = 10000; // soundcloud-reported render/crash fix, safari 5 - } - if (!_s.debugFlash) { - for (x in s) { - if (s.hasOwnProperty(x)) { - _s.oMC.style[x] = s[x]; - } - } - } - try { - if (!_isIE) { - _s.oMC.appendChild(oMovie); - } - oTarget.appendChild(_s.oMC); - if (_isIE) { - oEl = _s.oMC.appendChild(_doc.createElement('div')); - oEl.className = _s.swfCSS.swfBox; - oEl.innerHTML = movieHTML; - } - _appendSuccess = true; - } catch(e) { - throw new Error(_str('appXHTML')); - } - } else { - // it's already in the document. - sClass = _s.oMC.className; - _s.oMC.className = (sClass?sClass+' ':_s.swfCSS.swfDefault) + (extraClass?' '+extraClass:''); - _s.oMC.appendChild(oMovie); - if (_isIE) { - oEl = _s.oMC.appendChild(_doc.createElement('div')); - oEl.className = _s.swfCSS.swfBox; - oEl.innerHTML = movieHTML; - } - _appendSuccess = true; - } - } - - if (specialCase) { - //_s._wD(specialCase); - } - - _initMsg(); - //_s._wD(_smc+'createMovie(): Trying to load ' + smURL + (!_s._overHTTP && _s.altURL?' (alternate URL)':''), 1); - - return true; - }; - - _idCheck = this.getSoundById; - - _initMovie = function() { - if (_html5Only) { - _createMovie(); - return false; - } - // attempt to get, or create, movie - if (_s.o) { - return false; // may already exist - } - _s.o = _s.getMovie(_s.id); // inline markup - if (!_s.o) { - if (!_oRemoved) { - // try to create - _createMovie(_s.id, _s.url); - } else { - // try to re-append removed movie after reboot() - if (!_isIE) { - _s.oMC.appendChild(_oRemoved); - } else { - _s.oMC.innerHTML = _oRemovedHTML; - } - _oRemoved = null; - _didAppend = true; - } - _s.o = _s.getMovie(_s.id); - } - if (_s.o) { - //_s._wD(_smc+'initMovie(): Got '+_s.o.nodeName+' element ('+(_didAppend?'created via JS':'static HTML')+')'); - //_wDS('waitEI'); - } - if (_s.oninitmovie instanceof Function) { - setTimeout(_s.oninitmovie, 1); - } - return true; - }; - - _go = function(sURL) { - // where it all begins. - if (sURL) { - _s.url = sURL; - } - _initMovie(); - }; - - _delayWaitForEI = function() { - setTimeout(_waitForEI, 500); - }; - - _waitForEI = function() { - if (_waitingForEI) { - return false; - } - _waitingForEI = true; - _event.remove(_win, 'load', _delayWaitForEI); - if (_tryInitOnFocus && !_isFocused) { - //_wDS('waitFocus'); - return false; - } - var p; - if (!_didInit) { - p = _s.getMoviePercent(); - //_s._wD(_str('waitImpatient', (p === 100?' (SWF loaded)':(p > 0?' (SWF ' + p + '% loaded)':'')))); - } - setTimeout(function() { - p = _s.getMoviePercent(); - if (!_didInit) { - //_s._wD(_sm + ': No Flash response within expected time.\nLikely causes: ' + (p === 0?'Loading ' + _s.movieURL + ' may have failed (and/or Flash ' + _fV + '+ not present?), ':'') + 'Flash blocked or JS-Flash security error.' + (_s.debugFlash?' ' + _str('checkSWF'):''), 2); - if (!_s._overHTTP && p) { - //_wDS('localFail', 2); - if (!_s.debugFlash) { - //_wDS('tryDebug', 2); - } - } - if (p === 0) { - // if 0 (not null), probably a 404. - //_s._wD(_str('swf404', _s.url)); - } - //_debugTS('flashtojs', false, ': Timed out' + _s._overHTTP?' (Check flash security or flash blockers)':' (No plugin/missing SWF?)'); - } - // give up / time-out, depending - if (!_didInit && _okToDisable) { - if (p === null) { - // SWF failed. Maybe blocked. - if (_s.useFlashBlock || _s.flashLoadTimeout === 0) { - if (_s.useFlashBlock) { - _flashBlockHandler(); - } - //_wDS('waitForever'); - } else { - // old SM2 behaviour, simply fail - _failSafely(true); - } - } else { - // flash loaded? Shouldn't be a blocking issue, then. - if (_s.flashLoadTimeout === 0) { - //_wDS('waitForever'); - } else { - _failSafely(true); - } - } - } - }, _s.flashLoadTimeout); - }; - - _go = function(sURL) { - // where it all begins. - if (sURL) { - _s.url = sURL; - } - _initMovie(); - }; - - /* - _wDS = function(o, errorLevel) { - if (!o) { - return ''; - } else { - return //_s._wD(_str(o), errorLevel); - } - }; - - if (_wl.indexOf('debug=alert') + 1 && _s.debugMode) { - _s._wD = function(sText) {window.alert(sText);}; - } - - _toggleDebug = function() { - var o = _id(_s.debugID), - oT = _id(_s.debugID + '-toggle'); - if (!o) { - return false; - } - if (_debugOpen) { - // minimize - oT.innerHTML = '+'; - o.style.display = 'none'; - } else { - oT.innerHTML = '-'; - o.style.display = 'block'; - } - _debugOpen = !_debugOpen; - }; - - _debugTS = function(sEventType, bSuccess, sMessage) { - // troubleshooter debug hooks - if (typeof sm2Debugger !== 'undefined') { - try { - sm2Debugger.handleEvent(sEventType, bSuccess, sMessage); - } catch(e) { - // oh well - } - } - return true; - }; - */ - - _getSWFCSS = function() { - var css = []; - if (_s.debugMode) { - css.push(_s.swfCSS.sm2Debug); - } - if (_s.debugFlash) { - css.push(_s.swfCSS.flashDebug); - } - if (_s.useHighPerformance) { - css.push(_s.swfCSS.highPerf); - } - return css.join(' '); - }; - - _flashBlockHandler = function() { - // *possible* flash block situation. - var name = _str('fbHandler'), p = _s.getMoviePercent(), css = _s.swfCSS; - if (!_s.ok()) { - if (_needsFlash) { - // make the movie more visible, so user can fix - _s.oMC.className = _getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null?css.swfTimedout:css.swfError); - //_s._wD(name+': '+_str('fbTimeout')+(p?' ('+_str('fbLoaded')+')':'')); - } - _s.didFlashBlock = true; - _processOnEvents({type:'ontimeout',ignoreInit:true}); // fire onready(), complain lightly - if (_s.onerror instanceof Function) { - _s.onerror.apply(_win); - } - } else { - // SM2 loaded OK (or recovered) - if (_s.didFlashBlock) { - //_s._wD(name+': Unblocked'); - } - if (_s.oMC) { - _s.oMC.className = [_getSWFCSS(), css.swfDefault, css.swfLoaded + (_s.didFlashBlock?' '+css.swfUnblocked:'')].join(' '); - } - } - }; - - _handleFocus = function() { - function cleanup() { - _event.remove(_win, 'focus', _handleFocus); - _event.remove(_win, 'load', _handleFocus); - } - if (_isFocused || !_tryInitOnFocus) { - cleanup(); - return true; - } - _okToDisable = true; - _isFocused = true; - //_s._wD(_smc+'handleFocus()'); - if (_isSafari && _tryInitOnFocus) { - // giant Safari 3.1 hack - assume mousemove = focus given lack of focus event - _event.remove(_win, 'mousemove', _handleFocus); - } - // allow init to restart - _waitingForEI = false; - cleanup(); - return true; - }; - - _initComplete = function(bNoDisable) { - if (_didInit) { - return false; - } - if (_html5Only) { - // all good. - //_s._wD('-- SoundManager 2: loaded --'); - _didInit = true; - _processOnEvents(); - _initUserOnload(); - return true; - } - var sClass = _s.oMC.className, - wasTimeout = (_s.useFlashBlock && _s.flashLoadTimeout && !_s.getMoviePercent()); - if (!wasTimeout) { - _didInit = true; - } - //_s._wD('-- SoundManager 2 ' + (_disabled?'failed to load':'loaded') + ' (' + (_disabled?'security/load error':'OK') + ') --', 1); - if (_disabled || bNoDisable) { - if (_s.useFlashBlock) { - _s.oMC.className = _getSWFCSS() + ' ' + (_s.getMoviePercent() === null?_s.swfCSS.swfTimedout:_s.swfCSS.swfError); - } - _processOnEvents({type:'ontimeout'}); - //_debugTS('onload', false); - if (_s.onerror instanceof Function) { - _s.onerror.apply(_win); - } - return false; - } else { - //_debugTS('onload', true); - } - _event.add(_win, 'unload', _doNothing); // prevent browser from showing cached state via back button, because flash will be dead - if (_s.waitForWindowLoad && !_windowLoaded) { - //_wDS('waitOnload'); - _event.add(_win, 'load', _initUserOnload); - return false; - } else { - if (_s.waitForWindowLoad && _windowLoaded) { - //_wDS('docLoaded'); - } - _initUserOnload(); - } - return true; - }; - - _addOnEvent = function(sType, oMethod, oScope) { - if (typeof _on_queue[sType] === 'undefined') { - _on_queue[sType] = []; - } - _on_queue[sType].push({ - 'method': oMethod, - 'scope': (oScope || null), - 'fired': false - }); - }; - - _processOnEvents = function(oOptions) { - if (!oOptions) { // assume onready, if unspecified - oOptions = { - type: 'onready' - }; - } - if (!_didInit && oOptions && !oOptions.ignoreInit) { - // not ready yet. - return false; - } - var status = { - success: (oOptions && oOptions.ignoreInit?_s.ok():!_disabled) - }, - srcQueue = (oOptions && oOptions.type?_on_queue[oOptions.type]||[]:[]), // queue specified by type, or none - queue = [], i, j, - canRetry = (_needsFlash && _s.useFlashBlock && !_s.ok()); - for (i = 0; i < srcQueue.length; i++) { - if (srcQueue[i].fired !== true) { - queue.push(srcQueue[i]); - } - } - if (queue.length) { - //_s._wD(_sm + ': Firing ' + queue.length + ' '+oOptions.type+'() item' + (queue.length === 1?'':'s')); - for (i = 0, j = queue.length; i < j; i++) { - if (queue[i].scope) { - queue[i].method.apply(queue[i].scope, [status]); - } else { - queue[i].method(status); - } - if (!canRetry) { // flashblock case doesn't count here - queue[i].fired = true; - } - } - } - return true; - }; - - _initUserOnload = function() { - _win.setTimeout(function() { - if (_s.useFlashBlock) { - _flashBlockHandler(); - } - _processOnEvents(); - // call user-defined "onload", scoped to window - if (_s.onload instanceof Function) { - //_wDS('onload', 1); - _s.onload.apply(_win); - //_wDS('onloadOK', 1); - } - if (_s.waitForWindowLoad) { - _event.add(_win, 'load', _initUserOnload); - } - },1); - }; - - _detectFlash = function() { - - // hat tip: Flash Detect library (BSD, (C) 2007) by Carl "DocYes" S. Yestrau - http://featureblend.com/javascript-flash-detection-library.html / http://featureblend.com/license.txt - - if (_hasFlash !== undefined) { - // this work has already been done. - return _hasFlash; - } - - var hasPlugin = false, n = navigator, nP = n.plugins, obj, type, types, AX = _win.ActiveXObject; - - if (nP && nP.length) { - - type = 'application/x-shockwave-flash'; - types = n.mimeTypes; - if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) { - hasPlugin = true; - } - - } else if (typeof AX !== 'undefined') { - - try { - obj = new AX('ShockwaveFlash.ShockwaveFlash'); - } catch(e) { - // oh well - } - hasPlugin = (!!obj); - - } - - _hasFlash = hasPlugin; - - return hasPlugin; - - }; - - _featureCheck = function() { - var needsFlash, item, - isSpecial = (_ua.match(/iphone os (1|2|3_0|3_1)/i)?true:false); // iPhone <= 3.1 has broken HTML5 audio(), but firmware 3.2 (iPad) + iOS4 works. - if (isSpecial) { - _s.hasHTML5 = false; // has Audio(), but is broken; let it load links directly. - _html5Only = true; // ignore flash case, however - if (_s.oMC) { - _s.oMC.style.display = 'none'; - } - return false; - } - if (_s.useHTML5Audio) { - if (!_s.html5 || !_s.html5.canPlayType) { - //_s._wD('SoundManager: No HTML5 Audio() support detected.'); - _s.hasHTML5 = false; - return true; - } else { - _s.hasHTML5 = true; - } - if (_isBadSafari) { - //_s._wD(_smc+'Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - '+(!_hasFlash?' would use flash fallback for MP3/MP4, but none detected.':'will use flash fallback for MP3/MP4, if available'),1); - if (_detectFlash()) { - return true; - } - } - } else { - // flash required. - return true; - } - for (item in _s.audioFormats) { - if (_s.audioFormats.hasOwnProperty(item) && _s.audioFormats[item].required && !_s.html5.canPlayType(_s.audioFormats[item].type)) { - // may need flash for this format? - needsFlash = true; - } - } - // sanity check.. - if (_s.ignoreFlash) { - needsFlash = false; - } - _html5Only = (_s.useHTML5Audio && _s.hasHTML5 && !needsFlash && !_s.requireFlash); - return (_detectFlash() && needsFlash); - }; - - _init = function() { - var item, tests = []; - //_wDS('init'); - - // called after onload() - if (_didInit) { - //_wDS('didInit'); - return false; - } - - function _cleanup() { - _event.remove(_win, 'load', _s.beginDelayedInit); - } - - if (_s.hasHTML5) { - for (item in _s.audioFormats) { - if (_s.audioFormats.hasOwnProperty(item)) { - tests.push(item+': '+_s.html5[item]); - } - } - //_s._wD('-- SoundManager 2: HTML5 support tests ('+_s.html5Test+'): '+tests.join(', ')+' --',1); - } - - if (_html5Only) { - if (!_didInit) { - // we don't need no steenking flash! - _cleanup(); - _s.enabled = true; - _initComplete(); - } - return true; - } - - // flash path - _initMovie(); - try { - //_wDS('flashJS'); - _s.o._externalInterfaceTest(false); // attempt to talk to Flash - if (!_s.allowPolling) { - //_wDS('noPolling', 1); - } else { - _setPolling(true, _s.flashPollingInterval ? _s.flashPollingInterval : (_s.useFastPolling ? 10 : 50)); - } - if (!_s.debugMode) { - _s.o._disableDebug(); - } - _s.enabled = true; - //_debugTS('jstoflash', true); - } catch(e) { - //_s._wD('js/flash exception: ' + e.toString()); - //_debugTS('jstoflash', false); - _failSafely(true); // don't disable, for reboot() - _initComplete(); - return false; - } - _initComplete(); - // event cleanup - _cleanup(); - return true; - }; - - _beginInit = function() { - if (_initPending) { - return false; - } - _createMovie(); - _initMovie(); - _initPending = true; - return true; - }; - - _dcLoaded = function() { - if (_didDCLoaded) { - return false; - } - _didDCLoaded = true; - _initDebug(); - if (!_s.useHTML5Audio) { - if (!_detectFlash()) { - //_s._wD('SoundManager: No Flash detected, trying HTML5'); - _s.useHTML5Audio = true; - } - } - _testHTML5(); - _s.html5.usingFlash = _featureCheck(); - _needsFlash = _s.html5.usingFlash; - _didDCLoaded = true; - if (_doc.removeEventListener) { - _doc.removeEventListener('DOMContentLoaded', _dcLoaded, false); - } - _go(); - return true; - }; - - _startTimer = function(oSound) { - if (!oSound._hasTimer) { - oSound._hasTimer = true; - } - }; - - _stopTimer = function(oSound) { - if (oSound._hasTimer) { - oSound._hasTimer = false; - } - }; - - _die = function() { - if (_s.onerror instanceof Function) { - _s.onerror(); - } - _s.disable(); - }; - - _badSafariFix = function() { - // special case: "bad" Safari can fall back to flash for MP3/MP4 - if (!_isBadSafari || !_detectFlash()) { - return false; // doesn't apply - } - var aF = _s.audioFormats, i, item; - for (item in aF) { - if (aF.hasOwnProperty(item)) { - // special case: "bad" Safari can fall back to flash for MP3/MP4 - if (item === 'mp3' || item === 'mp4') { - //_s._wD(_sm+': Using flash fallback for '+item+' format'); - _s.html5[item] = false; - // assign result to related formats, too - if (aF[item] && aF[item].related) { - for (i = aF[item].related.length; i--;) { - _s.html5[aF[item].related[i]] = false; - } - } - } - } - } - }; - - // pseudo-private methods called by Flash - - this._setSandboxType = function(sandboxType) { - /* - var sb = _s.sandbox; - sb.type = sandboxType; - sb.description = sb.types[(typeof sb.types[sandboxType] !== 'undefined'?sandboxType:'unknown')]; - //_s._wD('Flash security sandbox type: ' + sb.type); - if (sb.type === 'localWithFile') { - sb.noRemote = true; - sb.noLocal = false; - //_wDS('secNote', 2); - } else if (sb.type === 'localWithNetwork') { - sb.noRemote = false; - sb.noLocal = true; - } else if (sb.type === 'localTrusted') { - sb.noRemote = false; - sb.noLocal = false; - } - */ - }; - - this._externalInterfaceOK = function(flashDate) { - // flash callback confirming flash loaded, EI working etc. - // flashDate = approx. timing/delay info for JS/flash bridge - if (_s.swfLoaded) { - return false; - } - var eiTime = new Date().getTime(); - //_s._wD(_smc+'externalInterfaceOK()' + (flashDate?' (~' + (eiTime - flashDate) + ' ms)':'')); - //_debugTS('swf', true); - //_debugTS('flashtojs', true); - _s.swfLoaded = true; - _tryInitOnFocus = false; - if (_isBadSafari) { - _badSafariFix(); - } - if (_isIE) { - // IE needs a timeout OR delay until window.onload - may need TODO: investigating - setTimeout(_init, 100); - } else { - _init(); - } - }; - - _dcIE = function() { - if (_doc.readyState === 'complete') { - _dcLoaded(); - _doc.detachEvent('onreadystatechange', _dcIE); - } - return true; - }; - - // focus and window load, init - if (!_s.hasHTML5 || _needsFlash) { - // only applies to Flash mode - _event.add(_win, 'focus', _handleFocus); - _event.add(_win, 'load', _handleFocus); - _event.add(_win, 'load', _delayWaitForEI); - if (_isSafari && _tryInitOnFocus) { - _event.add(_win, 'mousemove', _handleFocus); // massive Safari focus hack - } - } - - if (_doc.addEventListener) { - _doc.addEventListener('DOMContentLoaded', _dcLoaded, false); - } else if (_doc.attachEvent) { - _doc.attachEvent('onreadystatechange', _dcIE); - } else { - // no add/attachevent support - safe to assume no JS -> Flash either - //_debugTS('onload', false); - _die(); - } - - if (_doc.readyState === 'complete') { - setTimeout(_dcLoaded,100); - } - -} // SoundManager() - -// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading -if (typeof SM2_DEFER === 'undefined' || !SM2_DEFER) { - soundManager = new SoundManager(); -} - -// public interfaces -window.SoundManager = SoundManager; // constructor -window.soundManager = soundManager; // public API, flash callbacks etc - -}(window)); diff --git a/views/vibeOS/appfiles/breakout/sound/soundmanager2.js b/views/vibeOS/appfiles/breakout/sound/soundmanager2.js deleted file mode 100644 index 67a2f357..00000000 --- a/views/vibeOS/appfiles/breakout/sound/soundmanager2.js +++ /dev/null @@ -1,3015 +0,0 @@ -/** @license - * SoundManager 2: JavaScript Sound for the Web - * ---------------------------------------------- - * http://schillmania.com/projects/soundmanager2/ - * - * Copyright (c) 2007, Scott Schiller. All rights reserved. - * Code provided under the BSD License: - * http://schillmania.com/projects/soundmanager2/license.txt - * - * V2.97a.20110424 - */ - -/*jslint white: false, onevar: true, undef: true, nomen: false, eqeqeq: true, plusplus: false, bitwise: true, regexp: false, newcap: true, immed: true */ -/*global window, SM2_DEFER, sm2Debugger, console, document, navigator, setTimeout, setInterval, clearInterval, Audio */ - -(function(window) { - -var soundManager = null; - -function SoundManager(smURL, smID) { - - this.flashVersion = 8; // version of flash to require, either 8 or 9. Some API features require Flash 9. - this.debugMode = true; // enable debugging output (div#soundmanager-debug, OR console if available+configured) - this.debugFlash = false; // enable debugging output inside SWF, troubleshoot Flash/browser issues - this.useConsole = true; // use firebug/safari console.log()-type debug console if available - this.consoleOnly = false; // if console is being used, do not create/write to #soundmanager-debug - this.waitForWindowLoad = false; // force SM2 to wait for window.onload() before trying to call soundManager.onload() - this.nullURL = 'about:blank'; // path to "null" (empty) MP3 file, used to unload sounds (Flash 8 only) - this.allowPolling = true; // allow flash to poll for status update (required for whileplaying() events, peak, sound spectrum functions to work.) - this.useFastPolling = false; // uses lower flash timer interval for higher callback frequency, best combined with useHighPerformance - this.useMovieStar = true; // enable support for Flash 9.0r115+ (codename "MovieStar") MPEG4 audio formats (AAC, M4V, FLV, MOV etc.) - this.bgColor = '#ffffff'; // movie (.swf) background color, eg. '#000000' - this.useHighPerformance = false; // position:fixed flash movie can help increase js/flash speed, minimize lag - this.flashPollingInterval = null; // msec for polling interval. Defaults to 50 unless useFastPolling = true. - this.flashLoadTimeout = 1000; // msec to wait for flash movie to load before failing (0 = infinity) - this.wmode = null; // string: flash rendering mode - null, transparent, opaque (last two allow layering of HTML on top) - this.allowScriptAccess = 'always'; // for scripting the SWF (object/embed property), either 'always' or 'sameDomain' - this.useFlashBlock = false; // *requires flashblock.css, see demos* - allow recovery from flash blockers. Wait indefinitely and apply timeout CSS to SWF, if applicable. - this.useHTML5Audio = false; // Beta feature: Use HTML5 Audio() where API is supported (most Safari, Chrome versions), Firefox (no MP3/MP4.) Ideally, transparent vs. Flash API where possible. - this.html5Test = /^probably$/i; // HTML5 Audio().canPlayType() test. /^(probably|maybe)$/i if you want to be more liberal/risky. - this.useGlobalHTML5Audio = true; // (experimental) if true, re-use single HTML5 audio object across all sounds. Enabled by default on mobile devices/iOS. - this.requireFlash = false; // (experimental) if true, prevents "HTML5-only" mode when flash present. Allows flash to handle RTMP/serverURL, but HTML5 for other cases - - this.audioFormats = { - // determines HTML5 support, flash requirements - // eg. if MP3 or MP4 required, Flash fallback is used if HTML5 can't play it - // shotgun approach to MIME testing due to browser variance - 'mp3': { - 'type': ['audio/mpeg; codecs="mp3"','audio/mpeg','audio/mp3','audio/MPA','audio/mpa-robust'], - 'required': true - }, - 'mp4': { - 'related': ['aac','m4a'], // additional formats under the MP4 container - 'type': ['audio/mp4; codecs="mp4a.40.2"','audio/aac','audio/x-m4a','audio/MP4A-LATM','audio/mpeg4-generic'], - 'required': true - }, - 'ogg': { - 'type': ['audio/ogg; codecs=vorbis'], - 'required': false - }, - 'wav': { - 'type': ['audio/wav; codecs="1"','audio/wav','audio/wave','audio/x-wav'], - 'required': false - } - }; - - this.defaultOptions = { - 'autoLoad': false, // enable automatic loading (otherwise .load() will be called on demand with .play(), the latter being nicer on bandwidth - if you want to .load yourself, you also can) - 'stream': true, // allows playing before entire file has loaded (recommended) - 'autoPlay': false, // enable playing of file as soon as possible (much faster if "stream" is true) - 'loops': 1, // how many times to repeat the sound (position will wrap around to 0, setPosition() will break out of loop when >0) - 'onid3': null, // callback function for "ID3 data is added/available" - 'onload': null, // callback function for "load finished" - 'whileloading': null, // callback function for "download progress update" (X of Y bytes received) - 'onplay': null, // callback for "play" start - 'onpause': null, // callback for "pause" - 'onresume': null, // callback for "resume" (pause toggle) - 'whileplaying': null, // callback during play (position update) - 'onstop': null, // callback for "user stop" - 'onfailure': null, // callback function for when playing fails - 'onfinish': null, // callback function for "sound finished playing" - 'onbeforefinish': null, // callback for "before sound finished playing (at [time])" - 'onbeforefinishtime': 5000, // offset (milliseconds) before end of sound to trigger beforefinish (eg. 1000 msec = 1 second) - 'onbeforefinishcomplete': null,// function to call when said sound finishes playing - 'onjustbeforefinish': null, // callback for [n] msec before end of current sound - 'onjustbeforefinishtime': 200, // [n] - if not using, set to 0 (or null handler) and event will not fire. - 'multiShot': true, // let sounds "restart" or layer on top of each other when played multiple times, rather than one-shot/one at a time - 'multiShotEvents': false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled - 'position': null, // offset (milliseconds) to seek to within loaded sound data. - 'pan': 0, // "pan" settings, left-to-right, -100 to 100 - 'type': null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3 - 'usePolicyFile': false, // enable crossdomain.xml request for audio on remote domains (for ID3/waveform access) - 'volume': 100 // self-explanatory. 0-100, the latter being the max. - }; - - this.flash9Options = { // flash 9-only options, merged into defaultOptions if flash 9 is being used - 'isMovieStar': null, // "MovieStar" MPEG4 audio mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL - 'usePeakData': false, // enable left/right channel peak (level) data - 'useWaveformData': false, // enable sound spectrum (raw waveform data) - WARNING: CPU-INTENSIVE: may set CPUs on fire. - 'useEQData': false, // enable sound EQ (frequency spectrum data) - WARNING: Also CPU-intensive. - 'onbufferchange': null, // callback for "isBuffering" property change - 'ondataerror': null // callback for waveform/eq data access error (flash playing audio in other tabs/domains) - }; - - this.movieStarOptions = { // flash 9.0r115+ MPEG4 audio options, merged into defaultOptions if flash 9+movieStar mode is enabled - 'bufferTime': 3, // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try increasing.) - 'serverURL': null, // rtmp: FMS or FMIS server to connect to, required when requesting media via RTMP or one of its variants - 'onconnect': null, // rtmp: callback for connection to flash media server - 'duration': null // rtmp: song duration (msec) - }; - - this.version = null; - this.versionNumber = 'V2.97a.20110424'; - this.movieURL = null; - this.url = (smURL || null); - this.altURL = null; - this.swfLoaded = false; - this.enabled = false; - this.o = null; - this.movieID = 'sm2-container'; - this.id = (smID || 'sm2movie'); - this.swfCSS = { - 'swfBox': 'sm2-object-box', - 'swfDefault': 'movieContainer', - 'swfError': 'swf_error', // SWF loaded, but SM2 couldn't start (other error) - 'swfTimedout': 'swf_timedout', - 'swfLoaded': 'swf_loaded', - 'swfUnblocked': 'swf_unblocked', // or loaded OK - 'sm2Debug': 'sm2_debug', - 'highPerf': 'high_performance', - 'flashDebug': 'flash_debug' - }; - this.oMC = null; - this.sounds = {}; - this.soundIDs = []; - this.muted = false; - this.debugID = 'soundmanager-debug'; - this.debugURLParam = /([#?&])debug=1/i; - this.specialWmodeCase = false; - this.didFlashBlock = false; - - this.filePattern = null; - this.filePatterns = { - 'flash8': /\.mp3(\?.*)?$/i, - 'flash9': /\.mp3(\?.*)?$/i - }; - - this.baseMimeTypes = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i; // mp3 - this.netStreamMimeTypes = /^\s*audio\/(?:x-)?(?:mp(?:eg|3))\s*(?:$|;)/i; // mp3, mp4, aac etc. - this.netStreamTypes = ['aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'mp4v', '3gp', '3g2']; // Flash v9.0r115+ "moviestar" formats - this.netStreamPattern = new RegExp('\\.(' + this.netStreamTypes.join('|') + ')(\\?.*)?$', 'i'); - this.mimePattern = this.baseMimeTypes; - - this.features = { - 'buffering': false, - 'peakData': false, - 'waveformData': false, - 'eqData': false, - 'movieStar': false - }; - - this.sandbox = { - // - 'type': null, - 'types': { - 'remote': 'remote (domain-based) rules', - 'localWithFile': 'local with file access (no internet access)', - 'localWithNetwork': 'local with network (internet access only, no local access)', - 'localTrusted': 'local, trusted (local+internet access)' - }, - 'description': null, - 'noRemote': null, - 'noLocal': null - // - }; - - this.hasHTML5 = null; // switch for handling logic - this.html5 = { // stores canPlayType() results, etc. treat as read-only. - // mp3: boolean - // mp4: boolean - 'usingFlash': null // set if/when flash fallback is needed - }; - this.ignoreFlash = false; // used for special cases (eg. iPad/iPhone/palm OS?) - - // --- private SM2 internals --- - - var SMSound, - _s = this, _sm = 'soundManager', _smc = _sm+'::', _h5 = 'HTML5::', _id, _ua = navigator.userAgent, _win = window, _wl = _win.location.href.toString(), _fV = this.flashVersion, _doc = document, _doNothing, _init, _on_queue = [], _debugOpen = true, _debugTS, _didAppend = false, _appendSuccess = false, _didInit = false, _disabled = false, _windowLoaded = false, _wDS, _wdCount = 0, _initComplete, _mixin, _addOnEvent, _processOnEvents, _initUserOnload, _go, _delayWaitForEI, _waitForEI, _setVersionInfo, _handleFocus, _beginInit, _strings, _initMovie, _dcLoaded, _didDCLoaded, _getDocument, _createMovie, _die, _setPolling, _debugLevels = ['log', 'info', 'warn', 'error'], _defaultFlashVersion = 8, _disableObject, _failSafely, _normalizeMovieURL, _oRemoved = null, _oRemovedHTML = null, _str, _flashBlockHandler, _getSWFCSS, _toggleDebug, _loopFix, _policyFix, _complain, _idCheck, _waitingForEI = false, _initPending = false, _smTimer, _onTimer, _startTimer, _stopTimer, _needsFlash = null, _featureCheck, _html5OK, _html5Only = false, _html5CanPlay, _html5Ext, _dcIE, _testHTML5, _event, _slice = Array.prototype.slice, _useGlobalHTML5Audio = false, _hasFlash, _detectFlash, _badSafariFix, - _is_pre = _ua.match(/pre\//i), _is_iDevice = _ua.match(/(ipad|iphone|ipod)/i), _isMobile = (_ua.match(/mobile/i) || _is_pre || _is_iDevice), _isIE = _ua.match(/msie/i), _isWebkit = _ua.match(/webkit/i), _isSafari = (_ua.match(/safari/i) && !_ua.match(/chrome/i)), _isOpera = (_ua.match(/opera/i)), - _isBadSafari = (!_wl.match(/usehtml5audio/i) && !_wl.match(/sm2\-ignorebadua/i) && _isSafari && _ua.match(/OS X 10_6_([3-9])/i)), // Safari 4 and 5 occasionally fail to load/play HTML5 audio on Snow Leopard due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Known Apple "radar" bug. https://bugs.webkit.org/show_bug.cgi?id=32159 - _hasConsole = (typeof console !== 'undefined' && typeof console.log !== 'undefined'), _isFocused = (typeof _doc.hasFocus !== 'undefined'?_doc.hasFocus():null), _tryInitOnFocus = (typeof _doc.hasFocus === 'undefined' && _isSafari), _okToDisable = !_tryInitOnFocus; - - this._use_maybe = (_wl.match(/sm2\-useHTML5Maybe\=1/i)); // temporary feature: #sm2-useHTML5Maybe=1 forces loose canPlay() check - this._overHTTP = (_doc.location?_doc.location.protocol.match(/http/i):null); - this._http = (!this._overHTTP ? 'http:' : ''); - this.useAltURL = !this._overHTTP; // use altURL if not "online" - this._global_a = null; - - if (_is_iDevice || _is_pre) { - // during HTML5 beta period (off by default), may as well force it on Apple + Palm, flash support unlikely - _s.useHTML5Audio = true; - _s.ignoreFlash = true; - if (_s.useGlobalHTML5Audio) { - _useGlobalHTML5Audio = true; - } - } - - if (_is_pre || this._use_maybe) { - // less-strict canPlayType() checking option - _s.html5Test = /^(probably|maybe)$/i; - } - - // Temporary feature: allow force of HTML5 via URL: #sm2-usehtml5audio=0 or 1 - // - (function(){ - var a = '#sm2-usehtml5audio=', l = _wl, b = null; - if (l.indexOf(a) !== -1) { - b = (l.charAt(l.indexOf(a)+a.length) === '1'); - if (typeof console !== 'undefined' && typeof console.log !== 'undefined') { - console.log((b?'Enabling ':'Disabling ')+'useHTML5Audio via URL parameter'); - } - _s.useHTML5Audio = b; - } - }()); - // - - // --- public API methods --- - - this.ok = function() { - return (_needsFlash?(_didInit && !_disabled):(_s.useHTML5Audio && _s.hasHTML5)); - }; - - this.supported = this.ok; // legacy - - this.getMovie = function(smID) { - return _isIE?_win[smID]:(_isSafari?_id(smID) || _doc[smID]:_id(smID)); - }; - - this.createSound = function(oOptions) { - var _cs = _sm+'.createSound(): ', - thisOptions = null, oSound = null, _tO = null; - if (!_didInit || !_s.ok()) { - _complain(_cs + _str(!_didInit?'notReady':'notOK')); - return false; - } - if (arguments.length === 2) { - // function overloading in JS! :) ..assume simple createSound(id,url) use case - oOptions = { - 'id': arguments[0], - 'url': arguments[1] - }; - } - thisOptions = _mixin(oOptions); // inherit from defaultOptions - _tO = thisOptions; // alias - // - if (_tO.id.toString().charAt(0).match(/^[0-9]$/)) { - _s._wD(_cs + _str('badID', _tO.id), 2); - } - _s._wD(_cs + _tO.id + ' (' + _tO.url + ')', 1); - // - if (_idCheck(_tO.id, true)) { - _s._wD(_cs + _tO.id + ' exists', 1); - return _s.sounds[_tO.id]; - } - - function make() { - thisOptions = _loopFix(thisOptions); - _s.sounds[_tO.id] = new SMSound(_tO); - _s.soundIDs.push(_tO.id); - return _s.sounds[_tO.id]; - } - - if (_html5OK(_tO)) { - oSound = make(); - _s._wD('Loading sound '+_tO.id+' via HTML5'); - oSound._setup_html5(_tO); - } else { - if (_fV > 8 && _s.useMovieStar) { - if (_tO.isMovieStar === null) { - _tO.isMovieStar = ((_tO.serverURL || (_tO.type?_tO.type.match(_s.netStreamPattern):false)||_tO.url.match(_s.netStreamPattern))?true:false); - } - if (_tO.isMovieStar) { - _s._wD(_cs + 'using MovieStar handling'); - } - if (_tO.isMovieStar) { - if (_tO.usePeakData) { - _wDS('noPeak'); - _tO.usePeakData = false; - } - if (_tO.loops > 1) { - _wDS('noNSLoop'); - } - } - } - _tO = _policyFix(_tO, _cs); - oSound = make(); - if (_fV === 8) { - _s.o._createSound(_tO.id, _tO.onjustbeforefinishtime, _tO.loops||1, _tO.usePolicyFile); - } else { - _s.o._createSound(_tO.id, _tO.url, _tO.onjustbeforefinishtime, _tO.usePeakData, _tO.useWaveformData, _tO.useEQData, _tO.isMovieStar, (_tO.isMovieStar?_tO.bufferTime:false), _tO.loops||1, _tO.serverURL, _tO.duration||null, _tO.autoPlay, true, _tO.autoLoad, _tO.usePolicyFile); - if (!_tO.serverURL) { - // We are connected immediately - oSound.connected = true; - if (_tO.onconnect) { - _tO.onconnect.apply(oSound); - } - } - } - - if ((_tO.autoLoad || _tO.autoPlay) && !_tO.serverURL) { - oSound.load(_tO); // call load for non-rtmp streams - } - } - - if (_tO.autoPlay && !_tO.serverURL) { // rtmp will play in onconnect - oSound.play(); - } - return oSound; - }; - - this.destroySound = function(sID, _bFromSound) { - // explicitly destroy a sound before normal page unload, etc. - if (!_idCheck(sID)) { - return false; - } - var oS = _s.sounds[sID], i; - oS._iO = {}; // Disable all callbacks while the sound is being destroyed - oS.stop(); - oS.unload(); - for (i = 0; i < _s.soundIDs.length; i++) { - if (_s.soundIDs[i] === sID) { - _s.soundIDs.splice(i, 1); - break; - } - } - if (!_bFromSound) { - // ignore if being called from SMSound instance - oS.destruct(true); - } - oS = null; - delete _s.sounds[sID]; - return true; - }; - - this.load = function(sID, oOptions) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].load(oOptions); - }; - - this.unload = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].unload(); - }; - - this.play = function(sID, oOptions) { - var fN = _sm+'.play(): '; - if (!_didInit || !_s.ok()) { - _complain(fN + _str(!_didInit?'notReady':'notOK')); - return false; - } - if (!_idCheck(sID)) { - if (!(oOptions instanceof Object)) { - oOptions = { - url: oOptions - }; // overloading use case: play('mySound','/path/to/some.mp3'); - } - if (oOptions && oOptions.url) { - // overloading use case, create+play: .play('someID',{url:'/path/to.mp3'}); - _s._wD(fN + 'attempting to create "' + sID + '"', 1); - oOptions.id = sID; - return _s.createSound(oOptions).play(); - } else { - return false; - } - } - return _s.sounds[sID].play(oOptions); - }; - - this.start = this.play; // just for convenience - - this.setPosition = function(sID, nMsecOffset) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].setPosition(nMsecOffset); - }; - - this.stop = function(sID) { - if (!_idCheck(sID)) { - return false; - } - _s._wD(_sm+'.stop(' + sID + ')', 1); - return _s.sounds[sID].stop(); - }; - - this.stopAll = function() { - _s._wD(_sm+'.stopAll()', 1); - for (var oSound in _s.sounds) { - if (_s.sounds[oSound] instanceof SMSound) { - _s.sounds[oSound].stop(); // apply only to sound objects - } - } - }; - - this.pause = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].pause(); - }; - - this.pauseAll = function() { - for (var i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].pause(); - } - }; - - this.resume = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].resume(); - }; - - this.resumeAll = function() { - for (var i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].resume(); - } - }; - - this.togglePause = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].togglePause(); - }; - - this.setPan = function(sID, nPan) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].setPan(nPan); - }; - - this.setVolume = function(sID, nVol) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].setVolume(nVol); - }; - - this.mute = function(sID) { - var fN = _sm+'.mute(): ', - i = 0; - if (typeof sID !== 'string') { - sID = null; - } - if (!sID) { - _s._wD(fN + 'Muting all sounds'); - for (i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].mute(); - } - _s.muted = true; - } else { - if (!_idCheck(sID)) { - return false; - } - _s._wD(fN + 'Muting "' + sID + '"'); - return _s.sounds[sID].mute(); - } - return true; - }; - - this.muteAll = function() { - _s.mute(); - }; - - this.unmute = function(sID) { - var fN = _sm+'.unmute(): ', i; - if (typeof sID !== 'string') { - sID = null; - } - if (!sID) { - _s._wD(fN + 'Unmuting all sounds'); - for (i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].unmute(); - } - _s.muted = false; - } else { - if (!_idCheck(sID)) { - return false; - } - _s._wD(fN + 'Unmuting "' + sID + '"'); - return _s.sounds[sID].unmute(); - } - return true; - }; - - this.unmuteAll = function() { - _s.unmute(); - }; - - this.toggleMute = function(sID) { - if (!_idCheck(sID)) { - return false; - } - return _s.sounds[sID].toggleMute(); - }; - - this.getMemoryUse = function() { - if (_fV === 8) { - return 0; - } - if (_s.o) { - return parseInt(_s.o._getMemoryUse(), 10); - } - }; - - this.disable = function(bNoDisable) { - // destroy all functions - if (typeof bNoDisable === 'undefined') { - bNoDisable = false; - } - if (_disabled) { - return false; - } - _disabled = true; - _wDS('shutdown', 1); - for (var i = _s.soundIDs.length; i--;) { - _disableObject(_s.sounds[_s.soundIDs[i]]); - } - _initComplete(bNoDisable); // fire "complete", despite fail - _event.remove(_win, 'load', _initUserOnload); - return true; - }; - - this.canPlayMIME = function(sMIME) { - var result; - if (_s.hasHTML5) { - result = _html5CanPlay({type:sMIME}); - } - if (!_needsFlash || result) { - // no flash, or OK - return result; - } else { - return (sMIME?(sMIME.match(_s.mimePattern)?true:false):null); - } - }; - - this.canPlayURL = function(sURL) { - var result; - if (_s.hasHTML5) { - result = _html5CanPlay(sURL); - } - if (!_needsFlash || result) { - // no flash, or OK - return result; - } else { - return (sURL?(sURL.match(_s.filePattern)?true:false):null); - } - }; - - this.canPlayLink = function(oLink) { - if (typeof oLink.type !== 'undefined' && oLink.type) { - if (_s.canPlayMIME(oLink.type)) { - return true; - } - } - return _s.canPlayURL(oLink.href); - }; - - this.getSoundById = function(sID, suppressDebug) { - if (!sID) { - throw new Error(_sm+'.getSoundById(): sID is null/undefined'); - } - var result = _s.sounds[sID]; - if (!result && !suppressDebug) { - _s._wD('"' + sID + '" is an invalid sound ID.', 2); - } - return result; - }; - - this.onready = function(oMethod, oScope) { - var sType = 'onready'; - if (oMethod && oMethod instanceof Function) { - if (_didInit) { - _wDS('queue', sType); - } - if (!oScope) { - oScope = _win; - } - _addOnEvent(sType, oMethod, oScope); - _processOnEvents(); - return true; - } else { - throw _str('needFunction', sType); - } - }; - - this.ontimeout = function(oMethod, oScope) { - var sType = 'ontimeout'; - if (oMethod && oMethod instanceof Function) { - if (_didInit) { - _wDS('queue'); - } - if (!oScope) { - oScope = _win; - } - _addOnEvent(sType, oMethod, oScope); - _processOnEvents({type:sType}); - return true; - } else { - throw _str('needFunction', sType); - } - }; - - this.getMoviePercent = function() { - return (_s.o && typeof _s.o.PercentLoaded !== 'undefined'?_s.o.PercentLoaded():null); - }; - - this._writeDebug = function(sText, sType, bTimestamp) { - // pseudo-private console.log()-style output - // - var sDID = 'soundmanager-debug', o, oItem, sMethod; - if (!_s.debugMode) { - return false; - } - if (typeof bTimestamp !== 'undefined' && bTimestamp) { - sText = sText + ' | ' + new Date().getTime(); - } - if (_hasConsole && _s.useConsole) { - sMethod = _debugLevels[sType]; - if (typeof console[sMethod] !== 'undefined') { - console[sMethod](sText); - } else { - console.log(sText); - } - if (_s.useConsoleOnly) { - return true; - } - } - try { - o = _id(sDID); - if (!o) { - return false; - } - oItem = _doc.createElement('div'); - if (++_wdCount % 2 === 0) { - oItem.className = 'sm2-alt'; - } - if (typeof sType === 'undefined') { - sType = 0; - } else { - sType = parseInt(sType, 10); - } - oItem.appendChild(_doc.createTextNode(sText)); - if (sType) { - if (sType >= 2) { - oItem.style.fontWeight = 'bold'; - } - if (sType === 3) { - oItem.style.color = '#ff3333'; - } - } - // o.appendChild(oItem); // top-to-bottom - o.insertBefore(oItem, o.firstChild); // bottom-to-top - } catch(e) { - // oh well - } - o = null; - // - return true; - }; - this._wD = this._writeDebug; // alias - - this._debug = function() { - // - _wDS('currentObj', 1); - for (var i = 0, j = _s.soundIDs.length; i < j; i++) { - _s.sounds[_s.soundIDs[i]]._debug(); - } - // - }; - - this.reboot = function() { - // attempt to reset and init SM2 - _s._wD(_sm+'.reboot()'); - if (_s.soundIDs.length) { - _s._wD('Destroying ' + _s.soundIDs.length + ' SMSound objects...'); - } - var i, j; - for (i = _s.soundIDs.length; i--;) { - _s.sounds[_s.soundIDs[i]].destruct(); - } - // trash ze flash - try { - if (_isIE) { - _oRemovedHTML = _s.o.innerHTML; - } - _oRemoved = _s.o.parentNode.removeChild(_s.o); - _s._wD('Flash movie removed.'); - } catch(e) { - // uh-oh. - _wDS('badRemove', 2); - } - // actually, force recreate of movie. - _oRemovedHTML = _oRemoved = null; - _s.enabled = _didInit = _waitingForEI = _initPending = _didAppend = _appendSuccess = _disabled = _s.swfLoaded = false; - _s.soundIDs = _s.sounds = []; - _s.o = null; - for (i in _on_queue) { - if (_on_queue.hasOwnProperty(i)) { - for (j = _on_queue[i].length; j--;) { - _on_queue[i][j].fired = false; - } - } - } - _s._wD(_sm + ': Rebooting...'); - _win.setTimeout(function() { - _s.beginDelayedInit(); - }, 20); - }; - - this.destruct = function() { - _s._wD(_sm+'.destruct()'); - _s.disable(true); - }; - - this.beginDelayedInit = function() { - // _s._wD(_sm+'.beginDelayedInit()'); - _windowLoaded = true; - _dcLoaded(); - setTimeout(_beginInit, 20); - _delayWaitForEI(); - }; - - - // Wrap html5 event handlers so we don't call them on destroyed sounds - function _html5_event(oFn) { - return function(e) { - if (!this._t || !this._t._a) { - if (this._t && this._t.sID) { - _s._wD(_h5+'ignoring '+e.type+': '+this._t.sID); - } else { - _s._wD(_h5+'ignoring '+e.type); - } - return null; - } else { - return oFn.call(this, e); - } - }; - } - - this._html5_events = { - - // HTML5 event-name-to-handler map - abort: _html5_event(function(e) { - _s._wD(_h5+'abort: '+this._t.sID); - }), - - // enough has loaded to play - canplay: _html5_event(function(e) { - _s._wD(_h5+'canplay: '+this._t.sID+', '+this._t.url); - this._t._onbufferchange(0); - var position1K = (!isNaN(this._t.position)?this._t.position/1000:null); - // set the position if position was set before the sound loaded - this._t._html5_canplay = true; - if (this._t.position && this.currentTime !== position1K) { - _s._wD(_h5+'canplay: setting position to '+position1K+''); - try { - this.currentTime = position1K; - } catch(ee) { - _s._wD(_h5+'setting position failed: '+ee.message, 2); - } - } - }), - - load: _html5_event(function(e) { - if (!this._t.loaded) { - this._t._onbufferchange(0); - // should be 1, and the same - this._t._whileloading(this._t.bytesTotal, this._t.bytesTotal, this._t._get_html5_duration()); - this._t._onload(true); - } - }), - - emptied: _html5_event(function(e) { - _s._wD(_h5+'emptied: '+this._t.sID); - }), - - ended: _html5_event(function(e) { - _s._wD(_h5+'ended: '+this._t.sID); - this._t._onfinish(); - }), - - error: _html5_event(function(e) { - _s._wD(_h5+'error: '+this.error.code); - // call load with error state? - this._t._onload(false); - }), - - loadeddata: _html5_event(function(e) { - _s._wD(_h5+'loadeddata: '+this._t.sID); - }), - - loadedmetadata: _html5_event(function(e) { - _s._wD(_h5+'loadedmetadata: '+this._t.sID); - }), - - loadstart: _html5_event(function(e) { - _s._wD(_h5+'loadstart: '+this._t.sID); - // assume buffering at first - this._t._onbufferchange(1); - }), - - play: _html5_event(function(e) { - _s._wD(_h5+'play: '+this._t.sID+', '+this._t.url); - // once play starts, no buffering - this._t._onbufferchange(0); - }), - - // TODO: verify if this is actually implemented anywhere yet. - playing: _html5_event(function(e) { - _s._wD(_h5+'playing: '+this._t.sID+', '+this._t.url); - // once play starts, no buffering - this._t._onbufferchange(0); - }), - - progress: _html5_event(function(e) { - - if (this._t.loaded) { - return false; - } - - var i, j, str, loadSum = 0, buffered = 0, - isProgress = (e.type === 'progress'), - ranges = e.target.buffered, - loaded = (e.loaded||0), // firefox 3.6 implements e.loaded/total (bytes) - total = (e.total||1); - - if (ranges && ranges.length) { - - // if loaded is 0, try TimeRanges implementation as % of load - // https://developer.mozilla.org/en/DOM/TimeRanges - for (i=ranges.length; i--;) { - buffered = (ranges.end(i) - ranges.start(i)); - } - - // linear case, buffer sum; does not account for seeking and HTTP partials / byte ranges - loaded = buffered/e.target.duration; - - // - if (isProgress && ranges.length > 1) { - str = []; - j = ranges.length; - for (i=0; i - - if (isProgress && !isNaN(loaded)) { - _s._wD(_h5+'progress: '+this._t.sID+': ' + Math.floor(loaded*100)+'% loaded'); - } - - } - - if (!isNaN(loaded)) { - - this._t._onbufferchange(0); // if progress, likely not buffering - this._t._whileloading(loaded, total, this._t._get_html5_duration()); - - if (loaded && total && loaded === total) { - // in case "onload" doesn't fire (eg. gecko 1.9.2) - _s._html5_events.load.call(this, e); - } - - } - - }), - - ratechange: _html5_event(function(e) { - _s._wD(_h5+'ratechange: '+this._t.sID); - }), - - suspend: _html5_event(function(e) { - // download paused/stopped, may have finished (eg. onload) - _s._wD(_h5+'suspend: '+this._t.sID); - _s._html5_events.progress.call(this, e); - }), - - stalled: _html5_event(function(e) { - _s._wD(_h5+'stalled: '+this._t.sID); - }), - - timeupdate: _html5_event(function(e) { - this._t._onTimer(); - }), - - waiting: _html5_event(function(e) { // see also: seeking - _s._wD(_h5+'waiting: '+this._t.sID); - // playback faster than download rate, etc. - this._t._onbufferchange(1); - }) - - }; - - // --- SMSound (sound object) instance --- - - SMSound = function(oOptions) { - var _t = this, _resetProperties, _stop_html5_timer, _start_html5_timer; - this.sID = oOptions.id; - this.url = oOptions.url; - this.options = _mixin(oOptions); - this.instanceOptions = this.options; // per-play-instance-specific options - this._iO = this.instanceOptions; // short alias - // assign property defaults - this.pan = this.options.pan; - this.volume = this.options.volume; - this._lastURL = null; - this.isHTML5 = false; - this._a = null; - - // --- public methods --- - - this.id3 = {}; - - this._debug = function() { - // - // pseudo-private console.log()-style output - if (_s.debugMode) { - var stuff = null, msg = [], sF, sfBracket, maxLength = 64; - for (stuff in _t.options) { - if (_t.options[stuff] !== null) { - if (_t.options[stuff] instanceof Function) { - // handle functions specially - sF = _t.options[stuff].toString(); - sF = sF.replace(/\s\s+/g, ' '); // normalize spaces - sfBracket = sF.indexOf('{'); - msg.push(' ' + stuff + ': {' + sF.substr(sfBracket + 1, (Math.min(Math.max(sF.indexOf('\n') - 1, maxLength), maxLength))).replace(/\n/g, '') + '... }'); - } else { - msg.push(' ' + stuff + ': ' + _t.options[stuff]); - } - } - } - _s._wD('SMSound() merged options: {\n' + msg.join(', \n') + '\n}'); - } - // - }; - - this._debug(); - - this.load = function(oOptions) { - var oS = null; - if (typeof oOptions !== 'undefined') { - _t._iO = _mixin(oOptions, _t.options); - _t.instanceOptions = _t._iO; - } else { - oOptions = _t.options; - _t._iO = oOptions; - _t.instanceOptions = _t._iO; - if (_t._lastURL && _t._lastURL !== _t.url) { - _wDS('manURL'); - _t._iO.url = _t.url; - _t.url = null; - } - } - if (!_t._iO.url) { - _t._iO.url = _t.url; - } - _s._wD('SMSound.load(): ' + _t._iO.url, 1); - if (_t._iO.url === _t.url && _t.readyState !== 0 && _t.readyState !== 2) { - _wDS('onURL', 1); - return _t; - } - _t._lastURL = _t.url; - _t.loaded = false; - _t.readyState = 1; - _t.playState = 0; - if (_html5OK(_t._iO)) { - oS = _t._setup_html5(_t._iO); - if (!oS._called_load) { - _s._wD(_h5+'load: '+_t.sID); - oS.load(); - oS._called_load = true; - if (_t._iO.autoPlay) { - _t.play(); - } - } else { - _s._wD('HTML5 ignoring request to load again: '+_t.sID); - } - } else { - try { - _t.isHTML5 = false; - _t._iO = _policyFix(_loopFix(_t._iO)); - if (_fV === 8) { - _s.o._load(_t.sID, _t._iO.url, _t._iO.stream, _t._iO.autoPlay, (_t._iO.whileloading?1:0), _t._iO.loops||1, _t._iO.usePolicyFile); - } else { - _s.o._load(_t.sID, _t._iO.url, _t._iO.stream?true:false, _t._iO.autoPlay?true:false, _t._iO.loops||1, _t._iO.autoLoad?true:false, _t._iO.usePolicyFile); - } - } catch(e) { - _wDS('smError', 2); - _debugTS('onload', false); - _die(); - } - } - return _t; - }; - - this.unload = function() { - // Flash 8/AS2 can't "close" a stream - fake it by loading an empty MP3 - // Flash 9/AS3: Close stream, preventing further load - if (_t.readyState !== 0) { - _s._wD('SMSound.unload(): "' + _t.sID + '"'); - if (!_t.isHTML5) { - if (_fV === 8) { - _s.o._unload(_t.sID, _s.nullURL); - } else { - _s.o._unload(_t.sID); - } - } else { - _stop_html5_timer(); - if (_t._a) { - // abort()-style method here, stop loading? (doesn't exist?) - _t._a.pause(); -// if (!_useGlobalHTML5Audio || (_useGlobalHTML5Audio && _t.playState)) { // if global audio, only unload if actively playing - _t._a.src = ''; // https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Stopping_the_download_of_media -// } - } - } - // reset load/status flags - _resetProperties(); - } - return _t; - }; - - this.destruct = function(_bFromSM) { - _s._wD('SMSound.destruct(): "' + _t.sID + '"'); - if (!_t.isHTML5) { - // kill sound within Flash - // Disable the onfailure handler - _t._iO.onfailure = null; - _s.o._destroySound(_t.sID); - } else { - _stop_html5_timer(); - if (_t._a) { - // abort()-style method here, stop loading? (doesn't exist?) - _t._a.pause(); - _t._a.src = ''; // https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Stopping_the_download_of_media - if (!_useGlobalHTML5Audio) { - _t._remove_html5_events(); - } - } - } - if (!_bFromSM) { - _s.destroySound(_t.sID, true); // ensure deletion from controller - } - }; - - this.play = function(oOptions, _updatePlayState) { - var fN = 'SMSound.play(): ', allowMulti; - _updatePlayState = _updatePlayState === undefined ? true : _updatePlayState; // default true - if (!oOptions) { - oOptions = {}; - } - _t._iO = _mixin(oOptions, _t._iO); - _t._iO = _mixin(_t._iO, _t.options); - _t.instanceOptions = _t._iO; - if (_t._iO.serverURL) { - if (!_t.connected) { - if (!_t.getAutoPlay()) { - _s._wD(fN+' Netstream not connected yet - setting autoPlay'); - _t.setAutoPlay(true); - } - return _t; // play will be called in _onconnect() - } - } - if (_html5OK(_t._iO)) { - _t._setup_html5(_t._iO); - _start_html5_timer(); - } - if (_t.playState === 1 && !_t.paused) { - allowMulti = _t._iO.multiShot; - if (!allowMulti) { - _s._wD(fN + '"' + _t.sID + '" already playing (one-shot)', 1); - return _t; - } else { - _s._wD(fN + '"' + _t.sID + '" already playing (multi-shot)', 1); - if (_t.isHTML5) { - // TODO: BUG? - _t.setPosition(_t._iO.position); - } - } - } - if (!_t.loaded) { - if (_t.readyState === 0) { - _s._wD(fN + 'Attempting to load "' + _t.sID + '"', 1); - // try to get this sound playing ASAP - if (!_t.isHTML5) { - _t._iO.autoPlay = true; // assign directly because setAutoPlay() increments the instanceCount - _t.load(_t._iO); - } else { - _t.load(_t._iO); - // _t.readyState = 1; // redundant - } - } else if (_t.readyState === 2) { - _s._wD(fN + 'Could not load "' + _t.sID + '" - exiting', 2); - return _t; - } else { - _s._wD(fN + '"' + _t.sID + '" is loading - attempting to play..', 1); - } - } else { - _s._wD(fN + '"' + _t.sID + '"'); - } - // Streams will pause when their buffer is full if they are being loaded. - // In this case paused is true, but the song hasn't started playing yet. If - // we just call resume() the onplay() callback will never be called. So - // only call resume() if the position is > 0. - // Another reason is because options like volume won't have been applied yet. - if (_t.paused && _t.position && _t.position > 0) { // https://gist.github.com/37b17df75cc4d7a90bf6 - _s._wD(fN + '"' + _t.sID + '" is resuming from paused state',1); - _t.resume(); - } else { - _s._wD(fN+'"'+ _t.sID+'" is starting to play'); - _t.playState = 1; - _t.paused = false; - if (!_t.instanceCount || _t._iO.multiShotEvents || (_fV > 8 && !_t.isHTML5 && !_t.getAutoPlay())) { - _t.instanceCount++; - } - _t.position = (typeof _t._iO.position !== 'undefined' && !isNaN(_t._iO.position)?_t._iO.position:0); - if (!_t.isHTML5) { - _t._iO = _policyFix(_loopFix(_t._iO)); - } - if (_t._iO.onplay && _updatePlayState) { - _t._iO.onplay.apply(_t); - _t._onplay_called = true; - } - _t.setVolume(_t._iO.volume, true); - _t.setPan(_t._iO.pan, true); - if (!_t.isHTML5) { - _s.o._start(_t.sID, _t._iO.loops || 1, (_fV === 9?_t.position:_t.position / 1000)); - } else { - _start_html5_timer(); - _t._setup_html5().play(); - } - } - return _t; - }; - - this.start = this.play; // just for convenience - - this.stop = function(bAll) { - if (_t.playState === 1) { - _t._onbufferchange(0); - _t.resetOnPosition(0); - if (!_t.isHTML5) { - _t.playState = 0; - } - _t.paused = false; - if (_t._iO.onstop) { - _t._iO.onstop.apply(_t); - } - if (!_t.isHTML5) { - _s.o._stop(_t.sID, bAll); - // hack for netStream: just unload - if (_t._iO.serverURL) { - _t.unload(); - } - } else { - if (_t._a) { - _t.setPosition(0); // act like Flash, though - _t._a.pause(); // html5 has no stop() - _t.playState = 0; - _t._onTimer(); // and update UI - _stop_html5_timer(); - _t.unload(); - } - } - _t.instanceCount = 0; - _t._iO = {}; - } - return _t; - }; - - this.setAutoPlay = function(autoPlay) { - _s._wD('sound '+_t.sID+' turned autoplay ' + (autoPlay ? 'on' : 'off')); - _t._iO.autoPlay = autoPlay; - if (_t.isHTML5) { - if (_t._a && autoPlay) { - _t.play(); // HTML5 onload isn't reliable - } - } else { - _s.o._setAutoPlay(_t.sID, autoPlay); - } - if (autoPlay) { - // only increment the instanceCount if the sound isn't loaded (TODO: verify RTMP) - if (!_t.instanceCount && _t.readyState === 1) { - _t.instanceCount++; - _s._wD('sound '+_t.sID+' incremented instance count to '+_t.instanceCount); - } - } - }; - - this.getAutoPlay = function() { - return _t._iO.autoPlay; - }; - - this.setPosition = function(nMsecOffset, bNoDebug) { - if (nMsecOffset === undefined) { - nMsecOffset = 0; - } - // Use the duration from the instance options, if we don't have a track duration yet. - var original_pos, position, position1K, offset = (_t.isHTML5 ? Math.max(nMsecOffset,0) : Math.min(_t.duration || _t._iO.duration, Math.max(nMsecOffset, 0))); // position >= 0 and <= current available (loaded) duration - original_pos = _t.position; - _t.position = offset; - position1K = _t.position/1000; - _t.resetOnPosition(_t.position); - _t._iO.position = offset; - if (!_t.isHTML5) { - position = _fV === 9 ? _t.position : position1K; - if (_t.readyState && _t.readyState !== 2) { - _s.o._setPosition(_t.sID, position, (_t.paused || !_t.playState)); // if paused or not playing, will not resume (by playing) - } - } else if (_t._a) { - // Set the position in the canplay handler if the sound is not ready yet - if (_t._html5_canplay) { - if (_t._a.currentTime !== position1K) { - // Only set the position if we need to. - // DOM/JS errors/exceptions to watch out for: - // if seek is beyond (loaded?) position, "DOM exception 11" - // "INDEX_SIZE_ERR": DOM exception 1 - _s._wD('setPosition('+position1K+'): setting position'); - try { - _t._a.currentTime = position1K; - } catch(e) { - _s._wD('setPosition('+position1K+'): setting position failed: '+e.message, 2); - } - } - } else { - _s._wD('setPosition('+position1K+'): delaying, sound not ready'); - } - } - if (_t.isHTML5) { - if (_t.paused) { // if paused, refresh UI right away - _t._onTimer(true); // force update - } - } - return _t; - }; - - this.pause = function(bCallFlash) { - if (_t.paused || (_t.playState === 0 && _t.readyState !== 1)) { - return _t; - } - _s._wD('SMSound.pause()'); - _t.paused = true; - if (!_t.isHTML5) { - if (bCallFlash || bCallFlash === undefined) { - _s.o._pause(_t.sID); - } - } else { - _t._setup_html5().pause(); - _stop_html5_timer(); - } - if (_t._iO.onpause) { - _t._iO.onpause.apply(_t); - } - return _t; - }; - - // When auto-loaded streams pause on buffer full they have a playState of 0. - // We need to make sure that the playState is set to 1 when these streams "resume". - // - // When a paused stream is resumed, we need to trigger the onplay() callback if it - // hasn't been called already. In this case since the sound is being played for the - // first time, I think it's more appropriate to call onplay() rather than onresume(). - this.resume = function() { - if (!_t.paused) { - return _t; - } - _s._wD('SMSound.resume()'); - _t.paused = false; - _t.playState = 1; - if (!_t.isHTML5) { - if (_t._iO.isMovieStar) { - // Bizarre Webkit bug (Chrome reported via 8tracks.com dudes): AAC content paused for 30+ seconds(?) will not resume without a reposition. - _t.setPosition(_t.position); - } - _s.o._pause(_t.sID); // flash method is toggle-based (pause/resume) - } else { - _t._setup_html5().play(); - _start_html5_timer(); - } - if (!_t._onplay_called && _t._iO.onplay) { - _t._iO.onplay.apply(_t); - _t._onplay_called = true; - } else if (_t._iO.onresume) { - _t._iO.onresume.apply(_t); - } - return _t; - }; - - this.togglePause = function() { - _s._wD('SMSound.togglePause()'); - if (_t.playState === 0) { - _t.play({ - position: (_fV === 9 && !_t.isHTML5 ? _t.position:_t.position / 1000) - }); - return _t; - } - if (_t.paused) { - _t.resume(); - } else { - _t.pause(); - } - return _t; - }; - - this.setPan = function(nPan, bInstanceOnly) { - if (typeof nPan === 'undefined') { - nPan = 0; - } - if (typeof bInstanceOnly === 'undefined') { - bInstanceOnly = false; - } - if (!_t.isHTML5) { - _s.o._setPan(_t.sID, nPan); - } // else { no HTML5 pan? } - _t._iO.pan = nPan; - if (!bInstanceOnly) { - _t.pan = nPan; - _t.options.pan = nPan; - } - return _t; - }; - - this.setVolume = function(nVol, bInstanceOnly) { - if (typeof nVol === 'undefined') { - nVol = 100; - } - if (typeof bInstanceOnly === 'undefined') { - bInstanceOnly = false; - } - if (!_t.isHTML5) { - _s.o._setVolume(_t.sID, (_s.muted && !_t.muted) || _t.muted?0:nVol); - } else if (_t._a) { - _t._a.volume = Math.max(0, Math.min(1, nVol/100)); // valid range: 0-1 - } - _t._iO.volume = nVol; - if (!bInstanceOnly) { - _t.volume = nVol; - _t.options.volume = nVol; - } - return _t; - }; - - this.mute = function() { - _t.muted = true; - if (!_t.isHTML5) { - _s.o._setVolume(_t.sID, 0); - } else if (_t._a) { - _t._a.muted = true; - } - return _t; - }; - - this.unmute = function() { - _t.muted = false; - var hasIO = typeof _t._iO.volume !== 'undefined'; - if (!_t.isHTML5) { - _s.o._setVolume(_t.sID, hasIO?_t._iO.volume:_t.options.volume); - } else if (_t._a) { - _t._a.muted = false; - } - return _t; - }; - - this.toggleMute = function() { - return (_t.muted?_t.unmute():_t.mute()); - }; - - this.onposition = function(nPosition, oMethod, oScope) { - // TODO: allow for ranges, too? eg. (nPosition instanceof Array) - _t._onPositionItems.push({ - position: nPosition, - method: oMethod, - scope: (typeof oScope !== 'undefined'?oScope:_t), - fired: false - }); - return _t; - }; - - this.processOnPosition = function() { - var i, item, j = _t._onPositionItems.length; - if (!j || !_t.playState || _t._onPositionFired >= j) { - return false; - } - for (i=j; i--;) { - item = _t._onPositionItems[i]; - if (!item.fired && _t.position >= item.position) { - item.method.apply(item.scope,[item.position]); - item.fired = true; - _s._onPositionFired++; - } - } - return true; - }; - - this.resetOnPosition = function(nPosition) { - // reset "fired" for items interested in this position - var i, item, j = _t._onPositionItems.length; - if (!j) { - return false; - } - for (i=j; i--;) { - item = _t._onPositionItems[i]; - if (item.fired && nPosition <= item.position) { - item.fired = false; - _s._onPositionFired--; - } - } - return true; - }; - - // pseudo-private soundManager reference - - this._onTimer = function(bForce) { - // HTML5-only _whileplaying() etc. - var time, x = {}; - if (_t._hasTimer || bForce) { - if (_t._a && (bForce || ((_t.playState > 0 || _t.readyState === 1) && !_t.paused))) { // TODO: May not need to track readyState (1 = loading) - _t.duration = _t._get_html5_duration(); - _t.durationEstimate = _t.duration; - time = _t._a.currentTime?_t._a.currentTime*1000:0; - _t._whileplaying(time,x,x,x,x); - return true; - } else { - _s._wD('_onTimer: Warn for "'+_t.sID+'": '+(!_t._a?'Could not find element. ':'')+(_t.playState === 0?'playState bad, 0?':'playState = '+_t.playState+', OK')); - return false; - } - } - }; - - // --- private internals --- - - this._get_html5_duration = function() { - var d = (_t._a ? _t._a.duration*1000 : (_t._iO ? _t._iO.duration : undefined)); - return (d && !isNaN(d) && d !== Infinity ? d : (_t._iO ? _t._iO.duration : null)); - }; - - _start_html5_timer = function() { - if (_t.isHTML5) { - _startTimer(_t); - } - }; - - _stop_html5_timer = function() { - if (_t.isHTML5) { - _stopTimer(_t); - } - }; - - _resetProperties = function(bLoaded) { - _t._onPositionItems = []; - _t._onPositionFired = 0; - _t._hasTimer = null; - _t._onplay_called = false; - _t._a = null; - _t._html5_canplay = false; - _t.bytesLoaded = null; - _t.bytesTotal = null; - _t.position = null; - _t.duration = (_t._iO && _t._iO.duration?_t._iO.duration:null); - _t.durationEstimate = null; - _t.failures = 0; - _t.loaded = false; - _t.playState = 0; - _t.paused = false; - _t.readyState = 0; // 0 = uninitialised, 1 = loading, 2 = failed/error, 3 = loaded/success - _t.muted = false; - _t.didBeforeFinish = false; - _t.didJustBeforeFinish = false; - _t.isBuffering = false; - _t.instanceOptions = {}; - _t.instanceCount = 0; - _t.peakData = { - left: 0, - right: 0 - }; - _t.waveformData = { - left: [], - right: [] - }; - _t.eqData = []; // legacy: 1D array - _t.eqData.left = []; - _t.eqData.right = []; - }; - - _resetProperties(); - - // pseudo-private methods used by soundManager - - this._setup_html5 = function(oOptions) { - var _iO = _mixin(_t._iO, oOptions), d = decodeURI, - _a = _useGlobalHTML5Audio ? _s._global_a : _t._a, - _dURL = d(_iO.url), - _oldIO = (_a && _a._t ? _a._t.instanceOptions : null); - if (_a) { - if (_a._t && _oldIO.url === _iO.url && (!_t._lastURL || (_t._lastURL === _oldIO.url))) { - return _a; // same url, ignore request - } - _s._wD('setting new URL on existing object: ' + _dURL + (_t._lastURL ? ', old URL: ' + _t._lastURL : '')); - /* - * "First things first, I, Poppa.." (reset the previous state of the old sound, if playing) - * Fixes case with devices that can only play one sound at a time - * Otherwise, other sounds in mid-play will be terminated without warning and in a stuck state - */ - if (_useGlobalHTML5Audio && _a._t && _a._t.playState && _iO.url !== _oldIO.url) { - _a._t.stop(); - } - _resetProperties(); // new URL, so reset load/playstate and so on - _a.src = _iO.url; - _t.url = _iO.url; - _t._lastURL = _iO.url; - _a._called_load = false; - } else { - _s._wD('creating HTML5 Audio() element with URL: '+_dURL); - _a = new Audio(_iO.url); - _a._called_load = false; - if (_useGlobalHTML5Audio) { - _s._global_a = _a; - } - } - _t.isHTML5 = true; - _t._a = _a; // store a ref on the track - _a._t = _t; // store a ref on the audio - _t._add_html5_events(); - _a.loop = (_iO.loops>1?'loop':''); - if (_iO.autoLoad || _iO.autoPlay) { - _a.autobuffer = 'auto'; // early HTML5 implementation (non-standard) - _a.preload = 'auto'; // standard - _t.load(); - _a._called_load = true; - } else { - _a.autobuffer = false; // early HTML5 implementation (non-standard) - _a.preload = 'none'; // standard - } - _a.loop = (_iO.loops>1?'loop':''); // boolean instead of "loop", for webkit? - spec says string. http://www.w3.org/TR/html-markup/audio.html#audio.attrs.loop - return _a; - }; - - // related private methods - - this._add_html5_events = function() { - if (_t._a._added_events) { - return false; - } - - var f; - - function add(oEvt, oFn, bCapture) { - return _t._a ? _t._a.addEventListener(oEvt, oFn, bCapture||false) : null; - } - - _s._wD(_h5+'adding event listeners: '+_t.sID); - _t._a._added_events = true; - - for (f in _s._html5_events) { - if (_s._html5_events.hasOwnProperty(f)) { - add(f, _s._html5_events[f]); - } - } - - return true; - }; - - // Keep this externally accessible - this._remove_html5_events = function() { - // Remove event listeners - function remove(oEvt, oFn, bCapture) { - return (_t._a ? _t._a.removeEventListener(oEvt, oFn, bCapture||false) : null); - } - _s._wD(_h5+'removing event listeners: '+_t.sID); - _t._a._added_events = false; - - for (var f in _s._html5_events) { - if (_s._html5_events.hasOwnProperty(f)) { - remove(f, _s._html5_events[f]); - } - } - }; - - // --- "private" methods called by Flash --- - - this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) { - _t.bytesLoaded = nBytesLoaded; - _t.bytesTotal = nBytesTotal; - _t.duration = Math.floor(nDuration); - _t.bufferLength = nBufferLength; - if (!_t._iO.isMovieStar) { - if (_t._iO.duration) { - // use options, if specified and larger - _t.durationEstimate = (_t.duration > _t._iO.duration) ? _t.duration : _t._iO.duration; - } else { - _t.durationEstimate = parseInt((_t.bytesTotal / _t.bytesLoaded) * _t.duration, 10); - } - if (_t.durationEstimate === undefined) { - _t.durationEstimate = _t.duration; - } - if (_t.readyState !== 3 && _t._iO.whileloading) { - _t._iO.whileloading.apply(_t); - } - } else { - _t.durationEstimate = _t.duration; - if (_t.readyState !== 3 && _t._iO.whileloading) { - _t._iO.whileloading.apply(_t); - } - } - }; - - this._onid3 = function(oID3PropNames, oID3Data) { - // oID3PropNames: string array (names) - // ID3Data: string array (data) - _s._wD('SMSound._onid3(): "' + this.sID + '" ID3 data received.'); - var oData = [], i, j; - for (i = 0, j = oID3PropNames.length; i < j; i++) { - oData[oID3PropNames[i]] = oID3Data[i]; - } - _t.id3 = _mixin(_t.id3, oData); - if (_t._iO.onid3) { - _t._iO.onid3.apply(_t); - } - }; - - this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) { - if (isNaN(nPosition) || nPosition === null) { - return false; // flash safety net - } - if (_t.playState === 0 && nPosition > 0) { - // invalid position edge case for end/stop - nPosition = 0; - } - _t.position = nPosition; - _t.processOnPosition(); - if (_fV > 8 && !_t.isHTML5) { - if (_t._iO.usePeakData && typeof oPeakData !== 'undefined' && oPeakData) { - _t.peakData = { - left: oPeakData.leftPeak, - right: oPeakData.rightPeak - }; - } - if (_t._iO.useWaveformData && typeof oWaveformDataLeft !== 'undefined' && oWaveformDataLeft) { - _t.waveformData = { - left: oWaveformDataLeft.split(','), - right: oWaveformDataRight.split(',') - }; - } - if (_t._iO.useEQData) { - if (typeof oEQData !== 'undefined' && oEQData && oEQData.leftEQ) { - var eqLeft = oEQData.leftEQ.split(','); - _t.eqData = eqLeft; - _t.eqData.left = eqLeft; - if (typeof oEQData.rightEQ !== 'undefined' && oEQData.rightEQ) { - _t.eqData.right = oEQData.rightEQ.split(','); - } - } - } - } - if (_t.playState === 1) { - // special case/hack: ensure buffering is false if loading from cache (and not yet started) - if (!_t.isHTML5 && _s.flashVersion === 8 && !_t.position && _t.isBuffering) { - _t._onbufferchange(0); - } - if (_t._iO.whileplaying) { - _t._iO.whileplaying.apply(_t); // flash may call after actual finish - } - if ((_t.loaded || (!_t.loaded && _t._iO.isMovieStar)) && _t._iO.onbeforefinish && _t._iO.onbeforefinishtime && !_t.didBeforeFinish && _t.duration - _t.position <= _t._iO.onbeforefinishtime) { - _t._onbeforefinish(); - } - } - return true; - }; - - // Only applies to RTMP - this._onconnect = function(bSuccess) { - var fN = 'SMSound._onconnect(): '; - bSuccess = (bSuccess === 1); - _s._wD(fN+'"'+_t.sID+'"'+(bSuccess?' connected.':' failed to connect? - '+_t.url), (bSuccess?1:2)); - _t.connected = bSuccess; - if (bSuccess) { - _t.failures = 0; - if (_idCheck(_t.sID)) { - if (_t.getAutoPlay()) { - _t.play(undefined, _t.getAutoPlay()); // only update the play state if auto playing - } else if (_t._iO.autoLoad) { - _t.load(); - } - } - if (_t._iO.onconnect) { - _t._iO.onconnect.apply(_t,[bSuccess]); - } - } - }; - - this._onload = function(nSuccess) { - var fN = 'SMSound._onload(): ', loadOK = (nSuccess?true:false); - _s._wD(fN + '"' + _t.sID + '"' + (loadOK?' loaded.':' failed to load? - ' + _t.url), (loadOK?1:2)); - // - if (!loadOK && !_t.isHTML5) { - if (_s.sandbox.noRemote === true) { - _s._wD(fN + _str('noNet'), 1); - } - if (_s.sandbox.noLocal === true) { - _s._wD(fN + _str('noLocal'), 1); - } - } - // - _t.loaded = loadOK; - _t.readyState = loadOK?3:2; - _t._onbufferchange(0); - if (_t._iO.onload) { - _t._iO.onload.apply(_t, [loadOK]); - } - return true; - }; - - // fire onfailure() only once at most - // at this point we just recreate failed sounds rather than trying to reconnect. - this._onfailure = function(msg, level, code) { - _t.failures++; - _s._wD('SMSound._onfailure(): "'+_t.sID+'" count '+_t.failures); - if (_t._iO.onfailure && _t.failures === 1) { - _t._iO.onfailure(_t, msg, level, code); - } else { - _s._wD('SMSound._onfailure(): ignoring'); - } - }; - - this._onbeforefinish = function() { - if (!_t.didBeforeFinish) { - _t.didBeforeFinish = true; - if (_t._iO.onbeforefinish) { - _s._wD('SMSound._onbeforefinish(): "' + _t.sID + '"'); - _t._iO.onbeforefinish.apply(_t); - } - } - }; - - this._onjustbeforefinish = function(msOffset) { - if (!_t.didJustBeforeFinish) { - _t.didJustBeforeFinish = true; - if (_t._iO.onjustbeforefinish) { - _s._wD('SMSound._onjustbeforefinish(): "' + _t.sID + '"'); - _t._iO.onjustbeforefinish.apply(_t); - } - } - }; - - this._onfinish = function() { - // _s._wD('SMSound._onfinish(): "' + _t.sID + '" got instanceCount '+_t.instanceCount); - var _io_onfinish = _t._iO.onfinish; // store local copy before it gets trashed.. - _t._onbufferchange(0); - _t.resetOnPosition(0); - if (_t._iO.onbeforefinishcomplete) { - _t._iO.onbeforefinishcomplete.apply(_t); - } - // reset some state items - _t.didBeforeFinish = false; - _t.didJustBeforeFinish = false; - if (_t.instanceCount) { - _t.instanceCount--; - if (!_t.instanceCount) { - // reset instance options - _t.playState = 0; - _t.paused = false; - _t.instanceCount = 0; - _t.instanceOptions = {}; - _t._iO = {}; - _stop_html5_timer(); - } - if (!_t.instanceCount || _t._iO.multiShotEvents) { - // fire onfinish for last, or every instance - if (_io_onfinish) { - _s._wD('SMSound._onfinish(): "' + _t.sID + '"'); - _io_onfinish.apply(_t); - } - } - } - }; - - this._onbufferchange = function(nIsBuffering) { - var fN = 'SMSound._onbufferchange()'; - if (_t.playState === 0) { - // ignore if not playing - return false; - } - if ((nIsBuffering && _t.isBuffering) || (!nIsBuffering && !_t.isBuffering)) { - return false; - } - _t.isBuffering = (nIsBuffering === 1); - if (_t._iO.onbufferchange) { - _s._wD(fN + ': ' + nIsBuffering); - _t._iO.onbufferchange.apply(_t); - } - return true; - }; - - this._ondataerror = function(sError) { - // flash 9 wave/eq data handler - if (_t.playState > 0) { // hack: called at start, and end from flash at/after onfinish() - _s._wD('SMSound._ondataerror(): ' + sError); - if (_t._iO.ondataerror) { - _t._iO.ondataerror.apply(_t); - } - } - }; - - }; // SMSound() - - // --- private SM2 internals --- - - _getDocument = function() { - return (_doc.body?_doc.body:(_doc._docElement?_doc.documentElement:_doc.getElementsByTagName('div')[0])); - }; - - _id = function(sID) { - return _doc.getElementById(sID); - }; - - _mixin = function(oMain, oAdd) { - // non-destructive merge - var o1 = {}, i, o2, o; - for (i in oMain) { // clone c1 - if (oMain.hasOwnProperty(i)) { - o1[i] = oMain[i]; - } - } - o2 = (typeof oAdd === 'undefined'?_s.defaultOptions:oAdd); - for (o in o2) { - if (o2.hasOwnProperty(o) && typeof o1[o] === 'undefined') { - o1[o] = o2[o]; - } - } - return o1; - }; - - _event = (function() { - - var old = (_win.attachEvent), - evt = { - add: (old?'attachEvent':'addEventListener'), - remove: (old?'detachEvent':'removeEventListener') - }; - - function getArgs(oArgs) { - var args = _slice.call(oArgs), len = args.length; - if (old) { - args[1] = 'on' + args[1]; // prefix - if (len > 3) { - args.pop(); // no capture - } - } else if (len === 3) { - args.push(false); - } - return args; - } - - function apply(args, sType) { - var element = args.shift(), - method = [evt[sType]]; - if (old) { - element[method](args[0], args[1]); - } else { - element[method].apply(element, args); - } - } - - function add() { - apply(getArgs(arguments), 'add'); - } - - function remove() { - apply(getArgs(arguments), 'remove'); - } - - return { - 'add': add, - 'remove': remove - }; - - }()); - - _html5OK = function(iO) { - return (!iO.serverURL && (iO.type?_html5CanPlay({type:iO.type}):_html5CanPlay(iO.url)||_html5Only)); // Use type, if specified. If HTML5-only mode, no other options, so just give 'er - }; - - _html5CanPlay = function(sURL) { - // try to find MIME, test and return truthiness - if (!_s.useHTML5Audio || !_s.hasHTML5) { - return false; - } - var result, mime, offset, fileExt, item, aF = _s.audioFormats; - if (!_html5Ext) { - _html5Ext = []; - for (item in aF) { - if (aF.hasOwnProperty(item)) { - _html5Ext.push(item); - if (aF[item].related) { - _html5Ext = _html5Ext.concat(aF[item].related); - } - } - } - _html5Ext = new RegExp('\\.('+_html5Ext.join('|')+')','i'); - } - mime = (typeof sURL.type !== 'undefined'?sURL.type:null); - fileExt = (typeof sURL === 'string'?sURL.toLowerCase().match(_html5Ext):null); // TODO: Strip URL queries, etc. - if (!fileExt || !fileExt.length) { - if (!mime) { - return false; - } else { - // audio/mp3 -> mp3, result should be known - offset = mime.indexOf(';'); - fileExt = (offset !== -1?mime.substr(0,offset):mime).substr(6); // strip "audio/X; codecs.." - } - } else { - fileExt = fileExt[0].substr(1); // "mp3", for example - } - if (fileExt && typeof _s.html5[fileExt] !== 'undefined') { - // result known - return _s.html5[fileExt]; - } else { - if (!mime) { - if (fileExt && _s.html5[fileExt]) { - return _s.html5[fileExt]; - } else { - // best-case guess, audio/whatever-dot-filename-format-you're-playing - mime = 'audio/'+fileExt; - } - } - result = _s.html5.canPlayType(mime); - _s.html5[fileExt] = result; - // _s._wD('canPlayType, found result: '+result); - return result; - } - }; - - _testHTML5 = function() { - if (!_s.useHTML5Audio || typeof Audio === 'undefined') { - return false; - } - // double-whammy: Opera 9.64 throws WRONG_ARGUMENTS_ERR if no parameter passed to Audio(), and Webkit + iOS happily tries to load "null" as a URL. :/ - var a = (typeof Audio !== 'undefined' ? (_isOpera ? new Audio(null) : new Audio()) : null), item, support = {}, aF, i, _hasFlash = _detectFlash(); - function _cp(m) { - var canPlay, i, j, isOK = false; - if (!a || typeof a.canPlayType !== 'function') { - return false; - } - if (m instanceof Array) { - // iterate through all mime types, return any successes - for (i=0, j=m.length; i - notReady: 'Not loaded yet - wait for soundManager.onload()/onready()', - notOK: 'Audio support is not available.', - appXHTML: _smc + 'createMovie(): appendChild/innerHTML set failed. May be app/xhtml+xml DOM-related.', - spcWmode: _smc + 'createMovie(): Removing wmode, preventing known SWF loading issue(s)', - swf404: _sm + ': Verify that %s is a valid path.', - tryDebug: 'Try ' + _sm + '.debugFlash = true for more security details (output goes to SWF.)', - checkSWF: 'See SWF output for more debug info.', - localFail: _sm + ': Non-HTTP page (' + _doc.location.protocol + ' URL?) Review Flash player security settings for this special case:\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/', - waitFocus: _sm + ': Special case: Waiting for focus-related event..', - waitImpatient: _sm + ': Getting impatient, still waiting for Flash%s...', - waitForever: _sm + ': Waiting indefinitely for Flash (will recover if unblocked)...', - needFunction: _sm + ': Function object expected for %s', - badID: 'Warning: Sound ID "%s" should be a string, starting with a non-numeric character', - noMS: 'MovieStar mode not enabled. Exiting.', - currentObj: '--- ' + _sm + '._debug(): Current sound objects ---', - waitEI: _smc + 'initMovie(): Waiting for ExternalInterface call from Flash..', - waitOnload: _sm + ': Waiting for window.onload()', - docLoaded: _sm + ': Document already loaded', - onload: _smc + 'initComplete(): calling soundManager.onload()', - onloadOK: _sm + '.onload() complete', - init: '-- ' + _smc + 'init() --', - didInit: _smc + 'init(): Already called?', - flashJS: _sm + ': Attempting to call Flash from JS..', - noPolling: _sm + ': Polling (whileloading()/whileplaying() support) is disabled.', - secNote: 'Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html', - badRemove: 'Warning: Failed to remove flash movie.', - noPeak: 'Warning: peakData features unsupported for movieStar formats', - shutdown: _sm + '.disable(): Shutting down', - queue: _sm + ': Queueing %s handler', - smFail: _sm + ': Failed to initialise.', - smError: 'SMSound.load(): Exception: JS-Flash communication failed, or JS error.', - fbTimeout: 'No flash response, applying .'+_s.swfCSS.swfTimedout+' CSS..', - fbLoaded: 'Flash loaded', - fbHandler: _smc+'flashBlockHandler()', - manURL: 'SMSound.load(): Using manually-assigned URL', - onURL: _sm + '.load(): current URL already assigned.', - badFV: _sm + '.flashVersion must be 8 or 9. "%s" is invalid. Reverting to %s.', - as2loop: 'Note: Setting stream:false so looping can work (flash 8 limitation)', - noNSLoop: 'Note: Looping not implemented for MovieStar formats', - needfl9: 'Note: Switching to flash 9, required for MP4 formats.', - mfTimeout: 'Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case', - mfOn: 'mobileFlash::enabling on-screen flash repositioning', - policy: 'Enabling usePolicyFile for data access' - // - }; - - _str = function() { // o [,items to replace] - // - var args = _slice.call(arguments), // real array, please - o = args.shift(), // first arg - str = (_strings && _strings[o]?_strings[o]:''), i, j; - if (str && args && args.length) { - for (i = 0, j = args.length; i < j; i++) { - str = str.replace('%s', args[i]); - } - } - return str; - // - }; - - _loopFix = function(sOpt) { - // flash 8 requires stream = false for looping to work - if (_fV === 8 && sOpt.loops > 1 && sOpt.stream) { - _wDS('as2loop'); - sOpt.stream = false; - } - return sOpt; - }; - - _policyFix = function(sOpt, sPre) { - if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) { - _s._wD((sPre?sPre+':':'') + _str('policy')); - sOpt.usePolicyFile = true; - } - return sOpt; - }; - - _complain = function(sMsg) { - if (typeof console !== 'undefined' && typeof console.warn !== 'undefined') { - console.warn(sMsg); - } else { - _s._wD(sMsg); - } - }; - - _doNothing = function() { - return false; - }; - - _disableObject = function(o) { - for (var oProp in o) { - if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') { - o[oProp] = _doNothing; - } - } - oProp = null; - }; - - _failSafely = function(bNoDisable) { - // general failure exception handler - if (typeof bNoDisable === 'undefined') { - bNoDisable = false; - } - if (_disabled || bNoDisable) { - _wDS('smFail', 2); - _s.disable(bNoDisable); - } - }; - - _normalizeMovieURL = function(smURL) { - var urlParams = null; - if (smURL) { - if (smURL.match(/\.swf(\?.*)?$/i)) { - urlParams = smURL.substr(smURL.toLowerCase().lastIndexOf('.swf?') + 4); - if (urlParams) { - return smURL; // assume user knows what they're doing - } - } else if (smURL.lastIndexOf('/') !== smURL.length - 1) { - smURL = smURL + '/'; - } - } - return (smURL && smURL.lastIndexOf('/') !== - 1?smURL.substr(0, smURL.lastIndexOf('/') + 1):'./') + _s.movieURL; - }; - - _setVersionInfo = function() { - if (_fV !== 8 && _fV !== 9) { - _s._wD(_str('badFV', _fV, _defaultFlashVersion)); - _s.flashVersion = _defaultFlashVersion; - } - var isDebug = (_s.debugMode || _s.debugFlash?'_debug.swf':'.swf'); // debug flash movie, if applicable - if (_s.useHTML5Audio && !_html5Only && _s.audioFormats.mp4.required && _s.flashVersion < 9) { - _s._wD(_str('needfl9')); - _s.flashVersion = 9; - } - _fV = _s.flashVersion; // short-hand for internal use - _s.version = _s.versionNumber + (_html5Only?' (HTML5-only mode)':(_fV === 9?' (AS3/Flash 9)':' (AS2/Flash 8)')); - // set up default options - if (_fV > 8) { - _s.defaultOptions = _mixin(_s.defaultOptions, _s.flash9Options); - _s.features.buffering = true; - } - if (_fV > 8 && _s.useMovieStar) { - // flash 9+ support for movieStar formats as well as MP3 - _s.defaultOptions = _mixin(_s.defaultOptions, _s.movieStarOptions); - _s.filePatterns.flash9 = new RegExp('\\.(mp3|' + _s.netStreamTypes.join('|') + ')(\\?.*)?$', 'i'); - _s.mimePattern = _s.netStreamMimeTypes; - _s.features.movieStar = true; - } else { - _s.useMovieStar = false; - _s.features.movieStar = false; - } - _s.filePattern = _s.filePatterns[(_fV !== 8?'flash9':'flash8')]; - _s.movieURL = (_fV === 8?'soundmanager2.swf':'soundmanager2_flash9.swf').replace('.swf',isDebug); - _s.features.peakData = _s.features.waveformData = _s.features.eqData = (_fV > 8); - }; - - _setPolling = function(bPolling, bHighPerformance) { - if (!_s.o || !_s.allowPolling) { - return false; - } - _s.o._setPolling(bPolling, bHighPerformance); - }; - - function _initDebug() { - if (_s.debugURLParam.test(_wl)) { - _s.debugMode = true; // allow force of debug mode via URL - } - // - if (_id(_s.debugID)) { - return false; - } - var oD, oDebug, oTarget, oToggle, tmp; - if (_s.debugMode && !_id(_s.debugID) && ((!_hasConsole || !_s.useConsole) || (_s.useConsole && _hasConsole && !_s.consoleOnly))) { - oD = _doc.createElement('div'); - oD.id = _s.debugID + '-toggle'; - oToggle = { - 'position': 'fixed', - 'bottom': '0px', - 'right': '0px', - 'width': '1.2em', - 'height': '1.2em', - 'lineHeight': '1.2em', - 'margin': '2px', - 'textAlign': 'center', - 'border': '1px solid #999', - 'cursor': 'pointer', - 'background': '#fff', - 'color': '#333', - 'zIndex': 10001 - }; - oD.appendChild(_doc.createTextNode('-')); - oD.onclick = _toggleDebug; - oD.title = 'Toggle SM2 debug console'; - if (_ua.match(/msie 6/i)) { - oD.style.position = 'absolute'; - oD.style.cursor = 'hand'; - } - for (tmp in oToggle) { - if (oToggle.hasOwnProperty(tmp)) { - oD.style[tmp] = oToggle[tmp]; - } - } - oDebug = _doc.createElement('div'); - oDebug.id = _s.debugID; - oDebug.style.display = (_s.debugMode?'block':'none'); - if (_s.debugMode && !_id(oD.id)) { - try { - oTarget = _getDocument(); - oTarget.appendChild(oD); - } catch(e2) { - throw new Error(_str('appXHTML')); - } - oTarget.appendChild(oDebug); - } - } - oTarget = null; - // - } - - _createMovie = function(smID, smURL) { - - var specialCase = null, - remoteURL = (smURL?smURL:_s.url), - localURL = (_s.altURL?_s.altURL:remoteURL), - oEmbed, oMovie, oTarget = _getDocument(), tmp, movieHTML, oEl, extraClass = _getSWFCSS(), s, x, sClass, side = '100%', isRTL = null, html = _doc.getElementsByTagName('html')[0]; - isRTL = (html && html.dir && html.dir.match(/rtl/i)); - smID = (typeof smID === 'undefined'?_s.id:smID); - - if (_didAppend && _appendSuccess) { - return false; // ignore if already succeeded - } - - function _initMsg() { - _s._wD('-- SoundManager 2 ' + _s.version + (!_html5Only && _s.useHTML5Audio?(_s.hasHTML5?' + HTML5 audio':', no HTML5 audio support'):'') + (!_html5Only ? (_s.useMovieStar?', MovieStar mode':'') + (_s.useHighPerformance?', high performance mode, ':', ') + (( _s.flashPollingInterval ? 'custom (' + _s.flashPollingInterval + 'ms)' : (_s.useFastPolling?'fast':'normal')) + ' polling') + (_s.wmode?', wmode: ' + _s.wmode:'') + (_s.debugFlash?', flash debug mode':'') + (_s.useFlashBlock?', flashBlock mode':'') : '') + ' --', 1); - } - - if (_html5Only) { - _setVersionInfo(); - _initMsg(); - _s.oMC = _id(_s.movieID); - _init(); - // prevent multiple init attempts - _didAppend = true; - _appendSuccess = true; - return false; - } - - _didAppend = true; - - // safety check for legacy (change to Flash 9 URL) - _setVersionInfo(); - _s.url = _normalizeMovieURL(_s._overHTTP?remoteURL:localURL); - smURL = _s.url; - - _s.wmode = (!_s.wmode && _s.useHighPerformance && !_s.useMovieStar?'transparent':_s.wmode); - - if (_s.wmode !== null && (_ua.match(/msie 8/i) || (!_isIE && !_s.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) { - _s.specialWmodeCase = true; - // extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here - // does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout - // wmode breaks IE 8 on Vista + Win7 too in some cases, as of Jan.2011 (?) - _wDS('spcWmode'); - _s.wmode = null; - } - - oEmbed = { - 'name': smID, - 'id': smID, - 'src': smURL, - 'width': side, - 'height': side, - 'quality': 'high', - 'allowScriptAccess': _s.allowScriptAccess, - 'bgcolor': _s.bgColor, - 'pluginspage': _s._http+'//www.macromedia.com/go/getflashplayer', - 'type': 'application/x-shockwave-flash', - 'wmode': _s.wmode, - 'hasPriority': 'true' // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html - }; - - if (_s.debugFlash) { - oEmbed.FlashVars = 'debug=1'; - } - - if (!_s.wmode) { - delete oEmbed.wmode; // don't write empty attribute - } - - if (_isIE) { - // IE is "special". - oMovie = _doc.createElement('div'); - movieHTML = '' + (_s.wmode?' ':'') + '' + (_s.debugFlash?'':'') + ''; - } else { - oMovie = _doc.createElement('embed'); - for (tmp in oEmbed) { - if (oEmbed.hasOwnProperty(tmp)) { - oMovie.setAttribute(tmp, oEmbed[tmp]); - } - } - } - - _initDebug(); - extraClass = _getSWFCSS(); - oTarget = _getDocument(); - - if (oTarget) { - _s.oMC = _id(_s.movieID)?_id(_s.movieID):_doc.createElement('div'); - if (!_s.oMC.id) { - _s.oMC.id = _s.movieID; - _s.oMC.className = _s.swfCSS.swfDefault + ' ' + extraClass; - // "hide" flash movie - s = null; - oEl = null; - if (!_s.useFlashBlock) { - if (_s.useHighPerformance) { - s = { - 'position': 'fixed', - 'width': '8px', - 'height': '8px', - // >= 6px for flash to run fast, >= 8px to start up under Firefox/win32 in some cases. odd? yes. - 'bottom': '0px', - 'left': '0px', - 'overflow': 'hidden' - }; - } else { - s = { - 'position': 'absolute', - 'width': '6px', - 'height': '6px', - 'top': '-9999px', - 'left': '-9999px' - }; - if (isRTL) { - s.left = Math.abs(parseInt(s.left,10))+'px'; - } - } - } - if (_isWebkit) { - _s.oMC.style.zIndex = 10000; // soundcloud-reported render/crash fix, safari 5 - } - if (!_s.debugFlash) { - for (x in s) { - if (s.hasOwnProperty(x)) { - _s.oMC.style[x] = s[x]; - } - } - } - try { - if (!_isIE) { - _s.oMC.appendChild(oMovie); - } - oTarget.appendChild(_s.oMC); - if (_isIE) { - oEl = _s.oMC.appendChild(_doc.createElement('div')); - oEl.className = _s.swfCSS.swfBox; - oEl.innerHTML = movieHTML; - } - _appendSuccess = true; - } catch(e) { - throw new Error(_str('appXHTML')); - } - } else { - // it's already in the document. - sClass = _s.oMC.className; - _s.oMC.className = (sClass?sClass+' ':_s.swfCSS.swfDefault) + (extraClass?' '+extraClass:''); - _s.oMC.appendChild(oMovie); - if (_isIE) { - oEl = _s.oMC.appendChild(_doc.createElement('div')); - oEl.className = _s.swfCSS.swfBox; - oEl.innerHTML = movieHTML; - } - _appendSuccess = true; - } - } - - if (specialCase) { - _s._wD(specialCase); - } - - _initMsg(); - _s._wD(_smc+'createMovie(): Trying to load ' + smURL + (!_s._overHTTP && _s.altURL?' (alternate URL)':''), 1); - - return true; - }; - - _idCheck = this.getSoundById; - - _initMovie = function() { - if (_html5Only) { - _createMovie(); - return false; - } - // attempt to get, or create, movie - if (_s.o) { - return false; // may already exist - } - _s.o = _s.getMovie(_s.id); // inline markup - if (!_s.o) { - if (!_oRemoved) { - // try to create - _createMovie(_s.id, _s.url); - } else { - // try to re-append removed movie after reboot() - if (!_isIE) { - _s.oMC.appendChild(_oRemoved); - } else { - _s.oMC.innerHTML = _oRemovedHTML; - } - _oRemoved = null; - _didAppend = true; - } - _s.o = _s.getMovie(_s.id); - } - if (_s.o) { - _s._wD(_smc+'initMovie(): Got '+_s.o.nodeName+' element ('+(_didAppend?'created via JS':'static HTML')+')'); - _wDS('waitEI'); - } - if (_s.oninitmovie instanceof Function) { - setTimeout(_s.oninitmovie, 1); - } - return true; - }; - - _go = function(sURL) { - // where it all begins. - if (sURL) { - _s.url = sURL; - } - _initMovie(); - }; - - _delayWaitForEI = function() { - setTimeout(_waitForEI, 500); - }; - - _waitForEI = function() { - if (_waitingForEI) { - return false; - } - _waitingForEI = true; - _event.remove(_win, 'load', _delayWaitForEI); - if (_tryInitOnFocus && !_isFocused) { - _wDS('waitFocus'); - return false; - } - var p; - if (!_didInit) { - p = _s.getMoviePercent(); - _s._wD(_str('waitImpatient', (p === 100?' (SWF loaded)':(p > 0?' (SWF ' + p + '% loaded)':'')))); - } - setTimeout(function() { - p = _s.getMoviePercent(); - if (!_didInit) { - _s._wD(_sm + ': No Flash response within expected time.\nLikely causes: ' + (p === 0?'Loading ' + _s.movieURL + ' may have failed (and/or Flash ' + _fV + '+ not present?), ':'') + 'Flash blocked or JS-Flash security error.' + (_s.debugFlash?' ' + _str('checkSWF'):''), 2); - if (!_s._overHTTP && p) { - _wDS('localFail', 2); - if (!_s.debugFlash) { - _wDS('tryDebug', 2); - } - } - if (p === 0) { - // if 0 (not null), probably a 404. - _s._wD(_str('swf404', _s.url)); - } - _debugTS('flashtojs', false, ': Timed out' + _s._overHTTP?' (Check flash security or flash blockers)':' (No plugin/missing SWF?)'); - } - // give up / time-out, depending - if (!_didInit && _okToDisable) { - if (p === null) { - // SWF failed. Maybe blocked. - if (_s.useFlashBlock || _s.flashLoadTimeout === 0) { - if (_s.useFlashBlock) { - _flashBlockHandler(); - } - _wDS('waitForever'); - } else { - // old SM2 behaviour, simply fail - _failSafely(true); - } - } else { - // flash loaded? Shouldn't be a blocking issue, then. - if (_s.flashLoadTimeout === 0) { - _wDS('waitForever'); - } else { - _failSafely(true); - } - } - } - }, _s.flashLoadTimeout); - }; - - _go = function(sURL) { - // where it all begins. - if (sURL) { - _s.url = sURL; - } - _initMovie(); - }; - - // - _wDS = function(o, errorLevel) { - if (!o) { - return ''; - } else { - return _s._wD(_str(o), errorLevel); - } - }; - - if (_wl.indexOf('debug=alert') + 1 && _s.debugMode) { - _s._wD = function(sText) {window.alert(sText);}; - } - - _toggleDebug = function() { - var o = _id(_s.debugID), - oT = _id(_s.debugID + '-toggle'); - if (!o) { - return false; - } - if (_debugOpen) { - // minimize - oT.innerHTML = '+'; - o.style.display = 'none'; - } else { - oT.innerHTML = '-'; - o.style.display = 'block'; - } - _debugOpen = !_debugOpen; - }; - - _debugTS = function(sEventType, bSuccess, sMessage) { - // troubleshooter debug hooks - if (typeof sm2Debugger !== 'undefined') { - try { - sm2Debugger.handleEvent(sEventType, bSuccess, sMessage); - } catch(e) { - // oh well - } - } - return true; - }; - // - - _getSWFCSS = function() { - var css = []; - if (_s.debugMode) { - css.push(_s.swfCSS.sm2Debug); - } - if (_s.debugFlash) { - css.push(_s.swfCSS.flashDebug); - } - if (_s.useHighPerformance) { - css.push(_s.swfCSS.highPerf); - } - return css.join(' '); - }; - - _flashBlockHandler = function() { - // *possible* flash block situation. - var name = _str('fbHandler'), p = _s.getMoviePercent(), css = _s.swfCSS; - if (!_s.ok()) { - if (_needsFlash) { - // make the movie more visible, so user can fix - _s.oMC.className = _getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null?css.swfTimedout:css.swfError); - _s._wD(name+': '+_str('fbTimeout')+(p?' ('+_str('fbLoaded')+')':'')); - } - _s.didFlashBlock = true; - _processOnEvents({type:'ontimeout',ignoreInit:true}); // fire onready(), complain lightly - if (_s.onerror instanceof Function) { - _s.onerror.apply(_win); - } - } else { - // SM2 loaded OK (or recovered) - if (_s.didFlashBlock) { - _s._wD(name+': Unblocked'); - } - if (_s.oMC) { - _s.oMC.className = [_getSWFCSS(), css.swfDefault, css.swfLoaded + (_s.didFlashBlock?' '+css.swfUnblocked:'')].join(' '); - } - } - }; - - _handleFocus = function() { - function cleanup() { - _event.remove(_win, 'focus', _handleFocus); - _event.remove(_win, 'load', _handleFocus); - } - if (_isFocused || !_tryInitOnFocus) { - cleanup(); - return true; - } - _okToDisable = true; - _isFocused = true; - _s._wD(_smc+'handleFocus()'); - if (_isSafari && _tryInitOnFocus) { - // giant Safari 3.1 hack - assume mousemove = focus given lack of focus event - _event.remove(_win, 'mousemove', _handleFocus); - } - // allow init to restart - _waitingForEI = false; - cleanup(); - return true; - }; - - _initComplete = function(bNoDisable) { - if (_didInit) { - return false; - } - if (_html5Only) { - // all good. - _s._wD('-- SoundManager 2: loaded --'); - _didInit = true; - _processOnEvents(); - _initUserOnload(); - return true; - } - var sClass = _s.oMC.className, - wasTimeout = (_s.useFlashBlock && _s.flashLoadTimeout && !_s.getMoviePercent()); - if (!wasTimeout) { - _didInit = true; - } - _s._wD('-- SoundManager 2 ' + (_disabled?'failed to load':'loaded') + ' (' + (_disabled?'security/load error':'OK') + ') --', 1); - if (_disabled || bNoDisable) { - if (_s.useFlashBlock) { - _s.oMC.className = _getSWFCSS() + ' ' + (_s.getMoviePercent() === null?_s.swfCSS.swfTimedout:_s.swfCSS.swfError); - } - _processOnEvents({type:'ontimeout'}); - _debugTS('onload', false); - if (_s.onerror instanceof Function) { - _s.onerror.apply(_win); - } - return false; - } else { - _debugTS('onload', true); - } - _event.add(_win, 'unload', _doNothing); // prevent browser from showing cached state via back button, because flash will be dead - if (_s.waitForWindowLoad && !_windowLoaded) { - _wDS('waitOnload'); - _event.add(_win, 'load', _initUserOnload); - return false; - } else { - if (_s.waitForWindowLoad && _windowLoaded) { - _wDS('docLoaded'); - } - _initUserOnload(); - } - return true; - }; - - _addOnEvent = function(sType, oMethod, oScope) { - if (typeof _on_queue[sType] === 'undefined') { - _on_queue[sType] = []; - } - _on_queue[sType].push({ - 'method': oMethod, - 'scope': (oScope || null), - 'fired': false - }); - }; - - _processOnEvents = function(oOptions) { - if (!oOptions) { // assume onready, if unspecified - oOptions = { - type: 'onready' - }; - } - if (!_didInit && oOptions && !oOptions.ignoreInit) { - // not ready yet. - return false; - } - var status = { - success: (oOptions && oOptions.ignoreInit?_s.ok():!_disabled) - }, - srcQueue = (oOptions && oOptions.type?_on_queue[oOptions.type]||[]:[]), // queue specified by type, or none - queue = [], i, j, - canRetry = (_needsFlash && _s.useFlashBlock && !_s.ok()); - for (i = 0; i < srcQueue.length; i++) { - if (srcQueue[i].fired !== true) { - queue.push(srcQueue[i]); - } - } - if (queue.length) { - _s._wD(_sm + ': Firing ' + queue.length + ' '+oOptions.type+'() item' + (queue.length === 1?'':'s')); - for (i = 0, j = queue.length; i < j; i++) { - if (queue[i].scope) { - queue[i].method.apply(queue[i].scope, [status]); - } else { - queue[i].method(status); - } - if (!canRetry) { // flashblock case doesn't count here - queue[i].fired = true; - } - } - } - return true; - }; - - _initUserOnload = function() { - _win.setTimeout(function() { - if (_s.useFlashBlock) { - _flashBlockHandler(); - } - _processOnEvents(); - // call user-defined "onload", scoped to window - if (_s.onload instanceof Function) { - _wDS('onload', 1); - _s.onload.apply(_win); - _wDS('onloadOK', 1); - } - if (_s.waitForWindowLoad) { - _event.add(_win, 'load', _initUserOnload); - } - },1); - }; - - _detectFlash = function() { - - // hat tip: Flash Detect library (BSD, (C) 2007) by Carl "DocYes" S. Yestrau - http://featureblend.com/javascript-flash-detection-library.html / http://featureblend.com/license.txt - - if (_hasFlash !== undefined) { - // this work has already been done. - return _hasFlash; - } - - var hasPlugin = false, n = navigator, nP = n.plugins, obj, type, types, AX = _win.ActiveXObject; - - if (nP && nP.length) { - - type = 'application/x-shockwave-flash'; - types = n.mimeTypes; - if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) { - hasPlugin = true; - } - - } else if (typeof AX !== 'undefined') { - - try { - obj = new AX('ShockwaveFlash.ShockwaveFlash'); - } catch(e) { - // oh well - } - hasPlugin = (!!obj); - - } - - _hasFlash = hasPlugin; - - return hasPlugin; - - }; - - _featureCheck = function() { - var needsFlash, item, - isSpecial = (_ua.match(/iphone os (1|2|3_0|3_1)/i)?true:false); // iPhone <= 3.1 has broken HTML5 audio(), but firmware 3.2 (iPad) + iOS4 works. - if (isSpecial) { - _s.hasHTML5 = false; // has Audio(), but is broken; let it load links directly. - _html5Only = true; // ignore flash case, however - if (_s.oMC) { - _s.oMC.style.display = 'none'; - } - return false; - } - if (_s.useHTML5Audio) { - if (!_s.html5 || !_s.html5.canPlayType) { - _s._wD('SoundManager: No HTML5 Audio() support detected.'); - _s.hasHTML5 = false; - return true; - } else { - _s.hasHTML5 = true; - } - if (_isBadSafari) { - _s._wD(_smc+'Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - '+(!_hasFlash?' would use flash fallback for MP3/MP4, but none detected.':'will use flash fallback for MP3/MP4, if available'),1); - if (_detectFlash()) { - return true; - } - } - } else { - // flash required. - return true; - } - for (item in _s.audioFormats) { - if (_s.audioFormats.hasOwnProperty(item) && _s.audioFormats[item].required && !_s.html5.canPlayType(_s.audioFormats[item].type)) { - // may need flash for this format? - needsFlash = true; - } - } - // sanity check.. - if (_s.ignoreFlash) { - needsFlash = false; - } - _html5Only = (_s.useHTML5Audio && _s.hasHTML5 && !needsFlash && !_s.requireFlash); - return (_detectFlash() && needsFlash); - }; - - _init = function() { - var item, tests = []; - _wDS('init'); - - // called after onload() - if (_didInit) { - _wDS('didInit'); - return false; - } - - function _cleanup() { - _event.remove(_win, 'load', _s.beginDelayedInit); - } - - if (_s.hasHTML5) { - for (item in _s.audioFormats) { - if (_s.audioFormats.hasOwnProperty(item)) { - tests.push(item+': '+_s.html5[item]); - } - } - _s._wD('-- SoundManager 2: HTML5 support tests ('+_s.html5Test+'): '+tests.join(', ')+' --',1); - } - - if (_html5Only) { - if (!_didInit) { - // we don't need no steenking flash! - _cleanup(); - _s.enabled = true; - _initComplete(); - } - return true; - } - - // flash path - _initMovie(); - try { - _wDS('flashJS'); - _s.o._externalInterfaceTest(false); // attempt to talk to Flash - if (!_s.allowPolling) { - _wDS('noPolling', 1); - } else { - _setPolling(true, _s.flashPollingInterval ? _s.flashPollingInterval : (_s.useFastPolling ? 10 : 50)); - } - if (!_s.debugMode) { - _s.o._disableDebug(); - } - _s.enabled = true; - _debugTS('jstoflash', true); - } catch(e) { - _s._wD('js/flash exception: ' + e.toString()); - _debugTS('jstoflash', false); - _failSafely(true); // don't disable, for reboot() - _initComplete(); - return false; - } - _initComplete(); - // event cleanup - _cleanup(); - return true; - }; - - _beginInit = function() { - if (_initPending) { - return false; - } - _createMovie(); - _initMovie(); - _initPending = true; - return true; - }; - - _dcLoaded = function() { - if (_didDCLoaded) { - return false; - } - _didDCLoaded = true; - _initDebug(); - if (!_s.useHTML5Audio) { - if (!_detectFlash()) { - _s._wD('SoundManager: No Flash detected, trying HTML5'); - _s.useHTML5Audio = true; - } - } - _testHTML5(); - _s.html5.usingFlash = _featureCheck(); - _needsFlash = _s.html5.usingFlash; - _didDCLoaded = true; - if (_doc.removeEventListener) { - _doc.removeEventListener('DOMContentLoaded', _dcLoaded, false); - } - _go(); - return true; - }; - - _startTimer = function(oSound) { - if (!oSound._hasTimer) { - oSound._hasTimer = true; - } - }; - - _stopTimer = function(oSound) { - if (oSound._hasTimer) { - oSound._hasTimer = false; - } - }; - - _die = function() { - if (_s.onerror instanceof Function) { - _s.onerror(); - } - _s.disable(); - }; - - _badSafariFix = function() { - // special case: "bad" Safari can fall back to flash for MP3/MP4 - if (!_isBadSafari || !_detectFlash()) { - return false; // doesn't apply - } - var aF = _s.audioFormats, i, item; - for (item in aF) { - if (aF.hasOwnProperty(item)) { - // special case: "bad" Safari can fall back to flash for MP3/MP4 - if (item === 'mp3' || item === 'mp4') { - _s._wD(_sm+': Using flash fallback for '+item+' format'); - _s.html5[item] = false; - // assign result to related formats, too - if (aF[item] && aF[item].related) { - for (i = aF[item].related.length; i--;) { - _s.html5[aF[item].related[i]] = false; - } - } - } - } - } - }; - - // pseudo-private methods called by Flash - - this._setSandboxType = function(sandboxType) { - // - var sb = _s.sandbox; - sb.type = sandboxType; - sb.description = sb.types[(typeof sb.types[sandboxType] !== 'undefined'?sandboxType:'unknown')]; - _s._wD('Flash security sandbox type: ' + sb.type); - if (sb.type === 'localWithFile') { - sb.noRemote = true; - sb.noLocal = false; - _wDS('secNote', 2); - } else if (sb.type === 'localWithNetwork') { - sb.noRemote = false; - sb.noLocal = true; - } else if (sb.type === 'localTrusted') { - sb.noRemote = false; - sb.noLocal = false; - } - // - }; - - this._externalInterfaceOK = function(flashDate) { - // flash callback confirming flash loaded, EI working etc. - // flashDate = approx. timing/delay info for JS/flash bridge - if (_s.swfLoaded) { - return false; - } - var eiTime = new Date().getTime(); - _s._wD(_smc+'externalInterfaceOK()' + (flashDate?' (~' + (eiTime - flashDate) + ' ms)':'')); - _debugTS('swf', true); - _debugTS('flashtojs', true); - _s.swfLoaded = true; - _tryInitOnFocus = false; - if (_isBadSafari) { - _badSafariFix(); - } - if (_isIE) { - // IE needs a timeout OR delay until window.onload - may need TODO: investigating - setTimeout(_init, 100); - } else { - _init(); - } - }; - - _dcIE = function() { - if (_doc.readyState === 'complete') { - _dcLoaded(); - _doc.detachEvent('onreadystatechange', _dcIE); - } - return true; - }; - - // focus and window load, init - if (!_s.hasHTML5 || _needsFlash) { - // only applies to Flash mode - _event.add(_win, 'focus', _handleFocus); - _event.add(_win, 'load', _handleFocus); - _event.add(_win, 'load', _delayWaitForEI); - if (_isSafari && _tryInitOnFocus) { - _event.add(_win, 'mousemove', _handleFocus); // massive Safari focus hack - } - } - - if (_doc.addEventListener) { - _doc.addEventListener('DOMContentLoaded', _dcLoaded, false); - } else if (_doc.attachEvent) { - _doc.attachEvent('onreadystatechange', _dcIE); - } else { - // no add/attachevent support - safe to assume no JS -> Flash either - _debugTS('onload', false); - _die(); - } - - if (_doc.readyState === 'complete') { - setTimeout(_dcLoaded,100); - } - -} // SoundManager() - -// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading -if (typeof SM2_DEFER === 'undefined' || !SM2_DEFER) { - soundManager = new SoundManager(); -} - -// public interfaces -window.SoundManager = SoundManager; // constructor -window.soundManager = soundManager; // public API, flash callbacks etc - -}(window)); diff --git a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2.swf b/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2.swf deleted file mode 100644 index 6f9c0560..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2.swf and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_debug.swf b/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_debug.swf deleted file mode 100644 index 0eb074d3..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_debug.swf and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash9.swf b/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash9.swf deleted file mode 100644 index bf986d6a..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash9.swf and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash9_debug.swf b/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash9_debug.swf deleted file mode 100644 index c84da747..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash9_debug.swf and /dev/null differ diff --git a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash_xdomain.zip b/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash_xdomain.zip deleted file mode 100644 index 3817c76b..00000000 Binary files a/views/vibeOS/appfiles/breakout/sound/swf/soundmanager2_flash_xdomain.zip and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/app/lib/require.min.js b/views/vibeOS/appfiles/nsvg/components/app/lib/require.min.js deleted file mode 100644 index 75d9b0eb..00000000 --- a/views/vibeOS/appfiles/nsvg/components/app/lib/require.min.js +++ /dev/null @@ -1 +0,0 @@ -var requirejs,require,define;!function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.6",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i'); - ret.cdata =tmp_data[0]; - ret.svg += tmp_data[1]; - if (ret.cdata.substr(0,1)=='\r' || ret.cdata.substr(0,1)=='\n'){ - ret.cdata = ret.cdata.substr(2,ret.cdata.length); - } - } - return ret; - }, - on_canvas_change:function(){ - if(!obj.call_canvas_change) return false; - if(obj.timeout_canvas_change) clearTimeout(obj.timeout_canvas_change); - obj.timeout_canvas_change = setTimeout(function(){ - if(!obj.call_canvas_change) return false; - obj.call_svg_editor_change = false; - var svg_data = obj.parse_svg_string(methodDraw.canvas.getSvgString()); - obj.editor_svg.setValue(svg_data.svg); - obj.highlight_method_draw_selection(); - if(svg_data.cdata){ - methodDraw.loadFromString(svg_data.svg); - methodDraw.updateCanvas(); - obj.editor_code.setValue(svg_data.cdata); - obj.editor_action(obj.editor_code,'Format Document'); - } - obj.call_svg_editor_change = true; - - },100) - return obj; - }, - call_svg_editor_change:true, - timeout_svg_editor_change:false, - on_svg_editor_change:function(){ - if(!obj.call_svg_editor_change) return false; - if(obj.timeout_svg_editor_change) clearTimeout(obj.timeout_svg_editor_change); - var cur_selection = obj.method_draw_selection; - obj.timeout_svg_editor_change = setTimeout(function(){ - if(!obj.call_svg_editor_change) return false; - obj.call_canvas_change = false; - methodDraw.loadFromString(obj.editor_svg.getValue()); - methodDraw.updateCanvas(); - setTimeout(function(){ - //methodDraw.canvas.runExtensions("selectedChanged", cur_selection); - },100); - - obj.call_canvas_change = true; - },100); - - return obj; - }, - cached_patens:{}, - find_match:function(pat_id,pattern,my_text){ - if(!obj.cached_patens[pat_id]) obj.cached_patens[pat_id] = new RegExp(pattern, 'mi'); - let re_match = my_text.match(obj.cached_patens[pat_id]); - if(re_match){ - re_match = re_match[0]; - let ret = obj.editor_svg.getModel().findMatches(re_match); - if (ret.length>0) return ret[0]; - } - return false; - }, - method_draw_selection:false, - delta_decorations:[], - timeout_highlight:false, - highlight_method_draw_selection:function(){ - if(obj.timeout_highlight) clearTimeout(obj.timeout_highlight); - obj.timeout_highlight = setTimeout(function(){ - obj.delta_decorations = obj.editor_svg.deltaDecorations(obj.delta_decorations, [{ range: new monaco.Range(1,1,1,1), options : { } }]); - if (obj.method_draw_selection){ - var delta_decorations = []; - var monaco_text = obj.editor_svg.getValue(); - for (var el of obj.method_draw_selection.elements){ - var pattern_2 = '(<\/?\\w*(?:(?:(?:\\s*(?:".*"|\'.*\'|[^\'"<\\s]?))?)+\\s*|\\s*)\\sid\\s*=\\s*["|\']?' + el.id +'["|\']?(?:(?:(?:\\s*(?:".*"|\'.*\'|[^\'">\\s]?))?)+\\s*|\\s*)\\w*\/?>)'; - var pattern_1 = '(\\s]?))?)+\\s*|\\s*)\\w*>)[\\S\\s]+?<\/g>'; - var el_string = methodDraw.canvas.svgToString(el); - var match = obj.editor_svg.getModel().findMatches(el_string); - match =(match.length>0)?match[0]:false; - //match = false; - if (!match) match = obj.find_match('p1_'+el.id,pattern_1,monaco_text); - if (!match) match = obj.find_match('p2_'+el.id,pattern_2,monaco_text); - - if (match) { - var position =match.range; - delta_decorations.push({range: new monaco.Range(position.startLineNumber,position.startColumn,position.endLineNumber,position.endColumn), options: { inlineClassName: 'selected_element' }}); - if (position){ - //obj.editor_svg.setPosition({column: position.startColumn, lineNumber: position.startLineNumber}); - obj.editor_svg.revealLineInCenter(position.startLineNumber); - } - } - } - obj.delta_decorations = obj.editor_svg.deltaDecorations([],delta_decorations); - } - },100); - return obj; - }, - selection_changed:false, - on_select:function(data){ - if (!obj.delta_slob) obj.delta_slob = obj.editor_svg.deltaDecorations([],[]); - if (data) obj.method_draw_selection = data; - if (obj.method_draw_selection && obj.method_draw_selection.selectedElement){ - var el_exists = false; - if (obj.editor_svg.getModel().findMatches('id="'+obj.method_draw_selection.selectedElement.id+'"').length > 0) el_exists=true; - if (obj.editor_svg.getModel().findMatches("id='"+obj.method_draw_selection.selectedElement.id+"'").length > 0) el_exists=true; - if (!el_exists) obj.on_canvas_change(); - else obj.selection_changed = true; - }else{ - obj.selection_changed = true; - } - return obj; - }, - on_open:function(data){ - obj.call_svg_editor_change = obj.call_canvas_change = false; - setTimeout(function(){ - var svg_data = obj.parse_svg_string(data); - obj.editor_svg.setValue(svg_data.svg); - obj.editor_code.setValue(svg_data.cdata); - obj.editor_action(obj.editor_code,'Format Document'); - obj.editor_action(obj.editor_svg,'Format Document'); - obj.call_svg_editor_change = obj.call_canvas_change = true; - },100); - return obj; - }, - mouse_down:false, - init_dom_mouse(){ - document.addEventListener('mousedown', e => { - obj.mouse_down = true; - }); - document.addEventListener('mouseup', e => { - obj.mouse_down = false; - if (obj.selection_changed){ - obj.highlight_method_draw_selection(); - obj.selection_changed = false; - } - }); - return obj; - }, - editors_layout:function(){ - if (typeof obj.editor_svg !== 'undefined') { - obj.editor_svg.layout(); - } - if (typeof obj.editor_code !== 'undefined') { - obj.editor_code.layout(); - } - $('#svg_editor').css('width','100%'); - }, - compiled:false, - build:function(){ - var temp_svg = obj.editor_svg.getValue(); - obj.compiled = [ - temp_svg.substr(0,temp_svg.length-6), - '', - '' - ].join('\n'); - return obj; - }, - init_method_draw:function(){ - window.methodDraw.onChange = obj.on_canvas_change; - window.methodDraw.onOpen = obj.on_open; - window.methodDraw.onSelect = obj.on_select; - return obj; - }, - init_monaco:function(){ - obj.editor_svg_el = $('#editor_svg'); - obj.editor_code_el = $('#editor_code'); - if (obj.editor_svg_el.length > 0) { - obj.editor_svg = monaco.editor.create(obj.editor_svg_el.get(0), { - value: [].join('\n'), - theme: 'vs-dark', - scrollbar: { - useShadows: false, - verticalHasArrows: true, - horizontalHasArrows: true, - verticalScrollbarSize: 17, - horizontalScrollbarSize: 17, - arrowSize: 30 - }, - //wordWrap: 'wordWrapColumn', - //wordWrapMinified: true, - //wrappingIndent: "indent", - language: 'html', - scrollBeyondLastColumn: 0, - scrollBeyondLastLine: true, - //showFoldingControls: 'always', - //renderWhitespace: 'all', - //renderControlCharacters: true - }); - obj.editor_svg.onDidChangeModelContent(obj.on_svg_editor_change); - } - if (obj.editor_code_el.length > 0) { - obj.editor_code = monaco.editor.create(obj.editor_code_el.get(0), { - value: [ - '// DEMO code - Draw a Circle, Line or Rectangle and press Run', - 'var svg1 = document.getElementById("svg_1");', - 'if(svg1){', - ' var possible_props = ["x1","x","cx"];', - ' var prop = false;', - ' for (var n of possible_props){', - ' if (svg1[n]){', - ' prop = n;', - ' break;', - ' }', - ' }', - ' var val = parseFloat(svg1.getAttribute(prop));', - ' var end = val + 100;', - ' var timer = setInterval(function(){', - ' val+=0.5;', - ' if (val >= end){', - ' clearInterval(timer);', - ' return true;', - ' }', - ' svg1.setAttribute(prop,val);', - ' },10);', - '}' - ].join('\n'), - theme: 'vs-dark', - scrollbar: { - useShadows: false, - verticalHasArrows: true, - horizontalHasArrows: true, - verticalScrollbarSize: 17, - horizontalScrollbarSize: 17, - arrowSize: 30 - }, - language: 'javascript', - scrollBeyondLastColumn: 0, - scrollBeyondLastLine: true, - //showFoldingControls: 'always', - //renderWhitespace: 'all', - //renderControlCharacters: true - }); - obj.show_tab('editor_code') - } - $(window).on('resize', function(){ - obj.editors_layout(); - }); - return obj; - }, - init_tab_bar:function(){ - $('#svg_editor').resizable({ - handles: 's', - stop: function(event, ui) { - obj.editor_height = $(this).height(); - obj.editors_layout(); - } - }); - return obj; - }, - show_preview:function(){ - obj.build(); - $('#svg_editor').animate({'height':'0px'},300,function(){ - $('#run_code').html(''); - - -
- - - diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Arvo-Regular-webfont.svg b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Arvo-Regular-webfont.svg deleted file mode 100644 index 55fd0f6b..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Arvo-Regular-webfont.svg +++ /dev/null @@ -1,145 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright 2010 Anton Koovit -Designer : Anton Koovit -Foundry : Anton Koovit -Foundry URL : httpwwwkorkorkcom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Arvo-Regular-webfont.ttf b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Arvo-Regular-webfont.ttf deleted file mode 100644 index a82e385a..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Arvo-Regular-webfont.ttf and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.eot b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.eot deleted file mode 100644 index 1b442b2c..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.eot and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.svg b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.svg deleted file mode 100644 index 510798ab..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.svg +++ /dev/null @@ -1,133 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Generated in 2009 by FontLab Studio Copyright info pending - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.ttf b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.ttf deleted file mode 100644 index 2d49db05..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.ttf and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.woff deleted file mode 100644 index f63f8137..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/Junction-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.eot b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.eot deleted file mode 100644 index 08deeb7b..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.eot and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.svg b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.svg deleted file mode 100644 index 7523f758..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.svg +++ /dev/null @@ -1,235 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Generated in 2009 by FontLab Studio Copyright info pending - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.ttf b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.ttf deleted file mode 100644 index efbe8b46..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.ttf and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.woff deleted file mode 100644 index 2e2cda96..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/League_Gothic-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-bold-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-bold-webfont.woff deleted file mode 100644 index 403723be..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-bold-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-bolditalic-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-bolditalic-webfont.woff deleted file mode 100644 index b601f26d..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-bolditalic-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-italic-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-italic-webfont.woff deleted file mode 100644 index 890b291e..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-italic-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-regular-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-regular-webfont.woff deleted file mode 100644 index dad6488c..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/arvo-regular-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/euphoriascript-regular-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/euphoriascript-regular-webfont.woff deleted file mode 100644 index 57ee3373..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/euphoriascript-regular-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.eot b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.eot deleted file mode 100644 index 94f8fae1..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.eot and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.svg b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.svg deleted file mode 100644 index 6bc919af..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.svg +++ /dev/null @@ -1,939 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright c 2011 Barry Schwartz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.ttf b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.ttf deleted file mode 100644 index 008d5f9e..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.ttf and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.woff deleted file mode 100644 index ede3aa24..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.eot b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.eot deleted file mode 100644 index 7cc62dd9..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.eot and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.svg b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.svg deleted file mode 100644 index 816155bc..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.svg +++ /dev/null @@ -1,682 +0,0 @@ - - - - -This is a custom SVG webfont generated by Font Squirrel. -Copyright : Copyright c 2011 Barry Schwartz - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.ttf b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.ttf deleted file mode 100644 index 8f41cca3..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.ttf and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.woff deleted file mode 100644 index 53156d2c..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/fanwood_italic-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/shadowsintolight-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/shadowsintolight-webfont.woff deleted file mode 100644 index af8e15c4..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/shadowsintolight-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-black-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-black-webfont.woff deleted file mode 100644 index 10577271..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-black-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-blackitalic-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-blackitalic-webfont.woff deleted file mode 100644 index 63080ebd..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-blackitalic-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-italic-webfont.ttf b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-italic-webfont.ttf deleted file mode 100644 index d469c0cb..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-italic-webfont.ttf and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-regular-webfont.woff b/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-regular-webfont.woff deleted file mode 100644 index 3f8d3834..00000000 Binary files a/views/vibeOS/appfiles/nsvg/components/method-draw/css/font-files/simonetta-regular-webfont.woff and /dev/null differ diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/fonts.css b/views/vibeOS/appfiles/nsvg/components/method-draw/css/fonts.css deleted file mode 100644 index 1604519d..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/fonts.css +++ /dev/null @@ -1,84 +0,0 @@ -@font-face { - font-family: 'Arvo'; - src: url('font-files/arvo-bold-webfont.woff') format('woff'); - font-weight: bold; - font-style: normal; -} -@font-face { - font-family: 'Arvo'; - src: url('font-files/arvo-bolditalic-webfont.woff') format('woff'); - font-weight: bold; - font-style: italic; -} -@font-face { - font-family: 'Arvo'; - src: url('font-files/arvo-italic-webfont.woff') format('woff'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'Arvo'; - src: url('font-files/arvo-regular-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Euphoria'; - src: url('font-files/euphoriascript-regular-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Shadows Into Light'; - src: url('font-files/shadowsintolight-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Simonetta'; - src: url('font-files/simonetta-black-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Simonetta'; - src: url('font-files/simonetta-blackitalic-webfont.woff') format('woff'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'Simonetta'; - src: url('font-files/simonetta-italic-webfont.woff') format('woff'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'Simonetta'; - src: url('font-files/simonetta-regular-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Junction'; - src: url('font-files/Junction-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'League Gothic'; - src: url('font-files/League_Gothic-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Fanwood'; - src: url('font-files/fanwood-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'Fanwood'; - src: url('font-files/fanwood_italic-webfont.woff') format('woff'); - font-weight: normal; - font-style: italic; -} \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/jquery-ui.min.css b/views/vibeOS/appfiles/nsvg/components/method-draw/css/jquery-ui.min.css deleted file mode 100644 index 2beeb3bc..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/jquery-ui.min.css +++ /dev/null @@ -1,10 +0,0 @@ -/* - * jQuery UI CSS Framework 1.8.17 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - */ -.ui-helper-hidden{display:none;}.ui-helper-hidden-accessible{position:absolute!important;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px);}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none;}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;}.ui-helper-clearfix:after{clear:both;}.ui-helper-clearfix{zoom:1;}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0);}.ui-state-disabled{cursor:default!important;}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%;}.ui-accordion{width:100%;}.ui-accordion .ui-accordion-header{cursor:pointer;position:relative;margin-top:1px;zoom:1;}.ui-accordion .ui-accordion-li-fix{display:inline;}.ui-accordion .ui-accordion-header-active{border-bottom:0!important;}.ui-accordion .ui-accordion-header a{display:block;font-size:1em;padding:.5em .5em .5em .7em;}.ui-accordion-icons .ui-accordion-header a{padding-left:2.2em;}.ui-accordion .ui-accordion-header .ui-icon{position:absolute;left:.5em;top:50%;margin-top:-8px;}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;margin-top:-2px;position:relative;top:1px;margin-bottom:2px;overflow:auto;display:none;zoom:1;}.ui-accordion .ui-accordion-content-active{display:block;}.ui-autocomplete{position:absolute;cursor:default;}* html .ui-autocomplete{width:1px;}.ui-menu{list-style:none;padding:2px;margin:0;display:block;float:left;}.ui-menu .ui-menu{margin-top:-3px;}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;float:left;clear:left;width:100%;}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:.2em .4em;line-height:1.5;zoom:1;}.ui-menu .ui-menu-item a.ui-state-hover,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px;}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;text-decoration:none!important;cursor:pointer;text-align:center;zoom:1;overflow:visible;}.ui-button-icon-only{width:2.2em;}button.ui-button-icon-only{width:2.4em;}.ui-button-icons-only{width:3.4em;}button.ui-button-icons-only{width:3.7em;}.ui-button .ui-button-text{display:block;line-height:1.4;}.ui-button-text-only .ui-button-text{padding:.4em 1em;}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px;}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em;}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em;}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em;}input.ui-button{padding:.4em 1em;}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px;}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px;}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em;}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em;}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em;}.ui-buttonset{margin-right:7px;}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em;}button.ui-button::-moz-focus-inner{border:0;padding:0;}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none;}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0;}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em;}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px;}.ui-datepicker .ui-datepicker-prev{left:2px;}.ui-datepicker .ui-datepicker-next{right:2px;}.ui-datepicker .ui-datepicker-prev-hover{left:1px;}.ui-datepicker .ui-datepicker-next-hover{right:1px;}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px;}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center;}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0;}.ui-datepicker select.ui-datepicker-month-year{width:100%;}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%;}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em;}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0;}.ui-datepicker td{border:0;padding:1px;}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none;}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0;}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible;}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left;}.ui-datepicker.ui-datepicker-multi{width:auto;}.ui-datepicker-multi .ui-datepicker-group{float:left;}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em;}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%;}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%;}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%;}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0;}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0;}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left;}.ui-datepicker-row-break{clear:both;width:100%;font-size:0;}.ui-datepicker-rtl{direction:rtl;}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto;}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto;}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto;}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto;}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right;}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left;}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right;}.ui-datepicker-rtl .ui-datepicker-group{float:right;}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px;}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px;}.ui-datepicker-cover{display:none;display:block;position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px;}.ui-dialog{position:absolute;padding:.2em;width:300px;overflow:hidden;}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative;}.ui-dialog .ui-dialog-title{float:left;margin:.1em 16px .1em 0;}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px;}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px;}.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0;}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto;zoom:1;}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em;}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right;}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer;}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px;}.ui-draggable .ui-dialog-titlebar{cursor:move;}.ui-progressbar{height:2em;text-align:left;overflow:hidden;}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%;}.ui-resizable{position:relative;}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block;}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none;}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0;}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0;}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%;}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%;}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px;}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px;}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px;}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px;}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black;}.ui-slider{position:relative;text-align:left;}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0;}.ui-slider-horizontal{height:.8em;}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em;}.ui-slider-horizontal .ui-slider-range{top:0;height:100%;}.ui-slider-horizontal .ui-slider-range-min{left:0;}.ui-slider-horizontal .ui-slider-range-max{right:0;}.ui-slider-vertical{width:.8em;height:100px;}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em;}.ui-slider-vertical .ui-slider-range{left:0;width:100%;}.ui-slider-vertical .ui-slider-range-min{bottom:0;}.ui-slider-vertical .ui-slider-range-max{top:0;}.ui-tabs{position:relative;padding:.2em;zoom:1;}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0;}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:1px;margin:0 .2em 1px 0;border-bottom:0!important;padding:0;white-space:nowrap;}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none;}.ui-tabs .ui-tabs-nav li.ui-tabs-selected{margin-bottom:0;padding-bottom:1px;}.ui-tabs .ui-tabs-nav li.ui-tabs-selected a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-state-processing a{cursor:text;}.ui-tabs .ui-tabs-nav li a,.ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a{cursor:pointer;}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none;}.ui-tabs .ui-tabs-hide{display:none!important;}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em;}.ui-widget .ui-widget{font-size:1em;}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em;}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222;}.ui-widget-content a{color:#222;}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold;}.ui-widget-header a{color:#222;}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555;}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none;}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121;}.ui-state-hover a,.ui-state-hover a:hover{color:#212121;text-decoration:none;}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121;}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none;}.ui-widget :active{outline:none;}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636;}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636;}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a;}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a;}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a;}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold;}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal;}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none;}.ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png);}.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png);}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png);}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png);}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png);}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png);}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png);}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png);}.ui-icon-carat-1-n{background-position:0 0;}.ui-icon-carat-1-ne{background-position:-16px 0;}.ui-icon-carat-1-e{background-position:-32px 0;}.ui-icon-carat-1-se{background-position:-48px 0;}.ui-icon-carat-1-s{background-position:-64px 0;}.ui-icon-carat-1-sw{background-position:-80px 0;}.ui-icon-carat-1-w{background-position:-96px 0;}.ui-icon-carat-1-nw{background-position:-112px 0;}.ui-icon-carat-2-n-s{background-position:-128px 0;}.ui-icon-carat-2-e-w{background-position:-144px 0;}.ui-icon-triangle-1-n{background-position:0 -16px;}.ui-icon-triangle-1-ne{background-position:-16px -16px;}.ui-icon-triangle-1-e{background-position:-32px -16px;}.ui-icon-triangle-1-se{background-position:-48px -16px;}.ui-icon-triangle-1-s{background-position:-64px -16px;}.ui-icon-triangle-1-sw{background-position:-80px -16px;}.ui-icon-triangle-1-w{background-position:-96px -16px;}.ui-icon-triangle-1-nw{background-position:-112px -16px;}.ui-icon-triangle-2-n-s{background-position:-128px -16px;}.ui-icon-triangle-2-e-w{background-position:-144px -16px;}.ui-icon-arrow-1-n{background-position:0 -32px;}.ui-icon-arrow-1-ne{background-position:-16px -32px;}.ui-icon-arrow-1-e{background-position:-32px -32px;}.ui-icon-arrow-1-se{background-position:-48px -32px;}.ui-icon-arrow-1-s{background-position:-64px -32px;}.ui-icon-arrow-1-sw{background-position:-80px -32px;}.ui-icon-arrow-1-w{background-position:-96px -32px;}.ui-icon-arrow-1-nw{background-position:-112px -32px;}.ui-icon-arrow-2-n-s{background-position:-128px -32px;}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px;}.ui-icon-arrow-2-e-w{background-position:-160px -32px;}.ui-icon-arrow-2-se-nw{background-position:-176px -32px;}.ui-icon-arrowstop-1-n{background-position:-192px -32px;}.ui-icon-arrowstop-1-e{background-position:-208px -32px;}.ui-icon-arrowstop-1-s{background-position:-224px -32px;}.ui-icon-arrowstop-1-w{background-position:-240px -32px;}.ui-icon-arrowthick-1-n{background-position:0 -48px;}.ui-icon-arrowthick-1-ne{background-position:-16px -48px;}.ui-icon-arrowthick-1-e{background-position:-32px -48px;}.ui-icon-arrowthick-1-se{background-position:-48px -48px;}.ui-icon-arrowthick-1-s{background-position:-64px -48px;}.ui-icon-arrowthick-1-sw{background-position:-80px -48px;}.ui-icon-arrowthick-1-w{background-position:-96px -48px;}.ui-icon-arrowthick-1-nw{background-position:-112px -48px;}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px;}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px;}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px;}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px;}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px;}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px;}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px;}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px;}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px;}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px;}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px;}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px;}.ui-icon-arrowreturn-1-w{background-position:-64px -64px;}.ui-icon-arrowreturn-1-n{background-position:-80px -64px;}.ui-icon-arrowreturn-1-e{background-position:-96px -64px;}.ui-icon-arrowreturn-1-s{background-position:-112px -64px;}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px;}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px;}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px;}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px;}.ui-icon-arrow-4{background-position:0 -80px;}.ui-icon-arrow-4-diag{background-position:-16px -80px;}.ui-icon-extlink{background-position:-32px -80px;}.ui-icon-newwin{background-position:-48px -80px;}.ui-icon-refresh{background-position:-64px -80px;}.ui-icon-shuffle{background-position:-80px -80px;}.ui-icon-transfer-e-w{background-position:-96px -80px;}.ui-icon-transferthick-e-w{background-position:-112px -80px;}.ui-icon-folder-collapsed{background-position:0 -96px;}.ui-icon-folder-open{background-position:-16px -96px;}.ui-icon-document{background-position:-32px -96px;}.ui-icon-document-b{background-position:-48px -96px;}.ui-icon-note{background-position:-64px -96px;}.ui-icon-mail-closed{background-position:-80px -96px;}.ui-icon-mail-open{background-position:-96px -96px;}.ui-icon-suitcase{background-position:-112px -96px;}.ui-icon-comment{background-position:-128px -96px;}.ui-icon-person{background-position:-144px -96px;}.ui-icon-print{background-position:-160px -96px;}.ui-icon-trash{background-position:-176px -96px;}.ui-icon-locked{background-position:-192px -96px;}.ui-icon-unlocked{background-position:-208px -96px;}.ui-icon-bookmark{background-position:-224px -96px;}.ui-icon-tag{background-position:-240px -96px;}.ui-icon-home{background-position:0 -112px;}.ui-icon-flag{background-position:-16px -112px;}.ui-icon-calendar{background-position:-32px -112px;}.ui-icon-cart{background-position:-48px -112px;}.ui-icon-pencil{background-position:-64px -112px;}.ui-icon-clock{background-position:-80px -112px;}.ui-icon-disk{background-position:-96px -112px;}.ui-icon-calculator{background-position:-112px -112px;}.ui-icon-zoomin{background-position:-128px -112px;}.ui-icon-zoomout{background-position:-144px -112px;}.ui-icon-search{background-position:-160px -112px;}.ui-icon-wrench{background-position:-176px -112px;}.ui-icon-gear{background-position:-192px -112px;}.ui-icon-heart{background-position:-208px -112px;}.ui-icon-star{background-position:-224px -112px;}.ui-icon-link{background-position:-240px -112px;}.ui-icon-cancel{background-position:0 -128px;}.ui-icon-plus{background-position:-16px -128px;}.ui-icon-plusthick{background-position:-32px -128px;}.ui-icon-minus{background-position:-48px -128px;}.ui-icon-minusthick{background-position:-64px -128px;}.ui-icon-close{background-position:-80px -128px;}.ui-icon-closethick{background-position:-96px -128px;}.ui-icon-key{background-position:-112px -128px;}.ui-icon-lightbulb{background-position:-128px -128px;}.ui-icon-scissors{background-position:-144px -128px;}.ui-icon-clipboard{background-position:-160px -128px;}.ui-icon-copy{background-position:-176px -128px;}.ui-icon-contact{background-position:-192px -128px;}.ui-icon-image{background-position:-208px -128px;}.ui-icon-video{background-position:-224px -128px;}.ui-icon-script{background-position:-240px -128px;}.ui-icon-alert{background-position:0 -144px;}.ui-icon-info{background-position:-16px -144px;}.ui-icon-notice{background-position:-32px -144px;}.ui-icon-help{background-position:-48px -144px;}.ui-icon-check{background-position:-64px -144px;}.ui-icon-bullet{background-position:-80px -144px;}.ui-icon-radio-off{background-position:-96px -144px;}.ui-icon-radio-on{background-position:-112px -144px;}.ui-icon-pin-w{background-position:-128px -144px;}.ui-icon-pin-s{background-position:-144px -144px;}.ui-icon-play{background-position:0 -160px;}.ui-icon-pause{background-position:-16px -160px;}.ui-icon-seek-next{background-position:-32px -160px;}.ui-icon-seek-prev{background-position:-48px -160px;}.ui-icon-seek-end{background-position:-64px -160px;}.ui-icon-seek-start{background-position:-80px -160px;}.ui-icon-seek-first{background-position:-80px -160px;}.ui-icon-stop{background-position:-96px -160px;}.ui-icon-eject{background-position:-112px -160px;}.ui-icon-volume-off{background-position:-128px -160px;}.ui-icon-volume-on{background-position:-144px -160px;}.ui-icon-power{background-position:0 -176px;}.ui-icon-signal-diag{background-position:-16px -176px;}.ui-icon-signal{background-position:-32px -176px;}.ui-icon-battery-0{background-position:-48px -176px;}.ui-icon-battery-1{background-position:-64px -176px;}.ui-icon-battery-2{background-position:-80px -176px;}.ui-icon-battery-3{background-position:-96px -176px;}.ui-icon-circle-plus{background-position:0 -192px;}.ui-icon-circle-minus{background-position:-16px -192px;}.ui-icon-circle-close{background-position:-32px -192px;}.ui-icon-circle-triangle-e{background-position:-48px -192px;}.ui-icon-circle-triangle-s{background-position:-64px -192px;}.ui-icon-circle-triangle-w{background-position:-80px -192px;}.ui-icon-circle-triangle-n{background-position:-96px -192px;}.ui-icon-circle-arrow-e{background-position:-112px -192px;}.ui-icon-circle-arrow-s{background-position:-128px -192px;}.ui-icon-circle-arrow-w{background-position:-144px -192px;}.ui-icon-circle-arrow-n{background-position:-160px -192px;}.ui-icon-circle-zoomin{background-position:-176px -192px;}.ui-icon-circle-zoomout{background-position:-192px -192px;}.ui-icon-circle-check{background-position:-208px -192px;}.ui-icon-circlesmall-plus{background-position:0 -208px;}.ui-icon-circlesmall-minus{background-position:-16px -208px;}.ui-icon-circlesmall-close{background-position:-32px -208px;}.ui-icon-squaresmall-plus{background-position:-48px -208px;}.ui-icon-squaresmall-minus{background-position:-64px -208px;}.ui-icon-squaresmall-close{background-position:-80px -208px;}.ui-icon-grip-dotted-vertical{background-position:0 -224px;}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px;}.ui-icon-grip-solid-vertical{background-position:-32px -224px;}.ui-icon-grip-solid-horizontal{background-position:-48px -224px;}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px;}.ui-icon-grip-diagonal-se{background-position:-80px -224px;}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px;}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px;}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px;}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px;}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;} \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/method-draw.compiled.css b/views/vibeOS/appfiles/nsvg/components/method-draw/css/method-draw.compiled.css deleted file mode 100644 index 22fc5985..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/method-draw.compiled.css +++ /dev/null @@ -1,417 +0,0 @@ -#svg_editor .jPicker .Icon{display:inline-block;height:24px;position:relative;text-align:left;width:25px} -#svg_editor .jPicker .Icon span.Color,#svg_editor .jPicker .Icon span.Alpha{background-position:2px 2px;display:block;height:100%;left:0;position:absolute;top:0;width:100%} -#svg_editor .jPicker .Icon span.Image{background-repeat:no-repeat;cursor:pointer;display:block;height:100%;left:0;position:absolute;top:0;width:100%} -#svg_editor .jPicker.Container{z-index:10} -table#svg_editor .jPicker{width:545px;z-index:20} -#svg_editor .jPicker .Move{background-color:#ddd;border-color:#fff #666 #666 #fff;border-style:solid;border-width:1px;cursor:move;height:12px;padding:0} -#svg_editor .jPicker .Title{display:none} -#svg_editor .jPicker div.Map{border:solid #000 1px;cursor:crosshair;height:260px;margin:0;overflow:hidden;padding:0;position:relative;width:260px} -#svg_editor .jPicker div[class="Map"]{height:256px;width:256px} -#svg_editor .jPicker div.Bar{border:solid #000 1px;cursor:n-resize;height:260px;margin:0 15px;overflow:hidden;padding:0;position:relative;width:24px} -#svg_editor .jPicker div[class="Bar"]{height:256px;width:20px} -#svg_editor .jPicker .Map .Map1,#svg_editor .jPicker .Map .Map2,#svg_editor .jPicker .Map .Map3,#svg_editor .jPicker .Bar .Map1,#svg_editor .jPicker .Bar .Map2,#svg_editor .jPicker .Bar .Map3,#svg_editor .jPicker .Bar .Map4,#svg_editor .jPicker .Bar .Map5,#svg_editor .jPicker .Bar .Map6{background-color:transparent;background-image:none;display:block;left:0;position:absolute;top:0} -#svg_editor .jPicker .Map .Map1,#svg_editor .jPicker .Map .Map2,#svg_editor .jPicker .Map .Map3{height:2596px;width:256px} -#svg_editor .jPicker .Bar .Map1,#svg_editor .jPicker .Bar .Map2,#svg_editor .jPicker .Bar .Map3,#svg_editor .jPicker .Bar .Map4{height:3896px;width:20px} -#svg_editor .jPicker .Bar .Map5,#svg_editor .jPicker .Bar .Map6{height:256px;width:20px} -#svg_editor .jPicker .Map .Map1,#svg_editor .jPicker .Map .Map2,#svg_editor .jPicker .Bar .Map6{background-repeat:no-repeat} -#svg_editor .jPicker .Map .Map3,#svg_editor .jPicker .Bar .Map5{background-repeat:repeat} -#svg_editor .jPicker .Bar .Map1,#svg_editor .jPicker .Bar .Map2,#svg_editor .jPicker .Bar .Map3,#svg_editor .jPicker .Bar .Map4{background-repeat:repeat-x} -#svg_editor .jPicker .Map .Arrow{display:block;position:absolute} -#svg_editor .jPicker .Bar .Arrow{display:block;left:0;position:absolute} -#svg_editor .jPicker .Preview{font-size:9px;text-align:center} -#svg_editor .jPicker .Preview div.bgt{height:62px;margin:0 auto;padding:0;width:62px} -#svg_editor .jPicker .Preview div span{border:1px solid #000;display:block;height:30px;margin:0 auto;padding:0;width:60px} -#svg_editor .jPicker .Preview .Active{border-bottom-width:0} -#svg_editor .jPicker .Preview .Current{border-top-width:0;cursor:pointer} -#svg_editor .jPicker .Button{text-align:center;width:115px} -#svg_editor .jPicker .Button input{width:100px} -#svg_editor .jPicker td.Radio{margin:0;padding:0;width:31px} -#svg_editor .jPicker td.Radio input{margin:0 5px 0 0;padding:0} -#svg_editor .jPicker td.Text{font-size:12px!important;height:22px;margin:0;padding:0;text-align:left;width:70px} -#svg_editor .jPicker tr.Hex td.Text{width:100px;color:#666} -#svg_editor .jPicker tr.Hex td.Text span{width:100px;color:#333} -#svg_editor .jPicker td.Text input{background-color:#fff;border:1px inset #aaa;height:15px;margin:0 0 0 5px;text-align:left;width:30px;color:#333} -#svg_editor #color_picker .jPicker tr.Hex td.Text input.Hex{width:50px;display:inline-block;float:none} -#svg_editor .jPicker tr.Hex td.Text input.AHex{width:20px;display:none} -#svg_editor .jPicker .Grid{text-align:center;float:right;width:108px} -#svg_editor .jPicker .Grid span.QuickColor{cursor:pointer;display:inline-block;height:15px;line-height:15px;margin:0;padding:0;width:18px} -#svg_editor .jPicker td{vertical-align:top} -#svg_editor .jPicker td.colorsquare{width:275px} -#svg_editor .jPicker .prev_div{margin-top:-15px} -#svg_editor .jPicker .actions{position:absolute;bottom:20px;left:20px;right:20px} -#svg_editor .jPicker .actions .Ok{position:absolute;top:0;right:0} -#svg_editor .jPicker .actions .Cancel{position:absolute;top:0;left:0} -#svg_editor .jPicker .color_preview{width:62px;margin:0 auto} -h2.jGraduate_Title{display:none} -.jGraduate_Picker{position:absolute;padding:20px} -.jGraduate_tabs li{display:inline-block;padding:5px 10px;margin-right:5px;cursor:pointer} -li.jGraduate_tab_current{background:#fff;border-radius:3px 3px 0 0} -.jGraduate_colPick{display:none} -.jGraduate_gradPick{display:none;overflow:visible} -.jGraduate_tabs{position:relative;background-color:#ddd;padding:10px 10px 0 10px;margin:-20px -20px 20px -20px;border-radius:3px 3px 0 0} -div.jGraduate_Swatch{float:left;margin:0 15px 0 0} -div.jGraduate_GradContainer{border:solid #000 1px;background-image:url(../images/map-opacity.png);background-position:0 0;height:256px;width:256px;position:relative} -div.jGraduate_GradContainer div.grad_coord{background:rgba(0,0,0,0.8);border:2px solid white;border-radius:15px;-moz-border-radius:5px;width:14px;height:14px;position:absolute;margin:-7px -7px;top:0;left:0;text-align:center;font-size:8px;line-height:14px;color:white;text-decoration:none;cursor:pointer;-moz-user-select:none;-webkit-user-select:none} -.jGraduate_AlphaArrows{position:absolute;margin-top:-10px;margin-left:250.5px} -div.jGraduate_Opacity{border:2px inset #eee;margin-top:14px;background-color:black;background-image:url(../images/Maps.png);background-position:0 -2816px;height:20px;cursor:ew-resize} -div.jGraduate_StopSlider{margin:-10px 0 0 -10px;width:276px;overflow:visible;background:white;height:45px;cursor:pointer} -div.jGraduate_StopSection{width:120px;float:left} -div.jGraduate_StopSection.jGraduate_SpreadMethod{display:none} -input.jGraduate_Ok,input.jGraduate_Cancel{display:block;width:100px} -input.jGraduate_Ok{margin:0 0 5px 0} -.colorBox{float:left;height:16px;width:16px;border:1px solid #808080;cursor:pointer;margin:4px 4px 4px 30px} -.colorBox+label{float:left;margin-top:7px} -label.jGraduate_Form_Heading{color:#333;padding:2px;font-weight:bold;font-size:13px} -div.jGraduate_Form_Section{-moz-border-radius:5px;-webkit-border-radius:5px;padding:15px 5px 5px 5px;margin:5px 2px;width:100px;text-align:center;overflow:auto;background:#eee} -div.jGraduate_Form label{padding:0 2px;color:#333} -div.jGraduate_StopSection input[type=text],div.jGraduate_Slider input[type=text]{width:33px;color:#333} -div.jGraduate_LightBox{position:fixed;top:0;left:0;right:0;bottom:0;background-color:#000;opacity:.5;display:none} -div.jGraduate_stopPicker{position:absolute;display:none;background:white;padding:20px;border-radius:3px;width:530px;height:300px;box-shadow:0 5px 25px black} -.jGraduate_gradPick{width:526px} -.jGraduate_gradPick div.jGraduate_Slider{line-height:160%} -.jGraduate_gradPick div.jGraduate_Slider label:last-child{position:absolute;right:10px;top:0;color:#999;font-weight:bold} -.jGraduate_gradPick div.jGraduate_Slider label:last-child input{margin:0 3px 0 0;color:#333} -.jGraduate_gradPick .jGraduate_Form{float:left;width:270px;position:absolute;left:284px;width:266px;height:200px;top:195px;margin:-3px 3px 0 10px;line-height:200%} -.jGraduate_gradPick .jGraduate_Form label,.jGraduate_gradPick .jGraduate_Form input{width:auto;float:left} -.jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field label,.jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field input{width:auto;float:left;font-size:11px} -.jGraduate_gradPick .jGraduate_Form.jGraduate_rg_field #color_picker_jGraduate_match_ctr{float:none} -.jGraduate_gradPick .jGraduate_Form label{clear:left} -.jGraduate_gradPick .jGraduate_Points{position:static;float:left;margin:0;width:auto} -.jGraduate_Colorblocks{display:table;border-spacing:0 5px} -.jGraduate_colorblock{display:table-row} -.jGraduate_Colorblocks .jGraduate_colorblock>*{display:table-cell;vertical-align:middle;margin:0;float:none} -.jGraduate_gradPick .jGraduate_Form_Section{padding-top:9px} -.jGraduate_Slider{text-align:center;float:left;width:100%;position:relative;margin:5px 0} -.jGraduate_Slider .jGraduate_Form_Section{border:0;width:250px;padding:0 2px;overflow:visible} -.jGraduate_Slider label.prelabel{width:40px;text-align:left} -.jGraduate_SliderBar{width:140px;float:left;margin:0 5px;border:1px solid #BBB;height:20px;position:relative} -div.jGraduate_Slider input{margin-top:5px} -div.jGraduate_Slider img{top:0;left:0;position:absolute;cursor:ew-resize} -.jPicker .Button .Ok,.jGraduate_Picker .jGraduate_OkCancel .jGraduate_Ok{-webkit-appearance:none;margin:0;position:absolute;bottom:5px;right:5px} -.jPicker .Button .Cancel,.jGraduate_Picker .jGraduate_OkCancel .jGraduate_Cancel{margin:0;position:absolute;bottom:5px;left:5px} -body{background:#3f3f3c;font:13px/120% 'Lucida Sans','Lucida Grande','Lucida Sans Unicode',sans-serif;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:0;padding:0} -::selection{background:#000;color:#fff} -::-moz-selection{background:#000;color:#fff} -html,body{overflow:hidden;width:100%;height:100%} -::-webkit-scrollbar{width:5px;height:5px;background:#444} -::-webkit-scrollbar-track{border-radius:10px;background:#444} -::-webkit-scrollbar-thumb{border-radius:10px;background:#666} -::-webkit-scrollbar-corner{background:#444} -#browser-not-supported{font-size:.8em;font-family:Verdana,Helvetica,Arial;color:#000} -#svgroot{-moz-user-select:none;-webkit-user-select:none;position:absolute;top:0;left:0} -#svg_editor{background:#2f2f2c} -#menu_bar{padding:0 0 0 50px;background:#2f2f2c;position:relative;z-index:2} -#menu_bar.active .menu.open .menu_list{display:block} -.menu{position:relative;z-index:5;color:#333;display:inline-block} -.menu_title{cursor:pointer;display:inline-block;padding:7px 10px;z-index:10;color:#fff;position:relative;height:16px;vertical-align:top} -.touch .menu_title{padding:7px 17px;height:26px;line-height:26px} -.menu .menu_title:hover{background:rgba(255,255,255,0.1)} -.menu_list .separator{margin:5px 0;border-top:solid #ddd 1px} -.menu_list{display:none;position:absolute;top:28px;left:0;white-space:nowrap;background:white;padding:7px 0;border-radius:0 3px 3px 3px;box-shadow:0 0 20px rgba(0,0,0,0.8)} -.touch .menu_list{top:38px} -#menu_bar.active .menu.open .menu_title{background:white;color:#333} -.menu_list .menu_item{position:relative;overflow:hidden;line-height:22px;padding:5px 69px 5px 25px;cursor:default;color:#333} -.menu_list .menu_item.tool_button{background:transparent;border:0;margin:0;padding:5px 55px 5px 25px;height:auto;width:auto} -.menu_list .menu_item.push_button_pressed:before{content:'✔';position:absolute;display:block;left:7px;top:3px;width:20px;height:20px} -.menu_list .menu_item:hover,.menu_list .menu_item.push_button_pressed:hover{background:rgba(0,0,0,0.1);color:#000} -.menu_list .menu_item.disabled:hover,.menu_list .menu_item.push_button_pressed.disabled:hover{background:transparent;color:#333} -.menu_list .menu_item.push_button_pressed{background:transparent;border:0;width:auto;height:auto;margin:0} -.menu_list .menu_item span{display:block;position:absolute;right:10px;padding:5px;background:rgba(0,0,0,0.1);top:6px;height:10px;text-align:center;font-size:10px;line-height:120%} -#svgcanvas{line-height:normal;display:inline-block;background-color:#a0a0a0;text-align:center;vertical-align:middle;width:640px;height:480px;position:relative;background:#3f3f3c} -#rulers>div{position:absolute;background:#2f2f2c;z-index:1;overflow:hidden;-webkit-font-smoothing:none} -#rulers #ruler_corner{top:30px;left:50px;width:15px;height:15px;border:solid #444 1px;z-index:2} -#ruler_x{height:15px;top:30px;left:66px;right:175px;border-top:solid #444 1px;border-right:solid #444 1px} -#ruler_x_cursor{height:15px;border-right:dotted #999 1px;position:absolute;background:#2f2f2c} -#ruler_y_cursor{width:15px;border-top:dotted #999 1px;position:absolute;background:#2f2f2c} -#rulers.moved #ruler_corner,#rulers.moved #ruler_x{top:101px} -#ruler_y{width:15px;top:46px;left:50px;bottom:40px;border-left:solid #444 1px;border-bottom:solid #444 1px} -#rulers.moved #ruler_y{top:116px} -#ruler_x canvas:first-child{margin-left:-16px} -#ruler_x canvas{float:left} -#ruler_y canvas{margin-top:-16px} -#ruler_x>div,#ruler_y>div{overflow:hidden} -#palette{display:block;position:absolute;/*z-index:2*/;left:10px;bottom:5px;width:410px;right:145px;height:30px} -.palette_item{height:20%;width:5.2%;float:left;cursor:url(../images/eyedropper.png) 0 16,crosshair} -.palette_item.transparent,.palette_item.white,.palette_item.black{background:#fff;position:absolute;width:10px;height:10px;left:-10px;top:0} -.palette_item.transparent{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAVdEVYdENyZWF0aW9uIFRpbWUAOC8yMi8xMg1cp6sAAABESURBVBiVjdBBCgAgCETRr/e/87SJKFPLnfIcQRMIwMBIShIAvgZzoSrfkzrs8WyF1+kX9r3p8AE7nL7kSpSshN+JEQ8GixkF0mSevgAAAABJRU5ErkJggg==)} -.palette_item.black{background:#000;top:10px} -.palette_item.white{background:#fff;top:20px} -#color_tools{position:relative;width:48px;height:48px;margin:6px 6px 0 6px} -.touch #color_tools{width:auto;height:auto} -#tool_fill{position:absolute;top:0;left:0;z-index:1} -.touch #tool_fill{position:static;width:36px;height:36px;margin-bottom:10px} -#tool_fill.active,#tool_stroke.active{z-index:2} -#tool_stroke{top:14px;left:14px} -.touch #tool_fill.active,.touch #tool_stroke.active{outline:4px solid #09f} -#tool_fill,#tool_stroke,#tool_canvas{box-shadow:0 0 0 1px #2f2f2c;position:absolute} -.touch #tool_fill,.touch #tool_stroke,.touch #tool_canvas{position:relative;top:0;left:0} -#color_canvas_tools{float:left;cursor:pointer} -#tool_fill .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px} -.touch #tool_eyedropper{margin-top:6px} -.touch #tool_fill .color_block{width:36px;height:36px} -.touch #tool_fill .color_block svg{width:36px!important;height:36px!important} -.touch #tool_switch{display:none} -#use_panel .tool_button,#path_node_panel .tool_button{color:#999;border:solid #3f3f3c 1px;border-radius:3px;padding:3px 10px 3px 40px;background:transparent;position:relative;margin-top:10px;width:90px;height:23px;line-height:24px} -#use_panel .tool_button{padding-left:10px;margin-bottom:10px;width:124px} -#path_node_panel .tool_button img,#path_node_panel .tool_button svg{position:absolute;left:5px;top:3px} -#color_tools #tool_fill .color_block:hover,#color_tools #tool_stroke .color_block:hover{border-color:#fff} -#color_tools #tool_fill .color_block>div{position:absolute;top:0;left:0} -.touch #color_tools #tool_fill .color_block>div{position:relative} -#color_tools #tool_fill .color_block #fill_bg,#color_tools #tool_stroke .color_block #stroke_bg{position:absolute;top:1px;left:1px;bottom:1px;right:1px} -.touch #color_tools #tool_fill .color_block #fill_bg,.touch #color_tools #tool_stroke .color_block #stroke_bg{width:36px;height:36px;right:auto;bottom:auto} -.touch #tool_stroke{position:relative;top:0;left:0;z-index:0} -#stroke_color:after{content:'';position:absolute;display:block;width:8px;height:8px;left:8px;top:8px;background:#ccc;box-shadow:0 0 0 1px #000} -.touch #stroke_color:after{height:14px;left:10px;position:absolute;top:10px;width:14px} -#color_tools #tool_switch{cursor:pointer;opacity:.7;width:11px;height:11px;background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA2LzE0LzEyP6j5+gAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAB4SURBVBiVjZHRCYUwDEVvxIF0kZKN7EjiIrrReR/PSNSKXiikcE5JUtMeADMzXQIcdRfgFWqlyyB7ap1wL+0HAnIv1DqRJUBxTkLUWXIvh9AHkIeb58UkIUnDMH4ZR0otCfhv4ynbtp7ut722ZniFG8L9xx4Ek6QfN9huARmYwR0AAAAASUVORK5CYII=) top left no-repeat;position:absolute;top:-2px;left:28px} -#color_tools #cross:hover{opacity:1} -#color_tools #tool_stroke:hover #stroke_color:after{background:#fff} -#color_tools #tool_stroke .color_block{width:24px;height:24px;overflow:hidden;border:solid #ccc 1px} -.touch #color_tools #tool_stroke .color_block{width:36px;height:36px} -#color_tools #tool_stroke .color_block>div{position:absolute;bottom:0;right:0} -.touch #color_tools #tool_stroke .color_block>div{position:relative} -#color_tools .icon_label{padding:0;width:24px;height:100%;cursor:pointer;position:absolute} -#linkLabel>svg{height:20px;padding-top:4px} -div#workarea{display:inline-table-cell;position:absolute;top:30px;left:50px;bottom:40px;right:175px;background-color:#444;overflow:auto;text-align:center;-webkit-transition:-webkit-transform 500ms cubic-bezier(0.13,0.66,0.24,0.92);-moz-transition:-moz-transform 500ms cubic-bezier(0.13,0.66,0.24,0.92);-o-transition:-o-transform 500ms cubic-bezier(0.13,0.66,0.24,0.92);-ms-transition:-ms-transform 500ms cubic-bezier(0.13,0.66,0.24,0.92);transition:transform 500ms cubic-bezier(0.13,0.66,0.24,0.92)} -.touch div#workarea{top:40px} -.menu .menu_list{display:none;position:absolute} -.tool_button,.tool_button_current,.tool_button_pressed{cursor:pointer} -.tool_button:hover,.push_button:hover,.buttonup:hover,.buttondown,.tool_button_current,.push_button_pressed{background-color:#fff} -.tool_button.disabled,.tool_button.disabled:hover{opacity:.3;background-color:#aaa} -#tools_left .tool_button{background:#2f2f2c;position:relative} -#tools_left .tool_button.loaded{background:#ccc} -#tools_left .tool_button.loaded:hover{background:#fff} -#tools_left .tool_button:after,#tools_left .tool_button_current:after{position:absolute;content:'';border:solid #2f2f2c 2px;top:-1px;left:-1px;width:26px;height:26px;z-index:0} -#tools_left .tool_button_current{background-color:#0cf} -#main_icon span{position:absolute;width:100%;height:100%;display:block;z-index:2} -#tools_top{position:absolute;width:160px;height:100%;background:#2f2f2c;right:0;top:20px;border-bottom:0;overflow:visible;padding:0 0 0 15px} -.touch #tools_top{top:30px} -label{display:block;color:#999} -div#font-selector{width:140px;height:300px;overflow:auto;margin:0 auto;position:absolute;top:27px;right:0;border:1px solid black;padding:10px;display:none;background-color:white;z-index:10;border-radius:3px;box-shadow:0 5px 10px rgba(0,0,0,0.7)} -div#font-selector img{width:100%} -div#font-selector .font-item{border-bottom:solid #ddd 1px;padding:5px 10px;margin:0 -10px} -div#font-selector .font-item:hover{background-color:#eee} -#tools_top #marker_panel *{float:left} -#tools_top #marker_panel h4{float:none} -#tools_top #marker_panel .dropdown .icon_label{width:36px;height:20px;margin-top:2px;border:solid #3f3f3c 1px;text-align:center} -#tools_top #marker_panel .dropdown button{margin-top:2px} -#tools_top #marker_panel #marker_panel_title{float:none;color:#fff;margin-bottom:3px} -#tools_top #marker_panel .dropdown .icon_label img{float:none} -#color_picker input[type=text],#color_picker input[type=number]{width:30px;background:#fff} -.dropdown_set input[type=text],.dropdown_set input[type=number]{width:50px} -input[type=text].wide,input[type=number].wide{width:110px} -input[type=text].tuco,input[type=number].tuco{width:150px} -input[type=submit],input[type=button],button{background:#4f80ff;color:#fff;border-radius:3px;padding:7px 17px;border:0;line-height:140%;font-size:14px;font-weight:bold;font-family:sans-serif} -input[type=submit]:hover,button:hover{box-shadow:inset 0 3px 10px rgba(255,255,255,0.1),inset 0 -3px 10px rgba(0,0,0,0.2)} -input[type=submit]:hover,button:hover{background:#2f84c1} -input[type=submit]:active,button:active{box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);border-bottom:solid rgba(255,255,255,0.1) 1px} -#tools_left{position:absolute;border-right:0;width:50px;top:30px;bottom:0;left:0;background:#2f2f2c;z-index:4} -#workarea.wireframe #svgcontent *{fill:none;stroke:#000;stroke-width:1px;stroke-opacity:1.0;stroke-dasharray:0;opacity:1;pointer-events:stroke;vector-effect:non-scaling-stroke;filter:none} -#workarea.wireframe #svgcontent text{fill:#000;stroke:none} -#workarea.wireframe #canvasBackground>rect{fill:#FFF!important} -#workarea #canvasBackground>rect{stroke:transparent!important} -.context_panel{display:none} -#canvas_panel{display:block} -#multiselected_panel .selected_tool{vertical-align:12px} -#cur_context_panel{position:absolute;top:47px;left:68px;line-height:22px;overflow:auto;border-bottom:0;border-right:0;padding-left:5px;font-size:12px;background:black;color:#999;opacity:.5;padding:0 10px;border-radius:0 10px 10px 0} -#cur_context_panel a{float:none;text-decoration:none;color:#fff} -#cur_context_panel a:hover{text-decoration:underline} -#tools_left .tool_button,#tools_left .tool_button_current{position:relative;z-index:11} -.flyout_arrow_horiz{position:absolute;bottom:-1px;right:0;z-index:10} -.dropdown{position:relative;float:left} -.dropdown button{width:21px;height:22px;padding:0 3px 0 3px;border:0;background-color:#555;border-radius:0 2px 2px 0;margin-left:-1px;position:relative} -.dropdown button:hover{background-color:#666} -.dropdown button:after{content:'';position:absolute;border:solid transparent 4px;border-top-color:#999;top:9px;left:6px} -.dropdown button.down{border-left:1px solid #808080;border-top:1px solid #808080;border-right:1px solid #fff;border-bottom:1px solid #fff;background-color:#b0b0b0} -.dropdown ul{list-style:none;position:absolute;margin:0;padding:0;left:-80px;top:26px;z-index:4;display:none} -.dropup ul{top:auto;bottom:26px;border-radius:3px;box-shadow:0 5px 10px #000} -.dropup ul:after{content:'';display:block;position:absolute;bottom:-10px;right:50%;top:auto;width:0;height:0;border:solid transparent 5px;border-top-color:#fff} -.dropdown li{display:block;width:120px;padding:5px 10px;color:#333;background:#fff;margin:0;line-height:16px} -.dropdown li:first-child{border-radius:3px 3px 0 0} -.dropdown li:last-child{border-radius:0 0 3px 3px} -.dropdown li:hover{background-color:#ddd;color:#000} -.dropdown li.special{padding:10px;background:white;border:0;box-shadow:0 3px 10px black;border-radius:3px!important} -.dropdown li.special:after{content:'';display:block;position:absolute;top:-10px;right:50%;border:solid transparent 5px;border-bottom-color:#fff} -.dropdown li.special.down:after{bottom:-10px;right:50%;top:auto;border:solid transparent 5px;border-top-color:#fff} -.tool_button,.push_button,.tool_button_current,.push_button_pressed{height:27px;width:27px;border:solid #2f2f2c 8px;border-left-width:13px;margin:0;background-color:#ddd;cursor:pointer} -#main_menu li#tool_open,#main_menu li#tool_import{position:relative;overflow:hidden} -#tool_image{overflow:hidden} -#tool_open input,#tool_import input,#tool_import_bitmap input{position:absolute;opacity:0;font-size:10em;top:-5px;right:-5px;margin:0;cursor:pointer} -.disabled{opacity:.5;cursor:default} -.width_label{padding-right:5px} -#text{position:absolute;left:-9999px} -#tool_bold span,#tool_italic span{position:absolute;width:100%;height:100%;top:0;left:0;background:#ccc;opacity:0} -#url_notice{padding-top:4px;display:none} -#color_picker{position:absolute;display:none;background:#fff;height:350px;border-radius:3px;z-index:5;box-shadow:0 5px 10px #000;width:530px} -.tools_flyout{position:absolute;display:none;cursor:pointer;width:385px;z-index:10;left:47px!important;height:324px;background:#fff;border-radius:5px;box-shadow:0 5px 10px rgba(0,0,0,0.5)} -.tools_flyout_v{position:absolute;display:none;cursor:pointer;width:30px} -.tools_flyout .tool_button{float:left;background-color:#fff;height:24px;width:24px} -#tools_bottom{position:absolute;left:50px;right:0;bottom:0;height:40px;overflow:visible;background:#2f2f2c} -#tools_bottom_1{width:115px;float:left} -#tools_bottom_2{position:relative;float:left;margin-top:5px} -#tools_bottom input[type=text]{width:3.2em} -#tools_top h4{color:#fff;font-weight:normal;margin:0;padding:10px 0 5px 0} -#tools_top .dropdown .icon_label{border:1px solid transparent;height:auto} -#tools_top.multiselected #align_tools{display:none} -#tools_top.multiselected #multiselected_panel{display:block!important} -#tools_top.multiselected #multiselected_panel .hidable{display:none} -.draginput_cell{float:left;height:26px;height:26px;border:solid #3f3f3c 10px;outline:solid #2f2f2c 1px;background:#ddd;cursor:pointer;position:relative} -.draginput_cell:hover{background:#fff} -.draginput_cell:after{content:'';position:absolute;top:0;left:0;border:solid #3f3f3c 1px;height:26px;width:26px;z-index:0} -.align_buttons .draginput_cell:nth-child(1){border-radius:3px 0 0 0} -.align_buttons .draginput_cell:nth-child(3){border-radius:0 3px 0 0} -.align_buttons .draginput_cell:nth-child(4){border-radius:0 0 0 3px} -.align_buttons .draginput_cell:nth-child(6){border-radius:0 0 3px 0} -.align_buttons .push_button{display:block;float:left} -#option_lists ul{display:none;position:absolute;height:auto;z-index:3;margin:0;list-style:none;padding-left:0} -#option_lists .optcols2{width:70px;margin-left:-15px} -#option_lists .optcols3{width:192px;margin-left:-105px;margin-top:-25px;background:#fff;padding:5px;box-shadow:0 5px 10px #000;border-radius:3px} -#option_lists .optcols3:after{content:'';display:block;position:absolute;top:-10px;right:70px;border:solid transparent 5px;border-bottom-color:#fff} -#option_lists .tool_button,#option_lists .push_button,#option_lists .tool_button_current,#option_lists .push_button_pressed{border:0;background:transparent} -#option_lists .tool_button:hover{background:#ddd} -#option_lists ul li.current{background-color:#f4e284} -#option_lists .optcols4{width:130px;margin-left:-44px} -#option_lists ul[class^=optcols] li{float:left} -ul li.current{background-color:#f4e284} -#option_lists ul li{margin:0;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0} -#copyright{text-align:right;padding-right:.3em} -#svg_source_editor{display:none} -#svg_source_editor #svg_source_overlay{position:absolute;top:0;right:0;left:0;bottom:0;background-color:black;opacity:.6;z-index:5} -#svg_source_editor #svg_source_container{position:absolute;top:30px;left:100px;right:100px;bottom:30px;background-color:#fff;border-radius:3px;opacity:1.0;text-align:center;z-index:6;padding:15px 0} -#svg_source_editor form{position:absolute;display:block;top:15px;bottom:55px;left:15px;right:12px;padding:5px;font-size:12px} -#svg_source_textarea{width:100%;height:100%;line-height:140%;font-family:'Lucida Sans','Lucida Grande','Lucida Sans Unicode',sans-serif;font-size:12px} -#svg_source_editor #tool_source_back{position:absolute;bottom:45px;left:15px;right:15px} -#svg_source_editor #tool_source_back #tool_source_save{display:block;position:absolute;right:0} -#svg_source_editor #tool_source_back #tool_source_cancel{display:block;position:absolute;left:0} -button.cancel,input.Cancel,input.cancel,input.jGraduate_Cancel,button.cancel{-webkit-appearance:none;background-color:#999;box-shadow:0 0 1px rgba(0,0,0,0.5);margin:0} -#shape_buttons{overflow:auto;top:0;bottom:0;left:110px;right:0;position:absolute;vertical-align:top} -#shape_cats{min-width:110px;display:block;position:absolute;left:0;top:0;height:300px;background:#eee;border-radius:3px 0 0 3px;z-index:2} -#shape_cats>div{line-height:1em;padding:0 .5em;border-bottom:1px solid #ddd;background:#e8e8e8;color:#444;height:26px;line-height:26px} -#shape_cats>div:first-child{border-radius:3px 0 0 0} -#shape_cats>div:last-child{border-radius:0 0 0 3px} -#shape_cats div:hover{background:#efefef;color:#000} -#shape_cats div.current{font-weight:bold;background:#3f3f3c;color:#fff;position:relative} -#shape_cats div.current:after{content:'';position:absolute;right:-26px;top:0;border:solid transparent 13px;border-left-color:#3f3f3c} -.toolbar_button button .svg_icon{display:none} -#dialog_box{display:none} -#dialog_box_overlay{background:black;opacity:.5;height:100%;left:0;position:absolute;top:0;width:100%;z-index:6} -#dialog_content{height:95px;margin:10px 10px 5px 10px;overflow:auto;text-align:left;font-size:13px} -#dialog_buttons input:last-child{background:#999!important;position:absolute;left:10px;bottom:10px} -#dialog_buttons input:first-child{position:absolute;right:10px;bottom:10px} -#dialog_content.prompt{height:75px} -#dialog_content p{margin:10px;line-height:1.3em} -#dialog_container{position:absolute;left:50%;top:50%;width:300px;margin-left:-150px;height:150px;margin-top:-80px;position:fixed;z-index:50001;background:#fff} -#dialog_container,#dialog_content{border-radius:3px} -#dialog_buttons input[type=text]{width:90%;display:block;margin:0 0 5px 11px} -#dialog_buttons input[type=button]{margin:0 1em} -.invisible{visibility:none} -.ui-slider{position:relative;text-align:left} -.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default} -.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0} -.ui-slider-horizontal{height:.8em} -.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em} -.ui-slider-horizontal .ui-slider-range{top:0;height:100%} -.ui-slider-horizontal .ui-slider-range-min{left:0} -.ui-slider-horizontal .ui-slider-range-max{right:0} -.ui-slider-vertical{width:.8em;height:100px} -.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em} -.ui-slider-vertical .ui-slider-range{left:0;width:100%} -.ui-slider-vertical .ui-slider-range-min{bottom:0} -.ui-slider-vertical .ui-slider-range-max{top:0} -.ui-slider{background:#3f3f3c;border-radius:10px} -.ui-slider-handle{box-shadow:0 3px 3px rgba(0,0,0,0.3);border-radius:30px;background:#fff;background-image:-ms-linear-gradient(top,#ccc 0,#fff 100%);background-image:-moz-linear-gradient(top,#ccc 0,#fff 100%);background-image:-o-linear-gradient(top,#ccc 0,#fff 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#ccc),color-stop(1,#fff));background-image:-webkit-linear-gradient(top,#ccc 0,#fff 100%);background-image:linear-gradient(top,#ccc 0,#fff 100%)} -.ui-slider-handle:focus{outline:0} -#shape_buttons{background:#fff;border-radius:0 3px 3px 0;padding:10px} -.tools_flyout .tool_button,.tools_flyout .tool_flyout{background:#fff;width:40px;height:40px;margin:5px;border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-width:0} -.contextMenu{position:absolute;z-index:99999;border:solid 1px rgba(0,0,0,.33);background:rgba(255,255,255,.95);padding:5px 0;margin:0;display:none;font:12px/15px 'Lucida Sans','Lucida Grande',Helvetica,Verdana,sans-serif;border-radius:5px;-moz-border-radius:5px;-moz-box-shadow:2px 5px 10px rgba(0,0,0,.3);-webkit-box-shadow:2px 5px 10px rgba(0,0,0,.3);box-shadow:2px 5px 10px rgba(0,0,0,.3)} -.touch .contextMenu{border:solid 5px rgba(0,0,0,.7);padding:0;margin:0 0 0 20px;font:18px/24px sans-serif;border-radius:5px;-webkit-box-shadow:2px 5px 20px 3px #000;box-shadow:2px 5px 20px rgba(0,0,0,0.5)} -.touch .contextMenu:after{content:'';width:0;height:0;border:solid transparent 10px;border-right-color:rgba(0,0,0,.7);position:absolute;top:50%;left:-25px;margin-top:-10px;z-index:1000} -.contextMenu LI{list-style:none;padding:0;margin:0} -.contextMenu .shortcut{width:115px;text-align:right;float:right} -.touch .contextMenu .shortcut{display:none} -.touch .shortcut{display:none} -.contextMenu A{-moz-user-select:none;-webkit-user-select:none;color:#222;text-decoration:none;display:block;line-height:20px;height:20px;background-position:6px center;background-repeat:no-repeat;outline:0;padding:0 15px 1px 20px} -.touch .contextMenu A{padding:0 15px;border-bottom:#;font-weight:bold;border-top:solid 1px #e3e3e3;height:40px;line-height:40px;min-width:200px} -.contextMenu LI.hover A{background-color:#2e5dea;color:white;cursor:default} -.contextMenu LI.disabled A{color:#999} -.touch .contextMenu LI.disabled A{display:none} -.contextMenu LI.hover.disabled A{background-color:transparent} -.contextMenu LI.separator{border-top:solid 1px #e3e3e3;padding-top:5px;margin-top:5px} -.touch .contextMenu LI.separator{border-top:0;margin:0;padding:0} -#menu{display:none;position:absolute;top:0;left:0;right:0;height:30px;background:#000;z-index:10;color:#fff} -#workarea.rect,#workarea.line,#workarea.ellipse,#workarea.path,#workarea.shapelib{cursor:crosshair} -#workarea.text{cursor:text} -#workarea.eyedropper{cursor:url(../images/eyedropper.png) 0 16,crosshair} -#workarea.fhpath{cursor:url(../images/pencil_cursor.png) 0 16,crosshair} -#workarea.rotate *{cursor:url(../images/rotate.png) 12 12,auto} -#workarea.select text,#workarea.multiselect text{cursor:default} -#workarea.n-resize *{cursor:n-resize!important} -#workarea.e-resize *{cursor:e-resize!important} -#workarea.w-resize *{cursor:w-resize!important} -#workarea.s-resize *{cursor:s-resize!important} -#workarea.ne-resize *{cursor:ne-resize!important} -#workarea.se-resize *{cursor:se-resize!important} -#workarea.nw-resize *{cursor:nw-resize!important} -#workarea.sw-resize *{cursor:sw-resize!important} -#workarea.copy{cursor:copy} -#workarea.zoom{cursor:crosshair;cursor:-moz-zoom-in;cursor:-webkit-zoom-in} -#workarea.zoom.out{cursor:crosshair;cursor:-moz-zoom-out;cursor:-webkit-zoom-out} -#selectorRubberBand{shape-rendering:crispEdges} -.clearfix:before,.clearfix:after{content:"";display:table} -.clearfix:after{clear:both} -.clearfix{*zoom:1} -#group_title{display:none} -#base_unit_container{display:none;position:absolute;z-index:20} -.draginput{background:#3f3f3c;border-radius:3px;-webkit-font-smoothing:antialiased;width:70px;height:70px;display:block;position:relative;float:left;margin:0 5px 5px 0} -.draginput .caret{border:solid transparent 5px;border-top-color:#999;position:absolute;width:0;height:0;right:5px;margin-top:-2px;top:50%} -.draginput label{margin:28px 10px 0 5px;font-size:14px;color:white;font-weight:bold;font-family:sans-serif} -.draginput label#resolution_label,.draginput label#seg_type_label{font:bold 12px/110% sans-serif;position:absolute;left:auto;right:10px;z-index:0;text-align:right} -.draginput label#seg_type_label{margin-top:40px} -.draginput label#seg_type_label .caret{top:66%} -.draginput label#resolution_label .pull{position:relative;left:-15px} -.draginput label#resolution_label span{right:-13px;left:auto;font-size:16px;top:2px;font-weight:bold;color:white} -.touch .draginput.active:after{content:attr(data-value);display:block;position:absolute;background:#fff;font-size:16px;top:0;width:30px;left:-50px;padding:0 5px;color:#333;z-index:10;font-family:sans-serif;font-weight:bold;text-align:right;padding-right:10px;height:20px;line-height:20px;letter-spacing:-1px} -.touch .draginput.active:before{content:'';height:0;width:0;position:absolute;top:5px;left:-5px;border:solid transparent 5px;border-left-color:#fff} -.draginput input{border:0;background:transparent;font:24px/normal sans-serif;text-align:center;color:#4f80ff;padding:30px 0 16px;width:100%;height:24px;position:relative;z-index:2} -.draginput.twocol{width:145px} -#tool_font_family .caret{right:40px;top:55%} -#tool_font_family select{width:110px} -#tool_bold,#tool_italic{font:bold 20px/35px serif;text-align:center;position:absolute;padding:0;color:#ccc;background:transparent;border:0;width:35px;height:35px;margin:0;top:0;right:0} -#tool_italic{border-top:solid #2f2f2c 2px;top:35px;font-weight:bold;font-style:italic;font-size:24px} -#tool_bold:hover,#tool_italic:hover{color:#fff} -#tool_bold.active,#tool_italic.active{color:#50a0ff} -#preview_font{font-size:20px;color:#fff;height:70px;line-height:75px;padding:0 0 0 10px;white-space:nowrap;width:100px;overflow:hidden;border-right:solid #2f2f2c 2px;position:relative} -#preview_font:after{content:'';position:absolute;right:0;top:3px;bottom:3px;width:15px;border-right:solid #3f3f3c 10px;background:transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZzU4MCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjAlIj48c3RvcCBzdG9wLWNvbG9yPSIjM2YzZjNjIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiMzZjNmM2MiIG9mZnNldD0iMC43Ii8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2c1ODApIiAvPjwvc3ZnPg==)} -.draginput input,.draginput input:hover,.draginput input:active{cursor:url(../images/drag.png),move;cursor:-webkit-grab;cursor:-moz-grab;z-index:0;} -.draginput input[type="checkbox"],.draginput input[type="checkbox"]:hover,.draginput input[type="checkbox"]:active{cursor:pointer} -.draginput.checkbox{cursor:pointer} -.draginput.active input,.draginput.active input:hover,.draginput.active input:active{cursor:url(../images/dragging.png),move;cursor:-webkit-grabbing;cursor:-moz-grabbing} -.draginput span{font:11px/130% sans-serif;color:#ccc;display:block;position:absolute;top:5px;left:5px;text-align:left} -.draginput.error{background:#900} -.draginput.error input{color:#fff} -.draginput.stroke_tool{text-align:center} -.draginput select{-webkit-appearance:none;opacity:0;display:block;position:absolute;height:100%;width:100%;margin:0;z-index:1;top:0;left:0} -.draginput_cursor{position:absolute;top:50%;width:100%;border-top:solid rgba(50,100,200,0.25) 3px;margin-top:-2px;z-index:0} -.draginput input[readonly=readonly]{-webkit-appearance:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} -.draginput input:focus{background:#50a0ff;color:#fff;outline:0;box-shadow:0 0 5px 2px #50a0ff} -.draginput input:focus+span{z-index:10;color:#fff} -.draginput .push_bottom{bottom:0;position:absolute} -#zoom_label{height:20px;background:transparent;cursor:default!important;width:auto;padding:0 10px;margin:0} -#zoom_panel{padding:9px 0;right:175px;position:absolute} -#zoom_label img,#zoom_label svg{width:16px;height:16px} -#logo svg{pointer-events:none} -#zoomLabel{width:16px;height:16px;cursor:pointer;background:#ccc} -#zoomLabel:after{content:'';position:absolute;border-left:solid #2f2f2c 1px;left:0;height:16px} -#zoom_label input{color:#ccc;font-size:13px;height:auto;width:auto;padding:0;cursor:default;position:static} -#zoom_label span{top:0;left:0} -body.dragging *{cursor:url(../images/dragging.png),move;cursor:-webkit-grabbing;cursor:-moz-grabbing} -body.drag *{cursor:url(../images/dragging.png),move;cursor:-webkit-grabbing;cursor:-moz-grabbing} -input[readonly=readonly]:focus{box-shadow:none} -#color_canvas_tools,#fill_bg,#stroke_bg{background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAAA3NCSVQICAjb4U/gAAAABlBMVEXu7u7///8o06qaAAAACXBIWXMAAAsSAAALEgHS3X78AAAAFXRFWHRDcmVhdGlvbiBUaW1lADcvMjIvMTL7FNdCAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M1cbXjNgAAABFJREFUCJljYP7AgIb+MKAhAM8/C5vWL6zSAAAAAElFTkSuQmCC) top left repeat} -#color_canvas_tools{width:60px;height:40px;margin:23px 5px 5px 5px;position:relative;overflow:hidden} -#color_canvas_tools{display:block} -#tool_angle_indicator{width:50px;height:50px;border-radius:50px;background:rgba(255,255,255,0.05);position:absolute;bottom:2px;left:10px} -#tool_angle_indicator_cursor{width:4px;height:25px;border-top:solid #50a0ff 3px;position:absolute;margin:0 0 0 23px;-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-o-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0} -#stroke_style_label{font-size:30px;margin-top:33px;letter-spacing:-1px} -.stroke_tool .caret{top:60%} -#tool_align_relative{position:absolute;top:-5px;left:0;right:20px;display:block} -#tool_align_relative select{width:100%;display:block} \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/css/method-draw.css b/views/vibeOS/appfiles/nsvg/components/method-draw/css/method-draw.css deleted file mode 100644 index 6eb6e83e..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/css/method-draw.css +++ /dev/null @@ -1,2083 +0,0 @@ -/* Comment to prevent wrong concat */ - -body { - background: #3f3f3c; - font: 13px/120% 'Lucida Sans', 'Lucida Grande', 'Lucida Sans Unicode', sans-serif; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - margin: 0; - padding: 0; -} - -::selection {background: #000; color: #fff; /* Safari */} -::-moz-selection {background: #000; color: #fff; /* Firefox */} - -html, body { - overflow: hidden; - width: 100%; - height: 100%; -} - -::-webkit-scrollbar { - width: 5px; - height: 5px; - background: #444; -} - -::-webkit-scrollbar-track { - border-radius: 10px; - background: #444; -} - -::-webkit-scrollbar-thumb { - border-radius: 10px; - background: #666; -} - -::-webkit-scrollbar-corner { - background: #444; -} - -#browser-not-supported { - font-size: 0.8em; - font-family: Verdana, Helvetica, Arial; - color: #000000; -} - - #svgroot { - -moz-user-select: none; - -webkit-user-select: none; - position: absolute; - top: 0; - left: 0; -} - -#svg_editor { - background: #2f2f2c; -} - - #menu_bar { - padding: 0 0 0 50px; - background: #2f2f2c; - position: relative; - z-index: 2; -} - - #menu_bar.active .menu.open .menu_list { - display: block; -} - - .menu { - position: relative; - z-index: 5; - color: #333; - display: inline-block; -} - - .menu_title { - cursor: pointer; - display: inline-block; - padding: 7px 10px; - z-index: 10; - color: #fff; - position: relative; - height: 16px; - vertical-align: top; -} - -.touch .menu_title { - padding: 7px 17px; - height: 26px; - line-height: 26px; -} - - .menu .menu_title:hover { - background: rgba(255,255,255,0.1); -} - - .menu_list .separator { - margin: 5px 0; - border-top: solid #ddd 1px; -} - - .menu_list { - display: none; - position: absolute; - top: 28px; - left: 0; - white-space: nowrap; - background: white; - padding: 7px 0; - border-radius: 0 3px 3px 3px; - box-shadow: 0 0 20px rgba(0,0,0,0.8); -} - -.touch .menu_list { - top: 38px; -} - - #menu_bar.active .menu.open .menu_title { - background: white; - color: #333; -} - - .menu_list .menu_item { - position: relative; - overflow: hidden; - line-height: 22px; - padding: 5px 69px 5px 25px; - cursor: default; - color: #333; -} - - .menu_list .menu_item.tool_button { - background: transparent; - border: none; - margin: 0; - padding: 5px 55px 5px 25px; - height: auto; - width: auto; -} - - .menu_list .menu_item.push_button_pressed:before { - content: '✔'; - position: absolute; - display: block; - left: 7px; - top: 3px; - width: 20px; - height: 20px; -} - - .menu_list .menu_item:hover, - .menu_list .menu_item.push_button_pressed:hover { - background: rgba(0,0,0,0.1); - color: #000; -} - - .menu_list .menu_item.disabled:hover, - .menu_list .menu_item.push_button_pressed.disabled:hover { - background: transparent; - color: #333; -} - - .menu_list .menu_item.push_button_pressed { - background: transparent; - border: none; - width: auto; - height: auto; - margin: 0; -} - - .menu_list .menu_item span { - display: block; - position: absolute; - right: 10px; - padding: 5px; - background: rgba(0,0,0, 0.1); - top: 6px; - height: 10px; - text-align: center; - font-size: 10px; - line-height: 120%; -} - - #svgcanvas { - line-height: normal; - display: inline-block; - background-color: #A0A0A0; - text-align: center; - vertical-align: middle; - width: 640px; - height: 480px; - position: relative; - background: #3F3F3C; -} - -#rulers > div { - position: absolute; - background: #2f2f2c; - z-index: 1; - overflow: hidden; - -webkit-font-smoothing: none; -} - -#rulers #ruler_corner { - top: 30px; - left: 50px; - width: 15px; - height: 15px; - border: solid #444 1px; - z-index: 2; -} - -#ruler_x { - height: 15px; - top: 30px; - left: 66px; - right: 175px; - border-top: solid #444 1px; - border-right: solid #444 1px; -} - -#ruler_x_cursor { - height: 15px; - border-right: dotted #999 1px; - position: absolute; - background: #2f2f2c; -} - -#ruler_y_cursor { - width: 15px; - border-top: dotted #999 1px; - position: absolute; - background: #2f2f2c; -} - -#rulers.moved #ruler_corner, -#rulers.moved #ruler_x { - top: 101px; -} - -#ruler_y { - width: 15px; - top: 46px; - left: 50px; - bottom: 40px; - border-left: solid #444 1px; - border-bottom: solid #444 1px; -} - -#rulers.moved #ruler_y { - top: 116px; -} - - -#ruler_x canvas:first-child { - margin-left: -16px; -} - -#ruler_x canvas { - float: left; -} - -#ruler_y canvas { - margin-top: -16px; -} - -#ruler_x > div, -#ruler_y > div { - overflow: hidden; -} - - #palette { - display: block; - position: absolute; - z-index: 2; - left: 10px; - bottom: 5px; - width: 410px; - right: 145px; - height: 30px; -} - - .palette_item { - height: 20%; - width: 5.2%; - float: left; - cursor: url(../images/eyedropper.png) 0 16, crosshair; -} - -.palette_item.transparent, .palette_item.white, .palette_item.black { - background: #fff; - position: absolute; - width: 10px; - height: 10px; - left: -10px; - top: 0; -} - -.palette_item.transparent { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAVdEVYdENyZWF0aW9uIFRpbWUAOC8yMi8xMg1cp6sAAABESURBVBiVjdBBCgAgCETRr/e/87SJKFPLnfIcQRMIwMBIShIAvgZzoSrfkzrs8WyF1+kX9r3p8AE7nL7kSpSshN+JEQ8GixkF0mSevgAAAABJRU5ErkJggg==); -} - -.palette_item.black { - background: #000; - top: 10px; -} - -.palette_item.white { - background: #fff; - top: 20px; -} - - #color_tools { - position: relative; - width: 48px; - height: 48px; - margin: 6px 6px 0 6px; -} - -.touch #color_tools { - width: auto; - height: auto; -} - -#tool_fill { - position: absolute; - top: 0; - left: 0; - z-index: 1; -} - -.touch #tool_fill { - position: static; - width: 36px; - height: 36px; - margin-bottom: 10px; -} - - -#tool_fill.active, #tool_stroke.active { - z-index: 2; -} - -#tool_stroke { - top: 14px; - left: 14px; -} - -.touch #tool_fill.active, .touch #tool_stroke.active { - outline: 4px solid #09f; -} - -#tool_fill, #tool_stroke, #tool_canvas { - box-shadow: 0 0 0 1px #2f2f2c; - position: absolute; -} - -.touch #tool_fill, .touch #tool_stroke, .touch #tool_canvas { - position: relative; - top: 0; - left: 0; -} - -#color_canvas_tools { - float: left; - cursor: pointer; -} - -#tool_fill .color_block { - width: 24px; - height: 24px; - overflow: hidden; - border: solid #ccc 1px; -} - -.touch #tool_eyedropper { - margin-top: 6px; -} - -.touch #tool_fill .color_block { - width: 36px; - height: 36px; -} - -.touch #tool_fill .color_block svg { - width: 36px !important; - height: 36px !important; -} - -.touch #tool_switch { - display: none; -} - -#use_panel .tool_button, #path_node_panel .tool_button { - color: #999; - border: solid #3F3F3C 1px; - border-radius: 3px; - padding: 3px 10px 3px 40px; - background: - transparent; - position: relative; - margin-top: 10px; - width: 90px; - height: 23px; - line-height: 24px; -} - -#use_panel .tool_button { - padding-left: 10px; - margin-bottom: 10px; - width: 124px; -} - - #path_node_panel .tool_button img, #path_node_panel .tool_button svg { - position: absolute; - left: 5px; - top: 3px; -} - - #color_tools #tool_fill .color_block:hover, #color_tools #tool_stroke .color_block:hover { - border-color: #fff; -} - - #color_tools #tool_fill .color_block > div { - position: absolute; - top: 0; - left: 0; -} - -.touch #color_tools #tool_fill .color_block > div { - position: relative; -} - - #color_tools #tool_fill .color_block #fill_bg, #color_tools #tool_stroke .color_block #stroke_bg { - position: absolute; - top: 1px; - left: 1px; - bottom: 1px; - right: 1px; -} - -.touch #color_tools #tool_fill .color_block #fill_bg, .touch #color_tools #tool_stroke .color_block #stroke_bg { - width: 36px; - height: 36px; - right: auto; - bottom: auto; -} - -.touch #tool_stroke { - position: relative; - top: 0; - left: 0; - z-index: 0; -} - -#stroke_color:after { - content: ''; - position: absolute; - display: block; - width: 8px; - height: 8px; - left: 8px; - top: 8px; - background: #ccc; - box-shadow: 0 0 0 1px #000; -} - -.touch #stroke_color:after { - height: 14px; - left: 10px; - position: absolute; - top: 10px; - width: 14px; - -} - - #color_tools #tool_switch { - cursor: pointer; - opacity: 0.7; - width: 11px; - height: 11px; - background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALCAYAAACprHcmAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABV0RVh0Q3JlYXRpb24gVGltZQA2LzE0LzEyP6j5+gAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAB4SURBVBiVjZHRCYUwDEVvxIF0kZKN7EjiIrrReR/PSNSKXiikcE5JUtMeADMzXQIcdRfgFWqlyyB7ap1wL+0HAnIv1DqRJUBxTkLUWXIvh9AHkIeb58UkIUnDMH4ZR0otCfhv4ynbtp7ut722ZniFG8L9xx4Ek6QfN9huARmYwR0AAAAASUVORK5CYII=) top left no-repeat; - position: absolute; - top: -2px; - left: 28px; -} - - #color_tools #cross:hover { - opacity: 1; -} - - #color_tools #tool_stroke:hover #stroke_color:after { - background: #fff; -} - - #color_tools #tool_stroke .color_block { - width: 24px; - height: 24px; - overflow: hidden; - border: solid #ccc 1px; -} - -.touch #color_tools #tool_stroke .color_block { - width: 36px; - height: 36px; -} - - #color_tools #tool_stroke .color_block > div { - position: absolute; - bottom: 0; - right: 0; -} - -.touch #color_tools #tool_stroke .color_block > div { - position: relative; -} - - - - #color_tools .icon_label { - padding: 0; - width: 24px; - height: 100%; - cursor: pointer; - position: absolute; -} - - #linkLabel > svg { - height: 20px; - padding-top: 4px; -} - - div#workarea { - display: inline-table-cell; - position:absolute; - top: 30px; - left: 50px; - bottom: 40px; - right: 175px; - background-color: #444; - overflow: auto; - text-align: center; - -webkit-transition: -webkit-transform 500ms cubic-bezier(0.13,0.66,0.24,0.92); - -moz-transition: -moz-transform 500ms cubic-bezier(0.13,0.66,0.24,0.92); - -o-transition: -o-transform 500ms cubic-bezier(0.13,0.66,0.24,0.92); - -ms-transition: -ms-transform 500ms cubic-bezier(0.13,0.66,0.24,0.92); - transition: transform 500ms cubic-bezier(0.13,0.66,0.24,0.92); -} - -.touch div#workarea { - top: 40px; -} - - .menu .menu_list { - display: none; - position: absolute; -} - -.tool_button, -.tool_button_current, -.tool_button_pressed { - cursor: pointer; -} - - .tool_button:hover, - .push_button:hover, - .buttonup:hover, - .buttondown, - .tool_button_current, - .push_button_pressed -{ - background-color: #fff; -} - - .tool_button.disabled, - .tool_button.disabled:hover { - opacity: 0.3; - background-color: #aaa; -} - - #tools_left .tool_button { background: #2f2f2c; position: relative;} - #tools_left .tool_button.loaded { background: #ccc;} - #tools_left .tool_button.loaded:hover { background: #fff;} - #tools_left .tool_button:after, #tools_left .tool_button_current:after { - position: absolute; - content: ''; - border: solid #2f2f2c 2px; - top: -1px; - left: -1px; - width: 26px; - height: 26px; - z-index: 0; -} - - #tools_left .tool_button_current { - background-color: #0cf; -} - - #main_icon span { - position: absolute; - width: 100%; - height: 100%; - display: block; - z-index: 2; -} - - #tools_top { - position: absolute; - width: 160px; - height: 100%; - background: #2f2f2c; - right: 0; - top: 20px; - border-bottom: none; - overflow: visible; - padding: 0 0 0 15px; -} - -.touch #tools_top { - top: 30px; -} - - label { - display: block; - color: #999; -} - -div#font-selector { - width:140px; - height:300px; - overflow:auto; - margin:0 auto; - position:absolute; - top:27px; - right:0; - border:1px solid black; - padding:10px; - display:none; - background-color:white; - z-index: 10; - border-radius: 3px; - box-shadow: 0 5px 10px rgba(0,0,0,0.7); -} - -div#font-selector img { - width: 100%; -} - -div#font-selector .font-item { - border-bottom: solid #ddd 1px; - padding: 5px 10px; - margin: 0 -10px; -} - -div#font-selector .font-item:hover { - background-color: #eee; -} - - #tools_top #marker_panel * { - float: left; -} - - #tools_top #marker_panel h4 { - float: none; -} - - #tools_top #marker_panel .dropdown .icon_label { - width: 36px; - height: 20px; - margin-top: 2px; - border: solid #3f3f3c 1px; - text-align: center; -} - - #tools_top #marker_panel .dropdown button { - margin-top: 2px; -} - - #tools_top #marker_panel #marker_panel_title { - float: none; - color: #fff; - margin-bottom: 3px; -} - - #tools_top #marker_panel .dropdown .icon_label img { - float: none; -} - - - #color_picker input[type=text], #color_picker input[type=number] { - width: 30px; - background: #fff; -} - - .dropdown_set input[type=text], .dropdown_set input[type=number] { - width: 50px; -} - - input[type=text].wide, input[type=number].wide {width: 110px;} - input[type=text].tuco, input[type=number].tuco {width: 150px;} - - input[type=submit], input[type=button], button { - background: #4F80FF; - color: #fff; - border-radius: 3px; - padding: 7px 17px; - border: none; - line-height: 140%; - font-size: 14px; - font-weight: bold; - font-family: sans-serif; - -} - - input[type=submit]:hover, button:hover { -box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.1), - inset 0 -3px 10px rgba(0, 0, 0, 0.2); -} - - input[type=submit]:hover, button:hover {background: #2F84C1;} - input[type=submit]:active, button:active { box-shadow: inset 0 2px 2px rgba(0,0,0,0.2); border-bottom: solid rgba(255,255,255,0.1) 1px;} - - - #tools_left { - position: absolute; - border-right: none; - width: 50px; - top: 30px; - bottom: 0; - left: 0; - background: #2F2F2C; /* Needed so flyout icons don't appear on the left */ - z-index: 4; -} - -#workarea.wireframe #svgcontent * { - fill: none; - stroke: #000; - stroke-width: 1px; - stroke-opacity: 1.0; - stroke-dasharray: 0; - opacity: 1; - pointer-events: stroke; - vector-effect: non-scaling-stroke; - filter: none; -} - -#workarea.wireframe #svgcontent text { - fill: #000; - stroke: none; -} - -#workarea.wireframe #canvasBackground > rect { - fill: #FFF !important; -} - -#workarea #canvasBackground > rect { - stroke: transparent !important; -} - -.context_panel { - display: none; -} - -#canvas_panel { - display: block; -} - - #multiselected_panel .selected_tool { - vertical-align: 12px; -} - -#cur_context_panel { - position: absolute; - top: 47px; - left: 68px; - line-height: 22px; - overflow: auto; - border-bottom: none; - border-right: none; - padding-left: 5px; - font-size: 12px; - background: black; - color: #999; - opacity: 0.5; - padding: 0 10px; - border-radius: 0 10px 10px 0; -} - - #cur_context_panel a { - float: none; - text-decoration: none; - color: #fff; -} - - #cur_context_panel a:hover { - text-decoration: underline; -} - - - #tools_left .tool_button, - #tools_left .tool_button_current { - position: relative; - z-index: 11; -} - - .flyout_arrow_horiz { - position: absolute; - bottom: -1px; - right: 0; - z-index: 10; -} - -.dropdown { - position: relative; - float: left; -} - - .dropdown button { - width: 21px; - height: 22px; - padding: 0 3px 0 3px; - border: none; - background-color: #555; - border-radius: 0 2px 2px 0; - margin-left: -1px; - position: relative; -} - - .dropdown button:hover { - background-color: #666; -} - - .dropdown button:after { - content: ''; - position: absolute; - border: solid transparent 4px; - border-top-color: #999; - top: 9px; - left: 6px; -} - - - -.dropdown button.down { - border-left: 1px solid #808080; - border-top: 1px solid #808080; - border-right: 1px solid #FFFFFF; - border-bottom: 1px solid #FFFFFF; - background-color: #B0B0B0; -} - -.dropdown ul { - list-style: none; - position: absolute; - margin: 0; - padding: 0; - left: -80px; - top: 26px; - z-index: 4; - display: none; -} - -.dropup ul { - top: auto; - bottom: 26px; - border-radius: 3px; - box-shadow: 0 5px 10px #000; -} - -.dropup ul:after { - content: ''; - display: block; - position: absolute; - bottom: -10px; - right: 50%; - top: auto; - width: 0; - height: 0; - border: solid transparent 5px; - border-top-color: #fff; -} - -.dropdown li { - display: block; - width: 120px; - padding: 5px 10px; - color: #333; - background: #fff; - margin: 0; - line-height: 16px; -} - -.dropdown li:first-child {border-radius: 3px 3px 0 0;} -.dropdown li:last-child {border-radius: 0 0 3px 3px;} - - -.dropdown li:hover { - background-color: #ddd; - color: #000; -} - -.dropdown li.special { - padding: 10px; - background: white; - border: none; - box-shadow: 0 3px 10px black; - border-radius: 3px !important; -} - -.dropdown li.special:after { - content: ''; - display: block; - position: absolute; - top: -10px; - right: 50%; - border: solid transparent 5px; - border-bottom-color: #fff; - -} - -.dropdown li.special.down:after { - bottom: -10px; - right: 50%; - top: auto; - border: solid transparent 5px; - border-top-color: #fff; - -} - - .tool_button, - .push_button, - .tool_button_current, - .push_button_pressed -{ - height: 27px; - width: 27px; - border: solid #2f2f2c 8px; - border-left-width: 13px; - margin: 0; - background-color: #ddd; - cursor: pointer; -} - - #main_menu li#tool_open, #main_menu li#tool_import { - position: relative; - overflow: hidden; -} - -#tool_image { - overflow: hidden; -} - -#tool_open input, -#tool_import input, -#tool_import_bitmap input { - position: absolute; - opacity: 0; - font-size: 10em; - top: -5px; - right: -5px; - margin: 0; - cursor: pointer; /* Sadly doesn't appear to have an effect */ -} - - .disabled { - opacity: 0.5; - cursor: default; -} - - .width_label { - padding-right: 5px; -} - -#text { - position: absolute; - left: -9999px; -} - - #tool_bold span, #tool_italic span { - position: absolute; - width: 100%; - height: 100%; - top: 0; left: 0; - background: #ccc; - opacity: 0; -} - - - -#url_notice { - padding-top: 4px; - display: none; -} - - #color_picker { - position: absolute; - display: none; - background: #fff; - height: 350px; - border-radius: 3px; - z-index: 5; - box-shadow: 0 5px 10px #000; - width: 530px; -} - - .tools_flyout { - position: absolute; - display: none; - cursor: pointer; - width: 385px; - z-index: 10; - left: 47px !important; - height: 324px; - background: #fff; - border-radius: 5px; - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5); -} - - .tools_flyout_v { - position: absolute; - display: none; - cursor: pointer; - width: 30px; -} - - .tools_flyout .tool_button { - float: left; - background-color: #fff; - height: 24px; - width: 24px; -} - - #tools_bottom { - position: absolute; - left: 50px; - right: 0; - bottom: 0; - height: 40px; - overflow: visible; - background: #2f2f2c; -} - - #tools_bottom_1 { - width: 115px; - float: left; -} - - #tools_bottom_2 { - position: relative; - float: left; - margin-top: 5px; -} - -#tools_bottom input[type=text] { - width: 3.2em; -} - - #tools_top h4 { - color: #fff; - font-weight: normal; - margin: 0; - padding: 10px 0 5px 0; -} - -#tools_top .dropdown .icon_label { - border: 1px solid transparent; -/* margin-top: 3px;*/ - height: auto; -} - -#tools_top.multiselected #align_tools { - display: none; -} - -#tools_top.multiselected #multiselected_panel { - display: block !important; -} - -#tools_top.multiselected #multiselected_panel .hidable { - display: none; -} - - .draginput_cell { - float: left; - height: 26px; - height: 26px; - border: solid #3f3f3c 10px; - outline: solid #2f2f2c 1px; - background: #ddd; - cursor: pointer; - position: relative; -} - - .draginput_cell:hover { - background: #fff; -} - - .draginput_cell:after { - content: ''; - position: absolute; - top: 0; - left: 0; - border: solid #3f3f3c 1px; - height: 26px; - width: 26px; - z-index: 0; -} - - - .align_buttons .draginput_cell:nth-child(1) {border-radius: 3px 0 0 0;} - .align_buttons .draginput_cell:nth-child(3) {border-radius: 0 3px 0 0;} - .align_buttons .draginput_cell:nth-child(4) {border-radius: 0 0 0 3px;} - .align_buttons .draginput_cell:nth-child(6) {border-radius: 0 0 3px 0;} - - -.align_buttons .push_button { - display: block; - float: left; -} - -#option_lists ul { - display: none; - position: absolute; - height: auto; - z-index: 3; - margin: 0; - list-style: none; - padding-left: 0; -} - -#option_lists .optcols2 { - width: 70px; - margin-left: -15px; -} - -#option_lists .optcols3 { - width: 192px; - margin-left: -105px; - margin-top: -25px; - background: #fff; - padding: 5px; - box-shadow: 0 5px 10px #000; - border-radius: 3px; -} - -#option_lists .optcols3:after { - content: ''; - display: block; - position: absolute; - top: -10px; - right: 70px; - border: solid transparent 5px; - border-bottom-color: #fff; -} - - - #option_lists .tool_button, #option_lists .push_button, #option_lists .tool_button_current, #option_lists .push_button_pressed { - border: none; - background: transparent; -} - - #option_lists .tool_button:hover { - background: #ddd; -} - - #option_lists ul li.current { - background-color: #F4E284; -} - -#option_lists .optcols4 { - width: 130px; - margin-left: -44px; -} - -#option_lists ul[class^=optcols] li { - float: left; -} - - ul li.current { - background-color: #F4E284; -} - - #option_lists ul li { - margin: 0; - border-radius: 0; - -moz-border-radius: 0; - -webkit-border-radius: 0; -} - - #copyright { - text-align: right; - padding-right: .3em; -} - -#svg_source_editor { - display: none; -} - -#svg_source_editor #svg_source_overlay { - position: absolute; - top: 0px; - right: 0px; - left: 0px; - bottom: 0px; - background-color: black; - opacity: 0.6; - z-index: 5; -} - -#svg_source_editor #svg_source_container { - position: absolute; - top: 30px; - left: 100px; - right: 100px; - bottom: 30px; - background-color: #fff; - border-radius: 3px; - opacity: 1.0; - text-align: center; - z-index: 6; - padding: 15px 0; -} - -#svg_source_editor form { - position: absolute; - display: block; - top: 15px; - bottom: 55px; - left: 15px; - right: 12px; - padding: 5px; - font-size: 12px; -} - -#svg_source_textarea { - width: 100%; - height: 100%; - line-height: 140%; - font-family: 'Lucida Sans', 'Lucida Grande', 'Lucida Sans Unicode', sans-serif; - font-size: 12px; -} - -#svg_source_editor #tool_source_back { - position: absolute; - bottom: 45px; - left: 15px; - right: 15px; -} - -#svg_source_editor #tool_source_back #tool_source_save { - display: block; - position: absolute; - right: 0; -} - - -#svg_source_editor #tool_source_back #tool_source_cancel { - display: block; - position: absolute; - left: 0; -} - - - button.cancel, input.Cancel, input.cancel, input.jGraduate_Cancel, button.cancel { - -webkit-appearance: none; - background-color: #999; - box-shadow: 0 0 1px rgba(0,0,0,0.5); - margin: 0; -} - - -#shape_buttons { - overflow: auto; - top: 0; - bottom: 0; - left: 110px; - right: 0; - position: absolute; - vertical-align: top; -} - -#shape_cats { - min-width: 110px; - display: block; - position: absolute; - left: 0; - top: 0; - height: 300px; - background: #eee; - border-radius: 3px 0 0 3px; - z-index: 2; -} -#shape_cats > div { - line-height: 1em; - padding: 0 .5em; - border-bottom: 1px solid #ddd; - background: #E8E8E8; - color: #444; - height: 26px; - line-height: 26px; -} - -#shape_cats > div:first-child { - border-radius: 3px 0 0 0; -} - -#shape_cats > div:last-child { - border-radius: 0 0 0 3px; -} - -#shape_cats div:hover { - background: #efefef; - color: #000; -} -#shape_cats div.current { - font-weight: bold; - background: #3f3f3c; - color: #fff; - position: relative; -} - -#shape_cats div.current:after { - content: ''; - position: absolute; - right: -26px; - top: 0; - border: solid transparent 13px; - border-left-color: #3f3f3c; -} - -.toolbar_button button .svg_icon { - display: none; -} - -#dialog_box { - display: none; -} - -#dialog_box_overlay { - background: black; - opacity: .5; - height:100%; - left:0; - position:absolute; - top:0; - width:100%; - z-index: 6; -} - -#dialog_content { - height: 95px; - margin: 10px 10px 5px 10px; - overflow: auto; - text-align: left; - font-size: 13px; -} - -#dialog_buttons input:last-child { - background: #999 !important; - position: absolute; - left: 10px; - bottom: 10px; -} - -#dialog_buttons input:first-child { - position: absolute; - right: 10px; - bottom: 10px; -} - -#dialog_content.prompt { - height: 75px; -} - -#dialog_content p { - margin: 10px; - line-height: 1.3em; -} - -#dialog_container { - position: absolute; - left: 50%; - top: 50%; - width: 300px; - margin-left: -150px; - height: 150px; - margin-top: -80px; - position:fixed; - z-index:50001; - background: #fff; -} - - -#dialog_container, #dialog_content { - border-radius: 3px; -} - -#dialog_buttons input[type=text] { - width: 90%; - display: block; - margin: 0 0 5px 11px; -} - -#dialog_buttons input[type=button] { - margin: 0 1em; -} - -.invisible { - visibility: none; -} - - -/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; } - -.ui-slider { - background: #3F3F3C; - border-radius: 10px; -} - -.ui-slider-handle { - box-shadow: 0 3px 3px rgba(0,0,0,0.3); - border-radius: 30px; - background: #fff; - background-image: -ms-linear-gradient(top, #ccc 0%, #fff 100%); - background-image: -moz-linear-gradient(top, #ccc 0%, #fff 100%); - background-image: -o-linear-gradient(top, #ccc 0%, #fff 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ccc), color-stop(1, #fff)); - background-image: -webkit-linear-gradient(top, #ccc 0%, #fff 100%); - background-image: linear-gradient(top, #ccc 0%, #fff 100%); -} - -.ui-slider-handle:focus { - outline: none; -} - -/* Necessary to keep the flyouts sized properly */ -#shape_buttons {background: #fff; border-radius: 0 3px 3px 0; padding: 10px} - - .tools_flyout .tool_button, - .tools_flyout .tool_flyout { - background: #fff; - width: 40px; - height: 40px; - margin: 5px; - border-radius: 0px; - -moz-border-radius: 0px; - -webkit-border-radius: 0px; - border-width: 0; -} - -/* Generic context menu styles */ -.contextMenu { - position: absolute; - z-index: 99999; - border: solid 1px rgba(0,0,0,.33); - background: rgba(255,255,255,.95); - padding: 5px 0; - margin: 0px; - display: none; - font: 12px/15px 'Lucida Sans', 'Lucida Grande', Helvetica, Verdana, sans-serif; - border-radius: 5px; - -moz-border-radius: 5px; - -moz-box-shadow: 2px 5px 10px rgba(0,0,0,.3); - -webkit-box-shadow: 2px 5px 10px rgba(0,0,0,.3); - box-shadow: 2px 5px 10px rgba(0,0,0,.3); -} - -.touch .contextMenu { - border: solid 5px rgba(0,0,0,.7); - padding: 0; - margin: 0 0 0 20px; - font: 18px/24px sans-serif; - border-radius: 5px; - -webkit-box-shadow: 2px 5px 20px 3px #000; - box-shadow: 2px 5px 20px rgba(0,0,0,0.5); -} - -.touch .contextMenu:after { - content: ''; - width: 0; - height: 0; - border: solid transparent 10px; - border-right-color: rgba(0,0,0,.7); - position: absolute; - top: 50%; - left: -25px; - margin-top: -10px; - z-index: 1000; -} - -.contextMenu LI { - list-style: none; - padding: 0px; - margin: 0px; -} - -.contextMenu .shortcut { - width: 115px; - text-align:right; - float:right; -} - -.touch .contextMenu .shortcut { - display: none; -} - - -.touch .shortcut { - display: none; -} - - -.contextMenu A { - -moz-user-select: none; - -webkit-user-select: none; - color: #222; - text-decoration: none; - display: block; - line-height: 20px; - height: 20px; - background-position: 6px center; - background-repeat: no-repeat; - outline: none; - padding: 0px 15px 1px 20px; -} - -.touch .contextMenu A { - padding: 0 15px; - border-bottom: #; - font-weight: bold; - border-top: solid 1px #E3E3E3; - height: 40px; - line-height: 40px; - min-width: 200px; -} - -.contextMenu LI.hover A { - background-color: #2e5dea; - color: white; - cursor: default; -} - -.contextMenu LI.disabled A { - color: #999; - -} - -.touch .contextMenu LI.disabled A { - display: none; -} - -.contextMenu LI.hover.disabled A { - background-color: transparent; -} - -.contextMenu LI.separator { - border-top: solid 1px #E3E3E3; - padding-top: 5px; - margin-top: 5px; -} - -.touch .contextMenu LI.separator { - border-top: none; - margin: 0; - padding: 0; -} - -#menu { - display: none; - position: absolute; - top: 0; - left: 0; - right: 0; - height: 30px; - background: #000; - z-index: 10; - color: #fff; -} - -#workarea.rect, #workarea.line, #workarea.ellipse, #workarea.path, #workarea.shapelib { - cursor: crosshair; -} - -#workarea.text { - cursor: text; -} - -#workarea.eyedropper { - cursor: url(../images/eyedropper.png) 0 16, crosshair; -} - -#workarea.fhpath { - cursor: url(../images/pencil_cursor.png) 0 16, crosshair; -} - -#workarea.rotate * { - cursor: url(../images/rotate.png) 12 12, auto; -} - -#workarea.select text, #workarea.multiselect text { - cursor: default; -} - -#workarea.n-resize * {cursor: n-resize !important;} -#workarea.e-resize * {cursor: e-resize !important;} -#workarea.w-resize * {cursor: w-resize !important;} -#workarea.s-resize * {cursor: s-resize !important;} - -#workarea.ne-resize * {cursor: ne-resize !important;} -#workarea.se-resize * {cursor: se-resize !important;} -#workarea.nw-resize * {cursor: nw-resize !important;} -#workarea.sw-resize * {cursor: sw-resize !important;} - -#workarea.copy { - cursor: copy; -} - -#workarea.zoom { - cursor: crosshair; - cursor:-moz-zoom-in; - cursor:-webkit-zoom-in; -} -#workarea.zoom.out { - cursor: crosshair; - cursor:-moz-zoom-out; - cursor:-webkit-zoom-out; -} - -#selectorRubberBand { - shape-rendering: crispEdges; -} - -/* For modern browsers */ -.clearfix:before, -.clearfix:after { - content:""; - display:table; -} - -.clearfix:after { - clear:both; -} - -/* For IE 6/7 (trigger hasLayout) */ -.clearfix { - *zoom:1; -} - - - #group_title {display: none;} - -#base_unit_container { - display: none; - position: absolute; - z-index: 20; -} - - .draginput { - background: #3f3f3c; - border-radius: 3px; - -webkit-font-smoothing: antialiased; - width: 70px; - height: 70px; - display: block; - position: relative; - float: left; - margin: 0 5px 5px 0; -} - - .draginput .caret { - border: solid transparent 5px; - border-top-color: #999; - position: absolute; - width: 0; - height: 0; - right: 5px; - margin-top: -2px; - top: 50%; -} - - .draginput label { - margin: 28px 10px 0 5px; - font-size: 14px; - color: white; - font-weight: bold; - font-family: sans-serif; -} - - .draginput label#resolution_label, .draginput label#seg_type_label { - font: bold 12px/110% sans-serif; - position: absolute; - left: auto; - right: 10px; - z-index: 0; - text-align: right; -} - - .draginput label#seg_type_label { - margin-top: 40px; -} - - .draginput label#seg_type_label .caret { - top: 66%; -} - - .draginput label#resolution_label .pull { - position: relative; - left: -15px; -} - - .draginput label#resolution_label span { - right: -13px; - left: auto; - font-size: 16px; - top: 2px; - font-weight: bold; - color: white; -} - -.touch .draginput.active:after { - content: attr(data-value); - display: block; - position: absolute; - background: #fff; - font-size: 16px; - top: 0; - width: 30px; - left: -50px; - padding: 0 5px; - color: #333; - z-index: 10; - font-family: sans-serif; - font-weight: bold; - text-align: right; - padding-right: 10px; - height: 20px; - line-height: 20px; - letter-spacing: -1px; -} - -.touch .draginput.active:before { - content: ''; - height: 0; - width: 0; - position: absolute; - top: 5px; - left: -5px; - border: solid transparent 5px; - border-left-color: #fff; -} - - .draginput input { - border: none; - background: transparent; - font: 24px/normal sans-serif; - text-align: center; - color: #4F80FF; - padding: 30px 0 16px; - width: 100%; - height: 24px; - position: relative; - z-index: 2; -} - -.draginput.twocol { - width: 145px; -} - -#tool_font_family .caret { - right: 40px; - top: 55%; -} - -#tool_font_family select { - width: 110px; -} - - - #tool_bold, #tool_italic { - font: bold 20px/35px serif; - text-align: center; - position: absolute; - padding: 0 0 0 0; - color: #ccc; - background: transparent; - border: none; - width: 35px; - height: 35px; - margin: 0; - top: 0; - right: 0; -} - -#tool_italic { - border-top: solid #2f2f2c 2px; - top: 35px; - font-weight: bold; - font-style: italic; - font-size: 24px; -} - - - #tool_bold:hover, #tool_italic:hover { - color: #fff; -} - - #tool_bold.active, #tool_italic.active { - color: #50A0FF; -} - -#preview_font { - font-size: 20px; - color: #fff; - height: 70px; - line-height: 75px; - padding: 0 0 0 10px; - white-space: nowrap; - width: 100px; - overflow: hidden; - border-right: solid #2f2f2c 2px; - position: relative; -} - -#preview_font:after { - content: ''; - position: absolute; - right: 0; - top: 3px; - bottom: 3px; - width: 15px; - border-right: solid #3f3f3c 10px; - background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxsaW5lYXJHcmFkaWVudCBpZD0iZzU4MCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIHgxPSIwJSIgeTE9IjAlIiB4Mj0iMTAwJSIgeTI9IjAlIj48c3RvcCBzdG9wLWNvbG9yPSIjM2YzZjNjIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiMzZjNmM2MiIG9mZnNldD0iMC43Ii8+PC9saW5lYXJHcmFkaWVudD48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2c1ODApIiAvPjwvc3ZnPg==); -} - - -.draginput input, .draginput input:hover, .draginput input:active { - cursor: url(../images/drag.png), move; - cursor: -webkit-grab; - cursor: -moz-grab; -} - -.draginput input[type="checkbox"], .draginput input[type="checkbox"]:hover, .draginput input[type="checkbox"]:active { - cursor: pointer; -} - -.draginput.checkbox { - cursor: pointer; -} - -.draginput.active input, .draginput.active input:hover, .draginput.active input:active { - cursor: url(../images/dragging.png), move; - cursor: -webkit-grabbing; - cursor: -moz-grabbing; -} - - - - .draginput span { - font: 11px/130% sans-serif; - color: #ccc; - display: block; - position: absolute; - top: 5px; - left: 5px; - text-align: left; -} - - .draginput.error { - background: #900; -} - - .draginput.error input { - color: #fff; -} - - .draginput.stroke_tool { - text-align: center; -} - - .draginput select { - -webkit-appearance: none; - opacity: 0; - display: block; - position: absolute; - height: 100%; - width: 100%; - margin: 0; - z-index: 1; - top: 0; - left: 0; -} - - -.draginput_cursor{ - position: absolute; - top: 50%; - width: 100%; - border-top: solid rgba(50,100,200,0.25) 3px; - margin-top: -2px; - z-index: 0; -} - - .draginput input[readonly=readonly] { - -webkit-appearance: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - - - .draginput input:focus { - background: #50A0FF; - color: #fff; - outline: none; - box-shadow: 0 0 5px 2px #50A0FF; -} - - .draginput input:focus+span { - z-index: 10; - color:#fff; -} - -.draginput .push_bottom { - bottom: 0; - position: absolute; -} - -#zoom_label { - height: 20px; - background: transparent; - cursor: default !important; - width: auto; - padding: 0 10px; - margin: 0; -} - -#zoom_panel { - padding: 9px 0; - right: 175px; - position: absolute; -} - -#zoom_label img, #zoom_label svg { - width: 16px; - height: 16px; -} - -#logo svg { - pointer-events: none; -} - -#zoomLabel { - width: 16px; - height: 16px; - cursor: pointer; - background: #ccc; -} - -#zoomLabel:after { - content: ''; - position: absolute; - border-left: solid #2f2f2c 1px; - left: 0; - height: 16px; -} - -#zoom_label input { - color: #ccc; - font-size: 13px; - height: auto; - width: auto; - padding: 0; - cursor: default; - position: static; -} - -#zoom_label span { - top: 0; - left: 0; -} - -body.dragging * { - cursor: url(../images/dragging.png), move; - cursor: -webkit-grabbing; - cursor: -moz-grabbing; -} - -body.drag * { - cursor: url(../images/dragging.png), move; - cursor: -webkit-grabbing; - cursor: -moz-grabbing; -} - -input[readonly=readonly]:focus { - box-shadow: none; -} - -#color_canvas_tools, #fill_bg, #stroke_bg { - background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMAQMAAABsu86kAAAAA3NCSVQICAjb4U/gAAAABlBMVEXu7u7///8o06qaAAAACXBIWXMAAAsSAAALEgHS3X78AAAAFXRFWHRDcmVhdGlvbiBUaW1lADcvMjIvMTL7FNdCAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M1cbXjNgAAABFJREFUCJljYP7AgIb+MKAhAM8/C5vWL6zSAAAAAElFTkSuQmCC) top left repeat; -} - -#color_canvas_tools { - width: 60px; - height: 40px; - margin: 23px 5px 5px 5px; - position: relative; - overflow: hidden; -} - -#color_canvas_tools { - display: block; -} - - -#tool_angle_indicator { - width: 50px; - height: 50px; - border-radius: 50px; - background: rgba(255,255,255,0.05); - position: absolute; - bottom: 2px; - left: 10px; -} - -#tool_angle_indicator_cursor { - width: 4px; - height: 25px; - border-top: solid #50A0FF 3px; - position: absolute; - margin: 0 0 0 23px; - -webkit-transform-origin: 50% 0; - -moz-transform-origin: 50% 0; - -o-transform-origin: 50% 0; - -ms-transform-origin: 50% 0; - transform-origin: 50% 0; -} - -#stroke_style_label { - font-size: 30px; - margin-top: 33px; - letter-spacing: -1px; -} - -.stroke_tool .caret { - top: 60%; -} - -#tool_align_relative { - position: absolute; - top: -5px; - left: 0; - right: 20px; - display: block; -} - -#tool_align_relative select { - width: 100%; - display: block; -} \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/embedapi.html b/views/vibeOS/appfiles/nsvg/components/method-draw/embedapi.html deleted file mode 100644 index 889af204..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/embedapi.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - -
- - - - diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/closepath_icons.svg b/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/closepath_icons.svg deleted file mode 100644 index 7294f5ea..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/closepath_icons.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Layer 1 - - - - - - - - - - - - - - - - - Layer 1 - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-arrows.js b/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-arrows.js deleted file mode 100644 index 4f451921..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-arrows.js +++ /dev/null @@ -1,298 +0,0 @@ -/* - * ext-arrows.js - * - * Licensed under the Apache License, Version 2 - * - * Copyright(c) 2010 Alexis Deveria - * - */ - - -methodDraw.addExtension("Arrows", function(S) { - var svgcontent = S.svgcontent, - addElem = S.addSvgElementFromJson, - nonce = S.nonce, - randomize_ids = S.randomize_ids, - selElems; - - svgCanvas.bind('setnonce', setArrowNonce); - svgCanvas.bind('unsetnonce', unsetArrowNonce); - - var lang_list = { - "en":[ - {"id": "arrow_none", "textContent": "No arrow" } - ], - "fr":[ - {"id": "arrow_none", "textContent": "Sans flèche" } - ] - }; - - var prefix = 'se_arrow_'; - if (randomize_ids) { - var arrowprefix = prefix + nonce + '_'; - } else { - var arrowprefix = prefix; - } - - var pathdata = { - fw: {d:"m0,0l10,5l-10,5l5,-5l-5,-5z", refx:8, id: arrowprefix + 'fw'}, - bk: {d:"m10,0l-10,5l10,5l-5,-5l5,-5z", refx:2, id: arrowprefix + 'bk'} - } - - function setArrowNonce(window, n) { - randomize_ids = true; - arrowprefix = prefix + n + '_'; - pathdata.fw.id = arrowprefix + 'fw'; - pathdata.bk.id = arrowprefix + 'bk'; - } - - function unsetArrowNonce(window) { - randomize_ids = false; - arrowprefix = prefix; - pathdata.fw.id = arrowprefix + 'fw'; - pathdata.bk.id = arrowprefix + 'bk'; - } - - function getLinked(elem, attr) { - var str = elem.getAttribute(attr); - if(!str) return null; - var m = str.match(/\(\#(.*)\)/); - if(!m || m.length !== 2) { - return null; - } - return S.getElem(m[1]); - } - - function showPanel(on) { - $('#arrow_panel').toggle(on); - - if(on) { - var el = selElems[0]; - var end = el.getAttribute("marker-end"); - var start = el.getAttribute("marker-start"); - var mid = el.getAttribute("marker-mid"); - var val; - - if(end && start) { - val = "both"; - } else if(end) { - val = "end"; - } else if(start) { - val = "start"; - } else if(mid) { - val = "mid"; - if(mid.indexOf("bk") != -1) { - val = "mid_bk"; - } - } - - if(!start && !mid && !end) { - val = "none"; - } - - $("#arrow_list").val(val); - } - } - - function resetMarker() { - var el = selElems[0]; - el.removeAttribute("marker-start"); - el.removeAttribute("marker-mid"); - el.removeAttribute("marker-end"); - } - - function addMarker(dir, type, id) { - // TODO: Make marker (or use?) per arrow type, since refX can be different - id = id || arrowprefix + dir; - - var marker = S.getElem(id); - - var data = pathdata[dir]; - - if(type == "mid") { - data.refx = 5; - } - - if(!marker) { - marker = addElem({ - "element": "marker", - "attr": { - "viewBox": "0 0 10 10", - "id": id, - "refY": 5, - "markerUnits": "strokeWidth", - "markerWidth": 5, - "markerHeight": 5, - "orient": "auto", - "style": "pointer-events:none" // Currently needed for Opera - } - }); - var arrow = addElem({ - "element": "path", - "attr": { - "d": data.d, - "fill": "#000000" - } - }); - marker.appendChild(arrow); - S.findDefs().appendChild(marker); - } - - marker.setAttribute('refX', data.refx); - - return marker; - } - - function setArrow() { - var type = this.value; - resetMarker(); - - if(type == "none") { - return; - } - - // Set marker on element - var dir = "fw"; - if(type == "mid_bk") { - type = "mid"; - dir = "bk"; - } else if(type == "both") { - addMarker("bk", type); - svgCanvas.changeSelectedAttribute("marker-start", "url(#" + pathdata.bk.id + ")"); - type = "end"; - dir = "fw"; - } else if (type == "start") { - dir = "bk"; - } - - addMarker(dir, type); - svgCanvas.changeSelectedAttribute("marker-"+type, "url(#" + pathdata[dir].id + ")"); - S.call("changed", selElems); - } - - function colorChanged(elem) { - var color = elem.getAttribute('stroke'); - - var mtypes = ['start','mid','end']; - var defs = S.findDefs(); - - $.each(mtypes, function(i, type) { - var marker = getLinked(elem, 'marker-'+type); - if(!marker) return; - - var cur_color = $(marker).children().attr('fill'); - var cur_d = $(marker).children().attr('d'); - var new_marker = null; - if(cur_color === color) return; - - var all_markers = $(defs).find('marker'); - // Different color, check if already made - all_markers.each(function() { - var attrs = $(this).children().attr(['fill', 'd']); - if(attrs.fill === color && attrs.d === cur_d) { - // Found another marker with this color and this path - new_marker = this; - } - }); - - if(!new_marker) { - // Create a new marker with this color - var last_id = marker.id; - var dir = last_id.indexOf('_fw') !== -1?'fw':'bk'; - - new_marker = addMarker(dir, type, arrowprefix + dir + all_markers.length); - - $(new_marker).children().attr('fill', color); - } - - $(elem).attr('marker-'+type, "url(#" + new_marker.id + ")"); - - // Check if last marker can be removed - var remove = true; - $(S.svgcontent).find('line, polyline, path, polygon').each(function() { - var elem = this; - $.each(mtypes, function(j, mtype) { - if($(elem).attr('marker-' + mtype) === "url(#" + marker.id + ")") { - return remove = false; - } - }); - if(!remove) return false; - }); - - // Not found, so can safely remove - if(remove) { - $(marker).remove(); - } - - }); - - } - - return { - name: "Arrows", - context_tools: [{ - type: "select", - panel: "arrow_panel", - title: "Select arrow type", - id: "arrow_list", - options: { - none: "No arrow", - end: "---->", - start: "<----", - both: "<--->", - mid: "-->--", - mid_bk: "--<--" - }, - defval: "none", - events: { - change: setArrow - } - }], - callback: function() { - $('#arrow_panel').hide(); - // Set ID so it can be translated in locale file - $('#arrow_list option')[0].id = 'connector_no_arrow'; - }, - addLangData: function(lang) { - return { - data: lang_list[lang] - }; - }, - selectedChanged: function(opts) { - - // Use this to update the current selected elements - selElems = opts.elems; - - var i = selElems.length; - var marker_elems = ['line','path','polyline','polygon']; - - while(i--) { - var elem = selElems[i]; - if(elem && $.inArray(elem.tagName, marker_elems) != -1) { - if(opts.selectedElement && !opts.multiselected) { - showPanel(true); - } else { - showPanel(false); - } - } else { - showPanel(false); - } - } - }, - elementChanged: function(opts) { - var elem = opts.elems[0]; - if(elem && ( - elem.getAttribute("marker-start") || - elem.getAttribute("marker-mid") || - elem.getAttribute("marker-end") - )) { - // var start = elem.getAttribute("marker-start"); - // var mid = elem.getAttribute("marker-mid"); - // var end = elem.getAttribute("marker-end"); - // Has marker, so see if it should match color - colorChanged(elem); - } - - } - }; -}); diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-closepath.js b/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-closepath.js deleted file mode 100644 index dc73f1a9..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-closepath.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * ext-closepath.js - * - * Licensed under the Apache License, Version 2 - * - * Copyright(c) 2010 Jeff Schiller - * - */ - -// This extension adds a simple button to the contextual panel for paths -// The button toggles whether the path is open or closed -methodDraw.addExtension("ClosePath", function(S) { - var selElems, - updateButton = function(path) { - var seglist = path.pathSegList, - closed = seglist.getItem(seglist.numberOfItems - 1).pathSegType==1, - showbutton = closed ? '#tool_openpath' : '#tool_closepath', - hidebutton = closed ? '#tool_closepath' : '#tool_openpath'; - $(hidebutton).hide(); - $(showbutton).show(); - }, - showPanel = function(on) { - $('#closepath_panel').toggle(on); - if (on) { - var path = selElems[0]; - if (path) updateButton(path); - } - }, - - toggleClosed = function() { - var path = selElems[0]; - if (path) { - var seglist = path.pathSegList, - last = seglist.numberOfItems - 1; - // is closed - if(seglist.getItem(last).pathSegType == 1) { - seglist.removeItem(last); - } - else { - seglist.appendItem(path.createSVGPathSegClosePath()); - } - updateButton(path); - } - }; - - return { - name: "ClosePath", - svgicons: "extensions/closepath_icons.svg", - buttons: [{ - id: "tool_openpath", - type: "context", - panel: "closepath_panel", - title: "Open path", - events: { - 'click': function() { - toggleClosed(); - } - } - }, - { - id: "tool_closepath", - type: "context", - panel: "closepath_panel", - title: "Close path", - events: { - 'click': function() { - toggleClosed(); - } - } - }], - callback: function() { - $('#closepath_panel').hide(); - }, - selectedChanged: function(opts) { - selElems = opts.elems; - var i = selElems.length; - - while(i--) { - var elem = selElems[i]; - if(elem && elem.tagName == 'path') { - if(opts.selectedElement && !opts.multiselected) { - showPanel(true); - } else { - showPanel(false); - } - } else { - showPanel(false); - } - } - } - }; -}); diff --git a/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-connector.js b/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-connector.js deleted file mode 100644 index ffd54df0..00000000 --- a/views/vibeOS/appfiles/nsvg/components/method-draw/extensions/ext-connector.js +++ /dev/null @@ -1,587 +0,0 @@ -/* - * ext-connector.js - * - * Licensed under the Apache License, Version 2 - * - * Copyright(c) 2010 Alexis Deveria - * - */ - -methodDraw.addExtension("Connector", function(S) { - var svgcontent = S.svgcontent, - svgroot = S.svgroot, - getNextId = S.getNextId, - getElem = S.getElem, - addElem = S.addSvgElementFromJson, - selManager = S.selectorManager, - curConfig = methodDraw.curConfig, - started = false, - start_x, - start_y, - cur_line, - start_elem, - end_elem, - connections = [], - conn_sel = ".se_connector", - se_ns, -// connect_str = "-SE_CONNECT-", - selElems = []; - - elData = $.data; - - var lang_list = { - "en":[ - {"id": "mode_connect", "title": "Connect two objects" } - ], - "fr":[ - {"id": "mode_connect", "title": "Connecter deux objets"} - ] - }; - - function getOffset(side, line) { - var give_offset = !!line.getAttribute('marker-' + side); -// var give_offset = $(line).data(side+'_off'); - - // TODO: Make this number (5) be based on marker width/height - var size = line.getAttribute('stroke-width') * 5; - return give_offset ? size : 0; - } - - function showPanel(on) { - var conn_rules = $('#connector_rules'); - if(!conn_rules.length) { - conn_rules = $('').appendTo("head");xb()}},Gb=function(){ya(a("#view_menu"));var k=!a("#tool_snap").hasClass("push_button_pressed");k?a("#tool_snap").addClass("push_button_pressed"):a("#tool_snap").removeClass("push_button_pressed");curConfig.gridSnapping= -k},Ib=function(){window.self!=window.top&&top.exit_fullscreen()},Lb=function(){ya(a("#view_menu"));if(a("#tool_rulers").hasClass("push_button_pressed")){a("#tool_rulers").removeClass("push_button_pressed");a("#show_rulers").attr("checked",false);curConfig.showRulers=false}else{a("#tool_rulers").addClass("push_button_pressed");a("#show_rulers").attr("checked",true);curConfig.showRulers=true}a("#rulers").toggle(!!curConfig.showRulers)},xb=function(){if(!h){var k="#workarea.wireframe #svgcontent * { stroke-width: "+ -1/e.getZoom()+"px; }";a("#wireframe_rules").text(J.hasClass("wireframe")?k:"")}},Eb=function(k,n){if(!fa){ya(a("#view_menu"));fa=true;a("#save_output_btns").toggle(!!n);a("#tool_source_back").toggle(!n);var q=ca=e.getSvgString();a("#svg_source_textarea").val(q);a("#svg_source_editor").fadeIn();a("#svg_source_textarea").focus().select()}},Kb=function(){if(fa){if(e.setSvgString(a("#svg_source_textarea").val())){e.clearSelection();Ya();yb();ka()}else a.confirm(uiStrings.notification.QerrorsRevertToSource, -function(k){if(!k)return false;e.clearSelection();Ya();yb();ka()});la()}},zb=b.setIcon=function(k,n){var q=typeof n==="string"?a.getSvgIcon(n,true):n.clone();q?a(k).find("img").replaceWith(q):console.log("NOTE: Icon image missing: "+n)},gb;gb=function(){var k=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,n=document.getElementsByTagName("script")[0],q;for(q in n.style)if(k.test(q))return q.match(k)[0];if("WebkitOpacity"in n.style)return"Webkit";if("KhtmlOpacity"in n.style)return"Khtml";return""}();var Nb= -function(k,n){gb.toLowerCase();var q=["top","left","bottom","right"];k.each(function(){for(var u=a(this),E=u.outerWidth()*(n-1),I=u.outerHeight()*(n-1),K=0;K<4;K++){var O=q[K],V=u.data("orig_margin-"+O);if(V==null){V=parseInt(u.css("margin-"+O));u.data("orig_margin-"+O,V)}V=V*n;if(O==="right")V+=E;else if(O==="bottom")V+=I;u.css("margin-"+O,V)}})},Mb=b.setIconSize=function(k,n){if(!(k==s.size&&!n)){var q=a("#tools_top .toolset, #editor_panel > *, #history_panel > *, #main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *, #g_panel > *, #tool_font_size > *, .tools_flyout"), -u=1;u=typeof k=="number"?k:{s:0.75,m:1,l:1.25,xl:1.5}[k];b.tool_scale=R=u;oa();var E=q.parents(":hidden");E.css("visibility","hidden").show();Nb(q,u);E.css("visibility","visible").hide();q=a("#tool_size_rules");if(q.length)q.empty();else q=a('').appendTo("head");if(k!="m"){var I="";a.each(cssResizeRules,function(K,O){K="#svg_editor "+K.replace(/,/g,", #svg_editor");I+=K+"{";a.each(O,function(V,aa){if(typeof aa==="number")var S=aa*u+"px";else if(aa[k]||aa.all)S= -aa[k]||aa.all;I+=V+":"+S+";"});I+="}"});E="-"+gb.toLowerCase()+"-";I+="#tools_top .toolset, #editor_panel > *, #history_panel > *, #main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *, #g_panel > *, #tool_font_size > *, .tools_flyout{"+E+"transform: scale("+u+");} #svg_editor div.toolset .toolset {"+E+"transform: scale(1); margin: 1px !important;} #svg_editor .ui-slider {"+E+"transform: scale("+1/u+");}";q.text(I)}oa()}},Ab=function(){a("#dialog_box").hide(); -if(fa){if(fa)ca!==a("#svg_source_textarea").val()?a.confirm(uiStrings.notification.QignoreSourceChanges,function(k){k&&Ya()}):Ya();Db()}else ta&&e.leaveContext()},Ya=function(){a("#svg_source_editor").hide();fa=false;a("#svg_source_textarea").blur()};a(window).width();a(window).height();var Db=a.noop;a(window).resize(function(){G()});(function(){J.scroll(function(){if(a("#ruler_x").length!=0)a("#ruler_x")[0].scrollLeft=J[0].scrollLeft;if(a("#ruler_y").length!=0)a("#ruler_y")[0].scrollTop=J[0].scrollTop})})(); -a("#url_notice").click(function(){a.alert(this.title)});a("#change_image_url").click(function(){var k=e.getHref(X);k=k.indexOf("data:")===0?"":k;a.prompt(uiStrings.notification.enterNewImgURL,k,function(n){n&&Sa(n)})});var f=function(k){var n=k[0].id=="stroke_color"?"stroke":"fill",q=k[0].id=="canvas_color";if(q)n="canvas";var u=b.paintBox[n].paint;k=n=="stroke"?"Pick a Stroke Paint and Opacity":"Pick a Fill Paint and Opacity";q=q?{right:175,top:50}:{left:50,bottom:50};a("#color_picker").draggable({cancel:".jGraduate_tabs, .jGraduate_colPick, .jGraduate_gradPick, .jPicker", -containment:"window"}).removeAttr("style").css(q).jGraduate({paint:u,window:{pickerTitle:k},images:{clientPath:curConfig.jGraduatePath},newstop:"inverse"},function(E){u=new a.jGraduate.Paint(E);b.paintBox[n].setPaint(u);e.setPaint(n,u);a("#color_picker").hide()},function(){a("#color_picker").hide()})};d=function(k,n){var q=document.getElementById("canvas_background"),u={color:"fff",opacity:1};if(n=="stroke")u=curConfig.initStroke;if(n=="fill")u=curConfig.initFill;if(n=="canvas"&&q)if(q=q.getAttribute("fill").match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))u= -{color:("0"+parseInt(q[1],10).toString(16)).slice(-2)+("0"+parseInt(q[2],10).toString(16)).slice(-2)+("0"+parseInt(q[3],10).toString(16)).slice(-2),opacity:1};q=(new DOMParser).parseFromString(' ',"text/xml").documentElement;q=a(k)[0].appendChild(document.importNode(q,true));n==="canvas"?q.setAttribute("width",60.5): -q.setAttribute("width","100%");this.rect=q.firstChild;this.defs=q.getElementsByTagName("defs")[0];this.grad=this.defs.firstChild;this.paint=new a.jGraduate.Paint({solidColor:u.color});this.type=n;this.setPaint=function(E,I){this.paint=E;var K="none",O=E.type,V=E.alpha/100;switch(O){case "solidColor":K=E[O]=="none"||E[O]=="one"?"none":"#"+E[O];break;case "linearGradient":case "radialGradient":this.defs.removeChild(this.grad);this.grad=this.defs.appendChild(E[O]);K="url(#"+(this.grad.id="gradbox_"+ -this.type)+")"}this.rect.setAttribute("fill",K);this.rect.setAttribute("opacity",V);if(this.type=="canvas")if(O=document.getElementById("canvas_background")){Fa=e.getResolution();O.setAttribute("x",-1);O.setAttribute("y",-1);O.setAttribute("width",Fa.w+2);O.setAttribute("height",Fa.h+2);K.indexOf("url")==-1&&O.setAttribute("fill",K)}else Na(K);if(I){e.setColor(this.type,K,true);e.setPaintOpacity(this.type,V,true)}};this.update=function(E){if(X){var I=this.type;switch(X.tagName){case "use":case "image":case "foreignObject":return; -case "g":case "a":for(var K=null,O=X.getElementsByTagName("*"),V=0,aa=O.length;V=1){V=e.getResolution();a("#canvas_width").val(V.w.toFixed());a("#canvas_height").val(V.h.toFixed());a("#resolution_label").html("
"+V.w+"\u00d7
"+V.h+"
")}else requestAnimationFrame(O)};O()}else{a("#resolution_label").html("Custom");k.removeAttribute("readonly");k.focus();k.select();if(k.value=="fit"){k.value=100;n.value=100}}});a("#zoom").change(function(){xa(this)}); -a("input,select").attr("autocomplete","off");var B=function(){var k=[{sel:"#tool_select",fn:cb,evt:"click",key:["V",true]},{sel:"#tool_fhpath",fn:Ta,evt:"click",key:["Q",true]},{sel:"#tool_line",fn:Va,evt:"click",key:["L",true]},{sel:"#tool_rect",fn:Da,evt:"click",key:["R",true],icon:"rect"},{sel:"#tool_ellipse",fn:ua,evt:"mouseup",key:["C",true],icon:"ellipse"},{sel:"#tool_path",fn:db,evt:"click",key:["P",true]},{sel:"#tool_text",fn:Ea,evt:"click",key:["T",true]},{sel:"#tool_image",fn:$a,evt:"mouseup"}, -{sel:"#tool_zoom",fn:Ga,evt:"mouseup",key:["Z",true]},{sel:"#tool_clear",fn:Ma,evt:"mouseup",key:[w+"N",true]},{sel:"#tool_save",fn:function(){if(fa)Kb();else{ya(a("#file_menu"));e.save({images:s.img_save,round_digits:6})}},evt:"mouseup",key:[w+"S",true]},{sel:"#tool_export",fn:nb,evt:"mouseup"},{sel:"#tool_open",fn:Qa,evt:"mouseup"},{sel:"#tool_import",fn:mb,evt:"mouseup"},{sel:"#tool_source",fn:Eb,evt:"click",key:[w+"U",true]},{sel:"#tool_wireframe",fn:Hb,evt:"click"},{sel:"#tool_snap",fn:Gb,evt:"click"}, -{sel:"#tool_rulers",fn:Lb,evt:"click"},{sel:"#tool_source_cancel,#svg_source_overlay,#tool_docprops_cancel,#tool_prefs_cancel",fn:Ab,evt:"click",key:["esc",false,false],hidekey:true},{sel:"#tool_source_save",fn:Kb,evt:"click"},{sel:"#tool_delete,#tool_delete_multi",fn:lb,evt:"click",key:["del/backspace",true]},{sel:"#tool_reorient",fn:ob,evt:"click"},{sel:"#tool_node_link",fn:tb,evt:"change"},{sel:"#tool_node_clone",fn:ha,evt:"click"},{sel:"#tool_node_delete",fn:Y,evt:"click"},{sel:"#tool_openclose_path", -fn:M,evt:"click"},{sel:"#tool_add_subpath",fn:ja,evt:"click"},{sel:"#tool_move_top",fn:sa,evt:"click",key:w+"shift+up"},{sel:"#tool_move_bottom",fn:hb,evt:"click",key:w+"shift+down"},{sel:"#tool_move_up",fn:eb,evt:"click",key:[w+"up",true]},{sel:"#tool_move_down",fn:sb,evt:"click",key:[w+"down",true]},{sel:"#tool_topath",fn:ab,evt:"click"},{sel:"#tool_make_link,#tool_make_link_multi",fn:pb,evt:"click"},{sel:"#tool_clone,#tool_clone_multi",fn:Fb,evt:"click",key:[w+"D",true]},{sel:"#tool_group",fn:Bb, -evt:"click",key:[w+"G",true]},{sel:"#tool_ungroup",fn:Bb,evt:"click",key:w+"shift+G"},{sel:"#tool_unlink_use",fn:Bb,evt:"click"},{sel:"[id^=tool_align]",fn:bb,evt:"click"},{sel:"#tool_undo",fn:qb,evt:"click",key:w+"z"},{sel:"#tool_redo",fn:rb,evt:"click",key:["y",true]},{sel:"#tool_cut",fn:Ua,evt:"click",key:[w+"x",true]},{sel:"#tool_copy",fn:Xa,evt:"click",key:w+"c"},{sel:"#tool_paste",fn:wb,evt:"click",key:w+"v"},{sel:"#tool_switch",fn:Ha,evt:"click",key:["x",true]},{sel:"#tool_bold",fn:Wa,evt:"mousedown", -key:[w+"B",true]},{sel:"#tool_italic",fn:Za,evt:"mousedown",key:[w+"I",true]},{sel:"#copy_save_done",fn:Ab,evt:"click"},{key:"ctrl+left",fn:function(){Ca(0,1)}},{key:"ctrl+right",fn:function(){Ca(1,1)}},{key:"ctrl+shift+left",fn:function(){Ca(0,5)}},{key:"ctrl+shift+right",fn:function(){Ca(1,5)}},{key:"shift+O",fn:ba},{key:"shift+P",fn:P},{key:[w+"+",true],fn:function(){yb(2)}},{key:[w+"-",true],fn:function(){yb(0.5)}},{key:["up",true],fn:function(){fb(0,-1)}},{key:["down",true],fn:function(){fb(0, -1)}},{key:["left",true],fn:function(){fb(-1,0)}},{key:["right",true],fn:function(){fb(1,0)}},{key:"shift+up",fn:function(){fb(0,-10)}},{key:"shift+down",fn:function(){fb(0,10)}},{key:"shift+left",fn:function(){fb(-10,0)}},{key:"shift+right",fn:function(){fb(10,0)}},{key:["alt+up",true],fn:function(){e.cloneSelectedElements(0,-1)}},{key:["alt+down",true],fn:function(){e.cloneSelectedElements(0,1)}},{key:["alt+left",true],fn:function(){e.cloneSelectedElements(-1,0)}},{key:["alt+right",true],fn:function(){e.cloneSelectedElements(1, -0)}},{key:["alt+shift+up",true],fn:function(){e.cloneSelectedElements(0,-10)}},{key:["alt+shift+down",true],fn:function(){e.cloneSelectedElements(0,10)}},{key:["alt+shift+left",true],fn:function(){e.cloneSelectedElements(-10,0)}},{key:["alt+shift+right",true],fn:function(){e.cloneSelectedElements(10,0)}},{key:w+"A",fn:function(){e.selectAllInCurrentLayer()}},{key:"I",fn:function(){var q=a(".tool_button_current");if(q.length&&q[0].id!=="tool_eyedropper"){q.removeClass("tool_button_current").addClass("tool_button"); -a("#tool_eyedropper").addClass("tool_button_current").removeClass("tool_button")}e.setMode("eyedropper")}},{key:w+"shift+z",fn:rb},{key:"esc",fn:Ib}],n={"4/Shift+4":"#tools_rect_show","5/Shift+5":"#tools_ellipse_show"};return{setAll:function(){var q={};a.each(k,function(u,E){if(E.sel){var I=a(E.sel);if(I.length==0)return true;if(E.evt){if(svgedit.browser.isTouch()&&E.evt==="click")E.evt="mousedown";I[E.evt](E.fn)}if(E.parent&&a(E.parent+"_show").length!=0){var K=a(E.parent);K.length||(K=pa(E.parent.substr(1))); -K.append(I);a.isArray(q[E.parent])||(q[E.parent]=[]);q[E.parent].push(E)}}if(E.key){var O=E.fn,V=false;if(a.isArray(E.key)){K=E.key[0];if(E.key.length>1)V=E.key[1]}else K=E.key;K+="";svgedit.browser.isMac&&K.indexOf("+")!=-1&&K.split("+")[0]=="ctrl"&&K.replace("ctrl","cmd");a.each(K.split("/"),function(S,ea){a(document).bind("keydown",ea,function(ga){O();V&&ga.preventDefault();return false})});if(E.sel&&!E.hidekey&&I.attr("title")){var aa=I.attr("title").split("[")[0]+" ("+K+")";n[K]=E.sel;I.parents("#main_menu").length|| -I.attr("title",aa)}}});da(q);a(window).bind("keydown","tab",function(u){if(N==="canvas"){u.preventDefault();P()}}).bind("keydown","shift+tab",function(u){if(N==="canvas"){u.preventDefault();ba()}});a("#tool_zoom").dblclick(Ra)},setTitles:function(){a.each(n,function(q,u){var E=a(u).parents("#main_menu").length;a(u).each(function(){var I=E?a(this).text().split(" [")[0]:this.title.split(" [")[0],K="";a.each(q.split("/"),function(O,V){var aa=V.split("+"),S="";if(aa.length>1){S=aa[0]+"+";V=aa[1]}K+=(O? -"/":"")+S+(uiStrings["key_"+V]||V)});if(E)this.lastChild.textContent=I+" ["+K+"]";else this.title=I+" ["+K+"]"})})},getButtonData:function(q){var u;a.each(k,function(E,I){if(I.sel===q)u=I});return u}}}();B.setAll();b.ready(function(){var k=curConfig.initTool,n=a("#tools_left, #svg_editor .tools_flyout"),q=n.find("#tool_"+k);k=n.find("#"+k);(q.length?q:k.length?k:a("#tool_select")).click().mouseup();curConfig.wireframe&&a("#tool_wireframe").click();curConfig.showlayers&&toggleSidePanel();a("#rulers").toggle(!!curConfig.showRulers)}); -a("#canvas_height").dragInput({min:10,max:null,step:10,callback:m,cursor:false,dragAdjust:0.1});a("#canvas_width").dragInput({min:10,max:null,step:10,callback:m,cursor:false,dragAdjust:0.1});a("#rect_width").dragInput({min:1,max:null,step:1,callback:changeAttribute,cursor:false});a("#rect_height").dragInput({min:1,max:null,step:1,callback:changeAttribute,cursor:false});a("#ellipse_cx").dragInput({min:1,max:null,step:1,callback:changeAttribute,cursor:false});a("#ellipse_cy").dragInput({min:1,max:null, -step:1,callback:changeAttribute,cursor:false});a("#ellipse_rx").dragInput({min:1,max:null,step:1,callback:changeAttribute,cursor:false});a("#ellipse_ry").dragInput({min:1,max:null,step:1,callback:changeAttribute,cursor:false});a("#image_height").dragInput({min:1,max:null,step:1,callback:changeAttribute,cursor:false});a("#circle_cx").dragInput({min:1,max:null,step:1,callback:changeAttribute,cursor:false});a("#circle_cy").dragInput({min:1,max:null,step:1,callback:changeAttribute,cursor:false});a("#circle_r").dragInput({min:1, -max:null,step:1,callback:changeAttribute,cursor:false});a("#image_height").dragInput({min:0,max:null,step:1,callback:changeAttribute,cursor:false});a("#selected_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#selected_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_node_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_node_y").dragInput({min:null,max:null,step:1,callback:changeAttribute, -cursor:false});a("#image_width").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_x1").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_x2").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_y1").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#line_y2").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#path_x").dragInput({min:null, -max:null,step:1,callback:changeAttribute,cursor:false});a("#path_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#rect_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#rect_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#g_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#g_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#image_x").dragInput({min:null, -max:null,step:1,callback:changeAttribute,cursor:false});a("#text_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#text_x").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#image_y").dragInput({min:null,max:null,step:1,callback:changeAttribute,cursor:false});a("#rect_rx").dragInput({min:0,max:100,step:1,callback:changeAttribute,cursor:true});a("#stroke_width").dragInput({min:0,max:99,step:1,callback:function(k){var n=k.value;if(n==0&& -X&&["line","polyline"].indexOf(X.nodeName)>=0)n=k.value=1;e.setStrokeWidth(n)},cursor:true,smallStep:0.1,start:1.5});a("#angle").dragInput({min:-180,max:180,step:1,callback:function(k){e.setRotationAngle(k.value,true);rotateCursor(k.value);a("#tool_reorient").toggleClass("disabled",k.value==0)},cursor:false,dragAdjust:0.5});a("#font_size").dragInput({min:1,max:250,step:1,callback:function(k){e.setFontSize(k.value)},cursor:true,stepfunc:function(k,n){var q=k.value-0,u=q+n,E=u>=q;if(n===0)return q; -return q>=24?E?Math.round(q*1.1):Math.round(q/1.1):q<=1?E?q*2:q/2:u},dragAdjust:0.15});a("#group_opacity").dragInput({min:0,max:100,step:5,callback:changeAttribute,cursor:true,start:100});a("#blur").dragInput({min:0,max:10,step:0.1,callback:function(k,n){val=k.value;a("#blur").val(val);n?e.setBlur(val,true):e.setBlurNoUndo(val)},cursor:true,start:0});a("#zoom").val(e.getZoom()*100);a("#workarea").contextMenu({menu:"cmenu_canvas",inSpeed:0},function(k){switch(k){case "delete":lb();break;case "cut":Ua(); -break;case "copy":Xa();break;case "paste":e.pasteElements();break;case "paste_in_place":e.pasteElements("in_place");break;case "group":e.groupSelectedElements();break;case "ungroup":e.ungroupSelectedElement();break;case "move_front":sa();break;case "move_up":ib("Up");break;case "move_down":ib("Down");break;case "move_back":hb();break;default:svgedit.contextmenu&&svgedit.contextmenu.hasCustomHandler(k)&&svgedit.contextmenu.getCustomHandler(k).call()}});a(".contextMenu li").mousedown(function(k){k.preventDefault()}); -a("#cmenu_canvas li").disableContextMenu();H.enableContextMenuItems("#delete,#cut,#copy");window.onbeforeunload=function(){if(v.getUndoStackSize()===0)b.show_save_warning=false;if(!curConfig.no_save_warning&&b.show_save_warning)return uiStrings.notification.unsavedChanges};b.openPrep=function(k){a("#main_menu").hide();v.getUndoStackSize()===0?k(true):a.confirm(uiStrings.notification.QwantToOpen,k)};if(window.FileReader){d=function(k){k.stopPropagation();k.preventDefault();a("#workarea").removeAttr("style"); -a("#main_menu").hide();var n=null;if(n=k.type=="drop"?k.dataTransfer.files[0]:this.files[0])if(n.type.indexOf("image")!=-1)if(n.type.indexOf("svg")!=-1){k=new FileReader;k.onloadend=function(q){e.importSvgString(q.target.result,true);e.ungroupSelectedElement();e.ungroupSelectedElement();e.groupSelectedElements();e.alignSelectedElements("m","page");e.alignSelectedElements("c","page")};k.readAsText(n)}else{k=new FileReader;k.onloadend=function(q){insertNewImage=function(K,O){var V=e.addSvgElementFromJson({element:"image", -attr:{x:0,y:0,width:K,height:O,id:e.getNextId(),style:"pointer-events:inherit"}});e.setHref(V,q.target.result);e.selectOnly([V]);e.alignSelectedElements("m","page");e.alignSelectedElements("c","page");Ia()};var u=100,E=100,I=new Image;I.src=q.target.result;document.body.appendChild(I);I.onload=function(){u=I.offsetWidth;E=I.offsetHeight;insertNewImage(u,E);document.body.removeChild(I)}};k.readAsDataURL(n)}};J=a("#workarea");J[0].addEventListener("dragenter",function(k){k.stopPropagation();k.preventDefault(); -J.css({"-webkit-transform":"scale3d(1.1,1.1,1)","-moz-transform":"scale3d(1.1,1.1,1)","-o-transform":"scale(1.1)","-ms-transform":"scale3d(1.1,1.1,1)",transform:"scale3d(1.1,1.1,1)"})},false);J[0].addEventListener("dragover",function(k){k.stopPropagation();k.preventDefault()},false);J[0].addEventListener("dragleave",function(k){J.removeAttr("style");k.stopPropagation();k.preventDefault()},false);J[0].addEventListener("drop",d,false);var A=a('').change(function(){var k=this;b.openPrep(function(n){if(n){e.clear(); -if(k.files.length==1){n=new FileReader;n.onloadend=function(q){o(q.target.result);G()};n.readAsText(k.files[0])}}})});a("#tool_open").show().prepend(A);d=a('').change(d);a("#tool_import").show().prepend(d)}var G=b.updateCanvas=function(k,n){var q=J.width(),u=J.height(),E=q,I=u,K=e.getZoom(),O=J,V=a("#svgcanvas"),aa={x:O[0].scrollLeft+E/2,y:O[0].scrollTop+I/2},S=curConfig.canvas_expansion;q=Math.max(E,e.contentW*K*S);u=Math.max(I,e.contentH*K*S);q==E&&u==I?J.css("overflow","hidden"): -J.css("overflow","scroll");S=V.height()/2;var ea=V.width()/2;V.width(q).height(u);var ga=u/2,T=q/2,qa=e.updateCanvas(q,u),va=T/ea;q=q/2-E/2;u=u/2-I/2;if(n){n.x+=qa.x;n.y+=qa.y}else n={x:T+(aa.x-ea)*va,y:ga+(aa.y-S)*va};if(k)if(e.contentW>O.width()){J[0].scrollLeft=qa.x-10;J[0].scrollTop=qa.y-10}else{O[0].scrollLeft=q;O[0].scrollTop=u}else{O[0].scrollLeft=n.x-E/2;O[0].scrollTop=n.y-I/2}if(curConfig.showRulers){E=V;K=K;document.getElementById("workarea");document.getElementById("title_show");K||(K= -e.getZoom());E||(E=a("#svgcanvas"));I=e.getContentElem();O=svgedit.units.getTypeMap()[curConfig.baseUnit];for(V=0;V<2;V++){ea=(aa=V===0)?"x":"y";va=aa?"width":"height";S=I.getAttribute(ea)-0;ea=a("#ruler_"+ea+" canvas:first");$hcanv=ea.clone();ea.replaceWith($hcanv);q=$hcanv[0];ga=ea=E[va]()*2;q.parentNode.style[va]=ga+"px";T=0;var za;qa=q.getContext("2d");qa.fillStyle="rgb(200,0,0)";qa.fillRect(0,0,q.width,q.height);$hcanv.siblings().remove();if(ea>=3E4){var Aa=parseInt(ea/3E4)+1;za=Array(Aa);za[0]= -qa;for(u=1;u=1)u=Math.round(Aa);else{u=(q+"").split(".")[1].length; -u=Aa.toFixed(u)-0}if(u!==0&&u!==1E3&&u%1E3===0)u=u/1E3+"K";if(aa){qa.fillText(u,La+2,8);qa.fillStyle="#777"}else{Aa=(u+"").split("");for(u=0;uea){T++;qa.stroke();if(T>=za.length){u=10;La=ga;continue}qa=za[T];La-=3E4;ub=Math.round(La+Aa*u)+0.5}var Cb=u%2?12:10;if(aa){qa.moveTo(ub,15);qa.lineTo(ub,Cb)}else{qa.moveTo(15,ub);qa.lineTo(Cb,ub)}}}qa.strokeStyle="#666";qa.stroke()}J.scroll()}}, -D=[];for(d=0.1;d<1E5;d*=10){D.push(1*d);D.push(2*d);D.push(5*d)}G(true);try{var z=function(k){if(window.JSON&&JSON.stringify)return JSON.stringify(k);var n=arguments.callee;if(typeof k=="boolean"||typeof k=="number")return k+"";else if(typeof k=="string")return'"'+k.replace(/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,function(E){return"\\u"+("0000"+E.charCodeAt(0).toString(16)).slice(-4)})+'"';else if(k.length){for(var q= -0;q0?(c-s)/g:200,p=d/l*g,w=0,C=this.getAttribute("data-attr"),v=methodDraw.canvas,L=svgedit.browser.isTouch(),Q=true,J=d&&this.dragCfg.cursor?$("
").appendTo(e):false;b.attr("readonly","readonly");J&&!isNaN(this.dragCfg.start)&&J.css("top",this.dragCfg.start*-1/p+l);this.adjustValue= -function(H,U){var R;H=parseFloat(H);R=isNaN(this.value)?this.dragCfg.reset:$.isFunction(this.dragCfg.stepfunc)?this.dragCfg.stepfunc(this,H):Number((Number(this.value)+Number(H)).toFixed(5));if(c!==null)R=Math.min(R,c);if(s!==null)R=Math.max(R,s);J&&this.updateCursor(R);this.value=R;e.attr("data-value",R);$.isFunction(this.dragCfg.callback)&&this.dragCfg.callback(this,U)};e.toggleClass("draginput",e.is("label"));this.move=function(H,U,R){if(L)H=H.originalEvent.touches[0];if(w===0)w=U;U=(H.pageY-w)* --1;w=H.pageY;R=U*p*o;this.adjustValue(R.toFixed(g<1?1:0))};this.stop=function(){var H=v.getSelectedElems();$("body").removeClass("dragging");e.removeClass("active");Q=true;$(window).unbind("mousemove.draginput touchmove.draginput mouseup.draginput touchend.draginput");w=0;if(H[0]){H=v.undoMgr.finishUndoableChange();H.isEmpty()||v.undoMgr.addCommandToHistory(H)}this.adjustValue(0,Q)};this.updateCursor=function(){var H=parseFloat(this.value)*-1/p+l;J.css("top",H)};this.launch=function(H){var U=v.getSelectedElems(); -if(L)H=H.originalEvent.touches[0];var R=H.pageY,N=this.value,ca=this;v.undoMgr.beginUndoableChange(C,U);$("body").addClass("dragging");e.addClass("active");$(window).bind("mousemove.draginput touchmove.draginput",function(la){ca.move(la,R,parseFloat(N))});$(window).bind("mouseup.draginput touchend.draginput",function(){ca.stop()})};$(this).attr("readonly","readonly").attr("data-scale",p).attr("data-domain",l).attr("data-cursor",J!=false).bind("mousedown touchstart",function(H){this.blur();this.launch(H)}).bind("dblclick taphold", -function(){this.removeAttribute("readonly","readonly");this.focus();this.select()}).keydown(function(H){switch(H.keyCode){case 13:this.adjustValue(0);this.blur()}}).focus(function(){this.getAttribute("readonly")==="readonly"&&this.blur()}).blur(function(){this.setAttribute("readonly","readonly")}).bind("mousewheel",function(H,U,R,N){U=v.getSelectedElems();Q&&v.undoMgr.beginUndoableChange(C,U);Q=false;clearTimeout(window.undoTimeout);window.undoTimeout=setTimeout(function(){ca.stop()},200);var ca= -this;if(N>0)this.adjustValue(this.dragCfg.step);else N<0&&this.adjustValue(-this.dragCfg.step);H.preventDefault()})})};$.fn.dragInput.updateCursor=function(a){var o=parseFloat(a.value),e=parseFloat(a.getAttribute("data-scale")),b=parseFloat(a.getAttribute("data-domain"));o=o*-1/e+b+"px";a=a.parentNode.lastChild;if(a.className=="draginput_cursor")a.style.top=o};svgedit=svgedit||{}; -(function(){var a=this;if(!svgedit.contextmenu)svgedit.contextmenu={};a.contextMenuExtensions={};methodDraw.ready(function(){for(menuItem in contextMenuExtensions){var o=contextMenuExtensions[menuItem];Object.keys(a.contextMenuExtensions).length==0&&$("#cmenu_canvas").append("
  • ");var e=o.shortcut||"";$("#cmenu_canvas").append("
  • "+o.label+""+e+"
  • ")}});svgedit.contextmenu.resetCustomMenus=function(){a.contextMenuExtensions= -{}};svgedit.contextmenu.add=function(o){if(o&&o.id&&o.label&&o.action&&typeof o.action=="function")if(o.id in a.contextMenuExtensions)console.error('Cannot add extension "'+o.id+'", an extension by that name already exists"');else{console.log("Registed contextmenu item: {id:"+o.id+", label:"+o.label+"}");a.contextMenuExtensions[o.id]=o}else console.error("Menu items must be defined and have at least properties: id, label, action, where action must be a function")};svgedit.contextmenu.hasCustomHandler= -function(o){return a.contextMenuExtensions[o]&&true};svgedit.contextmenu.getCustomHandler=function(o){return a.contextMenuExtensions[o].action}})();(function(a,o){function e(l){return!a(l).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function b(l,s){var c=l.nodeName.toLowerCase();if("area"===c){c=l.parentNode;var g=c.name;if(!l.href||!g||c.nodeName.toLowerCase()!=="map")return false;c=a("img[usemap=#"+g+"]")[0];return!!c&&e(c)}return(/input|select|textarea|button|object/.test(c)?!l.disabled:"a"==c?l.href||s:s)&&e(l)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.17", -keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(l,s){return typeof l=="number"?this.each(function(){var c= -this;setTimeout(function(){a(c).focus();s&&s.call(c)},l)}):this._focus.apply(this,arguments)},scrollParent:function(){var l;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?l=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):l=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this, -"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!l.length?a(document):l},zIndex:function(l){if(l!==o)return this.css("zIndex",l);if(this.length){l=a(this[0]);for(var s;l.length&&l[0]!==document;){s=l.css("position");if(s==="absolute"||s==="relative"||s==="fixed"){s=parseInt(l.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}l=l.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart": -"mousedown")+".ui-disableSelection",function(l){l.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(l,s){function c(w,C,v,L){a.each(g,function(){C-=parseFloat(a.curCSS(w,"padding"+this,true))||0;v&&(C-=parseFloat(a.curCSS(w,"border"+this+"Width",true))||0);L&&(C-=parseFloat(a.curCSS(w,"margin"+this,true))||0)});return C}var g=s==="Width"?["Left","Right"]:["Top","Bottom"],d=s.toLowerCase(),p={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight, -outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+s]=function(w){if(w===o)return p["inner"+s].call(this);return this.each(function(){a(this).css(d,c(this,w)+"px")})};a.fn["outer"+s]=function(w,C){if(typeof w!="number")return p["outer"+s].call(this,w);return this.each(function(){a(this).css(d,c(this,w,true,C)+"px")})}}),a.extend(a.expr[":"],{data:function(l,s,c){return!!a.data(l,c[3])},focusable:function(l){return b(l,!isNaN(a.attr(l,"tabindex")))},tabbable:function(l){var s=a.attr(l, -"tabindex"),c=isNaN(s);return(c||s>=0)&&b(l,!c)}}),a(function(){var l=document.body,s=l.appendChild(s=document.createElement("div"));a.extend(s.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=s.offsetHeight===100;a.support.selectstart="onselectstart"in s;l.removeChild(s).style.display="none"}),a.extend(a.ui,{plugin:{add:function(l,s,c){l=a.ui[l].prototype;for(var g in c){l.plugins[g]=l.plugins[g]||[];l.plugins[g].push([s,c[g]])}},call:function(l,s,c){if((s=l.plugins[s])&& -l.element[0].parentNode)for(var g=0;g0)return true;l[c]=1;g=l[c]>0;l[c]=0;return g},isOverAxis:function(l,s,c){return l>s&&l=9)&&!e.button)return this._mouseUp(e);if(this._mouseStarted){this._mouseDrag(e);return e.preventDefault()}this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==false,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e));return!this._mouseStarted},_mouseUp:function(e){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);this._mouseStarted&& -(this._mouseStarted=false,e.target==this._mouseDownEvent.target&&a.data(e.target,this.widgetName+".preventClickEvent",true),this._mouseStop(e));return false},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -(function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){this.options.helper=="original"&& -!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative");this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(o){var e=this.options; -if(this.helper||e.disabled||a(o.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(o);if(!this.handle)return false;e.iframeFix&&a(e.iframeFix===true?"iframe":e.iframeFix).each(function(){a('
    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")});return true},_mouseStart:function(o){var e=this.options;this.helper= -this._createHelper(o);this._cacheHelperProportions();a.ui.ddmanager&&(a.ui.ddmanager.current=this);this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:o.pageX-this.offset.left,top:o.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); -this.originalPosition=this.position=this._generatePosition(o);this.originalPageX=o.pageX;this.originalPageY=o.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);e.containment&&this._setContainment();if(this._trigger("start",o)===false){this._clear();return false}this._cacheHelperProportions();a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,o);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(o,true);a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,o);return true}, -_mouseDrag:function(o,e){this.position=this._generatePosition(o);this.positionAbs=this._convertPositionTo("absolute");if(!e){var b=this._uiHash();if(this._trigger("drag",o,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,o);return false},_mouseStop:function(o){var e= -false;a.ui.ddmanager&&!this.options.dropBehaviour&&(e=a.ui.ddmanager.drop(this,o));this.dropped&&(e=this.dropped,this.dropped=false);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!e||this.options.revert=="valid"&&e||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,e)){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10), -function(){b._trigger("stop",o)!==false&&b._clear()})}else this._trigger("stop",o)!==false&&this._clear();return false},_mouseUp:function(o){this.options.iframeFix===true&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,o);return a.ui.mouse.prototype._mouseUp.call(this,o)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(o){var e=!this.options.handle|| -!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==o.target&&(e=true)});return e},_createHelper:function(o){var e=this.options;o=a.isFunction(e.helper)?a(e.helper.apply(this.element[0],[o])):e.helper=="clone"?this.element.clone().removeAttr("id"):this.element;o.parents("body").length||o.appendTo(e.appendTo=="parent"?this.element[0].parentNode:e.appendTo);o[0]!=this.element[0]&&!/(fixed|absolute)/.test(o.css("position"))&& -o.css("position","absolute");return o},_adjustOffsetFromHelper:function(o){typeof o=="string"&&(o=o.split(" "));a.isArray(o)&&(o={left:+o[0],top:+o[1]||0});"left"in o&&(this.offset.click.left=o.left+this.margins.left);"right"in o&&(this.offset.click.left=this.helperProportions.width-o.right+this.margins.left);"top"in o&&(this.offset.click.top=o.top+this.margins.top);"bottom"in o&&(this.offset.click.top=this.helperProportions.height-o.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent= -this.helper.offsetParent();var o=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(o.left+=this.scrollParent.scrollLeft(),o.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)o={top:0,left:0};return{top:o.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:o.left+(parseInt(this.offsetParent.css("borderLeftWidth"), -10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var o=this.element.position();return{top:o.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:o.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), -10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var o=this.options;o.containment=="parent"&&(o.containment=this.helper[0].parentNode);if(o.containment=="document"||o.containment=="window")this.containment=[o.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,o.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, -(o.containment=="document"?0:a(window).scrollLeft())+a(o.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(o.containment=="document"?0:a(window).scrollTop())+(a(o.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(o.containment)&&o.containment.constructor!=Array){o=a(o.containment);var e=o[0];if(e){o.offset();var b=a(e).css("overflow")!= -"hidden";this.containment=[(parseInt(a(e).css("borderLeftWidth"),10)||0)+(parseInt(a(e).css("paddingLeft"),10)||0),(parseInt(a(e).css("borderTopWidth"),10)||0)+(parseInt(a(e).css("paddingTop"),10)||0),(b?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(a(e).css("borderLeftWidth"),10)||0)-(parseInt(a(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(b?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(a(e).css("borderTopWidth"), -10)||0)-(parseInt(a(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=o}}else o.containment.constructor==Array&&(this.containment=o.containment)},_convertPositionTo:function(o,e){e||(e=this.position);var b=o=="absolute"?1:-1,l=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,s=/(html|body)/i.test(l[0].tagName);return{top:e.top+ -this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():s?0:l.scrollTop())*b),left:e.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():s?0:l.scrollLeft())*b)}},_generatePosition:function(o){var e=this.options,b=this.cssPosition=="absolute"&& -(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,l=/(html|body)/i.test(b[0].tagName),s=o.pageX,c=o.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;o.pageX-this.offset.click.leftg[2]&&(s=g[2]+this.offset.click.left);o.pageY-this.offset.click.top>g[3]&&(c=g[3]+this.offset.click.top)}if(e.grid){c=e.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/e.grid[1])*e.grid[1]:this.originalPageY;c=g?c-this.offset.click.topg[3]?c-this.offset.click.topg[2]?s-this.offset.click.left=0;w--){var C=b.snapElements[w].left,v=C+b.snapElements[w].width,L=b.snapElements[w].top,Q=L+b.snapElements[w].height;if(C-s
    ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(e.range==="min"||e.range==="max"?" ui-slider-range-"+e.range:"")));for(var c=b.length;c"); -this.handles=b.add(a(s.join("")).appendTo(o.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){e.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){e.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(g){a(this).data("index.ui-slider-handle", -g)});this.handles.keydown(function(g){var d=true,p=a(this).data("index.ui-slider-handle"),w,C,v;if(!o.options.disabled){switch(g.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:d=false;if(!o._keySliding){o._keySliding=true;a(this).addClass("ui-state-active");w=o._start(g,p);if(w===false)return}}w=o.options.step;o.options.values&&o.options.values.length? -C=v=o.values(p):C=v=o.value();switch(g.keyCode){case a.ui.keyCode.HOME:v=o._valueMin();break;case a.ui.keyCode.END:v=o._valueMax();break;case a.ui.keyCode.PAGE_UP:v=o._trimAlignValue(C+(o._valueMax()-o._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:v=o._trimAlignValue(C-(o._valueMax()-o._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(C===o._valueMax())return;v=o._trimAlignValue(C+w);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(C===o._valueMin())return;v=o._trimAlignValue(C- -w)}o._slide(g,p,v);return d}}).keyup(function(g){var d=a(this).data("index.ui-slider-handle");o._keySliding&&(o._keySliding=false,o._stop(g,d),o._change(g,d),a(this).removeClass("ui-state-active"))});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); -return this},_mouseCapture:function(o){var e=this.options,b,l,s,c,g;if(e.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();b=this._normValueFromMouse({x:o.pageX,y:o.pageY});l=this._valueMax()-this._valueMin()+1;c=this;this.handles.each(function(d){var p=Math.abs(b-c.values(d));l>p&&(l=p,s=a(this),g=d)});e.range===true&&this.values(1)===e.min&&(g+=1,s=a(this.handles[g]));if(this._start(o,g)===false)return false; -this._mouseSliding=true;c._handleIndex=g;s.addClass("ui-state-active").focus();e=s.offset();this._clickOffset=!a(o.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:o.pageX-e.left-s.width()/2,top:o.pageY-e.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(o,g,b);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(o){var e= -this._normValueFromMouse({x:o.pageX,y:o.pageY});this._slide(o,this._handleIndex,e);return false},_mouseStop:function(o){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(o,this._handleIndex);this._change(o,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(o){var e,b;this.orientation==="horizontal"? -(e=this.elementSize.width,b=o.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,b=o.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0));o=b/e;o>1&&(o=1);o<0&&(o=0);this.orientation==="vertical"&&(o=1-o);e=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+o*e)},_start:function(o,e){var b={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(b.value=this.values(e), -b.values=this.values());return this._trigger("start",o,b)},_slide:function(o,e,b){var l,s,c;this.options.values&&this.options.values.length?(l=this.values(e?0:1),this.options.values.length===2&&this.options.range===true&&(e===0&&b>l||e===1&&b1){this.options.values[o]=this._trimAlignValue(e);this._refreshValue();this._change(null,o)}else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(o):this.value();b=this.options.values;l=arguments[0];for(s=0;s=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,b=(o-this._valueMin())%e;o=o-b;Math.abs(b)*2>=e&&(o+=b>0?e:-e);return parseFloat(o.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var o= -this.options.range,e=this.options,b=this,l=this._animateOff?false:e.animate,s,c={},g,d,p,w;this.options.values&&this.options.values.length?this.handles.each(function(C){s=(b.values(C)-b._valueMin())/(b._valueMax()-b._valueMin())*100;c[b.orientation==="horizontal"?"left":"bottom"]=s+"%";a(this).stop(1,1)[l?"animate":"css"](c,e.animate);b.options.range===true&&(b.orientation==="horizontal"?(C===0&&b.range.stop(1,1)[l?"animate":"css"]({left:s+"%"},e.animate),C===1&&b.range[l?"animate":"css"]({width:s- -g+"%"},{queue:false,duration:e.animate})):(C===0&&b.range.stop(1,1)[l?"animate":"css"]({bottom:s+"%"},e.animate),C===1&&b.range[l?"animate":"css"]({height:s-g+"%"},{queue:false,duration:e.animate})));g=s}):(d=this.value(),p=this._valueMin(),w=this._valueMax(),s=w!==p?(d-p)/(w-p)*100:0,c[b.orientation==="horizontal"?"left":"bottom"]=s+"%",this.handle.stop(1,1)[l?"animate":"css"](c,e.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[l?"animate":"css"]({width:s+"%"},e.animate), -o==="max"&&this.orientation==="horizontal"&&this.range[l?"animate":"css"]({width:100-s+"%"},{queue:false,duration:e.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[l?"animate":"css"]({height:s+"%"},e.animate),o==="max"&&this.orientation==="vertical"&&this.range[l?"animate":"css"]({height:100-s+"%"},{queue:false,duration:e.animate}))}});a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery);(function(a){Math.precision=function(c,g){if(g===undefined)g=0;return Math.round(c*Math.pow(10,g))/Math.pow(10,g)};var o=function(c,g){var d=this,p=c.find("img:first"),w=0,C=100,v=100,L=0,Q=100,J=100,H=0,U=0,R,N,ca=[],la=function(Z){for(var da=0;dapa)da=pa;if(Z<0)Z=0;else if(Z>oa)Z=oa;ia.call(d,"xy",{x:da/pa*v+w,y:Z/oa*J+L})},ia=function(Z,da,pa){if(da===undefined){if(Z===undefined||Z==null)Z="xy";switch(Z.toLowerCase()){case "x":return H; -case "y":return U;default:return{x:H,y:U}}}if(!(pa!=null&&pa==d)){var oa=false,ma,na;if(Z==null)Z="xy";switch(Z.toLowerCase()){case "x":ma=da&&(da.x&&da.x|0||da|0)||0;break;case "y":na=da&&(da.y&&da.y|0||da|0)||0;break;default:ma=da&&da.x&&da.x|0||0;na=da&&da.y&&da.y|0||0}if(ma!=null){if(maC)ma=C;if(H!=ma){H=ma;oa=true}}if(na!=null){if(naQ)na=Q;if(U!=na){U=na;oa=true}}oa&&la.call(d,pa||d)}},ka=function(Z){a.isFunction(Z)&&ca.push(Z)};a.extend(true,d,{val:ia,range:function(Z, -da){if(da===undefined){if(Z===undefined||Z==null)Z="all";switch(Z.toLowerCase()){case "minx":return w;case "maxx":return C;case "rangex":return{minX:w,maxX:C,rangeX:v};case "miny":return L;case "maxy":return Q;case "rangey":return{minY:L,maxY:Q,rangeY:J};default:return{minX:w,maxX:C,rangeX:v,minY:L,maxY:Q,rangeY:J}}}var pa,oa,ma,na;if(Z==null)Z="all";switch(Z.toLowerCase()){case "minx":pa=da&&(da.minX&&da.minX|0||da|0)||0;break;case "maxx":oa=da&&(da.maxX&&da.maxX|0||da|0)||0;break;case "rangex":pa= -da&&da.minX&&da.minX|0||0;oa=da&&da.maxX&&da.maxX|0||0;break;case "miny":ma=da&&(da.minY&&da.minY|0||da|0)||0;break;case "maxy":na=da&&(da.maxY&&da.maxY|0||da|0)||0;break;case "rangey":ma=da&&da.minY&&da.minY|0||0;na=da&&da.maxY&&da.maxY|0||0;break;default:pa=da&&da.minX&&da.minX|0||0;oa=da&&da.maxX&&da.maxX|0||0;ma=da&&da.minY&&da.minY|0||0;na=da&&da.maxY&&da.maxY|0||0}if(pa!=null&&w!=pa){w=pa;v=C-w}if(oa!=null&&C!=oa){C=oa;v=C-w}if(ma!=null&&L!=ma){L=ma;J=Q-L}if(na!=null&&Q!=na){Q=na;J=Q-L}},bind:ka, -unbind:function(Z){if(a.isFunction(Z))for(var da;(da=a.inArray(Z,ca))!=-1;)ca.splice(da,1)},destroy:function(){a(document).unbind("mouseup",fa).unbind("mousemove",W);c.unbind("mousedown",X);ca=p=c=null}});p.src=g.arrow&&g.arrow.image;p.w=g.arrow&&g.arrow.width||p.width();p.h=g.arrow&&g.arrow.height||p.height();c.w=g.map&&g.map.width||c.width();c.h=g.map&&g.map.height||c.height();c.bind("mousedown",X);ka.call(d,function(){var Z=0,da=0,pa=c.w,oa=c.h,ma=p.w,na=p.h;setTimeout(function(){if(v>0)Z=H==C? -pa:H/v*pa|0;if(J>0)da=U==Q?oa:U/J*oa|0;if(ma>=pa)Z=(pa>>1)-(ma>>1);else Z-=ma>>1;if(na>=oa)da=(oa>>1)-(na>>1);else da-=na>>1;p.css({left:Z+"px",top:da+"px"})},0)})},e=function(c,g,d,p){var w=this;c=c.find("td.Text input");var C=c.eq(3),v=c.eq(4),L=c.eq(5),Q=c.length>7?c.eq(6):null,J=c.eq(0),H=c.eq(1),U=c.eq(2),R=c.eq(c.length>7?7:6),N=c.length>7?c.eq(8):null,ca=function(ia){if(!(ia.target.value==""&&ia.target!=R.get(0)&&(d!=null&&ia.target!=d.get(0)||d==null))){if(!W(ia))return ia;switch(ia.target){case C.get(0):switch(ia.keyCode){case 38:C.val(fa.call(w, -(C.val()<<0)+1,0,255));g.val("r",C.val(),ia.target);return false;case 40:C.val(fa.call(w,(C.val()<<0)-1,0,255));g.val("r",C.val(),ia.target);return false}break;case v.get(0):switch(ia.keyCode){case 38:v.val(fa.call(w,(v.val()<<0)+1,0,255));g.val("g",v.val(),ia.target);return false;case 40:v.val(fa.call(w,(v.val()<<0)-1,0,255));g.val("g",v.val(),ia.target);return false}break;case L.get(0):switch(ia.keyCode){case 38:L.val(fa.call(w,(L.val()<<0)+1,0,255));g.val("b",L.val(),ia.target);return false;case 40:L.val(fa.call(w, -(L.val()<<0)-1,0,255));g.val("b",L.val(),ia.target);return false}break;case Q&&Q.get(0):switch(ia.keyCode){case 38:Q.val(fa.call(w,parseFloat(Q.val())+1,0,100));g.val("a",Math.precision(Q.val()*255/100,p),ia.target);return false;case 40:Q.val(fa.call(w,parseFloat(Q.val())-1,0,100));g.val("a",Math.precision(Q.val()*255/100,p),ia.target);return false}break;case J.get(0):switch(ia.keyCode){case 38:J.val(fa.call(w,(J.val()<<0)+1,0,360));g.val("h",J.val(),ia.target);return false;case 40:J.val(fa.call(w, -(J.val()<<0)-1,0,360));g.val("h",J.val(),ia.target);return false}break;case H.get(0):switch(ia.keyCode){case 38:H.val(fa.call(w,(H.val()<<0)+1,0,100));g.val("s",H.val(),ia.target);return false;case 40:H.val(fa.call(w,(H.val()<<0)-1,0,100));g.val("s",H.val(),ia.target);return false}break;case U.get(0):switch(ia.keyCode){case 38:U.val(fa.call(w,(U.val()<<0)+1,0,100));g.val("v",U.val(),ia.target);return false;case 40:U.val(fa.call(w,(U.val()<<0)-1,0,100));g.val("v",U.val(),ia.target);return false}}}}, -la=function(ia){if(!(ia.target.value==""&&ia.target!=R.get(0)&&(d!=null&&ia.target!=d.get(0)||d==null))){if(!W(ia))return ia;switch(ia.target){case C.get(0):C.val(fa.call(w,C.val(),0,255));g.val("r",C.val(),ia.target);break;case v.get(0):v.val(fa.call(w,v.val(),0,255));g.val("g",v.val(),ia.target);break;case L.get(0):L.val(fa.call(w,L.val(),0,255));g.val("b",L.val(),ia.target);break;case Q&&Q.get(0):Q.val(fa.call(w,Q.val(),0,100));g.val("a",Math.precision(Q.val()*255/100,p),ia.target);break;case J.get(0):J.val(fa.call(w, -J.val(),0,360));g.val("h",J.val(),ia.target);break;case H.get(0):H.val(fa.call(w,H.val(),0,100));g.val("s",H.val(),ia.target);break;case U.get(0):U.val(fa.call(w,U.val(),0,100));g.val("v",U.val(),ia.target);break;case R.get(0):R.val(R.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));d&&d.val(R.val());g.val("hex",R.val()!=""?R.val():null,ia.target);break;case d&&d.get(0):d.val(d.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6));R.val(d.val());g.val("hex",d.val()!=""?d.val(): -null,ia.target);break;case N&&N.get(0):N.val(N.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2));g.val("a",N.val()!=null?parseInt(N.val(),16):null,ia.target)}}},X=function(ia){if(g.val()!=null)switch(ia.target){case C.get(0):C.val(g.val("r"));break;case v.get(0):v.val(g.val("g"));break;case L.get(0):L.val(g.val("b"));break;case Q&&Q.get(0):Q.val(Math.precision(g.val("a")*100/255,p));break;case J.get(0):J.val(g.val("h"));break;case H.get(0):H.val(g.val("s"));break;case U.get(0):U.val(g.val("v")); -break;case R.get(0):case d&&d.get(0):R.val(g.val("hex"));d&&d.val(g.val("hex"));break;case N&&N.get(0):N.val(g.val("ahex").substring(6))}},W=function(ia){switch(ia.keyCode){case 9:case 16:case 29:case 37:case 39:return false;case "c".charCodeAt():case "v".charCodeAt():if(ia.ctrlKey)return false}return true},fa=function(ia,ka,Z){if(ia==""||isNaN(ia))return ka;if(ia>Z)return Z;if(ia255)W.r=255;if(d!=W.r){d=W.r;X=true}break;case "g":if(ta)continue;fa=true;W.g=N&&N.g&&N.g|0||N&&N|0||0;if(W.g<0)W.g=0;else if(W.g>255)W.g=255;if(p!=W.g){p=W.g;X=true}break;case "b":if(ta)continue;fa=true;W.b=N&&N.b&&N.b|0||N&&N|0||0;if(W.b<0)W.b=0;else if(W.b>255)W.b=255;if(w!=W.b){w=W.b;X=true}break;case "a":W.a=N&&N.a!=null?N.a|0:N!=null?N|0:255;if(W.a< -0)W.a=0;else if(W.a>255)W.a=255;if(C!=W.a){C=W.a;X=true}break;case "h":if(fa)continue;ta=true;W.h=N&&N.h&&N.h|0||N&&N|0||0;if(W.h<0)W.h=0;else if(W.h>360)W.h=360;if(v!=W.h){v=W.h;X=true}break;case "s":if(fa)continue;ta=true;W.s=N&&N.s!=null?N.s|0:N!=null?N|0:100;if(W.s<0)W.s=0;else if(W.s>100)W.s=100;if(L!=W.s){L=W.s;X=true}break;case "v":if(fa)continue;ta=true;W.v=N&&N.v!=null?N.v|0:N!=null?N|0:100;if(W.v<0)W.v=0;else if(W.v>100)W.v=100;if(Q!=W.v){Q=W.v;X=true}}if(X){if(fa){d=d||0;p=p||0;w=w||0; -N=s.rgbToHsv({r:d,g:p,b:w});v=N.h;L=N.s;Q=N.v}else if(ta){v=v||0;L=L!=null?L:100;Q=Q!=null?Q:100;N=s.hsvToRgb({h:v,s:L,v:Q});d=N.r;p=N.g;w=N.b}C=C!=null?C:255;H.call(g,ca||g)}}}};a.extend(true,g,{val:U,bind:function(R){a.isFunction(R)&&J.push(R)},unbind:function(R){if(a.isFunction(R))for(var N;(N=a.inArray(R,J))!=-1;)J.splice(N,1)},destroy:function(){J=null}});if(c)if(c.ahex!=null)U("ahex",c);else if(c.hex!=null)U((c.a!=null?"a":"")+"hex",c.a!=null?{ahex:c.hex+s.intToHex(c.a)}:c);else if(c.r!=null&& -c.g!=null&&c.b!=null)U("rgb"+(c.a!=null?"a":""),c);else if(c.h!=null&&c.s!=null&&c.v!=null)U("hsv"+(c.a!=null?"a":""),c)},ColorMethods:{hexToRgba:function(c){c=this.validateHex(c);if(c=="")return{r:null,g:null,b:null,a:null};var g="00",d="00",p="00",w="255";if(c.length==6)c+="ff";if(c.length>6){g=c.substring(0,2);d=c.substring(2,4);p=c.substring(4,6);w=c.substring(6,c.length)}else{if(c.length>4){g=c.substring(4,c.length);c=c.substring(0,4)}if(c.length>2){d=c.substring(2,c.length);c=c.substring(0, -2)}if(c.length>0)p=c.substring(0,c.length)}return{r:this.hexToInt(g),g:this.hexToInt(d),b:this.hexToInt(p),a:this.hexToInt(w)}},validateHex:function(c){if(typeof c=="object")return"";c=c.toLowerCase().replace(/[^a-f0-9]/g,"");if(c.length>8)c=c.substring(0,8);return c},rgbaToHex:function(c){return this.intToHex(c.r)+this.intToHex(c.g)+this.intToHex(c.b)+this.intToHex(c.a)},intToHex:function(c){c=(c|0).toString(16);if(c.length==1)c="0"+c;return c.toLowerCase()},hexToInt:function(c){return parseInt(c, -16)},rgbToHsv:function(c){var g=c.r/255,d=c.g/255;c=c.b/255;var p={h:0,s:0,v:0},w=0,C=0;if(g>=d&&g>=c){C=g;w=d>c?c:d}else if(d>=c&&d>=g){C=d;w=g>c?c:g}else{C=c;w=d>g?g:d}p.v=C;p.s=C?(C-w)/C:0;if(p.s){w=C-w;p.h=g==C?(d-c)/w:d==C?2+(c-g)/w:4+(g-d)/w;p.h=parseInt(p.h*60);if(p.h<0)p.h+=360}else p.h=0;p.s=p.s*100|0;p.v=p.v*100|0;return p},hsvToRgb:function(c){var g={r:0,g:0,b:0,a:100},d=c.h,p=c.s;c=c.v;if(p==0)g.r=c==0?g.g=g.b=0:g.g=g.b=c*255/100|0;else{if(d==360)d=0;d/=60;p/=100;c/=100;var w=d|0,C=d- -w;d=c*(1-p);var v=c*(1-p*C);p=c*(1-p*(1-C));switch(w){case 0:g.r=c;g.g=p;g.b=d;break;case 1:g.r=v;g.g=c;g.b=d;break;case 2:g.r=d;g.g=c;g.b=p;break;case 3:g.r=d;g.g=v;g.b=c;break;case 4:g.r=p;g.g=d;g.b=c;break;case 5:g.r=c;g.g=d;g.b=v}g.r=g.r*255|0;g.g=g.g*255|0;g.b=g.b*255|0}return g}}};var b=a.jPicker.Color,l=a.jPicker.List,s=a.jPicker.ColorMethods;a.fn.jPicker=function(c){var g=arguments;return this.each(function(){var d=this,p=a.extend(true,{},a.fn.jPicker.defaults,c);if(a(d).get(0).nodeName.toLowerCase()== -"input"){a.extend(true,p,{window:{bindToInput:true,expandable:true,input:a(d)}});if(a(d).val()==""){p.color.active=new b({hex:null});p.color.current=new b({hex:null})}else if(s.validateHex(a(d).val())){p.color.active=new b({hex:a(d).val(),a:p.color.active.val("a")});p.color.current=new b({hex:a(d).val(),a:p.color.active.val("a")})}}if(p.window.expandable)a(d).after('    '); -else p.window.liveUpdate=false;var w=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,C=null,v=null,L=null,Q=null,J=null,H=null,U=null,R=null,N=null,ca=null,la=null,X=null,W=null,fa=null,ta=null,ia=null,ka=null,Z=null,da=null,pa=null,oa=null,ma=null,na=null,Ja=null,Fa=null,Na=null,Sa=null,Ia=null,Ka=function(M){var P=ja.active,ba=P.val("hex"),Ca,Ma;p.color.mode=M;switch(M){case "h":setTimeout(function(){Ta.call(d,v,"transparent");Da.call(d,Q,0);ua.call(d,Q,100);Da.call(d, -J,260);ua.call(d,J,100);Ta.call(d,L,"transparent");Da.call(d,U,0);ua.call(d,U,100);Da.call(d,R,260);ua.call(d,R,100);Da.call(d,N,260);ua.call(d,N,100);Da.call(d,ca,260);ua.call(d,ca,100);Da.call(d,X,260);ua.call(d,X,100)},0);W.range("all",{minX:0,maxX:100,minY:0,maxY:100});fa.range("rangeY",{minY:0,maxY:360});if(P.val("ahex")==null)break;W.val("xy",{x:P.val("s"),y:100-P.val("v")},W);fa.val("y",360-P.val("h"),fa);break;case "s":setTimeout(function(){Ta.call(d,v,"transparent");Da.call(d,Q,-260);Da.call(d, -J,-520);Da.call(d,U,-260);Da.call(d,R,-520);Da.call(d,X,260);ua.call(d,X,100)},0);W.range("all",{minX:0,maxX:360,minY:0,maxY:100});fa.range("rangeY",{minY:0,maxY:100});if(P.val("ahex")==null)break;W.val("xy",{x:P.val("h"),y:100-P.val("v")},W);fa.val("y",100-P.val("s"),fa);break;case "v":setTimeout(function(){Ta.call(d,v,"000000");Da.call(d,Q,-780);Da.call(d,J,260);Ta.call(d,L,ba);Da.call(d,U,-520);Da.call(d,R,260);ua.call(d,R,100);Da.call(d,X,260);ua.call(d,X,100)},0);W.range("all",{minX:0,maxX:360, -minY:0,maxY:100});fa.range("rangeY",{minY:0,maxY:100});if(P.val("ahex")==null)break;W.val("xy",{x:P.val("h"),y:100-P.val("s")},W);fa.val("y",100-P.val("v"),fa);break;case "r":Ca=-1040;Ma=-780;W.range("all",{minX:0,maxX:255,minY:0,maxY:255});fa.range("rangeY",{minY:0,maxY:255});if(P.val("ahex")==null)break;W.val("xy",{x:P.val("b"),y:255-P.val("g")},W);fa.val("y",255-P.val("r"),fa);break;case "g":Ca=-1560;Ma=-1820;W.range("all",{minX:0,maxX:255,minY:0,maxY:255});fa.range("rangeY",{minY:0,maxY:255}); -if(P.val("ahex")==null)break;W.val("xy",{x:P.val("b"),y:255-P.val("r")},W);fa.val("y",255-P.val("g"),fa);break;case "b":Ca=-2080;Ma=-2860;W.range("all",{minX:0,maxX:255,minY:0,maxY:255});fa.range("rangeY",{minY:0,maxY:255});if(P.val("ahex")==null)break;W.val("xy",{x:P.val("r"),y:255-P.val("g")},W);fa.val("y",255-P.val("b"),fa);break;case "a":setTimeout(function(){Ta.call(d,v,"transparent");Da.call(d,Q,-260);Da.call(d,J,-520);Da.call(d,U,260);Da.call(d,R,260);ua.call(d,R,100);Da.call(d,X,0);ua.call(d, -X,100)},0);W.range("all",{minX:0,maxX:360,minY:0,maxY:100});fa.range("rangeY",{minY:0,maxY:255});if(P.val("ahex")==null)break;W.val("xy",{x:P.val("h"),y:100-P.val("v")},W);fa.val("y",255-P.val("a"),fa);break;default:throw"Invalid Mode";}switch(M){case "s":case "v":case "a":setTimeout(function(){ua.call(d,Q,100);ua.call(d,U,100);Da.call(d,N,260);ua.call(d,N,100);Da.call(d,ca,260);ua.call(d,ca,100)},0);break;case "r":case "g":case "b":setTimeout(function(){Ta.call(d,v,"transparent");Ta.call(d,L,"transparent"); -ua.call(d,U,100);ua.call(d,Q,100);Da.call(d,Q,Ca);Da.call(d,J,Ca-260);Da.call(d,U,Ma-780);Da.call(d,R,Ma-520);Da.call(d,N,Ma);Da.call(d,ca,Ma-260);Da.call(d,X,260);ua.call(d,X,100)},0)}P.val("ahex")!=null&&Ba.call(d,P)},Ba=function(M,P){if(P==null||P!=fa&&P!=W)wa.call(d,M,P);setTimeout(function(){kb.call(d,M);vb.call(d,M);cb.call(d,M)},0)},xa=function(M,P){var ba=ja.active;if(!(P!=W&&ba.val()==null)){var Ca=M.val("all");switch(p.color.mode){case "h":ba.val("sv",{s:Ca.x,v:100-Ca.y},P);break;case "s":case "a":ba.val("hv", -{h:Ca.x,v:100-Ca.y},P);break;case "v":ba.val("hs",{h:Ca.x,s:100-Ca.y},P);break;case "r":ba.val("gb",{g:255-Ca.y,b:Ca.x},P);break;case "g":ba.val("rb",{r:255-Ca.y,b:Ca.x},P);break;case "b":ba.val("rg",{r:Ca.x,g:255-Ca.y},P)}}},ra=function(M,P){var ba=ja.active;if(!(P!=fa&&ba.val()==null))switch(p.color.mode){case "h":ba.val("h",{h:360-M.val("y")},P);break;case "s":ba.val("s",{s:100-M.val("y")},P);break;case "v":ba.val("v",{v:100-M.val("y")},P);break;case "r":ba.val("r",{r:255-M.val("y")},P);break; -case "g":ba.val("g",{g:255-M.val("y")},P);break;case "b":ba.val("b",{b:255-M.val("y")},P);break;case "a":ba.val("a",255-M.val("y"),P)}},wa=function(M,P){if(P!=W)switch(p.color.mode){case "h":var ba=M.val("sv");W.val("xy",{x:ba!=null?ba.s:100,y:100-(ba!=null?ba.v:100)},P);break;case "s":case "a":ba=M.val("hv");W.val("xy",{x:ba&&ba.h||0,y:100-(ba!=null?ba.v:100)},P);break;case "v":ba=M.val("hs");W.val("xy",{x:ba&&ba.h||0,y:100-(ba!=null?ba.s:100)},P);break;case "r":ba=M.val("bg");W.val("xy",{x:ba&& -ba.b||0,y:255-(ba&&ba.g||0)},P);break;case "g":ba=M.val("br");W.val("xy",{x:ba&&ba.b||0,y:255-(ba&&ba.r||0)},P);break;case "b":ba=M.val("rg");W.val("xy",{x:ba&&ba.r||0,y:255-(ba&&ba.g||0)},P)}if(P!=fa)switch(p.color.mode){case "h":fa.val("y",360-(M.val("h")||0),P);break;case "s":ba=M.val("s");fa.val("y",100-(ba!=null?ba:100),P);break;case "v":ba=M.val("v");fa.val("y",100-(ba!=null?ba:100),P);break;case "r":fa.val("y",255-(M.val("r")||0),P);break;case "g":fa.val("y",255-(M.val("g")||0),P);break;case "b":fa.val("y", -255-(M.val("b")||0),P);break;case "a":ba=M.val("a");fa.val("y",255-(ba!=null?ba:255),P)}},kb=function(M){try{var P=M.val("all");pa.css({backgroundColor:P&&"#"+P.hex||"transparent"});ua.call(d,pa,P&&Math.precision(P.a*100/255,4)||0)}catch(ba){}},vb=function(M){switch(p.color.mode){case "h":Ta.call(d,v,(new b({h:M.val("h")||0,s:100,v:100})).val("hex"));break;case "s":case "a":var P=M.val("s");ua.call(d,J,100-(P!=null?P:100));break;case "v":P=M.val("v");ua.call(d,Q,P!=null?P:100);break;case "r":ua.call(d, -J,Math.precision((M.val("r")||0)/255*100,4));break;case "g":ua.call(d,J,Math.precision((M.val("g")||0)/255*100,4));break;case "b":ua.call(d,J,Math.precision((M.val("b")||0)/255*100))}M=M.val("a");ua.call(d,H,Math.precision((255-(M||0))*100/255,4))},cb=function(M){switch(p.color.mode){case "h":var P=M.val("a");ua.call(d,la,Math.precision((255-(P||0))*100/255,4));break;case "s":P=M.val("hva");var ba=new b({h:P&&P.h||0,s:100,v:P!=null?P.v:100});Ta.call(d,L,ba.val("hex"));ua.call(d,R,100-(P!=null?P.v: -100));ua.call(d,la,Math.precision((255-(P&&P.a||0))*100/255,4));break;case "v":P=M.val("hsa");ba=new b({h:P&&P.h||0,s:P!=null?P.s:100,v:100});Ta.call(d,L,ba.val("hex"));ua.call(d,la,Math.precision((255-(P&&P.a||0))*100/255,4));break;case "r":case "g":case "b":ba=P=0;M=M.val("rgba");if(p.color.mode=="r"){P=M&&M.b||0;ba=M&&M.g||0}else if(p.color.mode=="g"){P=M&&M.b||0;ba=M&&M.r||0}else if(p.color.mode=="b"){P=M&&M.r||0;ba=M&&M.g||0}var Ca=ba>P?P:ba;ua.call(d,R,P>ba?Math.precision((P-ba)/(255-ba)*100, -4):0);ua.call(d,N,ba>P?Math.precision((ba-P)/(255-P)*100,4):0);ua.call(d,ca,Math.precision(Ca/255*100,4));ua.call(d,la,Math.precision((255-(M&&M.a||0))*100/255,4));break;case "a":P=M.val("a");Ta.call(d,L,M.val("hex")||"000000");ua.call(d,la,P!=null?0:100);ua.call(d,X,P!=null?100:0)}},Ta=function(M,P){M.css({backgroundColor:P&&P.length==6&&"#"+P||"transparent"})},Va=function(M,P){if(w&&(P.indexOf("AlphaBar.png")!=-1||P.indexOf("Bars.png")!=-1||P.indexOf("Maps.png")!=-1)){M.attr("pngSrc",P);M.css({backgroundImage:"none", -filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+P+"', sizingMethod='scale')"})}else M.css({backgroundImage:"url('"+P+"')"})},Da=function(M,P){M.css({top:P+"px"})},ua=function(M,P){M.css({visibility:P>0?"visible":"hidden"});if(P>0&&P<100)if(w){var ba=M.attr("pngSrc");ba!=null&&(ba.indexOf("AlphaBar.png")!=-1||ba.indexOf("Bars.png")!=-1||ba.indexOf("Maps.png")!=-1)?M.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ba+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+ -P+")"}):M.css({opacity:Math.precision(P/100,4)})}else M.css({opacity:Math.precision(P/100,4)});else if(P==0||P==100)if(w){ba=M.attr("pngSrc");ba!=null&&(ba.indexOf("AlphaBar.png")!=-1||ba.indexOf("Bars.png")!=-1||ba.indexOf("Maps.png")!=-1)?M.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ba+"', sizingMethod='scale')"}):M.css({opacity:""})}else M.css({opacity:""})},$a=function(){ja.active.val("ahex",ja.current.val("ahex"))},Ga=function(){ja.current.val("ahex",ja.active.val("ahex"))}, -Ra=function(M){a(this).parents("tbody:first").find('input:radio[value!="'+M.target.value+'"]').removeAttr("checked");Ka.call(d,M.target.value)},Ea=function(){$a.call(d)},db=function(){$a.call(d);p.window.expandable&&fb.call(d);a.isFunction(ob)&&ob.call(d,ja.active,na)},lb=function(){Ga.call(d);p.window.expandable&&fb.call(d);a.isFunction(ib)&&ib.call(d,ja.active,ma)},Ua=function(){pb.call(d)},Xa=function(M){var P=M.val("hex");oa.css({backgroundColor:P&&"#"+P||"transparent"});ua.call(d,oa,Math.precision((M.val("a")|| -0)*100/255,4))},wb=function(M){var P=M.val("hex");M=M.val("va");Fa.css({backgroundColor:P&&"#"+P||"transparent"});ua.call(d,Na,Math.precision((255-(M&&M.a||0))*100/255,4));if(p.window.bindToInput&&p.window.updateInputColor)p.window.input.css({backgroundColor:P&&"#"+P||"transparent",color:M==null||M.v>75?"#000000":"#ffffff"})},sa=function(M){ia=parseInt(C.css("left"));ka=parseInt(C.css("top"));Z=M.pageX;da=M.pageY;a(document).bind("mousemove",hb).bind("mouseup",eb);M.preventDefault()},hb=function(M){C.css({left:ia- -(Z-M.pageX)+"px",top:ka-(da-M.pageY)+"px"});p.window.expandable&&!a.support.boxModel&&C.prev().css({left:C.css("left"),top:C.css("top")});M.stopPropagation();M.preventDefault();return false},eb=function(M){a(document).unbind("mousemove",hb).unbind("mouseup",eb);M.stopPropagation();M.preventDefault();return false},sb=function(M){M.preventDefault();M.stopPropagation();ja.active.val("ahex",a(this).attr("title")||null,M.target);return false},ib=a.isFunction(g[1])&&g[1]||null,ab=a.isFunction(g[2])&&g[2]|| -null,ob=a.isFunction(g[3])&&g[3]||null,pb=function(){ja.current.val("ahex",ja.active.val("ahex"));var M=function(){if(!(!p.window.expandable||a.support.boxModel)){var P=C.find("table:first");C.before("