Merge branch 'feature/thinkpad' into develop
This commit is contained in:
@@ -52,3 +52,7 @@ config.yaml
|
|||||||
|
|
||||||
# test data
|
# test data
|
||||||
|
|
||||||
|
# virtualenv
|
||||||
|
/venv/
|
||||||
|
/py27/
|
||||||
|
/py2/
|
||||||
|
|||||||
+23
-23
@@ -1,23 +1,23 @@
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
def google_analytics(request):
|
def google_analytics(request):
|
||||||
"""
|
"""
|
||||||
Use the variables returned in this function to
|
Use the variables returned in this function to
|
||||||
render your Google Analytics tracking code template.
|
render your Google Analytics tracking code template.
|
||||||
"""
|
"""
|
||||||
ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_ID', False)
|
ga_prop_id = getattr(settings, 'GOOGLE_ANALYTICS_PROPERTY_ID', False)
|
||||||
ga_domain = getattr(settings, 'GOOGLE_ANALYTICS_DOMAIN', False)
|
ga_domain = getattr(settings, 'GOOGLE_ANALYTICS_DOMAIN', False)
|
||||||
if not settings.DEBUG and ga_prop_id and ga_domain:
|
if not settings.DEBUG and ga_prop_id and ga_domain:
|
||||||
return {
|
return {
|
||||||
'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id,
|
'GOOGLE_ANALYTICS_PROPERTY_ID': ga_prop_id,
|
||||||
'GOOGLE_ANALYTICS_DOMAIN': ga_domain,
|
'GOOGLE_ANALYTICS_DOMAIN': ga_domain,
|
||||||
}
|
}
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def hello_world(request):
|
def hello_world(request):
|
||||||
return {
|
return {
|
||||||
'helloworld': 'hi Sander'
|
'helloworld': 'hi Sander'
|
||||||
}
|
}
|
||||||
|
|
||||||
def warning_message(request):
|
def warning_message(request):
|
||||||
return {'WARNING_MESSAGE': settings.WARNING_MESSAGE}
|
return {'WARNING_MESSAGE': settings.WARNING_MESSAGE}
|
||||||
|
|||||||
@@ -0,0 +1,221 @@
|
|||||||
|
alabaster==0.7.7
|
||||||
|
amqp==1.4.9
|
||||||
|
anyjson==0.3.3
|
||||||
|
appdirs==1.4.3
|
||||||
|
argcomplete==1.0.0
|
||||||
|
arrow==0.12.1
|
||||||
|
asn1crypto==0.23.0
|
||||||
|
astropy==1.1.2
|
||||||
|
atomicwrites==1.3.0
|
||||||
|
attrs==18.2.0
|
||||||
|
awscli==1.14.57
|
||||||
|
Babel==2.2.0
|
||||||
|
backports-abc==0.4
|
||||||
|
backports.functools-lru-cache==1.5
|
||||||
|
backports.shutil-get-terminal-size==1.0.0
|
||||||
|
backports.ssl-match-hostname==3.4.0.2
|
||||||
|
beautifulsoup4==4.6.0
|
||||||
|
billiard==3.3.0.23
|
||||||
|
bitarray==0.8.1
|
||||||
|
blaze==0.9.1
|
||||||
|
bleach==2.0.0
|
||||||
|
bokeh==0.12.3
|
||||||
|
boto==2.48.0
|
||||||
|
boto3==1.6.6
|
||||||
|
botocore==1.9.10
|
||||||
|
bottle==0.12.9
|
||||||
|
Bottleneck==1.0.0
|
||||||
|
braintree==3.50.0
|
||||||
|
cairocffi==0.7.2
|
||||||
|
celery==3.1.23
|
||||||
|
certifi==2017.11.5
|
||||||
|
cffi==1.11.2
|
||||||
|
chardet==3.0.4
|
||||||
|
chest==0.2.3
|
||||||
|
click==6.6
|
||||||
|
cloudpickle==0.1.1
|
||||||
|
clyent==1.2.1
|
||||||
|
colorama==0.3.7
|
||||||
|
comtypes==1.1.7
|
||||||
|
configobj==5.0.6
|
||||||
|
coreapi==2.0.9
|
||||||
|
cryptography==2.1.3
|
||||||
|
cycler==0.10.0
|
||||||
|
Cython==0.23.4
|
||||||
|
cytoolz==0.7.5
|
||||||
|
dask==0.8.1
|
||||||
|
datashape==0.5.1
|
||||||
|
decorator==4.0.9
|
||||||
|
dill==0.2.4
|
||||||
|
Django==1.9.5
|
||||||
|
django-analytical==2.2.2
|
||||||
|
django-analytics==0.0.1
|
||||||
|
django-async-messages==0.3.1
|
||||||
|
django-braces==1.8.1
|
||||||
|
django-celery==3.1.17
|
||||||
|
django-classy-tags==0.8.0
|
||||||
|
django-cookie-law==1.0.12
|
||||||
|
django-cors-headers==1.1.0
|
||||||
|
django-cors-middleware==1.3.1
|
||||||
|
django-countries==5.3.2
|
||||||
|
django-datetime-widget==0.9.3
|
||||||
|
django-debug-toolbar==1.4
|
||||||
|
django-durationfield==0.5.2
|
||||||
|
django-extensions==1.7.5
|
||||||
|
django-filter==1.0.0
|
||||||
|
django-geckoboard==2.0.0
|
||||||
|
django-geojson==2.10.0
|
||||||
|
django-htmlmin==0.10.0
|
||||||
|
django-leaflet==0.22.0
|
||||||
|
django-mailbox==4.6.0
|
||||||
|
django-modelcluster==1.1
|
||||||
|
django-oauth-toolkit==0.10.0
|
||||||
|
django-oauth2-provider==0.2.6.1
|
||||||
|
django-rest-swagger==2.1.0
|
||||||
|
django-rq==0.8.0
|
||||||
|
django-rq-dashboard==0.3.0
|
||||||
|
django-ses==0.8.5
|
||||||
|
django-social-share==1.1.2
|
||||||
|
django-suit==0.2.25
|
||||||
|
django-suit-rq==1.0.1
|
||||||
|
django-taggit==0.18.1
|
||||||
|
django-translation-manager==0.3.4
|
||||||
|
django-treebeard==4.0
|
||||||
|
django-tz-detect==0.2.8
|
||||||
|
djangorestframework==3.5.3
|
||||||
|
docopt==0.6.2
|
||||||
|
docutils==0.12
|
||||||
|
enum34==1.1.2
|
||||||
|
et-xmlfile==1.0.1
|
||||||
|
Factory==1.2
|
||||||
|
fastcache==1.0.2
|
||||||
|
filemagic==1.6
|
||||||
|
fitparse==1.0.1
|
||||||
|
Flask==0.10.1
|
||||||
|
Flask-Cors==2.1.2
|
||||||
|
Flask-Login==0.3.2
|
||||||
|
Flask-OpenID==1.2.5
|
||||||
|
Flask-Uploads==0.2.0
|
||||||
|
flower==0.9.1
|
||||||
|
funcsigs==1.0.2
|
||||||
|
functools32==3.2.3.post2
|
||||||
|
future==0.16.0
|
||||||
|
futures==3.0.5
|
||||||
|
geocoder==1.37.0
|
||||||
|
geopy==1.11.0
|
||||||
|
gevent==1.1.0
|
||||||
|
greenlet==0.4.9
|
||||||
|
grin==1.2.1
|
||||||
|
gunicorn==19.4.5
|
||||||
|
HeapDict==1.0.0
|
||||||
|
honcho==0.6.6
|
||||||
|
html5lib==1.0.1
|
||||||
|
httplib2==0.9.2
|
||||||
|
icalendar==4.0.3
|
||||||
|
idna==2.6
|
||||||
|
ipaddress==1.0.14
|
||||||
|
ipython==4.2.0
|
||||||
|
ipython-genutils==0.1.0
|
||||||
|
iso8601==0.1.12
|
||||||
|
isodate==0.6.0
|
||||||
|
itsdangerous==0.24
|
||||||
|
itypes==1.1.0
|
||||||
|
Jinja2==2.8
|
||||||
|
jmespath==0.9.3
|
||||||
|
jsonschema==2.5.1
|
||||||
|
kiwisolver==1.0.1
|
||||||
|
kombu==3.0.35
|
||||||
|
lxml==4.2.1
|
||||||
|
Markdown==2.6.7
|
||||||
|
MarkupSafe==0.23
|
||||||
|
matplotlib==2.2.2
|
||||||
|
mechanize==0.3.6
|
||||||
|
MiniMockTest==0.5
|
||||||
|
mock==2.0.0
|
||||||
|
more-itertools==5.0.0
|
||||||
|
mpld3==0.2
|
||||||
|
mpmath==0.19
|
||||||
|
multipledispatch==0.4.8
|
||||||
|
networkx==1.11
|
||||||
|
nose==1.3.7
|
||||||
|
nose-parameterized==0.6.0
|
||||||
|
numpy==1.14.2
|
||||||
|
oauth2==1.9.0.post1
|
||||||
|
oauthlib==1.0.3
|
||||||
|
odo==0.4.2
|
||||||
|
openapi-codec==1.1.7
|
||||||
|
packaging==16.8
|
||||||
|
pandas==0.22.0
|
||||||
|
pathlib2==2.3.3
|
||||||
|
pathspec==0.5.5
|
||||||
|
pbr==5.1.2
|
||||||
|
pexpect==4.0.1
|
||||||
|
pickleshare==0.7.2
|
||||||
|
Pillow==3.2.0
|
||||||
|
pluggy==0.8.1
|
||||||
|
polib==1.0.7
|
||||||
|
psutil==4.1.0
|
||||||
|
ptyprocess==0.5.1
|
||||||
|
py==1.7.0
|
||||||
|
pyasn1==0.1.9
|
||||||
|
pycparser==2.14
|
||||||
|
pycrypto==2.6.1
|
||||||
|
PyMySQL==0.7.4
|
||||||
|
pync==1.6.1
|
||||||
|
pyparsing==2.2.0
|
||||||
|
pytest==4.2.0
|
||||||
|
pytest-sugar==0.9.2
|
||||||
|
python-dateutil==2.7.2
|
||||||
|
python-memcached==1.58
|
||||||
|
python-metar==1.4.0
|
||||||
|
python-openid==2.2.5
|
||||||
|
python-twitter==3.2
|
||||||
|
pytz==2018.4
|
||||||
|
PyYAML==3.12
|
||||||
|
pyzmq==15.2.0
|
||||||
|
ratelim==0.1.6
|
||||||
|
redis==2.10.5
|
||||||
|
req==1.0.0
|
||||||
|
requests==2.12.3
|
||||||
|
requests-oauthlib==0.7.0
|
||||||
|
rowingdata==2.0.0
|
||||||
|
rowingphysics==0.3.10
|
||||||
|
rq==0.6.0
|
||||||
|
rq-dashboard==0.3.7
|
||||||
|
rsa==3.4.2
|
||||||
|
s3transfer==0.1.13
|
||||||
|
scandir==1.6
|
||||||
|
scikit-image==0.12.3
|
||||||
|
scikit-learn==0.17.1
|
||||||
|
scipy==1.0.1
|
||||||
|
seaborn==0.7.0
|
||||||
|
Shapely==1.6.1
|
||||||
|
shortuuid==0.4.3
|
||||||
|
simplegeneric==0.8.1
|
||||||
|
simplejson==3.10.0
|
||||||
|
singledispatch==3.4.0.3
|
||||||
|
six==1.11.0
|
||||||
|
SQLAlchemy==1.0.12
|
||||||
|
sqlparse==0.1.19
|
||||||
|
-e git+git@bitbucket.org:sanderroosendaal/rowsandall.git@c9695a9f8f5ee0e459de066007a5ef4cef58255b#egg=stravalib
|
||||||
|
subprocess32==3.2.7
|
||||||
|
sympy==1.0
|
||||||
|
termcolor==1.1.0
|
||||||
|
timestring==1.6.2
|
||||||
|
timezonefinder==2.1.2
|
||||||
|
toolz==0.7.4
|
||||||
|
tornado==4.4.2
|
||||||
|
tqdm==4.23.0
|
||||||
|
traitlets==4.2.1
|
||||||
|
tzwhere==3.0.3
|
||||||
|
Unidecode==0.4.19
|
||||||
|
units==0.6
|
||||||
|
uritemplate==3.0.0
|
||||||
|
urllib3==1.22
|
||||||
|
VerbalExpressions==0.0.1
|
||||||
|
webencodings==0.5.1
|
||||||
|
Werkzeug==0.11.8
|
||||||
|
xlrd==1.0.0
|
||||||
|
xmltodict==0.11.0
|
||||||
|
yamjam==0.1.7
|
||||||
|
yamllint==1.8.1
|
||||||
|
|||||||
+6
-5
@@ -65,14 +65,14 @@ from rowers.dataprepnodjango import (
|
|||||||
add_c2_stroke_data_db,totaltime_sec_to_string,
|
add_c2_stroke_data_db,totaltime_sec_to_string,
|
||||||
create_c2_stroke_data_db,update_empower,
|
create_c2_stroke_data_db,update_empower,
|
||||||
database_url_debug,database_url,dataprep,
|
database_url_debug,database_url,dataprep,
|
||||||
# create_strava_stroke_data_db
|
# create_strava_stroke_data_db
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
from django.core.mail import (
|
from django.core.mail import (
|
||||||
send_mail,
|
send_mail,
|
||||||
EmailMessage,EmailMultiAlternatives,
|
EmailMessage,EmailMultiAlternatives,
|
||||||
)
|
)
|
||||||
|
|
||||||
from django.template import Context
|
from django.template import Context
|
||||||
from django.db.utils import OperationalError
|
from django.db.utils import OperationalError
|
||||||
@@ -106,7 +106,7 @@ def handle_c2_import_stroke_data(c2token,
|
|||||||
c2id,workoutid,
|
c2id,workoutid,
|
||||||
starttimeunix,
|
starttimeunix,
|
||||||
csvfilename,debug=True,**kwargs):
|
csvfilename,debug=True,**kwargs):
|
||||||
|
|
||||||
if 'workouttype' in kwargs:
|
if 'workouttype' in kwargs:
|
||||||
workouttype = kwargs['workouttype']
|
workouttype = kwargs['workouttype']
|
||||||
else:
|
else:
|
||||||
@@ -124,12 +124,13 @@ def handle_c2_import_stroke_data(c2token,
|
|||||||
strokedata,workoutid,starttimeunix,
|
strokedata,workoutid,starttimeunix,
|
||||||
csvfilename,debug=debug,workouttype=workouttype
|
csvfilename,debug=debug,workouttype=workouttype
|
||||||
)
|
)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
else:
|
else:
|
||||||
url = "https://log.concept2.com/api/users/me/results/"+str(c2id)
|
url = "https://log.concept2.com/api/users/me/results/"+str(c2id)
|
||||||
|
|
||||||
s = requests.get(url,headers=headers)
|
s = requests.get(url,headers=headers)
|
||||||
|
|
||||||
if s.status_code == 200:
|
if s.status_code == 200:
|
||||||
workoutdata = s.json()['data']
|
workoutdata = s.json()['data']
|
||||||
distance = workoutdata['distance']
|
distance = workoutdata['distance']
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
try:
|
||||||
|
WindowsError
|
||||||
|
except NameError:
|
||||||
|
WindowsError = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
OSError
|
||||||
|
except NameError:
|
||||||
|
OSError = None
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
pytestmark = pytest.mark.django_db
|
pytestmark = pytest.mark.django_db
|
||||||
@@ -88,7 +98,7 @@ def get_random_file(filename='rowers/tests/testdata/testdata.csv',name=''):
|
|||||||
row = rdata(filename)
|
row = rdata(filename)
|
||||||
totaldist = row.df['cum_dist'].max()
|
totaldist = row.df['cum_dist'].max()
|
||||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
totaltime = totaltime+row.df.loc[row.df.index[0],' ElapsedTime (sec)']
|
||||||
|
|
||||||
|
|
||||||
hours = int(totaltime/3600.)
|
hours = int(totaltime/3600.)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class WorkoutCompareTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -91,7 +91,7 @@ class BoxPlotTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -188,7 +188,7 @@ class ListWorkoutTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -244,7 +244,7 @@ class PlannedSessionTests(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_ics_download(self):
|
def test_ics_download(self):
|
||||||
@@ -289,7 +289,7 @@ class ForcecurveTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.getsmallrowdata_db',side_effect = mocked_getempowerdata_db)
|
@patch('rowers.dataprep.getsmallrowdata_db',side_effect = mocked_getempowerdata_db)
|
||||||
@@ -323,7 +323,7 @@ class CumStatsTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multistats)
|
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multistats)
|
||||||
@@ -360,7 +360,7 @@ class CumFlexTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multiflex)
|
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multiflex)
|
||||||
@@ -465,7 +465,7 @@ class MultiFlexTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multiflex)
|
@patch('rowers.dataprep.read_cols_df_sql', side_effect = mocked_read_df_cols_sql_multiflex)
|
||||||
@@ -567,7 +567,7 @@ class HistoTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class SimpleViewTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def start_protrial(self):
|
def start_protrial(self):
|
||||||
|
|||||||
@@ -71,13 +71,16 @@ class OTWCPChartTest(TestCase):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
for filename in os.listdir('rowers/tests/testdata/otwcp/temp'):
|
try:
|
||||||
path = os.path.join('rowers/tests/testdata/otwcp/temp/',filename)
|
for filename in os.listdir('rowers/tests/testdata/otwcp/temp'):
|
||||||
if not os.path.isdir(path):
|
path = os.path.join('rowers/tests/testdata/otwcp/temp/',filename)
|
||||||
try:
|
if not os.path.isdir(path):
|
||||||
os.remove(path)
|
try:
|
||||||
except (IOError,WindowsError):
|
os.remove(path)
|
||||||
pass
|
except (IOError,WindowsError,OSError):
|
||||||
|
pass
|
||||||
|
except (IOError,WindowsError,OSError):
|
||||||
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.getsmallrowdata_db',side_effect=mocked_cpraw)
|
@patch('rowers.dataprep.getsmallrowdata_db',side_effect=mocked_cpraw)
|
||||||
@patch('rowers.dataprep.getcpdata_sql',side_effect=mocked_getcpdata_sql)
|
@patch('rowers.dataprep.getcpdata_sql',side_effect=mocked_getcpdata_sql)
|
||||||
@@ -153,7 +156,7 @@ class CPChartTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_analytics_page(self):
|
def test_analytics_page(self):
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ workout run
|
|||||||
""")
|
""")
|
||||||
m.save()
|
m.save()
|
||||||
a2 = 'media/mailbox_attachments/colin3.csv'
|
a2 = 'media/mailbox_attachments/colin3.csv'
|
||||||
copyfile('rowers/tests/testdata/emails/colin.csv',a2)
|
copy('rowers/tests/testdata/emails/colin.csv',a2)
|
||||||
a = MessageAttachment(message=m,document=a2[6:])
|
a = MessageAttachment(message=m,document=a2[6:])
|
||||||
a.save()
|
a.save()
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ workout run
|
|||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
try:
|
try:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
except (IOError,WindowsError):
|
except (IOError,WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -100,7 +100,7 @@ boattype: 4x
|
|||||||
""")
|
""")
|
||||||
m.save()
|
m.save()
|
||||||
a2 = 'media/mailbox_attachments/'+filename
|
a2 = 'media/mailbox_attachments/'+filename
|
||||||
copyfile(u'rowers/tests/testdata/emails/'+filename,a2)
|
copy(u'rowers/tests/testdata/emails/'+filename,a2)
|
||||||
a = MessageAttachment(message=m,document=a2[6:])
|
a = MessageAttachment(message=m,document=a2[6:])
|
||||||
a.save()
|
a.save()
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ workout water
|
|||||||
""")
|
""")
|
||||||
m.save()
|
m.save()
|
||||||
a2 = 'media/mailbox_attachments/colin2.csv'
|
a2 = 'media/mailbox_attachments/colin2.csv'
|
||||||
copyfile('rowers/tests/testdata/emails/colin.csv',a2)
|
copy('rowers/tests/testdata/emails/colin.csv',a2)
|
||||||
a = MessageAttachment(message=m,document=a2[6:])
|
a = MessageAttachment(message=m,document=a2[6:])
|
||||||
a.save()
|
a.save()
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ race 1
|
|||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
try:
|
try:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
except (IOError,WindowsError):
|
except (IOError,WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -191,7 +191,7 @@ race 1
|
|||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
try:
|
try:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
except (IOError,WindowsError):
|
except (IOError,WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
|
|||||||
@@ -777,7 +777,7 @@ boattype: 2x
|
|||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
try:
|
try:
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.tpstuff.requests.post', side_effect=mocked_requests)
|
@patch('rowers.tpstuff.requests.post', side_effect=mocked_requests)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class TrainingPlanTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_createplan(self):
|
def test_createplan(self):
|
||||||
@@ -209,7 +209,7 @@ class SessionLinkTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_plannedsessions(self):
|
def test_plannedsessions(self):
|
||||||
@@ -437,7 +437,7 @@ class SessionCompleteTest(TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
os.remove(self.w1.csvfilename)
|
os.remove(self.w1.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_session1_complete(self):
|
def test_session1_complete(self):
|
||||||
@@ -672,7 +672,7 @@ class ChallengeCompleteTest(TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
os.remove(self.w1.csvfilename)
|
os.remove(self.w1.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_challenge1_complete(self):
|
def test_challenge1_complete(self):
|
||||||
@@ -895,7 +895,7 @@ class MandatoryTestCompleteTest(TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
os.remove(self.w1.csvfilename)
|
os.remove(self.w1.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_mandatorytest1_complete(self):
|
def test_mandatorytest1_complete(self):
|
||||||
@@ -1216,7 +1216,7 @@ class PlannedSessionsView(TestCase):
|
|||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
try:
|
||||||
os.remove(self.w1.csvfilename)
|
os.remove(self.w1.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_clone_view(self):
|
def test_clone_view(self):
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class TrialsTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_basictrial(self):
|
def test_basictrial(self):
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class SimpleViewTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 1
|
plotnr = 1
|
||||||
@@ -80,7 +80,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 2
|
plotnr = 2
|
||||||
@@ -93,7 +93,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 3
|
plotnr = 3
|
||||||
@@ -106,7 +106,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 4
|
plotnr = 4
|
||||||
@@ -119,7 +119,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 5
|
plotnr = 5
|
||||||
@@ -132,7 +132,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 6
|
plotnr = 6
|
||||||
@@ -145,7 +145,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 7
|
plotnr = 7
|
||||||
@@ -158,7 +158,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 8
|
plotnr = 8
|
||||||
@@ -171,7 +171,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 13
|
plotnr = 13
|
||||||
@@ -184,7 +184,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.tasks.rdata')
|
@patch('rowers.tasks.rdata')
|
||||||
@@ -206,7 +206,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 1
|
plotnr = 1
|
||||||
@@ -219,7 +219,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 2
|
plotnr = 2
|
||||||
@@ -232,7 +232,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 3
|
plotnr = 3
|
||||||
@@ -245,7 +245,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 4
|
plotnr = 4
|
||||||
@@ -258,7 +258,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 5
|
plotnr = 5
|
||||||
@@ -271,7 +271,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 6
|
plotnr = 6
|
||||||
@@ -284,7 +284,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 7
|
plotnr = 7
|
||||||
@@ -297,7 +297,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 8
|
plotnr = 8
|
||||||
@@ -310,7 +310,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 9
|
plotnr = 9
|
||||||
@@ -323,7 +323,7 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
plotnr = 13
|
plotnr = 13
|
||||||
@@ -336,5 +336,5 @@ class PlotTests(TestCase):
|
|||||||
filename=fullpathimagename)
|
filename=fullpathimagename)
|
||||||
try:
|
try:
|
||||||
os.remove(fullpathimagename)
|
os.remove(fullpathimagename)
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class TeamTest(TestCase):
|
|||||||
for csvfilename in self.csvfilenames:
|
for csvfilename in self.csvfilenames:
|
||||||
try:
|
try:
|
||||||
os.remove(csvfilename)
|
os.remove(csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_manager_drop_member(self):
|
def test_manager_drop_member(self):
|
||||||
@@ -288,7 +288,7 @@ class TeamTestLowLevel(TestCase):
|
|||||||
for csvfilename in self.csvfilenames:
|
for csvfilename in self.csvfilenames:
|
||||||
try:
|
try:
|
||||||
os.remove(csvfilename)
|
os.remove(csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_lowlevel_update_team(self):
|
def test_lowlevel_update_team(self):
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -283,7 +283,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -320,7 +320,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -357,7 +357,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -396,7 +396,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -432,7 +432,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -469,7 +469,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -508,7 +508,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -543,7 +543,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -576,7 +576,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -609,7 +609,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -642,7 +642,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@@ -676,7 +676,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -708,7 +708,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -740,7 +740,7 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@patch('rowers.dataprep.create_engine')
|
@patch('rowers.dataprep.create_engine')
|
||||||
@@ -772,6 +772,6 @@ class ViewTest(TestCase):
|
|||||||
f_to_be_deleted = w.csvfilename
|
f_to_be_deleted = w.csvfilename
|
||||||
try:
|
try:
|
||||||
os.remove(f_to_be_deleted+'.gz')
|
os.remove(f_to_be_deleted+'.gz')
|
||||||
except WindowsError:
|
except (WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class UserPreferencesTest(TestCase):
|
|||||||
for workout in self.user_workouts:
|
for workout in self.user_workouts:
|
||||||
try:
|
try:
|
||||||
os.remove(workout.csvfilename)
|
os.remove(workout.csvfilename)
|
||||||
except (IOError, WindowsError):
|
except (IOError, WindowsError,OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_accountsettings(self):
|
def test_accountsettings(self):
|
||||||
|
|||||||
+1
File diff suppressed because one or more lines are too long
+72497
File diff suppressed because it is too large
Load Diff
BIN
Binary file not shown.
+1
-1
@@ -257,7 +257,7 @@ urlpatterns = [
|
|||||||
url(r'^workout/upload/team/$',views.team_workout_upload_view,name='team_workout_upload_view'),
|
url(r'^workout/upload/team/$',views.team_workout_upload_view,name='team_workout_upload_view'),
|
||||||
url(r'^workout/upload/$',views.workout_upload_view,name='workout_upload_view'),
|
url(r'^workout/upload/$',views.workout_upload_view,name='workout_upload_view'),
|
||||||
url(r'^workout/(?P<id>\d+)/histo/$',views.workout_histo_view,name='workout_histo_view'),
|
url(r'^workout/(?P<id>\d+)/histo/$',views.workout_histo_view,name='workout_histo_view'),
|
||||||
url(r'^workout/(?P<id>\d+)/task/$',views.workout_test_task_view),
|
# url(r'^workout/(?P<id>\d+)/task/$',views.workout_test_task_view),
|
||||||
url(r'^workout/(?P<id>\d+)/forcecurve/$',views.workout_forcecurve_view,name='workout_forcecurve_view'),
|
url(r'^workout/(?P<id>\d+)/forcecurve/$',views.workout_forcecurve_view,name='workout_forcecurve_view'),
|
||||||
url(r'^workout/(?P<id>\d+)/unsubscribe/$',views.workout_unsubscribe_view,name='workout_unsubscribe_view'),
|
url(r'^workout/(?P<id>\d+)/unsubscribe/$',views.workout_unsubscribe_view,name='workout_unsubscribe_view'),
|
||||||
# url(r'^workout/(?P<id>\d+)/export/$',views.workout_export_view),
|
# url(r'^workout/(?P<id>\d+)/export/$',views.workout_export_view),
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -67,17 +67,17 @@ def workout_forcecurve_view(request,id=0,workstrokesonly=False):
|
|||||||
})
|
})
|
||||||
|
|
||||||
# Test asynchronous tasking and messaging
|
# Test asynchronous tasking and messaging
|
||||||
@login_required()
|
#@login_required()
|
||||||
def workout_test_task_view(request,id=0):
|
#def workout_test_task_view(request,id=0):
|
||||||
row = Workout.objects.get(id=id)
|
# row = Workout.objects.get(id=id)
|
||||||
res = myqueue(queuehigh,addcomment2,request.user.id,row.id)
|
# res = myqueue(queuehigh,addcomment2,request.user.id,row.id)#
|
||||||
|
#
|
||||||
|
#
|
||||||
url = reverse('workout_edit_view',
|
# url = reverse('workout_edit_view',
|
||||||
kwargs = {
|
# kwargs = {
|
||||||
'id':int(id),
|
# 'id':int(id),
|
||||||
})
|
# })
|
||||||
return HttpResponseRedirect(url)
|
# return HttpResponseRedirect(url)
|
||||||
|
|
||||||
# Show Stroke power histogram for a workout
|
# Show Stroke power histogram for a workout
|
||||||
@login_required()
|
@login_required()
|
||||||
|
|||||||
+1
-1
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ INSTALLED_APPS = [
|
|||||||
'leaflet',
|
'leaflet',
|
||||||
'django_rq',
|
'django_rq',
|
||||||
'django_rq_dashboard',
|
'django_rq_dashboard',
|
||||||
'translation_manager',
|
# 'translation_manager',
|
||||||
'django_mailbox',
|
'django_mailbox',
|
||||||
'rest_framework',
|
'rest_framework',
|
||||||
'datetimewidget',
|
'datetimewidget',
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ urlpatterns += [
|
|||||||
{'next_page': '/'},
|
{'next_page': '/'},
|
||||||
name='logout',),
|
name='logout',),
|
||||||
url(r'^rowers/',include('rowers.urls')),
|
url(r'^rowers/',include('rowers.urls')),
|
||||||
url(r'^cvkbrno/',include('cvkbrno.urls')),
|
# url(r'^cvkbrno/',include('cvkbrno.urls')),
|
||||||
url(r'^admin/rq/',include('django_rq_dashboard.urls')),
|
url(r'^admin/rq/',include('django_rq_dashboard.urls')),
|
||||||
url(r'^call\_back',rowersviews.rower_process_callback),
|
url(r'^call\_back',rowersviews.rower_process_callback),
|
||||||
url(r'^stravacall\_back',rowersviews.rower_process_stravacallback),
|
url(r'^stravacall\_back',rowersviews.rower_process_stravacallback),
|
||||||
@@ -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,}
|
||||||
|
)
|
||||||
|
]
|
||||||
|
|||||||
@@ -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
|
||||||
+202
-202
@@ -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.
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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;
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-4
@@ -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;
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-5
@@ -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;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
@@ -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> </strong></div></div></td>' +
|
'<td class="timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong> </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> </strong></div></div></td>' +
|
'<td class="timeline"><div class="djDebugTimeline"><div class="djDebugLineChart"><strong> </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);
|
||||||
|
|||||||
+8068
-8068
File diff suppressed because it is too large
Load Diff
+624
-624
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
+33
-33
@@ -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),
|
||||||
|
|||||||
+263
-263
@@ -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;
|
||||||
}));
|
}));
|
||||||
|
|||||||
@@ -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){
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user