Private
Public Access
1
0

working somewhat on thinkpad - doesn't pass tests

This commit is contained in:
Sander Roosendaal
2019-02-05 22:04:48 +01:00
parent c9695a9f8f
commit b6818ccabc
20 changed files with 9584 additions and 9448 deletions

View File

@@ -6,6 +6,8 @@ argcomplete==1.0.0
arrow==0.12.1 arrow==0.12.1
asn1crypto==0.23.0 asn1crypto==0.23.0
astropy==1.1.2 astropy==1.1.2
atomicwrites==1.3.0
attrs==18.2.0
awscli==1.14.57 awscli==1.14.57
Babel==2.2.0 Babel==2.2.0
backports-abc==0.4 backports-abc==0.4
@@ -34,7 +36,7 @@ click==6.6
cloudpickle==0.1.1 cloudpickle==0.1.1
clyent==1.2.1 clyent==1.2.1
colorama==0.3.7 colorama==0.3.7
comtypes==1.1.3 comtypes==1.1.7
configobj==5.0.6 configobj==5.0.6
coreapi==2.0.9 coreapi==2.0.9
cryptography==2.1.3 cryptography==2.1.3
@@ -85,6 +87,7 @@ docopt==0.6.2
docutils==0.12 docutils==0.12
enum34==1.1.2 enum34==1.1.2
et-xmlfile==1.0.1 et-xmlfile==1.0.1
Factory==1.2
fastcache==1.0.2 fastcache==1.0.2
filemagic==1.6 filemagic==1.6
fitparse==1.0.1 fitparse==1.0.1
@@ -94,7 +97,7 @@ Flask-Login==0.3.2
Flask-OpenID==1.2.5 Flask-OpenID==1.2.5
Flask-Uploads==0.2.0 Flask-Uploads==0.2.0
flower==0.9.1 flower==0.9.1
funcsigs==0.4 funcsigs==1.0.2
functools32==3.2.3.post2 functools32==3.2.3.post2
future==0.16.0 future==0.16.0
futures==3.0.5 futures==3.0.5
@@ -127,12 +130,14 @@ Markdown==2.6.7
MarkupSafe==0.23 MarkupSafe==0.23
matplotlib==2.2.2 matplotlib==2.2.2
mechanize==0.3.6 mechanize==0.3.6
MiniMockTest==0.5
mock==2.0.0
more-itertools==5.0.0
mpld3==0.2 mpld3==0.2
mpmath==0.19 mpmath==0.19
multipledispatch==0.4.8 multipledispatch==0.4.8
MySQL-python==1.2.5
mysqlclient==1.3.7
networkx==1.11 networkx==1.11
nose==1.3.7
nose-parameterized==0.6.0 nose-parameterized==0.6.0
numpy==1.14.2 numpy==1.14.2
oauth2==1.9.0.post1 oauth2==1.9.0.post1
@@ -141,20 +146,25 @@ odo==0.4.2
openapi-codec==1.1.7 openapi-codec==1.1.7
packaging==16.8 packaging==16.8
pandas==0.22.0 pandas==0.22.0
pathlib2==2.1.0 pathlib2==2.3.3
pathspec==0.5.5 pathspec==0.5.5
pbr==5.1.2
pexpect==4.0.1 pexpect==4.0.1
pickleshare==0.7.2 pickleshare==0.7.2
Pillow==3.2.0 Pillow==3.2.0
pluggy==0.8.1
polib==1.0.7 polib==1.0.7
psutil==4.1.0 psutil==4.1.0
ptyprocess==0.5.1 ptyprocess==0.5.1
py==1.7.0
pyasn1==0.1.9 pyasn1==0.1.9
pycparser==2.14 pycparser==2.14
pycrypto==2.6.1 pycrypto==2.6.1
PyMySQL==0.7.4 PyMySQL==0.7.4
pync==1.6.1 pync==1.6.1
pyparsing==2.2.0 pyparsing==2.2.0
pytest==4.2.0
pytest-sugar==0.9.2
python-dateutil==2.7.2 python-dateutil==2.7.2
python-memcached==1.58 python-memcached==1.58
python-metar==1.4.0 python-metar==1.4.0
@@ -165,6 +175,7 @@ PyYAML==3.12
pyzmq==15.2.0 pyzmq==15.2.0
ratelim==0.1.6 ratelim==0.1.6
redis==2.10.5 redis==2.10.5
req==1.0.0
requests==2.12.3 requests==2.12.3
requests-oauthlib==0.7.0 requests-oauthlib==0.7.0
rowingdata==2.0.0 rowingdata==2.0.0
@@ -186,10 +197,10 @@ singledispatch==3.4.0.3
six==1.11.0 six==1.11.0
SQLAlchemy==1.0.12 SQLAlchemy==1.0.12
sqlparse==0.1.19 sqlparse==0.1.19
# Editable install with no version control (stravalib==0.6.6) -e git+git@bitbucket.org:sanderroosendaal/rowsandall.git@c9695a9f8f5ee0e459de066007a5ef4cef58255b#egg=stravalib
-e /srv/venv/lib/python2.7/site-packages
subprocess32==3.2.7 subprocess32==3.2.7
sympy==1.0 sympy==1.0
termcolor==1.1.0
timestring==1.6.2 timestring==1.6.2
timezonefinder==2.1.2 timezonefinder==2.1.2
toolz==0.7.4 toolz==0.7.4

View File

@@ -1,3 +1,8 @@
try:
WindowsError
except NameError:
WindowsError = None
import pytest import pytest
pytestmark = pytest.mark.django_db pytestmark = pytest.mark.django_db

View File

@@ -146,7 +146,7 @@ from rowsandall_app.settings import (
PAYMENT_PROCESSING_ON PAYMENT_PROCESSING_ON
) )
from rowers.tasks_standalone import addcomment2 #from rowers.tasks_standalone import addcomment2
from django.contrib import messages from django.contrib import messages
from async_messages import messages as a_messages from async_messages import messages as a_messages

View File

@@ -0,0 +1,104 @@
"""
Django settings for rowsandall_app project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
from settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# 'HOST': 'localhost',
},
# 'TEST': {
# 'CHARSET': 'utf8',
# 'COLLATION': 'utf8_general_ci',
# },
# 'slave': {
# 'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'rowsanda_107501',
# 'USER': 'rowsanda_107501',
# 'PASSWORD': 'roeidata',
# 'HOST': 'store3.rosti.cz',
# 'PORT': '3306',
# }
}
#BROKER_URL = 'redis://localhost:6379/0'
#CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
#CELERY_IGNORE_RESULT = False
#CELERY_ACCEPT_CONTENT = ['json']
#CELERY_TASK_SERIALIZER = 'json'
#CELERY_RESULT_SERIALIZER = 'json'
#CELERY_TRACK_STARTED = True
#CELERY_SEND_TASK_SENT_EVENT = True
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
ALLOWED_HOSTS = []
#INSTALLED_APPS += ['debug_toolbar',]
MIDDLEWARE_CLASSES += ['debug_toolbar.middleware.DebugToolbarMiddleware',]
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
'LOCATION': os.path.join(BASE_DIR, 'django_cache'),
}
}
# Application definition
STATIC_URL = '/static/'
STATIC_ROOT = BASE_DIR
STATICFILES_DIRS = [os.path.join(BASE_DIR,'static/plots'),os.path.join(BASE_DIR,'static'),]
# INTERNAL_IPS = ['127.0.0.1']
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
LOGIN_REDIRECT_URL = '/rowers/list-workouts/'
SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
SITE_URL = "http://localhost:8000"
#EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
#EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
#EMAIL_BACKEND = 'django_ses.SESBackend'
AWS_SES_REGION_NAME = 'eu-west-1'
AWS_SES_REGION_ENDPOINT = 'email.eu-west-1.amazonaws.com'
EMAIL_HOST = CFG['aws_smtp']
EMAIL_PORT = CFG['aws_port']
EMAIL_HOST_USER = CFG['aws_smtp_username']
EMAIL_HOST_PASSWORD = CFG['aws_smtp_password']
EMAIL_USE_TLS = CFG['email_use_tls']
DEFAULT_FROM_EMAIL = 'info@rowsandall.com'
SETTINGS_NAME = 'rowsandall_app.settings_thinkpad'

View File

@@ -82,4 +82,9 @@ if settings.DEBUG:
import debug_toolbar import debug_toolbar
urlpatterns += [ urlpatterns += [
url(r'^__debug__/',include(debug_toolbar.urls)), url(r'^__debug__/',include(debug_toolbar.urls)),
] url(
regex=r'^static/(?P<path>.*)$',
view='django.views.static.serve',
kwargs={'document_root': settings.STATIC_ROOT,}
)
]

24
rqsettings.txt Normal file
View File

@@ -0,0 +1,24 @@
[program:myworker]
; Point the command to the specific rq command you want to run.
; If you use virtualenv, be sure to point it to
; /home/sander/python/rowsandall/py2/bin/rq
; Also, you probably want to include a settings module to configure this
; worker. For more info on that, see http://python-rq.org/docs/workers/
command=/path/to/rq worker -c workersettings high normal low
; process_num is required if you specify >1 numprocs
process_name=%(program_name)s-%(process_num)s
; If you want to run more than one worker instance, increase this
numprocs=3
; This is the directory from which RQ is ran. Be sure to point this to the
; directory where your source code is importable from
directory=/path/to
; RQ requires the TERM signal to perform a warm shutdown. If RQ does not die
; within 10 seconds, supervisor will forcefully kill it
stopsignal=TERM
; These are up to you
autostart=true
autorestart=true

View File

@@ -1,202 +1,202 @@
Apache License Apache License
Version 2.0, January 2004 Version 2.0, January 2004
http://www.apache.org/licenses/ http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions. 1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, "License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document. and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by "Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License. the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all "Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition, control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the "control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity. outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity "You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License. exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, "Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation including but not limited to software source code, documentation
source, and configuration files. source, and configuration files.
"Object" form shall mean any form resulting from mechanical "Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation, not limited to compiled object code, generated documentation,
and conversions to other media types. and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or "Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work copyright notice that is included in or attached to the work
(an example is provided in the Appendix below). (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object "Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of, separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof. the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including "Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted" the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution." designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity "Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work. subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of 2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual, this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of, copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form. Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of 3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual, this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made, (except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work, use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s) Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate granted to You under this License for that Work shall terminate
as of the date such litigation is filed. as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the 4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You modifications, and in Source or Object form, provided that You
meet the following conditions: meet the following conditions:
(a) You must give any other recipients of the Work or (a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices (b) You must cause any modified files to carry prominent notices
stating that You changed the files; and stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works (c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work, attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of excluding those notices that do not pertain to any part of
the Derivative Works; and the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its (d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or, documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed that such additional attribution notices cannot be construed
as modifying the License. as modifying the License.
You may add Your own copyright statement to Your modifications and You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use, for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License. the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, 5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions. this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions. with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade 6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor, names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file. origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or 7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS, Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License. risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, 8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise, whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill, Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages. has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing 9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer, the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity, and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify, of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability. of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work. APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]" boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier same "printed page" as the copyright notice for easier
identification within third-party archives. identification within third-party archives.
Copyright [yyyy] [name of copyright owner] Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
You may obtain a copy of the License at You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.

View File

@@ -8,7 +8,7 @@
} }
#CookielawBanner #CookielawCross { #CookielawBanner #CookielawCross {
background: url('/static/img/close.png') no-repeat 0 0; background: url('../img/close.png') no-repeat 0 0;
cursor: pointer; cursor: pointer;
display: block; display: block;
position: absolute; position: absolute;

View File

@@ -38,14 +38,13 @@
font-family:sans-serif; font-family:sans-serif;
text-align:left; text-align:left;
text-shadow: none; text-shadow: none;
white-space: normal;
-webkit-transition: none; -webkit-transition: none;
-moz-transition: none; -moz-transition: none;
-o-transition: none; -o-transition: none;
transition: none; transition: none;
} }
#djDebug button, #djDebug a.button { #djDebug button {
background-color: #eee; background-color: #eee;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eee), color-stop(100%, #cccccc)); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #eee), color-stop(100%, #cccccc));
background-image: -webkit-linear-gradient(top, #eee, #cccccc); background-image: -webkit-linear-gradient(top, #eee, #cccccc);
@@ -65,7 +64,7 @@
text-shadow: 0 1px 0 #eee; text-shadow: 0 1px 0 #eee;
} }
#djDebug button:hover, #djDebug a.button:hover { #djDebug button:hover {
background-color: #ddd; background-color: #ddd;
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ddd), color-stop(100%, #bbb)); background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ddd), color-stop(100%, #bbb));
background-image: -webkit-linear-gradient(top, #ddd, #bbb); background-image: -webkit-linear-gradient(top, #ddd, #bbb);
@@ -79,7 +78,7 @@
text-shadow: 0 1px 0 #ddd; text-shadow: 0 1px 0 #ddd;
} }
#djDebug button:active, #djDebug a.button:active { #djDebug button:active {
border: 1px solid #aaa; border: 1px solid #aaa;
border-bottom: 1px solid #888; border-bottom: 1px solid #888;
-webkit-box-shadow: inset 0 0 5px 2px #aaa, 0 1px 0 0 #eee; -webkit-box-shadow: inset 0 0 5px 2px #aaa, 0 1px 0 0 #eee;
@@ -287,7 +286,7 @@
border-collapse:collapse; border-collapse:collapse;
width:100%; width:100%;
background-color:#fff; background-color:#fff;
display:table; display:block;
margin-top:0.8em; margin-top:0.8em;
overflow: auto; overflow: auto;
} }
@@ -657,6 +656,3 @@
#djDebug .djdt-highlighted { #djDebug .djdt-highlighted {
background-color: lightgrey; background-color: lightgrey;
} }
.djdt-hidden {
display: none;
}

View File

@@ -1,4 +1 @@
var djdt = {jQuery: jQuery.noConflict(true)}; var djdt = {jQuery: jQuery.noConflict(true)}; window.define = _djdt_define_backup;
if (window.define) {
window.define.amd = _djdt_define_amd_backup;
}

View File

@@ -1,5 +1 @@
var _djdt_define_amd_backup; var _djdt_define_backup = window.define; window.define = undefined;
if (window.define) {
_djdt_define_amd_backup = window.define.amd;
window.define.amd = undefined;
}

View File

@@ -64,16 +64,16 @@
if (name == 'button') { if (name == 'button') {
var form = self.parents('form:eq(0)'); var form = self.parents('form:eq(0)');
ajax_data.url = self.attr('formaction'); ajax_data['url'] = self.attr('formaction');
if (form.length) { if (form.length) {
ajax_data.data = form.serialize(); ajax_data['data'] = form.serialize();
ajax_data.type = form.attr('method') || 'POST'; ajax_data['type'] = form.attr('method') || 'POST';
} }
} }
if (name == 'a') { if (name == 'a') {
ajax_data.url = self.attr('href'); ajax_data['url'] = self.attr('href');
} }
$.ajax(ajax_data).done(function(data){ $.ajax(ajax_data).done(function(data){
@@ -141,13 +141,13 @@
// due to djdt.handleDragged being set to true. // due to djdt.handleDragged being set to true.
if (djdt.handleDragged || event.pageY != startPageY) { if (djdt.handleDragged || event.pageY != startPageY) {
var top = baseY + event.clientY; var top = baseY + event.clientY;
if (top < 0) { if (top < 0) {
top = 0; top = 0;
} else if (top + handle.height() > windowHeight) { } else if (top + handle.height() > windowHeight) {
top = windowHeight - handle.height(); top = windowHeight - handle.height();
} }
handle.css({top: top}); handle.css({top: top});
djdt.handleDragged = true; djdt.handleDragged = true;
} }
@@ -213,13 +213,11 @@
$('#djDebugToolbar li').removeClass('djdt-active'); $('#djDebugToolbar li').removeClass('djdt-active');
// finally close toolbar // finally close toolbar
$('#djDebugToolbar').hide('fast'); $('#djDebugToolbar').hide('fast');
handle = $('#djDebugToolbarHandle'); $('#djDebugToolbarHandle').show();
handle.show();
// set handle position // set handle position
var handleTop = djdt.cookie.get('djdttop'); var handleTop = djdt.cookie.get('djdttop');
if (handleTop) { if (handleTop) {
handleTop = Math.min(handleTop, window.innerHeight - handle.outerHeight() - 10); $('#djDebugToolbarHandle').css({top: handleTop + 'px'});
handle.css({top: handleTop + 'px'});
} }
// Unbind keydown // Unbind keydown
$(document).unbind('keydown.djDebug'); $(document).unbind('keydown.djDebug');

View File

@@ -23,16 +23,16 @@
var $row = $('<tr class="' + ((rowCount % 2) ? 'djDebugOdd' : 'djDebugEven') + '"></tr>'); var $row = $('<tr class="' + ((rowCount % 2) ? 'djDebugOdd' : 'djDebugEven') + '"></tr>');
if (endStat) { if (endStat) {
// Render a start through end bar // Render a start through end bar
$row.html('<td>' + stat.replace('Start', '') + '</td>' + $row.html('<td>' + stat.replace('Start', '') + '</td>' +
'<td class="timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong>&#160;</strong></div></div></td>' + '<td class="timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong>&nbsp;</strong></div></div></td>' +
'<td>' + (perf.timing[stat] - timingOffset) + ' (+' + (perf.timing[endStat] - perf.timing[stat]) + ')</td>'); '<td>' + (perf.timing[stat] - timingOffset) + ' (+' + (perf.timing[endStat] - perf.timing[stat]) + ')</td>');
$row.find('strong').css({width: getCSSWidth(stat, endStat)}); $row.find('strong').css({width: getCSSWidth(stat, endStat)});
} else { } else {
// Render a point in time // Render a point in time
$row.html('<td>' + stat + '</td>' + $row.html('<td>' + stat + '</td>' +
'<td class="timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong>&#160;</strong></div></div></td>' + '<td class="timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong>&nbsp;</strong></div></div></td>' +
'<td>' + (perf.timing[stat] - timingOffset) + '</td>'); '<td>' + (perf.timing[stat] - timingOffset) + '</td>');
$row.find('strong').css({width: 2}); $row.find('strong').css({width: 2});
} }
$row.find('djDebugLineChart').css({left: getLeft(stat) + '%'}); $row.find('djDebugLineChart').css({left: getLeft(stat) + '%'});
$('#djDebugBrowserTimingTableBody').append($row); $('#djDebugBrowserTimingTableBody').append($row);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,51 +1,51 @@
.leaflet-vml-shape { .leaflet-vml-shape {
width: 1px; width: 1px;
height: 1px; height: 1px;
} }
.lvml { .lvml {
behavior: url(#default#VML); behavior: url(#default#VML);
display: inline-block; display: inline-block;
position: absolute; position: absolute;
} }
.leaflet-control { .leaflet-control {
display: inline; display: inline;
} }
.leaflet-popup-tip { .leaflet-popup-tip {
width: 21px; width: 21px;
_width: 27px; _width: 27px;
margin: 0 auto; margin: 0 auto;
_margin-top: -3px; _margin-top: -3px;
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
} }
.leaflet-popup-tip-container { .leaflet-popup-tip-container {
margin-top: -1px; margin-top: -1px;
} }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { .leaflet-popup-content-wrapper, .leaflet-popup-tip {
border: 1px solid #999; border: 1px solid #999;
} }
.leaflet-popup-content-wrapper { .leaflet-popup-content-wrapper {
zoom: 1; zoom: 1;
} }
.leaflet-control-zoom, .leaflet-control-zoom,
.leaflet-control-layers { .leaflet-control-layers {
border: 3px solid #999; border: 3px solid #999;
} }
.leaflet-control-layers-toggle { .leaflet-control-layers-toggle {
} }
.leaflet-control-attribution, .leaflet-control-attribution,
.leaflet-control-layers, .leaflet-control-layers,
.leaflet-control-scale-line { .leaflet-control-scale-line {
background: white; background: white;
} }
.leaflet-zoom-box { .leaflet-zoom-box {
filter: alpha(opacity=50); filter: alpha(opacity=50);
} }
.leaflet-control-attribution { .leaflet-control-attribution {
border-top: 1px solid #bbb; border-top: 1px solid #bbb;
border-left: 1px solid #bbb; border-left: 1px solid #bbb;
} }

View File

@@ -1,36 +1,36 @@
/* /*
proj4js.js -- Javascript reprojection library. proj4js.js -- Javascript reprojection library.
Authors: Mike Adair madairATdmsolutions.ca Authors: Mike Adair madairATdmsolutions.ca
Richard Greenwood richATgreenwoodmap.com Richard Greenwood richATgreenwoodmap.com
Didier Richard didier.richardATign.fr Didier Richard didier.richardATign.fr
Stephen Irons stephen.ironsATclear.net.nz Stephen Irons stephen.ironsATclear.net.nz
Olivier Terral oterralATgmail.com Olivier Terral oterralATgmail.com
License: License:
Copyright (c) 2012, Mike Adair, Richard Greenwood, Didier Richard, Copyright (c) 2012, Mike Adair, Richard Greenwood, Didier Richard,
Stephen Irons and Olivier Terral Stephen Irons and Olivier Terral
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions: Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software. in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
Note: This program is an almost direct port of the C library PROJ.4. Note: This program is an almost direct port of the C library PROJ.4.
*/ */
var Proj4js={defaultDatum:"WGS84",transform:function(a,c,b){if(!a.readyToUse)return this.reportError("Proj4js initialization for:"+a.srsCode+" not yet complete"),b;if(!c.readyToUse)return this.reportError("Proj4js initialization for:"+c.srsCode+" not yet complete"),b;if(a.datum&&c.datum&&((a.datum.datum_type==Proj4js.common.PJD_3PARAM||a.datum.datum_type==Proj4js.common.PJD_7PARAM)&&"WGS84"!=c.datumCode||(c.datum.datum_type==Proj4js.common.PJD_3PARAM||c.datum.datum_type==Proj4js.common.PJD_7PARAM)&& var Proj4js={defaultDatum:"WGS84",transform:function(a,c,b){if(!a.readyToUse)return this.reportError("Proj4js initialization for:"+a.srsCode+" not yet complete"),b;if(!c.readyToUse)return this.reportError("Proj4js initialization for:"+c.srsCode+" not yet complete"),b;if(a.datum&&c.datum&&((a.datum.datum_type==Proj4js.common.PJD_3PARAM||a.datum.datum_type==Proj4js.common.PJD_7PARAM)&&"WGS84"!=c.datumCode||(c.datum.datum_type==Proj4js.common.PJD_3PARAM||c.datum.datum_type==Proj4js.common.PJD_7PARAM)&&
"WGS84"!=a.datumCode)){var d=Proj4js.WGS84;this.transform(a,d,b);a=d}"enu"!=a.axis&&this.adjust_axis(a,!1,b);"longlat"==a.projName?(b.x*=Proj4js.common.D2R,b.y*=Proj4js.common.D2R):(a.to_meter&&(b.x*=a.to_meter,b.y*=a.to_meter),a.inverse(b));a.from_greenwich&&(b.x+=a.from_greenwich);b=this.datum_transform(a.datum,c.datum,b);c.from_greenwich&&(b.x-=c.from_greenwich);"longlat"==c.projName?(b.x*=Proj4js.common.R2D,b.y*=Proj4js.common.R2D):(c.forward(b),c.to_meter&&(b.x/=c.to_meter,b.y/=c.to_meter)); "WGS84"!=a.datumCode)){var d=Proj4js.WGS84;this.transform(a,d,b);a=d}"enu"!=a.axis&&this.adjust_axis(a,!1,b);"longlat"==a.projName?(b.x*=Proj4js.common.D2R,b.y*=Proj4js.common.D2R):(a.to_meter&&(b.x*=a.to_meter,b.y*=a.to_meter),a.inverse(b));a.from_greenwich&&(b.x+=a.from_greenwich);b=this.datum_transform(a.datum,c.datum,b);c.from_greenwich&&(b.x-=c.from_greenwich);"longlat"==c.projName?(b.x*=Proj4js.common.R2D,b.y*=Proj4js.common.R2D):(c.forward(b),c.to_meter&&(b.x/=c.to_meter,b.y/=c.to_meter));
"enu"!=c.axis&&this.adjust_axis(c,!0,b);return b},datum_transform:function(a,c,b){if(a.compare_datums(c)||a.datum_type==Proj4js.common.PJD_NODATUM||c.datum_type==Proj4js.common.PJD_NODATUM)return b;if(a.es!=c.es||a.a!=c.a||a.datum_type==Proj4js.common.PJD_3PARAM||a.datum_type==Proj4js.common.PJD_7PARAM||c.datum_type==Proj4js.common.PJD_3PARAM||c.datum_type==Proj4js.common.PJD_7PARAM)a.geodetic_to_geocentric(b),(a.datum_type==Proj4js.common.PJD_3PARAM||a.datum_type==Proj4js.common.PJD_7PARAM)&&a.geocentric_to_wgs84(b), "enu"!=c.axis&&this.adjust_axis(c,!0,b);return b},datum_transform:function(a,c,b){if(a.compare_datums(c)||a.datum_type==Proj4js.common.PJD_NODATUM||c.datum_type==Proj4js.common.PJD_NODATUM)return b;if(a.es!=c.es||a.a!=c.a||a.datum_type==Proj4js.common.PJD_3PARAM||a.datum_type==Proj4js.common.PJD_7PARAM||c.datum_type==Proj4js.common.PJD_3PARAM||c.datum_type==Proj4js.common.PJD_7PARAM)a.geodetic_to_geocentric(b),(a.datum_type==Proj4js.common.PJD_3PARAM||a.datum_type==Proj4js.common.PJD_7PARAM)&&a.geocentric_to_wgs84(b),

View File

@@ -1,263 +1,263 @@
(function (factory) { (function (factory) {
var L, proj4; var L, proj4;
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
// AMD // AMD
define(['leaflet', 'proj4'], factory); define(['leaflet', 'proj4'], factory);
} else if (typeof module === 'object' && typeof module.exports === "object") { } else if (typeof module === 'object' && typeof module.exports === "object") {
// Node/CommonJS // Node/CommonJS
L = require('leaflet'); L = require('leaflet');
proj4 = require('proj4'); proj4 = require('proj4');
module.exports = factory(L, proj4); module.exports = factory(L, proj4);
} else { } else {
// Browser globals // Browser globals
if (typeof window.L === 'undefined' || typeof window.proj4 === 'undefined') if (typeof window.L === 'undefined' || typeof window.proj4 === 'undefined')
throw 'Leaflet and proj4 must be loaded first'; throw 'Leaflet and proj4 must be loaded first';
factory(window.L, window.proj4); factory(window.L, window.proj4);
} }
}(function (L, proj4) { }(function (L, proj4) {
L.Proj = {}; L.Proj = {};
L.Proj._isProj4Obj = function(a) { L.Proj._isProj4Obj = function(a) {
return (typeof a.inverse !== 'undefined' && return (typeof a.inverse !== 'undefined' &&
typeof a.forward !== 'undefined'); typeof a.forward !== 'undefined');
}; };
L.Proj.Projection = L.Class.extend({ L.Proj.Projection = L.Class.extend({
initialize: function(code, def, bounds) { initialize: function(code, def, bounds) {
var isP4 = L.Proj._isProj4Obj(code); var isP4 = L.Proj._isProj4Obj(code);
this._proj = isP4 ? code : this._projFromCodeDef(code, def); this._proj = isP4 ? code : this._projFromCodeDef(code, def);
this.bounds = isP4 ? def : bounds; this.bounds = isP4 ? def : bounds;
}, },
project: function (latlng) { project: function (latlng) {
var point = this._proj.forward([latlng.lng, latlng.lat]); var point = this._proj.forward([latlng.lng, latlng.lat]);
return new L.Point(point[0], point[1]); return new L.Point(point[0], point[1]);
}, },
unproject: function (point, unbounded) { unproject: function (point, unbounded) {
var point2 = this._proj.inverse([point.x, point.y]); var point2 = this._proj.inverse([point.x, point.y]);
return new L.LatLng(point2[1], point2[0], unbounded); return new L.LatLng(point2[1], point2[0], unbounded);
}, },
_projFromCodeDef: function(code, def) { _projFromCodeDef: function(code, def) {
if (def) { if (def) {
proj4.defs(code, def); proj4.defs(code, def);
} else if (proj4.defs[code] === undefined) { } else if (proj4.defs[code] === undefined) {
var urn = code.split(':'); var urn = code.split(':');
if (urn.length > 3) { if (urn.length > 3) {
code = urn[urn.length - 3] + ':' + urn[urn.length - 1]; code = urn[urn.length - 3] + ':' + urn[urn.length - 1];
} }
if (proj4.defs[code] === undefined) { if (proj4.defs[code] === undefined) {
throw 'No projection definition for code ' + code; throw 'No projection definition for code ' + code;
} }
} }
return proj4(code); return proj4(code);
} }
}); });
L.Proj.CRS = L.Class.extend({ L.Proj.CRS = L.Class.extend({
includes: L.CRS, includes: L.CRS,
options: { options: {
transformation: new L.Transformation(1, 0, -1, 0) transformation: new L.Transformation(1, 0, -1, 0)
}, },
initialize: function(a, b, c) { initialize: function(a, b, c) {
var code, var code,
proj, proj,
def, def,
options; options;
if (L.Proj._isProj4Obj(a)) { if (L.Proj._isProj4Obj(a)) {
proj = a; proj = a;
code = proj.srsCode; code = proj.srsCode;
options = b || {}; options = b || {};
this.projection = new L.Proj.Projection(proj, options.bounds); this.projection = new L.Proj.Projection(proj, options.bounds);
} else { } else {
code = a; code = a;
def = b; def = b;
options = c || {}; options = c || {};
this.projection = new L.Proj.Projection(code, def, options.bounds); this.projection = new L.Proj.Projection(code, def, options.bounds);
} }
L.Util.setOptions(this, options); L.Util.setOptions(this, options);
this.code = code; this.code = code;
this.transformation = this.options.transformation; this.transformation = this.options.transformation;
if (this.options.origin) { if (this.options.origin) {
this.transformation = this.transformation =
new L.Transformation(1, -this.options.origin[0], new L.Transformation(1, -this.options.origin[0],
-1, this.options.origin[1]); -1, this.options.origin[1]);
} }
if (this.options.scales) { if (this.options.scales) {
this._scales = this.options.scales; this._scales = this.options.scales;
} else if (this.options.resolutions) { } else if (this.options.resolutions) {
this._scales = []; this._scales = [];
for (var i = this.options.resolutions.length - 1; i >= 0; i--) { for (var i = this.options.resolutions.length - 1; i >= 0; i--) {
if (this.options.resolutions[i]) { if (this.options.resolutions[i]) {
this._scales[i] = 1 / this.options.resolutions[i]; this._scales[i] = 1 / this.options.resolutions[i];
} }
} }
} }
this.infinite = !this.options.bounds; this.infinite = !this.options.bounds;
}, },
scale: function(zoom) { scale: function(zoom) {
var iZoom = Math.floor(zoom), var iZoom = Math.floor(zoom),
baseScale, baseScale,
nextScale, nextScale,
scaleDiff, scaleDiff,
zDiff; zDiff;
if (zoom === iZoom) { if (zoom === iZoom) {
return this._scales[zoom]; return this._scales[zoom];
} else { } else {
// Non-integer zoom, interpolate // Non-integer zoom, interpolate
baseScale = this._scales[iZoom]; baseScale = this._scales[iZoom];
nextScale = this._scales[iZoom + 1]; nextScale = this._scales[iZoom + 1];
scaleDiff = nextScale - baseScale; scaleDiff = nextScale - baseScale;
zDiff = (zoom - iZoom); zDiff = (zoom - iZoom);
return baseScale + scaleDiff * zDiff; return baseScale + scaleDiff * zDiff;
} }
}, },
zoom: function(scale) { zoom: function(scale) {
// Find closest number in this._scales, down // Find closest number in this._scales, down
var downScale = this._closestElement(this._scales, scale), var downScale = this._closestElement(this._scales, scale),
downZoom = this._scales.indexOf(downScale), downZoom = this._scales.indexOf(downScale),
nextScale, nextScale,
nextZoom, nextZoom,
scaleDiff; scaleDiff;
// Check if scale is downScale => return array index // Check if scale is downScale => return array index
if (scale === downScale) { if (scale === downScale) {
return downZoom; return downZoom;
} }
// Interpolate // Interpolate
nextZoom = downZoom + 1; nextZoom = downZoom + 1;
nextScale = this._scales[nextZoom]; nextScale = this._scales[nextZoom];
if (nextScale === undefined) { if (nextScale === undefined) {
return Infinity; return Infinity;
} }
scaleDiff = nextScale - downScale; scaleDiff = nextScale - downScale;
return (scale - downScale) / scaleDiff + downZoom; return (scale - downScale) / scaleDiff + downZoom;
}, },
distance: L.CRS.Earth.distance, distance: L.CRS.Earth.distance,
R: L.CRS.Earth.R, R: L.CRS.Earth.R,
/* Get the closest lowest element in an array */ /* Get the closest lowest element in an array */
_closestElement: function(array, element) { _closestElement: function(array, element) {
var low; var low;
for (var i = array.length; i--;) { for (var i = array.length; i--;) {
if (array[i] <= element && (low === undefined || low < array[i])) { if (array[i] <= element && (low === undefined || low < array[i])) {
low = array[i]; low = array[i];
} }
} }
return low; return low;
} }
}); });
L.Proj.GeoJSON = L.GeoJSON.extend({ L.Proj.GeoJSON = L.GeoJSON.extend({
initialize: function(geojson, options) { initialize: function(geojson, options) {
this._callLevel = 0; this._callLevel = 0;
L.GeoJSON.prototype.initialize.call(this, geojson, options); L.GeoJSON.prototype.initialize.call(this, geojson, options);
}, },
addData: function(geojson) { addData: function(geojson) {
var crs; var crs;
if (geojson) { if (geojson) {
if (geojson.crs && geojson.crs.type === 'name') { if (geojson.crs && geojson.crs.type === 'name') {
crs = new L.Proj.CRS(geojson.crs.properties.name); crs = new L.Proj.CRS(geojson.crs.properties.name);
} else if (geojson.crs && geojson.crs.type) { } else if (geojson.crs && geojson.crs.type) {
crs = new L.Proj.CRS(geojson.crs.type + ':' + geojson.crs.properties.code); crs = new L.Proj.CRS(geojson.crs.type + ':' + geojson.crs.properties.code);
} }
if (crs !== undefined) { if (crs !== undefined) {
this.options.coordsToLatLng = function(coords) { this.options.coordsToLatLng = function(coords) {
var point = L.point(coords[0], coords[1]); var point = L.point(coords[0], coords[1]);
return crs.projection.unproject(point); return crs.projection.unproject(point);
}; };
} }
} }
// Base class' addData might call us recursively, but // Base class' addData might call us recursively, but
// CRS shouldn't be cleared in that case, since CRS applies // CRS shouldn't be cleared in that case, since CRS applies
// to the whole GeoJSON, inluding sub-features. // to the whole GeoJSON, inluding sub-features.
this._callLevel++; this._callLevel++;
try { try {
L.GeoJSON.prototype.addData.call(this, geojson); L.GeoJSON.prototype.addData.call(this, geojson);
} finally { } finally {
this._callLevel--; this._callLevel--;
if (this._callLevel === 0) { if (this._callLevel === 0) {
delete this.options.coordsToLatLng; delete this.options.coordsToLatLng;
} }
} }
} }
}); });
L.Proj.geoJson = function(geojson, options) { L.Proj.geoJson = function(geojson, options) {
return new L.Proj.GeoJSON(geojson, options); return new L.Proj.GeoJSON(geojson, options);
}; };
L.Proj.ImageOverlay = L.ImageOverlay.extend({ L.Proj.ImageOverlay = L.ImageOverlay.extend({
initialize: function (url, bounds, options) { initialize: function (url, bounds, options) {
L.ImageOverlay.prototype.initialize.call(this, url, null, options); L.ImageOverlay.prototype.initialize.call(this, url, null, options);
this._projectedBounds = bounds; this._projectedBounds = bounds;
}, },
// Danger ahead: Overriding internal methods in Leaflet. // Danger ahead: Overriding internal methods in Leaflet.
// Decided to do this rather than making a copy of L.ImageOverlay // Decided to do this rather than making a copy of L.ImageOverlay
// and doing very tiny modifications to it. // and doing very tiny modifications to it.
// Future will tell if this was wise or not. // Future will tell if this was wise or not.
_animateZoom: function (event) { _animateZoom: function (event) {
var scale = this._map.getZoomScale(event.zoom); var scale = this._map.getZoomScale(event.zoom);
var northWest = L.point(this._projectedBounds.min.x, this._projectedBounds.max.y); var northWest = L.point(this._projectedBounds.min.x, this._projectedBounds.max.y);
var offset = this._projectedToNewLayerPoint(northWest, event.zoom, event.center); var offset = this._projectedToNewLayerPoint(northWest, event.zoom, event.center);
L.DomUtil.setTransform(this._image, offset, scale); L.DomUtil.setTransform(this._image, offset, scale);
}, },
_reset: function () { _reset: function () {
var zoom = this._map.getZoom(); var zoom = this._map.getZoom();
var pixelOrigin = this._map.getPixelOrigin(); var pixelOrigin = this._map.getPixelOrigin();
var bounds = L.bounds( var bounds = L.bounds(
this._transform(this._projectedBounds.min, zoom)._subtract(pixelOrigin), this._transform(this._projectedBounds.min, zoom)._subtract(pixelOrigin),
this._transform(this._projectedBounds.max, zoom)._subtract(pixelOrigin) this._transform(this._projectedBounds.max, zoom)._subtract(pixelOrigin)
); );
var size = bounds.getSize(); var size = bounds.getSize();
L.DomUtil.setPosition(this._image, bounds.min); L.DomUtil.setPosition(this._image, bounds.min);
this._image.style.width = size.x + 'px'; this._image.style.width = size.x + 'px';
this._image.style.height = size.y + 'px'; this._image.style.height = size.y + 'px';
}, },
_projectedToNewLayerPoint: function (point, zoom, center) { _projectedToNewLayerPoint: function (point, zoom, center) {
var viewHalf = this._map.getSize()._divideBy(2); var viewHalf = this._map.getSize()._divideBy(2);
var newTopLeft = this._map.project(center, zoom)._subtract(viewHalf)._round(); var newTopLeft = this._map.project(center, zoom)._subtract(viewHalf)._round();
var topLeft = newTopLeft.add(this._map._getMapPanePos()); var topLeft = newTopLeft.add(this._map._getMapPanePos());
return this._transform(point, zoom)._subtract(topLeft); return this._transform(point, zoom)._subtract(topLeft);
}, },
_transform: function (point, zoom) { _transform: function (point, zoom) {
var crs = this._map.options.crs; var crs = this._map.options.crs;
var transformation = crs.transformation; var transformation = crs.transformation;
var scale = crs.scale(zoom); var scale = crs.scale(zoom);
return transformation.transform(point, scale); return transformation.transform(point, scale);
} }
}); });
L.Proj.imageOverlay = function (url, bounds, options) { L.Proj.imageOverlay = function (url, bounds, options) {
return new L.Proj.ImageOverlay(url, bounds, options); return new L.Proj.ImageOverlay(url, bounds, options);
}; };
return L.Proj; return L.Proj;
})); }));

View File

@@ -18988,169 +18988,169 @@ function request(RequestConstructor, method, url) {
module.exports = request; module.exports = request;
},{}],162:[function(require,module,exports){ },{}],162:[function(require,module,exports){
/** /**
* Expose `Emitter`. * Expose `Emitter`.
*/ */
if (typeof module !== 'undefined') { if (typeof module !== 'undefined') {
module.exports = Emitter; module.exports = Emitter;
} }
/** /**
* Initialize a new `Emitter`. * Initialize a new `Emitter`.
* *
* @api public * @api public
*/ */
function Emitter(obj) { function Emitter(obj) {
if (obj) return mixin(obj); if (obj) return mixin(obj);
}; };
/** /**
* Mixin the emitter properties. * Mixin the emitter properties.
* *
* @param {Object} obj * @param {Object} obj
* @return {Object} * @return {Object}
* @api private * @api private
*/ */
function mixin(obj) { function mixin(obj) {
for (var key in Emitter.prototype) { for (var key in Emitter.prototype) {
obj[key] = Emitter.prototype[key]; obj[key] = Emitter.prototype[key];
} }
return obj; return obj;
} }
/** /**
* Listen on the given `event` with `fn`. * Listen on the given `event` with `fn`.
* *
* @param {String} event * @param {String} event
* @param {Function} fn * @param {Function} fn
* @return {Emitter} * @return {Emitter}
* @api public * @api public
*/ */
Emitter.prototype.on = Emitter.prototype.on =
Emitter.prototype.addEventListener = function(event, fn){ Emitter.prototype.addEventListener = function(event, fn){
this._callbacks = this._callbacks || {}; this._callbacks = this._callbacks || {};
(this._callbacks['$' + event] = this._callbacks['$' + event] || []) (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
.push(fn); .push(fn);
return this; return this;
}; };
/** /**
* Adds an `event` listener that will be invoked a single * Adds an `event` listener that will be invoked a single
* time then automatically removed. * time then automatically removed.
* *
* @param {String} event * @param {String} event
* @param {Function} fn * @param {Function} fn
* @return {Emitter} * @return {Emitter}
* @api public * @api public
*/ */
Emitter.prototype.once = function(event, fn){ Emitter.prototype.once = function(event, fn){
function on() { function on() {
this.off(event, on); this.off(event, on);
fn.apply(this, arguments); fn.apply(this, arguments);
} }
on.fn = fn; on.fn = fn;
this.on(event, on); this.on(event, on);
return this; return this;
}; };
/** /**
* Remove the given callback for `event` or all * Remove the given callback for `event` or all
* registered callbacks. * registered callbacks.
* *
* @param {String} event * @param {String} event
* @param {Function} fn * @param {Function} fn
* @return {Emitter} * @return {Emitter}
* @api public * @api public
*/ */
Emitter.prototype.off = Emitter.prototype.off =
Emitter.prototype.removeListener = Emitter.prototype.removeListener =
Emitter.prototype.removeAllListeners = Emitter.prototype.removeAllListeners =
Emitter.prototype.removeEventListener = function(event, fn){ Emitter.prototype.removeEventListener = function(event, fn){
this._callbacks = this._callbacks || {}; this._callbacks = this._callbacks || {};
// all // all
if (0 == arguments.length) { if (0 == arguments.length) {
this._callbacks = {}; this._callbacks = {};
return this; return this;
} }
// specific event // specific event
var callbacks = this._callbacks['$' + event]; var callbacks = this._callbacks['$' + event];
if (!callbacks) return this; if (!callbacks) return this;
// remove all handlers // remove all handlers
if (1 == arguments.length) { if (1 == arguments.length) {
delete this._callbacks['$' + event]; delete this._callbacks['$' + event];
return this; return this;
} }
// remove specific handler // remove specific handler
var cb; var cb;
for (var i = 0; i < callbacks.length; i++) { for (var i = 0; i < callbacks.length; i++) {
cb = callbacks[i]; cb = callbacks[i];
if (cb === fn || cb.fn === fn) { if (cb === fn || cb.fn === fn) {
callbacks.splice(i, 1); callbacks.splice(i, 1);
break; break;
} }
} }
return this; return this;
}; };
/** /**
* Emit `event` with the given args. * Emit `event` with the given args.
* *
* @param {String} event * @param {String} event
* @param {Mixed} ... * @param {Mixed} ...
* @return {Emitter} * @return {Emitter}
*/ */
Emitter.prototype.emit = function(event){ Emitter.prototype.emit = function(event){
this._callbacks = this._callbacks || {}; this._callbacks = this._callbacks || {};
var args = [].slice.call(arguments, 1) var args = [].slice.call(arguments, 1)
, callbacks = this._callbacks['$' + event]; , callbacks = this._callbacks['$' + event];
if (callbacks) { if (callbacks) {
callbacks = callbacks.slice(0); callbacks = callbacks.slice(0);
for (var i = 0, len = callbacks.length; i < len; ++i) { for (var i = 0, len = callbacks.length; i < len; ++i) {
callbacks[i].apply(this, args); callbacks[i].apply(this, args);
} }
} }
return this; return this;
}; };
/** /**
* Return array of callbacks for `event`. * Return array of callbacks for `event`.
* *
* @param {String} event * @param {String} event
* @return {Array} * @return {Array}
* @api public * @api public
*/ */
Emitter.prototype.listeners = function(event){ Emitter.prototype.listeners = function(event){
this._callbacks = this._callbacks || {}; this._callbacks = this._callbacks || {};
return this._callbacks['$' + event] || []; return this._callbacks['$' + event] || [];
}; };
/** /**
* Check if this emitter has `event` handlers. * Check if this emitter has `event` handlers.
* *
* @param {String} event * @param {String} event
* @return {Boolean} * @return {Boolean}
* @api public * @api public
*/ */
Emitter.prototype.hasListeners = function(event){ Emitter.prototype.hasListeners = function(event){
return !! this.listeners(event).length; return !! this.listeners(event).length;
}; };
},{}],163:[function(require,module,exports){ },{}],163:[function(require,module,exports){

2
static/rq/jquery.js vendored

File diff suppressed because one or more lines are too long