From 4dd8d229b9c3a8db85a38bff0d8a0f4a9cbf4e67 Mon Sep 17 00:00:00 2001 From: answerquest Date: Tue, 18 Sep 2018 12:55:38 +0530 Subject: [PATCH] v2.1.2 --- config/settings.js | 32 ++++++++++++++++++++++++++++ fares.html | 6 ++++++ hydcsv.html => hmrl.html | 6 ++++++ index.html | 12 ++++++++--- js/commonfuncs.js | 43 ++++++++++++-------------------------- js/navbar.js | 18 ---------------- js/routes.js | 10 +++------ js/stops.js | 6 +----- xml2GTFS.html => kmrl.html | 6 ++++++ misc.html | 6 ++++++ routes.html | 8 +++++-- schedules.html | 6 ++++++ stops.html | 4 ++++ 13 files changed, 98 insertions(+), 65 deletions(-) create mode 100644 config/settings.js rename hydcsv.html => hmrl.html (98%) delete mode 100644 js/navbar.js rename xml2GTFS.html => kmrl.html (97%) diff --git a/config/settings.js b/config/settings.js new file mode 100644 index 0000000..07a6e58 --- /dev/null +++ b/config/settings.js @@ -0,0 +1,32 @@ +// from commonfuncs.js + +const VERSION = 'v2.1.2'; +const APIpath = 'API/'; +const CURRENCY = 'INR'; +const route_type_options = {0:"0-Tram, Streetcar, Light rail", 1:"1-Subway, Metro", 2:"2-Rail", 3:"3-Bus",4:"4-Ferry" }; +//const route_type_lookup = {0:"Tram, Streetcar, Light rail", 1:"Subway, Metro", 2:"Rail", 3:"Bus",4:"Ferry" }; +const route_type_lookup = route_type_options; + +// this json holds the different pages. If you want to add/remove/rename a page, do so here. +const menu = { 'index.html':'Main', 'stops.html':'Stops', 'routes.html':'Routes', 'schedules.html':'Schedules', 'fares.html':'Fares', 'misc.html':'Misc','kmrl.html':'KMRL', 'hmrl.html':'HMRL'}; + +// this flag tells whether it is mandatory for all UIDs to be in capitals or not. +const CAPSLOCK = true; + +// default config parameters for KMRL KML import. +const KMRLDEFAULTS = { "stations":"stations.csv", "timepoint":1, "wheelchair_accessible":1, "route_type":1, "route_color":"00B7F3", "route_text_color":"000000", "secondland":"ml", "currency_type":CURRENCY, "payment_method":0, "transfers":"", "agency_id":"KMRL", "agency_name":"Kochi Metro", "agency_name_translation":"കൊച്ചി മെട്രോ", "agency_url":"http://www.kochimetro.org/", "agency_timezone":"Asia/Kolkata", "end_date":"20990101" + }; + +// loader: +const loaderHTML = '

Loading data.. please wait..'; + + +// from stops.js +const UID_leastchars = 2; +const UID_maxchars = 20; +const MARKERSLIMIT = 100; + +// from routes.js +const shapeAutocompleteOptions = {disable_search_threshold: 1, search_contains:true, width:100}; + +const stopAutocompleteOptions = {disable_search_threshold: 4, search_contains:true, width:225, placeholder_text_single:'Pick a stop'}; diff --git a/fares.html b/fares.html index 23abf15..3612b19 100644 --- a/fares.html +++ b/fares.html @@ -216,7 +216,13 @@

Changes Log




+ + + + + + \ No newline at end of file diff --git a/hydcsv.html b/hmrl.html similarity index 98% rename from hydcsv.html rename to hmrl.html index 728dfcb..882d3d9 100644 --- a/hydcsv.html +++ b/hmrl.html @@ -376,7 +376,13 @@

Changes Log




+ + + + + + \ No newline at end of file diff --git a/index.html b/index.html index d8011fa..0d4e61a 100644 --- a/index.html +++ b/index.html @@ -88,8 +88,8 @@
1. Import an existing GTFS feed. (.zip file)
2. Import data in other formats
@@ -134,7 +134,13 @@

Export GTFS Feed




+ - + + + + + + \ No newline at end of file diff --git a/js/commonfuncs.js b/js/commonfuncs.js index b72ca74..c155ec1 100644 --- a/js/commonfuncs.js +++ b/js/commonfuncs.js @@ -1,44 +1,27 @@ // ############################ // CONSTANTS -const VERSION = 'v2.1.0'; -const APIpath = 'API/'; -const CURRENCY = 'INR'; -const route_type_options = {0:"0-Tram, Streetcar, Light rail", 1:"1-Subway, Metro", 2:"2-Rail", 3:"3-Bus",4:"4-Ferry" }; -//const route_type_lookup = {0:"Tram, Streetcar, Light rail", 1:"Subway, Metro", 2:"Rail", 3:"Bus",4:"Ferry" }; -const route_type_lookup = route_type_options; +// moved to /config/settings.js -// this json holds the different pages. If you want to add/remove/rename a page, do so here. -const menu = { 'index.html':'Main', 'stops.html':'Stops', 'routes.html':'Routes', 'schedules.html':'Schedules', 'fares.html':'Fares', 'misc.html':'Misc','xml2GTFS.html':'KMRL', 'hydcsv.html':'HMRL'}; - -// this flag tells whether it is mandatory for all UIDs to be in capitals or not. -const CAPSLOCK = true; - -// default config parameters for KMRL KML import. -const KMRLDEFAULTS = { "stations":"stations.csv", "timepoint":1, "wheelchair_accessible":1, "route_type":1, "route_color":"00B7F3", "route_text_color":"000000", "secondland":"ml", "currency_type":CURRENCY, "payment_method":0, "transfers":"", "agency_id":"KMRL", "agency_name":"Kochi Metro", "agency_name_translation":"കൊച്ചി മെട്രോ", "agency_url":"http://www.kochimetro.org/", "agency_timezone":"Asia/Kolkata", "end_date":"20990101" - }; - -var navBarContentStart = ''; - - -// loader: -const loaderHTML = '

Loading data.. please wait..'; // ############################ // RUN ON ALL PAGES $(document).ready(function() { + /* Function to build navigation menu */ //finding current page, from https://stackoverflow.com/a/21343880/4355695 var pageName = location.pathname.split("/").slice(-1).join(); if(pageName == '') pageName = 'index.html'; console.log(pageName); - + + var navBarContentStart = ''; + var navBarContent = navBarContentStart; for(key in menu) { if(key == pageName) diff --git a/js/navbar.js b/js/navbar.js deleted file mode 100644 index c4cd12d..0000000 --- a/js/navbar.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -navBarContent = ''; -// moved to commonfuncs.js, put into a loop to highlight current page. -*/ \ No newline at end of file diff --git a/js/routes.js b/js/routes.js index d5d2f79..cadf8f7 100644 --- a/js/routes.js +++ b/js/routes.js @@ -1,11 +1,7 @@ // ######################################### // Initial things to execute on page load -const shapeAutocompleteOptions = {disable_search_threshold: 1, search_contains:true, width:100}; - -const stopAutocompleteOptions = {disable_search_threshold: 4, search_contains:true, width:225, placeholder_text_single:'Pick a stop'}; - -var allStops = [], stop_id_list =[], remaining0=[], remaining1=[], route_id_list=[], selected_route_id = '', globalShapesList=[], uploadedShapePrefix = ''; - +var allStops = [], stop_id_list =[], remaining0=[], remaining1=[], route_id_list=[]; +var selected_route_id = '', globalShapesList=[], uploadedShapePrefix = ''; // ######################################### // Function-variables to be used in tabulator @@ -675,7 +671,7 @@ function getPythonAllShapesList() { var jqxhr = $.get( `${APIpath}allShapesList`, function( data ) { globalShapesList = JSON.parse(data) ; console.log('GET request to API/allShapesList succesful.'); - console.log('globalShapesList: ' + JSON.stringify(globalShapesList) ); + // console.log('globalShapesList: ' + JSON.stringify(globalShapesList) ); if(selected_route_id) { // if a particular route is selected and global variable is holding a value // this block is skipped at page load time as no route has been selected at the time. diff --git a/js/stops.js b/js/stops.js index d011314..17f3b19 100644 --- a/js/stops.js +++ b/js/stops.js @@ -1,7 +1,3 @@ -//const stopsfile = 'GTFS/stops.txt'; -const UID_leastchars = 2; -const UID_maxchars = 20; - // ######################################### // Function-variables to be used in tabulator @@ -388,7 +384,7 @@ function reloadMap(timeflag='normal',filterFlag=false) { } function loadonmap(stopsjson,stopsLayer) { - var renderFlag = ( stopsjson.length > 1000 ? true : false ); + var renderFlag = ( stopsjson.length > MARKERSLIMIT ? true : false ); console.log('total stops: ' + stopsjson.length); // if there's too many stops, then use the SVG renderer way. Else if not too many stops, then use the divIcon way. diff --git a/xml2GTFS.html b/kmrl.html similarity index 97% rename from xml2GTFS.html rename to kmrl.html index 47a5df4..d9c196f 100644 --- a/xml2GTFS.html +++ b/kmrl.html @@ -210,7 +210,13 @@

Changes Log




+ + + + + + \ No newline at end of file diff --git a/misc.html b/misc.html index 9c65322..5ca48f3 100644 --- a/misc.html +++ b/misc.html @@ -298,7 +298,13 @@

Changes Log

Accordion over --> + + + + + + \ No newline at end of file diff --git a/routes.html b/routes.html index 8efa9a2..b51561f 100644 --- a/routes.html +++ b/routes.html @@ -332,9 +332,13 @@

Upload a shape

- - + + + + + + \ No newline at end of file diff --git a/schedules.html b/schedules.html index 244cb45..05cbd86 100644 --- a/schedules.html +++ b/schedules.html @@ -179,7 +179,13 @@
Timings



+ + + + + + \ No newline at end of file diff --git a/stops.html b/stops.html index 9f185b2..95a8aed 100644 --- a/stops.html +++ b/stops.html @@ -158,8 +158,12 @@

Changes Log

+ + + + \ No newline at end of file