BMLT Root Server
Variables
bmlt.js File Reference

Go to the source code of this file.

Variables

var bmltbaseURL
 
var recurseServiceBodies
 
var bmltClientInit
 
var getDayOfWeek
 
var getTodayDayOfWeek
 
var militaryToStandard
 
var getMeetingsByCity
 
var getMeetingsByServiceBodyId
 
var getMeetingsByServiceBodyIdAndWeekdayId
 
var getMeetingsByServiceBodyIdAndCity
 
var getMeetingsByLocation
 
var getFormats
 
var getUniqueValuesByServiceBody
 
var getServiceBodyIdQueryString
 
var getJSON
 
Array prototype unique
 

Variable Documentation

var bmltbaseURL

Definition at line 1 of file bmlt.js.

var bmltClientInit
Initial value:
= function (host, recurse) {
this.bmltbaseURL = host + "/client_interface/jsonp/?switcher=";
this.recurseServiceBodies = recurse == null ? false : recurse;
}
var bmltbaseURL
Definition: bmlt.js:1
var recurseServiceBodies
Definition: bmlt.js:2

Definition at line 4 of file bmlt.js.

var getDayOfWeek
Initial value:
= function (dayint) {
return ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][dayint];
}

Definition at line 9 of file bmlt.js.

var getFormats
Initial value:
= function (callback) {
getJSON(bmltbaseURL + "GetFormats&callback=?", callback);
}
var getJSON
Definition: bmlt.js:96
var bmltbaseURL
Definition: bmlt.js:1

Definition at line 68 of file bmlt.js.

var getJSON
Initial value:
= function (url, callback) {
var random = Math.floor(Math.random() * 999999);
var callbackFunctionName = "cb_" + random;
url += "&recursive=1";
}
url = url.replace("callback=?", "callback=" + callbackFunctionName);
window[callbackFunctionName] = function (data) {
callback(data);
};
var scriptItem = document.createElement('script');
scriptItem.setAttribute('src', url);
document.body.appendChild(scriptItem);
}
var recurseServiceBodies
Definition: bmlt.js:2

Definition at line 96 of file bmlt.js.

var getMeetingsByCity
Initial value:
= function (city, callback) {
getJSON(bmltbaseURL + "GetSearchResults&meeting_key=location_municipality&meeting_key_value=" + city + "&callback=?", callback);
}
var getJSON
Definition: bmlt.js:96
var bmltbaseURL
Definition: bmlt.js:1

Definition at line 48 of file bmlt.js.

var getMeetingsByLocation
Initial value:
= function (day, geoWidth, position, callback) {
getJSON(bmltbaseURL + "GetSearchResults&weekdays=" + day + "&geo_width=" + geoWidth + "&long_val=" + position.longitude + "&lat_val=" + position.latitude + "&callback=?", callback);
}
var getJSON
Definition: bmlt.js:96
var bmltbaseURL
Definition: bmlt.js:1

Definition at line 64 of file bmlt.js.

var getMeetingsByServiceBodyId
Initial value:
= function (serviceBodyId, callback) {
getJSON(bmltbaseURL + "GetSearchResults" + getServiceBodyIdQueryString(serviceBodyId) + "&callback=?", callback);
}
var getServiceBodyIdQueryString
Definition: bmlt.js:83
var getJSON
Definition: bmlt.js:96
var bmltbaseURL
Definition: bmlt.js:1

Definition at line 52 of file bmlt.js.

var getMeetingsByServiceBodyIdAndCity
Initial value:
= function (serviceBodyId, city, callback) {
getJSON(bmltbaseURL + "GetSearchResults" + getServiceBodyIdQueryString(serviceBodyId) + "&meeting_key=location_municipality&meeting_key_value=" + city + "&callback=?", callback);
}
var getServiceBodyIdQueryString
Definition: bmlt.js:83
var getJSON
Definition: bmlt.js:96
var bmltbaseURL
Definition: bmlt.js:1

Definition at line 60 of file bmlt.js.

var getMeetingsByServiceBodyIdAndWeekdayId
Initial value:
= function (serviceBodyId, weekdayId, callback) {
getJSON(bmltbaseURL + "GetSearchResults" + getServiceBodyIdQueryString(serviceBodyId) + "&weekdays=" + weekdayId + "&callback=?", callback);
}
var getServiceBodyIdQueryString
Definition: bmlt.js:83
var getJSON
Definition: bmlt.js:96
var bmltbaseURL
Definition: bmlt.js:1

Definition at line 56 of file bmlt.js.

var getServiceBodyIdQueryString
Initial value:
= function (serviceBodyIds) {
var serviceBodyIdString = "";
if (Array.isArray(serviceBodyIds)) {
for (var i = 0; i < serviceBodyIds.length; i++) {
serviceBodyIdString += "&services[]=" + serviceBodyIds[i];
}
} else {
serviceBodyIdString = "&services=" + serviceBodyIds;
}
return serviceBodyIdString;
}

Definition at line 83 of file bmlt.js.

var getTodayDayOfWeek
Initial value:
= function () {
return (new Date()).getDay() + 1;
}

Definition at line 13 of file bmlt.js.

var getUniqueValuesByServiceBody
Initial value:
= function (serviceBodyId, field, callback) {
getMeetingsByServiceBodyId(serviceBodyId, function (data) {
var valuesArray = [];
for (i = 0; i < data.length; i++) {
valuesArray.push(data[i][field]);
}
callback(valuesArray.unique())
});
}
var getMeetingsByServiceBodyId
Definition: bmlt.js:52

Definition at line 72 of file bmlt.js.

var militaryToStandard
Initial value:
= function (value) {
if (value !== null && value !== undefined) {
if (value.indexOf('AM') > -1 || value.indexOf('PM') > -1) {
return value;
} else {
if (value.length === 8) {
var valueconv = value.split(':');
var hours = Number(valueconv[0]);
var timeValue;
if (hours > 0 && hours <= 12) {
timeValue= "" + hours;
} else if (hours > 12) {
timeValue= "" + (hours - 12);
} else if (hours === 0) {
timeValue= "12";
}
timeValue += ":" + valueconv[1];
timeValue += (hours >= 12) ? " PM" : " AM";
return timeValue;
} else {
return valueconv;
}
}
}
}

Definition at line 17 of file bmlt.js.

var recurseServiceBodies

Definition at line 2 of file bmlt.js.

Array prototype unique
Initial value:
= function () {
var o = {}, a = [];
for (var i = 0; i < this.length; i++) {
o[this[i]] = 1
for (var e in o) {
a.push(e)
return a
}
}
}

Definition at line 113 of file bmlt.js.