├── campus
├── __init__.py
├── wsgi.py
├── urls.py
└── settings.py
├── website
├── __init__.py
├── migrations
│ └── __init__.py
├── models.py
├── tests.py
├── admin.py
├── static
│ ├── img
│ │ ├── mac.png
│ │ ├── favicon.ico
│ │ └── favicon.png
│ ├── css
│ │ ├── site.css
│ │ └── typeaheadjs.css
│ └── js
│ │ ├── hostnames.js
│ │ ├── app.js
│ │ ├── awesomplete.js
│ │ ├── typeahead.bundle.min.js
│ │ └── tippy.all.min.js
├── apps.py
├── map.py
├── urls.py
├── utility
│ ├── script.py
│ ├── zone3.csv
│ └── zone2.csv
├── zone3.csv
├── views.py
├── templates
│ ├── hostnames.html
│ ├── edit_map.html
│ └── map.html
└── zone2.csv
├── start.sh
├── screenshots
├── app_screenshot.png
└── views_screenshot.png
├── requirements.txt
├── uwsgi.ini
├── campus.service
├── manage.py
├── nginx.conf
├── campus.conf
├── LICENSE
├── README.md
├── .gitignore
└── CODE_OF_CONDUCT.md
/campus/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/website/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/website/migrations/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/start.sh:
--------------------------------------------------------------------------------
1 | sleep 30
2 | source env/bin/activate
3 | ./manage.py runserver 0.0.0.0:8000
--------------------------------------------------------------------------------
/website/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/website/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/website/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/website/static/img/mac.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexEzzeddine/campus42/HEAD/website/static/img/mac.png
--------------------------------------------------------------------------------
/screenshots/app_screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexEzzeddine/campus42/HEAD/screenshots/app_screenshot.png
--------------------------------------------------------------------------------
/website/static/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexEzzeddine/campus42/HEAD/website/static/img/favicon.ico
--------------------------------------------------------------------------------
/website/static/img/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexEzzeddine/campus42/HEAD/website/static/img/favicon.png
--------------------------------------------------------------------------------
/screenshots/views_screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexEzzeddine/campus42/HEAD/screenshots/views_screenshot.png
--------------------------------------------------------------------------------
/website/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class WebsiteConfig(AppConfig):
5 | name = 'website'
6 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | certifi==2017.11.5
2 | chardet==3.0.4
3 | Django==1.11.23
4 | idna==2.6
5 | pytz==2017.3
6 | requests==2.18.4
7 | urllib3==1.22
8 |
--------------------------------------------------------------------------------
/website/map.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 | school_map = {"zone2": [], "zone3": []}
4 |
5 | with open('website/map.json', 'r') as jsonfile:
6 | school_map = json.loads(jsonfile.read())
--------------------------------------------------------------------------------
/uwsgi.ini:
--------------------------------------------------------------------------------
1 | [uwsgi]
2 | socket = /tmp/campus.sock
3 | chmod-socket = 666
4 | chdir = /root/campus
5 | module = campus.wsgi
6 | enable-threads = true
7 | vacuum = true
8 | die-on-term = true
9 | master = 1
10 | logto = /root/campus/logs/uwsgi.log
11 |
--------------------------------------------------------------------------------
/campus.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=uWSGI instance to serve campus website
3 | After=network.target
4 |
5 | [Service]
6 | WorkingDirectory=/root/campus
7 | ExecStart=/usr/local/bin/uwsgi uwsgi.ini
8 | KillSignal=SIGINT
9 | Restart=always
10 | Type=notify
11 |
12 | [Install]
13 | WantedBy=multi-user.target
14 |
--------------------------------------------------------------------------------
/campus/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for campus project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "campus.settings")
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------
/website/urls.py:
--------------------------------------------------------------------------------
1 | from django.conf.urls import url
2 |
3 | from . import views
4 |
5 | urlpatterns = [
6 | url(r'^$', views.index, name='index'),
7 | url(r'^edit_map$', views.edit_map, name='edit_map'),
8 | url(r'^save_map$', views.save_map, name='save_map'),
9 | url(r'^get_active_users$', views.get_active_users, name='get_active_users'),
10 | url(r'^update_users$', views.update_users, name='update_users'),
11 | url(r'^hostnames$', views.show_hostnames, name='show_hostnames'),
12 | ]
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | import sys
4 |
5 | if __name__ == "__main__":
6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "campus.settings")
7 | try:
8 | from django.core.management import execute_from_command_line
9 | except ImportError:
10 | # The above import may fail for some other reason. Ensure that the
11 | # issue is really that Django is missing to avoid masking other
12 | # exceptions on Python 2.
13 | try:
14 | import django
15 | except ImportError:
16 | raise ImportError(
17 | "Couldn't import Django. Are you sure it's installed and "
18 | "available on your PYTHONPATH environment variable? Did you "
19 | "forget to activate a virtual environment?"
20 | )
21 | raise
22 | execute_from_command_line(sys.argv)
23 |
--------------------------------------------------------------------------------
/nginx.conf:
--------------------------------------------------------------------------------
1 | # nginx.conf
2 | upstream django {
3 | # connect to this socket
4 | server unix:///tmp/uwsgi.sock; # for a file socket
5 | # server 127.0.0.1:8001; # for a web port socket
6 | }
7 |
8 | server {
9 | # the port your site will be served on
10 | listen 80;
11 | # the domain name it will serve for
12 | server_name campus.42.us.org; # substitute your machine's IP address or FQDN
13 | charset utf-8;
14 |
15 | #Max upload size
16 | client_max_body_size 75M; # adjust to taste
17 |
18 | location /static {
19 | root /static; # your Django project's static files
20 | }
21 |
22 | # Finally, send all non-media requests to the Django server.
23 | location / {
24 | uwsgi_pass django;
25 | include ~/.brew/etc/nginx/uwsgi_params; # or the uwsgi_params you installed manually
26 | }
27 | }
--------------------------------------------------------------------------------
/campus/urls.py:
--------------------------------------------------------------------------------
1 | """campus URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/1.11/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.conf.urls import url, include
14 | 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
15 | """
16 | from django.conf.urls import url, include
17 | from django.contrib import admin
18 |
19 | urlpatterns = [
20 | url(r'^', include('website.urls')),
21 | url(r'^admin/', admin.site.urls),
22 | ]
23 |
--------------------------------------------------------------------------------
/campus.conf:
--------------------------------------------------------------------------------
1 | # nginx.conf
2 | upstream django {
3 | # connect to this socket
4 | server unix:///tmp/campus.sock; # for a file socket
5 | # server 127.0.0.1:8001; # for a web port socket
6 | }
7 |
8 | server {
9 | # the port your site will be served on
10 | listen 80;
11 | # the domain name it will serve for
12 | server_name campus.42.us.org; # substitute your machine's IP address or FQDN
13 | charset utf-8;
14 |
15 | #Max upload size
16 | client_max_body_size 75M; # adjust to taste
17 |
18 | location /static {
19 | root /root/campus/website/; # your Django project's static files
20 | }
21 |
22 | # Finally, send all non-media requests to the Django server.
23 | location / {
24 | uwsgi_pass django;
25 | include /etc/nginx/uwsgi_params; # or the uwsgi_params you installed manually
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/website/utility/script.py:
--------------------------------------------------------------------------------
1 | import csv, json
2 |
3 | school_map = {}
4 |
5 | with open('zone2.csv', 'r') as csvfile:
6 | mapreader = csv.reader(csvfile, delimiter=',', quotechar='|')
7 | zone = []
8 | for row in mapreader:
9 | zone.append([x for x in row])
10 | school_map["zone2"] = zone
11 |
12 | with open('zone3.csv', 'r') as csvfile:
13 | mapreader = csv.reader(csvfile, delimiter=',', quotechar='|')
14 | zone = []
15 | for row in mapreader:
16 | zone.append([x for x in row])
17 | school_map["zone3"] = zone
18 |
19 | json_map = {}
20 |
21 | for zone in school_map:
22 | json_map[zone] = []
23 | for row in school_map[zone]:
24 | new_row = []
25 | for cell in row:
26 | if cell == "0":
27 | item = {"type": "empty"}
28 | elif cell == "2":
29 | item = {"type": "table"}
30 | else:
31 | item = {"type": "computer", "host": cell}
32 | new_row.append(item)
33 | json_map[zone].append(new_row)
34 |
35 | print(json.dumps(json_map))
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Alex Ezzeddine
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 |
--------------------------------------------------------------------------------
/website/static/css/site.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #505050;
3 | padding-top: 56px;
4 | width: 100%;
5 | height: 100%;
6 | }
7 |
8 | nav {
9 | box-shadow: 0px 0px 5px 3px;
10 | }
11 |
12 | .zone-map {
13 | margin: auto;
14 | box-shadow: 0px 0px 75px 20px;
15 | }
16 |
17 | td {
18 | border: 1px solid #e4e4e4;
19 | }
20 |
21 | .cell {
22 | width: 40px;
23 | height: 40px;
24 | }
25 |
26 | .done {
27 | background-color: red;
28 | }
29 |
30 | .empty {
31 | background-color: white;
32 | }
33 |
34 | .desk {
35 | background-color: grey;
36 | }
37 |
38 | .computer {
39 | background-image: url("/static/img/mac.png");
40 | background-repeat: no-repeat;
41 | background-position: center center;
42 | background-size: 80%;
43 | }
44 |
45 | .user {
46 | background-size: cover;
47 | }
48 |
49 | main {
50 | width: 100%;
51 | height: 100%;
52 | }
53 |
54 | .loader {
55 | border: 16px solid #f3f3f3; /* Light grey */
56 | border-top: 16px solid #3498db; /* Blue */
57 | border-radius: 50%;
58 | width: 120px;
59 | height: 120px;
60 | animation: spin 2s linear infinite;
61 | }
62 |
63 | @keyframes spin {
64 | 0% { transform: rotate(0deg); }
65 | 100% { transform: rotate(360deg); }
66 | }
67 |
68 | footer {
69 | padding: 3px 11px;
70 | position: fixed;
71 | bottom: 1%;
72 | right: 1%;
73 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 42 Campus
2 | 42 Campus
3 | (available only inside the 42 network) is a website that allows 42 Silicon Valley students to find each other on the map. It is written in Python Django and uses 42 API to access users locations.
4 |
5 | 
6 |
7 | ## Requirements
8 | You will need to have *Python 3* and *pip 3* installed to run this project.
9 |
10 | **Also you will need to create a [42 Intra Application](https://profile.intra.42.fr/oauth/applications/new) and copy your application ID and application Secret into corresponding variables in the top of the `/website/views.py`**:
11 |
12 |
13 |
14 | ## Installation
15 | ```bash
16 | git clone https://github.com/AlexEzzeddine/campus42.git campus # clone the repo
17 | cd campus
18 | python3 -m venv --prompt campus env # create virtual environment
19 | source env/bin/activate # enable virtual environment
20 | pip install -r requirements.txt # install dependencies
21 | ```
22 | ## Usage
23 |
24 | Run a server with:
25 |
26 | ```bash
27 | ./manage.py runserver
28 | ```
29 |
30 | or
31 |
32 | ```bash
33 | ./manage.py runserver -s 0:port
34 | ```
35 |
36 | where `0` is a shortcut for `0.0.0.0` to make your website publicly available and `port` is a desired port number
37 |
38 | Now you can access the website at `localhost:8000`
39 |
40 | When you are done:
41 |
42 | 1. Press `Ctrl + C` to stop the server.
43 |
44 | 2. Type `deactivate` in your shell to disable virtual environment.
45 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | *.egg-info/
24 | .installed.cfg
25 | *.egg
26 | MANIFEST
27 |
28 | # PyInstaller
29 | # Usually these files are written by a python script from a template
30 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
31 | *.manifest
32 | *.spec
33 |
34 | # Installer logs
35 | pip-log.txt
36 | pip-delete-this-directory.txt
37 |
38 | # Unit test / coverage reports
39 | htmlcov/
40 | .tox/
41 | .coverage
42 | .coverage.*
43 | .cache
44 | nosetests.xml
45 | coverage.xml
46 | *.cover
47 | .hypothesis/
48 | .pytest_cache/
49 |
50 | # Translations
51 | *.mo
52 | *.pot
53 |
54 | # Django stuff:
55 | *.log
56 | .static_storage/
57 | .media/
58 | local_settings.py
59 |
60 | # Flask stuff:
61 | instance/
62 | .webassets-cache
63 |
64 | # Scrapy stuff:
65 | .scrapy
66 |
67 | # Sphinx documentation
68 | docs/_build/
69 |
70 | # PyBuilder
71 | target/
72 |
73 | # Jupyter Notebook
74 | .ipynb_checkpoints
75 |
76 | # pyenv
77 | .python-version
78 |
79 | # celery beat schedule file
80 | celerybeat-schedule
81 |
82 | # SageMath parsed files
83 | *.sage.py
84 |
85 | # Environments
86 | .env
87 | .venv
88 | env/
89 | venv/
90 | ENV/
91 | env.bak/
92 | venv.bak/
93 |
94 | # Spyder project settings
95 | .spyderproject
96 | .spyproject
97 |
98 | # Rope project settings
99 | .ropeproject
100 |
101 | # mkdocs documentation
102 | /site
103 |
104 | # mypy
105 | .mypy_cache/
106 |
107 | # Trash
108 | .DS_Store
109 |
--------------------------------------------------------------------------------
/website/zone3.csv:
--------------------------------------------------------------------------------
1 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2 | 0,0,0,0,0,e1z3r2p9,e1z3r2p11,e1z3r2p13,e1z3r2p15,0,e1z3r4p9,e1z3r4p11,e1z3r4p13,e1z3r4p15,e1z3r4p17,0,e1z3r6p9,e1z3r6p11,e1z3r6p13,e1z3r6p15,e1z3r6p17,0,e1z3r8p9,e1z3r8p11,e1z3r8p13,e1z3r8p15,e1z3r8p17,0,2,2,0
3 | 0,0,0,0,2,e1z3r2p8,0,e1z3r2p16,e1z3r2p17,0,e1z3r4p7,e1z3r4p8,0,e1z3r4p18,e1z3r4p19,0,e1z3r6p7,e1z3r6p8,0,e1z3r6p18,e1z3r6p19,0,e1z3r8p7,e1z3r8p8,0,e1z3r8p18,e1z3r8p19,0,e1z3r10p8,e1z3r10p7,0
4 | 0,0,0,0,e1z3r2p5,e1z3r2p6,0,e1z3r2p18,e1z3r2p19,0,e1z3r4p5,e1z3r4p6,0,e1z3r4p20,e1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 | 0,e1z3r1p4,e1z3r1p5,0,e1z3r1p19,e1z3r1p20,0,e1z3r3p6,e1z3r3p5,0,e1z3r3p21,e1z3r3p22,0,e1z3r5p6,e1z3r5p5,0,e1z3r5p21,e1z3r5p22,0,e1z3r7p6,e1z3r7p5,0,e1z3r7p21,e1z3r7p22,0,e1z3r9p6,e1z3r9p5,0,e1z3r9p21,e1z3r9p22,0
12 | 0,e1z3r1p6,e1z3r1p7,0,e1z3r1p17,e1z3r1p18,0,e1z3r3p8,e1z3r3p7,0,e1z3r3p19,e1z3r3p20,0,e1z3r5p8,e1z3r5p7,0,e1z3r5p19,e1z3r5p20,0,e1z3r7p8,e1z3r7p7,0,e1z3r7p19,e1z3r7p20,0,e1z3r9p8,e1z3r9p7,0,e1z3r9p19,e1z3r9p20,0
13 | 0,e1z3r1p8,e1z3r1p10,e1z3r1p12,e1z3r1p14,e1z3r1p16,0,e1z3r3p10,e1z3r3p12,e1z3r3p14,e1z3r3p16,e1z3r3p18,0,e1z3r5p10,e1z3r5p12,e1z3r5p14,e1z3r5p16,e1z3r5p18,0,e1z3r7p10,e1z3r7p12,e1z3r7p14,e1z3r7p16,e1z3r7p18,0,e1z3r9p10,e1z3r9p12,e1z3r9p14,e1z3r9p16,e1z3r9p18,0
14 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
--------------------------------------------------------------------------------
/website/utility/zone3.csv:
--------------------------------------------------------------------------------
1 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2 | 0,0,0,0,0,e1z3r2p9,e1z3r2p11,e1z3r2p13,e1z3r2p15,0,e1z3r4p9,e1z3r4p11,e1z3r4p13,e1z3r4p15,e1z3r4p17,0,e1z3r6p9,e1z3r6p11,e1z3r6p13,e1z3r6p15,e1z3r6p17,0,e1z3r8p9,e1z3r8p11,e1z3r8p13,e1z3r8p15,e1z3r8p17,0,2,2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e1z3r7p1,0,e1z3r7p25,e1z3r7p26,0,e1z3r9p2,e1z3r9p1,0,e1z3r9p25,e1z3r9p26,0
10 | 0,2,e1z3r1p3,0,e1z3r1p21,e1z3r1p22,0,e1z3r3p4,e1z3r3p3,0,e1z3r3p23,e1z3r3p24,0,e1z3r5p4,e1z3r5p3,0,e1z3r5p23,e1z3r5p24,0,e1z3r7p4,e1z3r7p3,0,e1z3r7p23,e1z3r7p24,0,e1z3r9p4,e1z3r9p3,0,e1z3r9p23,e1z3r9p24,0
11 | 0,e1z3r1p4,e1z3r1p5,0,e1z3r1p19,e1z3r1p20,0,e1z3r3p6,e1z3r3p5,0,e1z3r3p21,e1z3r3p22,0,e1z3r5p6,e1z3r5p5,0,e1z3r5p21,e1z3r5p22,0,e1z3r7p6,e1z3r7p5,0,e1z3r7p21,e1z3r7p22,0,e1z3r9p6,e1z3r9p5,0,e1z3r9p21,e1z3r9p22,0
12 | 0,e1z3r1p6,e1z3r1p7,0,e1z3r1p17,e1z3r1p18,0,e1z3r3p8,e1z3r3p7,0,e1z3r3p19,e1z3r3p20,0,e1z3r5p8,e1z3r5p7,0,e1z3r5p19,e1z3r5p20,0,e1z3r7p8,e1z3r7p7,0,e1z3r7p19,e1z3r7p20,0,e1z3r9p8,e1z3r9p7,0,e1z3r9p19,e1z3r9p20,0
13 | 0,e1z3r1p8,e1z3r1p10,e1z3r1p12,e1z3r1p14,e1z3r1p16,0,e1z3r3p10,e1z3r3p12,e1z3r3p14,e1z3r3p16,e1z3r3p18,0,e1z3r5p10,e1z3r5p12,e1z3r5p14,e1z3r5p16,e1z3r5p18,0,e1z3r7p10,e1z3r7p12,e1z3r7p14,e1z3r7p16,e1z3r7p18,0,e1z3r9p10,e1z3r9p12,e1z3r9p14,e1z3r9p16,e1z3r9p18,0
14 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
--------------------------------------------------------------------------------
/website/static/css/typeaheadjs.css:
--------------------------------------------------------------------------------
1 | span.twitter-typeahead .tt-menu,
2 | span.twitter-typeahead .tt-dropdown-menu {
3 | cursor: pointer;
4 | position: absolute;
5 | top: 100%;
6 | left: 0;
7 | z-index: 1000;
8 | display: none;
9 | float: left;
10 | /*min-width: 160px;*/
11 | padding: 5px 0;
12 | margin: 2px 0 0;
13 | list-style: none;
14 | font-size: 14px;
15 | text-align: left;
16 | background-color: #ffffff;
17 | border: 1px solid #cccccc;
18 | border: 1px solid rgba(0, 0, 0, 0.15);
19 | border-radius: 4px;
20 | -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
21 | box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
22 | background-clip: padding-box;
23 | }
24 | span.twitter-typeahead .tt-suggestion {
25 | display: block;
26 | padding: 3px 20px;
27 | clear: both;
28 | font-weight: normal;
29 | line-height: 1.42857143;
30 | color: #333333;
31 | white-space: nowrap;
32 | }
33 | span.twitter-typeahead .tt-suggestion.tt-cursor,
34 | span.twitter-typeahead .tt-suggestion:hover,
35 | span.twitter-typeahead .tt-suggestion:focus {
36 | color: #ffffff;
37 | text-decoration: none;
38 | outline: 0;
39 | background-color: #337ab7;
40 | }
41 | .input-group.input-group-lg span.twitter-typeahead .form-control {
42 | height: 46px;
43 | padding: 10px 16px;
44 | font-size: 18px;
45 | line-height: 1.3333333;
46 | border-radius: 6px;
47 | }
48 | .input-group.input-group-sm span.twitter-typeahead .form-control {
49 | height: 30px;
50 | padding: 5px 10px;
51 | font-size: 12px;
52 | line-height: 1.5;
53 | border-radius: 3px;
54 | }
55 |
56 | /*.input-group span.twitter-typeahead .tt-menu,
57 | .input-group span.twitter-typeahead .tt-dropdown-menu {
58 | top: 32px !important;
59 | }*/
60 | .input-group span.twitter-typeahead:not(:first-child):not(:last-child) .form-control {
61 | border-radius: 0;
62 | }
63 | .input-group span.twitter-typeahead:first-child .form-control {
64 | border-top-left-radius: 4px;
65 | border-bottom-left-radius: 4px;
66 | border-top-right-radius: 0;
67 | border-bottom-right-radius: 0;
68 | }
69 | .input-group span.twitter-typeahead:last-child .form-control {
70 | border-top-left-radius: 0;
71 | border-bottom-left-radius: 0;
72 | border-top-right-radius: 4px;
73 | border-bottom-right-radius: 4px;
74 | }
75 | /*.input-group.input-group-sm span.twitter-typeahead {
76 | height: 30px;
77 | }*/
78 | .input-group.input-group-sm span.twitter-typeahead .tt-menu,
79 | .input-group.input-group-sm span.twitter-typeahead .tt-dropdown-menu {
80 | top: 30px !important;
81 | }
82 | /*.input-group.input-group-lg span.twitter-typeahead {
83 | height: 46px;
84 | }*/
85 | .input-group.input-group-lg span.twitter-typeahead .tt-menu,
86 | .input-group.input-group-lg span.twitter-typeahead .tt-dropdown-menu {
87 | top: 46px !important;
88 | }
89 |
--------------------------------------------------------------------------------
/website/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import render
2 |
3 | from website.map import school_map
4 |
5 | from django.views.decorators.csrf import csrf_exempt
6 | from django.http import HttpResponse
7 | from collections import defaultdict
8 | import threading
9 | import requests
10 | import copy
11 | import json
12 | import sched, time
13 | requests.packages.urllib3.disable_warnings()
14 |
15 | INTRA_API_ROUTE = "https://api.intra.42.fr/v2/"
16 | token = None
17 | token_expires_at = int(time.time())
18 | active_users = None
19 | client_id = "Insert 42 application id here"
20 | client_secret = "Insert 42 application secret here"
21 |
22 | def get_token():
23 | global token
24 | global token_expires_at
25 | response = requests.post("https://api.intra.42.fr/oauth/token",
26 | data = {'grant_type': 'client_credentials', 'client_id': client_id, 'client_secret': client_secret},
27 | verify = False)
28 | print(response.text)
29 | token_data = response.json()
30 | token = token_data["access_token"]
31 | token_expires_at = int(time.time()) + token_data["expires_in"]
32 |
33 | def parse_users(users):
34 | return [{"host": user["host"], "login": user["user"]["login"], "value": user["user"]["login"]} for user in users]
35 |
36 | def update_users():
37 | print("Updating Active Users...")
38 | global active_users
39 | if not token or token_expires_at < int(time.time()):
40 | get_token()
41 | url = INTRA_API_ROUTE + "campus/7/locations?access_token=%s&filter[active]=true" % (token)
42 | response = requests.get(url)
43 | if response.ok:
44 | result = response.json()
45 | while("next" in response.links):
46 | url = response.links["next"]["url"]
47 | response = requests.get(url)
48 | result += response.json()
49 | active_users = parse_users(result)
50 | print("finished updating Active Users...")
51 | else:
52 | print("error updating Active Users...")
53 |
54 | def index(request):
55 | return render(request, 'map.html', {'map': school_map})
56 |
57 |
58 | def show_hostnames(request):
59 | return render(request, 'hostnames.html', {'map': school_map})
60 |
61 | def get_active_users(request):
62 | return HttpResponse(json.dumps(active_users), content_type="application/json")
63 |
64 | import csv
65 |
66 | def edit_map(request):
67 | return render(request, 'edit_map.html', {'map': school_map})
68 |
69 | @csrf_exempt
70 | def save_map(request):
71 | global school_map
72 | school_map = json.loads(request.body)
73 | with open('website/new.csv', 'w') as csvfile:
74 | mapwriter = csv.writer(csvfile, delimiter=',', quotechar='|')
75 | for row in school_map:
76 | mapwriter.writerow(row)
77 | print(school_map)
78 | return HttpResponse()
79 |
80 | def active_users_job():
81 | while True:
82 | try:
83 | update_users()
84 | except Exception as e:
85 | print(e)
86 | time.sleep(60)
87 |
88 | #read_map()
89 | threading.Thread(target=active_users_job, args=()).start()
90 |
--------------------------------------------------------------------------------
/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 contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at alex.izzedin@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/campus/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for campus project.
3 |
4 | Generated by 'django-admin startproject' using Django 1.11.7.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/1.11/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/1.11/ref/settings/
11 | """
12 |
13 | import os
14 |
15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 |
18 | # Quick-start development settings - unsuitable for production
19 | # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
20 |
21 | # SECURITY WARNING: keep the secret key used in production secret!
22 | SECRET_KEY = 'u1*_g6qarbe^2=$h-boauk3%4x%xbsilm=mb_lrv45ai1okgkl'
23 |
24 | # SECURITY WARNING: don't run with debug turned on in production!
25 | DEBUG = True
26 |
27 | ALLOWED_HOSTS = ['*']
28 |
29 |
30 | # Application definition
31 |
32 | INSTALLED_APPS = [
33 | 'website',
34 | 'django.contrib.admin',
35 | 'django.contrib.auth',
36 | 'django.contrib.contenttypes',
37 | 'django.contrib.sessions',
38 | 'django.contrib.messages',
39 | 'django.contrib.staticfiles',
40 | ]
41 |
42 | MIDDLEWARE = [
43 | 'django.middleware.security.SecurityMiddleware',
44 | 'django.contrib.sessions.middleware.SessionMiddleware',
45 | 'django.middleware.common.CommonMiddleware',
46 | 'django.middleware.csrf.CsrfViewMiddleware',
47 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
48 | 'django.contrib.messages.middleware.MessageMiddleware',
49 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
50 | ]
51 |
52 | ROOT_URLCONF = 'campus.urls'
53 |
54 | TEMPLATES = [
55 | {
56 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
57 | 'DIRS': [],
58 | 'APP_DIRS': True,
59 | 'OPTIONS': {
60 | 'context_processors': [
61 | 'django.template.context_processors.debug',
62 | 'django.template.context_processors.request',
63 | 'django.contrib.auth.context_processors.auth',
64 | 'django.contrib.messages.context_processors.messages',
65 | ],
66 | },
67 | },
68 | ]
69 |
70 | WSGI_APPLICATION = 'campus.wsgi.application'
71 |
72 |
73 | # Database
74 | # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
75 |
76 | DATABASES = {
77 | # 'default': {
78 | # 'ENGINE': 'django.db.backends.sqlite3',
79 | # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
80 | # }
81 | }
82 |
83 |
84 | # Password validation
85 | # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
86 |
87 | AUTH_PASSWORD_VALIDATORS = [
88 | {
89 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
90 | },
91 | {
92 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
93 | },
94 | {
95 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
96 | },
97 | {
98 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
99 | },
100 | ]
101 |
102 |
103 | # Internationalization
104 | # https://docs.djangoproject.com/en/1.11/topics/i18n/
105 |
106 | LANGUAGE_CODE = 'en-us'
107 |
108 | TIME_ZONE = 'America/Los_Angeles'
109 |
110 | USE_I18N = True
111 |
112 | USE_L10N = True
113 |
114 | USE_TZ = True
115 |
116 |
117 | # Static files (CSS, JavaScript, Images)
118 | # https://docs.djangoproject.com/en/1.11/howto/static-files/
119 |
120 | STATIC_URL = '/static/'
121 |
--------------------------------------------------------------------------------
/website/templates/hostnames.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 |
7 |
8 | Campus 42
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
44 |
45 |
46 |
47 | {% for zone_name, zone in map.items %}
48 |
49 |
50 | {% for row in zone %}
51 |
52 | {% for cell in row %}
53 | {% if cell.type == "empty" %}
54 | |
55 |
56 | |
57 | {% elif cell.type == "table" %}
58 |
59 |
60 | |
61 | {% else %}
62 |
63 |
64 | |
65 | {% endif %}
66 | {% endfor %}
67 |
68 | {% endfor %}
69 |
70 |
71 | {% endfor %}
72 |
73 |
74 |
75 |
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/website/templates/edit_map.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 |
7 |
8 | Campus 42
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
39 |
40 |
41 |
42 | {% for zone_name, zone in map.items %}
43 |
44 |
45 | {% for row in zone %}
46 |
47 | {% for cell in row %}
48 | {% if cell.type == "empty" %}
49 | |
50 |
51 | |
52 | {% elif cell.type == "table" %}
53 |
54 |
55 | |
56 | {% else %}
57 |
58 |
59 | |
60 | {% endif %}
61 | {% endfor %}
62 |
63 | {% endfor %}
64 |
65 |
66 | {% endfor %}
67 |
68 |
69 |
70 |
71 |
72 |
103 |
--------------------------------------------------------------------------------
/website/templates/map.html:
--------------------------------------------------------------------------------
1 | {% load static %}
2 |
3 |
4 |
5 |
6 |
7 |
8 | Campus 42
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
52 |
53 |
54 |
55 | {% for zone_name, zone in map.items %}
56 |
57 |
58 | {% for row in zone %}
59 |
60 | {% for cell in row %}
61 | {% if cell.type == "empty" %}
62 | |
63 |
64 | |
65 | {% elif cell.type == "table" %}
66 |
67 |
68 | |
69 | {% else %}
70 |
71 |
72 | |
73 | {% endif %}
74 | {% endfor %}
75 |
76 | {% endfor %}
77 |
78 |
79 | {% endfor %}
80 |
81 |
82 |
85 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/website/zone2.csv:
--------------------------------------------------------------------------------
1 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2 | 0,0,2,2,2,2,e1z2r1p4,0,0,0,0,e1z2r2p2,2,0,0,0,0,2,e1z2r3p1,0,0,0,e1z2r3p9,2,2,2,2,2,e1z2r3p11,0,0,0,0,e1z2r5p34,2,2,2,2,2,e1z2r5p30,0,0,0,e1z2r5p2,2,0,0,0,0,2,e1z2r7p1,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
33 |
--------------------------------------------------------------------------------
/website/utility/zone2.csv:
--------------------------------------------------------------------------------
1 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
2 | 0,0,2,2,2,2,e1z2r1p4,0,0,0,0,e1z2r2p2,2,0,0,0,0,2,e1z2r3p1,0,0,0,e1z2r3p9,2,2,2,2,2,e1z2r3p11,0,0,0,0,e1z2r5p34,2,2,2,2,2,e1z2r5p30,0,0,0,e1z2r5p2,2,0,0,0,0,2,e1z2r7p1,0,0,0,e1z2r7p9,2,2,2,2,2,e1z2r7p11,0,0,0,0,e1z2r9p34,2,2,2,2,2,e1z2r9p30,0,0,0,e1z2r9p2,2,0,0,0,2,e1z2r12p1,0,0
3 | 0,2,2,e1z2r1p3,2,2,2,e1z2r1p6,0,0,e1z2r2p4,2,2,2,0,0,2,2,2,e1z2r3p3,0,e1z2r3p7,2,2,2,e1z2r3p10,2,2,2,e1z2r3p13,0,0,e1z2r5p36,2,2,2,e1z2r5p33,2,2,2,e1z2r5p28,0,e1z2r5p4,2,2,2,0,0,2,2,2,e1z2r7p3,0,e1z2r7p7,2,2,2,e1z2r7p10,2,2,2,e1z2r7p13,0,0,e1z2r9p36,2,2,2,e1z2r9p33,2,2,2,e1z2r9p28,0,e1z2r9p4,2,2,2,0,2,2,2,e1z2r12p3,0
4 | 0,2,e1z2r1p1,0,e1z2r1p5,2,2,2,0,0,2,2,2,e1z2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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,e1z2r8p19,0,e1z2r8p15,2,2,2,0,0,2,2,2,e1z2r11p0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
30 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e1z2r4p25,2,2,2,e1z2r4p30,2,2,2,e1z2r4p31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e1z2r8p20,2,2,2,e1z2r8p17,2,2,2,e1z2r8p12,0,0,e1z2r11p0,2,2,2,e1z2r11p0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0
31 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e1z2r4p27,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e1z2r8p18,2,2,2,2,2,e1z2r8p14,0,0,0,0,e1z2r11p0,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0
32 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
33 |
--------------------------------------------------------------------------------
/website/static/js/hostnames.js:
--------------------------------------------------------------------------------
1 | var users = [];
2 |
3 | function clearGrid(){
4 | $(".computer").css("background-image", "")
5 | $(".computer").attr("data-user", "")
6 | //Add unwrapping a tag!!!
7 | //Add tooltip removal
8 | }
9 |
10 | function populateTooltip(tippy) {
11 | var tooltip = tippy.popper;
12 | var caller = $(tippy.reference).find(".user");
13 | var img = $(tooltip).find("img");
14 | img.attr("src", '');
15 | $(tooltip).find("#username").text(caller.data("user"));
16 | $(tooltip).find("#hostname").text(caller.data("host"));
17 | img.on('load', function(){
18 | tippy.hide();
19 | $(tooltip).find(".loader").hide();
20 | $(img).show();
21 | tippy.show();
22 | if (!tippy.hovered) {
23 | tippy.hide();
24 | }
25 | });
26 | img.hide();
27 | img.attr("src", 'https://cdn.intra.42.fr/users/medium_'+ caller.data("user") + '.jpg')
28 | tippy.show();
29 | }
30 |
31 | function updateUsers(){
32 | $.get({
33 | "url": "get_active_users",
34 | "success" : function(data){
35 | users = data
36 | if (!users){
37 | return;
38 | }
39 | users.forEach(function(user){
40 | computer = $(".computer[data-host='" + user.host + "']");
41 | computer.css("background-image", "url(" + "https://cdn.intra.42.fr/users/small_" + user.login + ".jpg" + ")");
42 | computer.wrap('')
43 | computer.attr("data-user", user.login)
44 | computer.addClass("user")
45 | })
46 | for (var i = 1; i < 4 ; i++) {
47 | $("#tab-zone" + i + " .users-online").text($("#zone" + i + " .user").length);
48 | }
49 | tippy('.profile-link',{
50 | trigger: "manual",
51 | updateDuration: 0,
52 | dynamicTitle: true,
53 | arrowTransform: "scale(1.5)",
54 | html: "#tooltip",
55 | performance: true,
56 | arrow: true,
57 | maxWidth: "300px",
58 | popperOptions: {
59 | modifiers: {
60 | preventOverflow: {
61 | enabled: false
62 | },
63 | hide: {
64 | enabled: false
65 | }
66 | }
67 | },
68 | })
69 | var users = new Bloodhound({
70 | datumTokenizer: Bloodhound.tokenizers.obj.whitespace("login"),
71 | queryTokenizer: Bloodhound.tokenizers.whitespace,
72 | local: users
73 | });
74 | $('#autocomplete').typeahead({
75 | highlight: true
76 | },
77 | {
78 | "display": "login",
79 | "source": users
80 | }).bind('typeahead:select', function(ev, suggestion) {
81 | this.blur();
82 | var tippy = $(".user[data-user='" + suggestion.value + "']").parent()[0]._tippy;
83 | var hostname = suggestion.host;
84 | var tabId = "tab-zone" + hostname[3];
85 | $("#tabs a#" + tabId).tab('show');
86 | tippy.hovered = true;
87 | populateTooltip(tippy)
88 | $(window).scrollTop($(tippy.reference).offset().top - $(window).height()/2);
89 | $(window).scrollLeft($(tippy.reference).offset().left - $(window).width()/2);
90 | });
91 | $('a.profile-link').hover(function (e) {
92 | e.preventDefault();
93 | e.currentTarget._tippy.hovered = true;
94 | populateTooltip(e.currentTarget._tippy);
95 | }, function (e) {
96 | e.preventDefault();
97 | e.currentTarget._tippy.hovered = false;
98 | e.currentTarget._tippy.hide();
99 | });
100 | }
101 | })
102 | }
103 |
104 | function updateGrid(){
105 | clearGrid()
106 | updateUsers()
107 | }
108 |
109 | lastTip = null;
110 |
111 | $(function(){
112 | $('#tabs a:first').tab('show');
113 | $('#tabs a').on('click', function (e) {
114 | e.preventDefault()
115 | $(this).tab('show')
116 | })
117 |
118 | tippy("[title]");
119 |
120 | var pushed = false;
121 |
122 | $("main").mousedown(function(e) {
123 | $("body").css('cursor', 'move');
124 | pushed = true;
125 | lastClientX = e.clientX;
126 | lastClientY = e.clientY;
127 | e.preventDefault();
128 | });
129 |
130 | $(window).mouseup(function(e) {
131 | $("body").css('cursor', 'default');
132 | pushed = false;
133 | });
134 |
135 | $(window).mousemove(function(e) {
136 | if (pushed) {
137 | document.body.scrollLeft -= e.clientX - lastClientX; // Safari
138 | document.documentElement.scrollLeft -= e.clientX - lastClientX; // Other browsers
139 | lastClientX = e.clientX;
140 | document.body.scrollTop -= e.clientY - lastClientY; // Safari
141 | document.documentElement.scrollTop -= e.clientY - lastClientY; // Other browsers
142 | lastClientY = e.clientY;
143 | }
144 | });
145 |
146 | // $(".zone-map").data("scale", 1.0);
147 | // var x = $(".tab-pane.active .zone-map").width() / 2 - $(window).width() / 2;
148 | // var y = $(".tab-pane.active .zone-map").height() / 2 - $(window).height() / 2;
149 | // $(".tab-pane.active").scrollLeft(x);
150 | // $(".tab-pane.active").scrollTop(y);
151 | // $(document).on('wheel mousewheel', function(e){
152 | // var delta;
153 | // var scale = $(".tab-pane.active .zone-map").data("scale");
154 | // e.preventDefault();
155 | // if (e.originalEvent.wheelDelta !== undefined)
156 | // delta = e.originalEvent.wheelDelta;
157 | // else
158 | // delta = e.originalEvent.deltaY * -1;
159 | // if(delta > 0) {
160 | // if (scale >= 2)
161 | // return;
162 | // scale *= 1.2;
163 | // }
164 | // else{
165 | // if (scale <= 0.5)
166 | // return;
167 | // scale /= 1.2;
168 | // }
169 | // $(".tab-pane.active .zone-map").data("scale", scale);
170 | // //var offset = $(".tab-pane.active table.zone-map").offset();
171 | // //console.log((offset.left) + " " + (offset.top));
172 | // $(".tab-pane.active table.zone-map").css("transform-origin", "center center");
173 | // //var translate_value = "translate(" + x + "px, " + y + "px)";
174 | // $(".tab-pane.active table.zone-map").css("transform", "scale(" + scale + ")");
175 | // var x = e.clientX - $(window).width() / 2 + $(".tab-pane.active").scrollLeft();
176 | // var y = e.clientY - $(window).height() / 2 + $(".tab-pane.active").scrollTop();
177 | // console.log(x + " " + y);
178 | // $(".tab-pane.active").scrollLeft(x);
179 | // $(".tab-pane.active").scrollTop(y);
180 | // });
181 | // $(document).on("mousemove", function(e){
182 | // var offset = $(".tab-pane.active .zone-map").offset();
183 | // console.log((offset.left) + " " + (offset.top));
184 | // })
185 |
186 | // if(mobile) {
187 | // $("a.profile-link").click(function(e) {
188 | // if(lastTip != e.target) {
189 | // e.preventDefault();
190 | // lastTip = e.target;
191 | // $(lastTip).trigger("hover");
192 | // }
193 | // });
194 | // }
195 | // }
196 | // $("#autocomplete").on("autocompleteselect", function( event, ui ){
197 | // var hostname = ui.item.host;
198 | // var zone = "zone" + hostname[3];
199 |
200 | // $(".user[data-user='" + ui.item.value + "']").css("border", "1px solid black");
201 | // });
202 |
203 |
204 | // $(".cell").click(function(){
205 | // var value = prompt($(this).data("host"))
206 | // if (value)
207 | // {
208 | // value = "e1z2r" + value.replace(" ", "p")
209 | // console.log(value)
210 | // $(this).data("host", value)
211 | // }
212 | // console.log($(this).data("host"))
213 | // data = [];
214 | // $("tr").each(function(){
215 | // row = [];
216 | // $(this).children(".cell").each(function(){
217 | // row.push($(this).data("host"))
218 | // })
219 | // data.push(row.slice())
220 | // })
221 | // console.log(data)
222 | // $.post({
223 | // url: "/savemap",
224 | // data: JSON.stringify(data),
225 | // success: function(){
226 | // location.reload();
227 | // }
228 | // })
229 | // })
230 | })
--------------------------------------------------------------------------------
/website/static/js/app.js:
--------------------------------------------------------------------------------
1 | var users = [];
2 |
3 | function clearGrid(){
4 | $(".computer").css("background-image", "")
5 | $(".computer").attr("data-user", "")
6 | //Add unwrapping a tag!!!
7 | //Add tooltip removal
8 | }
9 |
10 | function populateTooltip(tippy) {
11 | var tooltip = tippy.popper;
12 | var caller = $(tippy.reference).find(".user");
13 | var img = $(tooltip).find("img");
14 | img.attr("src", '');
15 | $(tooltip).find("#username").text(caller.data("user"));
16 | $(tooltip).find("#hostname").text(caller.data("host"));
17 | img.on('load', function(){
18 | tippy.hide();
19 | $(tooltip).find(".loader").hide();
20 | $(img).show();
21 | tippy.show();
22 | if (!tippy.hovered) {
23 | tippy.hide();
24 | }
25 | });
26 | img.hide();
27 | img.attr("src", 'https://cdn.intra.42.fr/users/medium_'+ caller.data("user") + '.jpg')
28 | tippy.show();
29 | }
30 |
31 | function updateUsers(){
32 | $.get({
33 | "url": "get_active_users",
34 | "success" : function(data){
35 | users = data
36 | if (!users){
37 | return;
38 | }
39 | users.forEach(function(user){
40 | computer = $(".computer[data-host='" + user.host + "']");
41 | computer.css("background-image", "url(" + "https://cdn.intra.42.fr/users/small_" + user.login + ".jpg" + ")");
42 | computer.wrap('')
43 | computer.attr("data-user", user.login)
44 | computer.addClass("user")
45 | })
46 | for (var i = 1; i < 5 ; i++) {
47 | $("#tab-zone" + i + " .users-online").text($("#zone" + i + " .user").length);
48 | }
49 | tippy('.profile-link',{
50 | trigger: "manual",
51 | updateDuration: 0,
52 | dynamicTitle: true,
53 | arrowTransform: "scale(1.5)",
54 | html: "#tooltip",
55 | performance: true,
56 | arrow: true,
57 | maxWidth: "300px",
58 | popperOptions: {
59 | modifiers: {
60 | preventOverflow: {
61 | enabled: false
62 | },
63 | hide: {
64 | enabled: false
65 | }
66 | }
67 | },
68 | })
69 | var users = new Bloodhound({
70 | datumTokenizer: Bloodhound.tokenizers.obj.whitespace("login"),
71 | queryTokenizer: Bloodhound.tokenizers.whitespace,
72 | local: users
73 | });
74 | $('#autocomplete').typeahead({
75 | highlight: true
76 | },
77 | {
78 | "display": "login",
79 | "source": users
80 | }).bind('typeahead:select', function(ev, suggestion) {
81 | this.blur();
82 | var tippy = $(".user[data-user='" + suggestion.value + "']").parent()[0]._tippy;
83 | var hostname = suggestion.host;
84 | var tabId = "tab-zone" + hostname[3];
85 | $("#tabs a#" + tabId).tab('show');
86 | tippy.hovered = true;
87 | populateTooltip(tippy)
88 | $(window).scrollTop($(tippy.reference).offset().top - $(window).height()/2);
89 | $(window).scrollLeft($(tippy.reference).offset().left - $(window).width()/2);
90 | });
91 | $('a.profile-link').hover(function (e) {
92 | e.preventDefault();
93 | e.currentTarget._tippy.hovered = true;
94 | populateTooltip(e.currentTarget._tippy);
95 | }, function (e) {
96 | e.preventDefault();
97 | e.currentTarget._tippy.hovered = false;
98 | e.currentTarget._tippy.hide();
99 | });
100 | }
101 | })
102 | }
103 |
104 | function updateGrid(){
105 | clearGrid()
106 | updateUsers()
107 | }
108 |
109 | lastTip = null;
110 |
111 | $(function(){
112 | updateUsers()
113 | $('#tabs a:first').tab('show');
114 | $('#tabs a').on('click', function (e) {
115 | e.preventDefault()
116 | $(this).tab('show')
117 | })
118 | $("#autocomplete").keyup(function(e){
119 | if(e.which == 13) {
120 | $(".tt-suggestion:first-child").trigger('click');
121 | }
122 | });
123 | $("#search-button").click(function(e){
124 | $(".tt-suggestion:first-child").trigger('click');
125 | });
126 |
127 | var pushed = false;
128 |
129 | $("main").mousedown(function(e) {
130 | $("body").css('cursor', 'move');
131 | pushed = true;
132 | lastClientX = e.clientX;
133 | lastClientY = e.clientY;
134 | e.preventDefault();
135 | });
136 |
137 | $(window).mouseup(function(e) {
138 | $("body").css('cursor', 'default');
139 | pushed = false;
140 | });
141 |
142 | $(window).mousemove(function(e) {
143 | if (pushed) {
144 | document.body.scrollLeft -= e.clientX - lastClientX; // Safari
145 | document.documentElement.scrollLeft -= e.clientX - lastClientX; // Other browsers
146 | lastClientX = e.clientX;
147 | document.body.scrollTop -= e.clientY - lastClientY; // Safari
148 | document.documentElement.scrollTop -= e.clientY - lastClientY; // Other browsers
149 | lastClientY = e.clientY;
150 | }
151 | });
152 |
153 | // $(".zone-map").data("scale", 1.0);
154 | // var x = $(".tab-pane.active .zone-map").width() / 2 - $(window).width() / 2;
155 | // var y = $(".tab-pane.active .zone-map").height() / 2 - $(window).height() / 2;
156 | // $(".tab-pane.active").scrollLeft(x);
157 | // $(".tab-pane.active").scrollTop(y);
158 | // $(document).on('wheel mousewheel', function(e){
159 | // var delta;
160 | // var scale = $(".tab-pane.active .zone-map").data("scale");
161 | // e.preventDefault();
162 | // if (e.originalEvent.wheelDelta !== undefined)
163 | // delta = e.originalEvent.wheelDelta;
164 | // else
165 | // delta = e.originalEvent.deltaY * -1;
166 | // if(delta > 0) {
167 | // if (scale >= 2)
168 | // return;
169 | // scale *= 1.2;
170 | // }
171 | // else{
172 | // if (scale <= 0.5)
173 | // return;
174 | // scale /= 1.2;
175 | // }
176 | // $(".tab-pane.active .zone-map").data("scale", scale);
177 | // //var offset = $(".tab-pane.active table.zone-map").offset();
178 | // //console.log((offset.left) + " " + (offset.top));
179 | // $(".tab-pane.active table.zone-map").css("transform-origin", "center center");
180 | // //var translate_value = "translate(" + x + "px, " + y + "px)";
181 | // $(".tab-pane.active table.zone-map").css("transform", "scale(" + scale + ")");
182 | // var x = e.clientX - $(window).width() / 2 + $(".tab-pane.active").scrollLeft();
183 | // var y = e.clientY - $(window).height() / 2 + $(".tab-pane.active").scrollTop();
184 | // console.log(x + " " + y);
185 | // $(".tab-pane.active").scrollLeft(x);
186 | // $(".tab-pane.active").scrollTop(y);
187 | // });
188 | // $(document).on("mousemove", function(e){
189 | // var offset = $(".tab-pane.active .zone-map").offset();
190 | // console.log((offset.left) + " " + (offset.top));
191 | // })
192 |
193 | // if(mobile) {
194 | // $("a.profile-link").click(function(e) {
195 | // if(lastTip != e.target) {
196 | // e.preventDefault();
197 | // lastTip = e.target;
198 | // $(lastTip).trigger("hover");
199 | // }
200 | // });
201 | // }
202 | // }
203 | // $("#autocomplete").on("autocompleteselect", function( event, ui ){
204 | // var hostname = ui.item.host;
205 | // var zone = "zone" + hostname[3];
206 |
207 | // $(".user[data-user='" + ui.item.value + "']").css("border", "1px solid black");
208 | // });
209 |
210 |
211 | // $(".cell").click(function(){
212 | // var value = prompt($(this).data("host"))
213 | // if (value)
214 | // {
215 | // value = "e1z2r" + value.replace(" ", "p")
216 | // console.log(value)
217 | // $(this).data("host", value)
218 | // }
219 | // console.log($(this).data("host"))
220 | // data = [];
221 | // $("tr").each(function(){
222 | // row = [];
223 | // $(this).children(".cell").each(function(){
224 | // row.push($(this).data("host"))
225 | // })
226 | // data.push(row.slice())
227 | // })
228 | // console.log(data)
229 | // $.post({
230 | // url: "/savemap",
231 | // data: JSON.stringify(data),
232 | // success: function(){
233 | // location.reload();
234 | // }
235 | // })
236 | // })
237 | })
--------------------------------------------------------------------------------
/website/static/js/awesomplete.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Simple, lightweight, usable local autocomplete library for modern browsers
3 | * Because there weren’t enough autocomplete scripts in the world? Because I’m completely insane and have NIH syndrome? Probably both. :P
4 | * @author Lea Verou http://leaverou.github.io/awesomplete
5 | * MIT license
6 | */
7 |
8 | (function () {
9 |
10 | var _ = function (input, o) {
11 | var me = this;
12 |
13 | // Keep track of number of instances for unique IDs
14 | Awesomplete.count = (Awesomplete.count || 0) + 1;
15 | this.count = Awesomplete.count;
16 |
17 | // Setup
18 |
19 | this.isOpened = false;
20 |
21 | this.input = $(input);
22 | this.input.setAttribute("autocomplete", "off");
23 | this.input.setAttribute("aria-owns", "awesomplete_list_" + this.count);
24 | this.input.setAttribute("role", "combobox");
25 |
26 | o = o || {};
27 |
28 | configure(this, {
29 | minChars: 2,
30 | maxItems: 10,
31 | autoFirst: false,
32 | data: _.DATA,
33 | filter: _.FILTER_CONTAINS,
34 | sort: o.sort === false ? false : _.SORT_BYLENGTH,
35 | item: _.ITEM,
36 | replace: _.REPLACE
37 | }, o);
38 |
39 | this.index = -1;
40 |
41 | // Create necessary elements
42 |
43 | this.container = $.create("div", {
44 | className: "awesomplete",
45 | around: input
46 | });
47 |
48 | this.ul = $.create("ul", {
49 | hidden: "hidden",
50 | role: "listbox",
51 | id: "awesomplete_list_" + this.count,
52 | inside: this.container
53 | });
54 |
55 | this.status = $.create("span", {
56 | className: "visually-hidden",
57 | role: "status",
58 | "aria-live": "assertive",
59 | "aria-atomic": true,
60 | inside: this.container,
61 | textContent: this.minChars != 0 ? ("Type " + this.minChars + " or more characters for results.") : "Begin typing for results."
62 | });
63 |
64 | // Bind events
65 |
66 | this._events = {
67 | input: {
68 | "input": this.evaluate.bind(this),
69 | "blur": this.close.bind(this, { reason: "blur" }),
70 | "keydown": function(evt) {
71 | var c = evt.keyCode;
72 |
73 | // If the dropdown `ul` is in view, then act on keydown for the following keys:
74 | // Enter / Esc / Up / Down
75 | if(me.opened) {
76 | if (c === 13 && me.selected) { // Enter
77 | evt.preventDefault();
78 | me.select();
79 | }
80 | else if (c === 27) { // Esc
81 | me.close({ reason: "esc" });
82 | }
83 | else if (c === 38 || c === 40) { // Down/Up arrow
84 | evt.preventDefault();
85 | me[c === 38? "previous" : "next"]();
86 | }
87 | }
88 | }
89 | },
90 | form: {
91 | "submit": this.close.bind(this, { reason: "submit" })
92 | },
93 | ul: {
94 | "mousedown": function(evt) {
95 | var li = evt.target;
96 |
97 | if (li !== this) {
98 |
99 | while (li && !/li/i.test(li.nodeName)) {
100 | li = li.parentNode;
101 | }
102 |
103 | if (li && evt.button === 0) { // Only select on left click
104 | evt.preventDefault();
105 | me.select(li, evt.target);
106 | }
107 | }
108 | }
109 | }
110 | };
111 |
112 | $.bind(this.input, this._events.input);
113 | $.bind(this.input.form, this._events.form);
114 | $.bind(this.ul, this._events.ul);
115 |
116 | if (this.input.hasAttribute("list")) {
117 | this.list = "#" + this.input.getAttribute("list");
118 | this.input.removeAttribute("list");
119 | }
120 | else {
121 | this.list = this.input.getAttribute("data-list") || o.list || [];
122 | }
123 |
124 | _.all.push(this);
125 | };
126 |
127 | _.prototype = {
128 | set list(list) {
129 | if (Array.isArray(list)) {
130 | this._list = list;
131 | }
132 | else if (typeof list === "string" && list.indexOf(",") > -1) {
133 | this._list = list.split(/\s*,\s*/);
134 | }
135 | else { // Element or CSS selector
136 | list = $(list);
137 |
138 | if (list && list.children) {
139 | var items = [];
140 | slice.apply(list.children).forEach(function (el) {
141 | if (!el.disabled) {
142 | var text = el.textContent.trim();
143 | var value = el.value || text;
144 | var label = el.label || text;
145 | if (value !== "") {
146 | items.push({ label: label, value: value });
147 | }
148 | }
149 | });
150 | this._list = items;
151 | }
152 | }
153 |
154 | if (document.activeElement === this.input) {
155 | this.evaluate();
156 | }
157 | },
158 |
159 | get selected() {
160 | return this.index > -1;
161 | },
162 |
163 | get opened() {
164 | return this.isOpened;
165 | },
166 |
167 | close: function (o) {
168 | if (!this.opened) {
169 | return;
170 | }
171 |
172 | this.ul.setAttribute("hidden", "");
173 | this.isOpened = false;
174 | this.index = -1;
175 |
176 | $.fire(this.input, "awesomplete-close", o || {});
177 | },
178 |
179 | open: function () {
180 | this.ul.removeAttribute("hidden");
181 | this.isOpened = true;
182 |
183 | if (this.autoFirst && this.index === -1) {
184 | this.goto(0);
185 | }
186 |
187 | $.fire(this.input, "awesomplete-open");
188 | },
189 |
190 | destroy: function() {
191 | //remove events from the input and its form
192 | $.unbind(this.input, this._events.input);
193 | $.unbind(this.input.form, this._events.form);
194 |
195 | //move the input out of the awesomplete container and remove the container and its children
196 | var parentNode = this.container.parentNode;
197 |
198 | parentNode.insertBefore(this.input, this.container);
199 | parentNode.removeChild(this.container);
200 |
201 | //remove autocomplete and aria-autocomplete attributes
202 | this.input.removeAttribute("autocomplete");
203 | this.input.removeAttribute("aria-autocomplete");
204 |
205 | //remove this awesomeplete instance from the global array of instances
206 | var indexOfAwesomplete = _.all.indexOf(this);
207 |
208 | if (indexOfAwesomplete !== -1) {
209 | _.all.splice(indexOfAwesomplete, 1);
210 | }
211 | },
212 |
213 | next: function () {
214 | var count = this.ul.children.length;
215 | this.goto(this.index < count - 1 ? this.index + 1 : (count ? 0 : -1) );
216 | },
217 |
218 | previous: function () {
219 | var count = this.ul.children.length;
220 | var pos = this.index - 1;
221 |
222 | this.goto(this.selected && pos !== -1 ? pos : count - 1);
223 | },
224 |
225 | // Should not be used, highlights specific item without any checks!
226 | goto: function (i) {
227 | var lis = this.ul.children;
228 |
229 | if (this.selected) {
230 | lis[this.index].setAttribute("aria-selected", "false");
231 | }
232 |
233 | this.index = i;
234 |
235 | if (i > -1 && lis.length > 0) {
236 | lis[i].setAttribute("aria-selected", "true");
237 |
238 | this.status.textContent = lis[i].textContent + ", list item " + (i + 1) + " of " + lis.length;
239 |
240 | this.input.setAttribute("aria-activedescendant", this.ul.id + "_item_" + this.index);
241 |
242 | // scroll to highlighted element in case parent's height is fixed
243 | this.ul.scrollTop = lis[i].offsetTop - this.ul.clientHeight + lis[i].clientHeight;
244 |
245 | $.fire(this.input, "awesomplete-highlight", {
246 | text: this.suggestions[this.index]
247 | });
248 | }
249 | },
250 |
251 | select: function (selected, origin) {
252 | if (selected) {
253 | this.index = $.siblingIndex(selected);
254 | } else {
255 | selected = this.ul.children[this.index];
256 | }
257 |
258 | if (selected) {
259 | var suggestion = this.suggestions[this.index];
260 |
261 | var allowed = $.fire(this.input, "awesomplete-select", {
262 | text: suggestion,
263 | origin: origin || selected
264 | });
265 |
266 | if (allowed) {
267 | this.replace(suggestion);
268 | this.close({ reason: "select" });
269 | $.fire(this.input, "awesomplete-selectcomplete", {
270 | text: suggestion
271 | });
272 | }
273 | }
274 | },
275 |
276 | evaluate: function() {
277 | var me = this;
278 | var value = this.input.value;
279 |
280 | if (value.length >= this.minChars && this._list.length > 0) {
281 | this.index = -1;
282 | // Populate list with options that match
283 | this.ul.innerHTML = "";
284 |
285 | this.suggestions = this._list
286 | .map(function(item) {
287 | return new Suggestion(me.data(item, value));
288 | })
289 | .filter(function(item) {
290 | return me.filter(item, value);
291 | });
292 |
293 | if (this.sort !== false) {
294 | this.suggestions = this.suggestions.sort(this.sort);
295 | }
296 |
297 | this.suggestions = this.suggestions.slice(0, this.maxItems);
298 |
299 | this.suggestions.forEach(function(text, index) {
300 | me.ul.appendChild(me.item(text, value, index));
301 | });
302 |
303 | if (this.ul.children.length === 0) {
304 |
305 | this.status.textContent = "No results found";
306 |
307 | this.close({ reason: "nomatches" });
308 |
309 | } else {
310 | this.open();
311 |
312 | this.status.textContent = this.ul.children.length + " results found";
313 | }
314 | }
315 | else {
316 | this.close({ reason: "nomatches" });
317 |
318 | this.status.textContent = "No results found";
319 | }
320 | }
321 | };
322 |
323 | // Static methods/properties
324 |
325 | _.all = [];
326 |
327 | _.FILTER_CONTAINS = function (text, input) {
328 | return RegExp($.regExpEscape(input.trim()), "i").test(text);
329 | };
330 |
331 | _.FILTER_STARTSWITH = function (text, input) {
332 | return RegExp("^" + $.regExpEscape(input.trim()), "i").test(text);
333 | };
334 |
335 | _.SORT_BYLENGTH = function (a, b) {
336 | if (a.length !== b.length) {
337 | return a.length - b.length;
338 | }
339 |
340 | return a < b? -1 : 1;
341 | };
342 |
343 | _.ITEM = function (text, input, item_id) {
344 | var html = input.trim() === "" ? text : text.replace(RegExp($.regExpEscape(input.trim()), "gi"), "$&");
345 | return $.create("li", {
346 | innerHTML: html,
347 | "aria-selected": "false",
348 | "id": "awesomplete_list_" + this.count + "_item_" + item_id
349 | });
350 | };
351 |
352 | _.REPLACE = function (text) {
353 | this.input.value = text.value;
354 | };
355 |
356 | _.DATA = function (item/*, input*/) { return item; };
357 |
358 | // Private functions
359 |
360 | function Suggestion(data) {
361 | var o = Array.isArray(data)
362 | ? { label: data[0], value: data[1] }
363 | : typeof data === "object" && "label" in data && "value" in data ? data : { label: data, value: data };
364 |
365 | this.label = o.label || o.value;
366 | this.value = o.value;
367 | }
368 | Object.defineProperty(Suggestion.prototype = Object.create(String.prototype), "length", {
369 | get: function() { return this.label.length; }
370 | });
371 | Suggestion.prototype.toString = Suggestion.prototype.valueOf = function () {
372 | return "" + this.label;
373 | };
374 |
375 | function configure(instance, properties, o) {
376 | for (var i in properties) {
377 | var initial = properties[i],
378 | attrValue = instance.input.getAttribute("data-" + i.toLowerCase());
379 |
380 | if (typeof initial === "number") {
381 | instance[i] = parseInt(attrValue);
382 | }
383 | else if (initial === false) { // Boolean options must be false by default anyway
384 | instance[i] = attrValue !== null;
385 | }
386 | else if (initial instanceof Function) {
387 | instance[i] = null;
388 | }
389 | else {
390 | instance[i] = attrValue;
391 | }
392 |
393 | if (!instance[i] && instance[i] !== 0) {
394 | instance[i] = (i in o)? o[i] : initial;
395 | }
396 | }
397 | }
398 |
399 | // Helpers
400 |
401 | var slice = Array.prototype.slice;
402 |
403 | function $(expr, con) {
404 | return typeof expr === "string"? (con || document).querySelector(expr) : expr || null;
405 | }
406 |
407 | function $$(expr, con) {
408 | return slice.call((con || document).querySelectorAll(expr));
409 | }
410 |
411 | $.create = function(tag, o) {
412 | var element = document.createElement(tag);
413 |
414 | for (var i in o) {
415 | var val = o[i];
416 |
417 | if (i === "inside") {
418 | $(val).appendChild(element);
419 | }
420 | else if (i === "around") {
421 | var ref = $(val);
422 | ref.parentNode.insertBefore(element, ref);
423 | element.appendChild(ref);
424 | }
425 | else if (i in element) {
426 | element[i] = val;
427 | }
428 | else {
429 | element.setAttribute(i, val);
430 | }
431 | }
432 |
433 | return element;
434 | };
435 |
436 | $.bind = function(element, o) {
437 | if (element) {
438 | for (var event in o) {
439 | var callback = o[event];
440 |
441 | event.split(/\s+/).forEach(function (event) {
442 | element.addEventListener(event, callback);
443 | });
444 | }
445 | }
446 | };
447 |
448 | $.unbind = function(element, o) {
449 | if (element) {
450 | for (var event in o) {
451 | var callback = o[event];
452 |
453 | event.split(/\s+/).forEach(function(event) {
454 | element.removeEventListener(event, callback);
455 | });
456 | }
457 | }
458 | };
459 |
460 | $.fire = function(target, type, properties) {
461 | var evt = document.createEvent("HTMLEvents");
462 |
463 | evt.initEvent(type, true, true );
464 |
465 | for (var j in properties) {
466 | evt[j] = properties[j];
467 | }
468 |
469 | return target.dispatchEvent(evt);
470 | };
471 |
472 | $.regExpEscape = function (s) {
473 | return s.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&");
474 | };
475 |
476 | $.siblingIndex = function (el) {
477 | /* eslint-disable no-cond-assign */
478 | for (var i = 0; el = el.previousElementSibling; i++);
479 | return i;
480 | };
481 |
482 | // Initialization
483 |
484 | function init() {
485 | $$("input.awesomplete").forEach(function (input) {
486 | new _(input);
487 | });
488 | }
489 |
490 | // Are we in a browser? Check for Document constructor
491 | if (typeof Document !== "undefined") {
492 | // DOM already loaded?
493 | if (document.readyState !== "loading") {
494 | init();
495 | }
496 | else {
497 | // Wait for it
498 | document.addEventListener("DOMContentLoaded", init);
499 | }
500 | }
501 |
502 | _.$ = $;
503 | _.$$ = $$;
504 |
505 | // Make sure to export Awesomplete on self when in a browser
506 | if (typeof self !== "undefined") {
507 | self.Awesomplete = _;
508 | }
509 |
510 | // Expose Awesomplete as a CJS module
511 | if (typeof module === "object" && module.exports) {
512 | module.exports = _;
513 | }
514 |
515 | return _;
516 |
517 | }());
518 |
--------------------------------------------------------------------------------
/website/static/js/typeahead.bundle.min.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * typeahead.js 0.11.1
3 | * https://github.com/twitter/typeahead.js
4 | * Copyright 2013-2015 Twitter, Inc. and other contributors; Licensed MIT
5 | */
6 |
7 | !function(a,b){"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(c){return a.Bloodhound=b(c)}):"object"==typeof exports?module.exports=b(require("jquery")):a.Bloodhound=b(jQuery)}(this,function(a){var b=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(a){return!a||/^\s*$/.test(a)},escapeRegExChars:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(a){return"string"==typeof a},isNumber:function(a){return"number"==typeof a},isArray:a.isArray,isFunction:a.isFunction,isObject:a.isPlainObject,isUndefined:function(a){return"undefined"==typeof a},isElement:function(a){return!(!a||1!==a.nodeType)},isJQuery:function(b){return b instanceof a},toStr:function(a){return b.isUndefined(a)||null===a?"":a+""},bind:a.proxy,each:function(b,c){function d(a,b){return c(b,a)}a.each(b,d)},map:a.map,filter:a.grep,every:function(b,c){var d=!0;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?void 0:!1}),!!d):d},some:function(b,c){var d=!1;return b?(a.each(b,function(a,e){return(d=c.call(null,e,a,b))?!1:void 0}),!!d):d},mixin:a.extend,identity:function(a){return a},clone:function(b){return a.extend(!0,{},b)},getIdGenerator:function(){var a=0;return function(){return a++}},templatify:function(b){function c(){return String(b)}return a.isFunction(b)?b:c},defer:function(a){setTimeout(a,0)},debounce:function(a,b,c){var d,e;return function(){var f,g,h=this,i=arguments;return f=function(){d=null,c||(e=a.apply(h,i))},g=c&&!d,clearTimeout(d),d=setTimeout(f,b),g&&(e=a.apply(h,i)),e}},throttle:function(a,b){var c,d,e,f,g,h;return g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)},function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c="0.11.1",d=function(){"use strict";function a(a){return a=b.toStr(a),a?a.split(/\s+/):[]}function c(a){return a=b.toStr(a),a?a.split(/\W+/):[]}function d(a){return function(c){return c=b.isArray(c)?c:[].slice.call(arguments,0),function(d){var e=[];return b.each(c,function(c){e=e.concat(a(b.toStr(d[c])))}),e}}}return{nonword:c,whitespace:a,obj:{nonword:d(c),whitespace:d(a)}}}(),e=function(){"use strict";function c(c){this.maxSize=b.isNumber(c)?c:100,this.reset(),this.maxSize<=0&&(this.set=this.get=a.noop)}function d(){this.head=this.tail=null}function e(a,b){this.key=a,this.val=b,this.prev=this.next=null}return b.mixin(c.prototype,{set:function(a,b){var c,d=this.list.tail;this.size>=this.maxSize&&(this.list.remove(d),delete this.hash[d.key],this.size--),(c=this.hash[a])?(c.val=b,this.list.moveToFront(c)):(c=new e(a,b),this.list.add(c),this.hash[a]=c,this.size++)},get:function(a){var b=this.hash[a];return b?(this.list.moveToFront(b),b.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new d}}),b.mixin(d.prototype,{add:function(a){this.head&&(a.next=this.head,this.head.prev=a),this.head=a,this.tail=this.tail||a},remove:function(a){a.prev?a.prev.next=a.next:this.head=a.next,a.next?a.next.prev=a.prev:this.tail=a.prev},moveToFront:function(a){this.remove(a),this.add(a)}}),c}(),f=function(){"use strict";function c(a,c){this.prefix=["__",a,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+b.escapeRegExChars(this.prefix)),this.ls=c||h,!this.ls&&this._noop()}function d(){return(new Date).getTime()}function e(a){return JSON.stringify(b.isUndefined(a)?null:a)}function f(b){return a.parseJSON(b)}function g(a){var b,c,d=[],e=h.length;for(b=0;e>b;b++)(c=h.key(b)).match(a)&&d.push(c.replace(a,""));return d}var h;try{h=window.localStorage,h.setItem("~~~","!"),h.removeItem("~~~")}catch(i){h=null}return b.mixin(c.prototype,{_prefix:function(a){return this.prefix+a},_ttlKey:function(a){return this._prefix(a)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=b.noop},_safeSet:function(a,b){try{this.ls.setItem(a,b)}catch(c){"QuotaExceededError"===c.name&&(this.clear(),this._noop())}},get:function(a){return this.isExpired(a)&&this.remove(a),f(this.ls.getItem(this._prefix(a)))},set:function(a,c,f){return b.isNumber(f)?this._safeSet(this._ttlKey(a),e(d()+f)):this.ls.removeItem(this._ttlKey(a)),this._safeSet(this._prefix(a),e(c))},remove:function(a){return this.ls.removeItem(this._ttlKey(a)),this.ls.removeItem(this._prefix(a)),this},clear:function(){var a,b=g(this.keyMatcher);for(a=b.length;a--;)this.remove(b[a]);return this},isExpired:function(a){var c=f(this.ls.getItem(this._ttlKey(a)));return b.isNumber(c)&&d()>c?!0:!1}}),c}(),g=function(){"use strict";function c(a){a=a||{},this.cancelled=!1,this.lastReq=null,this._send=a.transport,this._get=a.limiter?a.limiter(this._get):this._get,this._cache=a.cache===!1?new e(0):h}var d=0,f={},g=6,h=new e(10);return c.setMaxPendingRequests=function(a){g=a},c.resetCache=function(){h.reset()},b.mixin(c.prototype,{_fingerprint:function(b){return b=b||{},b.url+b.type+a.param(b.data||{})},_get:function(a,b){function c(a){b(null,a),k._cache.set(i,a)}function e(){b(!0)}function h(){d--,delete f[i],k.onDeckRequestArgs&&(k._get.apply(k,k.onDeckRequestArgs),k.onDeckRequestArgs=null)}var i,j,k=this;i=this._fingerprint(a),this.cancelled||i!==this.lastReq||((j=f[i])?j.done(c).fail(e):g>d?(d++,f[i]=this._send(a).done(c).fail(e).always(h)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(c,d){var e,f;d=d||a.noop,c=b.isString(c)?{url:c}:c||{},f=this._fingerprint(c),this.cancelled=!1,this.lastReq=f,(e=this._cache.get(f))?d(null,e):this._get(c,d)},cancel:function(){this.cancelled=!0}}),c}(),h=window.SearchIndex=function(){"use strict";function c(c){c=c||{},c.datumTokenizer&&c.queryTokenizer||a.error("datumTokenizer and queryTokenizer are both required"),this.identify=c.identify||b.stringify,this.datumTokenizer=c.datumTokenizer,this.queryTokenizer=c.queryTokenizer,this.reset()}function d(a){return a=b.filter(a,function(a){return!!a}),a=b.map(a,function(a){return a.toLowerCase()})}function e(){var a={};return a[i]=[],a[h]={},a}function f(a){for(var b={},c=[],d=0,e=a.length;e>d;d++)b[a[d]]||(b[a[d]]=!0,c.push(a[d]));return c}function g(a,b){var c=0,d=0,e=[];a=a.sort(),b=b.sort();for(var f=a.length,g=b.length;f>c&&g>d;)a[c]b[d]?d++:(e.push(a[c]),c++,d++);return e}var h="c",i="i";return b.mixin(c.prototype,{bootstrap:function(a){this.datums=a.datums,this.trie=a.trie},add:function(a){var c=this;a=b.isArray(a)?a:[a],b.each(a,function(a){var f,g;c.datums[f=c.identify(a)]=a,g=d(c.datumTokenizer(a)),b.each(g,function(a){var b,d,g;for(b=c.trie,d=a.split("");g=d.shift();)b=b[h][g]||(b[h][g]=e()),b[i].push(f)})})},get:function(a){var c=this;return b.map(a,function(a){return c.datums[a]})},search:function(a){var c,e,j=this;return c=d(this.queryTokenizer(a)),b.each(c,function(a){var b,c,d,f;if(e&&0===e.length)return!1;for(b=j.trie,c=a.split("");b&&(d=c.shift());)b=b[h][d];return b&&0===c.length?(f=b[i].slice(0),void(e=e?g(e,f):f)):(e=[],!1)}),e?b.map(f(e),function(a){return j.datums[a]}):[]},all:function(){var a=[];for(var b in this.datums)a.push(this.datums[b]);return a},reset:function(){this.datums={},this.trie=e()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),c}(),i=function(){"use strict";function a(a){this.url=a.url,this.ttl=a.ttl,this.cache=a.cache,this.prepare=a.prepare,this.transform=a.transform,this.transport=a.transport,this.thumbprint=a.thumbprint,this.storage=new f(a.cacheKey)}var c;return c={data:"data",protocol:"protocol",thumbprint:"thumbprint"},b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(a){this.cache&&(this.storage.set(c.data,a,this.ttl),this.storage.set(c.protocol,location.protocol,this.ttl),this.storage.set(c.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var a,b={};return this.cache?(b.data=this.storage.get(c.data),b.protocol=this.storage.get(c.protocol),b.thumbprint=this.storage.get(c.thumbprint),a=b.thumbprint!==this.thumbprint||b.protocol!==location.protocol,b.data&&!a?b.data:null):null},fromNetwork:function(a){function b(){a(!0)}function c(b){a(null,e.transform(b))}var d,e=this;a&&(d=this.prepare(this._settings()),this.transport(d).fail(b).done(c))},clear:function(){return this.storage.clear(),this}}),a}(),j=function(){"use strict";function a(a){this.url=a.url,this.prepare=a.prepare,this.transform=a.transform,this.transport=new g({cache:a.cache,limiter:a.limiter,transport:a.transport})}return b.mixin(a.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(a,b){function c(a,c){b(a?[]:e.transform(c))}var d,e=this;if(b)return a=a||"",d=this.prepare(a,this._settings()),this.transport.get(d,c)},cancelLastRequest:function(){this.transport.cancel()}}),a}(),k=function(){"use strict";function d(d){var e;return d?(e={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:b.identity,transform:b.identity,transport:null},d=b.isString(d)?{url:d}:d,d=b.mixin(e,d),!d.url&&a.error("prefetch requires url to be set"),d.transform=d.filter||d.transform,d.cacheKey=d.cacheKey||d.url,d.thumbprint=c+d.thumbprint,d.transport=d.transport?h(d.transport):a.ajax,d):null}function e(c){var d;if(c)return d={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:b.identity,transport:null},c=b.isString(c)?{url:c}:c,c=b.mixin(d,c),!c.url&&a.error("remote requires url to be set"),c.transform=c.filter||c.transform,c.prepare=f(c),c.limiter=g(c),c.transport=c.transport?h(c.transport):a.ajax,delete c.replace,delete c.wildcard,delete c.rateLimitBy,delete c.rateLimitWait,c}function f(a){function b(a,b){return b.url=f(b.url,a),b}function c(a,b){return b.url=b.url.replace(g,encodeURIComponent(a)),b}function d(a,b){return b}var e,f,g;return e=a.prepare,f=a.replace,g=a.wildcard,e?e:e=f?b:a.wildcard?c:d}function g(a){function c(a){return function(c){return b.debounce(c,a)}}function d(a){return function(c){return b.throttle(c,a)}}var e,f,g;return e=a.limiter,f=a.rateLimitBy,g=a.rateLimitWait,e||(e=/^throttle$/i.test(f)?d(g):c(g)),e}function h(c){return function(d){function e(a){b.defer(function(){g.resolve(a)})}function f(a){b.defer(function(){g.reject(a)})}var g=a.Deferred();return c(d,e,f),g}}return function(c){var f,g;return f={initialize:!0,identify:b.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},c=b.mixin(f,c||{}),!c.datumTokenizer&&a.error("datumTokenizer is required"),!c.queryTokenizer&&a.error("queryTokenizer is required"),g=c.sorter,c.sorter=g?function(a){return a.sort(g)}:b.identity,c.local=b.isFunction(c.local)?c.local():c.local,c.prefetch=d(c.prefetch),c.remote=e(c.remote),c}}(),l=function(){"use strict";function c(a){a=k(a),this.sorter=a.sorter,this.identify=a.identify,this.sufficient=a.sufficient,this.local=a.local,this.remote=a.remote?new j(a.remote):null,this.prefetch=a.prefetch?new i(a.prefetch):null,this.index=new h({identify:this.identify,datumTokenizer:a.datumTokenizer,queryTokenizer:a.queryTokenizer}),a.initialize!==!1&&this.initialize()}var e;return e=window&&window.Bloodhound,c.noConflict=function(){return window&&(window.Bloodhound=e),c},c.tokenizers=d,b.mixin(c.prototype,{__ttAdapter:function(){function a(a,b,d){return c.search(a,b,d)}function b(a,b){return c.search(a,b)}var c=this;return this.remote?a:b},_loadPrefetch:function(){function b(a,b){return a?c.reject():(e.add(b),e.prefetch.store(e.index.serialize()),void c.resolve())}var c,d,e=this;return c=a.Deferred(),this.prefetch?(d=this.prefetch.fromCache())?(this.index.bootstrap(d),c.resolve()):this.prefetch.fromNetwork(b):c.resolve(),c.promise()},_initialize:function(){function a(){b.add(b.local)}var b=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(a),this.initPromise},initialize:function(a){return!this.initPromise||a?this._initialize():this.initPromise},add:function(a){return this.index.add(a),this},get:function(a){return a=b.isArray(a)?a:[].slice.call(arguments),this.index.get(a)},search:function(a,c,d){function e(a){var c=[];b.each(a,function(a){!b.some(f,function(b){return g.identify(a)===g.identify(b)})&&c.push(a)}),d&&d(c)}var f,g=this;return f=this.sorter(this.index.search(a)),c(this.remote?f.slice():f),this.remote&&f.length=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},stringify:function(a){return b.isString(a)?a:JSON.stringify(a)},noop:function(){}}}(),c=function(){"use strict";function a(a){var g,h;return h=b.mixin({},f,a),g={css:e(),classes:h,html:c(h),selectors:d(h)},{css:g.css,html:g.html,classes:g.classes,selectors:g.selectors,mixin:function(a){b.mixin(a,g)}}}function c(a){return{wrapper:'',menu:''}}function d(a){var c={};return b.each(a,function(a,b){c[b]="."+a}),c}function e(){var a={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return b.isMsie()&&b.mixin(a.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),a}var f={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return a}(),d=function(){"use strict";function c(b){b&&b.el||a.error("EventBus initialized without el"),this.$el=a(b.el)}var d,e;return d="typeahead:",e={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},b.mixin(c.prototype,{_trigger:function(b,c){var e;return e=a.Event(d+b),(c=c||[]).unshift(e),this.$el.trigger.apply(this.$el,c),e},before:function(a){var b,c;return b=[].slice.call(arguments,1),c=this._trigger("before"+a,b),c.isDefaultPrevented()},trigger:function(a){var b;this._trigger(a,[].slice.call(arguments,1)),(b=e[a])&&this._trigger(b,[].slice.call(arguments,1))}}),c}(),e=function(){"use strict";function a(a,b,c,d){var e;if(!c)return this;for(b=b.split(i),c=d?h(c,d):c,this._callbacks=this._callbacks||{};e=b.shift();)this._callbacks[e]=this._callbacks[e]||{sync:[],async:[]},this._callbacks[e][a].push(c);return this}function b(b,c,d){return a.call(this,"async",b,c,d)}function c(b,c,d){return a.call(this,"sync",b,c,d)}function d(a){var b;if(!this._callbacks)return this;for(a=a.split(i);b=a.shift();)delete this._callbacks[b];return this}function e(a){var b,c,d,e,g;if(!this._callbacks)return this;for(a=a.split(i),d=[].slice.call(arguments,1);(b=a.shift())&&(c=this._callbacks[b]);)e=f(c.sync,this,[b].concat(d)),g=f(c.async,this,[b].concat(d)),e()&&j(g);return this}function f(a,b,c){function d(){for(var d,e=0,f=a.length;!d&&f>e;e+=1)d=a[e].apply(b,c)===!1;return!d}return d}function g(){var a;return a=window.setImmediate?function(a){setImmediate(function(){a()})}:function(a){setTimeout(function(){a()},0)}}function h(a,b){return a.bind?a.bind(b):function(){a.apply(b,[].slice.call(arguments,0))}}var i=/\s+/,j=g();return{onSync:c,onAsync:b,off:d,trigger:e}}(),f=function(a){"use strict";function c(a,c,d){for(var e,f=[],g=0,h=a.length;h>g;g++)f.push(b.escapeRegExChars(a[g]));return e=d?"\\b("+f.join("|")+")\\b":"("+f.join("|")+")",c?new RegExp(e):new RegExp(e,"i")}var d={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(e){function f(b){var c,d,f;return(c=h.exec(b.data))&&(f=a.createElement(e.tagName),e.className&&(f.className=e.className),d=b.splitText(c.index),d.splitText(c[0].length),f.appendChild(d.cloneNode(!0)),b.parentNode.replaceChild(f,d)),!!c}function g(a,b){for(var c,d=3,e=0;e').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:b.css("font-family"),fontSize:b.css("font-size"),fontStyle:b.css("font-style"),fontVariant:b.css("font-variant"),fontWeight:b.css("font-weight"),wordSpacing:b.css("word-spacing"),letterSpacing:b.css("letter-spacing"),textIndent:b.css("text-indent"),textRendering:b.css("text-rendering"),textTransform:b.css("text-transform")}).insertAfter(b)}function f(a,b){return c.normalizeQuery(a)===c.normalizeQuery(b)}function g(a){return a.altKey||a.ctrlKey||a.metaKey||a.shiftKey}var h;return h={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},c.normalizeQuery=function(a){return b.toStr(a).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},b.mixin(c.prototype,e,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(a){var b=h[a.which||a.keyCode];this._managePreventDefault(b,a),b&&this._shouldTrigger(b,a)&&this.trigger(b+"Keyed",a)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(a,b){var c;switch(a){case"up":case"down":c=!g(b);break;default:c=!1}c&&b.preventDefault()},_shouldTrigger:function(a,b){var c;switch(a){case"tab":c=!g(b);break;default:c=!0}return c},_checkLanguageDirection:function(){var a=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==a&&(this.dir=a,this.$hint.attr("dir",a),this.trigger("langDirChanged",a))},_setQuery:function(a,b){var c,d;c=f(a,this.query),d=c?this.query.length!==a.length:!1,this.query=a,b||c?!b&&d&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var a,c,d,e,f=this;return a=b.bind(this._onBlur,this),c=b.bind(this._onFocus,this),d=b.bind(this._onKeydown,this),e=b.bind(this._onInput,this),this.$input.on("blur.tt",a).on("focus.tt",c).on("keydown.tt",d),!b.isMsie()||b.isMsie()>9?this.$input.on("input.tt",e):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(a){h[a.which||a.keyCode]||b.defer(b.bind(f._onInput,f,a))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(a,b){this.setInputValue(a),this._setQuery(a,b)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(a){this.$input.val(a),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(a){this.$hint.val(a)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var a,b,c,d;a=this.getInputValue(),b=this.getHint(),c=a!==b&&0===b.indexOf(a),d=""!==a&&c&&!this.hasOverflow(),!d&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var a=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=a},isCursorAtEnd:function(){var a,c,d;return a=this.$input.val().length,c=this.$input[0].selectionStart,b.isNumber(c)?c===a:document.selection?(d=document.selection.createRange(),d.moveStart("character",-a),a===d.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=a("")}}),c}(),h=function(){"use strict";function c(c,e){c=c||{},c.templates=c.templates||{},c.templates.notFound=c.templates.notFound||c.templates.empty,c.source||a.error("missing source"),c.node||a.error("missing node"),c.name&&!h(c.name)&&a.error("invalid dataset name: "+c.name),e.mixin(this),this.highlight=!!c.highlight,this.name=c.name||j(),this.limit=c.limit||5,this.displayFn=d(c.display||c.displayKey),this.templates=g(c.templates,this.displayFn),this.source=c.source.__ttAdapter?c.source.__ttAdapter():c.source,this.async=b.isUndefined(c.async)?this.source.length>2:!!c.async,this._resetLastSuggestion(),this.$el=a(c.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function d(a){function c(b){return b[a]}return a=a||b.stringify,b.isFunction(a)?a:c}function g(c,d){function e(b){return a("
").text(d(b))}return{notFound:c.notFound&&b.templatify(c.notFound),pending:c.pending&&b.templatify(c.pending),header:c.header&&b.templatify(c.header),footer:c.footer&&b.templatify(c.footer),suggestion:c.suggestion||e}}function h(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var i,j;return i={val:"tt-selectable-display",obj:"tt-selectable-object"},j=b.getIdGenerator(),c.extractData=function(b){var c=a(b);return c.data(i.obj)?{val:c.data(i.val)||"",obj:c.data(i.obj)||null}:null},b.mixin(c.prototype,e,{_overwrite:function(a,b){b=b||[],b.length?this._renderSuggestions(a,b):this.async&&this.templates.pending?this._renderPending(a):!this.async&&this.templates.notFound?this._renderNotFound(a):this._empty(),this.trigger("rendered",this.name,b,!1)},_append:function(a,b){b=b||[],b.length&&this.$lastSuggestion.length?this._appendSuggestions(a,b):b.length?this._renderSuggestions(a,b):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(a),this.trigger("rendered",this.name,b,!0)},_renderSuggestions:function(a,b){var c;c=this._getSuggestionsFragment(a,b),this.$lastSuggestion=c.children().last(),this.$el.html(c).prepend(this._getHeader(a,b)).append(this._getFooter(a,b))},_appendSuggestions:function(a,b){var c,d;c=this._getSuggestionsFragment(a,b),d=c.children().last(),this.$lastSuggestion.after(c),this.$lastSuggestion=d},_renderPending:function(a){var b=this.templates.pending;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_renderNotFound:function(a){var b=this.templates.notFound;this._resetLastSuggestion(),b&&this.$el.html(b({query:a,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(c,d){var e,g=this;return e=document.createDocumentFragment(),b.each(d,function(b){var d,f;f=g._injectQuery(c,b),d=a(g.templates.suggestion(f)).data(i.obj,b).data(i.val,g.displayFn(b)).addClass(g.classes.suggestion+" "+g.classes.selectable),e.appendChild(d[0])}),this.highlight&&f({className:this.classes.highlight,node:e,pattern:c}),a(e)},_getFooter:function(a,b){return this.templates.footer?this.templates.footer({query:a,suggestions:b,dataset:this.name}):null},_getHeader:function(a,b){return this.templates.header?this.templates.header({query:a,suggestions:b,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=a()},_injectQuery:function(a,c){return b.isObject(c)?b.mixin({_query:a},c):c},update:function(b){function c(a){g||(g=!0,a=(a||[]).slice(0,e.limit),h=a.length,e._overwrite(b,a),h
")}}),c}(),i=function(){"use strict";function c(c,d){function e(b){var c=f.$node.find(b.node).first();return b.node=c.length?c:a("").appendTo(f.$node),new h(b,d)}var f=this;c=c||{},c.node||a.error("node is required"),d.mixin(this),this.$node=a(c.node),this.query=null,this.datasets=b.map(c.datasets,e)}return b.mixin(c.prototype,e,{_onSelectableClick:function(b){this.trigger("selectableClicked",a(b.currentTarget))},_onRendered:function(a,b,c,d){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",b,c,d)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){function a(a){return a.isEmpty()}return b.every(this.datasets,a)},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var a=this.getActiveSelectable();a&&a.removeClass(this.classes.cursor)},_ensureVisible:function(a){var b,c,d,e;b=a.position().top,c=b+a.outerHeight(!0),d=this.$node.scrollTop(),e=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),0>b?this.$node.scrollTop(d+b):c>e&&this.$node.scrollTop(d+(c-e))},bind:function(){var a,c=this;return a=b.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,a),b.each(this.datasets,function(a){a.onSync("asyncRequested",c._propagate,c).onSync("asyncCanceled",c._propagate,c).onSync("asyncReceived",c._propagate,c).onSync("rendered",c._onRendered,c).onSync("cleared",c._onCleared,c)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(a){this.$node.attr("dir",a)},selectableRelativeToCursor:function(a){var b,c,d,e;return c=this.getActiveSelectable(),b=this._getSelectables(),d=c?b.index(c):-1,e=d+a,e=(e+1)%(b.length+1)-1,e=-1>e?b.length-1:e,-1===e?null:b.eq(e)},setCursor:function(a){this._removeCursor(),(a=a&&a.first())&&(a.addClass(this.classes.cursor),this._ensureVisible(a))},getSelectableData:function(a){return a&&a.length?h.extractData(a):null},getActiveSelectable:function(){var a=this._getSelectables().filter(this.selectors.cursor).first();return a.length?a:null},getTopSelectable:function(){var a=this._getSelectables().first();return a.length?a:null},update:function(a){function c(b){b.update(a)}var d=a!==this.query;return d&&(this.query=a,b.each(this.datasets,c)),d},empty:function(){function a(a){a.clear()}b.each(this.datasets,a),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function c(a){a.destroy()}this.$node.off(".tt"),this.$node=a("
"),b.each(this.datasets,c)}}),c}(),j=function(){"use strict";function a(){i.apply(this,[].slice.call(arguments,0))}var c=i.prototype;return b.mixin(a.prototype,i.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),c.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),c.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),c._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(a){return this.$node.css("ltr"===a?this.css.ltr:this.css.rtl),c.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),a}(),k=function(){"use strict";function c(c,e){var f,g,h,i,j,k,l,m,n,o,p;c=c||{},c.input||a.error("missing input"),c.menu||a.error("missing menu"),c.eventBus||a.error("missing event bus"),e.mixin(this),this.eventBus=c.eventBus,this.minLength=b.isNumber(c.minLength)?c.minLength:1,this.input=c.input,this.menu=c.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),f=d(this,"activate","open","_onFocused"),g=d(this,"deactivate","_onBlurred"),h=d(this,"isActive","isOpen","_onEnterKeyed"),i=d(this,"isActive","isOpen","_onTabKeyed"),j=d(this,"isActive","_onEscKeyed"),k=d(this,"isActive","open","_onUpKeyed"),l=d(this,"isActive","open","_onDownKeyed"),m=d(this,"isActive","isOpen","_onLeftKeyed"),n=d(this,"isActive","isOpen","_onRightKeyed"),o=d(this,"_openIfActive","_onQueryChanged"),p=d(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",f,this).onSync("blurred",g,this).onSync("enterKeyed",h,this).onSync("tabKeyed",i,this).onSync("escKeyed",j,this).onSync("upKeyed",k,this).onSync("downKeyed",l,this).onSync("leftKeyed",m,this).onSync("rightKeyed",n,this).onSync("queryChanged",o,this).onSync("whitespaceChanged",p,this).onSync("langDirChanged",this._onLangDirChanged,this)}function d(a){var c=[].slice.call(arguments,1);return function(){var d=[].slice.call(arguments);b.each(c,function(b){return a[b].apply(a,d)})}}return b.mixin(c.prototype,{_hacks:function(){var c,d;c=this.input.$input||a("
"),d=this.menu.$node||a("
"),c.on("blur.tt",function(a){var e,f,g;
8 | e=document.activeElement,f=d.is(e),g=d.has(e).length>0,b.isMsie()&&(f||g)&&(a.preventDefault(),a.stopImmediatePropagation(),b.defer(function(){c.focus()}))}),d.on("mousedown.tt",function(a){a.preventDefault()})},_onSelectableClicked:function(a,b){this.select(b)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(a,b,c,d){this._updateHint(),this.eventBus.trigger("render",c,d,b)},_onAsyncRequested:function(a,b,c){this.eventBus.trigger("asyncrequest",c,b)},_onAsyncCanceled:function(a,b,c){this.eventBus.trigger("asynccancel",c,b)},_onAsyncReceived:function(a,b,c){this.eventBus.trigger("asyncreceive",c,b)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())&&this.select(c)&&b.preventDefault()},_onTabKeyed:function(a,b){var c;(c=this.menu.getActiveSelectable())?this.select(c)&&b.preventDefault():(c=this.menu.getTopSelectable())&&this.autocomplete(c)&&b.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(a,b){this._minLengthMet(b)?this.menu.update(b):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(a,b){this.dir!==b&&(this.dir=b,this.menu.setLanguageDirection(b))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(a){return a=b.isString(a)?a:this.input.getQuery()||"",a.length>=this.minLength},_updateHint:function(){var a,c,d,e,f,h,i;a=this.menu.getTopSelectable(),c=this.menu.getSelectableData(a),d=this.input.getInputValue(),!c||b.isBlankString(d)||this.input.hasOverflow()?this.input.clearHint():(e=g.normalizeQuery(d),f=b.escapeRegExChars(e),h=new RegExp("^(?:"+f+")(.+$)","i"),i=h.exec(c.val),i&&this.input.setHint(d+i[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return this.isActive()?!0:!this.isEnabled()||this.eventBus.before("active")?!1:(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return this.isActive()?this.eventBus.before("idle")?!1:(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0):!0},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(a){this.input.setQuery(b.toStr(a))},getVal:function(){return this.input.getQuery()},select:function(a){var b=this.menu.getSelectableData(a);return b&&!this.eventBus.before("select",b.obj)?(this.input.setQuery(b.val,!0),this.eventBus.trigger("select",b.obj),this.close(),!0):!1},autocomplete:function(a){var b,c,d;return b=this.input.getQuery(),c=this.menu.getSelectableData(a),d=c&&b!==c.val,d&&!this.eventBus.before("autocomplete",c.obj)?(this.input.setQuery(c.val),this.eventBus.trigger("autocomplete",c.obj),!0):!1},moveCursor:function(a){var b,c,d,e,f;return b=this.input.getQuery(),c=this.menu.selectableRelativeToCursor(a),d=this.menu.getSelectableData(c),e=d?d.obj:null,f=this._minLengthMet()&&this.menu.update(b),f||this.eventBus.before("cursorchange",e)?!1:(this.menu.setCursor(c),d?this.input.setInputValue(d.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",e),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),c}();!function(){"use strict";function e(b,c){b.each(function(){var b,d=a(this);(b=d.data(p.typeahead))&&c(b,d)})}function f(a,b){return a.clone().addClass(b.classes.hint).removeData().css(b.css.hint).css(l(a)).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1})}function h(a,b){a.data(p.attrs,{dir:a.attr("dir"),autocomplete:a.attr("autocomplete"),spellcheck:a.attr("spellcheck"),style:a.attr("style")}),a.addClass(b.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!a.attr("dir")&&a.attr("dir","auto")}catch(c){}return a}function l(a){return{backgroundAttachment:a.css("background-attachment"),backgroundClip:a.css("background-clip"),backgroundColor:a.css("background-color"),backgroundImage:a.css("background-image"),backgroundOrigin:a.css("background-origin"),backgroundPosition:a.css("background-position"),backgroundRepeat:a.css("background-repeat"),backgroundSize:a.css("background-size")}}function m(a){var c,d;c=a.data(p.www),d=a.parent().filter(c.selectors.wrapper),b.each(a.data(p.attrs),function(c,d){b.isUndefined(c)?a.removeAttr(d):a.attr(d,c)}),a.removeData(p.typeahead).removeData(p.www).removeData(p.attr).removeClass(c.classes.input),d.length&&(a.detach().insertAfter(d),d.remove())}function n(c){var d,e;return d=b.isJQuery(c)||b.isElement(c),e=d?a(c).first():[],e.length?e:null}var o,p,q;o=a.fn.typeahead,p={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},q={initialize:function(e,l){function m(){var c,m,q,r,s,t,u,v,w,x,y;b.each(l,function(a){a.highlight=!!e.highlight}),c=a(this),m=a(o.html.wrapper),q=n(e.hint),r=n(e.menu),s=e.hint!==!1&&!q,t=e.menu!==!1&&!r,s&&(q=f(c,o)),t&&(r=a(o.html.menu).css(o.css.menu)),q&&q.val(""),c=h(c,o),(s||t)&&(m.css(o.css.wrapper),c.css(s?o.css.input:o.css.inputWithNoHint),c.wrap(m).parent().prepend(s?q:null).append(t?r:null)),y=t?j:i,u=new d({el:c}),v=new g({hint:q,input:c},o),w=new y({node:r,datasets:l},o),x=new k({input:v,menu:w,eventBus:u,minLength:e.minLength},o),c.data(p.www,o),c.data(p.typeahead,x)}var o;return l=b.isArray(l)?l:[].slice.call(arguments,1),e=e||{},o=c(e.classNames),this.each(m)},isEnabled:function(){var a;return e(this.first(),function(b){a=b.isEnabled()}),a},enable:function(){return e(this,function(a){a.enable()}),this},disable:function(){return e(this,function(a){a.disable()}),this},isActive:function(){var a;return e(this.first(),function(b){a=b.isActive()}),a},activate:function(){return e(this,function(a){a.activate()}),this},deactivate:function(){return e(this,function(a){a.deactivate()}),this},isOpen:function(){var a;return e(this.first(),function(b){a=b.isOpen()}),a},open:function(){return e(this,function(a){a.open()}),this},close:function(){return e(this,function(a){a.close()}),this},select:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.select(d)}),c},autocomplete:function(b){var c=!1,d=a(b);return e(this.first(),function(a){c=a.autocomplete(d)}),c},moveCursor:function(a){var b=!1;return e(this.first(),function(c){b=c.moveCursor(a)}),b},val:function(a){var b;return arguments.length?(e(this,function(b){b.setVal(a)}),this):(e(this.first(),function(a){b=a.getVal()}),b)},destroy:function(){return e(this,function(a,b){m(b),a.destroy()}),this}},a.fn.typeahead=function(a){return q[a]?q[a].apply(this,[].slice.call(arguments,1)):q.initialize.apply(this,arguments)},a.fn.typeahead.noConflict=function(){return a.fn.typeahead=o,this}}()});
--------------------------------------------------------------------------------
/website/static/js/tippy.all.min.js:
--------------------------------------------------------------------------------
1 | (function(t,e){'object'==typeof exports&&'undefined'!=typeof module?module.exports=e():'function'==typeof define&&define.amd?define(e):t.tippy=e()})(this,function(){'use strict';function t(t){return'[object Object]'===Object.prototype.toString.call(t)}function a(e){if(e instanceof Element||t(e))return[e];if(e instanceof NodeList)return[].slice.call(e);if(Array.isArray(e))return e;try{return[].slice.call(document.querySelectorAll(e))}catch(t){return[]}}function r(t){for(var e=[!1,'webkit'],a=t.charAt(0).toUpperCase()+t.slice(1),r=0;r
\n \n \n \n '):w.classList.add('tippy-arrow'),x.appendChild(w)}if(l){x.setAttribute('data-animatefill','');var v=document.createElement('div');v.setAttribute('data-state','hidden'),v.classList.add('tippy-backdrop'),x.appendChild(v)}d&&x.setAttribute('data-inertia',''),u&&x.setAttribute('data-interactive','');var k=document.createElement('div');if(k.setAttribute('class','tippy-content'),h){var E;h instanceof Element?(k.appendChild(h),E='#'+h.id||'tippy-html-template'):(k.innerHTML=document.querySelector(h).innerHTML,E=h),g.setAttribute('data-html',''),u&&g.setAttribute('tabindex','-1'),x.setAttribute('data-template-id',E)}else k.innerHTML=e;return x.appendChild(k),g.appendChild(x),g}function p(t,e,a,i){var r=[];return'manual'===t?r:(e.addEventListener(t,a.handleTrigger),r.push({event:t,handler:a.handleTrigger}),'mouseenter'===t&&(Nt.supportsTouch&&i&&(e.addEventListener('touchstart',a.handleTrigger),r.push({event:'touchstart',handler:a.handleTrigger}),e.addEventListener('touchend',a.handleMouseleave),r.push({event:'touchend',handler:a.handleMouseleave})),e.addEventListener('mouseleave',a.handleMouseleave),r.push({event:'mouseleave',handler:a.handleMouseleave})),'focus'===t&&(e.addEventListener('blur',a.handleBlur),r.push({event:'blur',handler:a.handleBlur})),r)}function n(t,e){var a=Bt.reduce(function(a,i){var r=t.getAttribute('data-tippy-'+i.toLowerCase())||e[i];return'false'===r&&(r=!1),'true'===r&&(r=!0),isFinite(r)&&!isNaN(parseFloat(r))&&(r=parseFloat(r)),'string'==typeof r&&'['===r.trim().charAt(0)&&(r=JSON.parse(r)),a[i]=r,a},{});return _t({},e,a)}function s(t,e){return e.arrow&&(e.animateFill=!1),e.appendTo&&'function'==typeof e.appendTo&&(e.appendTo=e.appendTo()),'function'==typeof e.html&&(e.html=e.html(t)),e}function l(t){return{tooltip:t.querySelector(It.TOOLTIP),backdrop:t.querySelector(It.BACKDROP),content:t.querySelector(It.CONTENT)}}function d(t){var e=t.getAttribute('title');e&&t.setAttribute('data-original-title',e),t.removeAttribute('title')}function c(t){return t&&'[object Function]'==={}.toString.call(t)}function m(t,e){if(1!==t.nodeType)return[];var a=getComputedStyle(t,null);return e?a[e]:a}function f(t){return'HTML'===t.nodeName?t:t.parentNode||t.host}function h(t){if(!t)return document.body;switch(t.nodeName){case'HTML':case'BODY':return t.ownerDocument.body;case'#document':return t.body;}var e=m(t),a=e.overflow,i=e.overflowX,r=e.overflowY;return /(auto|scroll)/.test(a+r+i)?t:h(f(t))}function b(t){var e=t&&t.offsetParent,a=e&&e.nodeName;return a&&'BODY'!==a&&'HTML'!==a?-1!==['TD','TABLE'].indexOf(e.nodeName)&&'static'===m(e,'position')?b(e):e:t?t.ownerDocument.documentElement:document.documentElement}function u(t){var e=t.nodeName;return'BODY'!==e&&('HTML'===e||b(t.firstElementChild)===t)}function y(t){return null===t.parentNode?t:y(t.parentNode)}function g(t,e){if(!t||!t.nodeType||!e||!e.nodeType)return document.documentElement;var a=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=a?t:e,r=a?e:t,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var p=o.commonAncestorContainer;if(t!==p&&e!==p||i.contains(r))return u(p)?p:b(p);var n=y(t);return n.host?g(n.host,e):g(t,y(e).host)}function x(t){var e=1=a.clientWidth&&i>=a.clientHeight}),d=0o,bottom:r-n.bottom>o,left:n.left-i>o,right:i-n.right>o};return'top'===s?d.top=n.top-r>l:'bottom'===s?d.bottom=r-n.bottom>l:'left'===s?d.left=n.left-i>l:'right'===s?d.right=i-n.right>l:void 0,d.top||d.bottom||d.left||d.right}function ot(t,e,a,i){if(!e.length)return'';var r={scale:function(){return 1===e.length?''+e[0]:a?e[0]+', '+e[1]:e[1]+', '+e[0]}(),translate:function(){return 1===e.length?i?-e[0]+'px':e[0]+'px':a?i?e[0]+'px, '+-e[1]+'px':e[0]+'px, '+e[1]+'px':i?-e[1]+'px, '+e[0]+'px':e[1]+'px, '+e[0]+'px'}()};return r[t]}function pt(t,e){if(!t)return'';return e?t:{X:'Y',Y:'X'}[t]}function nt(t,e,a){var i=it(t),o='top'===i||'bottom'===i,p='right'===i||'bottom'===i,n=function(t){var e=a.match(t);return e?e[1]:''},s=function(t){var e=a.match(t);return e?e[1].split(',').map(parseFloat):[]},l={translate:/translateX?Y?\(([^)]+)\)/,scale:/scaleX?Y?\(([^)]+)\)/},d={translate:{axis:n(/translate([XY])/),numbers:s(l.translate)},scale:{axis:n(/scale([XY])/),numbers:s(l.scale)}},c=a.replace(l.translate,'translate'+pt(d.translate.axis,o)+'('+ot('translate',d.translate.numbers,o,p)+')').replace(l.scale,'scale'+pt(d.scale.axis,o)+'('+ot('scale',d.scale.numbers,o,p)+')');e.style[r('transform')]=c}function st(t){var e=t.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)}function lt(t){return-(t-Rt.distance)+'px'}function dt(t){requestAnimationFrame(function(){setTimeout(t,0)})}function ct(t,a){var i=Element.prototype.closest||function(t){for(var a=this;a;){if(e.call(a,t))return a;a=a.parentElement}};return i.call(t,a)}function mt(t,e){return Array.isArray(t)?t[e]:t}function ft(t,e){t.forEach(function(t){t&&t.setAttribute('data-state',e)})}function ht(t,e){t.forEach(function(t){t&&(t.style[r('transitionDuration')]=e+'ms')})}function bt(t){var e=this;if(wt.call(this),!this.state.visible){if(this.options.wait)return void this.options.wait.call(this.popper,this.show.bind(this),t);var a=Array.isArray(this.options.delay)?this.options.delay[0]:this.options.delay;a?this._internal.showTimeout=setTimeout(function(){e.show()},a):this.show()}}function ut(){var t=this;if(wt.call(this),!!this.state.visible){var e=Array.isArray(this.options.delay)?this.options.delay[1]:this.options.delay;e?this._internal.hideTimeout=setTimeout(function(){t.state.visible&&t.hide()},e):this.hide()}}function yt(){var t=this;return{handleTrigger:function(e){if(!t.state.disabled){var a=Nt.supportsTouch&&Nt.usingTouch&&('mouseenter'===e.type||'focus'===e.type);a&&t.options.touchHold||(t._internal.lastTriggerEvent=e,'click'===e.type&&'persistent'!==t.options.hideOnClick&&t.state.visible?ut.call(t):bt.call(t,e),a&&Nt.iOS&&t.reference.click&&t.reference.click())}},handleMouseleave:function(e){if(!('mouseleave'===e.type&&Nt.supportsTouch&&Nt.usingTouch&&t.options.touchHold)){if(t.options.interactive){var a=ut.bind(t),i=function e(i){var r=ct(i.target,It.REFERENCE),o=ct(i.target,It.POPPER)===t.popper,p=r===t.reference;o||p||rt(i,t.popper,t.options)&&(document.body.removeEventListener('mouseleave',a),document.removeEventListener('mousemove',e),ut.call(t))};return document.body.addEventListener('mouseleave',a),void document.addEventListener('mousemove',i)}ut.call(t)}},handleBlur:function(e){!e.relatedTarget||Nt.usingTouch||ct(e.relatedTarget,It.POPPER)||ut.call(t)}}}function gt(){var t=this,e=this.popper,a=this.reference,i=this.options,o=l(e),p=o.tooltip,n=i.popperOptions,s='round'===i.arrowType?It.ROUND_ARROW:It.ARROW,d=p.querySelector(s),c=_t({placement:i.placement},n||{},{modifiers:_t({},n?n.modifiers:{},{arrow:_t({element:s},n&&n.modifiers?n.modifiers.arrow:{}),flip:_t({enabled:i.flip,padding:i.distance+5,behavior:i.flipBehavior},n&&n.modifiers?n.modifiers.flip:{}),offset:_t({offset:i.offset},n&&n.modifiers?n.modifiers.offset:{})}),onCreate:function(){p.style[it(e)]=lt(i.distance),d&&i.arrowTransform&&nt(e,d,i.arrowTransform)},onUpdate:function(){var t=p.style;t.top='',t.bottom='',t.left='',t.right='',t[it(e)]=lt(i.distance),d&&i.arrowTransform&&nt(e,d,i.arrowTransform)}});return Et.call(this,{target:e,callback:function(){var a=e.style;a[r('transitionDuration')]='0ms',t.popperInstance.update(),dt(function(){a[r('transitionDuration')]=i.updateDuration+'ms'})},options:{childList:!0,subtree:!0,characterData:!0}}),new ee(a,e,c)}function xt(){var t=this,e=this.popper;this.options.appendTo.contains(e)||(this.options.appendTo.appendChild(e),this.popperInstance?(e.style[r('transform')]=null,this.popperInstance.update(),(!this.options.followCursor||Nt.usingTouch)&&this.popperInstance.enableEventListeners()):this.popperInstance=gt.call(this),this.options.followCursor&&!Nt.usingTouch&&(!this._internal.followCursorListener&&vt.call(this),document.addEventListener('mousemove',this._internal.followCursorListener),this.popperInstance.disableEventListeners(),dt(function(){t._internal.followCursorListener(t._internal.lastTriggerEvent)})))}function wt(){clearTimeout(this._internal.showTimeout),clearTimeout(this._internal.hideTimeout)}function vt(){var t=this;this._internal.followCursorListener=function(a){if(!(t._internal.lastTriggerEvent&&'focus'===t._internal.lastTriggerEvent.type)){var e,i,o=t.popper,p=t.options.offset,n=it(o),s=St(o.offsetWidth/2),l=St(o.offsetHeight/2),d=5,c=document.documentElement.offsetWidth||document.body.offsetWidth,m=a.pageX,f=a.pageY;'top'===n?(e=m-s+p,i=f-2*l):'bottom'===n?(e=m-s+p,i=f+10):'left'===n?(e=m-2*s,i=f-l+p):'right'===n?(e=m+5,i=f-l+p):void 0;('top'===n||'bottom'===n)&&(m+d+s+p>c&&(e=c-d-2*s),0>m-d-s+p&&(e=d)),o.style[r('transform')]='translate3d('+e+'px, '+i+'px, 0)'}}}function kt(){var t=this,e=function(){t.popper.style[r('transitionDuration')]=t.options.updateDuration+'ms'},a=function(){t.popper.style[r('transitionDuration')]=''};dt(function i(){t.popperInstance&&t.popperInstance.scheduleUpdate(),e(),t.state.visible?requestAnimationFrame(i):a()})}function Et(t){var e=t.target,a=t.callback,i=t.options;if(window.MutationObserver){var r=new MutationObserver(a);r.observe(e,i),this._internal.mutationObservers.push(r)}}function Tt(t,a){if(!t)return a();var e=l(this.popper),i=e.tooltip,r=function(t,e){e&&i[t+'EventListener']('ontransitionend'in window?'transitionend':'webkitTransitionEnd',e)},o=function t(o){o.target===i&&(r('remove',t),a())};r('remove',this._internal.transitionendListener),r('add',o),this._internal.transitionendListener=o}function Lt(t,e){return t.reduce(function(t,a){var i=oe,r=s(a,e.performance?e:n(a,e)),c=r.html,m=r.trigger,f=r.touchHold,h=r.dynamicTitle,b=r.createPopperInstanceOnInit,u=a.getAttribute('title');if(!u&&!c)return t;a.setAttribute('data-tippy',''),a.setAttribute('aria-describedby','tippy-'+i),d(a);var y=o(i,u,r),g=new re({id:i,reference:a,popper:y,options:r});g.popperInstance=b?gt.call(g):null;var x=yt.call(g);return g.listeners=m.trim().split(' ').reduce(function(t,e){return t.concat(p(e,a,x,f))},[]),h&&Et.call(g,{target:a,callback:function(){var t=l(y),e=t.content,i=a.getAttribute('title');i&&(e.innerHTML=i,d(a))},options:{attributes:!0}}),a._tippy=g,y._reference=a,t.push(g),oe++,t},[])}function Ot(t){var e=[].slice.call(document.querySelectorAll(It.POPPER));e.forEach(function(e){var a=e._reference._tippy,i=a.options;(!0===i.hideOnClick||-1e-t&&(Nt.usingTouch=!1,document.removeEventListener('mousemove',a),!Nt.iOS&&document.body.classList.remove('tippy-touch'),Nt.onUserInputChange('mouse')),t=e}}();document.addEventListener('click',function(t){if(!(t.target instanceof Element))return Ot();var e=ct(t.target,It.REFERENCE),a=ct(t.target,It.POPPER);if(!(a&&a._reference._tippy.options.interactive)){if(e){var i=e._tippy.options;if(!i.multiple&&Nt.usingTouch||!i.multiple&&-1i[t]&&!e.escapeWithReference&&(r=Yt(o[a],i[t]-('right'===t?o.width:o.height))),Zt({},a,r)}};return r.forEach(function(t){var e=-1===['left','top'].indexOf(t)?'secondary':'primary';o=Qt({},o,p[e](t))}),t.offsets.popper=o,t},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,a=e.popper,i=e.reference,r=t.placement.split('-')[0],o=Xt,p=-1!==['top','bottom'].indexOf(r),n=p?'right':'bottom',s=p?'left':'top',l=p?'width':'height';return a[n]o(i[n])&&(t.offsets.popper[s]=o(i[n])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var a;if(!$(t.instance.modifiers,'arrow','keepTogether'))return t;var i=e.element;if('string'==typeof i){if(i=t.instance.popper.querySelector(i),!i)return t;}else if(!t.instance.popper.contains(i))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),t;var r=t.placement.split('-')[0],o=t.offsets,p=o.popper,n=o.reference,s=-1!==['left','right'].indexOf(r),l=s?'height':'width',d=s?'Top':'Left',c=d.toLowerCase(),f=s?'left':'top',h=s?'bottom':'right',b=D(i)[l];n[h]-bp[h]&&(t.offsets.popper[c]+=n[c]+b-p[h]),t.offsets.popper=T(t.offsets.popper);var u=n[c]+n[l]/2-b/2,y=m(t.instance.popper),g=parseFloat(y['margin'+d],10),x=parseFloat(y['border'+d+'Width'],10),w=u-t.offsets.popper[c]-g-x;return w=Pt(Yt(p[l]-b,w),0),t.arrowElement=i,t.offsets.arrow=(a={},Zt(a,c,St(w)),Zt(a,f,''),a),t},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(t,e){if(_(t.instance.modifiers,'inner'))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var a=S(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement),i=t.placement.split('-')[0],r=N(i),o=t.placement.split('-')[1]||'',p=[];switch(e.behavior){case te.FLIP:p=[i,r];break;case te.CLOCKWISE:p=tt(i);break;case te.COUNTERCLOCKWISE:p=tt(i,!0);break;default:p=e.behavior;}return p.forEach(function(n,s){if(i!==n||p.length===s+1)return t;i=t.placement.split('-')[0],r=N(i);var l=t.offsets.popper,d=t.offsets.reference,c=Xt,m='left'===i&&c(l.right)>c(d.left)||'right'===i&&c(l.left)c(d.top)||'bottom'===i&&c(l.top)c(a.right),b=c(l.top)c(a.bottom),y='left'===i&&f||'right'===i&&h||'top'===i&&b||'bottom'===i&&u,g=-1!==['top','bottom'].indexOf(i),x=!!e.flipVariations&&(g&&'start'===o&&f||g&&'end'===o&&h||!g&&'start'===o&&b||!g&&'end'===o&&u);(m||y||x)&&(t.flipped=!0,(m||y)&&(i=p[s+1]),x&&(o=J(o)),t.placement=i+(o?'-'+o:''),t.offsets.popper=Qt({},t.offsets.popper,I(t.instance.popper,t.offsets.reference,t.placement)),t=W(t.instance.modifiers,t,'flip'))}),t},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,a=e.split('-')[0],i=t.offsets,r=i.popper,o=i.reference,p=-1!==['left','right'].indexOf(a),n=-1===['top','left'].indexOf(a);return r[p?'left':'top']=o[a]-(n?r[p?'width':'height']:0),t.placement=N(e),t.offsets.popper=T(r),t}},hide:{order:800,enabled:!0,fn:function(t){if(!$(t.instance.modifiers,'hide','preventOverflow'))return t;var e=t.offsets.reference,a=R(t.instance.modifiers,function(t){return'preventOverflow'===t.name}).boundaries;if(e.bottoma.right||e.top>a.bottom||e.right