Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Add layers now in

Mike McGann05c6dbfd5b7a
diff --git a/etc/config/config/aoi/geographic/Air Quality.json b/etc/config/config/aoi/Air Quality.json
similarity index 95%
rename from etc/config/config/aoi/geographic/Air Quality.json
rename to etc/config/config/aoi/Air Quality.json
index f101b33d6..92e455313 100644
--- a/etc/config/config/aoi/geographic/Air Quality.json
+++ b/etc/config/config/aoi/Air Quality.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Ash Plumes.json b/etc/config/config/aoi/Ash Plumes.json
similarity index 96%
rename from etc/config/config/aoi/geographic/Ash Plumes.json
rename to etc/config/config/aoi/Ash Plumes.json
index 1d443c621..cc12f662c 100644
--- a/etc/config/config/aoi/geographic/Ash Plumes.json
+++ b/etc/config/config/aoi/Ash Plumes.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Drought.json b/etc/config/config/aoi/Drought.json
similarity index 94%
rename from etc/config/config/aoi/geographic/Drought.json
rename to etc/config/config/aoi/Drought.json
index 28f94b828..922193c15 100644
--- a/etc/config/config/aoi/geographic/Drought.json
+++ b/etc/config/config/aoi/Drought.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Dust Storms.json b/etc/config/config/aoi/Dust Storms.json
similarity index 95%
rename from etc/config/config/aoi/geographic/Dust Storms.json
rename to etc/config/config/aoi/Dust Storms.json
index 5f82fd462..01fa1c394 100644
--- a/etc/config/config/aoi/geographic/Dust Storms.json
+++ b/etc/config/config/aoi/Dust Storms.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Featured.json b/etc/config/config/aoi/Featured.json
similarity index 94%
rename from etc/config/config/aoi/geographic/Featured.json
rename to etc/config/config/aoi/Featured.json
index a475fa211..3d37c1523 100644
--- a/etc/config/config/aoi/geographic/Featured.json
+++ b/etc/config/config/aoi/Featured.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Fires.json b/etc/config/config/aoi/Fires.json
similarity index 95%
rename from etc/config/config/aoi/geographic/Fires.json
rename to etc/config/config/aoi/Fires.json
index 0634a4838..eb87617e1 100644
--- a/etc/config/config/aoi/geographic/Fires.json
+++ b/etc/config/config/aoi/Fires.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Floods.json b/etc/config/config/aoi/Floods.json
similarity index 94%
rename from etc/config/config/aoi/geographic/Floods.json
rename to etc/config/config/aoi/Floods.json
index 4ddc2b400..dfe88fc01 100644
--- a/etc/config/config/aoi/geographic/Floods.json
+++ b/etc/config/config/aoi/Floods.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Other.json b/etc/config/config/aoi/Other.json
similarity index 94%
rename from etc/config/config/aoi/geographic/Other.json
rename to etc/config/config/aoi/Other.json
index 448552295..267cac1df 100644
--- a/etc/config/config/aoi/geographic/Other.json
+++ b/etc/config/config/aoi/Other.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"VIIRS_CityLights_2012"
],
diff --git a/etc/config/config/aoi/geographic/Severe Storms.json b/etc/config/config/aoi/Severe Storms.json
similarity index 98%
rename from etc/config/config/aoi/geographic/Severe Storms.json
rename to etc/config/config/aoi/Severe Storms.json
index 2f4dc9766..d9dfe140b 100644
--- a/etc/config/config/aoi/geographic/Severe Storms.json
+++ b/etc/config/config/aoi/Severe Storms.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Shipping.json b/etc/config/config/aoi/Shipping.json
similarity index 94%
rename from etc/config/config/aoi/geographic/Shipping.json
rename to etc/config/config/aoi/Shipping.json
index 8c5220ede..ce7a2ee58 100644
--- a/etc/config/config/aoi/geographic/Shipping.json
+++ b/etc/config/config/aoi/Shipping.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Smoke Plumes.json b/etc/config/config/aoi/Smoke Plumes.json
similarity index 96%
rename from etc/config/config/aoi/geographic/Smoke Plumes.json
rename to etc/config/config/aoi/Smoke Plumes.json
index a7118e7ca..f4cb92c94 100644
--- a/etc/config/config/aoi/geographic/Smoke Plumes.json
+++ b/etc/config/config/aoi/Smoke Plumes.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/geographic/Vegetation.json b/etc/config/config/aoi/Vegetation.json
similarity index 93%
rename from etc/config/config/aoi/geographic/Vegetation.json
rename to etc/config/config/aoi/Vegetation.json
index cbac880e3..e1b345bf3 100644
--- a/etc/config/config/aoi/geographic/Vegetation.json
+++ b/etc/config/config/aoi/Vegetation.json
@@ -1,4 +1,5 @@
{
+ "projections": [ "geographic" ],
"baselayers": [
"MODIS_Terra_CorrectedReflectance_TrueColor",
"MODIS_Aqua_CorrectedReflectance_TrueColor",
diff --git a/etc/config/config/aoi/antarctic/All.json b/etc/config/config/aoi/antarctic/All.json
deleted file mode 100644
index cf4215ba6..000000000
--- a/etc/config/config/aoi/antarctic/All.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_CorrectedReflectance_Bands367",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Sea_Ice",
- "MODIS_Aqua_Sea_Ice",
- "MODIS_Terra_Snow_Cover",
- "MODIS_Aqua_Snow_Cover",
- "MODIS_Terra_Brightness_Temp_Band31_Day",
- "MODIS_Terra_Brightness_Temp_Band31_Night",
- "MODIS_Aqua_Brightness_Temp_Band31_Day",
- "MODIS_Aqua_Brightness_Temp_Band31_Night",
- "antarctic_coastlines",
- "land_mask",
- "polarview:graticule3031_10x30",
- "Terra_Antarctic_Orbit_Asc",
- "Terra_Antarctic_Orbit_Dsc",
- "Aqua_Antarctic_Orbit_Asc",
- "Aqua_Antarctic_Orbit_Dsc",
- "Aura_Antarctic_Orbit_Asc",
- "Aura_Antarctic_Orbit_Dsc"
- ]
-}
\ No newline at end of file
diff --git a/etc/config/config/aoi/arctic/All.json b/etc/config/config/aoi/arctic/All.json
deleted file mode 100644
index 6ef3c6c1f..000000000
--- a/etc/config/config/aoi/arctic/All.json
+++ /dev/null
@@ -1,34 +0,0 @@
-{
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_CorrectedReflectance_Bands367",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Sea_Ice",
- "MODIS_Aqua_Sea_Ice",
- "MODIS_Terra_Snow_Cover",
- "MODIS_Aqua_Snow_Cover",
- "MODIS_Terra_Brightness_Temp_Band31_Day",
- "MODIS_Terra_Brightness_Temp_Band31_Night",
- "MODIS_Aqua_Brightness_Temp_Band31_Day",
- "MODIS_Aqua_Brightness_Temp_Band31_Night",
- "grump-v1-population-count_2000",
- "arctic_coastlines_3413",
- "arctic_coastlines",
- "land_mask",
- "cartographic:00-global-labels",
- "arctic_graticule_3413",
- "polarview:graticuleN",
- "Terra_Arctic_Orbit_Asc",
- "Terra_Arctic_Orbit_Dsc",
- "Aqua_Arctic_Orbit_Asc",
- "Aqua_Arctic_Orbit_Dsc",
- "Aura_Arctic_Orbit_Asc",
- "Aura_Arctic_Orbit_Dsc"
- ]
-}
-
diff --git a/etc/config/config/aoi/geographic/make.py b/etc/config/config/aoi/geographic/make.py
deleted file mode 100644
index aedc4b649..000000000
--- a/etc/config/config/aoi/geographic/make.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-
-import json
-
-with open('/Users/jmcgann/Code/Aptana/worldview/src/data/geographic_ap_products.json') as infile:
- config = json.load(infile)
-
-for cat in config:
- print cat
- newconfig = {"baselayers": [], "overlays": []}
- for item in config[cat]:
- newconfig[item["category"]] += [item["value"]]
- print newconfig
-
- with open(cat + ".json", "w") as outfile:
- json.dump(newconfig, outfile, indent=4, separators=(',', ': '), sort_keys=True)
-
-
-
-
diff --git a/etc/config/config/aoi/geographic/All.json b/etc/config/config/layerOrder.json
similarity index 89%
rename from etc/config/config/aoi/geographic/All.json
rename to etc/config/config/layerOrder.json
index db2ccd97b..bedc230a7 100644
--- a/etc/config/config/aoi/geographic/All.json
+++ b/etc/config/config/layerOrder.json
@@ -113,17 +113,35 @@
"gpw-v3-coastlines",
"cartographic:00-global-labels",
"sedac_bound",
+ "antarctic_coastlines",
+ "arctic_coastlines_3413",
+ "arctic_coastlines",
"grump-v1-population-count_2000",
+ "polarview:graticule3031_10x30",
"ol_graticule",
+ "arctic_graticule_3413",
+ "polarview:graticuleN",
"MODIS_Water_Mask",
"MODIS_Terra_Data_No_Data",
"MODIS_Aqua_Data_No_Data",
"Terra_Orbit_Asc",
"Terra_Orbit_Dsc",
+ "Terra_Antarctic_Orbit_Asc",
+ "Terra_Antarctic_Orbit_Dsc",
+ "Terra_Arctic_Orbit_Asc",
+ "Terra_Arctic_Orbit_Dsc",
"Aqua_Orbit_Asc",
"Aqua_Orbit_Dsc",
+ "Aqua_Antarctic_Orbit_Asc",
+ "Aqua_Antarctic_Orbit_Dsc",
+ "Aqua_Arctic_Orbit_Asc",
+ "Aqua_Arctic_Orbit_Dsc",
"Aura_Orbit_Asc",
"Aura_Orbit_Dsc",
+ "Aura_Antarctic_Orbit_Asc",
+ "Aura_Antarctic_Orbit_Dsc",
+ "Aura_Arctic_Orbit_Asc",
+ "Aura_Arctic_Orbit_Dsc",
"Calipso_Orbit_Asc",
"Calipso_Orbit_Dsc"
]
diff --git a/etc/config/config/projections/antarctic.json b/etc/config/config/projections/antarctic.json
index 44f228139..66f6478a4 100644
--- a/etc/config/config/projections/antarctic.json
+++ b/etc/config/config/projections/antarctic.json
@@ -8,6 +8,7 @@
],
"name": "antarctic",
"numZoomLevels": 6,
+ "epsg": 3031,
"crs": "EPSG:3031",
"resolutions": [
8192.0,
diff --git a/etc/config/config/projections/arctic.json b/etc/config/config/projections/arctic.json
index b5aa56fe2..93d512f26 100644
--- a/etc/config/config/projections/arctic.json
+++ b/etc/config/config/projections/arctic.json
@@ -7,6 +7,7 @@
],
"name": "arctic",
"numZoomLevels": 6,
+ "epsg": 3413,
"crs": "EPSG:3413",
"resolutions": [
8192.0,
diff --git a/etc/config/config/projections/arctic3995.json b/etc/config/config/projections/arctic3995.json
index 69cd06ef6..7fb656f5b 100644
--- a/etc/config/config/projections/arctic3995.json
+++ b/etc/config/config/projections/arctic3995.json
@@ -1,5 +1,6 @@
{
"name": "arctic",
+ "epsg": 3995,
"crs": "EPSG:3995",
"virtual": "true"
}
\ No newline at end of file
diff --git a/etc/config/config/projections/geographic.json b/etc/config/config/projections/geographic.json
index 722dd2842..f6624a18a 100644
--- a/etc/config/config/projections/geographic.json
+++ b/etc/config/config/projections/geographic.json
@@ -7,6 +7,7 @@
],
"name": "geographic",
"numZoomLevels": 9,
+ "epsg": 4326,
"crs": "EPSG:4326",
"resolutions": [
0.5625,
diff --git a/src/data/config.json b/src/data/config.json
index 1a8eb035a..e45e9fe7f 100644
--- a/src/data/config.json
+++ b/src/data/config.json
@@ -1,508 +1,346 @@
{
"aoi": {
- "antarctic": {
- "All": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_CorrectedReflectance_Bands367",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Sea_Ice",
- "MODIS_Aqua_Sea_Ice",
- "MODIS_Terra_Snow_Cover",
- "MODIS_Aqua_Snow_Cover",
- "MODIS_Terra_Brightness_Temp_Band31_Day",
- "MODIS_Terra_Brightness_Temp_Band31_Night",
- "MODIS_Aqua_Brightness_Temp_Band31_Day",
- "MODIS_Aqua_Brightness_Temp_Band31_Night",
- "antarctic_coastlines",
- "land_mask",
- "polarview:graticule3031_10x30",
- "Terra_Antarctic_Orbit_Asc",
- "Terra_Antarctic_Orbit_Dsc",
- "Aqua_Antarctic_Orbit_Asc",
- "Aqua_Antarctic_Orbit_Dsc",
- "Aura_Antarctic_Orbit_Asc",
- "Aura_Antarctic_Orbit_Dsc"
- ]
- }
+ "Air Quality": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Aerosol",
+ "MODIS_Aqua_Aerosol",
+ "MODIS_Combined_Value_Added_AOD",
+ "AIRS_CO_Total_Column_Day",
+ "AIRS_CO_Total_Column_Night",
+ "MLS_CO_215hPa_Day",
+ "MLS_CO_215hPa_Night",
+ "AIRS_Prata_SO2_Index_Day",
+ "AIRS_Prata_SO2_Index_Night",
+ "MLS_SO2_147hPa_Day",
+ "MLS_SO2_147hPa_Night",
+ "OMI_Aerosol_Index",
+ "OMI_Aerosol_Optical_Depth",
+ "OMI_Absorbing_Aerosol_Optical_Depth",
+ "OMI_SO2_Planetary_Boundary_Layer",
+ "OMI_SO2_Lower_Troposphere",
+ "OMI_SO2_Middle_Troposphere",
+ "OMI_SO2_Upper_Troposphere_and_Stratosphere",
+ "land_mask"
+ ],
+ "projections": [
+ "geographic"
+ ]
},
- "arctic": {
- "All": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_CorrectedReflectance_Bands367",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Sea_Ice",
- "MODIS_Aqua_Sea_Ice",
- "MODIS_Terra_Snow_Cover",
- "MODIS_Aqua_Snow_Cover",
- "MODIS_Terra_Brightness_Temp_Band31_Day",
- "MODIS_Terra_Brightness_Temp_Band31_Night",
- "MODIS_Aqua_Brightness_Temp_Band31_Day",
- "MODIS_Aqua_Brightness_Temp_Band31_Night",
- "grump-v1-population-count_2000",
- "arctic_coastlines_3413",
- "arctic_coastlines",
- "land_mask",
- "cartographic:00-global-labels",
- "arctic_graticule_3413",
- "polarview:graticuleN",
- "Terra_Arctic_Orbit_Asc",
- "Terra_Arctic_Orbit_Dsc",
- "Aqua_Arctic_Orbit_Asc",
- "Aqua_Arctic_Orbit_Dsc",
- "Aura_Arctic_Orbit_Asc",
- "Aura_Arctic_Orbit_Dsc"
- ]
- }
+ "Ash Plumes": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands143",
+ "MODIS_Aqua_SurfaceReflectance_Bands143",
+ "MODIS_Terra_CorrectedReflectance_Bands721",
+ "MODIS_Aqua_CorrectedReflectance_Bands721",
+ "MODIS_Terra_SurfaceReflectance_Bands721",
+ "MODIS_Aqua_SurfaceReflectance_Bands721",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Aerosol",
+ "MODIS_Aqua_Aerosol",
+ "MODIS_Combined_Value_Added_AOD",
+ "AIRS_Prata_SO2_Index_Day",
+ "AIRS_Prata_SO2_Index_Night",
+ "OMI_SO2_Planetary_Boundary_Layer",
+ "OMI_SO2_Lower_Troposphere",
+ "OMI_SO2_Middle_Troposphere",
+ "OMI_SO2_Upper_Troposphere_and_Stratosphere",
+ "MLS_SO2_147hPa_Day",
+ "MLS_SO2_147hPa_Night",
+ "land_mask",
+ "ndh-volcano-hazard-frequency-distribution",
+ "ndh-volcano-mortality-risks-distribution",
+ "ndh-volcano-proportional-economic-loss-risk-deciles"
+ ],
+ "projections": [
+ "geographic"
+ ]
},
- "geographic": {
- "Air Quality": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Aerosol",
- "MODIS_Aqua_Aerosol",
- "MODIS_Combined_Value_Added_AOD",
- "AIRS_CO_Total_Column_Day",
- "AIRS_CO_Total_Column_Night",
- "MLS_CO_215hPa_Day",
- "MLS_CO_215hPa_Night",
- "AIRS_Prata_SO2_Index_Day",
- "AIRS_Prata_SO2_Index_Night",
- "MLS_SO2_147hPa_Day",
- "MLS_SO2_147hPa_Night",
- "OMI_Aerosol_Index",
- "OMI_Aerosol_Optical_Depth",
- "OMI_Absorbing_Aerosol_Optical_Depth",
- "OMI_SO2_Planetary_Boundary_Layer",
- "OMI_SO2_Lower_Troposphere",
- "OMI_SO2_Middle_Troposphere",
- "OMI_SO2_Upper_Troposphere_and_Stratosphere",
- "land_mask"
- ]
- },
- "All": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands143",
- "MODIS_Aqua_SurfaceReflectance_Bands143",
- "MODIS_Terra_SurfaceReflectance_Bands121",
- "MODIS_Aqua_SurfaceReflectance_Bands121",
- "MODIS_Terra_CorrectedReflectance_Bands367",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "MODIS_Terra_SurfaceReflectance_Bands721",
- "MODIS_Aqua_SurfaceReflectance_Bands721",
- "VIIRS_CityLights_2012",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Aerosol",
- "MODIS_Aqua_Aerosol",
- "MODIS_Combined_Value_Added_AOD",
- "MODIS_Terra_Brightness_Temp_Band31_Day",
- "MODIS_Terra_Brightness_Temp_Band31_Night",
- "MODIS_Aqua_Brightness_Temp_Band31_Day",
- "MODIS_Aqua_Brightness_Temp_Band31_Night",
- "MODIS_Terra_Chlorophyll_A",
- "MODIS_Aqua_Chlorophyll_A",
- "MODIS_Terra_Cloud_Top_Pressure_Day",
- "MODIS_Terra_Cloud_Top_Pressure_Night",
- "MODIS_Aqua_Cloud_Top_Pressure_Day",
- "MODIS_Aqua_Cloud_Top_Pressure_Night",
- "MODIS_Terra_Cloud_Top_Temp_Day",
- "MODIS_Terra_Cloud_Top_Temp_Night",
- "MODIS_Aqua_Cloud_Top_Temp_Day",
- "MODIS_Aqua_Cloud_Top_Temp_Night",
- "MODIS_Fires_All",
- "MODIS_Fires_Terra",
- "MODIS_Fires_Aqua",
- "MODIS_Terra_Land_Surface_Temp_Day",
- "MODIS_Terra_Land_Surface_Temp_Night",
- "MODIS_Aqua_Land_Surface_Temp_Day",
- "MODIS_Aqua_Land_Surface_Temp_Night",
- "MODIS_Terra_Sea_Ice",
- "MODIS_Aqua_Sea_Ice",
- "MODIS_Terra_Snow_Cover",
- "MODIS_Aqua_Snow_Cover",
- "MODIS_Terra_Water_Vapor_5km_Day",
- "MODIS_Terra_Water_Vapor_5km_Night",
- "MODIS_Aqua_Water_Vapor_5km_Day",
- "MODIS_Aqua_Water_Vapor_5km_Night",
- "AIRS_CO_Total_Column_Day",
- "AIRS_CO_Total_Column_Night",
- "AIRS_Dust_Score",
- "AIRS_Precipitation_Day",
- "AIRS_Precipitation_Night",
- "AIRS_Prata_SO2_Index_Day",
- "AIRS_Prata_SO2_Index_Night",
- "AIRS_RelativeHumidity_400hPa_Day",
- "AIRS_RelativeHumidity_400hPa_Night",
- "AIRS_RelativeHumidity_500hPa_Day",
- "AIRS_RelativeHumidity_500hPa_Night",
- "AIRS_RelativeHumidity_600hPa_Day",
- "AIRS_RelativeHumidity_600hPa_Night",
- "AIRS_RelativeHumidity_700hPa_Day",
- "AIRS_RelativeHumidity_700hPa_Night",
- "AIRS_RelativeHumidity_850hPa_Day",
- "AIRS_RelativeHumidity_850hPa_Night",
- "AIRS_Temperature_400hPa_Day",
- "AIRS_Temperature_400hPa_Night",
- "AIRS_Temperature_500hPa_Day",
- "AIRS_Temperature_500hPa_Night",
- "AIRS_Temperature_600hPa_Day",
- "AIRS_Temperature_600hPa_Night",
- "AIRS_Temperature_700hPa_Day",
- "AIRS_Temperature_700hPa_Night",
- "AIRS_Temperature_850hPa_Day",
- "AIRS_Temperature_850hPa_Night",
- "OMI_Absorbing_Aerosol_Optical_Depth",
- "OMI_Aerosol_Index",
- "OMI_Aerosol_Optical_Depth",
- "OMI_Cloud_Pressure",
- "OMI_SO2_Planetary_Boundary_Layer",
- "OMI_SO2_Lower_Troposphere",
- "OMI_SO2_Middle_Troposphere",
- "OMI_SO2_Upper_Troposphere_and_Stratosphere",
- "MLS_CO_215hPa_Day",
- "MLS_CO_215hPa_Night",
- "MLS_HNO3_46hPa_Day",
- "MLS_HNO3_46hPa_Night",
- "MLS_N2O_46hPa_Day",
- "MLS_N2O_46hPa_Night",
- "MLS_O3_46hPa_Day",
- "MLS_O3_46hPa_Night",
- "MLS_SO2_147hPa_Day",
- "MLS_SO2_147hPa_Night",
- "MLS_Temperature_46hPa_Day",
- "MLS_Temperature_46hPa_Night",
- "MLS_H2O_46hPa_Day",
- "MLS_H2O_46hPa_Night",
- "land_mask",
- "ndh-cyclone-hazard-frequency-distribution",
- "ndh-cyclone-mortality-risks-distribution",
- "ndh-cyclone-proportional-economic-loss-risk-deciles",
- "ndh-drought-hazard-frequency-distribution",
- "ndh-drought-mortality-risks-distribution",
- "ndh-drought-proportional-economic-loss-risk-deciles",
- "ndh-flood-hazard-frequency-distribution",
- "ndh-flood-mortality-risks-distribution",
- "ndh-flood-proportional-economic-loss-risk-deciles",
- "ndh-volcano-hazard-frequency-distribution",
- "ndh-volcano-mortality-risks-distribution",
- "ndh-volcano-proportional-economic-loss-risk-deciles",
- "cartographic:esri-administrative-boundaries_level-1",
- "gpw-v3-coastlines",
- "cartographic:00-global-labels",
- "sedac_bound",
- "grump-v1-population-count_2000",
- "ol_graticule",
- "MODIS_Water_Mask",
- "MODIS_Terra_Data_No_Data",
- "MODIS_Aqua_Data_No_Data",
- "Terra_Orbit_Asc",
- "Terra_Orbit_Dsc",
- "Aqua_Orbit_Asc",
- "Aqua_Orbit_Dsc",
- "Aura_Orbit_Asc",
- "Aura_Orbit_Dsc",
- "Calipso_Orbit_Asc",
- "Calipso_Orbit_Dsc"
- ]
- },
- "Ash Plumes": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands143",
- "MODIS_Aqua_SurfaceReflectance_Bands143",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "MODIS_Terra_SurfaceReflectance_Bands721",
- "MODIS_Aqua_SurfaceReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Aerosol",
- "MODIS_Aqua_Aerosol",
- "MODIS_Combined_Value_Added_AOD",
- "AIRS_Prata_SO2_Index_Day",
- "AIRS_Prata_SO2_Index_Night",
- "OMI_SO2_Planetary_Boundary_Layer",
- "OMI_SO2_Lower_Troposphere",
- "OMI_SO2_Middle_Troposphere",
- "OMI_SO2_Upper_Troposphere_and_Stratosphere",
- "MLS_SO2_147hPa_Day",
- "MLS_SO2_147hPa_Night",
- "land_mask",
- "ndh-volcano-hazard-frequency-distribution",
- "ndh-volcano-mortality-risks-distribution",
- "ndh-volcano-proportional-economic-loss-risk-deciles"
- ]
- },
- "Drought": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands121",
- "MODIS_Aqua_SurfaceReflectance_Bands121",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Snow_Cover",
- "MODIS_Aqua_Snow_Cover",
- "AIRS_Precipitation_Day",
- "AIRS_Precipitation_Night",
- "land_mask",
- "ndh-drought-hazard-frequency-distribution",
- "ndh-drought-mortality-risks-distribution",
- "ndh-drought-proportional-economic-loss-risk-deciles"
- ]
- },
- "Dust Storms": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands143",
- "MODIS_Aqua_SurfaceReflectance_Bands143",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "MODIS_Terra_SurfaceReflectance_Bands721",
- "MODIS_Aqua_SurfaceReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Aerosol",
- "MODIS_Aqua_Aerosol",
- "MODIS_Combined_Value_Added_AOD",
- "AIRS_Dust_Score",
- "OMI_Aerosol_Index",
- "OMI_Aerosol_Optical_Depth",
- "OMI_Absorbing_Aerosol_Optical_Depth"
- ]
- },
- "Featured": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "VIIRS_CityLights_2012",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Land_Surface_Temp_Day",
- "MODIS_Terra_Land_Surface_Temp_Night",
- "MODIS_Fires_All",
- "MODIS_Terra_Aerosol",
- "AIRS_Dust_Score",
- "MODIS_Terra_Snow_Cover",
- "MODIS_Terra_Sea_Ice",
- "Terra_Orbit_Asc",
- "Terra_Orbit_Dsc",
- "sedac_bound",
- "cartographic:esri-administrative-boundaries_level-1",
- "grump-v1-population-count_2000"
- ]
- },
- "Fires": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands721",
- "MODIS_Aqua_SurfaceReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Fires_All",
- "MODIS_Fires_Terra",
- "MODIS_Fires_Aqua",
- "MODIS_Terra_Aerosol",
- "MODIS_Aqua_Aerosol",
- "MODIS_Combined_Value_Added_AOD",
- "MODIS_Terra_Land_Surface_Temp_Day",
- "MODIS_Terra_Land_Surface_Temp_Night",
- "MODIS_Aqua_Land_Surface_Temp_Day",
- "MODIS_Aqua_Land_Surface_Temp_Night",
- "AIRS_CO_Total_Column_Day",
- "AIRS_CO_Total_Column_Night",
- "OMI_Aerosol_Index",
- "OMI_Aerosol_Optical_Depth",
- "OMI_Absorbing_Aerosol_Optical_Depth"
- ]
- },
- "Floods": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands121",
- "MODIS_Aqua_SurfaceReflectance_Bands121",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "AIRS_Precipitation_Day",
- "AIRS_Precipitation_Night",
- "MODIS_Water_Mask",
- "land_mask",
- "ndh-flood-hazard-frequency-distribution",
- "ndh-flood-mortality-risks-distribution",
- "ndh-flood-proportional-economic-loss-risk-deciles"
- ]
- },
- "Other": {
- "baselayers": [
- "VIIRS_CityLights_2012"
- ],
- "overlays": [
- "grump-v1-population-count_2000",
- "cartographic:esri-administrative-boundaries_level-1",
- "sedac_bound",
- "gpw-v3-coastlines",
- "cartographic:00-global-labels",
- "ol_graticule",
- "MODIS_Water_Mask",
- "MODIS_Terra_Data_No_Data",
- "MODIS_Aqua_Data_No_Data",
- "Terra_Orbit_Asc",
- "Terra_Orbit_Dsc",
- "Aqua_Orbit_Asc",
- "Aqua_Orbit_Dsc",
- "Aura_Orbit_Asc",
- "Aura_Orbit_Dsc",
- "Calipso_Orbit_Asc",
- "Calipso_Orbit_Dsc"
- ]
- },
- "Severe Storms": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Water_Vapor_5km_Day",
- "MODIS_Terra_Water_Vapor_5km_Night",
- "MODIS_Aqua_Water_Vapor_5km_Day",
- "MODIS_Aqua_Water_Vapor_5km_Night",
- "MODIS_Terra_Cloud_Top_Temp_Day",
- "MODIS_Terra_Cloud_Top_Temp_Night",
- "MODIS_Aqua_Cloud_Top_Temp_Day",
- "MODIS_Aqua_Cloud_Top_Temp_Night",
- "MODIS_Terra_Cloud_Top_Pressure_Day",
- "MODIS_Terra_Cloud_Top_Pressure_Night",
- "MODIS_Aqua_Cloud_Top_Pressure_Day",
- "MODIS_Aqua_Cloud_Top_Pressure_Night",
- "AIRS_Precipitation_Day",
- "AIRS_Precipitation_Night",
- "AIRS_RelativeHumidity_400hPa_Day",
- "AIRS_RelativeHumidity_400hPa_Night",
- "AIRS_RelativeHumidity_500hPa_Day",
- "AIRS_RelativeHumidity_500hPa_Night",
- "AIRS_RelativeHumidity_600hPa_Day",
- "AIRS_RelativeHumidity_600hPa_Night",
- "AIRS_RelativeHumidity_700hPa_Day",
- "AIRS_RelativeHumidity_700hPa_Night",
- "AIRS_RelativeHumidity_850hPa_Day",
- "AIRS_RelativeHumidity_850hPa_Night",
- "AIRS_Temperature_400hPa_Day",
- "AIRS_Temperature_400hPa_Night",
- "AIRS_Temperature_500hPa_Day",
- "AIRS_Temperature_500hPa_Night",
- "AIRS_Temperature_600hPa_Day",
- "AIRS_Temperature_600hPa_Night",
- "AIRS_Temperature_700hPa_Day",
- "AIRS_Temperature_700hPa_Night",
- "AIRS_Temperature_850hPa_Day",
- "AIRS_Temperature_850hPa_Night",
- "OMI_Cloud_Pressure",
- "land_mask",
- "ndh-cyclone-hazard-frequency-distribution",
- "ndh-cyclone-mortality-risks-distribution",
- "ndh-cyclone-proportional-economic-loss-risk-deciles",
- "ndh-flood-hazard-frequency-distribution",
- "ndh-flood-mortality-risks-distribution",
- "ndh-flood-proportional-economic-loss-risk-deciles"
- ]
- },
- "Shipping": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands143",
- "MODIS_Aqua_SurfaceReflectance_Bands143",
- "MODIS_Terra_CorrectedReflectance_Bands367",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Sea_Ice",
- "MODIS_Aqua_Sea_Ice",
- "MODIS_Terra_Brightness_Temp_Band31_Day",
- "MODIS_Terra_Brightness_Temp_Band31_Night",
- "MODIS_Aqua_Brightness_Temp_Band31_Day",
- "MODIS_Aqua_Brightness_Temp_Band31_Night",
- "land_mask"
- ]
- },
- "Smoke Plumes": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands143",
- "MODIS_Aqua_SurfaceReflectance_Bands143",
- "MODIS_Terra_CorrectedReflectance_Bands367",
- "MODIS_Terra_CorrectedReflectance_Bands721",
- "MODIS_Aqua_CorrectedReflectance_Bands721",
- "MODIS_Terra_SurfaceReflectance_Bands721",
- "MODIS_Aqua_SurfaceReflectance_Bands721",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Aerosol",
- "MODIS_Aqua_Aerosol",
- "MODIS_Combined_Value_Added_AOD",
- "AIRS_CO_Total_Column_Day",
- "AIRS_CO_Total_Column_Night",
- "MLS_CO_215hPa_Day",
- "MLS_CO_215hPa_Night",
- "OMI_Aerosol_Index",
- "OMI_Aerosol_Optical_Depth",
- "OMI_Absorbing_Aerosol_Optical_Depth",
- "land_mask"
- ]
- },
- "Vegetation": {
- "baselayers": [
- "MODIS_Terra_CorrectedReflectance_TrueColor",
- "MODIS_Aqua_CorrectedReflectance_TrueColor",
- "MODIS_Terra_SurfaceReflectance_Bands121",
- "MODIS_Aqua_SurfaceReflectance_Bands121",
- "land_water_map"
- ],
- "overlays": [
- "MODIS_Terra_Snow_Cover",
- "MODIS_Aqua_Snow_Cover",
- "MODIS_Terra_Land_Surface_Temp_Day",
- "MODIS_Terra_Land_Surface_Temp_Night",
- "MODIS_Aqua_Land_Surface_Temp_Day",
- "MODIS_Aqua_Land_Surface_Temp_Night",
- "land_mask"
- ]
- }
+ "Drought": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands121",
+ "MODIS_Aqua_SurfaceReflectance_Bands121",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Snow_Cover",
+ "MODIS_Aqua_Snow_Cover",
+ "AIRS_Precipitation_Day",
+ "AIRS_Precipitation_Night",
+ "land_mask",
+ "ndh-drought-hazard-frequency-distribution",
+ "ndh-drought-mortality-risks-distribution",
+ "ndh-drought-proportional-economic-loss-risk-deciles"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Dust Storms": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands143",
+ "MODIS_Aqua_SurfaceReflectance_Bands143",
+ "MODIS_Terra_CorrectedReflectance_Bands721",
+ "MODIS_Aqua_CorrectedReflectance_Bands721",
+ "MODIS_Terra_SurfaceReflectance_Bands721",
+ "MODIS_Aqua_SurfaceReflectance_Bands721",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Aerosol",
+ "MODIS_Aqua_Aerosol",
+ "MODIS_Combined_Value_Added_AOD",
+ "AIRS_Dust_Score",
+ "OMI_Aerosol_Index",
+ "OMI_Aerosol_Optical_Depth",
+ "OMI_Absorbing_Aerosol_Optical_Depth"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Featured": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "VIIRS_CityLights_2012",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Land_Surface_Temp_Day",
+ "MODIS_Terra_Land_Surface_Temp_Night",
+ "MODIS_Fires_All",
+ "MODIS_Terra_Aerosol",
+ "AIRS_Dust_Score",
+ "MODIS_Terra_Snow_Cover",
+ "MODIS_Terra_Sea_Ice",
+ "Terra_Orbit_Asc",
+ "Terra_Orbit_Dsc",
+ "sedac_bound",
+ "cartographic:esri-administrative-boundaries_level-1",
+ "grump-v1-population-count_2000"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Fires": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands721",
+ "MODIS_Aqua_SurfaceReflectance_Bands721",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Fires_All",
+ "MODIS_Fires_Terra",
+ "MODIS_Fires_Aqua",
+ "MODIS_Terra_Aerosol",
+ "MODIS_Aqua_Aerosol",
+ "MODIS_Combined_Value_Added_AOD",
+ "MODIS_Terra_Land_Surface_Temp_Day",
+ "MODIS_Terra_Land_Surface_Temp_Night",
+ "MODIS_Aqua_Land_Surface_Temp_Day",
+ "MODIS_Aqua_Land_Surface_Temp_Night",
+ "AIRS_CO_Total_Column_Day",
+ "AIRS_CO_Total_Column_Night",
+ "OMI_Aerosol_Index",
+ "OMI_Aerosol_Optical_Depth",
+ "OMI_Absorbing_Aerosol_Optical_Depth"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Floods": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands121",
+ "MODIS_Aqua_SurfaceReflectance_Bands121",
+ "MODIS_Terra_CorrectedReflectance_Bands721",
+ "MODIS_Aqua_CorrectedReflectance_Bands721",
+ "land_water_map"
+ ],
+ "overlays": [
+ "AIRS_Precipitation_Day",
+ "AIRS_Precipitation_Night",
+ "MODIS_Water_Mask",
+ "land_mask",
+ "ndh-flood-hazard-frequency-distribution",
+ "ndh-flood-mortality-risks-distribution",
+ "ndh-flood-proportional-economic-loss-risk-deciles"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Other": {
+ "baselayers": [
+ "VIIRS_CityLights_2012"
+ ],
+ "overlays": [
+ "grump-v1-population-count_2000",
+ "cartographic:esri-administrative-boundaries_level-1",
+ "sedac_bound",
+ "gpw-v3-coastlines",
+ "cartographic:00-global-labels",
+ "ol_graticule",
+ "MODIS_Water_Mask",
+ "MODIS_Terra_Data_No_Data",
+ "MODIS_Aqua_Data_No_Data",
+ "Terra_Orbit_Asc",
+ "Terra_Orbit_Dsc",
+ "Aqua_Orbit_Asc",
+ "Aqua_Orbit_Dsc",
+ "Aura_Orbit_Asc",
+ "Aura_Orbit_Dsc",
+ "Calipso_Orbit_Asc",
+ "Calipso_Orbit_Dsc"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Severe Storms": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Water_Vapor_5km_Day",
+ "MODIS_Terra_Water_Vapor_5km_Night",
+ "MODIS_Aqua_Water_Vapor_5km_Day",
+ "MODIS_Aqua_Water_Vapor_5km_Night",
+ "MODIS_Terra_Cloud_Top_Temp_Day",
+ "MODIS_Terra_Cloud_Top_Temp_Night",
+ "MODIS_Aqua_Cloud_Top_Temp_Day",
+ "MODIS_Aqua_Cloud_Top_Temp_Night",
+ "MODIS_Terra_Cloud_Top_Pressure_Day",
+ "MODIS_Terra_Cloud_Top_Pressure_Night",
+ "MODIS_Aqua_Cloud_Top_Pressure_Day",
+ "MODIS_Aqua_Cloud_Top_Pressure_Night",
+ "AIRS_Precipitation_Day",
+ "AIRS_Precipitation_Night",
+ "AIRS_RelativeHumidity_400hPa_Day",
+ "AIRS_RelativeHumidity_400hPa_Night",
+ "AIRS_RelativeHumidity_500hPa_Day",
+ "AIRS_RelativeHumidity_500hPa_Night",
+ "AIRS_RelativeHumidity_600hPa_Day",
+ "AIRS_RelativeHumidity_600hPa_Night",
+ "AIRS_RelativeHumidity_700hPa_Day",
+ "AIRS_RelativeHumidity_700hPa_Night",
+ "AIRS_RelativeHumidity_850hPa_Day",
+ "AIRS_RelativeHumidity_850hPa_Night",
+ "AIRS_Temperature_400hPa_Day",
+ "AIRS_Temperature_400hPa_Night",
+ "AIRS_Temperature_500hPa_Day",
+ "AIRS_Temperature_500hPa_Night",
+ "AIRS_Temperature_600hPa_Day",
+ "AIRS_Temperature_600hPa_Night",
+ "AIRS_Temperature_700hPa_Day",
+ "AIRS_Temperature_700hPa_Night",
+ "AIRS_Temperature_850hPa_Day",
+ "AIRS_Temperature_850hPa_Night",
+ "OMI_Cloud_Pressure",
+ "land_mask",
+ "ndh-cyclone-hazard-frequency-distribution",
+ "ndh-cyclone-mortality-risks-distribution",
+ "ndh-cyclone-proportional-economic-loss-risk-deciles",
+ "ndh-flood-hazard-frequency-distribution",
+ "ndh-flood-mortality-risks-distribution",
+ "ndh-flood-proportional-economic-loss-risk-deciles"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Shipping": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands143",
+ "MODIS_Aqua_SurfaceReflectance_Bands143",
+ "MODIS_Terra_CorrectedReflectance_Bands367",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Sea_Ice",
+ "MODIS_Aqua_Sea_Ice",
+ "MODIS_Terra_Brightness_Temp_Band31_Day",
+ "MODIS_Terra_Brightness_Temp_Band31_Night",
+ "MODIS_Aqua_Brightness_Temp_Band31_Day",
+ "MODIS_Aqua_Brightness_Temp_Band31_Night",
+ "land_mask"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Smoke Plumes": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands143",
+ "MODIS_Aqua_SurfaceReflectance_Bands143",
+ "MODIS_Terra_CorrectedReflectance_Bands367",
+ "MODIS_Terra_CorrectedReflectance_Bands721",
+ "MODIS_Aqua_CorrectedReflectance_Bands721",
+ "MODIS_Terra_SurfaceReflectance_Bands721",
+ "MODIS_Aqua_SurfaceReflectance_Bands721",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Aerosol",
+ "MODIS_Aqua_Aerosol",
+ "MODIS_Combined_Value_Added_AOD",
+ "AIRS_CO_Total_Column_Day",
+ "AIRS_CO_Total_Column_Night",
+ "MLS_CO_215hPa_Day",
+ "MLS_CO_215hPa_Night",
+ "OMI_Aerosol_Index",
+ "OMI_Aerosol_Optical_Depth",
+ "OMI_Absorbing_Aerosol_Optical_Depth",
+ "land_mask"
+ ],
+ "projections": [
+ "geographic"
+ ]
+ },
+ "Vegetation": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands121",
+ "MODIS_Aqua_SurfaceReflectance_Bands121",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Snow_Cover",
+ "MODIS_Aqua_Snow_Cover",
+ "MODIS_Terra_Land_Surface_Temp_Day",
+ "MODIS_Terra_Land_Surface_Temp_Night",
+ "MODIS_Aqua_Land_Surface_Temp_Day",
+ "MODIS_Aqua_Land_Surface_Temp_Night",
+ "land_mask"
+ ],
+ "projections": [
+ "geographic"
+ ]
}
},
"defaults": {
@@ -588,6 +426,154 @@
}
}
},
+ "layerOrder": {
+ "baselayers": [
+ "MODIS_Terra_CorrectedReflectance_TrueColor",
+ "MODIS_Aqua_CorrectedReflectance_TrueColor",
+ "MODIS_Terra_SurfaceReflectance_Bands143",
+ "MODIS_Aqua_SurfaceReflectance_Bands143",
+ "MODIS_Terra_SurfaceReflectance_Bands121",
+ "MODIS_Aqua_SurfaceReflectance_Bands121",
+ "MODIS_Terra_CorrectedReflectance_Bands367",
+ "MODIS_Terra_CorrectedReflectance_Bands721",
+ "MODIS_Aqua_CorrectedReflectance_Bands721",
+ "MODIS_Terra_SurfaceReflectance_Bands721",
+ "MODIS_Aqua_SurfaceReflectance_Bands721",
+ "VIIRS_CityLights_2012",
+ "land_water_map"
+ ],
+ "overlays": [
+ "MODIS_Terra_Aerosol",
+ "MODIS_Aqua_Aerosol",
+ "MODIS_Combined_Value_Added_AOD",
+ "MODIS_Terra_Brightness_Temp_Band31_Day",
+ "MODIS_Terra_Brightness_Temp_Band31_Night",
+ "MODIS_Aqua_Brightness_Temp_Band31_Day",
+ "MODIS_Aqua_Brightness_Temp_Band31_Night",
+ "MODIS_Terra_Chlorophyll_A",
+ "MODIS_Aqua_Chlorophyll_A",
+ "MODIS_Terra_Cloud_Top_Pressure_Day",
+ "MODIS_Terra_Cloud_Top_Pressure_Night",
+ "MODIS_Aqua_Cloud_Top_Pressure_Day",
+ "MODIS_Aqua_Cloud_Top_Pressure_Night",
+ "MODIS_Terra_Cloud_Top_Temp_Day",
+ "MODIS_Terra_Cloud_Top_Temp_Night",
+ "MODIS_Aqua_Cloud_Top_Temp_Day",
+ "MODIS_Aqua_Cloud_Top_Temp_Night",
+ "MODIS_Fires_All",
+ "MODIS_Fires_Terra",
+ "MODIS_Fires_Aqua",
+ "MODIS_Terra_Land_Surface_Temp_Day",
+ "MODIS_Terra_Land_Surface_Temp_Night",
+ "MODIS_Aqua_Land_Surface_Temp_Day",
+ "MODIS_Aqua_Land_Surface_Temp_Night",
+ "MODIS_Terra_Sea_Ice",
+ "MODIS_Aqua_Sea_Ice",
+ "MODIS_Terra_Snow_Cover",
+ "MODIS_Aqua_Snow_Cover",
+ "MODIS_Terra_Water_Vapor_5km_Day",
+ "MODIS_Terra_Water_Vapor_5km_Night",
+ "MODIS_Aqua_Water_Vapor_5km_Day",
+ "MODIS_Aqua_Water_Vapor_5km_Night",
+ "AIRS_CO_Total_Column_Day",
+ "AIRS_CO_Total_Column_Night",
+ "AIRS_Dust_Score",
+ "AIRS_Precipitation_Day",
+ "AIRS_Precipitation_Night",
+ "AIRS_Prata_SO2_Index_Day",
+ "AIRS_Prata_SO2_Index_Night",
+ "AIRS_RelativeHumidity_400hPa_Day",
+ "AIRS_RelativeHumidity_400hPa_Night",
+ "AIRS_RelativeHumidity_500hPa_Day",
+ "AIRS_RelativeHumidity_500hPa_Night",
+ "AIRS_RelativeHumidity_600hPa_Day",
+ "AIRS_RelativeHumidity_600hPa_Night",
+ "AIRS_RelativeHumidity_700hPa_Day",
+ "AIRS_RelativeHumidity_700hPa_Night",
+ "AIRS_RelativeHumidity_850hPa_Day",
+ "AIRS_RelativeHumidity_850hPa_Night",
+ "AIRS_Temperature_400hPa_Day",
+ "AIRS_Temperature_400hPa_Night",
+ "AIRS_Temperature_500hPa_Day",
+ "AIRS_Temperature_500hPa_Night",
+ "AIRS_Temperature_600hPa_Day",
+ "AIRS_Temperature_600hPa_Night",
+ "AIRS_Temperature_700hPa_Day",
+ "AIRS_Temperature_700hPa_Night",
+ "AIRS_Temperature_850hPa_Day",
+ "AIRS_Temperature_850hPa_Night",
+ "OMI_Absorbing_Aerosol_Optical_Depth",
+ "OMI_Aerosol_Index",
+ "OMI_Aerosol_Optical_Depth",
+ "OMI_Cloud_Pressure",
+ "OMI_SO2_Planetary_Boundary_Layer",
+ "OMI_SO2_Lower_Troposphere",
+ "OMI_SO2_Middle_Troposphere",
+ "OMI_SO2_Upper_Troposphere_and_Stratosphere",
+ "MLS_CO_215hPa_Day",
+ "MLS_CO_215hPa_Night",
+ "MLS_HNO3_46hPa_Day",
+ "MLS_HNO3_46hPa_Night",
+ "MLS_N2O_46hPa_Day",
+ "MLS_N2O_46hPa_Night",
+ "MLS_O3_46hPa_Day",
+ "MLS_O3_46hPa_Night",
+ "MLS_SO2_147hPa_Day",
+ "MLS_SO2_147hPa_Night",
+ "MLS_Temperature_46hPa_Day",
+ "MLS_Temperature_46hPa_Night",
+ "MLS_H2O_46hPa_Day",
+ "MLS_H2O_46hPa_Night",
+ "land_mask",
+ "ndh-cyclone-hazard-frequency-distribution",
+ "ndh-cyclone-mortality-risks-distribution",
+ "ndh-cyclone-proportional-economic-loss-risk-deciles",
+ "ndh-drought-hazard-frequency-distribution",
+ "ndh-drought-mortality-risks-distribution",
+ "ndh-drought-proportional-economic-loss-risk-deciles",
+ "ndh-flood-hazard-frequency-distribution",
+ "ndh-flood-mortality-risks-distribution",
+ "ndh-flood-proportional-economic-loss-risk-deciles",
+ "ndh-volcano-hazard-frequency-distribution",
+ "ndh-volcano-mortality-risks-distribution",
+ "ndh-volcano-proportional-economic-loss-risk-deciles",
+ "cartographic:esri-administrative-boundaries_level-1",
+ "gpw-v3-coastlines",
+ "cartographic:00-global-labels",
+ "sedac_bound",
+ "antarctic_coastlines",
+ "arctic_coastlines_3413",
+ "arctic_coastlines",
+ "grump-v1-population-count_2000",
+ "polarview:graticule3031_10x30",
+ "ol_graticule",
+ "arctic_graticule_3413",
+ "polarview:graticuleN",
+ "MODIS_Water_Mask",
+ "MODIS_Terra_Data_No_Data",
+ "MODIS_Aqua_Data_No_Data",
+ "Terra_Orbit_Asc",
+ "Terra_Orbit_Dsc",
+ "Terra_Antarctic_Orbit_Asc",
+ "Terra_Antarctic_Orbit_Dsc",
+ "Terra_Arctic_Orbit_Asc",
+ "Terra_Arctic_Orbit_Dsc",
+ "Aqua_Orbit_Asc",
+ "Aqua_Orbit_Dsc",
+ "Aqua_Antarctic_Orbit_Asc",
+ "Aqua_Antarctic_Orbit_Dsc",
+ "Aqua_Arctic_Orbit_Asc",
+ "Aqua_Arctic_Orbit_Dsc",
+ "Aura_Orbit_Asc",
+ "Aura_Orbit_Dsc",
+ "Aura_Antarctic_Orbit_Asc",
+ "Aura_Antarctic_Orbit_Dsc",
+ "Aura_Arctic_Orbit_Asc",
+ "Aura_Arctic_Orbit_Dsc",
+ "Calipso_Orbit_Asc",
+ "Calipso_Orbit_Dsc"
+ ]
+ },
"layers": {
"AIRS_CO_Total_Column_Day": {
"bins": 7,
diff --git a/src/ext/jscrollpane/jquery.jscrollpane.js b/src/ext/jscrollpane/jquery.jscrollpane.js
new file mode 100644
index 000000000..12983881a
--- /dev/null
+++ b/src/ext/jscrollpane/jquery.jscrollpane.js
@@ -0,0 +1,1447 @@
+/*!
+ * jScrollPane - v2.0.17 - 2013-08-17
+ * http://jscrollpane.kelvinluck.com/
+ *
+ * Copyright (c) 2013 Kelvin Luck
+ * Dual licensed under the MIT or GPL licenses.
+ */
+
+// Script: jScrollPane - cross browser customisable scrollbars
+//
+// *Version: 2.0.17, Last updated: 2013-08-17*
+//
+// Project Home - http://jscrollpane.kelvinluck.com/
+// GitHub - http://github.com/vitch/jScrollPane
+// Source - http://github.com/vitch/jScrollPane/raw/master/script/jquery.jscrollpane.js
+// (Minified) - http://github.com/vitch/jScrollPane/raw/master/script/jquery.jscrollpane.min.js
+//
+// About: License
+//
+// Copyright (c) 2013 Kelvin Luck
+// Dual licensed under the MIT or GPL Version 2 licenses.
+// http://jscrollpane.kelvinluck.com/MIT-LICENSE.txt
+// http://jscrollpane.kelvinluck.com/GPL-LICENSE.txt
+//
+// About: Examples
+//
+// All examples and demos are available through the jScrollPane example site at:
+// http://jscrollpane.kelvinluck.com/
+//
+// About: Support and Testing
+//
+// This plugin is tested on the browsers below and has been found to work reliably on them. If you run
+// into a problem on one of the supported browsers then please visit the support section on the jScrollPane
+// website (http://jscrollpane.kelvinluck.com/) for more information on getting support. You are also
+// welcome to fork the project on GitHub if you can contribute a fix for a given issue.
+//
+// jQuery Versions - tested in 1.4.2+ - reported to work in 1.3.x
+// Browsers Tested - Firefox 3.6.8, Safari 5, Opera 10.6, Chrome 5.0, IE 6, 7, 8
+//
+// About: Release History
+//
+// 2.0.17 - (2013-08-17) Working correctly when box-sizing is set to border-box (thanks @pieht)
+// 2.0.16 - (2013-07-30) Resetting left position when scroll is removed. Fixes #189
+// 2.0.15 - (2013-07-29) Fixed issue with scrollToElement where the destX and destY are undefined.
+// 2.0.14 - (2013-05-01) Updated to most recent mouse wheel plugin (see #106) and related changes for sensible scroll speed
+// 2.0.13 - (2013-05-01) Switched to semver compatible version name
+// 2.0.0beta12 - (2012-09-27) fix for jQuery 1.8+
+// 2.0.0beta11 - (2012-05-14)
+// 2.0.0beta10 - (2011-04-17) cleaner required size calculation, improved keyboard support, stickToBottom/Left, other small fixes
+// 2.0.0beta9 - (2011-01-31) new API methods, bug fixes and correct keyboard support for FF/OSX
+// 2.0.0beta8 - (2011-01-29) touchscreen support, improved keyboard support
+// 2.0.0beta7 - (2011-01-23) scroll speed consistent (thanks Aivo Paas)
+// 2.0.0beta6 - (2010-12-07) scrollToElement horizontal support
+// 2.0.0beta5 - (2010-10-18) jQuery 1.4.3 support, various bug fixes
+// 2.0.0beta4 - (2010-09-17) clickOnTrack support, bug fixes
+// 2.0.0beta3 - (2010-08-27) Horizontal mousewheel, mwheelIntent, keyboard support, bug fixes
+// 2.0.0beta2 - (2010-08-21) Bug fixes
+// 2.0.0beta1 - (2010-08-17) Rewrite to follow modern best practices and enable horizontal scrolling, initially hidden
+// elements and dynamically sized elements.
+// 1.x - (2006-12-31 - 2010-07-31) Initial version, hosted at googlecode, deprecated
+
+(function($,window,undefined){
+
+ $.fn.jScrollPane = function(settings)
+ {
+ // JScrollPane "class" - public methods are available through $('selector').data('jsp')
+ function JScrollPane(elem, s)
+ {
+ var settings, jsp = this, pane, paneWidth, paneHeight, container, contentWidth, contentHeight,
+ percentInViewH, percentInViewV, isScrollableV, isScrollableH, verticalDrag, dragMaxY,
+ verticalDragPosition, horizontalDrag, dragMaxX, horizontalDragPosition,
+ verticalBar, verticalTrack, scrollbarWidth, verticalTrackHeight, verticalDragHeight, arrowUp, arrowDown,
+ horizontalBar, horizontalTrack, horizontalTrackWidth, horizontalDragWidth, arrowLeft, arrowRight,
+ reinitialiseInterval, originalPadding, originalPaddingTotalWidth, previousContentWidth,
+ wasAtTop = true, wasAtLeft = true, wasAtBottom = false, wasAtRight = false,
+ originalElement = elem.clone(false, false).empty(),
+ mwEvent = $.fn.mwheelIntent ? 'mwheelIntent.jsp' : 'mousewheel.jsp';
+
+ if (elem.css('box-sizing') === 'border-box') {
+ originalPadding = 0;
+ originalPaddingTotalWidth = 0;
+ } else {
+ originalPadding = elem.css('paddingTop') + ' ' +
+ elem.css('paddingRight') + ' ' +
+ elem.css('paddingBottom') + ' ' +
+ elem.css('paddingLeft');
+ originalPaddingTotalWidth = (parseInt(elem.css('paddingLeft'), 10) || 0) +
+ (parseInt(elem.css('paddingRight'), 10) || 0);
+ }
+
+ function initialise(s)
+ {
+
+ var /*firstChild, lastChild, */isMaintainingPositon, lastContentX, lastContentY,
+ hasContainingSpaceChanged, originalScrollTop, originalScrollLeft,
+ maintainAtBottom = false, maintainAtRight = false;
+
+ settings = s;
+
+ if (pane === undefined) {
+ originalScrollTop = elem.scrollTop();
+ originalScrollLeft = elem.scrollLeft();
+
+ elem.css(
+ {
+ overflow: 'hidden',
+ padding: 0
+ }
+ );
+ // TODO: Deal with where width/ height is 0 as it probably means the element is hidden and we should
+ // come back to it later and check once it is unhidden...
+ paneWidth = elem.innerWidth() + originalPaddingTotalWidth;
+ paneHeight = elem.innerHeight();
+
+ elem.width(paneWidth);
+
+ pane = $('<div class="jspPane" />').css('padding', originalPadding).append(elem.children());
+ container = $('<div class="jspContainer" />')
+ .css({
+ 'width': paneWidth + 'px',
+ 'height': paneHeight + 'px'
+ }
+ ).append(pane).appendTo(elem);
+
+ /*
+ // Move any margins from the first and last children up to the container so they can still
+ // collapse with neighbouring elements as they would before jScrollPane
+ firstChild = pane.find(':first-child');
+ lastChild = pane.find(':last-child');
+ elem.css(
+ {
+ 'margin-top': firstChild.css('margin-top'),
+ 'margin-bottom': lastChild.css('margin-bottom')
+ }
+ );
+ firstChild.css('margin-top', 0);
+ lastChild.css('margin-bottom', 0);
+ */
+ } else {
+ elem.css('width', '');
+
+ maintainAtBottom = settings.stickToBottom && isCloseToBottom();
+ maintainAtRight = settings.stickToRight && isCloseToRight();
+
+ hasContainingSpaceChanged = elem.innerWidth() + originalPaddingTotalWidth != paneWidth || elem.outerHeight() != paneHeight;
+
+ if (hasContainingSpaceChanged) {
+ paneWidth = elem.innerWidth() + originalPaddingTotalWidth;
+ paneHeight = elem.innerHeight();
+ container.css({
+ width: paneWidth + 'px',
+ height: paneHeight + 'px'
+ });
+ }
+
+ // If nothing changed since last check...
+ if (!hasContainingSpaceChanged && previousContentWidth == contentWidth && pane.outerHeight() == contentHeight) {
+ elem.width(paneWidth);
+ return;
+ }
+ previousContentWidth = contentWidth;
+
+ pane.css('width', '');
+ elem.width(paneWidth);
+
+ container.find('>.jspVerticalBar,>.jspHorizontalBar').remove().end();
+ }
+
+ pane.css('overflow', 'auto');
+ if (s.contentWidth) {
+ contentWidth = s.contentWidth;
+ } else {
+ contentWidth = pane[0].scrollWidth;
+ }
+ contentHeight = pane[0].scrollHeight;
+ pane.css('overflow', '');
+
+ percentInViewH = contentWidth / paneWidth;
+ percentInViewV = contentHeight / paneHeight;
+ isScrollableV = percentInViewV > 1;
+
+ isScrollableH = percentInViewH > 1;
+
+ //console.log(paneWidth, paneHeight, contentWidth, contentHeight, percentInViewH, percentInViewV, isScrollableH, isScrollableV);
+
+ if (!(isScrollableH || isScrollableV)) {
+ elem.removeClass('jspScrollable');
+ pane.css({
+ top: 0,
+ left: 0,
+ width: container.width() - originalPaddingTotalWidth
+ });
+ removeMousewheel();
+ removeFocusHandler();
+ removeKeyboardNav();
+ removeClickOnTrack();
+ } else {
+ elem.addClass('jspScrollable');
+
+ isMaintainingPositon = settings.maintainPosition && (verticalDragPosition || horizontalDragPosition);
+ if (isMaintainingPositon) {
+ lastContentX = contentPositionX();
+ lastContentY = contentPositionY();
+ }
+
+ initialiseVerticalScroll();
+ initialiseHorizontalScroll();
+ resizeScrollbars();
+
+ if (isMaintainingPositon) {
+ scrollToX(maintainAtRight ? (contentWidth - paneWidth ) : lastContentX, false);
+ scrollToY(maintainAtBottom ? (contentHeight - paneHeight) : lastContentY, false);
+ }
+
+ initFocusHandler();
+ initMousewheel();
+ initTouch();
+
+ if (settings.enableKeyboardNavigation) {
+ initKeyboardNav();
+ }
+ if (settings.clickOnTrack) {
+ initClickOnTrack();
+ }
+
+ observeHash();
+ if (settings.hijackInternalLinks) {
+ hijackInternalLinks();
+ }
+ }
+
+ if (settings.autoReinitialise && !reinitialiseInterval) {
+ reinitialiseInterval = setInterval(
+ function()
+ {
+ initialise(settings);
+ },
+ settings.autoReinitialiseDelay
+ );
+ } else if (!settings.autoReinitialise && reinitialiseInterval) {
+ clearInterval(reinitialiseInterval);
+ }
+
+ originalScrollTop && elem.scrollTop(0) && scrollToY(originalScrollTop, false);
+ originalScrollLeft && elem.scrollLeft(0) && scrollToX(originalScrollLeft, false);
+
+ elem.trigger('jsp-initialised', [isScrollableH || isScrollableV]);
+ }
+
+ function initialiseVerticalScroll()
+ {
+ if (isScrollableV) {
+
+ container.append(
+ $('<div class="jspVerticalBar" />').append(
+ $('<div class="jspCap jspCapTop" />'),
+ $('<div class="jspTrack" />').append(
+ $('<div class="jspDrag" />').append(
+ $('<div class="jspDragTop" />'),
+ $('<div class="jspDragBottom" />')
+ )
+ ),
+ $('<div class="jspCap jspCapBottom" />')
+ )
+ );
+
+ verticalBar = container.find('>.jspVerticalBar');
+ verticalTrack = verticalBar.find('>.jspTrack');
+ verticalDrag = verticalTrack.find('>.jspDrag');
+
+ if (settings.showArrows) {
+ arrowUp = $('<a class="jspArrow jspArrowUp" />').bind(
+ 'mousedown.jsp', getArrowScroll(0, -1)
+ ).bind('click.jsp', nil);
+ arrowDown = $('<a class="jspArrow jspArrowDown" />').bind(
+ 'mousedown.jsp', getArrowScroll(0, 1)
+ ).bind('click.jsp', nil);
+ if (settings.arrowScrollOnHover) {
+ arrowUp.bind('mouseover.jsp', getArrowScroll(0, -1, arrowUp));
+ arrowDown.bind('mouseover.jsp', getArrowScroll(0, 1, arrowDown));
+ }
+
+ appendArrows(verticalTrack, settings.verticalArrowPositions, arrowUp, arrowDown);
+ }
+
+ verticalTrackHeight = paneHeight;
+ container.find('>.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow').each(
+ function()
+ {
+ verticalTrackHeight -= $(this).outerHeight();
+ }
+ );
+
+
+ verticalDrag.hover(
+ function()
+ {
+ verticalDrag.addClass('jspHover');
+ },
+ function()
+ {
+ verticalDrag.removeClass('jspHover');
+ }
+ ).bind(
+ 'mousedown.jsp',
+ function(e)
+ {
+ // Stop IE from allowing text selection
+ $('html').bind('dragstart.jsp selectstart.jsp', nil);
+
+ verticalDrag.addClass('jspActive');
+
+ var startY = e.pageY - verticalDrag.position().top;
+
+ $('html').bind(
+ 'mousemove.jsp',
+ function(e)
+ {
+ positionDragY(e.pageY - startY, false);
+ }
+ ).bind('mouseup.jsp mouseleave.jsp', cancelDrag);
+ return false;
+ }
+ );
+ sizeVerticalScrollbar();
+ }
+ }
+
+ function sizeVerticalScrollbar()
+ {
+ verticalTrack.height(verticalTrackHeight + 'px');
+ verticalDragPosition = 0;
+ scrollbarWidth = settings.verticalGutter + verticalTrack.outerWidth();
+
+ // Make the pane thinner to allow for the vertical scrollbar
+ pane.width(paneWidth - scrollbarWidth - originalPaddingTotalWidth);
+
+ // Add margin to the left of the pane if scrollbars are on that side (to position
+ // the scrollbar on the left or right set it's left or right property in CSS)
+ try {
+ if (verticalBar.position().left === 0) {
+ pane.css('margin-left', scrollbarWidth + 'px');
+ }
+ } catch (err) {
+ }
+ }
+
+ function initialiseHorizontalScroll()
+ {
+ if (isScrollableH) {
+
+ container.append(
+ $('<div class="jspHorizontalBar" />').append(
+ $('<div class="jspCap jspCapLeft" />'),
+ $('<div class="jspTrack" />').append(
+ $('<div class="jspDrag" />').append(
+ $('<div class="jspDragLeft" />'),
+ $('<div class="jspDragRight" />')
+ )
+ ),
+ $('<div class="jspCap jspCapRight" />')
+ )
+ );
+
+ horizontalBar = container.find('>.jspHorizontalBar');
+ horizontalTrack = horizontalBar.find('>.jspTrack');
+ horizontalDrag = horizontalTrack.find('>.jspDrag');
+
+ if (settings.showArrows) {
+ arrowLeft = $('<a class="jspArrow jspArrowLeft" />').bind(
+ 'mousedown.jsp', getArrowScroll(-1, 0)
+ ).bind('click.jsp', nil);
+ arrowRight = $('<a class="jspArrow jspArrowRight" />').bind(
+ 'mousedown.jsp', getArrowScroll(1, 0)
+ ).bind('click.jsp', nil);
+ if (settings.arrowScrollOnHover) {
+ arrowLeft.bind('mouseover.jsp', getArrowScroll(-1, 0, arrowLeft));
+ arrowRight.bind('mouseover.jsp', getArrowScroll(1, 0, arrowRight));
+ }
+ appendArrows(horizontalTrack, settings.horizontalArrowPositions, arrowLeft, arrowRight);
+ }
+
+ horizontalDrag.hover(
+ function()
+ {
+ horizontalDrag.addClass('jspHover');
+ },
+ function()
+ {
+ horizontalDrag.removeClass('jspHover');
+ }
+ ).bind(
+ 'mousedown.jsp',
+ function(e)
+ {
+ // Stop IE from allowing text selection
+ $('html').bind('dragstart.jsp selectstart.jsp', nil);
+
+ horizontalDrag.addClass('jspActive');
+
+ var startX = e.pageX - horizontalDrag.position().left;
+
+ $('html').bind(
+ 'mousemove.jsp',
+ function(e)
+ {
+ positionDragX(e.pageX - startX, false);
+ }
+ ).bind('mouseup.jsp mouseleave.jsp', cancelDrag);
+ return false;
+ }
+ );
+ horizontalTrackWidth = container.innerWidth();
+ sizeHorizontalScrollbar();
+ }
+ }
+
+ function sizeHorizontalScrollbar()
+ {
+ container.find('>.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow').each(
+ function()
+ {
+ horizontalTrackWidth -= $(this).outerWidth();
+ }
+ );
+
+ horizontalTrack.width(horizontalTrackWidth + 'px');
+ horizontalDragPosition = 0;
+ }
+
+ function resizeScrollbars()
+ {
+ if (isScrollableH && isScrollableV) {
+ var horizontalTrackHeight = horizontalTrack.outerHeight(),
+ verticalTrackWidth = verticalTrack.outerWidth();
+ verticalTrackHeight -= horizontalTrackHeight;
+ $(horizontalBar).find('>.jspCap:visible,>.jspArrow').each(
+ function()
+ {
+ horizontalTrackWidth += $(this).outerWidth();
+ }
+ );
+ horizontalTrackWidth -= verticalTrackWidth;
+ paneHeight -= verticalTrackWidth;
+ paneWidth -= horizontalTrackHeight;
+ horizontalTrack.parent().append(
+ $('<div class="jspCorner" />').css('width', horizontalTrackHeight + 'px')
+ );
+ sizeVerticalScrollbar();
+ sizeHorizontalScrollbar();
+ }
+ // reflow content
+ if (isScrollableH) {
+ pane.width((container.outerWidth() - originalPaddingTotalWidth) + 'px');
+ }
+ contentHeight = pane.outerHeight();
+ percentInViewV = contentHeight / paneHeight;
+
+ if (isScrollableH) {
+ horizontalDragWidth = Math.ceil(1 / percentInViewH * horizontalTrackWidth);
+ if (horizontalDragWidth > settings.horizontalDragMaxWidth) {
+ horizontalDragWidth = settings.horizontalDragMaxWidth;
+ } else if (horizontalDragWidth < settings.horizontalDragMinWidth) {
+ horizontalDragWidth = settings.horizontalDragMinWidth;
+ }
+ horizontalDrag.width(horizontalDragWidth + 'px');
+ dragMaxX = horizontalTrackWidth - horizontalDragWidth;
+ _positionDragX(horizontalDragPosition); // To update the state for the arrow buttons
+ }
+ if (isScrollableV) {
+ verticalDragHeight = Math.ceil(1 / percentInViewV * verticalTrackHeight);
+ if (verticalDragHeight > settings.verticalDragMaxHeight) {
+ verticalDragHeight = settings.verticalDragMaxHeight;
+ } else if (verticalDragHeight < settings.verticalDragMinHeight) {
+ verticalDragHeight = settings.verticalDragMinHeight;
+ }
+ verticalDrag.height(verticalDragHeight + 'px');
+ dragMaxY = verticalTrackHeight - verticalDragHeight;
+ _positionDragY(verticalDragPosition); // To update the state for the arrow buttons
+ }
+ }
+
+ function appendArrows(ele, p, a1, a2)
+ {
+ var p1 = "before", p2 = "after", aTemp;
+
+ // Sniff for mac... Is there a better way to determine whether the arrows would naturally appear
+ // at the top or the bottom of the bar?
+ if (p == "os") {
+ p = /Mac/.test(navigator.platform) ? "after" : "split";
+ }
+ if (p == p1) {
+ p2 = p;
+ } else if (p == p2) {
+ p1 = p;
+ aTemp = a1;
+ a1 = a2;
+ a2 = aTemp;
+ }
+
+ ele[p1](a1)[p2](a2);
+ }
+
+ function getArrowScroll(dirX, dirY, ele)
+ {
+ return function()
+ {
+ arrowScroll(dirX, dirY, this, ele);
+ this.blur();
+ return false;
+ };
+ }
+
+ function arrowScroll(dirX, dirY, arrow, ele)
+ {
+ arrow = $(arrow).addClass('jspActive');
+
+ var eve,
+ scrollTimeout,
+ isFirst = true,
+ doScroll = function()
+ {
+ if (dirX !== 0) {
+ jsp.scrollByX(dirX * settings.arrowButtonSpeed);
+ }
+ if (dirY !== 0) {
+ jsp.scrollByY(dirY * settings.arrowButtonSpeed);
+ }
+ scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.arrowRepeatFreq);
+ isFirst = false;
+ };
+
+ doScroll();
+
+ eve = ele ? 'mouseout.jsp' : 'mouseup.jsp';
+ ele = ele || $('html');
+ ele.bind(
+ eve,
+ function()
+ {
+ arrow.removeClass('jspActive');
+ scrollTimeout && clearTimeout(scrollTimeout);
+ scrollTimeout = null;
+ ele.unbind(eve);
+ }
+ );
+ }
+
+ function initClickOnTrack()
+ {
+ removeClickOnTrack();
+ if (isScrollableV) {
+ verticalTrack.bind(
+ 'mousedown.jsp',
+ function(e)
+ {
+ if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) {
+ var clickedTrack = $(this),
+ offset = clickedTrack.offset(),
+ direction = e.pageY - offset.top - verticalDragPosition,
+ scrollTimeout,
+ isFirst = true,
+ doScroll = function()
+ {
+ var offset = clickedTrack.offset(),
+ pos = e.pageY - offset.top - verticalDragHeight / 2,
+ contentDragY = paneHeight * settings.scrollPagePercent,
+ dragY = dragMaxY * contentDragY / (contentHeight - paneHeight);
+ if (direction < 0) {
+ if (verticalDragPosition - dragY > pos) {
+ jsp.scrollByY(-contentDragY);
+ } else {
+ positionDragY(pos);
+ }
+ } else if (direction > 0) {
+ if (verticalDragPosition + dragY < pos) {
+ jsp.scrollByY(contentDragY);
+ } else {
+ positionDragY(pos);
+ }
+ } else {
+ cancelClick();
+ return;
+ }
+ scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq);
+ isFirst = false;
+ },
+ cancelClick = function()
+ {
+ scrollTimeout && clearTimeout(scrollTimeout);
+ scrollTimeout = null;
+ $(document).unbind('mouseup.jsp', cancelClick);
+ };
+ doScroll();
+ $(document).bind('mouseup.jsp', cancelClick);
+ return false;
+ }
+ }
+ );
+ }
+
+ if (isScrollableH) {
+ horizontalTrack.bind(
+ 'mousedown.jsp',
+ function(e)
+ {
+ if (e.originalTarget === undefined || e.originalTarget == e.currentTarget) {
+ var clickedTrack = $(this),
+ offset = clickedTrack.offset(),
+ direction = e.pageX - offset.left - horizontalDragPosition,
+ scrollTimeout,
+ isFirst = true,
+ doScroll = function()
+ {
+ var offset = clickedTrack.offset(),
+ pos = e.pageX - offset.left - horizontalDragWidth / 2,
+ contentDragX = paneWidth * settings.scrollPagePercent,
+ dragX = dragMaxX * contentDragX / (contentWidth - paneWidth);
+ if (direction < 0) {
+ if (horizontalDragPosition - dragX > pos) {
+ jsp.scrollByX(-contentDragX);
+ } else {
+ positionDragX(pos);
+ }
+ } else if (direction > 0) {
+ if (horizontalDragPosition + dragX < pos) {
+ jsp.scrollByX(contentDragX);
+ } else {
+ positionDragX(pos);
+ }
+ } else {
+ cancelClick();
+ return;
+ }
+ scrollTimeout = setTimeout(doScroll, isFirst ? settings.initialDelay : settings.trackClickRepeatFreq);
+ isFirst = false;
+ },
+ cancelClick = function()
+ {
+ scrollTimeout && clearTimeout(scrollTimeout);
+ scrollTimeout = null;
+ $(document).unbind('mouseup.jsp', cancelClick);
+ };
+ doScroll();
+ $(document).bind('mouseup.jsp', cancelClick);
+ return false;
+ }
+ }
+ );
+ }
+ }
+
+ function removeClickOnTrack()
+ {
+ if (horizontalTrack) {
+ horizontalTrack.unbind('mousedown.jsp');
+ }
+ if (verticalTrack) {
+ verticalTrack.unbind('mousedown.jsp');
+ }
+ }
+
+ function cancelDrag()
+ {
+ $('html').unbind('dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp');
+
+ if (verticalDrag) {
+ verticalDrag.removeClass('jspActive');
+ }
+ if (horizontalDrag) {
+ horizontalDrag.removeClass('jspActive');
+ }
+ }
+
+ function positionDragY(destY, animate)
+ {
+ if (!isScrollableV) {
+ return;
+ }
+ if (destY < 0) {
+ destY = 0;
+ } else if (destY > dragMaxY) {
+ destY = dragMaxY;
+ }
+
+ // can't just check if(animate) because false is a valid value that could be passed in...
+ if (animate === undefined) {
+ animate = settings.animateScroll;
+ }
+ if (animate) {
+ jsp.animate(verticalDrag, 'top', destY, _positionDragY);
+ } else {
+ verticalDrag.css('top', destY);
+ _positionDragY(destY);
+ }
+
+ }
+
+ function _positionDragY(destY)
+ {
+ if (destY === undefined) {
+ destY = verticalDrag.position().top;
+ }
+
+ container.scrollTop(0);
+ verticalDragPosition = destY;
+
+ var isAtTop = verticalDragPosition === 0,
+ isAtBottom = verticalDragPosition == dragMaxY,
+ percentScrolled = destY/ dragMaxY,
+ destTop = -percentScrolled * (contentHeight - paneHeight);
+
+ if (wasAtTop != isAtTop || wasAtBottom != isAtBottom) {
+ wasAtTop = isAtTop;
+ wasAtBottom = isAtBottom;
+ elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]);
+ }
+
+ updateVerticalArrows(isAtTop, isAtBottom);
+ pane.css('top', destTop);
+ elem.trigger('jsp-scroll-y', [-destTop, isAtTop, isAtBottom]).trigger('scroll');
+ }
+
+ function positionDragX(destX, animate)
+ {
+ if (!isScrollableH) {
+ return;
+ }
+ if (destX < 0) {
+ destX = 0;
+ } else if (destX > dragMaxX) {
+ destX = dragMaxX;
+ }
+
+ if (animate === undefined) {
+ animate = settings.animateScroll;
+ }
+ if (animate) {
+ jsp.animate(horizontalDrag, 'left', destX, _positionDragX);
+ } else {
+ horizontalDrag.css('left', destX);
+ _positionDragX(destX);
+ }
+ }
+
+ function _positionDragX(destX)
+ {
+ if (destX === undefined) {
+ destX = horizontalDrag.position().left;
+ }
+
+ container.scrollTop(0);
+ horizontalDragPosition = destX;
+
+ var isAtLeft = horizontalDragPosition === 0,
+ isAtRight = horizontalDragPosition == dragMaxX,
+ percentScrolled = destX / dragMaxX,
+ destLeft = -percentScrolled * (contentWidth - paneWidth);
+
+ if (wasAtLeft != isAtLeft || wasAtRight != isAtRight) {
+ wasAtLeft = isAtLeft;
+ wasAtRight = isAtRight;
+ elem.trigger('jsp-arrow-change', [wasAtTop, wasAtBottom, wasAtLeft, wasAtRight]);
+ }
+
+ updateHorizontalArrows(isAtLeft, isAtRight);
+ pane.css('left', destLeft);
+ elem.trigger('jsp-scroll-x', [-destLeft, isAtLeft, isAtRight]).trigger('scroll');
+ }
+
+ function updateVerticalArrows(isAtTop, isAtBottom)
+ {
+ if (settings.showArrows) {
+ arrowUp[isAtTop ? 'addClass' : 'removeClass']('jspDisabled');
+ arrowDown[isAtBottom ? 'addClass' : 'removeClass']('jspDisabled');
+ }
+ }
+
+ function updateHorizontalArrows(isAtLeft, isAtRight)
+ {
+ if (settings.showArrows) {
+ arrowLeft[isAtLeft ? 'addClass' : 'removeClass']('jspDisabled');
+ arrowRight[isAtRight ? 'addClass' : 'removeClass']('jspDisabled');
+ }
+ }
+
+ function scrollToY(destY, animate)
+ {
+ var percentScrolled = destY / (contentHeight - paneHeight);
+ positionDragY(percentScrolled * dragMaxY, animate);
+ }
+
+ function scrollToX(destX, animate)
+ {
+ var percentScrolled = destX / (contentWidth - paneWidth);
+ positionDragX(percentScrolled * dragMaxX, animate);
+ }
+
+ function scrollToElement(ele, stickToTop, animate)
+ {
+ var e, eleHeight, eleWidth, eleTop = 0, eleLeft = 0, viewportTop, viewportLeft, maxVisibleEleTop, maxVisibleEleLeft, destY, destX;
+
+ // Legal hash values aren't necessarily legal jQuery selectors so we need to catch any
+ // errors from the lookup...
+ try {
+ e = $(ele);
+ } catch (err) {
+ return;
+ }
+ eleHeight = e.outerHeight();
+ eleWidth= e.outerWidth();
+
+ container.scrollTop(0);
+ container.scrollLeft(0);
+
+ // loop through parents adding the offset top of any elements that are relatively positioned between
+ // the focused element and the jspPane so we can get the true distance from the top
+ // of the focused element to the top of the scrollpane...
+ while (!e.is('.jspPane')) {
+ eleTop += e.position().top;
+ eleLeft += e.position().left;
+ e = e.offsetParent();
+ if (/^body|html$/i.test(e[0].nodeName)) {
+ // we ended up too high in the document structure. Quit!
+ return;
+ }
+ }
+
+ viewportTop = contentPositionY();
+ maxVisibleEleTop = viewportTop + paneHeight;
+ if (eleTop < viewportTop || stickToTop) { // element is above viewport
+ destY = eleTop - settings.verticalGutter;
+ } else if (eleTop + eleHeight > maxVisibleEleTop) { // element is below viewport
+ destY = eleTop - paneHeight + eleHeight + settings.verticalGutter;
+ }
+ if (!isNaN(destY)) {
+ scrollToY(destY, animate);
+ }
+
+ viewportLeft = contentPositionX();
+ maxVisibleEleLeft = viewportLeft + paneWidth;
+ if (eleLeft < viewportLeft || stickToTop) { // element is to the left of viewport
+ destX = eleLeft - settings.horizontalGutter;
+ } else if (eleLeft + eleWidth > maxVisibleEleLeft) { // element is to the right viewport
+ destX = eleLeft - paneWidth + eleWidth + settings.horizontalGutter;
+ }
+ if (!isNaN(destX)) {
+ scrollToX(destX, animate);
+ }
+
+ }
+
+ function contentPositionX()
+ {
+ return -pane.position().left;
+ }
+
+ function contentPositionY()
+ {
+ return -pane.position().top;
+ }
+
+ function isCloseToBottom()
+ {
+ var scrollableHeight = contentHeight - paneHeight;
+ return (scrollableHeight > 20) && (scrollableHeight - contentPositionY() < 10);
+ }
+
+ function isCloseToRight()
+ {
+ var scrollableWidth = contentWidth - paneWidth;
+ return (scrollableWidth > 20) && (scrollableWidth - contentPositionX() < 10);
+ }
+
+ function initMousewheel()
+ {
+ container.unbind(mwEvent).bind(
+ mwEvent,
+ function (event, delta, deltaX, deltaY) {
+ var dX = horizontalDragPosition, dY = verticalDragPosition;
+ jsp.scrollBy(deltaX * settings.mouseWheelSpeed, -deltaY * settings.mouseWheelSpeed, false);
+ // return true if there was no movement so rest of screen can scroll
+ return dX == horizontalDragPosition && dY == verticalDragPosition;
+ }
+ );
+ }
+
+ function removeMousewheel()
+ {
+ container.unbind(mwEvent);
+ }
+
+ function nil()
+ {
+ return false;
+ }
+
+ function initFocusHandler()
+ {
+ pane.find(':input,a').unbind('focus.jsp').bind(
+ 'focus.jsp',
+ function(e)
+ {
+ scrollToElement(e.target, false);
+ }
+ );
+ }
+
+ function removeFocusHandler()
+ {
+ pane.find(':input,a').unbind('focus.jsp');
+ }
+
+ function initKeyboardNav()
+ {
+ var keyDown, elementHasScrolled, validParents = [];
+ isScrollableH && validParents.push(horizontalBar[0]);
+ isScrollableV && validParents.push(verticalBar[0]);
+
+ // IE also focuses elements that don't have tabindex set.
+ pane.focus(
+ function()
+ {
+ elem.focus();
+ }
+ );
+
+ elem.attr('tabindex', 0)
+ .unbind('keydown.jsp keypress.jsp')
+ .bind(
+ 'keydown.jsp',
+ function(e)
+ {
+ if (e.target !== this && !(validParents.length && $(e.target).closest(validParents).length)){
+ return;
+ }
+ var dX = horizontalDragPosition, dY = verticalDragPosition;
+ switch(e.keyCode) {
+ case 40: // down
+ case 38: // up
+ case 34: // page down
+ case 32: // space
+ case 33: // page up
+ case 39: // right
+ case 37: // left
+ keyDown = e.keyCode;
+ keyDownHandler();
+ break;
+ case 35: // end
+ scrollToY(contentHeight - paneHeight);
+ keyDown = null;
+ break;
+ case 36: // home
+ scrollToY(0);
+ keyDown = null;
+ break;
+ }
+
+ elementHasScrolled = e.keyCode == keyDown && dX != horizontalDragPosition || dY != verticalDragPosition;
+ return !elementHasScrolled;
+ }
+ ).bind(
+ 'keypress.jsp', // For FF/ OSX so that we can cancel the repeat key presses if the JSP scrolls...
+ function(e)
+ {
+ if (e.keyCode == keyDown) {
+ keyDownHandler();
+ }
+ return !elementHasScrolled;
+ }
+ );
+
+ if (settings.hideFocus) {
+ elem.css('outline', 'none');
+ if ('hideFocus' in container[0]){
+ elem.attr('hideFocus', true);
+ }
+ } else {
+ elem.css('outline', '');
+ if ('hideFocus' in container[0]){
+ elem.attr('hideFocus', false);
+ }
+ }
+
+ function keyDownHandler()
+ {
+ var dX = horizontalDragPosition, dY = verticalDragPosition;
+ switch(keyDown) {
+ case 40: // down
+ jsp.scrollByY(settings.keyboardSpeed, false);
+ break;
+ case 38: // up
+ jsp.scrollByY(-settings.keyboardSpeed, false);
+ break;
+ case 34: // page down
+ case 32: // space
+ jsp.scrollByY(paneHeight * settings.scrollPagePercent, false);
+ break;
+ case 33: // page up
+ jsp.scrollByY(-paneHeight * settings.scrollPagePercent, false);
+ break;
+ case 39: // right
+ jsp.scrollByX(settings.keyboardSpeed, false);
+ break;
+ case 37: // left
+ jsp.scrollByX(-settings.keyboardSpeed, false);
+ break;
+ }
+
+ elementHasScrolled = dX != horizontalDragPosition || dY != verticalDragPosition;
+ return elementHasScrolled;
+ }
+ }
+
+ function removeKeyboardNav()
+ {
+ elem.attr('tabindex', '-1')
+ .removeAttr('tabindex')
+ .unbind('keydown.jsp keypress.jsp');
+ }
+
+ function observeHash()
+ {
+ if (location.hash && location.hash.length > 1) {
+ var e,
+ retryInt,
+ hash = escape(location.hash.substr(1)) // hash must be escaped to prevent XSS
+ ;
+ try {
+ e = $('#' + hash + ', a[name="' + hash + '"]');
+ } catch (err) {
+ return;
+ }
+
+ if (e.length && pane.find(hash)) {
+ // nasty workaround but it appears to take a little while before the hash has done its thing
+ // to the rendered page so we just wait until the container's scrollTop has been messed up.
+ if (container.scrollTop() === 0) {
+ retryInt = setInterval(
+ function()
+ {
+ if (container.scrollTop() > 0) {
+ scrollToElement(e, true);
+ $(document).scrollTop(container.position().top);
+ clearInterval(retryInt);
+ }
+ },
+ 50
+ );
+ } else {
+ scrollToElement(e, true);
+ $(document).scrollTop(container.position().top);
+ }
+ }
+ }
+ }
+
+ function hijackInternalLinks()
+ {
+ // only register the link handler once
+ if ($(document.body).data('jspHijack')) {
+ return;
+ }
+
+ // remember that the handler was bound
+ $(document.body).data('jspHijack', true);
+
+ // use live handler to also capture newly created links
+ $(document.body).delegate('a[href*=#]', 'click', function(event) {
+ // does the link point to the same page?
+ // this also takes care of cases with a <base>-Tag or Links not starting with the hash #
+ // e.g. <a href="index.html#test"> when the current url already is index.html
+ var href = this.href.substr(0, this.href.indexOf('#')),
+ locationHref = location.href,
+ hash,
+ element,
+ container,
+ jsp,
+ scrollTop,
+ elementTop;
+ if (location.href.indexOf('#') !== -1) {
+ locationHref = location.href.substr(0, location.href.indexOf('#'));
+ }
+ if (href !== locationHref) {
+ // the link points to another page
+ return;
+ }
+
+ // check if jScrollPane should handle this click event
+ hash = escape(this.href.substr(this.href.indexOf('#') + 1));
+
+ // find the element on the page
+ element;
+ try {
+ element = $('#' + hash + ', a[name="' + hash + '"]');
+ } catch (e) {
+ // hash is not a valid jQuery identifier
+ return;
+ }
+
+ if (!element.length) {
+ // this link does not point to an element on this page
+ return;
+ }
+
+ container = element.closest('.jspScrollable');
+ jsp = container.data('jsp');
+
+ // jsp might be another jsp instance than the one, that bound this event
+ // remember: this event is only bound once for all instances.
+ jsp.scrollToElement(element, true);
+
+ if (container[0].scrollIntoView) {
+ // also scroll to the top of the container (if it is not visible)
+ scrollTop = $(window).scrollTop();
+ elementTop = element.offset().top;
+ if (elementTop < scrollTop || elementTop > scrollTop + $(window).height()) {
+ container[0].scrollIntoView();
+ }
+ }
+
+ // jsp handled this event, prevent the browser default (scrolling :P)
+ event.preventDefault();
+ });
+ }
+
+ // Init touch on iPad, iPhone, iPod, Android
+ function initTouch()
+ {
+ var startX,
+ startY,
+ touchStartX,
+ touchStartY,
+ moved,
+ moving = false;
+
+ container.unbind('touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick').bind(
+ 'touchstart.jsp',
+ function(e)
+ {
+ var touch = e.originalEvent.touches[0];
+ startX = contentPositionX();
+ startY = contentPositionY();
+ touchStartX = touch.pageX;
+ touchStartY = touch.pageY;
+ moved = false;
+ moving = true;
+ }
+ ).bind(
+ 'touchmove.jsp',
+ function(ev)
+ {
+ if(!moving) {
+ return;
+ }
+
+ var touchPos = ev.originalEvent.touches[0],
+ dX = horizontalDragPosition, dY = verticalDragPosition;
+
+ jsp.scrollTo(startX + touchStartX - touchPos.pageX, startY + touchStartY - touchPos.pageY);
+
+ moved = moved || Math.abs(touchStartX - touchPos.pageX) > 5 || Math.abs(touchStartY - touchPos.pageY) > 5;
+
+ // return true if there was no movement so rest of screen can scroll
+ return dX == horizontalDragPosition && dY == verticalDragPosition;
+ }
+ ).bind(
+ 'touchend.jsp',
+ function(e)
+ {
+ moving = false;
+ /*if(moved) {
+ return false;
+ }*/
+ }
+ ).bind(
+ 'click.jsp-touchclick',
+ function(e)
+ {
+ if(moved) {
+ moved = false;
+ return false;
+ }
+ }
+ );
+ }
+
+ function destroy(){
+ var currentY = contentPositionY(),
+ currentX = contentPositionX();
+ elem.removeClass('jspScrollable').unbind('.jsp');
+ elem.replaceWith(originalElement.append(pane.children()));
+ originalElement.scrollTop(currentY);
+ originalElement.scrollLeft(currentX);
+
+ // clear reinitialize timer if active
+ if (reinitialiseInterval) {
+ clearInterval(reinitialiseInterval);
+ }
+ }
+
+ // Public API
+ $.extend(
+ jsp,
+ {
+ // Reinitialises the scroll pane (if it's internal dimensions have changed since the last time it
+ // was initialised). The settings object which is passed in will override any settings from the
+ // previous time it was initialised - if you don't pass any settings then the ones from the previous
+ // initialisation will be used.
+ reinitialise: function(s)
+ {
+ s = $.extend({}, settings, s);
+ initialise(s);
+ },
+ // Scrolls the specified element (a jQuery object, DOM node or jQuery selector string) into view so
+ // that it can be seen within the viewport. If stickToTop is true then the element will appear at
+ // the top of the viewport, if it is false then the viewport will scroll as little as possible to
+ // show the element. You can also specify if you want animation to occur. If you don't provide this
+ // argument then the animateScroll value from the settings object is used instead.
+ scrollToElement: function(ele, stickToTop, animate)
+ {
+ scrollToElement(ele, stickToTop, animate);
+ },
+ // Scrolls the pane so that the specified co-ordinates within the content are at the top left
+ // of the viewport. animate is optional and if not passed then the value of animateScroll from
+ // the settings object this jScrollPane was initialised with is used.
+ scrollTo: function(destX, destY, animate)
+ {
+ scrollToX(destX, animate);
+ scrollToY(destY, animate);
+ },
+ // Scrolls the pane so that the specified co-ordinate within the content is at the left of the
+ // viewport. animate is optional and if not passed then the value of animateScroll from the settings
+ // object this jScrollPane was initialised with is used.
+ scrollToX: function(destX, animate)
+ {
+ scrollToX(destX, animate);
+ },
+ // Scrolls the pane so that the specified co-ordinate within the content is at the top of the
+ // viewport. animate is optional and if not passed then the value of animateScroll from the settings
+ // object this jScrollPane was initialised with is used.
+ scrollToY: function(destY, animate)
+ {
+ scrollToY(destY, animate);
+ },
+ // Scrolls the pane to the specified percentage of its maximum horizontal scroll position. animate
+ // is optional and if not passed then the value of animateScroll from the settings object this
+ // jScrollPane was initialised with is used.
+ scrollToPercentX: function(destPercentX, animate)
+ {
+ scrollToX(destPercentX * (contentWidth - paneWidth), animate);
+ },
+ // Scrolls the pane to the specified percentage of its maximum vertical scroll position. animate
+ // is optional and if not passed then the value of animateScroll from the settings object this
+ // jScrollPane was initialised with is used.
+ scrollToPercentY: function(destPercentY, animate)
+ {
+ scrollToY(destPercentY * (contentHeight - paneHeight), animate);
+ },
+ // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
+ // the value of animateScroll from the settings object this jScrollPane was initialised with is used.
+ scrollBy: function(deltaX, deltaY, animate)
+ {
+ jsp.scrollByX(deltaX, animate);
+ jsp.scrollByY(deltaY, animate);
+ },
+ // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
+ // the value of animateScroll from the settings object this jScrollPane was initialised with is used.
+ scrollByX: function(deltaX, animate)
+ {
+ var destX = contentPositionX() + Math[deltaX<0 ? 'floor' : 'ceil'](deltaX),
+ percentScrolled = destX / (contentWidth - paneWidth);
+ positionDragX(percentScrolled * dragMaxX, animate);
+ },
+ // Scrolls the pane by the specified amount of pixels. animate is optional and if not passed then
+ // the value of animateScroll from the settings object this jScrollPane was initialised with is used.
+ scrollByY: function(deltaY, animate)
+ {
+ var destY = contentPositionY() + Math[deltaY<0 ? 'floor' : 'ceil'](deltaY),
+ percentScrolled = destY / (contentHeight - paneHeight);
+ positionDragY(percentScrolled * dragMaxY, animate);
+ },
+ // Positions the horizontal drag at the specified x position (and updates the viewport to reflect
+ // this). animate is optional and if not passed then the value of animateScroll from the settings
+ // object this jScrollPane was initialised with is used.
+ positionDragX: function(x, animate)
+ {
+ positionDragX(x, animate);
+ },
+ // Positions the vertical drag at the specified y position (and updates the viewport to reflect
+ // this). animate is optional and if not passed then the value of animateScroll from the settings
+ // object this jScrollPane was initialised with is used.
+ positionDragY: function(y, animate)
+ {
+ positionDragY(y, animate);
+ },
+ // This method is called when jScrollPane is trying to animate to a new position. You can override
+ // it if you want to provide advanced animation functionality. It is passed the following arguments:
+ // * ele - the element whose position is being animated
+ // * prop - the property that is being animated
+ // * value - the value it's being animated to
+ // * stepCallback - a function that you must execute each time you update the value of the property
+ // You can use the default implementation (below) as a starting point for your own implementation.
+ animate: function(ele, prop, value, stepCallback)
+ {
+ var params = {};
+ params[prop] = value;
+ ele.animate(
+ params,
+ {
+ 'duration' : settings.animateDuration,
+ 'easing' : settings.animateEase,
+ 'queue' : false,
+ 'step' : stepCallback
+ }
+ );
+ },
+ // Returns the current x position of the viewport with regards to the content pane.
+ getContentPositionX: function()
+ {
+ return contentPositionX();
+ },
+ // Returns the current y position of the viewport with regards to the content pane.
+ getContentPositionY: function()
+ {
+ return contentPositionY();
+ },
+ // Returns the width of the content within the scroll pane.
+ getContentWidth: function()
+ {
+ return contentWidth;
+ },
+ // Returns the height of the content within the scroll pane.
+ getContentHeight: function()
+ {
+ return contentHeight;
+ },
+ // Returns the horizontal position of the viewport within the pane content.
+ getPercentScrolledX: function()
+ {
+ return contentPositionX() / (contentWidth - paneWidth);
+ },
+ // Returns the vertical position of the viewport within the pane content.
+ getPercentScrolledY: function()
+ {
+ return contentPositionY() / (contentHeight - paneHeight);
+ },
+ // Returns whether or not this scrollpane has a horizontal scrollbar.
+ getIsScrollableH: function()
+ {
+ return isScrollableH;
+ },
+ // Returns whether or not this scrollpane has a vertical scrollbar.
+ getIsScrollableV: function()
+ {
+ return isScrollableV;
+ },
+ // Gets a reference to the content pane. It is important that you use this method if you want to
+ // edit the content of your jScrollPane as if you access the element directly then you may have some
+ // problems (as your original element has had additional elements for the scrollbars etc added into
+ // it).
+ getContentPane: function()
+ {
+ return pane;
+ },
+ // Scrolls this jScrollPane down as far as it can currently scroll. If animate isn't passed then the
+ // animateScroll value from settings is used instead.
+ scrollToBottom: function(animate)
+ {
+ positionDragY(dragMaxY, animate);
+ },
+ // Hijacks the links on the page which link to content inside the scrollpane. If you have changed
+ // the content of your page (e.g. via AJAX) and want to make sure any new anchor links to the
+ // contents of your scroll pane will work then call this function.
+ hijackInternalLinks: $.noop,
+ // Removes the jScrollPane and returns the page to the state it was in before jScrollPane was
+ // initialised.
+ destroy: function()
+ {
+ destroy();
+ }
+ }
+ );
+
+ initialise(s);
+ }
+
+ // Pluginifying code...
+ settings = $.extend({}, $.fn.jScrollPane.defaults, settings);
+
+ // Apply default speed
+ $.each(['arrowButtonSpeed', 'trackClickSpeed', 'keyboardSpeed'], function() {
+ settings[this] = settings[this] || settings.speed;
+ });
+
+ return this.each(
+ function()
+ {
+ var elem = $(this), jspApi = elem.data('jsp');
+ if (jspApi) {
+ jspApi.reinitialise(settings);
+ } else {
+ $("script",elem).filter('[type="text/javascript"],:not([type])').remove();
+ jspApi = new JScrollPane(elem, settings);
+ elem.data('jsp', jspApi);
+ }
+ }
+ );
+ };
+
+ $.fn.jScrollPane.defaults = {
+ showArrows : false,
+ maintainPosition : true,
+ stickToBottom : false,
+ stickToRight : false,
+ clickOnTrack : true,
+ autoReinitialise : false,
+ autoReinitialiseDelay : 500,
+ verticalDragMinHeight : 0,
+ verticalDragMaxHeight : 99999,
+ horizontalDragMinWidth : 0,
+ horizontalDragMaxWidth : 99999,
+ contentWidth : undefined,
+ animateScroll : false,
+ animateDuration : 300,
+ animateEase : 'linear',
+ hijackInternalLinks : false,
+ verticalGutter : 4,
+ horizontalGutter : 4,
+ mouseWheelSpeed : 3,
+ arrowButtonSpeed : 0,
+ arrowRepeatFreq : 50,
+ arrowScrollOnHover : false,
+ trackClickSpeed : 0,
+ trackClickRepeatFreq : 70,
+ verticalArrowPositions : 'split',
+ horizontalArrowPositions : 'split',
+ enableKeyboardNavigation : true,
+ hideFocus : false,
+ keyboardSpeed : 0,
+ initialDelay : 300, // Delay before starting repeating
+ speed : 30, // Default speed when others falsey
+ scrollPagePercent : .8 // Percent of visible area scrolled when pageUp/Down or track area pressed
+ };
+
+})(jQuery,this);
+
diff --git a/src/ext/jscrollpane/jquery.jscrollpane.min.js b/src/ext/jscrollpane/jquery.jscrollpane.min.js
deleted file mode 100644
index d7d9cae76..000000000
--- a/src/ext/jscrollpane/jquery.jscrollpane.min.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*!
- * jScrollPane - v2.0.14 - 2013-05-01
- * http://jscrollpane.kelvinluck.com/
- *
- * Copyright (c) 2010 Kelvin Luck
- * Dual licensed under the MIT or GPL licenses.
- */
-(function(b,a,c){b.fn.jScrollPane=function(e){function d(D,O){var ay,Q=this,Y,aj,v,al,T,Z,y,q,az,aE,au,i,I,h,j,aa,U,ap,X,t,A,aq,af,am,G,l,at,ax,x,av,aH,f,L,ai=true,P=true,aG=false,k=false,ao=D.clone(false,false).empty(),ac=b.fn.mwheelIntent?"mwheelIntent.jsp":"mousewheel.jsp";aH=D.css("paddingTop")+" "+D.css("paddingRight")+" "+D.css("paddingBottom")+" "+D.css("paddingLeft");f=(parseInt(D.css("paddingLeft"),10)||0)+(parseInt(D.css("paddingRight"),10)||0);function ar(aQ){var aL,aN,aM,aJ,aI,aP,aO=false,aK=false;ay=aQ;if(Y===c){aI=D.scrollTop();aP=D.scrollLeft();D.css({overflow:"hidden",padding:0});aj=D.innerWidth()+f;v=D.innerHeight();D.width(aj);Y=b('<div class="jspPane" />').css("padding",aH).append(D.children());al=b('<div class="jspContainer" />').css({width:aj+"px",height:v+"px"}).append(Y).appendTo(D)}else{D.css("width","");aO=ay.stickToBottom&&K();aK=ay.stickToRight&&B();aJ=D.innerWidth()+f!=aj||D.outerHeight()!=v;if(aJ){aj=D.innerWidth()+f;v=D.innerHeight();al.css({width:aj+"px",height:v+"px"})}if(!aJ&&L==T&&Y.outerHeight()==Z){D.width(aj);return}L=T;Y.css("width","");D.width(aj);al.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()}Y.css("overflow","auto");if(aQ.contentWidth){T=aQ.contentWidth}else{T=Y[0].scrollWidth}Z=Y[0].scrollHeight;Y.css("overflow","");y=T/aj;q=Z/v;az=q>1;aE=y>1;if(!(aE||az)){D.removeClass("jspScrollable");Y.css({top:0,width:al.width()-f});n();E();R();w()}else{D.addClass("jspScrollable");aL=ay.maintainPosition&&(I||aa);if(aL){aN=aC();aM=aA()}aF();z();F();if(aL){N(aK?(T-aj):aN,false);M(aO?(Z-v):aM,false)}J();ag();an();if(ay.enableKeyboardNavigation){S()}if(ay.clickOnTrack){p()}C();if(ay.hijackInternalLinks){m()}}if(ay.autoReinitialise&&!av){av=setInterval(function(){ar(ay)},ay.autoReinitialiseDelay)}else{if(!ay.autoReinitialise&&av){clearInterval(av)}}aI&&D.scrollTop(0)&&M(aI,false);aP&&D.scrollLeft(0)&&N(aP,false);D.trigger("jsp-initialised",[aE||az])}function aF(){if(az){al.append(b('<div class="jspVerticalBar" />').append(b('<div class="jspCap jspCapTop" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragTop" />'),b('<div class="jspDragBottom" />'))),b('<div class="jspCap jspCapBottom" />')));U=al.find(">.jspVerticalBar");ap=U.find(">.jspTrack");au=ap.find(">.jspDrag");if(ay.showArrows){aq=b('<a class="jspArrow jspArrowUp" />').bind("mousedown.jsp",aD(0,-1)).bind("click.jsp",aB);af=b('<a class="jspArrow jspArrowDown" />').bind("mousedown.jsp",aD(0,1)).bind("click.jsp",aB);if(ay.arrowScrollOnHover){aq.bind("mouseover.jsp",aD(0,-1,aq));af.bind("mouseover.jsp",aD(0,1,af))}ak(ap,ay.verticalArrowPositions,aq,af)}t=v;al.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){t-=b(this).outerHeight()});au.hover(function(){au.addClass("jspHover")},function(){au.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);au.addClass("jspActive");var s=aI.pageY-au.position().top;b("html").bind("mousemove.jsp",function(aJ){V(aJ.pageY-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});o()}}function o(){ap.height(t+"px");I=0;X=ay.verticalGutter+ap.outerWidth();Y.width(aj-X-f);try{if(U.position().left===0){Y.css("margin-left",X+"px")}}catch(s){}}function z(){if(aE){al.append(b('<div class="jspHorizontalBar" />').append(b('<div class="jspCap jspCapLeft" />'),b('<div class="jspTrack" />').append(b('<div class="jspDrag" />').append(b('<div class="jspDragLeft" />'),b('<div class="jspDragRight" />'))),b('<div class="jspCap jspCapRight" />')));am=al.find(">.jspHorizontalBar");G=am.find(">.jspTrack");h=G.find(">.jspDrag");if(ay.showArrows){ax=b('<a class="jspArrow jspArrowLeft" />').bind("mousedown.jsp",aD(-1,0)).bind("click.jsp",aB);x=b('<a class="jspArrow jspArrowRight" />').bind("mousedown.jsp",aD(1,0)).bind("click.jsp",aB);
-if(ay.arrowScrollOnHover){ax.bind("mouseover.jsp",aD(-1,0,ax));x.bind("mouseover.jsp",aD(1,0,x))}ak(G,ay.horizontalArrowPositions,ax,x)}h.hover(function(){h.addClass("jspHover")},function(){h.removeClass("jspHover")}).bind("mousedown.jsp",function(aI){b("html").bind("dragstart.jsp selectstart.jsp",aB);h.addClass("jspActive");var s=aI.pageX-h.position().left;b("html").bind("mousemove.jsp",function(aJ){W(aJ.pageX-s,false)}).bind("mouseup.jsp mouseleave.jsp",aw);return false});l=al.innerWidth();ah()}}function ah(){al.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){l-=b(this).outerWidth()});G.width(l+"px");aa=0}function F(){if(aE&&az){var aI=G.outerHeight(),s=ap.outerWidth();t-=aI;b(am).find(">.jspCap:visible,>.jspArrow").each(function(){l+=b(this).outerWidth()});l-=s;v-=s;aj-=aI;G.parent().append(b('<div class="jspCorner" />').css("width",aI+"px"));o();ah()}if(aE){Y.width((al.outerWidth()-f)+"px")}Z=Y.outerHeight();q=Z/v;if(aE){at=Math.ceil(1/y*l);if(at>ay.horizontalDragMaxWidth){at=ay.horizontalDragMaxWidth}else{if(at<ay.horizontalDragMinWidth){at=ay.horizontalDragMinWidth}}h.width(at+"px");j=l-at;ae(aa)}if(az){A=Math.ceil(1/q*t);if(A>ay.verticalDragMaxHeight){A=ay.verticalDragMaxHeight}else{if(A<ay.verticalDragMinHeight){A=ay.verticalDragMinHeight}}au.height(A+"px");i=t-A;ad(I)}}function ak(aJ,aL,aI,s){var aN="before",aK="after",aM;if(aL=="os"){aL=/Mac/.test(navigator.platform)?"after":"split"}if(aL==aN){aK=aL}else{if(aL==aK){aN=aL;aM=aI;aI=s;s=aM}}aJ[aN](aI)[aK](s)}function aD(aI,s,aJ){return function(){H(aI,s,this,aJ);this.blur();return false}}function H(aL,aK,aO,aN){aO=b(aO).addClass("jspActive");var aM,aJ,aI=true,s=function(){if(aL!==0){Q.scrollByX(aL*ay.arrowButtonSpeed)}if(aK!==0){Q.scrollByY(aK*ay.arrowButtonSpeed)}aJ=setTimeout(s,aI?ay.initialDelay:ay.arrowRepeatFreq);aI=false};s();aM=aN?"mouseout.jsp":"mouseup.jsp";aN=aN||b("html");aN.bind(aM,function(){aO.removeClass("jspActive");aJ&&clearTimeout(aJ);aJ=null;aN.unbind(aM)})}function p(){w();if(az){ap.bind("mousedown.jsp",function(aN){if(aN.originalTarget===c||aN.originalTarget==aN.currentTarget){var aL=b(this),aO=aL.offset(),aM=aN.pageY-aO.top-I,aJ,aI=true,s=function(){var aR=aL.offset(),aS=aN.pageY-aR.top-A/2,aP=v*ay.scrollPagePercent,aQ=i*aP/(Z-v);if(aM<0){if(I-aQ>aS){Q.scrollByY(-aP)}else{V(aS)}}else{if(aM>0){if(I+aQ<aS){Q.scrollByY(aP)}else{V(aS)}}else{aK();return}}aJ=setTimeout(s,aI?ay.initialDelay:ay.trackClickRepeatFreq);aI=false},aK=function(){aJ&&clearTimeout(aJ);aJ=null;b(document).unbind("mouseup.jsp",aK)};s();b(document).bind("mouseup.jsp",aK);return false}})}if(aE){G.bind("mousedown.jsp",function(aN){if(aN.originalTarget===c||aN.originalTarget==aN.currentTarget){var aL=b(this),aO=aL.offset(),aM=aN.pageX-aO.left-aa,aJ,aI=true,s=function(){var aR=aL.offset(),aS=aN.pageX-aR.left-at/2,aP=aj*ay.scrollPagePercent,aQ=j*aP/(T-aj);if(aM<0){if(aa-aQ>aS){Q.scrollByX(-aP)}else{W(aS)}}else{if(aM>0){if(aa+aQ<aS){Q.scrollByX(aP)}else{W(aS)}}else{aK();return}}aJ=setTimeout(s,aI?ay.initialDelay:ay.trackClickRepeatFreq);aI=false},aK=function(){aJ&&clearTimeout(aJ);aJ=null;b(document).unbind("mouseup.jsp",aK)};s();b(document).bind("mouseup.jsp",aK);return false}})}}function w(){if(G){G.unbind("mousedown.jsp")}if(ap){ap.unbind("mousedown.jsp")}}function aw(){b("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp");if(au){au.removeClass("jspActive")}if(h){h.removeClass("jspActive")}}function V(s,aI){if(!az){return}if(s<0){s=0}else{if(s>i){s=i}}if(aI===c){aI=ay.animateScroll}if(aI){Q.animate(au,"top",s,ad)}else{au.css("top",s);ad(s)}}function ad(aI){if(aI===c){aI=au.position().top}al.scrollTop(0);I=aI;var aL=I===0,aJ=I==i,aK=aI/i,s=-aK*(Z-v);if(ai!=aL||aG!=aJ){ai=aL;aG=aJ;D.trigger("jsp-arrow-change",[ai,aG,P,k])}u(aL,aJ);Y.css("top",s);D.trigger("jsp-scroll-y",[-s,aL,aJ]).trigger("scroll")}function W(aI,s){if(!aE){return}if(aI<0){aI=0}else{if(aI>j){aI=j}}if(s===c){s=ay.animateScroll}if(s){Q.animate(h,"left",aI,ae)
-}else{h.css("left",aI);ae(aI)}}function ae(aI){if(aI===c){aI=h.position().left}al.scrollTop(0);aa=aI;var aL=aa===0,aK=aa==j,aJ=aI/j,s=-aJ*(T-aj);if(P!=aL||k!=aK){P=aL;k=aK;D.trigger("jsp-arrow-change",[ai,aG,P,k])}r(aL,aK);Y.css("left",s);D.trigger("jsp-scroll-x",[-s,aL,aK]).trigger("scroll")}function u(aI,s){if(ay.showArrows){aq[aI?"addClass":"removeClass"]("jspDisabled");af[s?"addClass":"removeClass"]("jspDisabled")}}function r(aI,s){if(ay.showArrows){ax[aI?"addClass":"removeClass"]("jspDisabled");x[s?"addClass":"removeClass"]("jspDisabled")}}function M(s,aI){var aJ=s/(Z-v);V(aJ*i,aI)}function N(aI,s){var aJ=aI/(T-aj);W(aJ*j,s)}function ab(aV,aQ,aJ){var aN,aK,aL,s=0,aU=0,aI,aP,aO,aS,aR,aT;try{aN=b(aV)}catch(aM){return}aK=aN.outerHeight();aL=aN.outerWidth();al.scrollTop(0);al.scrollLeft(0);while(!aN.is(".jspPane")){s+=aN.position().top;aU+=aN.position().left;aN=aN.offsetParent();if(/^body|html$/i.test(aN[0].nodeName)){return}}aI=aA();aO=aI+v;if(s<aI||aQ){aR=s-ay.verticalGutter}else{if(s+aK>aO){aR=s-v+aK+ay.verticalGutter}}if(aR){M(aR,aJ)}aP=aC();aS=aP+aj;if(aU<aP||aQ){aT=aU-ay.horizontalGutter}else{if(aU+aL>aS){aT=aU-aj+aL+ay.horizontalGutter}}if(aT){N(aT,aJ)}}function aC(){return -Y.position().left}function aA(){return -Y.position().top}function K(){var s=Z-v;return(s>20)&&(s-aA()<10)}function B(){var s=T-aj;return(s>20)&&(s-aC()<10)}function ag(){al.unbind(ac).bind(ac,function(aL,aM,aK,aI){var aJ=aa,s=I;Q.scrollBy(aK*ay.mouseWheelSpeed,-aI*ay.mouseWheelSpeed,false);return aJ==aa&&s==I})}function n(){al.unbind(ac)}function aB(){return false}function J(){Y.find(":input,a").unbind("focus.jsp").bind("focus.jsp",function(s){ab(s.target,false)})}function E(){Y.find(":input,a").unbind("focus.jsp")}function S(){var s,aI,aK=[];aE&&aK.push(am[0]);az&&aK.push(U[0]);Y.focus(function(){D.focus()});D.attr("tabindex",0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp",function(aN){if(aN.target!==this&&!(aK.length&&b(aN.target).closest(aK).length)){return}var aM=aa,aL=I;switch(aN.keyCode){case 40:case 38:case 34:case 32:case 33:case 39:case 37:s=aN.keyCode;aJ();break;case 35:M(Z-v);s=null;break;case 36:M(0);s=null;break}aI=aN.keyCode==s&&aM!=aa||aL!=I;return !aI}).bind("keypress.jsp",function(aL){if(aL.keyCode==s){aJ()}return !aI});if(ay.hideFocus){D.css("outline","none");if("hideFocus" in al[0]){D.attr("hideFocus",true)}}else{D.css("outline","");if("hideFocus" in al[0]){D.attr("hideFocus",false)}}function aJ(){var aM=aa,aL=I;switch(s){case 40:Q.scrollByY(ay.keyboardSpeed,false);break;case 38:Q.scrollByY(-ay.keyboardSpeed,false);break;case 34:case 32:Q.scrollByY(v*ay.scrollPagePercent,false);break;case 33:Q.scrollByY(-v*ay.scrollPagePercent,false);break;case 39:Q.scrollByX(ay.keyboardSpeed,false);break;case 37:Q.scrollByX(-ay.keyboardSpeed,false);break}aI=aM!=aa||aL!=I;return aI}}function R(){D.attr("tabindex","-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")}function C(){if(location.hash&&location.hash.length>1){var aK,aI,aJ=escape(location.hash.substr(1));try{aK=b("#"+aJ+', a[name="'+aJ+'"]')}catch(s){return}if(aK.length&&Y.find(aJ)){if(al.scrollTop()===0){aI=setInterval(function(){if(al.scrollTop()>0){ab(aK,true);b(document).scrollTop(al.position().top);clearInterval(aI)}},50)}else{ab(aK,true);b(document).scrollTop(al.position().top)}}}}function m(){if(b(document.body).data("jspHijack")){return}b(document.body).data("jspHijack",true);b(document.body).delegate("a[href*=#]","click",function(s){var aI=this.href.substr(0,this.href.indexOf("#")),aK=location.href,aO,aP,aJ,aM,aL,aN;if(location.href.indexOf("#")!==-1){aK=location.href.substr(0,location.href.indexOf("#"))}if(aI!==aK){return}aO=escape(this.href.substr(this.href.indexOf("#")+1));aP;try{aP=b("#"+aO+', a[name="'+aO+'"]')}catch(aQ){return}if(!aP.length){return}aJ=aP.closest(".jspScrollable");aM=aJ.data("jsp");aM.scrollToElement(aP,true);if(aJ[0].scrollIntoView){aL=b(a).scrollTop();aN=aP.offset().top;if(aN<aL||aN>aL+b(a).height()){aJ[0].scrollIntoView()}}s.preventDefault()
-})}function an(){var aJ,aI,aL,aK,aM,s=false;al.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp",function(aN){var aO=aN.originalEvent.touches[0];aJ=aC();aI=aA();aL=aO.pageX;aK=aO.pageY;aM=false;s=true}).bind("touchmove.jsp",function(aQ){if(!s){return}var aP=aQ.originalEvent.touches[0],aO=aa,aN=I;Q.scrollTo(aJ+aL-aP.pageX,aI+aK-aP.pageY);aM=aM||Math.abs(aL-aP.pageX)>5||Math.abs(aK-aP.pageY)>5;return aO==aa&&aN==I}).bind("touchend.jsp",function(aN){s=false}).bind("click.jsp-touchclick",function(aN){if(aM){aM=false;return false}})}function g(){var s=aA(),aI=aC();D.removeClass("jspScrollable").unbind(".jsp");D.replaceWith(ao.append(Y.children()));ao.scrollTop(s);ao.scrollLeft(aI);if(av){clearInterval(av)}}b.extend(Q,{reinitialise:function(aI){aI=b.extend({},ay,aI);ar(aI)},scrollToElement:function(aJ,aI,s){ab(aJ,aI,s)},scrollTo:function(aJ,s,aI){N(aJ,aI);M(s,aI)},scrollToX:function(aI,s){N(aI,s)},scrollToY:function(s,aI){M(s,aI)},scrollToPercentX:function(aI,s){N(aI*(T-aj),s)},scrollToPercentY:function(aI,s){M(aI*(Z-v),s)},scrollBy:function(aI,s,aJ){Q.scrollByX(aI,aJ);Q.scrollByY(s,aJ)},scrollByX:function(s,aJ){var aI=aC()+Math[s<0?"floor":"ceil"](s),aK=aI/(T-aj);W(aK*j,aJ)},scrollByY:function(s,aJ){var aI=aA()+Math[s<0?"floor":"ceil"](s),aK=aI/(Z-v);V(aK*i,aJ)},positionDragX:function(s,aI){W(s,aI)},positionDragY:function(aI,s){V(aI,s)},animate:function(aI,aL,s,aK){var aJ={};aJ[aL]=s;aI.animate(aJ,{duration:ay.animateDuration,easing:ay.animateEase,queue:false,step:aK})},getContentPositionX:function(){return aC()},getContentPositionY:function(){return aA()},getContentWidth:function(){return T},getContentHeight:function(){return Z},getPercentScrolledX:function(){return aC()/(T-aj)},getPercentScrolledY:function(){return aA()/(Z-v)},getIsScrollableH:function(){return aE},getIsScrollableV:function(){return az},getContentPane:function(){return Y},scrollToBottom:function(s){V(i,s)},hijackInternalLinks:b.noop,destroy:function(){g()}});ar(O)}e=b.extend({},b.fn.jScrollPane.defaults,e);b.each(["arrowButtonSpeed","trackClickSpeed","keyboardSpeed"],function(){e[this]=e[this]||e.speed});return this.each(function(){var f=b(this),g=f.data("jsp");if(g){g.reinitialise(e)}else{b("script",f).filter('[type="text/javascript"],:not([type])').remove();g=new d(f,e);f.data("jsp",g)}})};b.fn.jScrollPane.defaults={showArrows:false,maintainPosition:true,stickToBottom:false,stickToRight:false,clickOnTrack:true,autoReinitialise:false,autoReinitialiseDelay:500,verticalDragMinHeight:0,verticalDragMaxHeight:99999,horizontalDragMinWidth:0,horizontalDragMaxWidth:99999,contentWidth:c,animateScroll:false,animateDuration:300,animateEase:"linear",hijackInternalLinks:false,verticalGutter:4,horizontalGutter:4,mouseWheelSpeed:3,arrowButtonSpeed:0,arrowRepeatFreq:50,arrowScrollOnHover:false,trackClickSpeed:0,trackClickRepeatFreq:70,verticalArrowPositions:"split",horizontalArrowPositions:"split",enableKeyboardNavigation:true,hideFocus:false,keyboardSpeed:0,initialDelay:300,speed:30,scrollPagePercent:0.8}})(jQuery,this);
\ No newline at end of file
diff --git a/src/ext/jscrollpane/version-2.0.14 b/src/ext/jscrollpane/version-2.0.17
similarity index 100%
rename from src/ext/jscrollpane/version-2.0.14
rename to src/ext/jscrollpane/version-2.0.17
diff --git a/src/index.html b/src/index.html
index 64180508e..009a1151e 100644
--- a/src/index.html
+++ b/src/index.html
@@ -78,9 +78,9 @@
<!-- link.dev --> <script type="text/javascript" src="ext/jscrollpane/jquery.mousewheel.js"></script>
<!-- link.dev --> <script type="text/javascript" src="ext/jscrollpane/mwheelIntent.js"></script>
- <!-- link.dev --> <script type="text/javascript" src="ext/jscrollpane/jquery.jscrollpane.min.js"></script>
+ <!-- link.dev --> <script type="text/javascript" src="ext/jscrollpane/jquery.jscrollpane.js"></script>
- <!-- link.dev --> <script type="text/javascript" src="ext/mobiscroll/mobiscroll.core.js"></script>
+ <!-- link.dev --> <script type="text/javascript" src="ext/mobiscroll/mobiscroll.core.js"></script>
<!-- link.dev --> <script type="text/javascript" src="ext/mobiscroll/mobiscroll.datetime.js"></script>
<!-- link.dev --> <script type="text/javascript" src="ext/mobiscroll/mobiscroll.select.js"></script>
<!-- link.dev --> <script type="text/javascript" src="ext/mobiscroll/mobiscroll.jqm.js"></script>
@@ -224,6 +224,7 @@
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Widget/Projection.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Widget/LayerSideBar.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Widget/ActiveLayers.js"></script>
+ <!-- link.dev --> <script type="text/javascript" src="js/Worldview/Widget/AddLayers.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Widget/Map.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Widget/Palette.js"></script>
<!-- link.dev --> <script type="text/javascript" src="js/Worldview/Widget/WorldviewMap.js"></script>
diff --git a/src/js/Worldview.js b/src/js/Worldview.js
index cc60252db..cf903bb77 100644
--- a/src/js/Worldview.js
+++ b/src/js/Worldview.js
@@ -61,6 +61,19 @@
// Width boundary in pixels where desktop mode switches to mobile.
ns.TRANSITION_WIDTH = 720;
+ ns.LAYER_TYPES = {
+ baselayers: {
+ id: "baselayers",
+ camel: "BaseLayers",
+ description: "Base Layers"
+ },
+ overlays: {
+ id: "overlays",
+ camel: "Overlays",
+ description: "Overlays"
+ }
+ };
+
/**
* Determines if Worldview is being run in development mode.
*
@@ -459,15 +472,8 @@
return $(arr1).not(arr2).length == 0 && $(arr2).not(arr1).length == 0;
};
- ns.abbreviate = function(size, text) {
- if ( text.length <= size ) {
- return text;
- }
- // Remove elipsis size
- var s = size - 3;
- var left = Math.ceil(s / 2);
- var right = -Math.floor(s / 2);
- return text.slice(0, left) + "..." + text.slice(right);
+ ns.id = function(value) {
+ return value.replace(/:/g,"colon");
};
})(window.Worldview = window.Worldview || {});
diff --git a/src/js/Worldview/Models/Layers.js b/src/js/Worldview/Models/Layers.js
index ab59ebe33..fbaf17ac2 100644
--- a/src/js/Worldview/Models/Layers.js
+++ b/src/js/Worldview/Models/Layers.js
@@ -52,6 +52,17 @@ Worldview.Models.Layers = function(config, projectionModel) {
return results;
};
+ self.count = function(type, projection) {
+ projection = projection || projectionModel.selected;
+ var layers = self.forProjection(projection);
+ return layers[type].length;
+ };
+
+ self.total = function(projection) {
+ return self.count("baselayers", projection) +
+ self.count("overlays", projection);
+ };
+
self.add = function(type, id, hidden) {
var layer = getLayer(id);
if ( $.inArray(layer, self.active[type]) >= 0 ) {
@@ -81,6 +92,17 @@ Worldview.Models.Layers = function(config, projectionModel) {
}
};
+ self.isActive = function(type, id) {
+ var answer = false;
+ $.each(self.active[type], function(index, layer) {
+ if ( id === layer.id ) {
+ answer = true;
+ return false;
+ }
+ });
+ return answer;
+ };
+
self.toPermalink = function() {
var types = [];
$.each(self.forProjection(), function(type, layers) {
diff --git a/src/js/Worldview/Models/Projection.js b/src/js/Worldview/Models/Projection.js
index 09b0fc3dc..5696d097b 100644
--- a/src/js/Worldview/Models/Projection.js
+++ b/src/js/Worldview/Models/Projection.js
@@ -17,12 +17,6 @@ Worldview.Models.Projection = function(config) {
var self = {};
- var projections = {
- geographic: { epsg: 4326, crs: "EPSG:4326" },
- arctic: { epsg: 3413, crs: "EPSG:3413" },
- antarctic: { epsg: 3031, crs: "EPSG:3031 "}
- };
-
self.selected = null;
self.epsg = null;
self.crs = null;
@@ -33,14 +27,14 @@ Worldview.Models.Projection = function(config) {
};
self.set = function(projection) {
- var p = projections[projection];
- if ( !p ) {
+ var p = config.projections[projection];
+ if ( !p || p.virtual ) {
throw new Error("Invalid projection: " + projection);
}
- if ( self.projection === projection ) {
+ if ( self.selected === projection ) {
return;
}
- self.selected = projection;
+ self.selected = p.name;
self.epsg = p.epsg;
self.crs = p.crs;
self.events.trigger("change", self.selected, {
diff --git a/src/js/Worldview/Widget/ActiveLayers.js b/src/js/Worldview/Widget/ActiveLayers.js
index 330b043f7..5ffcf387b 100644
--- a/src/js/Worldview/Widget/ActiveLayers.js
+++ b/src/js/Worldview/Widget/ActiveLayers.js
@@ -15,12 +15,12 @@ Worldview.Widget.ActiveLayers = function(config, model, projectionModel) {
var log = Logging.getLogger("Widget.ActiveLayers");
var aoi = config.aoi;
- var types = [
- {id: "baselayers", camel: "BaseLayers", description: "Base Layers"},
- {id: "overlays", camel: "Overlays", description: "Overlays"}
- ];
+ var types = Worldview.LAYER_TYPES;
var jsp;
+ var ICON_VISIBLE = "images/visible.png";
+ var ICON_HIDDEN = "images/invisible.png";
+
var self = {};
self.id = "products";
self.selector = "#products";
@@ -28,10 +28,12 @@ Worldview.Widget.ActiveLayers = function(config, model, projectionModel) {
var init = function() {
render();
model.events
+ .on("add", onLayerAdded)
.on("remove", onLayerRemoved)
.on("visibility", onLayerVisibility);
projectionModel.events
.on("change", render);
+ $(window).resize(resize);
};
var render = function() {
@@ -39,16 +41,14 @@ Worldview.Widget.ActiveLayers = function(config, model, projectionModel) {
$container.empty();
var tabs_height = $(".ui-tabs-nav").outerHeight(true);
- $(self.selector).addClass('bank');
- $(self.selector).height(
+ $container.addClass('bank');
+ $container.height(
$(self.selector).parent().outerHeight() - tabs_height
);
- var html = [];
$.each(types, function(index, type) {
- html.push(renderType(type));
+ renderType($container, type);
});
- $(self.selector).html(html.join("\n"));
//this.renderCanvases();
@@ -64,67 +64,92 @@ Worldview.Widget.ActiveLayers = function(config, model, projectionModel) {
containment: "parent",
tolerance: "pointer"
});
- if ( $(window).width() > Worldview.TRANSITION_WIDTH ) {
- if ( jsp ) {
- var api = jsp.data('jsp');
- if ( api ) {
- api.destroy();
- }
- }
- this.jsp = $("." + self.id + "category")
- .jScrollPane({autoReinitialise: false, verticalGutter:0});
- }
$("." + self.id + "category li").disableSelection();
- //$("." + this.id + "category").bind('sortstop',{self:this},SOTE.widget.Bank.handleSort);
+ $("." + self.id + "category").bind('sortstop', reorder);
- //setTimeout(SOTE.widget.Bank.adjustCategoryHeights,1,{self:this});
-
- /* MCG
- // Mark the component as ready in the registry if called via init()
- if ((this.initRenderComplete === false) && REGISTRY) {
- this.initRenderComplete = true;
- REGISTRY.markComponentReady(this.id);
- }
- END MCG */
+ setTimeout(resize, 1);
};
- var renderType = function(type) {
- var html = [];
- html.push(
- "<div id='" + self.id + type.camel + "' class='categoryContainer'>" +
- "<h3 class='head'>" + type.description + "</h3>" +
- "<ul id='" + type.id + "' class='" + self.id +
- "category category'>");
+ var renderType = function($parent, type) {
+ var $container = $("<div></div>")
+ .attr("id", self.id + type.camel)
+ .addClass("categoryContainer");
+
+ var $header = $("<h3></h3>")
+ .addClass("head")
+ .html(type.description);
+
+ var $layers = $("<ul></ul>")
+ .attr("id", type.id)
+ .addClass(self.id + "category")
+ .addClass("category");
$.each(model.forProjection()[type.id], function(index, layer) {
- html.push(
- "<li id='" + type.id + "-" + id(layer.id) + "' class='" +
- self.id + "item item'>" +
- "<a>" +
- "<img class='close bank-item-img' id='close|" +
- type.id + "|" + id(layer.id) +
- "' title='Remove Layer' " +
- "src='images/close-red-x.png'/>" +
- "</a>"
- );
- if ( !model.visible[layer.id] ) {
- html.push("<a class='hdanchor'>" +
- "<img class='hide hideReg bank-item-img' " +
- "title='Show Layer' id='hide" + id(layer.id) + "'" +
- "data-action='show' data-layer='" + layer.id + "'" +
- "src='images/invisible.png' /></a>");
- } else {
- html.push("<a class='hdanchor'>" +
- "<img class='hide hideReg bank-item-img' " +
- "title='Hide Layer' id='hide" + id(layer.id) + "'" +
- "data-action='hide' data-layer='" + layer.id + "'" +
- "src='images/visible.png' /></a>");
+ renderLayer($layers, type, layer);
+ });
- }
- html.push("<h4>" + layer.name + "</h4>");
- html.push("<p>" + layer.description + "</p>");
+ $container.append($header);
+ $container.append($layers);
+ $parent.append($container);
+ };
+
+ var renderLayer = function($parent, type, layer) {
+ var $layer = $("<li></li>")
+ .attr("id", type.id + "-" + Worldview.id(layer.id))
+ .addClass(self.id + "item")
+ .addClass("item");
+
+ var $removeButton = $("<a></a>");
+ var $removeImage = $("<img></img>")
+ .attr("id", "close" + type.id + Worldview.id(layer.id))
+ .addClass("close")
+ .addClass("bank-item-img")
+ .attr("data-layer", layer.id)
+ .attr("data-layer-type", type.id)
+ .attr("title", "Remove Layer")
+ .attr("src", "images/close-red-x.png");
+ $removeButton.append($removeImage);
+ $layer.append($removeButton);
+
+ var $visibleButton = $("<a></a>")
+ .addClass("hdanchor");
+ var $visibleImage = $("<img></img>")
+ .attr("id", "hide" + Worldview.id(layer.id))
+ .attr("data-layer", layer.id)
+ .addClass("hide")
+ .addClass("hideReg")
+ .addClass("bank-item-img");
+ if ( !model.visible[layer.id] ) {
+ $visibleImage
+ .attr("title", "Show Layer")
+ .attr("data-action", "show")
+ .attr("src", ICON_HIDDEN);
+ } else {
+ $visibleImage
+ .attr("title", "Hide Layer")
+ .attr("data-action", "hide")
+ .attr("src", ICON_VISIBLE);
+ }
+ $visibleButton.append($visibleImage);
+ $layer.append($visibleButton);
+
+ $layer.append($("<h4></h4>").html(layer.name));
+ $layer.append($("<p></p>").html(layer.description));
+
+ if ( layer.rendered ) {
+ renderLegend($layer, type, layer);
+ }
+ $parent.append($layer);
+ };
+
+ var renderLegend = function($parent, type, layer) {
+ var $container = $("<div></div>");
+
+ $container.append($("<span>X</span>").addClass("palette"));
+
+ /*
// Has a rendered palette?
if ( layer.rendered ) {
html.push(
@@ -148,32 +173,123 @@ Worldview.Widget.ActiveLayers = function(config, model, projectionModel) {
}
html.push("</li>");
});
- html.push("</ul>");
- html.push("</div>");
- return html.join("\n");
+ */
+ };
+
+ var adjustCategoryHeights = function() {
+ var heights = [];
+ var container_height = $(self.selector).outerHeight(true);
+ var labelHeight = 0;
+ $(self.selector + ' .head').each(function(){
+ labelHeight += $(this).outerHeight(true);
+ });
+ container_height -= labelHeight;
+ var types = ["baselayers", "overlays"];
+ $.each(types, function(i, type) {
+ var actual_height = 0;
+ var count = 0;
+ $('#' + type + ' li').each(function() {
+ actual_height += $(this).outerHeight(true);
+ count++;
+ });
+
+ heights.push({
+ name: type,
+ height: actual_height,
+ count: count
+ });
+ });
+
+ if ( heights[0].height + heights[1].height > container_height ) {
+ if ( heights[0].height > container_height / 2 ) {
+ heights[0].height = container_height / 2;
+ }
+ heights[1].height = container_height - heights[0].height;
+ }
+
+ $("#" + heights[0].name).css("height",heights[0].height+"px");
+ $("#" + heights[1].name).css("height",heights[1].height+"px");
+
+ reinitializeScrollbars();
+ };
+
+ var reinitializeScrollbars = function() {
+ $("." + self.id + "category").each(function() {
+ var api = $(this).data('jsp');
+ if ( api ) {
+ api.reinitialise();
+ }
+ });
+ };
+
+ var resize = function() {
+ // If on a mobile device, use the native scroll bars
+ if ( $(window).width() > Worldview.TRANSITION_WIDTH ) {
+ if ( jsp ) {
+ var api = jsp.data('jsp');
+ if ( api ) {
+ api.destroy();
+ }
+ }
+ this.jsp = $("." + self.id + "category")
+ .jScrollPane({autoReinitialise: false, verticalGutter:0});
+ }
+ adjustCategoryHeights();
};
var removeLayer = function(event) {
- var items = event.target.id.split("|");
- var type = items[1];
- var id = unescapeId(items[2].replace(/close/, ""));
- model.remove(type, id);
+ var $target = $(event.target);
+ model.remove($target.attr("data-layer-type"),
+ $target.attr("data-layer"));
};
var onLayerRemoved = function(layer, type) {
- var layerSelector = "#" + type + "-" + id(layer.id);
+ var layerSelector = "#" + type + "-" + Worldview.id(layer.id);
$(layerSelector).remove();
+ adjustCategoryHeights();
+ };
+
+ var onLayerAdded = function(layer, type) {
+ var $container = $("#" + type);
+ var api = $container.data("jsp");
+ if ( api ) {
+ $container = api.getContentPane();
+ }
+ renderLayer($container, types[type], layer);
+ adjustCategoryHeights();
};
var toggleVisibility = function(event) {
- var $element = $("#" + event.target.id);
- var action = $element.attr("data-action");
+ var $target = $(event.target);
+ var action = $target.attr("data-action");
var layer = $element.attr("data-layer");
- if ( action === "show" ) {
- model.setVisibility(layer, true);
+ if ( $target.attr("data-action") === "show" ) {
+ model.setVisibility($target.attr("data-layer"), true);
} else {
- model.setVisibility(layer, false);
+ model.setVisibility($target.attr("data-layer"), false);
+ }
+ };
+
+ var reorder = function(a, b, c) {
+ console.log("reorder", a, b, c);
+ console.log($(this).index());
+ /*
+ self.values = {};
+ for(var i=0; i<self.categories.length; i++){
+ var formatted = self.categories[i].replace(/\s/g, "");
+ formatted = formatted.toLowerCase();
+ self.values[formatted] = new Array();
+ jQuery('li[id|="'+formatted+'"]').each(function() {
+ var item = jQuery( this );
+ var id = item.attr("id");
+ var vals = id.split("-");
+ var val = vals.splice(0,1);
+ val = vals.join("-");
+ self.values[formatted].push({value:val});
+ });
}
+ self.fire();
+ */
};
var onLayerVisibility = function(layer, visible) {
@@ -187,14 +303,6 @@ Worldview.Widget.ActiveLayers = function(config, model, projectionModel) {
}
};
- var id = function(value) {
- return value.replace(/:/g, "colon");
- };
-
- var unescapeId = function(value) {
- return value.replace("colon", /:/g);
- };
-
init();
return self;
};
diff --git a/src/js/Worldview/Widget/AddLayers.js b/src/js/Worldview/Widget/AddLayers.js
new file mode 100644
index 000000000..b640276a6
--- /dev/null
+++ b/src/js/Worldview/Widget/AddLayers.js
@@ -0,0 +1,295 @@
+/*
+ * NASA Worldview
+ *
+ * This code was originally developed at NASA/Goddard Space Flight Center for
+ * the Earth Science Data and Information System (ESDIS) project.
+ *
+ * Copyright (C) 2013 United States Government as represented by the
+ * Administrator of the National Aeronautics and Space Administration.
+ * All Rights Reserved.
+ */
+
+Worldview.namespace("Widget");
+
+Worldview.Widget.AddLayers = function(config, model, projectionModel) {
+
+ var jsp = null;
+
+ var self = {};
+
+ self.selector = "#selectorbox";
+ self.id = "selectorbox";
+
+ var init = function() {
+ render();
+ $(window).resize(resize);
+
+ model.events
+ .on("add", onLayerAdded)
+ .on("remove", onLayerRemoved);
+ projectionModel.events.on("change", filter);
+ };
+
+ var render = function() {
+ $(self.selector).empty();
+ var tabs_height = $(".ui-tabs-nav").outerHeight(true);
+ $(self.selector).addClass('selector');
+ $(self.selector).height(
+ $(self.selector).parent().outerHeight() - tabs_height
+ );
+
+ var $form = $("<div></div>")
+ .attr("id", self.id + "facetedSearch")
+ .addClass("facetedSearch");
+
+ var $select = $("<select></select>")
+ .attr("id", self.id + "select")
+ .addClass("select");
+
+ $form.append($select);
+
+ var $search = $("<input>")
+ .attr("id", self.id + "search")
+ .addClass("search")
+ .attr("type", "text")
+ .attr("name", "search")
+ .attr("placeholder", "ex. modis. terra, fire")
+ .attr("autocomplete", "off");
+
+ $form.append($search);
+ $(self.selector).append($form);
+
+ var $content = $("<div></div>")
+ .attr("id", self.id + "content");
+
+ renderType($content, "baselayers", "Base Layers", "BaseLayers");
+ renderType($content, "overlays", "Overlays", "Overlays");
+ $(self.selector).append($content);
+
+ $(self.selector + " .selectorItem input").on("click", toggleLayer);
+ $(self.selector + "select").on('change', filter);
+ $(self.selector + "search").on('keyup', filter);
+ $(self.selector + "search").focus();
+
+ //resize();
+
+ if ( $(window).width() > Worldview.TRANSITION_WIDTH ) {
+ if ( jsp ) {
+ var api = jsp.data('jsp');
+ if ( api ) {
+ api.destroy();
+ }
+ }
+ jsp = $("." + self.id + "category").jScrollPane({
+ autoReinitialise: false,
+ verticalGutter: 0
+ });
+ }
+
+ updateAreasOfInterest();
+ setTimeout(adjustCategoryHeights, 1);
+ };
+
+ var renderType = function($parent, type, header, camelCase) {
+ var $container = $("<div></div>")
+ .attr("id", self.id + camelCase)
+ .addClass("categoryContainer");
+
+ var $header = $("<h3></h3>")
+ .addClass("head")
+ .html(header);
+
+ var $element = $("<ul></ul>")
+ .attr("id", self.id + type)
+ .addClass(self.id + "category")
+ .addClass("category")
+ .addClass("scroll-pane");
+
+ $.each(config.layerOrder[type], function(index, layerId) {
+ renderLayer($element, type, layerId);
+ });
+
+ $container.append($header);
+ $container.append($element);
+ $parent.append($container);
+ };
+
+ var renderLayer = function($parent, type, layerId) {
+ var layer = config.layers[layerId];
+ var $element = $("<li></li>")
+ .addClass("selectorItem")
+ .addClass("item");
+
+ var $name = $("<h4></h4>")
+ .html(layer.name);
+ if ( config.parameters.markPalettes ) {
+ if ( layer.rendered ) {
+ $name.addClass("mark");
+ }
+ }
+ if ( config.parameters.markDownoads ) {
+ if ( layer.product ) {
+ $name.addClass("mark");
+ }
+ }
+ var $description = $("<p></p>")
+ .html(layer.description);
+
+ var $checkbox = $("<input></input>")
+ .attr("id", Worldview.id(layer.id))
+ .attr("value", layer.id)
+ .attr("type", "checkbox")
+ .attr("data-layer", layer.id)
+ .attr("data-layer-type", type);
+ if ( type === "baselayers" ) {
+ $checkbox.attr("name", type);
+ }
+ if ( model.isActive(type, layer.id) ) {
+ $checkbox.attr("checked", "checked");
+ };
+
+ $element.append($checkbox);
+ $element.append($name);
+ $element.append($description);
+
+ $parent.append($element);
+ };
+
+ var adjustCategoryHeights = function() {
+ var heights = [];
+ var facets_height =
+ $(self.selector + "facetedSearch").outerHeight(true);
+ var container_height =
+ $(self.selector).outerHeight(true) - facets_height;
+ $(self.selector + "content").height(container_height);
+ var labelHeight = 0;
+ $(self.selector + 'content .head').each(function() {
+ labelHeight += $(this).outerHeight(true);
+ });
+ container_height -= labelHeight;
+
+ $.each(["baselayers", "overlays"], function(i, type) {
+ var actual_height = 0;
+ var count = 0;
+ $(self.selector + type + ' li').each(function() {
+ if ( $(this).is(":visible") ) {
+ actual_height += $(this).outerHeight(true);
+ count++;
+ }
+ });
+
+ heights.push({
+ name: self.id + type,
+ height: actual_height,
+ count: count
+ });
+ });
+
+ if ( heights[0].height + heights[1].height > container_height ) {
+ if( heights[0].height > container_height / 2 ) {
+ heights[0].height = container_height / 2;
+ }
+ heights[1].height = container_height - heights[0].height;
+ }
+ $("#" + heights[0].name).css("height", heights[0].height + "px");
+ $("#" + heights[1].name).css("height", heights[1].height + "px");
+
+ reinitializeScrollbars();
+ };
+
+ var reinitializeScrollbars = function() {
+ var pane = $("." + self.id + "category").each(function() {
+ var api = $(this).data('jsp');
+ if ( api ) {
+ api.reinitialise();
+ }
+ });
+ };
+
+ var resize = function() {
+ var tabs_height = $(".ui-tabs-nav").outerHeight(true);
+ $(self.selector)
+ .height($(self.selector).parent().outerHeight() - tabs_height);
+
+ setTimeout(adjustCategoryHeights, 1);
+ };
+
+ var toggleLayer = function(event) {
+ var $target = $(event.target);
+ if ( event.target.checked ) {
+ model.add($target.attr("data-layer-type"),
+ $target.attr("data-layer"));
+ } else {
+ model.remove($target.attr("data-layer-type"),
+ $target.attr("data-layer"));
+ }
+ };
+
+ var onLayerAdded = function(layer) {
+ var $element = $("#" + Worldview.id(layer.id));
+ $element.attr("checked", "checked");
+ };
+
+ var onLayerRemoved = function(layer) {
+ var $element = $("#" + Worldview.id(layer.id));
+ $element.removeAttr("checked");
+ };
+
+ var updateAreasOfInterest = function() {
+ $select = $("#" + self.id + "select");
+ $select.empty();
+ var $option = $("<option></option>")
+ .attr("value", "All")
+ .html("All");
+ $select.append($option);
+
+ $.each(config.aoi, function(name, info) {
+ if ( $.inArray(projectionModel.selected,
+ info.projections ) >= 0 ) {
+ var $option = $("<option></option>")
+ .attr("value", name)
+ .html(name);
+ $select.append($option);
+ }
+ });
+ filter();
+ };
+
+ var filterAreaOfInterest = function(layerId) {
+ var aoi = $(self.selector + "select").val();
+ if ( aoi === "All" ) {
+ return false;
+ }
+ return $.inArray(layerId, config.aoi[aoi].baselayers) < 0 &&
+ $.inArray(layerId, config.aoi[aoi].overlays) < 0;
+ };
+
+ var filterProjection = function(layer) {
+ return !layer.projections[projectionModel.selected];
+ };
+
+ var filterSearch = function(layer) {
+ var search = $(self.selector + "search").val();
+ if ( search === "" ) {
+ return false;
+ }
+ search = search.toLowerCase();
+ return !layer.name.toLowerCase().contains(search) &&
+ !layer.description.toLowerCase().contains(search);
+ };
+
+ var filter = function() {
+ $.each(config.layers, function(layerId, layer) {
+ var filtered =
+ filterAreaOfInterest(layerId) ||
+ filterProjection(layer) ||
+ filterSearch(layer);
+ var display = filtered ? "none": "block";
+ $("#" + layerId).parent().css("display", display);
+ });
+ adjustCategoryHeights();
+ };
+
+ init();
+ return self;
+};
diff --git a/src/js/Worldview/Widget/LayerSideBar.js b/src/js/Worldview/Widget/LayerSideBar.js
index 70d19ae16..b60bd0bf8 100644
--- a/src/js/Worldview/Widget/LayerSideBar.js
+++ b/src/js/Worldview/Widget/LayerSideBar.js
@@ -11,7 +11,7 @@
Worldview.namespace("Widget");
-Worldview.Widget.LayerSideBar = function() {
+Worldview.Widget.LayerSideBar = function(layersModel) {
var HTML_TAB_ACTIVE_SELECTED =
"<i class='productsIcon selected icon-layers'></i>" +
@@ -34,7 +34,10 @@ Worldview.Widget.LayerSideBar = function() {
var HTML_TAB_DOWNLOAD_UNSELECTED =
"<i class='productsIcon selected icon-download' title='Download'></i>";
+ var collapsed = false;
+
var self = {};
+
self.id = "productsHolder";
self.selector = "#productsHolder";
self.events = Worldview.Events();
@@ -65,62 +68,29 @@ Worldview.Widget.LayerSideBar = function() {
"</a>" +
"</li>" +
"</ul>" +
+
+ "<div id='" + self.id + "toggleButtonHolder'" +
+ "class='toggleButtonHolder'>" +
+ "<a class='accordionToggler atcollapse arrow' " +
+ "title='Hide'></a>" +
+ "</a>" +
+ "</div>" +
+
"<div id='products'></div>" +
"<div id='selectorbox'></div>" +
"<div id='DataDownload'></div>";
+
$container.html(html);
$container.tabs({
show: onTabChange
});
- /*
- var toggleButtonHolder = document.createElement("div");
- toggleButtonHolder.setAttribute("id",this.id+"toggleButtonHolder");
- toggleButtonHolder.setAttribute("class","toggleButtonHolder");
- var accordionToggler = document.createElement("a");
- accordionToggler.setAttribute("class","accordionToggler atcollapse arrow");
- accordionToggler.setAttribute("title","Hide Layer Selector");
- this.isCollapsed = false;
- toggleButtonHolder.appendChild(accordionToggler);
- this.container.appendChild(toggleButtonHolder);
- */
-
- /*
- //this.container.appendChild(productContainer);
- var self = this;
- $('#'+this.id).tabs({show: function(e, ui) {
- e.data = { self: self };
- SOTE.widget.Products.change(e, ui);
- }});
-
- this.b = Worldview.Widget.ActiveLayers(this.config);
-
-
- //$('#'+this.id+"prods").on("tabsshow",SOTE.widget.Products.change);
- $('.accordionToggler').bind('click',{self:this},SOTE.widget.Products.toggle);
-
- if($(window).width() < 720){
- SOTE.widget.Products.toggle({data: {self:this}});
- }
-
-
- //setTimeout(SOTE.forceResize();
-
- // Mark the component as ready in the registry if called via init()
- if ((this.initRenderComplete === false) && REGISTRY) {
- this.initRenderComplete = true;
- REGISTRY.markComponentReady(this.id);
+ if ( $(window).width() < Worldview.TRANSITION_WIDTH ) {
+ slide();
}
- var self = this;
- $(window).resize(function(){
- self.b.render();
- self.s.resize();
- self.adjustAlignment();
- });
-
- $("#products").bind("fire", {self:this}, SOTE.widget.Products.handleFire);
- */
+ $('.accordionToggler').bind('click', slide);
+ $(window).resize(adjustAlignment);
};
var onTabChange = function(e, ui) {
@@ -167,6 +137,42 @@ Worldview.Widget.LayerSideBar = function() {
return false;
};
+ var slide = function(e, ui) {
+ if ( collapsed ) {
+ $('.accordionToggler')
+ .removeClass('atexpand')
+ .addClass('atcollapse')
+ .removeClass('staticLayers dateHolder')
+ .addClass('arrow');
+ $('.accordionToggler').attr("title","Hide Layer Selector");
+ $('.accordionToggler').empty();
+ $('.products').animate({left:'0'}, 300);
+ collapsed = false;
+ $('.accordionToggler').appendTo("#"+self.id+"toggleButtonHolder");
+ }
+ else {
+ $('.accordionToggler')
+ .removeClass('atcollapse')
+ .addClass('dateHolder')
+ .removeClass('arrow')
+ .addClass('staticLayers');
+ $('.accordionToggler').attr("title","Show Layer Selector");
+ $('.accordionToggler').html("Layers (" + layersModel.total() + ")");
+
+ var w = $('.products').outerWidth();
+ $('.products').animate({left:'-'+w+"px"}, 300);
+ collapsed = true;
+ $("#" + self.id).after($('.accordionToggler'));
+ }
+ };
+
+ var adjustAlignment = function() {
+ if ( $(window).width() < Worldview.TRANSITION_WITH && collapsed ) {
+ var w = $('.products').outerWidth();
+ $('.products').css("left", "-"+w+"px");
+ }
+ };
+
init();
return self;
diff --git a/src/js/Worldview/Widget/WorldviewMap.js b/src/js/Worldview/Widget/WorldviewMap.js
index b9f591a6c..f1dbdfa3b 100644
--- a/src/js/Worldview/Widget/WorldviewMap.js
+++ b/src/js/Worldview/Widget/WorldviewMap.js
@@ -39,7 +39,7 @@ Worldview.Widget.WorldviewMap = function(containerId, config) {
var last = null;
var init = function() {
- Logging.debug("Worldview.Map");
+ //Logging.debug("Worldview.Map");
if ( REGISTRY ) {
REGISTRY.register(containerId, self);
} else {
@@ -80,11 +80,9 @@ Worldview.Widget.WorldviewMap = function(containerId, config) {
log.debug("Last State", last);
- console.log("----- projection", state.projection, "last", last.projection);
if ( state.projection !== undefined &&
state.projection !== last.projection ) {
var projection = state.projection;
- console.log("******* SETTING PROJECTION");
if ( !(projection in self.maps.mapConfig.projections) ) {
var defaultProjection =
self.maps.mapConfig.defaults.projection;
diff --git a/src/js/main.js b/src/js/main.js
index e00fa7373..16c4f9c39 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -142,9 +142,11 @@ $(function() {// Initialize "static" vars
var palettes = Worldview.Widget.Palette("palettes", config, {
alignTo: "#products"
});
- var layerSideBar = Worldview.Widget.LayerSideBar();
+ var layerSideBar = Worldview.Widget.LayerSideBar(layersModel);
var activeLayers = Worldview.Widget.ActiveLayers(config, layersModel,
projectionModel);
+ var addLayers = Worldview.Widget.AddLayers(config, layersModel,
+ projectionModel);
/*
var products = new SOTE.widget.Products("productsHolder", {
@@ -258,10 +260,9 @@ $(function() {// Initialize "static" vars
// These are only convienence handles to important objects used
// for console debugging. Code should NOT reference these as they
// are subject to change or removal.
- Worldview.opacity = opacity;
- Worldview.palettes = palettes;
- Worldview.view = map;
- Worldview.maps = map.maps;
+ Worldview.widgets = {
+ addLayers: addLayers
+ };
// Initialize widgets