okay it's done i think

This commit is contained in:
ix 2021-09-06 19:42:13 +02:00
parent 8cf4c891e8
commit 9e24750a1b
107 changed files with 8276 additions and 4414 deletions

Binary file not shown.

View File

@ -0,0 +1,81 @@
{% extends 'base.html' %}
{% block content %}
{% load i18n %}
<div class="row">
<div class="col-sm-12 col-md-9">
<div class="ctf-block">
<div class="ctf-head">
<h3>{{ ctf.name }}</h3>
<small>{% trans "Published date" %} : {{ ctf.pub_date }}</small>
</div>
<div class="ctf-body">
{{ ctf.description|safe }}
</div>
<div class="ctf-footer">
{% if request.user.is_authenticated %}
{% if valitated == True %}
<p>{% trans "Congratulation !" %}</p>
{% elif alvalitated == True %}
<p>{% trans "Already flagged" %}</p>
{% if ctf.ctf_url %}
<a class="begin-ctf-link" target="_blank" href="{{ ctf.ctf_url }}">{% trans "Start the challenge" %}</a></br>
{% elif ctf.file %}
<a class="begin-ctf-link" target="_blank" href="{{ ctf.file.url }}">{% trans "Download" %}</a></br>
{% endif %}
{% else %}
{% if failed %}
<p>{% trans "Wrong flag ! You can do it !" %}</p>
{% endif %}
{% if ctf.ctf_url %}
<a class="begin-ctf-link" target="_blank" href="{{ ctf.ctf_url }}">{% trans "Start the challenge" %}</a></br>
{% elif ctf.file %}
<a class="begin-ctf-link" target="_blank" href="{{ ctf.file.url }}">{% trans "Download" %}</a></br>
{% endif %}
<form method="post" class="submitflag-form">
{% csrf_token %}
<input type="text" name="flag" maxlength="48" required="" id="id_flag">
<input class="form-control" type="submit" value=">">
</form>
{% endif %}
{% endif %}
</div>
</div>
<div>
<h4>{% trans "Solved by" %}</h4>
{% if solved_list %}
<table class="table table-dark">
<thead>
<tr>
<th scope="col">{% trans "Username" %}</th>
<th scope="col">{% trans "Website" %}</th>
<th scope="col">{% trans "Score" %}</th>
<th scope="col">{% trans "Date" %}</th>
</tr>
</thead>
<tbody>
{% for s in solved_list %}
<tr>
<th scope="row"><a class="profile_link" href="/accounts/profile/{{ s.user.username }}"> {{ s.user.username }}</a></th>
<td>{{ s.user.userprofileinfo.portfolio_site }}</td>
<td>{{ s.user.userprofileinfo.score }}</td>
<td>{{ s.flag_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{% trans "Nobody have solved this CTF." %}</p>
{% endif %}
</div>
</div>
<div class="d-none d-md-block col-10 col-md-3 right-sidebar">
<ul class="list-group">
<li class="list-group-item">{% trans "Author" %} : {{ ctf.author.username }}</li>
<li class="list-group-item">{% trans "Point reward" %} : {{ ctf.points }}</li>
</ul>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,53 @@
{% extends 'base.html' %}
{% block content %}
{% load i18n %}
<div class="row">
<div class="col-sm-12 col-md-9 news-card">
<h3>{{ cat.name }}</h3>
{% if ctfs %}
<table class="table table-striped table-dark">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">{% trans "Username" %}</th>
<th scope="col">{% trans "Score" %}</th>
<th scope="col">{% trans "Solved" %}</th>
</tr>
</thead>
<tbody>
{% for ctf in ctfs %}
<tr>
{% if request.user.is_authenticated %}
{% if ctf.solved %}
<th scope="row" style="color:green;">&#10003;</th>
{% else %}
<th scope="row" style="color:red;">&#10005;</th>
{% endif %}
{% else %}
<th scope="row"> </th>
{% endif %}
<td><a href="/ctfs/{{ cat.slug }}/{{ ctf.slug }}">{{ ctf.name }}</td>
<td>{{ ctf.points }}</td>
<td>{{ ctf.solved_num }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{% trans "No ctf available for this category." %}</p>
{% endif %}
</div>
<div class="col-sm-12 col-md-3 right-sidebar">
<ul class="list-group">
<li class="list-group-item active">{% trans "Categories" %}</li>
{% if cats %}
{% for c in cats %}
<a class="list-group-item" href="/ctfs/{{ c.slug }}">{{ c.name }}</a>
{% endfor %}
{% else %}
<li class="list-group-item">{% trans "No category available." %}</li>
{% endif %}
</ul>
</div>
</div>
{% endblock %}

View File

@ -1,4 +1,4 @@
"" """
Django settings for project project. Django settings for project project.
Generated by 'django-admin startproject' using Django 2.2.5. Generated by 'django-admin startproject' using Django 2.2.5.
@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/2.2/ref/settings/
""" """
import os import os
from django.utils.translation import gettext_lazy as _
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@ -20,7 +21,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'secret_key_for_dev' SECRET_KEY = 'secret'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
@ -46,6 +47,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
@ -109,6 +111,21 @@ AUTH_PASSWORD_VALIDATORS = [
LANGUAGE_CODE = 'en-us' LANGUAGE_CODE = 'en-us'
LANGUAGE_COOKIE_NAME = 'django_language'
USE_I18N = True
LANGUAGES = (
('en', _("English")),
('de', _('German')),
('fr', _('French')),
('ru', _('Russian')),
)
LOCALE_PATHS = (
os.path.join(BASE_DIR, 'locale'),
)
TIME_ZONE = 'UTC' TIME_ZONE = 'UTC'
USE_I18N = True USE_I18N = True
@ -123,9 +140,23 @@ USE_TZ = True
SITE_ID = 1 SITE_ID = 1
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'statics'),) STATIC_ROOT = ''
if DEBUG:
#STATIC_ROOT = os.path.join(BASE_DIR, 'statics')
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'statics'),)
else:
STATIC_ROOT = '/home/user/42ctf/src/statics'
TEMPLATES[0]['OPTIONS']['context_processors'].append("ctfs.context_processors.cat_processor") TEMPLATES[0]['OPTIONS']['context_processors'].append("ctfs.context_processors.cat_processor")
MEDIA_URL = '/media/' MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
LOGIN_URL = '/accounts/signin/' LOGIN_URL = '/accounts/signin/'
EMAIL_BACKEND = 'django_mailjet.backends.MailjetBackend'
EMAIL_HOST = 'in-v3.mailjet.com'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = '42ctf <no-reply@42ctf.org>'
MAILJET_API_KEY = ''
MAILJET_API_SECRET = ''

View File

@ -14,7 +14,7 @@ select.admin-autocomplete {
.select2-container--admin-autocomplete.select2-container--focus .select2-selection, .select2-container--admin-autocomplete.select2-container--focus .select2-selection,
.select2-container--admin-autocomplete.select2-container--open .select2-selection { .select2-container--admin-autocomplete.select2-container--open .select2-selection {
border-color: #999; border-color: var(--body-quiet-color);
min-height: 30px; min-height: 30px;
} }
@ -29,13 +29,13 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete .select2-selection--single { .select2-container--admin-autocomplete .select2-selection--single {
background-color: #fff; background-color: var(--body-bg);
border: 1px solid #ccc; border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
} }
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered { .select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered {
color: #444; color: var(--body-fg);
line-height: 30px; line-height: 30px;
} }
@ -46,7 +46,7 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__placeholder { .select2-container--admin-autocomplete .select2-selection--single .select2-selection__placeholder {
color: #999; color: var(--body-quiet-color);
} }
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow { .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow {
@ -80,7 +80,7 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--single { .select2-container--admin-autocomplete.select2-container--disabled .select2-selection--single {
background-color: #eee; background-color: var(--darkened-bg);
cursor: default; cursor: default;
} }
@ -94,8 +94,8 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete .select2-selection--multiple { .select2-container--admin-autocomplete .select2-selection--multiple {
background-color: white; background-color: var(--body-bg);
border: 1px solid #ccc; border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
cursor: text; cursor: text;
} }
@ -104,8 +104,10 @@ select.admin-autocomplete {
box-sizing: border-box; box-sizing: border-box;
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0 5px; padding: 0 10px 5px 5px;
width: 100%; width: 100%;
display: flex;
flex-wrap: wrap;
} }
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__rendered li { .select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__rendered li {
@ -113,7 +115,7 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__placeholder { .select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__placeholder {
color: #999; color: var(--body-quiet-color);
margin-top: 5px; margin-top: 5px;
float: left; float: left;
} }
@ -123,11 +125,13 @@ select.admin-autocomplete {
float: right; float: right;
font-weight: bold; font-weight: bold;
margin: 5px; margin: 5px;
position: absolute;
right: 0;
} }
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice { .select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4; background-color: var(--darkened-bg);
border: 1px solid #ccc; border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
cursor: default; cursor: default;
float: left; float: left;
@ -137,7 +141,7 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice__remove { .select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice__remove {
color: #999; color: var(--body-quiet-color);
cursor: pointer; cursor: pointer;
display: inline-block; display: inline-block;
font-weight: bold; font-weight: bold;
@ -145,7 +149,7 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice__remove:hover { .select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; color: var(--body-fg);
} }
.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-search--inline { .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-search--inline {
@ -163,12 +167,12 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete.select2-container--focus .select2-selection--multiple { .select2-container--admin-autocomplete.select2-container--focus .select2-selection--multiple {
border: solid #999 1px; border: solid var(--body-quiet-color) 1px;
outline: 0; outline: 0;
} }
.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--multiple { .select2-container--admin-autocomplete.select2-container--disabled .select2-selection--multiple {
background-color: #eee; background-color: var(--darkened-bg);
cursor: default; cursor: default;
} }
@ -186,12 +190,20 @@ select.admin-autocomplete {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
} }
.select2-container--admin-autocomplete .select2-search--dropdown {
background: var(--darkened-bg);
}
.select2-container--admin-autocomplete .select2-search--dropdown .select2-search__field { .select2-container--admin-autocomplete .select2-search--dropdown .select2-search__field {
border: 1px solid #ccc; background: var(--body-bg);
color: var(--body-fg);
border: 1px solid var(--border-color);
border-radius: 4px;
} }
.select2-container--admin-autocomplete .select2-search--inline .select2-search__field { .select2-container--admin-autocomplete .select2-search--inline .select2-search__field {
background: transparent; background: transparent;
color: var(--body-fg);
border: none; border: none;
outline: 0; outline: 0;
box-shadow: none; box-shadow: none;
@ -201,6 +213,8 @@ select.admin-autocomplete {
.select2-container--admin-autocomplete .select2-results > .select2-results__options { .select2-container--admin-autocomplete .select2-results > .select2-results__options {
max-height: 200px; max-height: 200px;
overflow-y: auto; overflow-y: auto;
color: var(--body-fg);
background: var(--body-bg);
} }
.select2-container--admin-autocomplete .select2-results__option[role=group] { .select2-container--admin-autocomplete .select2-results__option[role=group] {
@ -208,11 +222,12 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete .select2-results__option[aria-disabled=true] { .select2-container--admin-autocomplete .select2-results__option[aria-disabled=true] {
color: #999; color: var(--body-quiet-color);
} }
.select2-container--admin-autocomplete .select2-results__option[aria-selected=true] { .select2-container--admin-autocomplete .select2-results__option[aria-selected=true] {
background-color: #ddd; background-color: var(--selected-bg);
color: var(--body-fg);
} }
.select2-container--admin-autocomplete .select2-results__option .select2-results__option { .select2-container--admin-autocomplete .select2-results__option .select2-results__option {
@ -249,8 +264,8 @@ select.admin-autocomplete {
} }
.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] { .select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] {
background-color: #79aec8; background-color: var(--primary);
color: white; color: var(--primary-fg);
} }
.select2-container--admin-autocomplete .select2-results__group { .select2-container--admin-autocomplete .select2-results__group {

View File

@ -4,24 +4,116 @@
@import url(fonts.css); @import url(fonts.css);
/* VARIABLE DEFINITIONS */
:root {
--primary: #79aec8;
--secondary: #417690;
--accent: #f5dd5d;
--primary-fg: #fff;
--body-fg: #333;
--body-bg: #fff;
--body-quiet-color: #666;
--body-loud-color: #000;
--header-color: #ffc;
--header-branding-color: var(--accent);
--header-bg: var(--secondary);
--header-link-color: var(--primary-fg);
--breadcrumbs-fg: #c4dce8;
--breadcrumbs-link-fg: var(--body-bg);
--breadcrumbs-bg: var(--primary);
--link-fg: #447e9b;
--link-hover-color: #036;
--link-selected-fg: #5b80b2;
--hairline-color: #e8e8e8;
--border-color: #ccc;
--error-fg: #ba2121;
--message-success-bg: #dfd;
--message-warning-bg: #ffc;
--message-error-bg: #ffefef;
--darkened-bg: #f8f8f8; /* A bit darker than --body-bg */
--selected-bg: #e4e4e4; /* E.g. selected table cells */
--selected-row: #ffc;
--button-fg: #fff;
--button-bg: var(--primary);
--button-hover-bg: #609ab6;
--default-button-bg: var(--secondary);
--default-button-hover-bg: #205067;
--close-button-bg: #888; /* Previously #bbb, contrast 1.92 */
--close-button-hover-bg: #747474;
--delete-button-bg: #ba2121;
--delete-button-hover-bg: #a41515;
--object-tools-fg: var(--button-fg);
--object-tools-bg: var(--close-button-bg);
--object-tools-hover-bg: var(--close-button-hover-bg);
}
@media (prefers-color-scheme: dark) {
:root {
--primary: #264b5d;
--primary-fg: #eee;
--body-fg: #eeeeee;
--body-bg: #121212;
--body-quiet-color: #e0e0e0;
--body-loud-color: #ffffff;
--breadcrumbs-link-fg: #e0e0e0;
--breadcrumbs-bg: var(--primary);
--link-fg: #81d4fa;
--link-hover-color: #4ac1f7;
--link-selected-fg: #6f94c6;
--hairline-color: #272727;
--border-color: #353535;
--error-fg: #e35f5f;
--message-success-bg: #006b1b;
--message-warning-bg: #583305;
--message-error-bg: #570808;
--darkened-bg: #212121;
--selected-bg: #1b1b1b;
--selected-row: #00363a;
--close-button-bg: #333333;
--close-button-hover-bg: #666666;
}
}
html, body {
height: 100%;
}
body { body {
margin: 0; margin: 0;
padding: 0; padding: 0;
font-size: 14px; font-size: 14px;
font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; font-family: "Roboto","Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif;
color: #333; color: var(--body-fg);
background: #fff; background: var(--body-bg);
} }
/* LINKS */ /* LINKS */
a:link, a:visited { a:link, a:visited {
color: #447e9b; color: var(--link-fg);
text-decoration: none; text-decoration: none;
transition: color 0.15s, background 0.15s;
} }
a:focus, a:hover { a:focus, a:hover {
color: #036; color: var(--link-hover-color);
} }
a:focus { a:focus {
@ -33,7 +125,7 @@ a img {
} }
a.section:link, a.section:visited { a.section:link, a.section:visited {
color: #fff; color: var(--header-link-color);
text-decoration: none; text-decoration: none;
} }
@ -60,7 +152,7 @@ h1 {
margin: 0 0 20px; margin: 0 0 20px;
font-weight: 300; font-weight: 300;
font-size: 20px; font-size: 20px;
color: #666; color: var(--body-quiet-color);
} }
h2 { h2 {
@ -76,7 +168,7 @@ h2.subhead {
h3 { h3 {
font-size: 14px; font-size: 14px;
margin: .8em 0 .3em 0; margin: .8em 0 .3em 0;
color: #666; color: var(--body-quiet-color);
font-weight: bold; font-weight: bold;
} }
@ -89,12 +181,12 @@ h4 {
h5 { h5 {
font-size: 10px; font-size: 10px;
margin: 1.5em 0 .5em 0; margin: 1.5em 0 .5em 0;
color: #666; color: var(--body-quiet-color);
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
} }
ul li { ul > li {
list-style-type: square; list-style-type: square;
padding: 1px 0; padding: 1px 0;
} }
@ -124,9 +216,10 @@ form {
fieldset { fieldset {
margin: 0; margin: 0;
min-width: 0;
padding: 0; padding: 0;
border: none; border: none;
border-top: 1px solid #eee; border-top: 1px solid var(--hairline-color);
} }
blockquote { blockquote {
@ -139,13 +232,14 @@ blockquote {
code, pre { code, pre {
font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace; font-family: "Bitstream Vera Sans Mono", Monaco, "Courier New", Courier, monospace;
color: #666; color: var(--body-quiet-color);
font-size: 12px; font-size: 12px;
overflow-x: auto;
} }
pre.literal-block { pre.literal-block {
margin: 10px; margin: 10px;
background: #eee; background: var(--darkened-bg);
padding: 6px 8px; padding: 6px 8px;
} }
@ -155,8 +249,8 @@ code strong {
hr { hr {
clear: both; clear: both;
color: #eee; color: var(--hairline-color);
background-color: #eee; background-color: var(--hairline-color);
height: 1px; height: 1px;
border: none; border: none;
margin: 0; margin: 0;
@ -171,25 +265,13 @@ hr {
font-size: 11px; font-size: 11px;
} }
.tiny {
font-size: 10px;
}
p.tiny {
margin-top: -2px;
}
.mini { .mini {
font-size: 10px; font-size: 10px;
} }
p.mini {
margin-top: -3px;
}
.help, p.help, form p.help, div.help, form div.help, div.help li { .help, p.help, form p.help, div.help, form div.help, div.help li {
font-size: 11px; font-size: 11px;
color: #999; color: var(--body-quiet-color);
} }
div.help ul { div.help ul {
@ -205,54 +287,35 @@ p img, h1 img, h2 img, h3 img, h4 img, td img {
} }
.quiet, a.quiet:link, a.quiet:visited { .quiet, a.quiet:link, a.quiet:visited {
color: #999; color: var(--body-quiet-color);
font-weight: normal; font-weight: normal;
} }
.float-right {
float: right;
}
.float-left {
float: left;
}
.clear { .clear {
clear: both; clear: both;
} }
.align-left {
text-align: left;
}
.align-right {
text-align: right;
}
.example {
margin: 10px 0;
padding: 5px 10px;
background: #efefef;
}
.nowrap { .nowrap {
white-space: nowrap; white-space: nowrap;
} }
.hidden {
display: none;
}
/* TABLES */ /* TABLES */
table { table {
border-collapse: collapse; border-collapse: collapse;
border-color: #ccc; border-color: var(--border-color);
} }
td, th { td, th {
font-size: 13px; font-size: 13px;
line-height: 16px; line-height: 16px;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
vertical-align: top; vertical-align: top;
padding: 8px; padding: 8px;
font-family: "Roboto", "Lucida Grande", Verdana, Arial, sans-serif;
} }
th { th {
@ -262,34 +325,37 @@ th {
thead th, thead th,
tfoot td { tfoot td {
color: #666; color: var(--body-quiet-color);
padding: 5px 10px; padding: 5px 10px;
font-size: 11px; font-size: 11px;
background: #fff; background: var(--body-bg);
border: none; border: none;
border-top: 1px solid #eee; border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
} }
tfoot td { tfoot td {
border-bottom: none; border-bottom: none;
border-top: 1px solid #eee; border-top: 1px solid var(--hairline-color);
} }
thead th.required { thead th.required {
color: #000; color: var(--body-loud-color);
} }
tr.alt { tr.alt {
background: #f6f6f6; background: var(--darkened-bg);
} }
.row1 { tr:nth-child(odd), .row-form-errors {
background: #fff; background: var(--body-bg);
} }
.row2 { tr:nth-child(even),
background: #f9f9f9; tr:nth-child(even) .errorlist,
tr:nth-child(odd) + .row-form-errors,
tr:nth-child(odd) + .row-form-errors .errorlist {
background: var(--darkened-bg);
} }
/* SORTABLE TABLES */ /* SORTABLE TABLES */
@ -298,15 +364,15 @@ thead th {
padding: 5px 10px; padding: 5px 10px;
line-height: normal; line-height: normal;
text-transform: uppercase; text-transform: uppercase;
background: #f6f6f6; background: var(--darkened-bg);
} }
thead th a:link, thead th a:visited { thead th a:link, thead th a:visited {
color: #666; color: var(--body-quiet-color);
} }
thead th.sorted { thead th.sorted {
background: #eee; background: var(--selected-bg);
} }
thead th.sorted .text { thead th.sorted .text {
@ -325,7 +391,7 @@ table thead th .text a {
} }
table thead th .text a:focus, table thead th .text a:hover { table thead th .text a:focus, table thead th .text a:hover {
background: #eee; background: var(--selected-bg);
} }
thead th.sorted a.sortremove { thead th.sorted a.sortremove {
@ -372,12 +438,12 @@ table thead th.sorted .sortoptions a.sortremove:after {
left: 3px; left: 3px;
font-weight: 200; font-weight: 200;
font-size: 18px; font-size: 18px;
color: #999; color: var(--body-quiet-color);
} }
table thead th.sorted .sortoptions a.sortremove:focus:after, table thead th.sorted .sortoptions a.sortremove:focus:after,
table thead th.sorted .sortoptions a.sortremove:hover:after { table thead th.sorted .sortoptions a.sortremove:hover:after {
color: #447e9b; color: var(--link-fg);
} }
table thead th.sorted .sortoptions a.sortremove:focus, table thead th.sorted .sortoptions a.sortremove:focus,
@ -424,16 +490,18 @@ textarea {
input[type=text], input[type=password], input[type=email], input[type=url], input[type=text], input[type=password], input[type=email], input[type=url],
input[type=number], input[type=tel], textarea, select, .vTextField { input[type=number], input[type=tel], textarea, select, .vTextField {
border: 1px solid #ccc; border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
padding: 5px 6px; padding: 5px 6px;
margin-top: 0; margin-top: 0;
color: var(--body-fg);
background-color: var(--body-bg);
} }
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, input[type=text]:focus, input[type=password]:focus, input[type=email]:focus,
input[type=url]:focus, input[type=number]:focus, input[type=tel]:focus, input[type=url]:focus, input[type=number]:focus, input[type=tel]:focus,
textarea:focus, select:focus, .vTextField:focus { textarea:focus, select:focus, .vTextField:focus {
border-color: #999; border-color: var(--body-quiet-color);
} }
select { select {
@ -449,12 +517,13 @@ select[multiple] {
/* FORM BUTTONS */ /* FORM BUTTONS */
.button, input[type=submit], input[type=button], .submit-row input, a.button { .button, input[type=submit], input[type=button], .submit-row input, a.button {
background: #79aec8; background: var(--button-bg);
padding: 10px 15px; padding: 10px 15px;
border: none; border: none;
border-radius: 4px; border-radius: 4px;
color: #fff; color: var(--button-fg);
cursor: pointer; cursor: pointer;
transition: background 0.15s;
} }
a.button { a.button {
@ -464,7 +533,7 @@ a.button {
.button:active, input[type=submit]:active, input[type=button]:active, .button:active, input[type=submit]:active, input[type=button]:active,
.button:focus, input[type=submit]:focus, input[type=button]:focus, .button:focus, input[type=submit]:focus, input[type=button]:focus,
.button:hover, input[type=submit]:hover, input[type=button]:hover { .button:hover, input[type=submit]:hover, input[type=button]:hover {
background: #609ab6; background: var(--button-hover-bg);
} }
.button[disabled], input[type=submit][disabled], input[type=button][disabled] { .button[disabled], input[type=submit][disabled], input[type=button][disabled] {
@ -475,13 +544,13 @@ a.button {
float: right; float: right;
border: none; border: none;
font-weight: 400; font-weight: 400;
background: #417690; background: var(--default-button-bg);
} }
.button.default:active, input[type=submit].default:active, .button.default:active, input[type=submit].default:active,
.button.default:focus, input[type=submit].default:focus, .button.default:focus, input[type=submit].default:focus,
.button.default:hover, input[type=submit].default:hover { .button.default:hover, input[type=submit].default:hover {
background: #205067; background: var(--default-button-hover-bg);
} }
.button[disabled].default, .button[disabled].default,
@ -496,7 +565,7 @@ input[type=button][disabled].default {
.module { .module {
border: none; border: none;
margin-bottom: 30px; margin-bottom: 30px;
background: #fff; background: var(--body-bg);
} }
.module p, .module ul, .module h3, .module h4, .module dl, .module pre { .module p, .module ul, .module h3, .module h4, .module dl, .module pre {
@ -522,8 +591,8 @@ input[type=button][disabled].default {
font-weight: 400; font-weight: 400;
font-size: 13px; font-size: 13px;
text-align: left; text-align: left;
background: #79aec8; background: var(--primary);
color: #fff; color: var(--header-link-color);
} }
.module caption, .module caption,
@ -550,18 +619,18 @@ ul.messagelist li {
font-size: 13px; font-size: 13px;
padding: 10px 10px 10px 65px; padding: 10px 10px 10px 65px;
margin: 0 0 10px 0; margin: 0 0 10px 0;
background: #dfd url(../img/icon-yes.svg) 40px 12px no-repeat; background: var(--message-success-bg) url(../img/icon-yes.svg) 40px 12px no-repeat;
background-size: 16px auto; background-size: 16px auto;
color: #333; color: var(--body-fg);
} }
ul.messagelist li.warning { ul.messagelist li.warning {
background: #ffc url(../img/icon-alert.svg) 40px 14px no-repeat; background: var(--message-warning-bg) url(../img/icon-alert.svg) 40px 14px no-repeat;
background-size: 14px auto; background-size: 14px auto;
} }
ul.messagelist li.error { ul.messagelist li.error {
background: #ffefef url(../img/icon-no.svg) 40px 12px no-repeat; background: var(--message-error-bg) url(../img/icon-no.svg) 40px 12px no-repeat;
background-size: 16px auto; background-size: 16px auto;
} }
@ -571,24 +640,26 @@ ul.messagelist li.error {
display: block; display: block;
padding: 10px 12px; padding: 10px 12px;
margin: 0 0 10px 0; margin: 0 0 10px 0;
color: #ba2121; color: var(--error-fg);
border: 1px solid #ba2121; border: 1px solid var(--error-fg);
border-radius: 4px; border-radius: 4px;
background-color: #fff; background-color: var(--body-bg);
background-position: 5px 12px; background-position: 5px 12px;
overflow-wrap: break-word;
} }
ul.errorlist { ul.errorlist {
margin: 0 0 4px; margin: 0 0 4px;
padding: 0; padding: 0;
color: #ba2121; color: var(--error-fg);
background: #fff; background: var(--body-bg);
} }
ul.errorlist li { ul.errorlist li {
font-size: 13px; font-size: 13px;
display: block; display: block;
margin-bottom: 4px; margin-bottom: 4px;
overflow-wrap: break-word;
} }
ul.errorlist li:first-child { ul.errorlist li:first-child {
@ -612,7 +683,7 @@ td ul.errorlist li {
.form-row.errors { .form-row.errors {
margin: 0; margin: 0;
border: none; border: none;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
background: none; background: none;
} }
@ -620,22 +691,9 @@ td ul.errorlist li {
padding-left: 0; padding-left: 0;
} }
.errors input, .errors select, .errors textarea { .errors input, .errors select, .errors textarea,
border: 1px solid #ba2121; td ul.errorlist + input, td ul.errorlist + select, td ul.errorlist + textarea {
} border: 1px solid var(--error-fg);
div.system-message {
background: #ffc;
margin: 10px;
padding: 6px 8px;
font-size: .8em;
}
div.system-message p.system-message-title {
padding: 4px 5px 4px 25px;
margin: 0;
color: #c11;
background: #ffefef url(../img/icon-no.svg) 5px 5px no-repeat;
} }
.description { .description {
@ -646,20 +704,19 @@ div.system-message p.system-message-title {
/* BREADCRUMBS */ /* BREADCRUMBS */
div.breadcrumbs { div.breadcrumbs {
background: #79aec8; background: var(--breadcrumbs-bg);
padding: 10px 40px; padding: 10px 40px;
border: none; border: none;
font-size: 14px; color: var(--breadcrumbs-fg);
color: #c4dce8;
text-align: left; text-align: left;
} }
div.breadcrumbs a { div.breadcrumbs a {
color: #fff; color: var(--breadcrumbs-link-fg);
} }
div.breadcrumbs a:focus, div.breadcrumbs a:hover { div.breadcrumbs a:focus, div.breadcrumbs a:hover {
color: #c4dce8; color: var(--breadcrumbs-fg);
} }
/* ACTION ICONS */ /* ACTION ICONS */
@ -685,11 +742,11 @@ div.breadcrumbs a:focus, div.breadcrumbs a:hover {
} }
a.deletelink:link, a.deletelink:visited { a.deletelink:link, a.deletelink:visited {
color: #CC3434; color: #CC3434; /* XXX Probably unused? */
} }
a.deletelink:focus, a.deletelink:hover { a.deletelink:focus, a.deletelink:hover {
color: #993333; color: #993333; /* XXX Probably unused? */
text-decoration: none; text-decoration: none;
} }
@ -704,14 +761,6 @@ a.deletelink:focus, a.deletelink:hover {
margin-top: -48px; margin-top: -48px;
} }
.form-row .object-tools {
margin-top: 5px;
margin-bottom: 5px;
float: none;
height: 2em;
padding-left: 3.5em;
}
.object-tools li { .object-tools li {
display: block; display: block;
float: left; float: left;
@ -727,29 +776,29 @@ a.deletelink:focus, a.deletelink:hover {
display: block; display: block;
float: left; float: left;
padding: 3px 12px; padding: 3px 12px;
background: #999; background: var(--object-tools-bg);
color: var(--object-tools-fg);
font-weight: 400; font-weight: 400;
font-size: 11px; font-size: 11px;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.5px; letter-spacing: 0.5px;
color: #fff;
} }
.object-tools a:focus, .object-tools a:hover { .object-tools a:focus, .object-tools a:hover {
background-color: #417690; background-color: var(--object-tools-hover-bg);
} }
.object-tools a:focus{ .object-tools a:focus{
text-decoration: none; text-decoration: none;
} }
.object-tools a.viewsitelink, .object-tools a.golink,.object-tools a.addlink { .object-tools a.viewsitelink, .object-tools a.addlink {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: right 7px center; background-position: right 7px center;
padding-right: 26px; padding-right: 26px;
} }
.object-tools a.viewsitelink, .object-tools a.golink { .object-tools a.viewsitelink {
background-image: url(../img/tooltag-arrowright.svg); background-image: url(../img/tooltag-arrowright.svg);
} }
@ -774,6 +823,23 @@ table#change-history tbody th {
width: 100%; width: 100%;
min-width: 980px; min-width: 980px;
padding: 0; padding: 0;
display: flex;
flex-direction: column;
height: 100%;
}
#container > div {
flex-shrink: 0;
}
#container > .main {
display: flex;
flex: 1 0 auto;
}
.main > .content {
flex: 1 0;
max-width: 100%;
} }
#content { #content {
@ -834,13 +900,13 @@ table#change-history tbody th {
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 10px 40px; padding: 10px 40px;
background: #417690; background: var(--header-bg);
color: #ffc; color: var(--header-color);
overflow: hidden; overflow: hidden;
} }
#header a:link, #header a:visited { #header a:link, #header a:visited {
color: #fff; color: var(--header-link-color);
} }
#header a:focus , #header a:hover { #header a:focus , #header a:hover {
@ -856,11 +922,11 @@ table#change-history tbody th {
margin: 0 20px 0 0; margin: 0 20px 0 0;
font-weight: 300; font-weight: 300;
font-size: 24px; font-size: 24px;
color: #f5dd5d; color: var(--accent);
} }
#branding h1, #branding h1 a:link, #branding h1 a:visited { #branding h1, #branding h1 a:link, #branding h1 a:visited {
color: #f5dd5d; color: var(--accent);
} }
#branding h2 { #branding h2 {
@ -868,7 +934,7 @@ table#change-history tbody th {
font-size: 14px; font-size: 14px;
margin: -8px 0 8px 0; margin: -8px 0 8px 0;
font-weight: normal; font-weight: normal;
color: #ffc; color: var(--header-color);
} }
#branding a:hover { #branding a:hover {
@ -892,14 +958,14 @@ table#change-history tbody th {
#user-tools a:focus, #user-tools a:hover { #user-tools a:focus, #user-tools a:hover {
text-decoration: none; text-decoration: none;
border-bottom-color: #79aec8; border-bottom-color: var(--primary);
color: #79aec8; color: var(--primary);
} }
/* SIDEBAR */ /* SIDEBAR */
#content-related { #content-related {
background: #f8f8f8; background: var(--darkened-bg);
} }
#content-related .module { #content-related .module {
@ -907,8 +973,7 @@ table#change-history tbody th {
} }
#content-related h3 { #content-related h3 {
font-size: 14px; color: var(--body-quiet-color);
color: #666;
padding: 0 16px; padding: 0 16px;
margin: 0 0 16px; margin: 0 0 16px;
} }
@ -937,22 +1002,22 @@ table#change-history tbody th {
background: none; background: none;
padding: 16px; padding: 16px;
margin-bottom: 16px; margin-bottom: 16px;
border-bottom: 1px solid #eaeaea; border-bottom: 1px solid var(--hairline-color);
font-size: 18px; font-size: 18px;
color: #333; color: var(--body-fg);
} }
.delete-confirmation form input[type="submit"] { .delete-confirmation form input[type="submit"] {
background: #ba2121; background: var(--delete-button-bg);
border-radius: 4px; border-radius: 4px;
padding: 10px 15px; padding: 10px 15px;
color: #fff; color: var(--button-fg);
} }
.delete-confirmation form input[type="submit"]:active, .delete-confirmation form input[type="submit"]:active,
.delete-confirmation form input[type="submit"]:focus, .delete-confirmation form input[type="submit"]:focus,
.delete-confirmation form input[type="submit"]:hover { .delete-confirmation form input[type="submit"]:hover {
background: #a41515; background: var(--delete-button-hover-bg);
} }
.delete-confirmation form .cancel-link { .delete-confirmation form .cancel-link {
@ -960,17 +1025,17 @@ table#change-history tbody th {
vertical-align: middle; vertical-align: middle;
height: 15px; height: 15px;
line-height: 15px; line-height: 15px;
background: #ddd;
border-radius: 4px; border-radius: 4px;
padding: 10px 15px; padding: 10px 15px;
color: #333; color: var(--button-fg);
background: var(--close-button-bg);
margin: 0 0 0 10px; margin: 0 0 0 10px;
} }
.delete-confirmation form .cancel-link:active, .delete-confirmation form .cancel-link:active,
.delete-confirmation form .cancel-link:focus, .delete-confirmation form .cancel-link:focus,
.delete-confirmation form .cancel-link:hover { .delete-confirmation form .cancel-link:hover {
background: #ccc; background: var(--close-button-hover-bg);
} }
/* POPUP */ /* POPUP */

View File

@ -1,8 +1,14 @@
/* CHANGELISTS */ /* CHANGELISTS */
#changelist { #changelist {
position: relative; display: flex;
width: 100%; align-items: flex-start;
justify-content: space-between;
}
#changelist .changelist-form-container {
flex: 1 1 auto;
min-width: 0;
} }
#changelist table { #changelist table {
@ -21,7 +27,6 @@
.change-list .filtered .results, .change-list .filtered .paginator, .change-list .filtered .results, .change-list .filtered .paginator,
.filtered #toolbar, .filtered div.xfull { .filtered #toolbar, .filtered div.xfull {
margin-right: 280px;
width: auto; width: auto;
} }
@ -31,16 +36,17 @@
#changelist-form .results { #changelist-form .results {
overflow-x: auto; overflow-x: auto;
width: 100%;
} }
#changelist .toplinks { #changelist .toplinks {
border-bottom: 1px solid #ddd; border-bottom: 1px solid var(--hairline-color);
} }
#changelist .paginator { #changelist .paginator {
color: #666; color: var(--body-quiet-color);
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
background: #fff; background: var(--body-bg);
overflow: hidden; overflow: hidden;
} }
@ -62,57 +68,59 @@
} }
#changelist table tfoot { #changelist table tfoot {
color: #666; color: var(--body-quiet-color);
} }
/* TOOLBAR */ /* TOOLBAR */
#changelist #toolbar { #toolbar {
padding: 8px 10px; padding: 8px 10px;
margin-bottom: 15px; margin-bottom: 15px;
border-top: 1px solid #eee; border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
background: #f8f8f8; background: var(--darkened-bg);
color: #666; color: var(--body-quiet-color);
} }
#changelist #toolbar form input { #toolbar form input {
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
padding: 5px; padding: 5px;
color: #333; color: var(--body-fg);
} }
#changelist #toolbar form #searchbar { #toolbar #searchbar {
height: 19px; height: 19px;
border: 1px solid #ccc; border: 1px solid var(--border-color);
padding: 2px 5px; padding: 2px 5px;
margin: 0; margin: 0;
vertical-align: top; vertical-align: top;
font-size: 13px; font-size: 13px;
max-width: 100%;
} }
#changelist #toolbar form #searchbar:focus { #toolbar #searchbar:focus {
border-color: #999; border-color: var(--body-quiet-color);
} }
#changelist #toolbar form input[type="submit"] { #toolbar form input[type="submit"] {
border: 1px solid #ccc; border: 1px solid var(--border-color);
padding: 2px 10px; font-size: 13px;
padding: 4px 8px;
margin: 0; margin: 0;
vertical-align: middle; vertical-align: middle;
background: #fff; background: var(--body-bg);
box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset; box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
cursor: pointer; cursor: pointer;
color: #333; color: var(--body-fg);
} }
#changelist #toolbar form input[type="submit"]:focus, #toolbar form input[type="submit"]:focus,
#changelist #toolbar form input[type="submit"]:hover { #toolbar form input[type="submit"]:hover {
border-color: #999; border-color: var(--body-quiet-color);
} }
#changelist #changelist-search img { #changelist-search img {
vertical-align: middle; vertical-align: middle;
margin-right: 4px; margin-right: 4px;
} }
@ -120,14 +128,11 @@
/* FILTER COLUMN */ /* FILTER COLUMN */
#changelist-filter { #changelist-filter {
position: absolute; flex: 0 0 240px;
top: 0; order: 1;
right: 0; background: var(--darkened-bg);
z-index: 1000;
width: 240px;
background: #f8f8f8;
border-left: none; border-left: none;
margin: 0; margin: 0 0 0 30px;
} }
#changelist-filter h2 { #changelist-filter h2 {
@ -141,7 +146,6 @@
#changelist-filter h3 { #changelist-filter h3 {
font-weight: 400; font-weight: 400;
font-size: 14px;
padding: 0 15px; padding: 0 15px;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -149,12 +153,11 @@
#changelist-filter ul { #changelist-filter ul {
margin: 5px 0; margin: 5px 0;
padding: 0 15px 15px; padding: 0 15px 15px;
border-bottom: 1px solid #eaeaea; border-bottom: 1px solid var(--hairline-color);
} }
#changelist-filter ul:last-child { #changelist-filter ul:last-child {
border-bottom: none; border-bottom: none;
padding-bottom: none;
} }
#changelist-filter li { #changelist-filter li {
@ -165,25 +168,31 @@
#changelist-filter a { #changelist-filter a {
display: block; display: block;
color: #999; color: var(--body-quiet-color);
text-overflow: ellipsis; text-overflow: ellipsis;
overflow-x: hidden; overflow-x: hidden;
} }
#changelist-filter li.selected { #changelist-filter li.selected {
border-left: 5px solid #eaeaea; border-left: 5px solid var(--hairline-color);
padding-left: 10px; padding-left: 10px;
margin-left: -15px; margin-left: -15px;
} }
#changelist-filter li.selected a { #changelist-filter li.selected a {
color: #5b80b2; color: var(--link-selected-fg);
} }
#changelist-filter a:focus, #changelist-filter a:hover, #changelist-filter a:focus, #changelist-filter a:hover,
#changelist-filter li.selected a:focus, #changelist-filter li.selected a:focus,
#changelist-filter li.selected a:hover { #changelist-filter li.selected a:hover {
color: #036; color: var(--link-hover-color);
}
#changelist-filter #changelist-filter-clear a {
font-size: 13px;
padding-bottom: 10px;
border-bottom: 1px solid var(--hairline-color);
} }
/* DATE DRILLDOWN */ /* DATE DRILLDOWN */
@ -204,12 +213,12 @@
} }
.change-list ul.toplinks .date-back a { .change-list ul.toplinks .date-back a {
color: #999; color: var(--body-quiet-color);
} }
.change-list ul.toplinks .date-back a:focus, .change-list ul.toplinks .date-back a:focus,
.change-list ul.toplinks .date-back a:hover { .change-list ul.toplinks .date-back a:hover {
color: #036; color: var(--link-hover-color);
} }
/* PAGINATOR */ /* PAGINATOR */
@ -220,26 +229,26 @@
padding-bottom: 10px; padding-bottom: 10px;
line-height: 22px; line-height: 22px;
margin: 0; margin: 0;
border-top: 1px solid #ddd; border-top: 1px solid var(--hairline-color);
width: 100%;
} }
.paginator a:link, .paginator a:visited { .paginator a:link, .paginator a:visited {
padding: 2px 6px; padding: 2px 6px;
background: #79aec8; background: var(--button-bg);
text-decoration: none; text-decoration: none;
color: #fff; color: var(--button-fg);
} }
.paginator a.showall { .paginator a.showall {
padding: 0;
border: none; border: none;
background: none; background: none;
color: #5b80b2; color: var(--link-fg);
} }
.paginator a.showall:focus, .paginator a.showall:hover { .paginator a.showall:focus, .paginator a.showall:hover {
background: none; background: none;
color: #036; color: var(--link-hover-color);
} }
.paginator .end { .paginator .end {
@ -255,13 +264,12 @@
.paginator a:focus, .paginator a:hover { .paginator a:focus, .paginator a:hover {
color: white; color: white;
background: #036; background: var(--link-hover-color);
} }
/* ACTIONS */ /* ACTIONS */
.filtered .actions { .filtered .actions {
margin-right: 280px;
border-right: none; border-right: none;
} }
@ -271,21 +279,22 @@
} }
#changelist table tbody tr.selected { #changelist table tbody tr.selected {
background-color: #FFFFCC; background-color: var(--selected-row);
} }
#changelist .actions { #changelist .actions {
padding: 10px; padding: 10px;
background: #fff; background: var(--body-bg);
border-top: none; border-top: none;
border-bottom: none; border-bottom: none;
line-height: 24px; line-height: 24px;
color: #999; color: var(--body-quiet-color);
width: 100%;
} }
#changelist .actions.selected { #changelist .actions.selected { /* XXX Probably unused? */
background: #fffccf; background: var(--body-bg);
border-top: 1px solid #fffee8; border-top: 1px solid var(--body-bg);
border-bottom: 1px solid #edecd6; border-bottom: 1px solid #edecd6;
} }
@ -295,7 +304,6 @@
#changelist .actions span.question { #changelist .actions span.question {
font-size: 13px; font-size: 13px;
margin: 0 0.5em; margin: 0 0.5em;
display: none;
} }
#changelist .actions:last-child { #changelist .actions:last-child {
@ -305,9 +313,8 @@
#changelist .actions select { #changelist .actions select {
vertical-align: top; vertical-align: top;
height: 24px; height: 24px;
background: none; color: var(--body-fg);
color: #000; border: 1px solid var(--border-color);
border: 1px solid #ccc;
border-radius: 4px; border-radius: 4px;
font-size: 14px; font-size: 14px;
padding: 0 0 0 4px; padding: 0 0 0 4px;
@ -316,7 +323,7 @@
} }
#changelist .actions select:focus { #changelist .actions select:focus {
border-color: #999; border-color: var(--body-quiet-color);
} }
#changelist .actions label { #changelist .actions label {
@ -327,18 +334,18 @@
#changelist .actions .button { #changelist .actions .button {
font-size: 13px; font-size: 13px;
border: 1px solid #ccc; border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
background: #fff; background: var(--body-bg);
box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset; box-shadow: 0 -15px 20px -10px rgba(0, 0, 0, 0.15) inset;
cursor: pointer; cursor: pointer;
height: 24px; height: 24px;
line-height: 1; line-height: 1;
padding: 4px 8px; padding: 4px 8px;
margin: 0; margin: 0;
color: #333; color: var(--body-fg);
} }
#changelist .actions .button:focus, #changelist .actions .button:hover { #changelist .actions .button:focus, #changelist .actions .button:hover {
border-color: #999; border-color: var(--body-quiet-color);
} }

View File

@ -23,5 +23,4 @@ ul.actionlist li {
list-style-type: none; list-style-type: none;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
-o-text-overflow: ellipsis;
} }

View File

@ -6,7 +6,7 @@
overflow: hidden; overflow: hidden;
padding: 10px; padding: 10px;
font-size: 13px; font-size: 13px;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
} }
.form-row img, .form-row input { .form-row img, .form-row input {
@ -22,21 +22,17 @@ form .form-row p {
padding-left: 0; padding-left: 0;
} }
.hidden {
display: none;
}
/* FORM LABELS */ /* FORM LABELS */
label { label {
font-weight: normal; font-weight: normal;
color: #666; color: var(--body-quiet-color);
font-size: 13px; font-size: 13px;
} }
.required label, label.required { .required label, label.required {
font-weight: bold; font-weight: bold;
color: #333; color: var(--body-fg);
} }
/* RADIO BUTTONS */ /* RADIO BUTTONS */
@ -219,24 +215,24 @@ fieldset.collapsed h2, fieldset.collapsed {
} }
fieldset.collapsed { fieldset.collapsed {
border: 1px solid #eee; border: 1px solid var(--hairline-color);
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
} }
fieldset.collapsed h2 { fieldset.collapsed h2 {
background: #f8f8f8; background: var(--darkened-bg);
color: #666; color: var(--body-quiet-color);
} }
fieldset .collapse-toggle { fieldset .collapse-toggle {
color: #fff; color: var(--header-link-color);
} }
fieldset.collapsed .collapse-toggle { fieldset.collapsed .collapse-toggle {
background: transparent; background: transparent;
display: inline; display: inline;
color: #447e9b; color: var(--link-fg);
} }
/* MONOSPACE TEXTAREAS */ /* MONOSPACE TEXTAREAS */
@ -250,8 +246,8 @@ fieldset.monospace textarea {
.submit-row { .submit-row {
padding: 12px 14px; padding: 12px 14px;
margin: 0 0 20px; margin: 0 0 20px;
background: #f8f8f8; background: var(--darkened-bg);
border: 1px solid #eee; border: 1px solid var(--hairline-color);
border-radius: 4px; border-radius: 4px;
text-align: right; text-align: right;
overflow: hidden; overflow: hidden;
@ -283,35 +279,35 @@ body.popup .submit-row {
.submit-row a.deletelink { .submit-row a.deletelink {
display: block; display: block;
background: #ba2121; background: var(--delete-button-bg);
border-radius: 4px; border-radius: 4px;
padding: 10px 15px; padding: 10px 15px;
height: 15px; height: 15px;
line-height: 15px; line-height: 15px;
color: #fff; color: var(--button-fg);
} }
.submit-row a.closelink { .submit-row a.closelink {
display: inline-block; display: inline-block;
background: #bbbbbb; background: var(--close-button-bg);
border-radius: 4px; border-radius: 4px;
padding: 10px 15px; padding: 10px 15px;
height: 15px; height: 15px;
line-height: 15px; line-height: 15px;
margin: 0 0 0 5px; margin: 0 0 0 5px;
color: #fff; color: var(--button-fg);
} }
.submit-row a.deletelink:focus, .submit-row a.deletelink:focus,
.submit-row a.deletelink:hover, .submit-row a.deletelink:hover,
.submit-row a.deletelink:active { .submit-row a.deletelink:active {
background: #a41515; background: var(--delete-button-hover-bg);
} }
.submit-row a.closelink:focus, .submit-row a.closelink:focus,
.submit-row a.closelink:hover, .submit-row a.closelink:hover,
.submit-row a.closelink:active { .submit-row a.closelink:active {
background: #aaaaaa; background: var(--close-button-hover-bg);
} }
/* CUSTOM FORM FIELDS */ /* CUSTOM FORM FIELDS */
@ -390,12 +386,12 @@ body.popup .submit-row {
.inline-related h3 { .inline-related h3 {
margin: 0; margin: 0;
color: #666; color: var(--body-quiet-color);
padding: 5px; padding: 5px;
font-size: 13px; font-size: 13px;
background: #f8f8f8; background: var(--darkened-bg);
border-top: 1px solid #eee; border-top: 1px solid var(--hairline-color);
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
} }
.inline-related h3 span.delete { .inline-related h3 span.delete {
@ -409,7 +405,7 @@ body.popup .submit-row {
.inline-related fieldset { .inline-related fieldset {
margin: 0; margin: 0;
background: #fff; background: var(--body-bg);
border: none; border: none;
width: 100%; width: 100%;
} }
@ -421,7 +417,7 @@ body.popup .submit-row {
text-align: left; text-align: left;
font-weight: bold; font-weight: bold;
background: #bcd; background: #bcd;
color: #fff; color: var(--body-bg);
} }
.inline-group .tabular fieldset.module { .inline-group .tabular fieldset.module {
@ -430,6 +426,7 @@ body.popup .submit-row {
.inline-related.tabular fieldset.module table { .inline-related.tabular fieldset.module table {
width: 100%; width: 100%;
overflow-x: scroll;
} }
.last-related fieldset { .last-related fieldset {
@ -459,7 +456,7 @@ body.popup .submit-row {
overflow: hidden; overflow: hidden;
font-size: 9px; font-size: 9px;
font-weight: bold; font-weight: bold;
color: #666; color: var(--body-quiet-color);
_width: 700px; _width: 700px;
} }
@ -476,15 +473,15 @@ body.popup .submit-row {
.inline-group div.add-row, .inline-group div.add-row,
.inline-group .tabular tr.add-row td { .inline-group .tabular tr.add-row td {
color: #666; color: var(--body-quiet-color);
background: #f8f8f8; background: var(--darkened-bg);
padding: 8px 10px; padding: 8px 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
} }
.inline-group .tabular tr.add-row td { .inline-group .tabular tr.add-row td {
padding: 8px 10px; padding: 8px 10px;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--hairline-color);
} }
.inline-group ul.tools a.add, .inline-group ul.tools a.add,
@ -501,7 +498,7 @@ body.popup .submit-row {
/* RELATED FIELD ADD ONE / LOOKUP */ /* RELATED FIELD ADD ONE / LOOKUP */
.add-another, .related-lookup { .related-lookup {
margin-left: 5px; margin-left: 5px;
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
@ -509,12 +506,6 @@ body.popup .submit-row {
background-size: 14px; background-size: 14px;
} }
.add-another {
width: 16px;
height: 16px;
background-image: url(../img/icon-addlink.svg);
}
.related-lookup { .related-lookup {
width: 16px; width: 16px;
height: 16px; height: 16px;

View File

@ -1,7 +1,8 @@
/* LOGIN FORM */ /* LOGIN FORM */
body.login { .login {
background: #f8f8f8; background: var(--darkened-bg);
height: auto;
} }
.login #header { .login #header {
@ -15,7 +16,7 @@ body.login {
} }
.login #header h1 a { .login #header h1 a {
color: #fff; color: var(--header-link-color);
} }
.login #content { .login #content {
@ -23,55 +24,35 @@ body.login {
} }
.login #container { .login #container {
background: #fff; background: var(--body-bg);
border: 1px solid #eaeaea; border: 1px solid var(--hairline-color);
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
width: 28em; width: 28em;
min-width: 300px; min-width: 300px;
margin: 100px auto; margin: 100px auto;
} height: auto;
.login #content-main {
width: 100%;
} }
.login .form-row { .login .form-row {
padding: 4px 0; padding: 4px 0;
float: left;
width: 100%;
border-bottom: none;
} }
.login .form-row label { .login .form-row label {
padding-right: 0.5em; display: block;
line-height: 2em; line-height: 2em;
font-size: 1em;
clear: both;
color: #333;
} }
.login .form-row #id_username, .login .form-row #id_password { .login .form-row #id_username, .login .form-row #id_password {
clear: both;
padding: 8px; padding: 8px;
width: 100%; width: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
} }
.login span.help {
font-size: 10px;
display: block;
}
.login .submit-row { .login .submit-row {
clear: both; padding: 1em 0 0 0;
padding: 1em 0 0 9.4em;
margin: 0; margin: 0;
border: none; text-align: center;
background: none;
text-align: left;
} }
.login .password-reset-link { .login .password-reset-link {

View File

@ -0,0 +1,120 @@
.sticky {
position: sticky;
top: 0;
max-height: 100vh;
}
.toggle-nav-sidebar {
z-index: 20;
left: 0;
display: flex;
align-items: center;
justify-content: center;
flex: 0 0 23px;
width: 23px;
border: 0;
border-right: 1px solid var(--hairline-color);
background-color: var(--body-bg);
cursor: pointer;
font-size: 20px;
color: var(--link-fg);
padding: 0;
}
[dir="rtl"] .toggle-nav-sidebar {
border-left: 1px solid var(--hairline-color);
border-right: 0;
}
.toggle-nav-sidebar:hover,
.toggle-nav-sidebar:focus {
background-color: var(--darkened-bg);
}
#nav-sidebar {
z-index: 15;
flex: 0 0 275px;
left: -276px;
margin-left: -276px;
border-top: 1px solid transparent;
border-right: 1px solid var(--hairline-color);
background-color: var(--body-bg);
overflow: auto;
}
[dir="rtl"] #nav-sidebar {
border-left: 1px solid var(--hairline-color);
border-right: 0;
left: 0;
margin-left: 0;
right: -276px;
margin-right: -276px;
}
.toggle-nav-sidebar::before {
content: '\00BB';
}
.main.shifted .toggle-nav-sidebar::before {
content: '\00AB';
}
.main.shifted > #nav-sidebar {
left: 24px;
margin-left: 0;
}
[dir="rtl"] .main.shifted > #nav-sidebar {
left: 0;
right: 24px;
margin-right: 0;
}
#nav-sidebar .module th {
width: 100%;
overflow-wrap: anywhere;
}
#nav-sidebar .module th,
#nav-sidebar .module caption {
padding-left: 16px;
}
#nav-sidebar .module td {
white-space: nowrap;
}
[dir="rtl"] #nav-sidebar .module th,
[dir="rtl"] #nav-sidebar .module caption {
padding-left: 8px;
padding-right: 16px;
}
#nav-sidebar .current-app .section:link,
#nav-sidebar .current-app .section:visited {
color: var(--header-color);
font-weight: bold;
}
#nav-sidebar .current-model {
background: var(--selected-row);
}
.main > #nav-sidebar + .content {
max-width: calc(100% - 23px);
}
.main.shifted > #nav-sidebar + .content {
max-width: calc(100% - 299px);
}
@media (max-width: 767px) {
#nav-sidebar, #toggle-nav-sidebar {
display: none;
}
.main > #nav-sidebar + .content,
.main.shifted > #nav-sidebar + .content {
max-width: 100%;
}
}

View File

@ -93,16 +93,14 @@ input[type="submit"], button {
/* Changelist */ /* Changelist */
#changelist #toolbar { #toolbar {
border: none; border: none;
padding: 15px; padding: 15px;
} }
#changelist-search > div { #changelist-search > div {
display: -webkit-flex;
display: flex; display: flex;
-webkit-flex-wrap: wrap; flex-wrap: nowrap;
flex-wrap: wrap;
max-width: 480px; max-width: 480px;
} }
@ -110,16 +108,20 @@ input[type="submit"], button {
line-height: 22px; line-height: 22px;
} }
#changelist #toolbar form #searchbar { #toolbar form #searchbar {
-webkit-flex: 1 0 auto;
flex: 1 0 auto; flex: 1 0 auto;
width: 0; width: 0;
height: 22px; height: 22px;
margin: 0 10px 0 6px; margin: 0 10px 0 6px;
} }
#toolbar form input[type=submit] {
flex: 0 1 auto;
}
#changelist-search .quiet { #changelist-search .quiet {
width: 100%; width: 0;
flex: 1 0 auto;
margin: 5px 0 0 25px; margin: 5px 0 0 25px;
} }
@ -138,7 +140,7 @@ input[type="submit"], button {
} }
#changelist .actions select { #changelist .actions select {
background: #fff; background: var(--body-bg);
} }
#changelist .actions .button { #changelist .actions .button {
@ -155,19 +157,16 @@ input[type="submit"], button {
} }
#changelist-filter { #changelist-filter {
width: 200px; flex-basis: 200px;
} }
.change-list .filtered .results, .change-list .filtered .results,
.change-list .filtered .paginator, .change-list .filtered .paginator,
.filtered #toolbar, .filtered #toolbar,
.filtered .actions, .filtered .actions,
.filtered div.xfull {
margin-right: 230px;
}
#changelist .paginator { #changelist .paginator {
border-top-color: #eee; border-top-color: var(--hairline-color); /* XXX Is this used at all? */
} }
#changelist .results + .paginator { #changelist .results + .paginator {
@ -214,11 +213,11 @@ input[type="submit"], button {
fieldset .fieldBox + .fieldBox { fieldset .fieldBox + .fieldBox {
margin-top: 10px; margin-top: 10px;
padding-top: 10px; padding-top: 10px;
border-top: 1px solid #eee; border-top: 1px solid var(--hairline-color);
} }
textarea { textarea {
max-width: 518px; max-width: 100%;
max-height: 120px; max-height: 120px;
} }
@ -226,7 +225,6 @@ input[type="submit"], button {
padding-top: 6px; padding-top: 6px;
} }
.aligned .add-another,
.aligned .related-lookup, .aligned .related-lookup,
.aligned .datetimeshortcuts, .aligned .datetimeshortcuts,
.aligned .related-lookup + strong { .aligned .related-lookup + strong {
@ -354,6 +352,14 @@ input[type="submit"], button {
} }
.stacked .active.selector-add { .stacked .active.selector-add {
background-position: 0 -40px;
}
.active.selector-add:focus, .active.selector-add:hover {
background-position: 0 -140px;
}
.stacked .active.selector-add:focus, .stacked .active.selector-add:hover {
background-position: 0 -60px; background-position: 0 -60px;
} }
@ -362,6 +368,14 @@ input[type="submit"], button {
} }
.stacked .active.selector-remove { .stacked .active.selector-remove {
background-position: 0 0;
}
.active.selector-remove:focus, .active.selector-remove:hover {
background-position: 0 -100px;
}
.stacked .active.selector-remove:focus, .stacked .active.selector-remove:hover {
background-position: 0 -20px; background-position: 0 -20px;
} }
@ -385,11 +399,15 @@ input[type="submit"], button {
.datetime .timezonewarning { .datetime .timezonewarning {
display: block; display: block;
font-size: 11px; font-size: 11px;
color: #999; color: var(--body-quiet-color);
} }
.datetimeshortcuts { .datetimeshortcuts {
color: #ccc; color: var(--border-color); /* XXX Redundant, .datetime span also sets #ccc */
}
.form-row .datetime input.vDateField, .form-row .datetime input.vTimeField {
width: 75%;
} }
.inline-group { .inline-group {
@ -484,25 +502,16 @@ input[type="submit"], button {
/* Changelist */ /* Changelist */
#changelist { #changelist {
display: flex; align-items: stretch;
flex-direction: column; flex-direction: column;
} }
#changelist #toolbar { #toolbar {
order: 1;
padding: 10px; padding: 10px;
} }
#changelist .xfull {
order: 2;
}
#changelist-form {
order: 3;
}
#changelist-filter { #changelist-filter {
order: 4; margin-left: 0;
} }
#changelist .actions label { #changelist .actions label {
@ -518,11 +527,6 @@ input[type="submit"], button {
flex: 1 0 100%; flex: 1 0 100%;
} }
.change-list .filtered .results, .change-list .filtered .paginator,
.filtered #toolbar, .filtered .actions, .filtered div.xfull {
margin-right: 0;
}
#changelist-filter { #changelist-filter {
position: static; position: static;
width: auto; width: auto;
@ -651,7 +655,7 @@ input[type="submit"], button {
margin-bottom: -3px; margin-bottom: -3px;
} }
form .aligned ul.radiolist li + li { form .aligned ul.radiolist:not(.inline) li + li {
margin-top: 5px; margin-top: 5px;
} }
@ -721,14 +725,22 @@ input[type="submit"], button {
background-position: 0 0; background-position: 0 0;
} }
.active.selector-remove:focus, .active.selector-remove:hover {
background-position: 0 -20px;
}
.selector-add { .selector-add {
background-position: 0 -40px; background-position: 0 -40px;
} }
.active.selector-add:focus, .active.selector-add:hover {
background-position: 0 -60px;
}
/* Inlines */ /* Inlines */
.inline-group[data-inline-type="stacked"] .inline-related { .inline-group[data-inline-type="stacked"] .inline-related {
border: 2px solid #eee; border: 1px solid var(--hairline-color);
border-radius: 4px; border-radius: 4px;
margin-top: 15px; margin-top: 15px;
overflow: auto; overflow: auto;
@ -738,18 +750,19 @@ input[type="submit"], button {
box-sizing: border-box; box-sizing: border-box;
} }
.inline-group[data-inline-type="stacked"] .inline-related + .inline-related {
margin-top: 30px;
}
.inline-group[data-inline-type="stacked"] .inline-related .module { .inline-group[data-inline-type="stacked"] .inline-related .module {
padding: 0 10px; padding: 0 10px;
} }
.inline-group[data-inline-type="stacked"] .inline-related .module .form-row:last-child { .inline-group[data-inline-type="stacked"] .inline-related .module .form-row {
border-top: 1px solid var(--hairline-color);
border-bottom: none; border-bottom: none;
} }
.inline-group[data-inline-type="stacked"] .inline-related .module .form-row:first-child {
border-top: none;
}
.inline-group[data-inline-type="stacked"] .inline-related h3 { .inline-group[data-inline-type="stacked"] .inline-related h3 {
padding: 10px; padding: 10px;
border-top-width: 0; border-top-width: 0;
@ -779,7 +792,7 @@ input[type="submit"], button {
.inline-group[data-inline-type="stacked"] div.add-row { .inline-group[data-inline-type="stacked"] div.add-row {
margin-top: 15px; margin-top: 15px;
border: 1px solid #eee; border: 1px solid var(--hairline-color);
border-radius: 4px; border-radius: 4px;
} }
@ -873,9 +886,7 @@ input[type="submit"], button {
} }
.login .form-row label { .login .form-row label {
display: block;
margin: 0 0 5px; margin: 0 0 5px;
padding: 0;
line-height: 1.2; line-height: 1.2;
} }
@ -883,7 +894,7 @@ input[type="submit"], button {
padding: 15px 0 0; padding: 15px 0 0;
} }
.login br, .login .submit-row label { .login br {
display: none; display: none;
} }
@ -951,7 +962,7 @@ input[type="submit"], button {
} }
.timelist a { .timelist a {
background: #fff; background: var(--body-bg);
padding: 4px; padding: 4px;
} }

View File

@ -23,9 +23,9 @@
[dir="rtl"] .change-list .filtered .paginator, [dir="rtl"] .change-list .filtered .paginator,
[dir="rtl"] .filtered #toolbar, [dir="rtl"] .filtered #toolbar,
[dir="rtl"] .filtered div.xfull, [dir="rtl"] .filtered div.xfull,
[dir="rtl"] .filtered .actions { [dir="rtl"] .filtered .actions,
margin-right: 0; [dir="rtl"] #changelist-filter {
margin-left: 230px; margin-left: 0;
} }
[dir="rtl"] .inline-group ul.tools a.add, [dir="rtl"] .inline-group ul.tools a.add,
@ -63,15 +63,6 @@
/* MOBILE */ /* MOBILE */
@media (max-width: 767px) { @media (max-width: 767px) {
[dir="rtl"] .change-list .filtered .results,
[dir="rtl"] .change-list .filtered .paginator,
[dir="rtl"] .filtered #toolbar,
[dir="rtl"] .filtered div.xfull,
[dir="rtl"] .filtered .actions {
margin-left: 0;
}
[dir="rtl"] .aligned .add-another,
[dir="rtl"] .aligned .related-lookup, [dir="rtl"] .aligned .related-lookup,
[dir="rtl"] .aligned .datetimeshortcuts { [dir="rtl"] .aligned .datetimeshortcuts {
margin-left: 0; margin-left: 0;
@ -81,4 +72,9 @@
[dir="rtl"] .aligned ul { [dir="rtl"] .aligned ul {
margin-right: 0; margin-right: 0;
} }
[dir="rtl"] #changelist-filter {
margin-left: 0;
margin-right: 0;
}
} }

View File

@ -1,25 +1,3 @@
body {
direction: rtl;
}
/* LOGIN */
.login .form-row {
float: right;
}
.login .form-row label {
float: right;
padding-left: 0.5em;
padding-right: 0;
text-align: left;
}
.login .submit-row {
clear: both;
padding: 1em 9.4em 0 0;
}
/* GLOBAL */ /* GLOBAL */
th { th {
@ -109,31 +87,21 @@ thead th.sorted .text {
} }
#changelist-filter { #changelist-filter {
right: auto;
left: 0;
border-left: none; border-left: none;
border-right: none; border-right: none;
} margin-left: 0;
margin-right: 30px;
.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull {
margin-right: 0;
margin-left: 280px;
} }
#changelist-filter li.selected { #changelist-filter li.selected {
border-left: none; border-left: none;
padding-left: 10px; padding-left: 10px;
margin-left: 0; margin-left: 0;
border-right: 5px solid #eaeaea; border-right: 5px solid var(--hairline-color);
padding-right: 10px; padding-right: 10px;
margin-right: -15px; margin-right: -15px;
} }
.filtered .actions {
margin-left: 280px;
margin-right: 0;
}
#changelist table tbody td:first-child, #changelist table tbody th:first-child { #changelist table tbody td:first-child, #changelist table tbody th:first-child {
border-right: none; border-right: none;
border-left: none; border-left: none;
@ -257,13 +225,3 @@ form .form-row p.datetime {
margin-left: inherit; margin-left: inherit;
margin-right: 2px; margin-right: 2px;
} }
/* IE7 specific bug fixes */
div.colM {
position: relative;
}
.submit-row input {
float: left;
}

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2012-2015 Kevin Brown, Igor Vaynberg, and Select2 contributors Copyright (c) 2012-2017 Kevin Brown, Igor Vaynberg, and Select2 contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -118,12 +118,14 @@
.select2-hidden-accessible { .select2-hidden-accessible {
border: 0 !important; border: 0 !important;
clip: rect(0 0 0 0) !important; clip: rect(0 0 0 0) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important; height: 1px !important;
margin: -1px !important;
overflow: hidden !important; overflow: hidden !important;
padding: 0 !important; padding: 0 !important;
position: absolute !important; position: absolute !important;
width: 1px !important; } width: 1px !important;
white-space: nowrap !important; }
.select2-container--default .select2-selection--single { .select2-container--default .select2-selection--single {
background-color: #fff; background-color: #fff;
@ -186,16 +188,13 @@
width: 100%; } width: 100%; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered li { .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
list-style: none; } list-style: none; }
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
color: #999;
margin-top: 5px;
float: left; }
.select2-container--default .select2-selection--multiple .select2-selection__clear { .select2-container--default .select2-selection--multiple .select2-selection__clear {
cursor: pointer; cursor: pointer;
float: right; float: right;
font-weight: bold; font-weight: bold;
margin-top: 5px; margin-top: 5px;
margin-right: 10px; } margin-right: 10px;
padding: 1px; }
.select2-container--default .select2-selection--multiple .select2-selection__choice { .select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e4e4e4; background-color: #e4e4e4;
border: 1px solid #aaa; border: 1px solid #aaa;
@ -214,7 +213,7 @@
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
color: #333; } color: #333; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline { .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right; } float: right; }
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice { .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
@ -420,9 +419,7 @@
color: #555; } color: #555; }
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice { .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
float: right; } float: right;
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px; margin-left: 5px;
margin-right: auto; } margin-right: auto; }

File diff suppressed because one or more lines are too long

View File

@ -22,26 +22,25 @@
} }
.selector-available h2, .selector-chosen h2 { .selector-available h2, .selector-chosen h2 {
border: 1px solid #ccc; border: 1px solid var(--border-color);
border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;
} }
.selector-chosen h2 { .selector-chosen h2 {
background: #79aec8; background: var(--primary);
color: #fff; color: var(--header-link-color);
} }
.selector .selector-available h2 { .selector .selector-available h2 {
background: #f8f8f8; background: var(--darkened-bg);
color: #666; color: var(--body-quiet-color);
} }
.selector .selector-filter { .selector .selector-filter {
background: white; border: 1px solid var(--border-color);
border: 1px solid #ccc;
border-width: 0 1px; border-width: 0 1px;
padding: 8px; padding: 8px;
color: #999; color: var(--body-quiet-color);
font-size: 10px; font-size: 10px;
margin: 0; margin: 0;
text-align: left; text-align: left;
@ -66,7 +65,7 @@
.selector ul.selector-chooser { .selector ul.selector-chooser {
float: left; float: left;
width: 22px; width: 22px;
background-color: #eee; background-color: var(--selected-bg);
border-radius: 10px; border-radius: 10px;
margin: 10em 5px 0 5px; margin: 10em 5px 0 5px;
padding: 0; padding: 0;
@ -91,7 +90,7 @@
text-indent: -3000px; text-indent: -3000px;
overflow: hidden; overflow: hidden;
cursor: default; cursor: default;
opacity: 0.3; opacity: 0.55;
} }
.active.selector-add, .active.selector-remove { .active.selector-add, .active.selector-remove {
@ -126,14 +125,14 @@ a.selector-chooseall, a.selector-clearall {
overflow: hidden; overflow: hidden;
font-weight: bold; font-weight: bold;
line-height: 16px; line-height: 16px;
color: #666; color: var(--body-quiet-color);
text-decoration: none; text-decoration: none;
opacity: 0.3; opacity: 0.55;
} }
a.active.selector-chooseall:focus, a.active.selector-clearall:focus, a.active.selector-chooseall:focus, a.active.selector-clearall:focus,
a.active.selector-chooseall:hover, a.active.selector-clearall:hover { a.active.selector-chooseall:hover, a.active.selector-clearall:hover {
color: #447e9b; color: var(--link-fg);
} }
a.active.selector-chooseall, a.active.selector-clearall { a.active.selector-chooseall, a.active.selector-clearall {
@ -211,6 +210,11 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
} }
.stacked .active.selector-add { .stacked .active.selector-add {
background-position: 0 -32px;
cursor: pointer;
}
.stacked .active.selector-add:focus, .stacked .active.selector-add:hover {
background-position: 0 -48px; background-position: 0 -48px;
cursor: pointer; cursor: pointer;
} }
@ -221,6 +225,11 @@ a.active.selector-clearall:focus, a.active.selector-clearall:hover {
} }
.stacked .active.selector-remove { .stacked .active.selector-remove {
background-position: 0 0px;
cursor: pointer;
}
.stacked .active.selector-remove:focus, .stacked .active.selector-remove:hover {
background-position: 0 -16px; background-position: 0 -16px;
cursor: pointer; cursor: pointer;
} }
@ -251,7 +260,7 @@ p.datetime {
line-height: 20px; line-height: 20px;
margin: 0; margin: 0;
padding: 0; padding: 0;
color: #666; color: var(--body-quiet-color);
font-weight: bold; font-weight: bold;
} }
@ -259,11 +268,10 @@ p.datetime {
white-space: nowrap; white-space: nowrap;
font-weight: normal; font-weight: normal;
font-size: 11px; font-size: 11px;
color: #ccc; color: var(--body-quiet-color);
} }
.datetime input, .form-row .datetime input.vDateField, .form-row .datetime input.vTimeField { .datetime input, .form-row .datetime input.vDateField, .form-row .datetime input.vTimeField {
min-width: 0;
margin-left: 5px; margin-left: 5px;
margin-bottom: 4px; margin-bottom: 4px;
} }
@ -304,7 +312,7 @@ table p.datetime {
.timezonewarning { .timezonewarning {
font-size: 11px; font-size: 11px;
color: #999; color: var(--body-quiet-color);
} }
/* URL */ /* URL */
@ -313,7 +321,7 @@ p.url {
line-height: 20px; line-height: 20px;
margin: 0; margin: 0;
padding: 0; padding: 0;
color: #666; color: var(--body-quiet-color);
font-size: 11px; font-size: 11px;
font-weight: bold; font-weight: bold;
} }
@ -328,7 +336,7 @@ p.file-upload {
line-height: 20px; line-height: 20px;
margin: 0; margin: 0;
padding: 0; padding: 0;
color: #666; color: var(--body-quiet-color);
font-size: 11px; font-size: 11px;
font-weight: bold; font-weight: bold;
} }
@ -346,7 +354,7 @@ p.file-upload {
} }
span.clearable-file-input label { span.clearable-file-input label {
color: #333; color: var(--body-fg);
font-size: 11px; font-size: 11px;
display: inline; display: inline;
float: none; float: none;
@ -359,8 +367,9 @@ span.clearable-file-input label {
font-size: 12px; font-size: 12px;
width: 19em; width: 19em;
text-align: center; text-align: center;
background: white; background: var(--body-bg);
border: 1px solid #ddd; color: var(--body-fg);
border: 1px solid var(--hairline-color);
border-radius: 4px; border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
overflow: hidden; overflow: hidden;
@ -388,20 +397,20 @@ span.clearable-file-input label {
margin: 0; margin: 0;
text-align: center; text-align: center;
border-top: none; border-top: none;
background: #f5dd5d;
font-weight: 700; font-weight: 700;
font-size: 12px; font-size: 12px;
color: #333; color: #333;
background: var(--accent);
} }
.calendar th { .calendar th {
padding: 8px 5px; padding: 8px 5px;
background: #f8f8f8; background: var(--darkened-bg);
border-bottom: 1px solid #ddd; border-bottom: 1px solid var(--border-color);
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
color: #666; color: var(--body-quiet-color);
} }
.calendar td { .calendar td {
@ -409,17 +418,17 @@ span.clearable-file-input label {
font-size: 12px; font-size: 12px;
text-align: center; text-align: center;
padding: 0; padding: 0;
border-top: 1px solid #eee; border-top: 1px solid var(--hairline-color);
border-bottom: none; border-bottom: none;
} }
.calendar td.selected a { .calendar td.selected a {
background: #79aec8; background: var(--primary);
color: #fff; color: var(--button-fg);
} }
.calendar td.nonday { .calendar td.nonday {
background: #f8f8f8; background: var(--darkened-bg);
} }
.calendar td.today a { .calendar td.today a {
@ -431,17 +440,17 @@ span.clearable-file-input label {
font-weight: 400; font-weight: 400;
padding: 6px; padding: 6px;
text-decoration: none; text-decoration: none;
color: #444; color: var(--body-quiet-color);
} }
.calendar td a:focus, .timelist a:focus, .calendar td a:focus, .timelist a:focus,
.calendar td a:hover, .timelist a:hover { .calendar td a:hover, .timelist a:hover {
background: #79aec8; background: var(--primary);
color: white; color: white;
} }
.calendar td a:active, .timelist a:active { .calendar td a:active, .timelist a:active {
background: #417690; background: var(--header-bg);
color: white; color: white;
} }
@ -455,16 +464,16 @@ span.clearable-file-input label {
.calendarnav a:link, #calendarnav a:visited, .calendarnav a:link, #calendarnav a:visited,
#calendarnav a:focus, #calendarnav a:hover { #calendarnav a:focus, #calendarnav a:hover {
color: #999; color: var(--body-quiet-color);
} }
.calendar-shortcuts { .calendar-shortcuts {
background: white; background: var(--body-bg);
color: var(--body-quiet-color);
font-size: 11px; font-size: 11px;
line-height: 11px; line-height: 11px;
border-top: 1px solid #eee; border-top: 1px solid var(--hairline-color);
padding: 8px 0; padding: 8px 0;
color: #ccc;
} }
.calendarbox .calendarnav-previous, .calendarbox .calendarnav-next { .calendarbox .calendarnav-previous, .calendarbox .calendarnav-next {
@ -502,8 +511,8 @@ span.clearable-file-input label {
padding: 4px 0; padding: 4px 0;
font-size: 12px; font-size: 12px;
background: #eee; background: #eee;
border-top: 1px solid #ddd; border-top: 1px solid var(--border-color);
color: #333; color: var(--body-fg);
} }
.calendar-cancel:focus, .calendar-cancel:hover { .calendar-cancel:focus, .calendar-cancel:hover {

View File

@ -1,52 +1,39 @@
(function($) { 'use strict';
'use strict'; {
var SelectBox = { const SelectBox = {
cache: {}, cache: {},
init: function(id) { init: function(id) {
var box = document.getElementById(id); const box = document.getElementById(id);
var node;
SelectBox.cache[id] = []; SelectBox.cache[id] = [];
var cache = SelectBox.cache[id]; const cache = SelectBox.cache[id];
var boxOptions = box.options; for (const node of box.options) {
var boxOptionsLength = boxOptions.length;
for (var i = 0, j = boxOptionsLength; i < j; i++) {
node = boxOptions[i];
cache.push({value: node.value, text: node.text, displayed: 1}); cache.push({value: node.value, text: node.text, displayed: 1});
} }
}, },
redisplay: function(id) { redisplay: function(id) {
// Repopulate HTML select box from cache // Repopulate HTML select box from cache
var box = document.getElementById(id); const box = document.getElementById(id);
var node; const scroll_value_from_top = box.scrollTop;
$(box).empty(); // clear all options box.innerHTML = '';
var new_options = box.outerHTML.slice(0, -9); // grab just the opening tag for (const node of SelectBox.cache[id]) {
var cache = SelectBox.cache[id];
for (var i = 0, j = cache.length; i < j; i++) {
node = cache[i];
if (node.displayed) { if (node.displayed) {
var new_option = new Option(node.text, node.value, false, false); const new_option = new Option(node.text, node.value, false, false);
// Shows a tooltip when hovering over the option // Shows a tooltip when hovering over the option
new_option.setAttribute("title", node.text); new_option.title = node.text;
new_options += new_option.outerHTML; box.appendChild(new_option);
} }
} }
new_options += '</select>'; box.scrollTop = scroll_value_from_top;
box.outerHTML = new_options;
}, },
filter: function(id, text) { filter: function(id, text) {
// Redisplay the HTML select box, displaying only the choices containing ALL // Redisplay the HTML select box, displaying only the choices containing ALL
// the words in text. (It's an AND search.) // the words in text. (It's an AND search.)
var tokens = text.toLowerCase().split(/\s+/); const tokens = text.toLowerCase().split(/\s+/);
var node, token; for (const node of SelectBox.cache[id]) {
var cache = SelectBox.cache[id];
for (var i = 0, j = cache.length; i < j; i++) {
node = cache[i];
node.displayed = 1; node.displayed = 1;
var node_text = node.text.toLowerCase(); const node_text = node.text.toLowerCase();
var numTokens = tokens.length; for (const token of tokens) {
for (var k = 0; k < numTokens; k++) { if (!node_text.includes(token)) {
token = tokens[k];
if (node_text.indexOf(token) === -1) {
node.displayed = 0; node.displayed = 0;
break; // Once the first token isn't found we're done break; // Once the first token isn't found we're done
} }
@ -55,10 +42,9 @@
SelectBox.redisplay(id); SelectBox.redisplay(id);
}, },
delete_from_cache: function(id, value) { delete_from_cache: function(id, value) {
var node, delete_index = null; let delete_index = null;
var cache = SelectBox.cache[id]; const cache = SelectBox.cache[id];
for (var i = 0, j = cache.length; i < j; i++) { for (const [i, node] of cache.entries()) {
node = cache[i];
if (node.value === value) { if (node.value === value) {
delete_index = i; delete_index = i;
break; break;
@ -71,10 +57,7 @@
}, },
cache_contains: function(id, value) { cache_contains: function(id, value) {
// Check if an item is contained in the cache // Check if an item is contained in the cache
var node; for (const node of SelectBox.cache[id]) {
var cache = SelectBox.cache[id];
for (var i = 0, j = cache.length; i < j; i++) {
node = cache[i];
if (node.value === value) { if (node.value === value) {
return true; return true;
} }
@ -82,13 +65,9 @@
return false; return false;
}, },
move: function(from, to) { move: function(from, to) {
var from_box = document.getElementById(from); const from_box = document.getElementById(from);
var option; for (const option of from_box.options) {
var boxOptions = from_box.options; const option_value = option.value;
var boxOptionsLength = boxOptions.length;
for (var i = 0, j = boxOptionsLength; i < j; i++) {
option = boxOptions[i];
var option_value = option.value;
if (option.selected && SelectBox.cache_contains(from, option_value)) { if (option.selected && SelectBox.cache_contains(from, option_value)) {
SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1});
SelectBox.delete_from_cache(from, option_value); SelectBox.delete_from_cache(from, option_value);
@ -98,13 +77,9 @@
SelectBox.redisplay(to); SelectBox.redisplay(to);
}, },
move_all: function(from, to) { move_all: function(from, to) {
var from_box = document.getElementById(from); const from_box = document.getElementById(from);
var option; for (const option of from_box.options) {
var boxOptions = from_box.options; const option_value = option.value;
var boxOptionsLength = boxOptions.length;
for (var i = 0, j = boxOptionsLength; i < j; i++) {
option = boxOptions[i];
var option_value = option.value;
if (SelectBox.cache_contains(from, option_value)) { if (SelectBox.cache_contains(from, option_value)) {
SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1}); SelectBox.add_to_cache(to, {value: option_value, text: option.text, displayed: 1});
SelectBox.delete_from_cache(from, option_value); SelectBox.delete_from_cache(from, option_value);
@ -117,28 +92,21 @@
SelectBox.cache[id].sort(function(a, b) { SelectBox.cache[id].sort(function(a, b) {
a = a.text.toLowerCase(); a = a.text.toLowerCase();
b = b.text.toLowerCase(); b = b.text.toLowerCase();
try {
if (a > b) { if (a > b) {
return 1; return 1;
} }
if (a < b) { if (a < b) {
return -1; return -1;
} }
}
catch (e) {
// silently fail on IE 'unknown' exception
}
return 0; return 0;
} ); } );
}, },
select_all: function(id) { select_all: function(id) {
var box = document.getElementById(id); const box = document.getElementById(id);
var boxOptions = box.options; for (const option of box.options) {
var boxOptionsLength = boxOptions.length; option.selected = true;
for (var i = 0; i < boxOptionsLength; i++) {
boxOptions[i].selected = 'selected';
} }
} }
}; };
window.SelectBox = SelectBox; window.SelectBox = SelectBox;
})(django.jQuery); }

View File

@ -2,49 +2,40 @@
/* /*
SelectFilter2 - Turns a multiple-select box into a filter interface. SelectFilter2 - Turns a multiple-select box into a filter interface.
Requires jQuery, core.js, and SelectBox.js. Requires core.js and SelectBox.js.
*/ */
(function($) { 'use strict';
'use strict'; {
function findForm(node) {
// returns the node of the form containing the given node
if (node.tagName.toLowerCase() !== 'form') {
return findForm(node.parentNode);
}
return node;
}
window.SelectFilter = { window.SelectFilter = {
init: function(field_id, field_name, is_stacked) { init: function(field_id, field_name, is_stacked) {
if (field_id.match(/__prefix__/)) { if (field_id.match(/__prefix__/)) {
// Don't initialize on empty forms. // Don't initialize on empty forms.
return; return;
} }
var from_box = document.getElementById(field_id); const from_box = document.getElementById(field_id);
from_box.id += '_from'; // change its ID from_box.id += '_from'; // change its ID
from_box.className = 'filtered'; from_box.className = 'filtered';
var ps = from_box.parentNode.getElementsByTagName('p'); for (const p of from_box.parentNode.getElementsByTagName('p')) {
for (var i = 0; i < ps.length; i++) { if (p.classList.contains("info")) {
if (ps[i].className.indexOf("info") !== -1) {
// Remove <p class="info">, because it just gets in the way. // Remove <p class="info">, because it just gets in the way.
from_box.parentNode.removeChild(ps[i]); from_box.parentNode.removeChild(p);
} else if (ps[i].className.indexOf("help") !== -1) { } else if (p.classList.contains("help")) {
// Move help text up to the top so it isn't below the select // Move help text up to the top so it isn't below the select
// boxes or wrapped off on the side to the right of the add // boxes or wrapped off on the side to the right of the add
// button: // button:
from_box.parentNode.insertBefore(ps[i], from_box.parentNode.firstChild); from_box.parentNode.insertBefore(p, from_box.parentNode.firstChild);
} }
} }
// <div class="selector"> or <div class="selector stacked"> // <div class="selector"> or <div class="selector stacked">
var selector_div = quickElement('div', from_box.parentNode); const selector_div = quickElement('div', from_box.parentNode);
selector_div.className = is_stacked ? 'selector stacked' : 'selector'; selector_div.className = is_stacked ? 'selector stacked' : 'selector';
// <div class="selector-available"> // <div class="selector-available">
var selector_available = quickElement('div', selector_div); const selector_available = quickElement('div', selector_div);
selector_available.className = 'selector-available'; selector_available.className = 'selector-available';
var title_available = quickElement('h2', selector_available, interpolate(gettext('Available %s') + ' ', [field_name])); const title_available = quickElement('h2', selector_available, interpolate(gettext('Available %s') + ' ', [field_name]));
quickElement( quickElement(
'span', title_available, '', 'span', title_available, '',
'class', 'help help-tooltip help-icon', 'class', 'help help-tooltip help-icon',
@ -58,10 +49,10 @@ Requires jQuery, core.js, and SelectBox.js.
) )
); );
var filter_p = quickElement('p', selector_available, '', 'id', field_id + '_filter'); const filter_p = quickElement('p', selector_available, '', 'id', field_id + '_filter');
filter_p.className = 'selector-filter'; filter_p.className = 'selector-filter';
var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + '_input'); const search_filter_label = quickElement('label', filter_p, '', 'for', field_id + '_input');
quickElement( quickElement(
'span', search_filter_label, '', 'span', search_filter_label, '',
@ -71,25 +62,25 @@ Requires jQuery, core.js, and SelectBox.js.
filter_p.appendChild(document.createTextNode(' ')); filter_p.appendChild(document.createTextNode(' '));
var filter_input = quickElement('input', filter_p, '', 'type', 'text', 'placeholder', gettext("Filter")); const filter_input = quickElement('input', filter_p, '', 'type', 'text', 'placeholder', gettext("Filter"));
filter_input.id = field_id + '_input'; filter_input.id = field_id + '_input';
selector_available.appendChild(from_box); selector_available.appendChild(from_box);
var choose_all = quickElement('a', selector_available, gettext('Choose all'), 'title', interpolate(gettext('Click to choose all %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_add_all_link'); const choose_all = quickElement('a', selector_available, gettext('Choose all'), 'title', interpolate(gettext('Click to choose all %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_add_all_link');
choose_all.className = 'selector-chooseall'; choose_all.className = 'selector-chooseall';
// <ul class="selector-chooser"> // <ul class="selector-chooser">
var selector_chooser = quickElement('ul', selector_div); const selector_chooser = quickElement('ul', selector_div);
selector_chooser.className = 'selector-chooser'; selector_chooser.className = 'selector-chooser';
var add_link = quickElement('a', quickElement('li', selector_chooser), gettext('Choose'), 'title', gettext('Choose'), 'href', '#', 'id', field_id + '_add_link'); const add_link = quickElement('a', quickElement('li', selector_chooser), gettext('Choose'), 'title', gettext('Choose'), 'href', '#', 'id', field_id + '_add_link');
add_link.className = 'selector-add'; add_link.className = 'selector-add';
var remove_link = quickElement('a', quickElement('li', selector_chooser), gettext('Remove'), 'title', gettext('Remove'), 'href', '#', 'id', field_id + '_remove_link'); const remove_link = quickElement('a', quickElement('li', selector_chooser), gettext('Remove'), 'title', gettext('Remove'), 'href', '#', 'id', field_id + '_remove_link');
remove_link.className = 'selector-remove'; remove_link.className = 'selector-remove';
// <div class="selector-chosen"> // <div class="selector-chosen">
var selector_chosen = quickElement('div', selector_div); const selector_chosen = quickElement('div', selector_div);
selector_chosen.className = 'selector-chosen'; selector_chosen.className = 'selector-chosen';
var title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s') + ' ', [field_name])); const title_chosen = quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s') + ' ', [field_name]));
quickElement( quickElement(
'span', title_chosen, '', 'span', title_chosen, '',
'class', 'help help-tooltip help-icon', 'class', 'help help-tooltip help-icon',
@ -103,16 +94,16 @@ Requires jQuery, core.js, and SelectBox.js.
) )
); );
var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name')); const to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', '', 'size', from_box.size, 'name', from_box.name);
to_box.className = 'filtered'; to_box.className = 'filtered';
var clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_remove_all_link'); const clear_all = quickElement('a', selector_chosen, gettext('Remove all'), 'title', interpolate(gettext('Click to remove all chosen %s at once.'), [field_name]), 'href', '#', 'id', field_id + '_remove_all_link');
clear_all.className = 'selector-clearall'; clear_all.className = 'selector-clearall';
from_box.setAttribute('name', from_box.getAttribute('name') + '_old'); from_box.name = from_box.name + '_old';
// Set up the JavaScript event handlers for the select box filter interface // Set up the JavaScript event handlers for the select box filter interface
var move_selection = function(e, elem, move_func, from, to) { const move_selection = function(e, elem, move_func, from, to) {
if (elem.className.indexOf('active') !== -1) { if (elem.classList.contains('active')) {
move_func(from, to); move_func(from, to);
SelectFilter.refresh_icons(field_id); SelectFilter.refresh_icons(field_id);
} }
@ -154,7 +145,7 @@ Requires jQuery, core.js, and SelectBox.js.
SelectFilter.refresh_icons(field_id); SelectFilter.refresh_icons(field_id);
} }
}); });
findForm(from_box).addEventListener('submit', function() { from_box.closest('form').addEventListener('submit', function() {
SelectBox.select_all(field_id + '_to'); SelectBox.select_all(field_id + '_to');
}); });
SelectBox.init(field_id + '_from'); SelectBox.init(field_id + '_from');
@ -164,64 +155,66 @@ Requires jQuery, core.js, and SelectBox.js.
if (!is_stacked) { if (!is_stacked) {
// In horizontal mode, give the same height to the two boxes. // In horizontal mode, give the same height to the two boxes.
var j_from_box = $('#' + field_id + '_from'); const j_from_box = document.getElementById(field_id + '_from');
var j_to_box = $('#' + field_id + '_to'); const j_to_box = document.getElementById(field_id + '_to');
j_to_box.height($(filter_p).outerHeight() + j_from_box.outerHeight()); let height = filter_p.offsetHeight + j_from_box.offsetHeight;
const j_to_box_style = window.getComputedStyle(j_to_box);
if (j_to_box_style.getPropertyValue('box-sizing') === 'border-box') {
// Add the padding and border to the final height.
height += parseInt(j_to_box_style.getPropertyValue('padding-top'), 10)
+ parseInt(j_to_box_style.getPropertyValue('padding-bottom'), 10)
+ parseInt(j_to_box_style.getPropertyValue('border-top-width'), 10)
+ parseInt(j_to_box_style.getPropertyValue('border-bottom-width'), 10);
}
j_to_box.style.height = height + 'px';
} }
// Initial icon refresh // Initial icon refresh
SelectFilter.refresh_icons(field_id); SelectFilter.refresh_icons(field_id);
}, },
any_selected: function(field) { any_selected: function(field) {
var any_selected = false;
try {
// Temporarily add the required attribute and check validity. // Temporarily add the required attribute and check validity.
// This is much faster in WebKit browsers than the fallback. field.required = true;
field.attr('required', 'required'); const any_selected = field.checkValidity();
any_selected = field.is(':valid'); field.required = false;
field.removeAttr('required');
} catch (e) {
// Browsers that don't support :valid (IE < 10)
any_selected = field.find('option:selected').length > 0;
}
return any_selected; return any_selected;
}, },
refresh_icons: function(field_id) { refresh_icons: function(field_id) {
var from = $('#' + field_id + '_from'); const from = document.getElementById(field_id + '_from');
var to = $('#' + field_id + '_to'); const to = document.getElementById(field_id + '_to');
// Active if at least one item is selected // Active if at least one item is selected
$('#' + field_id + '_add_link').toggleClass('active', SelectFilter.any_selected(from)); document.getElementById(field_id + '_add_link').classList.toggle('active', SelectFilter.any_selected(from));
$('#' + field_id + '_remove_link').toggleClass('active', SelectFilter.any_selected(to)); document.getElementById(field_id + '_remove_link').classList.toggle('active', SelectFilter.any_selected(to));
// Active if the corresponding box isn't empty // Active if the corresponding box isn't empty
$('#' + field_id + '_add_all_link').toggleClass('active', from.find('option').length > 0); document.getElementById(field_id + '_add_all_link').classList.toggle('active', from.querySelector('option'));
$('#' + field_id + '_remove_all_link').toggleClass('active', to.find('option').length > 0); document.getElementById(field_id + '_remove_all_link').classList.toggle('active', to.querySelector('option'));
}, },
filter_key_press: function(event, field_id) { filter_key_press: function(event, field_id) {
var from = document.getElementById(field_id + '_from'); const from = document.getElementById(field_id + '_from');
// don't submit form if user pressed Enter // don't submit form if user pressed Enter
if ((event.which && event.which === 13) || (event.keyCode && event.keyCode === 13)) { if ((event.which && event.which === 13) || (event.keyCode && event.keyCode === 13)) {
from.selectedIndex = 0; from.selectedIndex = 0;
SelectBox.move(field_id + '_from', field_id + '_to'); SelectBox.move(field_id + '_from', field_id + '_to');
from.selectedIndex = 0; from.selectedIndex = 0;
event.preventDefault(); event.preventDefault();
return false;
} }
}, },
filter_key_up: function(event, field_id) { filter_key_up: function(event, field_id) {
var from = document.getElementById(field_id + '_from'); const from = document.getElementById(field_id + '_from');
var temp = from.selectedIndex; const temp = from.selectedIndex;
SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value); SelectBox.filter(field_id + '_from', document.getElementById(field_id + '_input').value);
from.selectedIndex = temp; from.selectedIndex = temp;
return true;
}, },
filter_key_down: function(event, field_id) { filter_key_down: function(event, field_id) {
var from = document.getElementById(field_id + '_from'); const from = document.getElementById(field_id + '_from');
// right arrow -- move across // right arrow -- move across
if ((event.which && event.which === 39) || (event.keyCode && event.keyCode === 39)) { if ((event.which && event.which === 39) || (event.keyCode && event.keyCode === 39)) {
var old_index = from.selectedIndex; const old_index = from.selectedIndex;
SelectBox.move(field_id + '_from', field_id + '_to'); SelectBox.move(field_id + '_from', field_id + '_to');
from.selectedIndex = (old_index === from.length) ? from.length - 1 : old_index; from.selectedIndex = (old_index === from.length) ? from.length - 1 : old_index;
return false; return;
} }
// down arrow -- wrap around // down arrow -- wrap around
if ((event.which && event.which === 40) || (event.keyCode && event.keyCode === 40)) { if ((event.which && event.which === 40) || (event.keyCode && event.keyCode === 40)) {
@ -231,16 +224,13 @@ Requires jQuery, core.js, and SelectBox.js.
if ((event.which && event.which === 38) || (event.keyCode && event.keyCode === 38)) { if ((event.which && event.which === 38) || (event.keyCode && event.keyCode === 38)) {
from.selectedIndex = (from.selectedIndex === 0) ? from.length - 1 : from.selectedIndex - 1; from.selectedIndex = (from.selectedIndex === 0) ? from.length - 1 : from.selectedIndex - 1;
} }
return true;
} }
}; };
window.addEventListener('load', function(e) { window.addEventListener('load', function(e) {
$('select.selectfilter, select.selectfilterstacked').each(function() { document.querySelectorAll('select.selectfilter, select.selectfilterstacked').forEach(function(el) {
var $el = $(this), const data = el.dataset;
data = $el.data(); SelectFilter.init(el.id, data.fieldName, parseInt(data.isStacked, 10));
SelectFilter.init($el.attr('id'), data.fieldName, parseInt(data.isStacked, 10));
}); });
}); });
}
})(django.jQuery);

View File

@ -1,153 +1,196 @@
/*global gettext, interpolate, ngettext*/ /*global gettext, interpolate, ngettext*/
(function($) { 'use strict';
'use strict'; {
var lastChecked; function show(selector) {
document.querySelectorAll(selector).forEach(function(el) {
$.fn.actions = function(opts) { el.classList.remove('hidden');
var options = $.extend({}, $.fn.actions.defaults, opts); });
var actionCheckboxes = $(this);
var list_editable_changed = false;
var showQuestion = function() {
$(options.acrossClears).hide();
$(options.acrossQuestions).show();
$(options.allContainer).hide();
},
showClear = function() {
$(options.acrossClears).show();
$(options.acrossQuestions).hide();
$(options.actionContainer).toggleClass(options.selectedClass);
$(options.allContainer).show();
$(options.counterContainer).hide();
},
reset = function() {
$(options.acrossClears).hide();
$(options.acrossQuestions).hide();
$(options.allContainer).hide();
$(options.counterContainer).show();
},
clearAcross = function() {
reset();
$(options.acrossInput).val(0);
$(options.actionContainer).removeClass(options.selectedClass);
},
checker = function(checked) {
if (checked) {
showQuestion();
} else {
reset();
} }
$(actionCheckboxes).prop("checked", checked)
.parent().parent().toggleClass(options.selectedClass, checked); function hide(selector) {
}, document.querySelectorAll(selector).forEach(function(el) {
updateCounter = function() { el.classList.add('hidden');
var sel = $(actionCheckboxes).filter(":checked").length; });
}
function showQuestion(options) {
hide(options.acrossClears);
show(options.acrossQuestions);
hide(options.allContainer);
}
function showClear(options) {
show(options.acrossClears);
hide(options.acrossQuestions);
document.querySelector(options.actionContainer).classList.remove(options.selectedClass);
show(options.allContainer);
hide(options.counterContainer);
}
function reset(options) {
hide(options.acrossClears);
hide(options.acrossQuestions);
hide(options.allContainer);
show(options.counterContainer);
}
function clearAcross(options) {
reset(options);
document.querySelector(options.acrossInput).value = 0;
document.querySelector(options.actionContainer).classList.remove(options.selectedClass);
}
function checker(actionCheckboxes, options, checked) {
if (checked) {
showQuestion(options);
} else {
reset(options);
}
actionCheckboxes.forEach(function(el) {
el.checked = checked;
el.closest('tr').classList.toggle(options.selectedClass, checked);
});
}
function updateCounter(actionCheckboxes, options) {
const sel = Array.from(actionCheckboxes).filter(function(el) {
return el.checked;
}).length;
const counter = document.querySelector(options.counterContainer);
// data-actions-icnt is defined in the generated HTML // data-actions-icnt is defined in the generated HTML
// and contains the total amount of objects in the queryset // and contains the total amount of objects in the queryset
var actions_icnt = $('.action-counter').data('actionsIcnt'); const actions_icnt = Number(counter.dataset.actionsIcnt);
$(options.counterContainer).html(interpolate( counter.textContent = interpolate(
ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), { ngettext('%(sel)s of %(cnt)s selected', '%(sel)s of %(cnt)s selected', sel), {
sel: sel, sel: sel,
cnt: actions_icnt cnt: actions_icnt
}, true)); }, true);
$(options.allToggle).prop("checked", function() { const allToggle = document.getElementById(options.allToggleId);
var value; allToggle.checked = sel === actionCheckboxes.length;
if (sel === actionCheckboxes.length) { if (allToggle.checked) {
value = true; showQuestion(options);
showQuestion();
} else { } else {
value = false; clearAcross(options);
clearAcross();
}
return value;
});
};
// Show counter by default
$(options.counterContainer).show();
// Check state of checkboxes and reinit state if needed
$(this).filter(":checked").each(function(i) {
$(this).parent().parent().toggleClass(options.selectedClass);
updateCounter();
if ($(options.acrossInput).val() === 1) {
showClear();
}
});
$(options.allToggle).show().on('click', function() {
checker($(this).prop("checked"));
updateCounter();
});
$("a", options.acrossQuestions).on('click', function(event) {
event.preventDefault();
$(options.acrossInput).val(1);
showClear();
});
$("a", options.acrossClears).on('click', function(event) {
event.preventDefault();
$(options.allToggle).prop("checked", false);
clearAcross();
checker(0);
updateCounter();
});
lastChecked = null;
$(actionCheckboxes).on('click', function(event) {
if (!event) { event = window.event; }
var target = event.target ? event.target : event.srcElement;
if (lastChecked && $.data(lastChecked) !== $.data(target) && event.shiftKey === true) {
var inrange = false;
$(lastChecked).prop("checked", target.checked)
.parent().parent().toggleClass(options.selectedClass, target.checked);
$(actionCheckboxes).each(function() {
if ($.data(this) === $.data(lastChecked) || $.data(this) === $.data(target)) {
inrange = (inrange) ? false : true;
}
if (inrange) {
$(this).prop("checked", target.checked)
.parent().parent().toggleClass(options.selectedClass, target.checked);
}
});
}
$(target).parent().parent().toggleClass(options.selectedClass, target.checked);
lastChecked = target;
updateCounter();
});
$('form#changelist-form table#result_list tr').on('change', 'td:gt(0) :input', function() {
list_editable_changed = true;
});
$('form#changelist-form button[name="index"]').on('click', function(event) {
if (list_editable_changed) {
return confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."));
}
});
$('form#changelist-form input[name="_save"]').on('click', function(event) {
var action_changed = false;
$('select option:selected', options.actionContainer).each(function() {
if ($(this).val()) {
action_changed = true;
}
});
if (action_changed) {
if (list_editable_changed) {
return confirm(gettext("You have selected an action, but you haven't saved your changes to individual fields yet. Please click OK to save. You'll need to re-run the action."));
} else {
return confirm(gettext("You have selected an action, and you haven't made any changes on individual fields. You're probably looking for the Go button rather than the Save button."));
} }
} }
});
}; const defaults = {
/* Setup plugin defaults */
$.fn.actions.defaults = {
actionContainer: "div.actions", actionContainer: "div.actions",
counterContainer: "span.action-counter", counterContainer: "span.action-counter",
allContainer: "div.actions span.all", allContainer: "div.actions span.all",
acrossInput: "div.actions input.select-across", acrossInput: "div.actions input.select-across",
acrossQuestions: "div.actions span.question", acrossQuestions: "div.actions span.question",
acrossClears: "div.actions span.clear", acrossClears: "div.actions span.clear",
allToggle: "#action-toggle", allToggleId: "action-toggle",
selectedClass: "selected" selectedClass: "selected"
}; };
$(document).ready(function() {
var $actionsEls = $('tr input.action-select'); window.Actions = function(actionCheckboxes, options) {
if ($actionsEls.length > 0) { options = Object.assign({}, defaults, options);
$actionsEls.actions(); let list_editable_changed = false;
let lastChecked = null;
let shiftPressed = false;
document.addEventListener('keydown', (event) => {
shiftPressed = event.shiftKey;
});
document.addEventListener('keyup', (event) => {
shiftPressed = event.shiftKey;
});
document.getElementById(options.allToggleId).addEventListener('click', function(event) {
checker(actionCheckboxes, options, this.checked);
updateCounter(actionCheckboxes, options);
});
document.querySelectorAll(options.acrossQuestions + " a").forEach(function(el) {
el.addEventListener('click', function(event) {
event.preventDefault();
const acrossInput = document.querySelector(options.acrossInput);
acrossInput.value = 1;
showClear(options);
});
});
document.querySelectorAll(options.acrossClears + " a").forEach(function(el) {
el.addEventListener('click', function(event) {
event.preventDefault();
document.getElementById(options.allToggleId).checked = false;
clearAcross(options);
checker(actionCheckboxes, options, false);
updateCounter(actionCheckboxes, options);
});
});
function affectedCheckboxes(target, withModifier) {
const multiSelect = (lastChecked && withModifier && lastChecked !== target);
if (!multiSelect) {
return [target];
}
const checkboxes = Array.from(actionCheckboxes);
const targetIndex = checkboxes.findIndex(el => el === target);
const lastCheckedIndex = checkboxes.findIndex(el => el === lastChecked);
const startIndex = Math.min(targetIndex, lastCheckedIndex);
const endIndex = Math.max(targetIndex, lastCheckedIndex);
const filtered = checkboxes.filter((el, index) => (startIndex <= index) && (index <= endIndex));
return filtered;
};
Array.from(document.getElementById('result_list').tBodies).forEach(function(el) {
el.addEventListener('change', function(event) {
const target = event.target;
if (target.classList.contains('action-select')) {
const checkboxes = affectedCheckboxes(target, shiftPressed);
checker(checkboxes, options, target.checked);
updateCounter(actionCheckboxes, options);
lastChecked = target;
} else {
list_editable_changed = true;
} }
}); });
})(django.jQuery); });
document.querySelector('#changelist-form button[name=index]').addEventListener('click', function() {
if (list_editable_changed) {
const confirmed = confirm(gettext("You have unsaved changes on individual editable fields. If you run an action, your unsaved changes will be lost."));
if (!confirmed) {
event.preventDefault();
}
}
});
const el = document.querySelector('#changelist-form input[name=_save]');
// The button does not exist if no fields are editable.
if (el) {
el.addEventListener('click', function(event) {
if (document.querySelector('[name=action]').value) {
const text = list_editable_changed
? gettext("You have selected an action, but you havent saved your changes to individual fields yet. Please click OK to save. Youll need to re-run the action.")
: gettext("You have selected an action, and you havent made any changes on individual fields. Youre probably looking for the Go button rather than the Save button.");
if (!confirm(text)) {
event.preventDefault();
}
}
});
}
};
// Call function fn when the DOM is loaded and ready. If it is already
// loaded, call the function now.
// http://youmightnotneedjquery.com/#ready
function ready(fn) {
if (document.readyState !== 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
ready(function() {
const actionsEls = document.querySelectorAll('tr input.action-select');
if (actionsEls.length > 0) {
Actions(actionsEls);
}
});
}

View File

@ -1,10 +1,10 @@
/*global Calendar, findPosX, findPosY, getStyle, get_format, gettext, gettext_noop, interpolate, ngettext, quickElement*/ /*global Calendar, findPosX, findPosY, get_format, gettext, gettext_noop, interpolate, ngettext, quickElement*/
// Inserts shortcut buttons after all of the following: // Inserts shortcut buttons after all of the following:
// <input type="text" class="vDateField"> // <input type="text" class="vDateField">
// <input type="text" class="vTimeField"> // <input type="text" class="vTimeField">
(function() { 'use strict';
'use strict'; {
var DateTimeShortcuts = { const DateTimeShortcuts = {
calendars: [], calendars: [],
calendarInputs: [], calendarInputs: [],
clockInputs: [], clockInputs: [],
@ -28,21 +28,18 @@
timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch
timezoneOffset: 0, timezoneOffset: 0,
init: function() { init: function() {
var body = document.getElementsByTagName('body')[0]; const serverOffset = document.body.dataset.adminUtcOffset;
var serverOffset = body.getAttribute('data-admin-utc-offset');
if (serverOffset) { if (serverOffset) {
var localOffset = new Date().getTimezoneOffset() * -60; const localOffset = new Date().getTimezoneOffset() * -60;
DateTimeShortcuts.timezoneOffset = localOffset - serverOffset; DateTimeShortcuts.timezoneOffset = localOffset - serverOffset;
} }
var inputs = document.getElementsByTagName('input'); for (const inp of document.getElementsByTagName('input')) {
for (var i = 0; i < inputs.length; i++) { if (inp.type === 'text' && inp.classList.contains('vTimeField')) {
var inp = inputs[i];
if (inp.getAttribute('type') === 'text' && inp.className.match(/vTimeField/)) {
DateTimeShortcuts.addClock(inp); DateTimeShortcuts.addClock(inp);
DateTimeShortcuts.addTimezoneWarning(inp); DateTimeShortcuts.addTimezoneWarning(inp);
} }
else if (inp.getAttribute('type') === 'text' && inp.className.match(/vDateField/)) { else if (inp.type === 'text' && inp.classList.contains('vDateField')) {
DateTimeShortcuts.addCalendar(inp); DateTimeShortcuts.addCalendar(inp);
DateTimeShortcuts.addTimezoneWarning(inp); DateTimeShortcuts.addTimezoneWarning(inp);
} }
@ -50,11 +47,10 @@
}, },
// Return the current time while accounting for the server timezone. // Return the current time while accounting for the server timezone.
now: function() { now: function() {
var body = document.getElementsByTagName('body')[0]; const serverOffset = document.body.dataset.adminUtcOffset;
var serverOffset = body.getAttribute('data-admin-utc-offset');
if (serverOffset) { if (serverOffset) {
var localNow = new Date(); const localNow = new Date();
var localOffset = localNow.getTimezoneOffset() * -60; const localOffset = localNow.getTimezoneOffset() * -60;
localNow.setTime(localNow.getTime() + 1000 * (serverOffset - localOffset)); localNow.setTime(localNow.getTime() + 1000 * (serverOffset - localOffset));
return localNow; return localNow;
} else { } else {
@ -63,8 +59,8 @@
}, },
// Add a warning when the time zone in the browser and backend do not match. // Add a warning when the time zone in the browser and backend do not match.
addTimezoneWarning: function(inp) { addTimezoneWarning: function(inp) {
var warningClass = DateTimeShortcuts.timezoneWarningClass; const warningClass = DateTimeShortcuts.timezoneWarningClass;
var timezoneOffset = DateTimeShortcuts.timezoneOffset / 3600; let timezoneOffset = DateTimeShortcuts.timezoneOffset / 3600;
// Only warn if there is a time zone mismatch. // Only warn if there is a time zone mismatch.
if (!timezoneOffset) { if (!timezoneOffset) {
@ -76,7 +72,7 @@
return; return;
} }
var message; let message;
if (timezoneOffset > 0) { if (timezoneOffset > 0) {
message = ngettext( message = ngettext(
'Note: You are %s hour ahead of server time.', 'Note: You are %s hour ahead of server time.',
@ -94,7 +90,7 @@
} }
message = interpolate(message, [timezoneOffset]); message = interpolate(message, [timezoneOffset]);
var warning = document.createElement('span'); const warning = document.createElement('span');
warning.className = warningClass; warning.className = warningClass;
warning.textContent = message; warning.textContent = message;
inp.parentNode.appendChild(document.createElement('br')); inp.parentNode.appendChild(document.createElement('br'));
@ -102,23 +98,23 @@
}, },
// Add clock widget to a given field // Add clock widget to a given field
addClock: function(inp) { addClock: function(inp) {
var num = DateTimeShortcuts.clockInputs.length; const num = DateTimeShortcuts.clockInputs.length;
DateTimeShortcuts.clockInputs[num] = inp; DateTimeShortcuts.clockInputs[num] = inp;
DateTimeShortcuts.dismissClockFunc[num] = function() { DateTimeShortcuts.dismissClock(num); return true; }; DateTimeShortcuts.dismissClockFunc[num] = function() { DateTimeShortcuts.dismissClock(num); return true; };
// Shortcut links (clock icon and "Now" link) // Shortcut links (clock icon and "Now" link)
var shortcuts_span = document.createElement('span'); const shortcuts_span = document.createElement('span');
shortcuts_span.className = DateTimeShortcuts.shortCutsClass; shortcuts_span.className = DateTimeShortcuts.shortCutsClass;
inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling);
var now_link = document.createElement('a'); const now_link = document.createElement('a');
now_link.setAttribute('href', "#"); now_link.href = "#";
now_link.textContent = gettext('Now'); now_link.textContent = gettext('Now');
now_link.addEventListener('click', function(e) { now_link.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
DateTimeShortcuts.handleClockQuicklink(num, -1); DateTimeShortcuts.handleClockQuicklink(num, -1);
}); });
var clock_link = document.createElement('a'); const clock_link = document.createElement('a');
clock_link.setAttribute('href', '#'); clock_link.href = '#';
clock_link.id = DateTimeShortcuts.clockLinkName + num; clock_link.id = DateTimeShortcuts.clockLinkName + num;
clock_link.addEventListener('click', function(e) { clock_link.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
@ -152,32 +148,32 @@
// <p class="calendar-cancel"><a href="#">Cancel</a></p> // <p class="calendar-cancel"><a href="#">Cancel</a></p>
// </div> // </div>
var clock_box = document.createElement('div'); const clock_box = document.createElement('div');
clock_box.style.display = 'none'; clock_box.style.display = 'none';
clock_box.style.position = 'absolute'; clock_box.style.position = 'absolute';
clock_box.className = 'clockbox module'; clock_box.className = 'clockbox module';
clock_box.setAttribute('id', DateTimeShortcuts.clockDivName + num); clock_box.id = DateTimeShortcuts.clockDivName + num;
document.body.appendChild(clock_box); document.body.appendChild(clock_box);
clock_box.addEventListener('click', function(e) { e.stopPropagation(); }); clock_box.addEventListener('click', function(e) { e.stopPropagation(); });
quickElement('h2', clock_box, gettext('Choose a time')); quickElement('h2', clock_box, gettext('Choose a time'));
var time_list = quickElement('ul', clock_box); const time_list = quickElement('ul', clock_box);
time_list.className = 'timelist'; time_list.className = 'timelist';
// The list of choices can be overridden in JavaScript like this: // The list of choices can be overridden in JavaScript like this:
// DateTimeShortcuts.clockHours.name = [['3 a.m.', 3]]; // DateTimeShortcuts.clockHours.name = [['3 a.m.', 3]];
// where name is the name attribute of the <input>. // where name is the name attribute of the <input>.
var name = typeof DateTimeShortcuts.clockHours[inp.name] === 'undefined' ? 'default_' : inp.name; const name = typeof DateTimeShortcuts.clockHours[inp.name] === 'undefined' ? 'default_' : inp.name;
DateTimeShortcuts.clockHours[name].forEach(function(element) { DateTimeShortcuts.clockHours[name].forEach(function(element) {
var time_link = quickElement('a', quickElement('li', time_list), gettext(element[0]), 'href', '#'); const time_link = quickElement('a', quickElement('li', time_list), gettext(element[0]), 'href', '#');
time_link.addEventListener('click', function(e) { time_link.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
DateTimeShortcuts.handleClockQuicklink(num, element[1]); DateTimeShortcuts.handleClockQuicklink(num, element[1]);
}); });
}); });
var cancel_p = quickElement('p', clock_box); const cancel_p = quickElement('p', clock_box);
cancel_p.className = 'calendar-cancel'; cancel_p.className = 'calendar-cancel';
var cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#'); const cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#');
cancel_link.addEventListener('click', function(e) { cancel_link.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
DateTimeShortcuts.dismissClock(num); DateTimeShortcuts.dismissClock(num);
@ -192,19 +188,17 @@
}); });
}, },
openClock: function(num) { openClock: function(num) {
var clock_box = document.getElementById(DateTimeShortcuts.clockDivName + num); const clock_box = document.getElementById(DateTimeShortcuts.clockDivName + num);
var clock_link = document.getElementById(DateTimeShortcuts.clockLinkName + num); const clock_link = document.getElementById(DateTimeShortcuts.clockLinkName + num);
// Recalculate the clockbox position // Recalculate the clockbox position
// is it left-to-right or right-to-left layout ? // is it left-to-right or right-to-left layout ?
if (getStyle(document.body, 'direction') !== 'rtl') { if (window.getComputedStyle(document.body).direction !== 'rtl') {
clock_box.style.left = findPosX(clock_link) + 17 + 'px'; clock_box.style.left = findPosX(clock_link) + 17 + 'px';
} }
else { else {
// since style's width is in em, it'd be tough to calculate // since style's width is in em, it'd be tough to calculate
// px value of it. let's use an estimated px for now // px value of it. let's use an estimated px for now
// TODO: IE returns wrong value for findPosX when in rtl mode
// (it returns as it was left aligned), needs to be fixed.
clock_box.style.left = findPosX(clock_link) - 110 + 'px'; clock_box.style.left = findPosX(clock_link) - 110 + 'px';
} }
clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px'; clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px';
@ -218,7 +212,7 @@
document.removeEventListener('click', DateTimeShortcuts.dismissClockFunc[num]); document.removeEventListener('click', DateTimeShortcuts.dismissClockFunc[num]);
}, },
handleClockQuicklink: function(num, val) { handleClockQuicklink: function(num, val) {
var d; let d;
if (val === -1) { if (val === -1) {
d = DateTimeShortcuts.now(); d = DateTimeShortcuts.now();
} }
@ -231,24 +225,24 @@
}, },
// Add calendar widget to a given field. // Add calendar widget to a given field.
addCalendar: function(inp) { addCalendar: function(inp) {
var num = DateTimeShortcuts.calendars.length; const num = DateTimeShortcuts.calendars.length;
DateTimeShortcuts.calendarInputs[num] = inp; DateTimeShortcuts.calendarInputs[num] = inp;
DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; }; DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; };
// Shortcut links (calendar icon and "Today" link) // Shortcut links (calendar icon and "Today" link)
var shortcuts_span = document.createElement('span'); const shortcuts_span = document.createElement('span');
shortcuts_span.className = DateTimeShortcuts.shortCutsClass; shortcuts_span.className = DateTimeShortcuts.shortCutsClass;
inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling); inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling);
var today_link = document.createElement('a'); const today_link = document.createElement('a');
today_link.setAttribute('href', '#'); today_link.href = '#';
today_link.appendChild(document.createTextNode(gettext('Today'))); today_link.appendChild(document.createTextNode(gettext('Today')));
today_link.addEventListener('click', function(e) { today_link.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
DateTimeShortcuts.handleCalendarQuickLink(num, 0); DateTimeShortcuts.handleCalendarQuickLink(num, 0);
}); });
var cal_link = document.createElement('a'); const cal_link = document.createElement('a');
cal_link.setAttribute('href', '#'); cal_link.href = '#';
cal_link.id = DateTimeShortcuts.calendarLinkName + num; cal_link.id = DateTimeShortcuts.calendarLinkName + num;
cal_link.addEventListener('click', function(e) { cal_link.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
@ -283,24 +277,24 @@
// </div> // </div>
// <p class="calendar-cancel"><a href="#">Cancel</a></p> // <p class="calendar-cancel"><a href="#">Cancel</a></p>
// </div> // </div>
var cal_box = document.createElement('div'); const cal_box = document.createElement('div');
cal_box.style.display = 'none'; cal_box.style.display = 'none';
cal_box.style.position = 'absolute'; cal_box.style.position = 'absolute';
cal_box.className = 'calendarbox module'; cal_box.className = 'calendarbox module';
cal_box.setAttribute('id', DateTimeShortcuts.calendarDivName1 + num); cal_box.id = DateTimeShortcuts.calendarDivName1 + num;
document.body.appendChild(cal_box); document.body.appendChild(cal_box);
cal_box.addEventListener('click', function(e) { e.stopPropagation(); }); cal_box.addEventListener('click', function(e) { e.stopPropagation(); });
// next-prev links // next-prev links
var cal_nav = quickElement('div', cal_box); const cal_nav = quickElement('div', cal_box);
var cal_nav_prev = quickElement('a', cal_nav, '<', 'href', '#'); const cal_nav_prev = quickElement('a', cal_nav, '<', 'href', '#');
cal_nav_prev.className = 'calendarnav-previous'; cal_nav_prev.className = 'calendarnav-previous';
cal_nav_prev.addEventListener('click', function(e) { cal_nav_prev.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
DateTimeShortcuts.drawPrev(num); DateTimeShortcuts.drawPrev(num);
}); });
var cal_nav_next = quickElement('a', cal_nav, '>', 'href', '#'); const cal_nav_next = quickElement('a', cal_nav, '>', 'href', '#');
cal_nav_next.className = 'calendarnav-next'; cal_nav_next.className = 'calendarnav-next';
cal_nav_next.addEventListener('click', function(e) { cal_nav_next.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
@ -308,15 +302,15 @@
}); });
// main box // main box
var cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num); const cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num);
cal_main.className = 'calendar'; cal_main.className = 'calendar';
DateTimeShortcuts.calendars[num] = new Calendar(DateTimeShortcuts.calendarDivName2 + num, DateTimeShortcuts.handleCalendarCallback(num)); DateTimeShortcuts.calendars[num] = new Calendar(DateTimeShortcuts.calendarDivName2 + num, DateTimeShortcuts.handleCalendarCallback(num));
DateTimeShortcuts.calendars[num].drawCurrent(); DateTimeShortcuts.calendars[num].drawCurrent();
// calendar shortcuts // calendar shortcuts
var shortcuts = quickElement('div', cal_box); const shortcuts = quickElement('div', cal_box);
shortcuts.className = 'calendar-shortcuts'; shortcuts.className = 'calendar-shortcuts';
var day_link = quickElement('a', shortcuts, gettext('Yesterday'), 'href', '#'); let day_link = quickElement('a', shortcuts, gettext('Yesterday'), 'href', '#');
day_link.addEventListener('click', function(e) { day_link.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
DateTimeShortcuts.handleCalendarQuickLink(num, -1); DateTimeShortcuts.handleCalendarQuickLink(num, -1);
@ -335,9 +329,9 @@
}); });
// cancel bar // cancel bar
var cancel_p = quickElement('p', cal_box); const cancel_p = quickElement('p', cal_box);
cancel_p.className = 'calendar-cancel'; cancel_p.className = 'calendar-cancel';
var cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#'); const cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#');
cancel_link.addEventListener('click', function(e) { cancel_link.addEventListener('click', function(e) {
e.preventDefault(); e.preventDefault();
DateTimeShortcuts.dismissCalendar(num); DateTimeShortcuts.dismissCalendar(num);
@ -351,18 +345,18 @@
}); });
}, },
openCalendar: function(num) { openCalendar: function(num) {
var cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1 + num); const cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1 + num);
var cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName + num); const cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName + num);
var inp = DateTimeShortcuts.calendarInputs[num]; const inp = DateTimeShortcuts.calendarInputs[num];
// Determine if the current value in the input has a valid date. // Determine if the current value in the input has a valid date.
// If so, draw the calendar with that date's year and month. // If so, draw the calendar with that date's year and month.
if (inp.value) { if (inp.value) {
var format = get_format('DATE_INPUT_FORMATS')[0]; const format = get_format('DATE_INPUT_FORMATS')[0];
var selected = inp.value.strptime(format); const selected = inp.value.strptime(format);
var year = selected.getUTCFullYear(); const year = selected.getUTCFullYear();
var month = selected.getUTCMonth() + 1; const month = selected.getUTCMonth() + 1;
var re = /\d{4}/; const re = /\d{4}/;
if (re.test(year.toString()) && month >= 1 && month <= 12) { if (re.test(year.toString()) && month >= 1 && month <= 12) {
DateTimeShortcuts.calendars[num].drawDate(month, year, selected); DateTimeShortcuts.calendars[num].drawDate(month, year, selected);
} }
@ -370,14 +364,12 @@
// Recalculate the clockbox position // Recalculate the clockbox position
// is it left-to-right or right-to-left layout ? // is it left-to-right or right-to-left layout ?
if (getStyle(document.body, 'direction') !== 'rtl') { if (window.getComputedStyle(document.body).direction !== 'rtl') {
cal_box.style.left = findPosX(cal_link) + 17 + 'px'; cal_box.style.left = findPosX(cal_link) + 17 + 'px';
} }
else { else {
// since style's width is in em, it'd be tough to calculate // since style's width is in em, it'd be tough to calculate
// px value of it. let's use an estimated px for now // px value of it. let's use an estimated px for now
// TODO: IE returns wrong value for findPosX when in rtl mode
// (it returns as it was left aligned), needs to be fixed.
cal_box.style.left = findPosX(cal_link) - 180 + 'px'; cal_box.style.left = findPosX(cal_link) - 180 + 'px';
} }
cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px'; cal_box.style.top = Math.max(0, findPosY(cal_link) - 75) + 'px';
@ -396,7 +388,7 @@
DateTimeShortcuts.calendars[num].drawNextMonth(); DateTimeShortcuts.calendars[num].drawNextMonth();
}, },
handleCalendarCallback: function(num) { handleCalendarCallback: function(num) {
var format = get_format('DATE_INPUT_FORMATS')[0]; let format = get_format('DATE_INPUT_FORMATS')[0];
// the format needs to be escaped a little // the format needs to be escaped a little
format = format.replace('\\', '\\\\') format = format.replace('\\', '\\\\')
.replace('\r', '\\r') .replace('\r', '\\r')
@ -410,7 +402,7 @@
}; };
}, },
handleCalendarQuickLink: function(num, offset) { handleCalendarQuickLink: function(num, offset) {
var d = DateTimeShortcuts.now(); const d = DateTimeShortcuts.now();
d.setDate(d.getDate() + offset); d.setDate(d.getDate() + offset);
DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]); DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]);
DateTimeShortcuts.calendarInputs[num].focus(); DateTimeShortcuts.calendarInputs[num].focus();
@ -420,4 +412,4 @@
window.addEventListener('load', DateTimeShortcuts.init); window.addEventListener('load', DateTimeShortcuts.init);
window.DateTimeShortcuts = DateTimeShortcuts; window.DateTimeShortcuts = DateTimeShortcuts;
})(); }

View File

@ -1,38 +1,17 @@
/*global SelectBox, interpolate*/ /*global SelectBox, interpolate*/
// Handles related-objects functionality: lookup link for raw_id_fields // Handles related-objects functionality: lookup link for raw_id_fields
// and Add Another links. // and Add Another links.
'use strict';
(function($) { {
'use strict'; const $ = django.jQuery;
// IE doesn't accept periods or dashes in the window name, but the element IDs
// we use to generate popup window names may contain them, therefore we map them
// to allowed characters in a reversible way so that we can locate the correct
// element when the popup window is dismissed.
function id_to_windowname(text) {
text = text.replace(/\./g, '__dot__');
text = text.replace(/\-/g, '__dash__');
return text;
}
function windowname_to_id(text) {
text = text.replace(/__dot__/g, '.');
text = text.replace(/__dash__/g, '-');
return text;
}
function showAdminPopup(triggeringLink, name_regexp, add_popup) { function showAdminPopup(triggeringLink, name_regexp, add_popup) {
var name = triggeringLink.id.replace(name_regexp, ''); const name = triggeringLink.id.replace(name_regexp, '');
name = id_to_windowname(name); const href = new URL(triggeringLink.href);
var href = triggeringLink.href;
if (add_popup) { if (add_popup) {
if (href.indexOf('?') === -1) { href.searchParams.set('_popup', 1);
href += '?_popup=1';
} else {
href += '&_popup=1';
} }
} const win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
var win = window.open(href, name, 'height=500,width=800,resizable=yes,scrollbars=yes');
win.focus(); win.focus();
return false; return false;
} }
@ -42,9 +21,9 @@
} }
function dismissRelatedLookupPopup(win, chosenId) { function dismissRelatedLookupPopup(win, chosenId) {
var name = windowname_to_id(win.name); const name = win.name;
var elem = document.getElementById(name); const elem = document.getElementById(name);
if (elem.className.indexOf('vManyToManyRawIdAdminField') !== -1 && elem.value) { if (elem.classList.contains('vManyToManyRawIdAdminField') && elem.value) {
elem.value += ',' + chosenId; elem.value += ',' + chosenId;
} else { } else {
document.getElementById(name).value = chosenId; document.getElementById(name).value = chosenId;
@ -57,15 +36,15 @@
} }
function updateRelatedObjectLinks(triggeringLink) { function updateRelatedObjectLinks(triggeringLink) {
var $this = $(triggeringLink); const $this = $(triggeringLink);
var siblings = $this.nextAll('.view-related, .change-related, .delete-related'); const siblings = $this.nextAll('.view-related, .change-related, .delete-related');
if (!siblings.length) { if (!siblings.length) {
return; return;
} }
var value = $this.val(); const value = $this.val();
if (value) { if (value) {
siblings.each(function() { siblings.each(function() {
var elm = $(this); const elm = $(this);
elm.attr('href', elm.attr('data-href-template').replace('__fk__', value)); elm.attr('href', elm.attr('data-href-template').replace('__fk__', value));
}); });
} else { } else {
@ -74,14 +53,14 @@
} }
function dismissAddRelatedObjectPopup(win, newId, newRepr) { function dismissAddRelatedObjectPopup(win, newId, newRepr) {
var name = windowname_to_id(win.name); const name = win.name;
var elem = document.getElementById(name); const elem = document.getElementById(name);
if (elem) { if (elem) {
var elemName = elem.nodeName.toUpperCase(); const elemName = elem.nodeName.toUpperCase();
if (elemName === 'SELECT') { if (elemName === 'SELECT') {
elem.options[elem.options.length] = new Option(newRepr, newId, true, true); elem.options[elem.options.length] = new Option(newRepr, newId, true, true);
} else if (elemName === 'INPUT') { } else if (elemName === 'INPUT') {
if (elem.className.indexOf('vManyToManyRawIdAdminField') !== -1 && elem.value) { if (elem.classList.contains('vManyToManyRawIdAdminField') && elem.value) {
elem.value += ',' + newId; elem.value += ',' + newId;
} else { } else {
elem.value = newId; elem.value = newId;
@ -90,8 +69,8 @@
// Trigger a change event to update related links if required. // Trigger a change event to update related links if required.
$(elem).trigger('change'); $(elem).trigger('change');
} else { } else {
var toId = name + "_to"; const toId = name + "_to";
var o = new Option(newRepr, newId); const o = new Option(newRepr, newId);
SelectBox.add_to_cache(toId, o); SelectBox.add_to_cache(toId, o);
SelectBox.redisplay(toId); SelectBox.redisplay(toId);
} }
@ -99,9 +78,9 @@
} }
function dismissChangeRelatedObjectPopup(win, objId, newRepr, newId) { function dismissChangeRelatedObjectPopup(win, objId, newRepr, newId) {
var id = windowname_to_id(win.name).replace(/^edit_/, ''); const id = win.name.replace(/^edit_/, '');
var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); const selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]);
var selects = $(selectsSelector); const selects = $(selectsSelector);
selects.find('option').each(function() { selects.find('option').each(function() {
if (this.value === objId) { if (this.value === objId) {
this.textContent = newRepr; this.textContent = newRepr;
@ -118,9 +97,9 @@
} }
function dismissDeleteRelatedObjectPopup(win, objId) { function dismissDeleteRelatedObjectPopup(win, objId) {
var id = windowname_to_id(win.name).replace(/^delete_/, ''); const id = win.name.replace(/^delete_/, '');
var selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]); const selectsSelector = interpolate('#%s, #%s_from, #%s_to', [id, id, id]);
var selects = $(selectsSelector); const selects = $(selectsSelector);
selects.find('option').each(function() { selects.find('option').each(function() {
if (this.value === objId) { if (this.value === objId) {
$(this).remove(); $(this).remove();
@ -129,10 +108,6 @@
win.close(); win.close();
} }
// Global for testing purposes
window.id_to_windowname = id_to_windowname;
window.windowname_to_id = windowname_to_id;
window.showRelatedObjectLookupPopup = showRelatedObjectLookupPopup; window.showRelatedObjectLookupPopup = showRelatedObjectLookupPopup;
window.dismissRelatedLookupPopup = dismissRelatedLookupPopup; window.dismissRelatedLookupPopup = dismissRelatedLookupPopup;
window.showRelatedObjectPopup = showRelatedObjectPopup; window.showRelatedObjectPopup = showRelatedObjectPopup;
@ -153,7 +128,7 @@
$('body').on('click', '.related-widget-wrapper-link', function(e) { $('body').on('click', '.related-widget-wrapper-link', function(e) {
e.preventDefault(); e.preventDefault();
if (this.href) { if (this.href) {
var event = $.Event('django:show-related', {href: this.href}); const event = $.Event('django:show-related', {href: this.href});
$(this).trigger(event); $(this).trigger(event);
if (!event.isDefaultPrevented()) { if (!event.isDefaultPrevented()) {
showRelatedObjectPopup(this); showRelatedObjectPopup(this);
@ -161,7 +136,7 @@
} }
}); });
$('body').on('change', '.related-widget-wrapper select', function(e) { $('body').on('change', '.related-widget-wrapper select', function(e) {
var event = $.Event('django:update-related'); const event = $.Event('django:update-related');
$(this).trigger(event); $(this).trigger(event);
if (!event.isDefaultPrevented()) { if (!event.isDefaultPrevented()) {
updateRelatedObjectLinks(this); updateRelatedObjectLinks(this);
@ -170,12 +145,11 @@
$('.related-widget-wrapper select').trigger('change'); $('.related-widget-wrapper select').trigger('change');
$('body').on('click', '.related-lookup', function(e) { $('body').on('click', '.related-lookup', function(e) {
e.preventDefault(); e.preventDefault();
var event = $.Event('django:lookup-related'); const event = $.Event('django:lookup-related');
$(this).trigger(event); $(this).trigger(event);
if (!event.isDefaultPrevented()) { if (!event.isDefaultPrevented()) {
showRelatedObjectLookupPopup(this); showRelatedObjectLookupPopup(this);
} }
}); });
}); });
}
})(django.jQuery);

View File

@ -1,12 +1,16 @@
(function($) { 'use strict';
'use strict'; {
var init = function($element, options) { const $ = django.jQuery;
var settings = $.extend({ const init = function($element, options) {
const settings = $.extend({
ajax: { ajax: {
data: function(params) { data: function(params) {
return { return {
term: params.term, term: params.term,
page: params.page page: params.page,
app_label: $element.data('app-label'),
model_name: $element.data('model-name'),
field_name: $element.data('field-name')
}; };
} }
} }
@ -15,9 +19,9 @@
}; };
$.fn.djangoAdminSelect2 = function(options) { $.fn.djangoAdminSelect2 = function(options) {
var settings = $.extend({}, options); const settings = $.extend({}, options);
$.each(this, function(i, element) { $.each(this, function(i, element) {
var $element = $(element); const $element = $(element);
init($element, settings); init($element, settings);
}); });
return this; return this;
@ -34,4 +38,4 @@
return $newFormset.find('.admin-autocomplete').djangoAdminSelect2(); return $newFormset.find('.admin-autocomplete').djangoAdminSelect2();
}; };
})(this)); })(this));
}(django.jQuery)); }

View File

@ -3,11 +3,10 @@
calendar.js - Calendar functions by Adrian Holovaty calendar.js - Calendar functions by Adrian Holovaty
depends on core.js for utility functions like removeChildren or quickElement depends on core.js for utility functions like removeChildren or quickElement
*/ */
'use strict';
(function() { {
'use strict';
// CalendarNamespace -- Provides a collection of HTML calendar-related helper functions // CalendarNamespace -- Provides a collection of HTML calendar-related helper functions
var CalendarNamespace = { const CalendarNamespace = {
monthsOfYear: [ monthsOfYear: [
gettext('January'), gettext('January'),
gettext('February'), gettext('February'),
@ -22,6 +21,20 @@ depends on core.js for utility functions like removeChildren or quickElement
gettext('November'), gettext('November'),
gettext('December') gettext('December')
], ],
monthsOfYearAbbrev: [
pgettext('abbrev. month January', 'Jan'),
pgettext('abbrev. month February', 'Feb'),
pgettext('abbrev. month March', 'Mar'),
pgettext('abbrev. month April', 'Apr'),
pgettext('abbrev. month May', 'May'),
pgettext('abbrev. month June', 'Jun'),
pgettext('abbrev. month July', 'Jul'),
pgettext('abbrev. month August', 'Aug'),
pgettext('abbrev. month September', 'Sep'),
pgettext('abbrev. month October', 'Oct'),
pgettext('abbrev. month November', 'Nov'),
pgettext('abbrev. month December', 'Dec')
],
daysOfWeek: [ daysOfWeek: [
pgettext('one letter Sunday', 'S'), pgettext('one letter Sunday', 'S'),
pgettext('one letter Monday', 'M'), pgettext('one letter Monday', 'M'),
@ -36,7 +49,7 @@ depends on core.js for utility functions like removeChildren or quickElement
return (((year % 4) === 0) && ((year % 100) !== 0 ) || ((year % 400) === 0)); return (((year % 4) === 0) && ((year % 100) !== 0 ) || ((year % 400) === 0));
}, },
getDaysInMonth: function(month, year) { getDaysInMonth: function(month, year) {
var days; let days;
if (month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12) { if (month === 1 || month === 3 || month === 5 || month === 7 || month === 8 || month === 10 || month === 12) {
days = 31; days = 31;
} }
@ -52,11 +65,11 @@ depends on core.js for utility functions like removeChildren or quickElement
return days; return days;
}, },
draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999 draw: function(month, year, div_id, callback, selected) { // month = 1-12, year = 1-9999
var today = new Date(); const today = new Date();
var todayDay = today.getDate(); const todayDay = today.getDate();
var todayMonth = today.getMonth() + 1; const todayMonth = today.getMonth() + 1;
var todayYear = today.getFullYear(); const todayYear = today.getFullYear();
var todayClass = ''; let todayClass = '';
// Use UTC functions here because the date field does not contain time // Use UTC functions here because the date field does not contain time
// and using the UTC function variants prevent the local time offset // and using the UTC function variants prevent the local time offset
@ -69,33 +82,33 @@ depends on core.js for utility functions like removeChildren or quickElement
// //
// The day variable above will be 1 instead of 2 in, say, US Pacific time // The day variable above will be 1 instead of 2 in, say, US Pacific time
// zone. // zone.
var isSelectedMonth = false; let isSelectedMonth = false;
if (typeof selected !== 'undefined') { if (typeof selected !== 'undefined') {
isSelectedMonth = (selected.getUTCFullYear() === year && (selected.getUTCMonth() + 1) === month); isSelectedMonth = (selected.getUTCFullYear() === year && (selected.getUTCMonth() + 1) === month);
} }
month = parseInt(month); month = parseInt(month);
year = parseInt(year); year = parseInt(year);
var calDiv = document.getElementById(div_id); const calDiv = document.getElementById(div_id);
removeChildren(calDiv); removeChildren(calDiv);
var calTable = document.createElement('table'); const calTable = document.createElement('table');
quickElement('caption', calTable, CalendarNamespace.monthsOfYear[month - 1] + ' ' + year); quickElement('caption', calTable, CalendarNamespace.monthsOfYear[month - 1] + ' ' + year);
var tableBody = quickElement('tbody', calTable); const tableBody = quickElement('tbody', calTable);
// Draw days-of-week header // Draw days-of-week header
var tableRow = quickElement('tr', tableBody); let tableRow = quickElement('tr', tableBody);
for (var i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]); quickElement('th', tableRow, CalendarNamespace.daysOfWeek[(i + CalendarNamespace.firstDayOfWeek) % 7]);
} }
var startingPos = new Date(year, month - 1, 1 - CalendarNamespace.firstDayOfWeek).getDay(); const startingPos = new Date(year, month - 1, 1 - CalendarNamespace.firstDayOfWeek).getDay();
var days = CalendarNamespace.getDaysInMonth(month, year); const days = CalendarNamespace.getDaysInMonth(month, year);
var nonDayCell; let nonDayCell;
// Draw blanks before first of month // Draw blanks before first of month
tableRow = quickElement('tr', tableBody); tableRow = quickElement('tr', tableBody);
for (i = 0; i < startingPos; i++) { for (let i = 0; i < startingPos; i++) {
nonDayCell = quickElement('td', tableRow, ' '); nonDayCell = quickElement('td', tableRow, ' ');
nonDayCell.className = "nonday"; nonDayCell.className = "nonday";
} }
@ -109,8 +122,8 @@ depends on core.js for utility functions like removeChildren or quickElement
} }
// Draw days of month // Draw days of month
var currentDay = 1; let currentDay = 1;
for (i = startingPos; currentDay <= days; i++) { for (let i = startingPos; currentDay <= days; i++) {
if (i % 7 === 0 && currentDay !== 1) { if (i % 7 === 0 && currentDay !== 1) {
tableRow = quickElement('tr', tableBody); tableRow = quickElement('tr', tableBody);
} }
@ -128,8 +141,8 @@ depends on core.js for utility functions like removeChildren or quickElement
todayClass += "selected"; todayClass += "selected";
} }
var cell = quickElement('td', tableRow, '', 'class', todayClass); const cell = quickElement('td', tableRow, '', 'class', todayClass);
var link = quickElement('a', cell, currentDay, 'href', '#'); const link = quickElement('a', cell, currentDay, 'href', '#');
link.addEventListener('click', calendarMonth(year, month)); link.addEventListener('click', calendarMonth(year, month));
currentDay++; currentDay++;
} }
@ -205,4 +218,4 @@ depends on core.js for utility functions like removeChildren or quickElement
}; };
window.Calendar = Calendar; window.Calendar = Calendar;
window.CalendarNamespace = CalendarNamespace; window.CalendarNamespace = CalendarNamespace;
})(); }

View File

@ -1,13 +1,29 @@
(function($) { 'use strict';
'use strict'; {
$(function() { // Call function fn when the DOM is loaded and ready. If it is already
$('.cancel-link').on('click', function(e) { // loaded, call the function now.
e.preventDefault(); // http://youmightnotneedjquery.com/#ready
if (window.location.search.indexOf('&_popup=1') === -1) { function ready(fn) {
window.history.back(); // Go back if not a popup. if (document.readyState !== 'loading') {
fn();
} else { } else {
window.close(); // Otherwise, close the popup. document.addEventListener('DOMContentLoaded', fn);
} }
}
ready(function() {
function handleClick(event) {
event.preventDefault();
const params = new URLSearchParams(window.location.search);
if (params.has('_popup')) {
window.close(); // Close the popup.
} else {
window.history.back(); // Otherwise, go back.
}
}
document.querySelectorAll('.cancel-link').forEach(function(el) {
el.addEventListener('click', handleClick);
}); });
}); });
})(django.jQuery); }

View File

@ -1,20 +1,16 @@
/*global showAddAnotherPopup, showRelatedObjectLookupPopup showRelatedObjectPopup updateRelatedObjectLinks*/ 'use strict';
{
(function($) { const inputTags = ['BUTTON', 'INPUT', 'SELECT', 'TEXTAREA'];
'use strict'; const modelName = document.getElementById('django-admin-form-add-constants').dataset.modelName;
$(document).ready(function() {
var modelName = $('#django-admin-form-add-constants').data('modelName');
$('body').on('click', '.add-another', function(e) {
e.preventDefault();
var event = $.Event('django:add-another-related');
$(this).trigger(event);
if (!event.isDefaultPrevented()) {
showAddAnotherPopup(this);
}
});
if (modelName) { if (modelName) {
$('form#' + modelName + '_form :input:visible:enabled:first').focus(); const form = document.getElementById(modelName + '_form');
for (const element of form.elements) {
// HTMLElement.offsetParent returns null when the element is not
// rendered.
if (inputTags.includes(element.tagName) && !element.disabled && element.offsetParent) {
element.focus();
break;
} }
}); }
})(django.jQuery); }
}

View File

@ -1,29 +1,18 @@
/*global gettext*/ /*global gettext*/
(function() { 'use strict';
'use strict'; {
var closestElem = function(elem, tagName) {
if (elem.nodeName === tagName.toUpperCase()) {
return elem;
}
if (elem.parentNode.nodeName === 'BODY') {
return null;
}
return elem.parentNode && closestElem(elem.parentNode, tagName);
};
window.addEventListener('load', function() { window.addEventListener('load', function() {
// Add anchor tag for Show/Hide link // Add anchor tag for Show/Hide link
var fieldsets = document.querySelectorAll('fieldset.collapse'); const fieldsets = document.querySelectorAll('fieldset.collapse');
for (var i = 0; i < fieldsets.length; i++) { for (const [i, elem] of fieldsets.entries()) {
var elem = fieldsets[i];
// Don't hide if fields in this fieldset have errors // Don't hide if fields in this fieldset have errors
if (elem.querySelectorAll('div.errors').length === 0) { if (elem.querySelectorAll('div.errors, ul.errorlist').length === 0) {
elem.classList.add('collapsed'); elem.classList.add('collapsed');
var h2 = elem.querySelector('h2'); const h2 = elem.querySelector('h2');
var link = document.createElement('a'); const link = document.createElement('a');
link.setAttribute('id', 'fieldsetcollapser' + i); link.id = 'fieldsetcollapser' + i;
link.setAttribute('class', 'collapse-toggle'); link.className = 'collapse-toggle';
link.setAttribute('href', '#'); link.href = '#';
link.textContent = gettext('Show'); link.textContent = gettext('Show');
h2.appendChild(document.createTextNode(' (')); h2.appendChild(document.createTextNode(' ('));
h2.appendChild(link); h2.appendChild(link);
@ -31,11 +20,11 @@
} }
} }
// Add toggle to hide/show anchor tag // Add toggle to hide/show anchor tag
var toggleFunc = function(ev) { const toggleFunc = function(ev) {
if (ev.target.matches('.collapse-toggle')) { if (ev.target.matches('.collapse-toggle')) {
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
var fieldset = closestElem(ev.target, 'fieldset'); const fieldset = ev.target.closest('fieldset');
if (fieldset.classList.contains('collapsed')) { if (fieldset.classList.contains('collapsed')) {
// Show // Show
ev.target.textContent = gettext('Hide'); ev.target.textContent = gettext('Hide');
@ -47,9 +36,8 @@
} }
} }
}; };
var inlineDivs = document.querySelectorAll('fieldset.module'); document.querySelectorAll('fieldset.module').forEach(function(el) {
for (i = 0; i < inlineDivs.length; i++) { el.addEventListener('click', toggleFunc);
inlineDivs[i].addEventListener('click', toggleFunc);
}
}); });
})(); });
}

View File

@ -1,19 +1,15 @@
// Core javascript helper functions // Core javascript helper functions
'use strict';
// basic browser identification & version
var isOpera = (navigator.userAgent.indexOf("Opera") >= 0) && parseFloat(navigator.appVersion);
var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]);
// quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]); // quickElement(tagType, parentReference [, textInChildNode, attribute, attributeValue ...]);
function quickElement() { function quickElement() {
'use strict'; const obj = document.createElement(arguments[0]);
var obj = document.createElement(arguments[0]);
if (arguments[2]) { if (arguments[2]) {
var textNode = document.createTextNode(arguments[2]); const textNode = document.createTextNode(arguments[2]);
obj.appendChild(textNode); obj.appendChild(textNode);
} }
var len = arguments.length; const len = arguments.length;
for (var i = 3; i < len; i += 2) { for (let i = 3; i < len; i += 2) {
obj.setAttribute(arguments[i], arguments[i + 1]); obj.setAttribute(arguments[i], arguments[i + 1]);
} }
arguments[1].appendChild(obj); arguments[1].appendChild(obj);
@ -22,7 +18,6 @@ function quickElement() {
// "a" is reference to an object // "a" is reference to an object
function removeChildren(a) { function removeChildren(a) {
'use strict';
while (a.hasChildNodes()) { while (a.hasChildNodes()) {
a.removeChild(a.lastChild); a.removeChild(a.lastChild);
} }
@ -33,16 +28,11 @@ function removeChildren(a) {
// See https://www.quirksmode.org/js/findpos.html // See https://www.quirksmode.org/js/findpos.html
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
function findPosX(obj) { function findPosX(obj) {
'use strict'; let curleft = 0;
var curleft = 0;
if (obj.offsetParent) { if (obj.offsetParent) {
while (obj.offsetParent) { while (obj.offsetParent) {
curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft);
obj = obj.offsetParent;
}
// IE offsetParent does not include the top-level
if (isIE && obj.parentElement) {
curleft += obj.offsetLeft - obj.scrollLeft; curleft += obj.offsetLeft - obj.scrollLeft;
obj = obj.offsetParent;
} }
} else if (obj.x) { } else if (obj.x) {
curleft += obj.x; curleft += obj.x;
@ -51,16 +41,11 @@ function findPosX(obj) {
} }
function findPosY(obj) { function findPosY(obj) {
'use strict'; let curtop = 0;
var curtop = 0;
if (obj.offsetParent) { if (obj.offsetParent) {
while (obj.offsetParent) { while (obj.offsetParent) {
curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop);
obj = obj.offsetParent;
}
// IE offsetParent does not include the top-level
if (isIE && obj.parentElement) {
curtop += obj.offsetTop - obj.scrollTop; curtop += obj.offsetTop - obj.scrollTop;
obj = obj.offsetParent;
} }
} else if (obj.y) { } else if (obj.y) {
curtop += obj.y; curtop += obj.y;
@ -71,16 +56,9 @@ function findPosY(obj) {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Date object extensions // Date object extensions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
(function() { {
'use strict';
Date.prototype.getTwelveHours = function() { Date.prototype.getTwelveHours = function() {
var hours = this.getHours(); return this.getHours() % 12 || 12;
if (hours === 0) {
return 12;
}
else {
return hours <= 12 ? hours : hours - 12;
}
}; };
Date.prototype.getTwoDigitMonth = function() { Date.prototype.getTwoDigitMonth = function() {
@ -107,12 +85,10 @@ function findPosY(obj) {
return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds(); return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds();
}; };
Date.prototype.getHourMinute = function() { Date.prototype.getAbbrevMonthName = function() {
return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute(); return typeof window.CalendarNamespace === "undefined"
}; ? this.getTwoDigitMonth()
: window.CalendarNamespace.monthsOfYearAbbrev[this.getMonth()];
Date.prototype.getHourMinuteSecond = function() {
return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond();
}; };
Date.prototype.getFullMonthName = function() { Date.prototype.getFullMonthName = function() {
@ -122,7 +98,8 @@ function findPosY(obj) {
}; };
Date.prototype.strftime = function(format) { Date.prototype.strftime = function(format) {
var fields = { const fields = {
b: this.getAbbrevMonthName(),
B: this.getFullMonthName(), B: this.getFullMonthName(),
c: this.toString(), c: this.toString(),
d: this.getTwoDigitDate(), d: this.getTwoDigitDate(),
@ -139,7 +116,7 @@ function findPosY(obj) {
Y: '' + this.getFullYear(), Y: '' + this.getFullYear(),
'%': '%' '%': '%'
}; };
var result = '', i = 0; let result = '', i = 0;
while (i < format.length) { while (i < format.length) {
if (format.charAt(i) === '%') { if (format.charAt(i) === '%') {
result = result + fields[format.charAt(i + 1)]; result = result + fields[format.charAt(i + 1)];
@ -156,19 +133,11 @@ function findPosY(obj) {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// String object extensions // String object extensions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
String.prototype.pad_left = function(pad_length, pad_string) {
var new_string = this;
for (var i = 0; new_string.length < pad_length; i++) {
new_string = pad_string + new_string;
}
return new_string;
};
String.prototype.strptime = function(format) { String.prototype.strptime = function(format) {
var split_format = format.split(/[.\-/]/); const split_format = format.split(/[.\-/]/);
var date = this.split(/[.\-/]/); const date = this.split(/[.\-/]/);
var i = 0; let i = 0;
var day, month, year; let day, month, year;
while (i < split_format.length) { while (i < split_format.length) {
switch (split_format[i]) { switch (split_format[i]) {
case "%d": case "%d":
@ -181,7 +150,14 @@ function findPosY(obj) {
year = date[i]; year = date[i];
break; break;
case "%y": case "%y":
// A %y value in the range of [00, 68] is in the current
// century, while [69, 99] is in the previous century,
// according to the Open Group Specification.
if (parseInt(date[i], 10) >= 69) {
year = date[i]; year = date[i];
} else {
year = (new Date(Date.UTC(date[i], 0))).getUTCFullYear() + 100;
}
break; break;
} }
++i; ++i;
@ -191,22 +167,4 @@ function findPosY(obj) {
// date extraction. // date extraction.
return new Date(Date.UTC(year, month, day)); return new Date(Date.UTC(year, month, day));
}; };
})();
// ----------------------------------------------------------------------------
// Get the computed style for and element
// ----------------------------------------------------------------------------
function getStyle(oElm, strCssRule) {
'use strict';
var strValue = "";
if(document.defaultView && document.defaultView.getComputedStyle) {
strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
}
else if(oElm.currentStyle) {
strCssRule = strCssRule.replace(/\-(\w)/g, function(strMatch, p1) {
return p1.toUpperCase();
});
strValue = oElm.currentStyle[strCssRule];
}
return strValue;
} }

View File

@ -15,15 +15,16 @@
* Licensed under the New BSD License * Licensed under the New BSD License
* See: https://opensource.org/licenses/bsd-license.php * See: https://opensource.org/licenses/bsd-license.php
*/ */
(function($) { 'use strict';
'use strict'; {
const $ = django.jQuery;
$.fn.formset = function(opts) { $.fn.formset = function(opts) {
var options = $.extend({}, $.fn.formset.defaults, opts); const options = $.extend({}, $.fn.formset.defaults, opts);
var $this = $(this); const $this = $(this);
var $parent = $this.parent(); const $parent = $this.parent();
var updateElementIndex = function(el, prefix, ndx) { const updateElementIndex = function(el, prefix, ndx) {
var id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))"); const id_regex = new RegExp("(" + prefix + "-(\\d+|__prefix__))");
var replacement = prefix + "-" + ndx; const replacement = prefix + "-" + ndx;
if ($(el).prop("for")) { if ($(el).prop("for")) {
$(el).prop("for", $(el).prop("for").replace(id_regex, replacement)); $(el).prop("for", $(el).prop("for").replace(id_regex, replacement));
} }
@ -34,22 +35,21 @@
el.name = el.name.replace(id_regex, replacement); el.name = el.name.replace(id_regex, replacement);
} }
}; };
var totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").prop("autocomplete", "off"); const totalForms = $("#id_" + options.prefix + "-TOTAL_FORMS").prop("autocomplete", "off");
var nextIndex = parseInt(totalForms.val(), 10); let nextIndex = parseInt(totalForms.val(), 10);
var maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").prop("autocomplete", "off"); const maxForms = $("#id_" + options.prefix + "-MAX_NUM_FORMS").prop("autocomplete", "off");
// only show the add button if we are allowed to add more items, const minForms = $("#id_" + options.prefix + "-MIN_NUM_FORMS").prop("autocomplete", "off");
// note that max_num = None translates to a blank string. let addButton;
var showAddButton = maxForms.val() === '' || (maxForms.val() - totalForms.val()) > 0;
$this.each(function(i) { /**
$(this).not("." + options.emptyCssClass).addClass(options.formCssClass); * The "Add another MyModel" button below the inline forms.
}); */
if ($this.length && showAddButton) { const addInlineAddButton = function() {
var addButton = options.addButton;
if (addButton === null) { if (addButton === null) {
if ($this.prop("tagName") === "TR") { if ($this.prop("tagName") === "TR") {
// If forms are laid out as table rows, insert the // If forms are laid out as table rows, insert the
// "add" button in a new table row: // "add" button in a new table row:
var numCols = this.eq(-1).children().length; const numCols = $this.eq(-1).children().length;
$parent.append('<tr class="' + options.addCssClass + '"><td colspan="' + numCols + '"><a href="#">' + options.addText + "</a></tr>"); $parent.append('<tr class="' + options.addCssClass + '"><td colspan="' + numCols + '"><a href="#">' + options.addText + "</a></tr>");
addButton = $parent.find("tr:last a"); addButton = $parent.find("tr:last a");
} else { } else {
@ -58,13 +58,44 @@
addButton = $this.filter(":last").next().find("a"); addButton = $this.filter(":last").next().find("a");
} }
} }
addButton.on('click', function(e) { addButton.on('click', addInlineClickHandler);
};
const addInlineClickHandler = function(e) {
e.preventDefault(); e.preventDefault();
var template = $("#" + options.prefix + "-empty"); const template = $("#" + options.prefix + "-empty");
var row = template.clone(true); const row = template.clone(true);
row.removeClass(options.emptyCssClass) row.removeClass(options.emptyCssClass)
.addClass(options.formCssClass) .addClass(options.formCssClass)
.attr("id", options.prefix + "-" + nextIndex); .attr("id", options.prefix + "-" + nextIndex);
addInlineDeleteButton(row);
row.find("*").each(function() {
updateElementIndex(this, options.prefix, totalForms.val());
});
// Insert the new form when it has been fully edited.
row.insertBefore($(template));
// Update number of total forms.
$(totalForms).val(parseInt(totalForms.val(), 10) + 1);
nextIndex += 1;
// Hide the add button if there's a limit and it's been reached.
if ((maxForms.val() !== '') && (maxForms.val() - totalForms.val()) <= 0) {
addButton.parent().hide();
}
// Show the remove buttons if there are more than min_num.
toggleDeleteButtonVisibility(row.closest('.inline-group'));
// Pass the new form to the post-add callback, if provided.
if (options.added) {
options.added(row);
}
$(document).trigger('formset:added', [row, options.prefix]);
};
/**
* The "X" button that is part of every unsaved inline.
* (When saved, it is replaced with a "Delete" checkbox.)
*/
const addInlineDeleteButton = function(row) {
if (row.is("tr")) { if (row.is("tr")) {
// If the forms are laid out in table rows, insert // If the forms are laid out in table rows, insert
// the remove button into the last table cell: // the remove button into the last table cell:
@ -78,54 +109,80 @@
// last child element of the form's container: // last child element of the form's container:
row.children(":first").append('<span><a class="' + options.deleteCssClass + '" href="#">' + options.deleteText + "</a></span>"); row.children(":first").append('<span><a class="' + options.deleteCssClass + '" href="#">' + options.deleteText + "</a></span>");
} }
row.find("*").each(function() { // Add delete handler for each row.
updateElementIndex(this, options.prefix, totalForms.val()); row.find("a." + options.deleteCssClass).on('click', inlineDeleteHandler.bind(this));
}); };
// Insert the new form when it has been fully edited
row.insertBefore($(template)); const inlineDeleteHandler = function(e1) {
// Update number of total forms
$(totalForms).val(parseInt(totalForms.val(), 10) + 1);
nextIndex += 1;
// Hide add button in case we've hit the max, except we want to add infinitely
if ((maxForms.val() !== '') && (maxForms.val() - totalForms.val()) <= 0) {
addButton.parent().hide();
}
// The delete button of each row triggers a bunch of other things
row.find("a." + options.deleteCssClass).on('click', function(e1) {
e1.preventDefault(); e1.preventDefault();
// Remove the parent form containing this button: const deleteButton = $(e1.target);
const row = deleteButton.closest('.' + options.formCssClass);
const inlineGroup = row.closest('.inline-group');
// Remove the parent form containing this button,
// and also remove the relevant row with non-field errors:
const prevRow = row.prev();
if (prevRow.length && prevRow.hasClass('row-form-errors')) {
prevRow.remove();
}
row.remove(); row.remove();
nextIndex -= 1; nextIndex -= 1;
// If a post-delete callback was provided, call it with the deleted form: // Pass the deleted form to the post-delete callback, if provided.
if (options.removed) { if (options.removed) {
options.removed(row); options.removed(row);
} }
$(document).trigger('formset:removed', [row, options.prefix]); $(document).trigger('formset:removed', [row, options.prefix]);
// Update the TOTAL_FORMS form count. // Update the TOTAL_FORMS form count.
var forms = $("." + options.formCssClass); const forms = $("." + options.formCssClass);
$("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length); $("#id_" + options.prefix + "-TOTAL_FORMS").val(forms.length);
// Show add button again once we drop below max // Show add button again once below maximum number.
if ((maxForms.val() === '') || (maxForms.val() - forms.length) > 0) { if ((maxForms.val() === '') || (maxForms.val() - forms.length) > 0) {
addButton.parent().show(); addButton.parent().show();
} }
// Also, update names and ids for all remaining form controls // Hide the remove buttons if at min_num.
// so they remain in sequence: toggleDeleteButtonVisibility(inlineGroup);
var i, formCount; // Also, update names and ids for all remaining form controls so
var updateElementCallback = function() { // they remain in sequence:
let i, formCount;
const updateElementCallback = function() {
updateElementIndex(this, options.prefix, i); updateElementIndex(this, options.prefix, i);
}; };
for (i = 0, formCount = forms.length; i < formCount; i++) { for (i = 0, formCount = forms.length; i < formCount; i++) {
updateElementIndex($(forms).get(i), options.prefix, i); updateElementIndex($(forms).get(i), options.prefix, i);
$(forms.get(i)).find("*").each(updateElementCallback); $(forms.get(i)).find("*").each(updateElementCallback);
} }
}); };
// If a post-add callback was supplied, call it with the added form:
if (options.added) { const toggleDeleteButtonVisibility = function(inlineGroup) {
options.added(row); if ((minForms.val() !== '') && (minForms.val() - totalForms.val()) >= 0) {
inlineGroup.find('.inline-deletelink').hide();
} else {
inlineGroup.find('.inline-deletelink').show();
} }
$(document).trigger('formset:added', [row, options.prefix]); };
$this.each(function(i) {
$(this).not("." + options.emptyCssClass).addClass(options.formCssClass);
}); });
// Create the delete buttons for all unsaved inlines:
$this.filter('.' + options.formCssClass + ':not(.has_original):not(.' + options.emptyCssClass + ')').each(function() {
addInlineDeleteButton($(this));
});
toggleDeleteButtonVisibility($this);
// Create the add button, initially hidden.
addButton = options.addButton;
addInlineAddButton();
// Show the add button if allowed to add more items.
// Note that max_num = None translates to a blank string.
const showAddButton = maxForms.val() === '' || (maxForms.val() - totalForms.val()) > 0;
if ($this.length && showAddButton) {
addButton.parent().show();
} else {
addButton.parent().hide();
} }
return this; return this;
}; };
@ -146,14 +203,9 @@
// Tabular inlines --------------------------------------------------------- // Tabular inlines ---------------------------------------------------------
$.fn.tabularFormset = function(selector, options) { $.fn.tabularFormset = function(selector, options) {
var $rows = $(this); const $rows = $(this);
var alternatingRows = function(row) {
$(selector).not(".add-row").removeClass("row1 row2")
.filter(":even").addClass("row1").end()
.filter(":odd").addClass("row2");
};
var reinitDateTimeShortCuts = function() { const reinitDateTimeShortCuts = function() {
// Reinitialize the calendar and clock widgets by force // Reinitialize the calendar and clock widgets by force
if (typeof DateTimeShortcuts !== "undefined") { if (typeof DateTimeShortcuts !== "undefined") {
$(".datetimeshortcuts").remove(); $(".datetimeshortcuts").remove();
@ -161,24 +213,24 @@
} }
}; };
var updateSelectFilter = function() { const updateSelectFilter = function() {
// If any SelectFilter widgets are a part of the new form, // If any SelectFilter widgets are a part of the new form,
// instantiate a new SelectFilter instance for it. // instantiate a new SelectFilter instance for it.
if (typeof SelectFilter !== 'undefined') { if (typeof SelectFilter !== 'undefined') {
$('.selectfilter').each(function(index, value) { $('.selectfilter').each(function(index, value) {
var namearr = value.name.split('-'); const namearr = value.name.split('-');
SelectFilter.init(value.id, namearr[namearr.length - 1], false); SelectFilter.init(value.id, namearr[namearr.length - 1], false);
}); });
$('.selectfilterstacked').each(function(index, value) { $('.selectfilterstacked').each(function(index, value) {
var namearr = value.name.split('-'); const namearr = value.name.split('-');
SelectFilter.init(value.id, namearr[namearr.length - 1], true); SelectFilter.init(value.id, namearr[namearr.length - 1], true);
}); });
} }
}; };
var initPrepopulatedFields = function(row) { const initPrepopulatedFields = function(row) {
row.find('.prepopulated_field').each(function() { row.find('.prepopulated_field').each(function() {
var field = $(this), const field = $(this),
input = field.find('input, select, textarea'), input = field.find('input, select, textarea'),
dependency_list = input.data('dependency_list') || [], dependency_list = input.data('dependency_list') || [],
dependencies = []; dependencies = [];
@ -198,12 +250,10 @@
deleteCssClass: "inline-deletelink", deleteCssClass: "inline-deletelink",
deleteText: options.deleteText, deleteText: options.deleteText,
emptyCssClass: "empty-form", emptyCssClass: "empty-form",
removed: alternatingRows,
added: function(row) { added: function(row) {
initPrepopulatedFields(row); initPrepopulatedFields(row);
reinitDateTimeShortCuts(); reinitDateTimeShortCuts();
updateSelectFilter(); updateSelectFilter();
alternatingRows(row);
}, },
addButton: options.addButton addButton: options.addButton
}); });
@ -213,15 +263,15 @@
// Stacked inlines --------------------------------------------------------- // Stacked inlines ---------------------------------------------------------
$.fn.stackedFormset = function(selector, options) { $.fn.stackedFormset = function(selector, options) {
var $rows = $(this); const $rows = $(this);
var updateInlineLabel = function(row) { const updateInlineLabel = function(row) {
$(selector).find(".inline_label").each(function(i) { $(selector).find(".inline_label").each(function(i) {
var count = i + 1; const count = i + 1;
$(this).html($(this).html().replace(/(#\d+)/g, "#" + count)); $(this).html($(this).html().replace(/(#\d+)/g, "#" + count));
}); });
}; };
var reinitDateTimeShortCuts = function() { const reinitDateTimeShortCuts = function() {
// Reinitialize the calendar and clock widgets by force, yuck. // Reinitialize the calendar and clock widgets by force, yuck.
if (typeof DateTimeShortcuts !== "undefined") { if (typeof DateTimeShortcuts !== "undefined") {
$(".datetimeshortcuts").remove(); $(".datetimeshortcuts").remove();
@ -229,23 +279,23 @@
} }
}; };
var updateSelectFilter = function() { const updateSelectFilter = function() {
// If any SelectFilter widgets were added, instantiate a new instance. // If any SelectFilter widgets were added, instantiate a new instance.
if (typeof SelectFilter !== "undefined") { if (typeof SelectFilter !== "undefined") {
$(".selectfilter").each(function(index, value) { $(".selectfilter").each(function(index, value) {
var namearr = value.name.split('-'); const namearr = value.name.split('-');
SelectFilter.init(value.id, namearr[namearr.length - 1], false); SelectFilter.init(value.id, namearr[namearr.length - 1], false);
}); });
$(".selectfilterstacked").each(function(index, value) { $(".selectfilterstacked").each(function(index, value) {
var namearr = value.name.split('-'); const namearr = value.name.split('-');
SelectFilter.init(value.id, namearr[namearr.length - 1], true); SelectFilter.init(value.id, namearr[namearr.length - 1], true);
}); });
} }
}; };
var initPrepopulatedFields = function(row) { const initPrepopulatedFields = function(row) {
row.find('.prepopulated_field').each(function() { row.find('.prepopulated_field').each(function() {
var field = $(this), const field = $(this),
input = field.find('input, select, textarea'), input = field.find('input, select, textarea'),
dependency_list = input.data('dependency_list') || [], dependency_list = input.data('dependency_list') || [],
dependencies = []; dependencies = [];
@ -280,19 +330,19 @@
$(document).ready(function() { $(document).ready(function() {
$(".js-inline-admin-formset").each(function() { $(".js-inline-admin-formset").each(function() {
var data = $(this).data(), const data = $(this).data(),
inlineOptions = data.inlineFormset, inlineOptions = data.inlineFormset;
selector; let selector;
switch(data.inlineType) { switch(data.inlineType) {
case "stacked": case "stacked":
selector = inlineOptions.name + "-group .inline-related"; selector = inlineOptions.name + "-group .inline-related";
$(selector).stackedFormset(selector, inlineOptions.options); $(selector).stackedFormset(selector, inlineOptions.options);
break; break;
case "tabular": case "tabular":
selector = inlineOptions.name + "-group .tabular.inline-related tbody:first > tr"; selector = inlineOptions.name + "-group .tabular.inline-related tbody:first > tr.form-row";
$(selector).tabularFormset(selector, inlineOptions.options); $(selector).tabularFormset(selector, inlineOptions.options);
break; break;
} }
}); });
}); });
})(django.jQuery); }

View File

@ -1,8 +1,8 @@
/*global django:true, jQuery:false*/ /*global jQuery:false*/
'use strict';
/* Puts the included jQuery into our own namespace using noConflict and passing /* Puts the included jQuery into our own namespace using noConflict and passing
* it 'true'. This ensures that the included jQuery doesn't pollute the global * it 'true'. This ensures that the included jQuery doesn't pollute the global
* namespace (i.e. this preserves pre-existing values for both window.$ and * namespace (i.e. this preserves pre-existing values for both window.$ and
* window.jQuery). * window.jQuery).
*/ */
var django = django || {}; window.django = {jQuery: jQuery.noConflict(true)};
django.jQuery = jQuery.noConflict(true);

View File

@ -0,0 +1,39 @@
'use strict';
{
const toggleNavSidebar = document.getElementById('toggle-nav-sidebar');
if (toggleNavSidebar !== null) {
const navLinks = document.querySelectorAll('#nav-sidebar a');
function disableNavLinkTabbing() {
for (const navLink of navLinks) {
navLink.tabIndex = -1;
}
}
function enableNavLinkTabbing() {
for (const navLink of navLinks) {
navLink.tabIndex = 0;
}
}
const main = document.getElementById('main');
let navSidebarIsOpen = localStorage.getItem('django.admin.navSidebarIsOpen');
if (navSidebarIsOpen === null) {
navSidebarIsOpen = 'true';
}
if (navSidebarIsOpen === 'false') {
disableNavLinkTabbing();
}
main.classList.toggle('shifted', navSidebarIsOpen === 'true');
toggleNavSidebar.addEventListener('click', function() {
if (navSidebarIsOpen === 'true') {
navSidebarIsOpen = 'false';
disableNavLinkTabbing();
} else {
navSidebarIsOpen = 'true';
enableNavLinkTabbing();
}
localStorage.setItem('django.admin.navSidebarIsOpen', navSidebarIsOpen);
main.classList.toggle('shifted');
});
}
}

View File

@ -1,7 +1,7 @@
/*global opener */ /*global opener */
(function() { 'use strict';
'use strict'; {
var initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse); const initData = JSON.parse(document.getElementById('django-admin-popup-response-constants').dataset.popupResponse);
switch(initData.action) { switch(initData.action) {
case 'change': case 'change':
opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value); opener.dismissChangeRelatedObjectPopup(window, initData.value, initData.obj, initData.new_value);
@ -13,4 +13,4 @@
opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj); opener.dismissAddRelatedObjectPopup(window, initData.value, initData.obj);
break; break;
} }
})(); }

View File

@ -1,6 +1,7 @@
/*global URLify*/ /*global URLify*/
(function($) { 'use strict';
'use strict'; {
const $ = django.jQuery;
$.fn.prepopulate = function(dependencies, maxLength, allowUnicode) { $.fn.prepopulate = function(dependencies, maxLength, allowUnicode) {
/* /*
Depends on urlify.js Depends on urlify.js
@ -11,15 +12,15 @@
allowUnicode - Unicode support of the URLify'd string allowUnicode - Unicode support of the URLify'd string
*/ */
return this.each(function() { return this.each(function() {
var prepopulatedField = $(this); const prepopulatedField = $(this);
var populate = function() { const populate = function() {
// Bail if the field's value has been changed by the user // Bail if the field's value has been changed by the user
if (prepopulatedField.data('_changed')) { if (prepopulatedField.data('_changed')) {
return; return;
} }
var values = []; const values = [];
$.each(dependencies, function(i, field) { $.each(dependencies, function(i, field) {
field = $(field); field = $(field);
if (field.val().length > 0) { if (field.val().length > 0) {
@ -39,4 +40,4 @@
} }
}); });
}; };
})(django.jQuery); }

View File

@ -1,10 +1,11 @@
(function($) { 'use strict';
'use strict'; {
var fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields'); const $ = django.jQuery;
const fields = $('#django-admin-prepopulated-fields-constants').data('prepopulatedFields');
$.each(fields, function(index, field) { $.each(fields, function(index, field) {
$('.empty-form .form-row .field-' + field.name + ', .empty-form.form-row .field-' + field.name).addClass('prepopulated_field'); $('.empty-form .form-row .field-' + field.name + ', .empty-form.form-row .field-' + field.name).addClass('prepopulated_field');
$(field.id).data('dependency_list', field.dependency_list).prepopulate( $(field.id).data('dependency_list', field.dependency_list).prepopulate(
field.dependency_ids, field.maxLength, field.allowUnicode field.dependency_ids, field.maxLength, field.allowUnicode
); );
}); });
})(django.jQuery); }

View File

@ -1,8 +1,7 @@
/*global XRegExp*/ /*global XRegExp*/
(function() { 'use strict';
'use strict'; {
const LATIN_MAP = {
var LATIN_MAP = {
'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE', 'À': 'A', 'Á': 'A', 'Â': 'A', 'Ã': 'A', 'Ä': 'A', 'Å': 'A', 'Æ': 'AE',
'Ç': 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I', 'Ç': 'C', 'È': 'E', 'É': 'E', 'Ê': 'E', 'Ë': 'E', 'Ì': 'I', 'Í': 'I',
'Î': 'I', 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O', 'Î': 'I', 'Ï': 'I', 'Ð': 'D', 'Ñ': 'N', 'Ò': 'O', 'Ó': 'O', 'Ô': 'O',
@ -14,10 +13,10 @@
'ö': 'o', 'ő': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u', 'ö': 'o', 'ő': 'o', 'ø': 'o', 'ù': 'u', 'ú': 'u', 'û': 'u', 'ü': 'u',
'ű': 'u', 'ý': 'y', 'þ': 'th', 'ÿ': 'y' 'ű': 'u', 'ý': 'y', 'þ': 'th', 'ÿ': 'y'
}; };
var LATIN_SYMBOLS_MAP = { const LATIN_SYMBOLS_MAP = {
'©': '(c)' '©': '(c)'
}; };
var GREEK_MAP = { const GREEK_MAP = {
'α': 'a', 'β': 'b', 'γ': 'g', 'δ': 'd', 'ε': 'e', 'ζ': 'z', 'η': 'h', 'α': 'a', 'β': 'b', 'γ': 'g', 'δ': 'd', 'ε': 'e', 'ζ': 'z', 'η': 'h',
'θ': '8', 'ι': 'i', 'κ': 'k', 'λ': 'l', 'μ': 'm', 'ν': 'n', 'ξ': '3', 'θ': '8', 'ι': 'i', 'κ': 'k', 'λ': 'l', 'μ': 'm', 'ν': 'n', 'ξ': '3',
'ο': 'o', 'π': 'p', 'ρ': 'r', 'σ': 's', 'τ': 't', 'υ': 'y', 'φ': 'f', 'ο': 'o', 'π': 'p', 'ρ': 'r', 'σ': 's', 'τ': 't', 'υ': 'y', 'φ': 'f',
@ -29,15 +28,15 @@
'Φ': 'F', 'Χ': 'X', 'Ψ': 'PS', 'Ω': 'W', 'Ά': 'A', 'Έ': 'E', 'Ί': 'I', 'Φ': 'F', 'Χ': 'X', 'Ψ': 'PS', 'Ω': 'W', 'Ά': 'A', 'Έ': 'E', 'Ί': 'I',
'Ό': 'O', 'Ύ': 'Y', 'Ή': 'H', 'Ώ': 'W', 'Ϊ': 'I', 'Ϋ': 'Y' 'Ό': 'O', 'Ύ': 'Y', 'Ή': 'H', 'Ώ': 'W', 'Ϊ': 'I', 'Ϋ': 'Y'
}; };
var TURKISH_MAP = { const TURKISH_MAP = {
'ş': 's', 'Ş': 'S', 'ı': 'i', 'İ': 'I', 'ç': 'c', 'Ç': 'C', 'ü': 'u', 'ş': 's', 'Ş': 'S', 'ı': 'i', 'İ': 'I', 'ç': 'c', 'Ç': 'C', 'ü': 'u',
'Ü': 'U', 'ö': 'o', 'Ö': 'O', 'ğ': 'g', 'Ğ': 'G' 'Ü': 'U', 'ö': 'o', 'Ö': 'O', 'ğ': 'g', 'Ğ': 'G'
}; };
var ROMANIAN_MAP = { const ROMANIAN_MAP = {
'ă': 'a', 'î': 'i', 'ș': 's', 'ț': 't', 'â': 'a', 'ă': 'a', 'î': 'i', 'ș': 's', 'ț': 't', 'â': 'a',
'Ă': 'A', 'Î': 'I', 'Ș': 'S', 'Ț': 'T', 'Â': 'A' 'Ă': 'A', 'Î': 'I', 'Ș': 'S', 'Ț': 'T', 'Â': 'A'
}; };
var RUSSIAN_MAP = { const RUSSIAN_MAP = {
'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'yo', 'а': 'a', 'б': 'b', 'в': 'v', 'г': 'g', 'д': 'd', 'е': 'e', 'ё': 'yo',
'ж': 'zh', 'з': 'z', 'и': 'i', 'й': 'j', 'к': 'k', 'л': 'l', 'м': 'm', 'ж': 'zh', 'з': 'z', 'и': 'i', 'й': 'j', 'к': 'k', 'л': 'l', 'м': 'm',
'н': 'n', 'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u', 'н': 'n', 'о': 'o', 'п': 'p', 'р': 'r', 'с': 's', 'т': 't', 'у': 'u',
@ -49,16 +48,16 @@
'Ф': 'F', 'Х': 'H', 'Ц': 'C', 'Ч': 'Ch', 'Ш': 'Sh', 'Щ': 'Sh', 'Ъ': '', 'Ф': 'F', 'Х': 'H', 'Ц': 'C', 'Ч': 'Ch', 'Ш': 'Sh', 'Щ': 'Sh', 'Ъ': '',
'Ы': 'Y', 'Ь': '', 'Э': 'E', 'Ю': 'Yu', 'Я': 'Ya' 'Ы': 'Y', 'Ь': '', 'Э': 'E', 'Ю': 'Yu', 'Я': 'Ya'
}; };
var UKRAINIAN_MAP = { const UKRAINIAN_MAP = {
'Є': 'Ye', 'І': 'I', 'Ї': 'Yi', 'Ґ': 'G', 'є': 'ye', 'і': 'i', 'Є': 'Ye', 'І': 'I', 'Ї': 'Yi', 'Ґ': 'G', 'є': 'ye', 'і': 'i',
'ї': 'yi', 'ґ': 'g' 'ї': 'yi', 'ґ': 'g'
}; };
var CZECH_MAP = { const CZECH_MAP = {
'č': 'c', 'ď': 'd', 'ě': 'e', 'ň': 'n', 'ř': 'r', 'š': 's', 'ť': 't', 'č': 'c', 'ď': 'd', 'ě': 'e', 'ň': 'n', 'ř': 'r', 'š': 's', 'ť': 't',
'ů': 'u', 'ž': 'z', 'Č': 'C', 'Ď': 'D', 'Ě': 'E', 'Ň': 'N', 'Ř': 'R', 'ů': 'u', 'ž': 'z', 'Č': 'C', 'Ď': 'D', 'Ě': 'E', 'Ň': 'N', 'Ř': 'R',
'Š': 'S', 'Ť': 'T', 'Ů': 'U', 'Ž': 'Z' 'Š': 'S', 'Ť': 'T', 'Ů': 'U', 'Ž': 'Z'
}; };
var SLOVAK_MAP = { const SLOVAK_MAP = {
'á': 'a', 'ä': 'a', 'č': 'c', 'ď': 'd', 'é': 'e', 'í': 'i', 'ľ': 'l', 'á': 'a', 'ä': 'a', 'č': 'c', 'ď': 'd', 'é': 'e', 'í': 'i', 'ľ': 'l',
'ĺ': 'l', 'ň': 'n', 'ó': 'o', 'ô': 'o', 'ŕ': 'r', 'š': 's', 'ť': 't', 'ĺ': 'l', 'ň': 'n', 'ó': 'o', 'ô': 'o', 'ŕ': 'r', 'š': 's', 'ť': 't',
'ú': 'u', 'ý': 'y', 'ž': 'z', 'ú': 'u', 'ý': 'y', 'ž': 'z',
@ -66,40 +65,40 @@
'Ĺ': 'L', 'Ň': 'N', 'Ó': 'O', 'Ô': 'O', 'Ŕ': 'R', 'Š': 'S', 'Ť': 'T', 'Ĺ': 'L', 'Ň': 'N', 'Ó': 'O', 'Ô': 'O', 'Ŕ': 'R', 'Š': 'S', 'Ť': 'T',
'Ú': 'U', 'Ý': 'Y', 'Ž': 'Z' 'Ú': 'U', 'Ý': 'Y', 'Ž': 'Z'
}; };
var POLISH_MAP = { const POLISH_MAP = {
'ą': 'a', 'ć': 'c', 'ę': 'e', 'ł': 'l', 'ń': 'n', 'ó': 'o', 'ś': 's', 'ą': 'a', 'ć': 'c', 'ę': 'e', 'ł': 'l', 'ń': 'n', 'ó': 'o', 'ś': 's',
'ź': 'z', 'ż': 'z', 'ź': 'z', 'ż': 'z',
'Ą': 'A', 'Ć': 'C', 'Ę': 'E', 'Ł': 'L', 'Ń': 'N', 'Ó': 'O', 'Ś': 'S', 'Ą': 'A', 'Ć': 'C', 'Ę': 'E', 'Ł': 'L', 'Ń': 'N', 'Ó': 'O', 'Ś': 'S',
'Ź': 'Z', 'Ż': 'Z' 'Ź': 'Z', 'Ż': 'Z'
}; };
var LATVIAN_MAP = { const LATVIAN_MAP = {
'ā': 'a', 'č': 'c', 'ē': 'e', 'ģ': 'g', 'ī': 'i', 'ķ': 'k', 'ļ': 'l', 'ā': 'a', 'č': 'c', 'ē': 'e', 'ģ': 'g', 'ī': 'i', 'ķ': 'k', 'ļ': 'l',
'ņ': 'n', 'š': 's', 'ū': 'u', 'ž': 'z', 'ņ': 'n', 'š': 's', 'ū': 'u', 'ž': 'z',
'Ā': 'A', 'Č': 'C', 'Ē': 'E', 'Ģ': 'G', 'Ī': 'I', 'Ķ': 'K', 'Ļ': 'L', 'Ā': 'A', 'Č': 'C', 'Ē': 'E', 'Ģ': 'G', 'Ī': 'I', 'Ķ': 'K', 'Ļ': 'L',
'Ņ': 'N', 'Š': 'S', 'Ū': 'U', 'Ž': 'Z' 'Ņ': 'N', 'Š': 'S', 'Ū': 'U', 'Ž': 'Z'
}; };
var ARABIC_MAP = { const ARABIC_MAP = {
'أ': 'a', 'ب': 'b', 'ت': 't', 'ث': 'th', 'ج': 'g', 'ح': 'h', 'خ': 'kh', 'د': 'd', 'أ': 'a', 'ب': 'b', 'ت': 't', 'ث': 'th', 'ج': 'g', 'ح': 'h', 'خ': 'kh', 'د': 'd',
'ذ': 'th', 'ر': 'r', 'ز': 'z', 'س': 's', 'ش': 'sh', 'ص': 's', 'ض': 'd', 'ط': 't', 'ذ': 'th', 'ر': 'r', 'ز': 'z', 'س': 's', 'ش': 'sh', 'ص': 's', 'ض': 'd', 'ط': 't',
'ظ': 'th', 'ع': 'aa', 'غ': 'gh', 'ف': 'f', 'ق': 'k', 'ك': 'k', 'ل': 'l', 'م': 'm', 'ظ': 'th', 'ع': 'aa', 'غ': 'gh', 'ف': 'f', 'ق': 'k', 'ك': 'k', 'ل': 'l', 'م': 'm',
'ن': 'n', 'ه': 'h', 'و': 'o', 'ي': 'y' 'ن': 'n', 'ه': 'h', 'و': 'o', 'ي': 'y'
}; };
var LITHUANIAN_MAP = { const LITHUANIAN_MAP = {
'ą': 'a', 'č': 'c', 'ę': 'e', 'ė': 'e', 'į': 'i', 'š': 's', 'ų': 'u', 'ą': 'a', 'č': 'c', 'ę': 'e', 'ė': 'e', 'į': 'i', 'š': 's', 'ų': 'u',
'ū': 'u', 'ž': 'z', 'ū': 'u', 'ž': 'z',
'Ą': 'A', 'Č': 'C', 'Ę': 'E', 'Ė': 'E', 'Į': 'I', 'Š': 'S', 'Ų': 'U', 'Ą': 'A', 'Č': 'C', 'Ę': 'E', 'Ė': 'E', 'Į': 'I', 'Š': 'S', 'Ų': 'U',
'Ū': 'U', 'Ž': 'Z' 'Ū': 'U', 'Ž': 'Z'
}; };
var SERBIAN_MAP = { const SERBIAN_MAP = {
'ђ': 'dj', 'ј': 'j', 'љ': 'lj', 'њ': 'nj', 'ћ': 'c', 'џ': 'dz', 'ђ': 'dj', 'ј': 'j', 'љ': 'lj', 'њ': 'nj', 'ћ': 'c', 'џ': 'dz',
'đ': 'dj', 'Ђ': 'Dj', 'Ј': 'j', 'Љ': 'Lj', 'Њ': 'Nj', 'Ћ': 'C', 'đ': 'dj', 'Ђ': 'Dj', 'Ј': 'j', 'Љ': 'Lj', 'Њ': 'Nj', 'Ћ': 'C',
'Џ': 'Dz', 'Đ': 'Dj' 'Џ': 'Dz', 'Đ': 'Dj'
}; };
var AZERBAIJANI_MAP = { const AZERBAIJANI_MAP = {
'ç': 'c', 'ə': 'e', 'ğ': 'g', 'ı': 'i', 'ö': 'o', 'ş': 's', 'ü': 'u', 'ç': 'c', 'ə': 'e', 'ğ': 'g', 'ı': 'i', 'ö': 'o', 'ş': 's', 'ü': 'u',
'Ç': 'C', 'Ə': 'E', 'Ğ': 'G', 'İ': 'I', 'Ö': 'O', 'Ş': 'S', 'Ü': 'U' 'Ç': 'C', 'Ə': 'E', 'Ğ': 'G', 'İ': 'I', 'Ö': 'O', 'Ş': 'S', 'Ü': 'U'
}; };
var GEORGIAN_MAP = { const GEORGIAN_MAP = {
'ა': 'a', 'ბ': 'b', 'გ': 'g', 'დ': 'd', 'ე': 'e', 'ვ': 'v', 'ზ': 'z', 'ა': 'a', 'ბ': 'b', 'გ': 'g', 'დ': 'd', 'ე': 'e', 'ვ': 'v', 'ზ': 'z',
'თ': 't', 'ი': 'i', 'კ': 'k', 'ლ': 'l', 'მ': 'm', 'ნ': 'n', 'ო': 'o', 'თ': 't', 'ი': 'i', 'კ': 'k', 'ლ': 'l', 'მ': 'm', 'ნ': 'n', 'ო': 'o',
'პ': 'p', 'ჟ': 'j', 'რ': 'r', 'ს': 's', 'ტ': 't', 'უ': 'u', 'ფ': 'f', 'პ': 'p', 'ჟ': 'j', 'რ': 'r', 'ს': 's', 'ტ': 't', 'უ': 'u', 'ფ': 'f',
@ -107,7 +106,7 @@
'წ': 'w', 'ჭ': 'ch', 'ხ': 'x', 'ჯ': 'j', 'ჰ': 'h' 'წ': 'w', 'ჭ': 'ch', 'ხ': 'x', 'ჯ': 'j', 'ჰ': 'h'
}; };
var ALL_DOWNCODE_MAPS = [ const ALL_DOWNCODE_MAPS = [
LATIN_MAP, LATIN_MAP,
LATIN_SYMBOLS_MAP, LATIN_SYMBOLS_MAP,
GREEK_MAP, GREEK_MAP,
@ -126,27 +125,16 @@
GEORGIAN_MAP GEORGIAN_MAP
]; ];
var Downcoder = { const Downcoder = {
'Initialize': function() { 'Initialize': function() {
if (Downcoder.map) { // already made if (Downcoder.map) { // already made
return; return;
} }
Downcoder.map = {}; Downcoder.map = {};
Downcoder.chars = []; for (const lookup of ALL_DOWNCODE_MAPS) {
for (var i = 0; i < ALL_DOWNCODE_MAPS.length; i++) { Object.assign(Downcoder.map, lookup);
var lookup = ALL_DOWNCODE_MAPS[i];
for (var c in lookup) {
if (lookup.hasOwnProperty(c)) {
Downcoder.map[c] = lookup[c];
} }
} Downcoder.regex = new RegExp(Object.keys(Downcoder.map).join('|'), 'g');
}
for (var k in Downcoder.map) {
if (Downcoder.map.hasOwnProperty(k)) {
Downcoder.chars.push(k);
}
}
Downcoder.regex = new RegExp(Downcoder.chars.join('|'), 'g');
} }
}; };
@ -160,23 +148,10 @@
function URLify(s, num_chars, allowUnicode) { function URLify(s, num_chars, allowUnicode) {
// changes, e.g., "Petty theft" to "petty-theft" // changes, e.g., "Petty theft" to "petty-theft"
// remove all these words from the string before urlifying
if (!allowUnicode) { if (!allowUnicode) {
s = downcode(s); s = downcode(s);
} }
var hasUnicodeChars = /[^\u0000-\u007f]/.test(s); s = s.toLowerCase(); // convert to lowercase
// Remove English words only if the string contains ASCII (English)
// characters.
if (!hasUnicodeChars) {
var removeList = [
"a", "an", "as", "at", "before", "but", "by", "for", "from",
"is", "in", "into", "like", "of", "off", "on", "onto", "per",
"since", "than", "the", "this", "that", "to", "up", "via",
"with"
];
var r = new RegExp('\\b(' + removeList.join('|') + ')\\b', 'gi');
s = s.replace(r, '');
}
// if downcode doesn't hit, the char will be stripped here // if downcode doesn't hit, the char will be stripped here
if (allowUnicode) { if (allowUnicode) {
// Keep Unicode letters including both lowercase and uppercase // Keep Unicode letters including both lowercase and uppercase
@ -189,7 +164,7 @@
s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens s = s.replace(/[-\s]+/g, '-'); // convert spaces to hyphens
s = s.substring(0, num_chars); // trim to first num_chars chars s = s.substring(0, num_chars); // trim to first num_chars chars
s = s.replace(/-+$/g, ''); // trim any trailing hyphens s = s.replace(/-+$/g, ''); // trim any trailing hyphens
return s.toLowerCase(); // convert to lowercase return s;
} }
window.URLify = URLify; window.URLify = URLify;
})(); }

View File

@ -1,10 +1,4 @@
Copyright jQuery Foundation and other contributors, https://jquery.org/ Copyright JS Foundation and other contributors, https://js.foundation/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery
====
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2012-2015 Kevin Brown, Igor Vaynberg, and Select2 contributors Copyright (c) 2012-2017 Kevin Brown, Igor Vaynberg, and Select2 contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/af",[],function(){return{errorLoading:function(){return"Die resultate kon nie gelaai word nie."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Verwyders asseblief "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Voer asseblief "+(e.minimum-e.input.length)+" of meer karakters"},loadingMore:function(){return"Meer resultate word gelaai…"},maximumSelected:function(e){var n="Kies asseblief net "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"Geen resultate gevind"},searching:function(){return"Besig…"},removeAllItems:function(){return"Verwyder alle items"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="الرجاء حذف "+t+" عناصر";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="الرجاء إضافة "+t+" عناصر";return n},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){var t="تستطيع إختيار "+e.maximum+" بنود فقط";return t},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(n){return"الرجاء حذف "+(n.input.length-n.maximum)+" عناصر"},inputTooShort:function(n){return"الرجاء إضافة "+(n.minimum-n.input.length)+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(n){return"تستطيع إختيار "+n.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"},removeAllItems:function(){return"قم بإزالة كل العناصر"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/az",[],function(){return{inputTooLong:function(n){return n.input.length-n.maximum+" simvol silin"},inputTooShort:function(n){return n.minimum-n.input.length+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(n){return"Sadəcə "+n.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"},removeAllItems:function(){return"Bütün elementləri sil"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/bg",[],function(){return{inputTooLong:function(n){var e=n.input.length-n.maximum,u="Моля въведете с "+e+" по-малко символ";return e>1&&(u+="a"),u},inputTooShort:function(n){var e=n.minimum-n.input.length,u="Моля въведете още "+e+" символ";return e>1&&(u+="a"),u},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(n){var e="Можете да направите до "+n.maximum+" ";return n.maximum>1?e+="избора":e+="избор",e},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"},removeAllItems:function(){return"Премахнете всички елементи"}}}),n.define,n.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/bn",[],function(){return{errorLoading:function(){return"ফলাফলগুলি লোড করা যায়নি।"},inputTooLong:function(n){var e=n.input.length-n.maximum,u="অনুগ্রহ করে "+e+" টি অক্ষর মুছে দিন।";return 1!=e&&(u="অনুগ্রহ করে "+e+" টি অক্ষর মুছে দিন।"),u},inputTooShort:function(n){return n.minimum-n.input.length+" টি অক্ষর অথবা অধিক অক্ষর লিখুন।"},loadingMore:function(){return"আরো ফলাফল লোড হচ্ছে ..."},maximumSelected:function(n){var e=n.maximum+" টি আইটেম নির্বাচন করতে পারবেন।";return 1!=n.maximum&&(e=n.maximum+" টি আইটেম নির্বাচন করতে পারবেন।"),e},noResults:function(){return"কোন ফলাফল পাওয়া যায়নি।"},searching:function(){return"অনুসন্ধান করা হচ্ছে ..."}}}),n.define,n.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/bs",[],function(){function e(e,n,r,t){return e%10==1&&e%100!=11?n:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?r:t}return{errorLoading:function(){return"Preuzimanje nije uspijelo."},inputTooLong:function(n){var r=n.input.length-n.maximum,t="Obrišite "+r+" simbol";return t+=e(r,"","a","a")},inputTooShort:function(n){var r=n.minimum-n.input.length,t="Ukucajte bar još "+r+" simbol";return t+=e(r,"","a","a")},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(n){var r="Možete izabrati samo "+n.maximum+" stavk";return r+=e(n.maximum,"u","e","i")},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Uklonite sve stavke"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Si us plau, elimina "+n+" car";return r+=1==n?"àcter":"àcters"},inputTooShort:function(e){var n=e.minimum-e.input.length,r="Si us plau, introdueix "+n+" car";return r+=1==n?"àcter":"àcters"},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var n="Només es pot seleccionar "+e.maximum+" element";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"},removeAllItems:function(){return"Treu tots els elements"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/cs",[],function(){function e(e,n){switch(e){case 2:return n?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(n){var t=n.input.length-n.maximum;return 1==t?"Prosím, zadejte o jeden znak méně.":t<=4?"Prosím, zadejte o "+e(t,!0)+" znaky méně.":"Prosím, zadejte o "+t+" znaků méně."},inputTooShort:function(n){var t=n.minimum-n.input.length;return 1==t?"Prosím, zadejte ještě jeden znak.":t<=4?"Prosím, zadejte ještě další "+e(t,!0)+" znaky.":"Prosím, zadejte ještě dalších "+t+" znaků."},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(n){var t=n.maximum;return 1==t?"Můžete zvolit jen jednu položku.":t<=4?"Můžete zvolit maximálně "+e(t,!1)+" položky.":"Můžete zvolit maximálně "+t+" položek."},noResults:function(){return"Nenalezeny žádné položky."},searching:function(){return"Vyhledávání…"},removeAllItems:function(){return"Odstraňte všechny položky"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Angiv venligst "+t+" tegn mindre";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Angiv venligst "+t+" tegn mere";return n},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){return"Angiv venligst "+(e.input.length-e.maximum)+" tegn mindre"},inputTooShort:function(e){return"Angiv venligst "+(e.minimum-e.input.length)+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var n="Du kan kun vælge "+e.maximum+" emne";return 1!=e.maximum&&(n+="r"),n},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"},removeAllItems:function(){return"Fjern alle elementer"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){return"Bitte "+(e.input.length-e.maximum)+" Zeichen weniger eingeben"},inputTooShort:function(e){return"Bitte "+(e.minimum-e.input.length)+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var n="Sie können nur "+e.maximum+" Element";return 1!=e.maximum&&(n+="e"),n+=" auswählen"},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"},removeAllItems:function(){return"Entferne alle Elemente"}}}),e.define,e.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/dsb",[],function(){var n=["znamuško","znamušce","znamuška","znamuškow"],e=["zapisk","zapiska","zapiski","zapiskow"],u=function(n,e){return 1===n?e[0]:2===n?e[1]:n>2&&n<=4?e[2]:n>=5?e[3]:void 0};return{errorLoading:function(){return"Wuslědki njejsu se dali zacytaś."},inputTooLong:function(e){var a=e.input.length-e.maximum;return"Pšosym lašuj "+a+" "+u(a,n)},inputTooShort:function(e){var a=e.minimum-e.input.length;return"Pšosym zapódaj nanejmjenjej "+a+" "+u(a,n)},loadingMore:function(){return"Dalšne wuslědki se zacytaju…"},maximumSelected:function(n){return"Móžoš jano "+n.maximum+" "+u(n.maximum,e)+"wubraś."},noResults:function(){return"Žedne wuslědki namakane"},searching:function(){return"Pyta se…"},removeAllItems:function(){return"Remove all items"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(n){var e=n.input.length-n.maximum,u="Παρακαλώ διαγράψτε "+e+" χαρακτήρ";return 1==e&&(u+="α"),1!=e&&(u+="ες"),u},inputTooShort:function(n){return"Παρακαλώ συμπληρώστε "+(n.minimum-n.input.length)+" ή περισσότερους χαρακτήρες"},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(n){var e="Μπορείτε να επιλέξετε μόνο "+n.maximum+" επιλογ";return 1==n.maximum&&(e+="ή"),1!=n.maximum&&(e+="ές"),e},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"},removeAllItems:function(){return"Καταργήστε όλα τα στοιχεία"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Please delete "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var n="You can only select "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Por favor, elimine "+n+" car";return r+=1==n?"ácter":"acteres"},inputTooShort:function(e){var n=e.minimum-e.input.length,r="Por favor, introduzca "+n+" car";return r+=1==n?"ácter":"acteres"},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var n="Sólo puede seleccionar "+e.maximum+" elemento";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Eliminar todos los elementos"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var n=e.input.length-e.maximum,t="Sisesta "+n+" täht";return 1!=n&&(t+="e"),t+=" vähem"},inputTooShort:function(e){var n=e.minimum-e.input.length,t="Sisesta "+n+" täht";return 1!=n&&(t+="e"),t+=" rohkem"},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var n="Saad vaid "+e.maximum+" tulemus";return 1==e.maximum?n+="e":n+="t",n+=" valida"},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"},removeAllItems:function(){return"Eemalda kõik esemed"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return n+=1==t?"karaktere bat":t+" karaktere",n+=" gutxiago"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return n+=1==t?"karaktere bat":t+" karaktere",n+=" gehiago"},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return 1===e.maximum?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"},removeAllItems:function(){return"Kendu elementu guztiak"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(n){return"لطفاً "+(n.input.length-n.maximum)+" کاراکتر را حذف نمایید"},inputTooShort:function(n){return"لطفاً تعداد "+(n.minimum-n.input.length)+" کاراکتر یا بیشتر وارد نمایید"},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(n){return"شما تنها می‌توانید "+n.maximum+" آیتم را انتخاب نمایید"},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."},removeAllItems:function(){return"همه موارد را حذف کنید"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(n){return"Ole hyvä ja anna "+(n.input.length-n.maximum)+" merkkiä vähemmän"},inputTooShort:function(n){return"Ole hyvä ja anna "+(n.minimum-n.input.length)+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(n){return"Voit valita ainoastaan "+n.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"},removeAllItems:function(){return"Poista kaikki kohteet"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var n=e.input.length-e.maximum;return"Supprimez "+n+" caractère"+(n>1?"s":"")},inputTooShort:function(e){var n=e.minimum-e.input.length;return"Saisissez au moins "+n+" caractère"+(n>1?"s":"")},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1?"s":"")},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"},removeAllItems:function(){return"Supprimer tous les éléments"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Elimine ";return t===1?n+="un carácter":n+=t+" caracteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Engada ";return t===1?n+="un carácter":n+=t+" caracteres",n},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){var t="Só pode ";return e.maximum===1?t+="un elemento":t+=e.maximum+" elementos",t},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var n=e.input.length-e.maximum;return 1===n?"Elimine un carácter":"Elimine "+n+" caracteres"},inputTooShort:function(e){var n=e.minimum-e.input.length;return 1===n?"Engada un carácter":"Engada "+n+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return 1===e.maximum?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Elimina todos os elementos"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(n){var e=n.input.length-n.maximum,r="נא למחוק ";return r+=1===e?"תו אחד":e+" תווים"},inputTooShort:function(n){var e=n.minimum-n.input.length,r="נא להכניס ";return r+=1===e?"תו אחד":e+" תווים",r+=" או יותר"},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(n){var e="באפשרותך לבחור עד ";return 1===n.maximum?e+="פריט אחד":e+=n.maximum+" פריטים",e},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"},removeAllItems:function(){return"הסר את כל הפריטים"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(n){var e=n.input.length-n.maximum,r=e+" अक्षर को हटा दें";return e>1&&(r=e+" अक्षरों को हटा दें "),r},inputTooShort:function(n){return"कृपया "+(n.minimum-n.input.length)+" या अधिक अक्षर दर्ज करें"},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(n){return"आप केवल "+n.maximum+" आइटम का चयन कर सकते हैं"},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."},removeAllItems:function(){return"सभी वस्तुओं को हटा दें"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hr",[],function(){function n(n){var e=" "+n+" znak";return n%10<5&&n%10>0&&(n%100<5||n%100>19)?n%10>1&&(e+="a"):e+="ova",e}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(e){return"Unesite "+n(e.input.length-e.maximum)},inputTooShort:function(e){return"Unesite još "+n(e.minimum-e.input.length)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(n){return"Maksimalan broj odabranih stavki je "+n.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Ukloni sve stavke"}}}),n.define,n.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hsb",[],function(){var n=["znamješko","znamješce","znamješka","znamješkow"],e=["zapisk","zapiskaj","zapiski","zapiskow"],u=function(n,e){return 1===n?e[0]:2===n?e[1]:n>2&&n<=4?e[2]:n>=5?e[3]:void 0};return{errorLoading:function(){return"Wuslědki njedachu so začitać."},inputTooLong:function(e){var a=e.input.length-e.maximum;return"Prošu zhašej "+a+" "+u(a,n)},inputTooShort:function(e){var a=e.minimum-e.input.length;return"Prošu zapodaj znajmjeńša "+a+" "+u(a,n)},loadingMore:function(){return"Dalše wuslědki so začitaja…"},maximumSelected:function(n){return"Móžeš jenož "+n.maximum+" "+u(n.maximum,e)+"wubrać"},noResults:function(){return"Žane wuslědki namakane"},searching:function(){return"Pyta so…"},removeAllItems:function(){return"Remove all items"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){return"Túl hosszú. "+(e.input.length-e.maximum)+" karakterrel több, mint kellene."},inputTooShort:function(e){return"Túl rövid. Még "+(e.minimum-e.input.length)+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"},removeAllItems:function(){return"Távolítson el minden elemet"}}}),e.define,e.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(n){return"Խնդրում ենք հեռացնել "+(n.input.length-n.maximum)+" նշան"},inputTooShort:function(n){return"Խնդրում ենք մուտքագրել "+(n.minimum-n.input.length)+" կամ ավել նշաններ"},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(n){return"Դուք կարող եք ընտրել առավելագույնը "+n.maximum+" կետ"},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"},removeAllItems:function(){return"Հեռացնել բոլոր տարրերը"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(n){return"Hapuskan "+(n.input.length-n.maximum)+" huruf"},inputTooShort:function(n){return"Masukkan "+(n.minimum-n.input.length)+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(n){return"Anda hanya dapat memilih "+n.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Hapus semua item"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/is",[],function(){return{inputTooLong:function(n){var t=n.input.length-n.maximum,e="Vinsamlegast styttið texta um "+t+" staf";return t<=1?e:e+"i"},inputTooShort:function(n){var t=n.minimum-n.input.length,e="Vinsamlegast skrifið "+t+" staf";return t>1&&(e+="i"),e+=" í viðbót"},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(n){return"Þú getur aðeins valið "+n.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"},removeAllItems:function(){return"Fjarlægðu öll atriði"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Per favore cancella "+n+" caratter";return t+=1!==n?"i":"e"},inputTooShort:function(e){return"Per favore inserisci "+(e.minimum-e.input.length)+" o più caratteri"},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var n="Puoi selezionare solo "+e.maximum+" element";return 1!==e.maximum?n+="i":n+="o",n},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"},removeAllItems:function(){return"Rimuovi tutti gli oggetti"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(n){return n.input.length-n.maximum+" 文字を削除してください"},inputTooShort:function(n){return"少なくとも "+(n.minimum-n.input.length)+" 文字を入力してください"},loadingMore:function(){return"読み込み中…"},maximumSelected:function(n){return n.maximum+" 件しか選択できません"},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"},removeAllItems:function(){return"すべてのアイテムを削除"}}}),n.define,n.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ka",[],function(){return{errorLoading:function(){return"მონაცემების ჩატვირთვა შეუძლებელია."},inputTooLong:function(n){return"გთხოვთ აკრიფეთ "+(n.input.length-n.maximum)+" სიმბოლოთი ნაკლები"},inputTooShort:function(n){return"გთხოვთ აკრიფეთ "+(n.minimum-n.input.length)+" სიმბოლო ან მეტი"},loadingMore:function(){return"მონაცემების ჩატვირთვა…"},maximumSelected:function(n){return"თქვენ შეგიძლიათ აირჩიოთ არაუმეტეს "+n.maximum+" ელემენტი"},noResults:function(){return"რეზულტატი არ მოიძებნა"},searching:function(){return"ძიება…"},removeAllItems:function(){return"ამოიღე ყველა ელემენტი"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(n){return"សូមលុបចេញ "+(n.input.length-n.maximum)+" អក្សរ"},inputTooShort:function(n){return"សូមបញ្ចូល"+(n.minimum-n.input.length)+" អក្សរ រឺ ច្រើនជាងនេះ"},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(n){return"អ្នកអាចជ្រើសរើសបានតែ "+n.maximum+" ជម្រើសប៉ុណ្ណោះ"},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."},removeAllItems:function(){return"លុបធាតុទាំងអស់"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(n){return"너무 깁니다. "+(n.input.length-n.maximum)+" 글자 지워주세요."},inputTooShort:function(n){return"너무 짧습니다. "+(n.minimum-n.input.length)+" 글자 더 입력해주세요."},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(n){return"최대 "+n.maximum+"개까지만 선택 가능합니다."},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"},removeAllItems:function(){return"모든 항목 삭제"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/lt",[],function(){function n(n,e,i,t){return n%10==1&&(n%100<11||n%100>19)?e:n%10>=2&&n%10<=9&&(n%100<11||n%100>19)?i:t}return{inputTooLong:function(e){var i=e.input.length-e.maximum,t="Pašalinkite "+i+" simbol";return t+=n(i,"į","ius","ių")},inputTooShort:function(e){var i=e.minimum-e.input.length,t="Įrašykite dar "+i+" simbol";return t+=n(i,"į","ius","ių")},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(e){var i="Jūs galite pasirinkti tik "+e.maximum+" element";return i+=n(e.maximum,"ą","us","ų")},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"},removeAllItems:function(){return"Pašalinti visus elementus"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/lv",[],function(){function e(e,n,u,i){return 11===e?n:e%10==1?u:i}return{inputTooLong:function(n){var u=n.input.length-n.maximum,i="Lūdzu ievadiet par "+u;return(i+=" simbol"+e(u,"iem","u","iem"))+" mazāk"},inputTooShort:function(n){var u=n.minimum-n.input.length,i="Lūdzu ievadiet vēl "+u;return i+=" simbol"+e(u,"us","u","us")},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(n){var u="Jūs varat izvēlēties ne vairāk kā "+n.maximum;return u+=" element"+e(n.maximum,"us","u","us")},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"},removeAllItems:function(){return"Noņemt visus vienumus"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/mk",[],function(){return{inputTooLong:function(n){var e=(n.input.length,n.maximum,"Ве молиме внесете "+n.maximum+" помалку карактер");return 1!==n.maximum&&(e+="и"),e},inputTooShort:function(n){var e=(n.minimum,n.input.length,"Ве молиме внесете уште "+n.maximum+" карактер");return 1!==n.maximum&&(e+="и"),e},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(n){var e="Можете да изберете само "+n.maximum+" ставк";return 1===n.maximum?e+="а":e+="и",e},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"},removeAllItems:function(){return"Отстрани ги сите предмети"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(n){return"Sila hapuskan "+(n.input.length-n.maximum)+" aksara"},inputTooShort:function(n){return"Sila masukkan "+(n.minimum-n.input.length)+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(n){return"Anda hanya boleh memilih "+n.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"},removeAllItems:function(){return"Keluarkan semua item"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=" flere tegn":n+=" tegn til",n},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){return"Vennligst fjern "+(e.input.length-e.maximum)+" tegn"},inputTooShort:function(e){return"Vennligst skriv inn "+(e.minimum-e.input.length)+" tegn til"},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"},removeAllItems:function(){return"Fjern alle elementer"}}}),e.define,e.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ne",[],function(){return{errorLoading:function(){return"नतिजाहरु देखाउन सकिएन।"},inputTooLong:function(n){var e=n.input.length-n.maximum,u="कृपया "+e+" अक्षर मेटाउनुहोस्।";return 1!=e&&(u+="कृपया "+e+" अक्षरहरु मेटाउनुहोस्।"),u},inputTooShort:function(n){return"कृपया बाँकी रहेका "+(n.minimum-n.input.length)+" वा अरु धेरै अक्षरहरु भर्नुहोस्।"},loadingMore:function(){return"अरु नतिजाहरु भरिँदैछन् …"},maximumSelected:function(n){var e="तँपाई "+n.maximum+" वस्तु मात्र छान्न पाउँनुहुन्छ।";return 1!=n.maximum&&(e="तँपाई "+n.maximum+" वस्तुहरु मात्र छान्न पाउँनुहुन्छ।"),e},noResults:function(){return"कुनै पनि नतिजा भेटिएन।"},searching:function(){return"खोजि हुँदैछ…"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){return"Gelieve "+(e.input.length-e.maximum)+" karakters te verwijderen"},inputTooShort:function(e){return"Gelieve "+(e.minimum-e.input.length)+" of meer karakters in te voeren"},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var n=1==e.maximum?"kan":"kunnen",r="Er "+n+" maar "+e.maximum+" item";return 1!=e.maximum&&(r+="s"),r+=" worden geselecteerd"},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"},removeAllItems:function(){return"Verwijder alle items"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/pl",[],function(){var n=["znak","znaki","znaków"],e=["element","elementy","elementów"],r=function(n,e){return 1===n?e[0]:n>1&&n<=4?e[1]:n>=5?e[2]:void 0};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Usuń "+t+" "+r(t,n)},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Podaj przynajmniej "+t+" "+r(t,n)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(n){return"Możesz zaznaczyć tylko "+n.maximum+" "+r(n.maximum,e)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"},removeAllItems:function(){return"Usuń wszystkie przedmioty"}}}),n.define,n.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ps",[],function(){return{errorLoading:function(){return"پايلي نه سي ترلاسه کېدای"},inputTooLong:function(n){var e=n.input.length-n.maximum,r="د مهربانۍ لمخي "+e+" توری ړنګ کړئ";return 1!=e&&(r=r.replace("توری","توري")),r},inputTooShort:function(n){return"لږ تر لږه "+(n.minimum-n.input.length)+" يا ډېر توري وليکئ"},loadingMore:function(){return"نوري پايلي ترلاسه کيږي..."},maximumSelected:function(n){var e="تاسو يوازي "+n.maximum+" قلم په نښه کولای سی";return 1!=n.maximum&&(e=e.replace("قلم","قلمونه")),e},noResults:function(){return"پايلي و نه موندل سوې"},searching:function(){return"لټول کيږي..."},removeAllItems:function(){return"ټول توکي لرې کړئ"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Apague "+n+" caracter";return 1!=n&&(r+="es"),r},inputTooShort:function(e){return"Digite "+(e.minimum-e.input.length)+" ou mais caracteres"},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var n="Você só pode selecionar "+e.maximum+" ite";return 1==e.maximum?n+="m":n+="ns",n},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"carácter",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var r=e.input.length-e.maximum,n="Por favor apague "+r+" ";return n+=1!=r?"caracteres":"caractere"},inputTooShort:function(e){return"Introduza "+(e.minimum-e.input.length)+" ou mais caracteres"},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var r="Apenas pode seleccionar "+e.maximum+" ";return r+=1!=e.maximum?"itens":"item"},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"},removeAllItems:function(){return"Remover todos os itens"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+"sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return 1!==t&&(n+="e"),n},inputTooShort:function(e){return"Vă rugăm să introduceți "+(e.minimum-e.input.length)+" sau mai multe caractere"},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",1!==e.maximum&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"},removeAllItems:function(){return"Eliminați toate elementele"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/ru",[],function(){function n(n,e,r,u){return n%10<5&&n%10>0&&n%100<5||n%100>20?n%10>1?r:e:u}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(e){var r=e.input.length-e.maximum,u="Пожалуйста, введите на "+r+" символ";return u+=n(r,"","a","ов"),u+=" меньше"},inputTooShort:function(e){var r=e.minimum-e.input.length,u="Пожалуйста, введите ещё хотя бы "+r+" символ";return u+=n(r,"","a","ов")},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(e){var r="Вы можете выбрать не более "+e.maximum+" элемент";return r+=n(e.maximum,"","a","ов")},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"},removeAllItems:function(){return"Удалить все элементы"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(n){var t=n.input.length-n.maximum;return 1==t?"Prosím, zadajte o jeden znak menej":t>=2&&t<=4?"Prosím, zadajte o "+e[t](!0)+" znaky menej":"Prosím, zadajte o "+t+" znakov menej"},inputTooShort:function(n){var t=n.minimum-n.input.length;return 1==t?"Prosím, zadajte ešte jeden znak":t<=4?"Prosím, zadajte ešte ďalšie "+e[t](!0)+" znaky":"Prosím, zadajte ešte ďalších "+t+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(n){return 1==n.maximum?"Môžete zvoliť len jednu položku":n.maximum>=2&&n.maximum<=4?"Môžete zvoliť najviac "+e[n.maximum](!1)+" položky":"Môžete zvoliť najviac "+n.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"},removeAllItems:function(){return"Odstráňte všetky položky"}}}),e.define,e.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Prosim zbrišite "+n+" znak";return 2==n?t+="a":1!=n&&(t+="e"),t},inputTooShort:function(e){var n=e.minimum-e.input.length,t="Prosim vpišite še "+n+" znak";return 2==n?t+="a":1!=n&&(t+="e"),t},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var n="Označite lahko največ "+e.maximum+" predmet";return 2==e.maximum?n+="a":1!=e.maximum&&(n+="e"),n},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"},removeAllItems:function(){return"Odstranite vse elemente"}}}),e.define,e.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/sq",[],function(){return{errorLoading:function(){return"Rezultatet nuk mund të ngarkoheshin."},inputTooLong:function(e){var n=e.input.length-e.maximum,t="Të lutem fshi "+n+" karakter";return 1!=n&&(t+="e"),t},inputTooShort:function(e){return"Të lutem shkruaj "+(e.minimum-e.input.length)+" ose më shumë karaktere"},loadingMore:function(){return"Duke ngarkuar më shumë rezultate…"},maximumSelected:function(e){var n="Mund të zgjedhësh vetëm "+e.maximum+" element";return 1!=e.maximum&&(n+="e"),n},noResults:function(){return"Nuk u gjet asnjë rezultat"},searching:function(){return"Duke kërkuar…"},removeAllItems:function(){return"Hiq të gjitha sendet"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sr-Cyrl",[],function(){function n(n,e,r,u){return n%10==1&&n%100!=11?e:n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r:u}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(e){var r=e.input.length-e.maximum,u="Обришите "+r+" симбол";return u+=n(r,"","а","а")},inputTooShort:function(e){var r=e.minimum-e.input.length,u="Укуцајте бар још "+r+" симбол";return u+=n(r,"","а","а")},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(e){var r="Можете изабрати само "+e.maximum+" ставк";return r+=n(e.maximum,"у","е","и")},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"},removeAllItems:function(){return"Уклоните све ставке"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sr",[],function(){function n(n,e,r,t){return n%10==1&&n%100!=11?e:n%10>=2&&n%10<=4&&(n%100<12||n%100>14)?r:t}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(e){var r=e.input.length-e.maximum,t="Obrišite "+r+" simbol";return t+=n(r,"","a","a")},inputTooShort:function(e){var r=e.minimum-e.input.length,t="Ukucajte bar još "+r+" simbol";return t+=n(r,"","a","a")},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(e){var r="Možete izabrati samo "+e.maximum+" stavk";return r+=n(e.maximum,"u","e","i")},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"},removeAllItems:function(){return"Уклоните све ставке"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(n){return"Vänligen sudda ut "+(n.input.length-n.maximum)+" tecken"},inputTooShort:function(n){return"Vänligen skriv in "+(n.minimum-n.input.length)+" eller fler tecken"},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(n){return"Du kan max välja "+n.maximum+" element"},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"},removeAllItems:function(){return"Ta bort alla objekt"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(n){return"โปรดลบออก "+(n.input.length-n.maximum)+" ตัวอักษร"},inputTooShort:function(n){return"โปรดพิมพ์เพิ่มอีก "+(n.minimum-n.input.length)+" ตัวอักษร"},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(n){return"คุณสามารถเลือกได้ไม่เกิน "+n.maximum+" รายการ"},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"},removeAllItems:function(){return"ลบรายการทั้งหมด"}}}),n.define,n.require}();

View File

@ -0,0 +1,3 @@
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/tk",[],function(){return{errorLoading:function(){return"Netije ýüklenmedi."},inputTooLong:function(e){return e.input.length-e.maximum+" harp bozuň."},inputTooShort:function(e){return"Ýene-de iň az "+(e.minimum-e.input.length)+" harp ýazyň."},loadingMore:function(){return"Köpräk netije görkezilýär…"},maximumSelected:function(e){return"Diňe "+e.maximum+" sanysyny saýlaň."},noResults:function(){return"Netije tapylmady."},searching:function(){return"Gözlenýär…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(n){return n.input.length-n.maximum+" karakter daha girmelisiniz"},inputTooShort:function(n){return"En az "+(n.minimum-n.input.length)+" karakter daha girmelisiniz"},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(n){return"Sadece "+n.maximum+" seçim yapabilirsiniz"},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"},removeAllItems:function(){return"Tüm öğeleri kaldır"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/uk",[],function(){function n(n,e,u,r){return n%100>10&&n%100<15?r:n%10==1?e:n%10>1&&n%10<5?u:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(e){return"Будь ласка, видаліть "+(e.input.length-e.maximum)+" "+n(e.maximum,"літеру","літери","літер")},inputTooShort:function(n){return"Будь ласка, введіть "+(n.minimum-n.input.length)+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(e){return"Ви можете вибрати лише "+e.maximum+" "+n(e.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"},removeAllItems:function(){return"Видалити всі елементи"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+' ký tự"';return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/vi",[],function(){return{inputTooLong:function(n){return"Vui lòng xóa bớt "+(n.input.length-n.maximum)+" ký tự"},inputTooShort:function(n){return"Vui lòng nhập thêm từ "+(n.minimum-n.input.length)+" ký tự trở lên"},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(n){return"Chỉ có thể chọn được "+n.maximum+" lựa chọn"},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"},removeAllItems:function(){return"Xóa tất cả các mục"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}();

View File

@ -1,3 +1,3 @@
/*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */ /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})(); !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(n){return"請刪掉"+(n.input.length-n.maximum)+"個字元"},inputTooShort:function(n){return"請再輸入"+(n.minimum-n.input.length)+"個字元"},loadingMore:function(){return"載入中…"},maximumSelected:function(n){return"你只能選擇最多"+n.maximum+"項"},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"},removeAllItems:function(){return"刪除所有項目"}}}),n.define,n.require}();

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More