mirror of
https://github.com/Ekokumppanit/Lentolaskuri.git
synced 2026-02-05 23:43:16 +00:00
- Added section on configuration to README.md
- Made the application more configurable by the user - Made installation easier - API location is now dynamic based on window.location - Cleaned up some older code that was pointing to dev stuff - Now includes the SQL-table required to run the application - Application now exposes config to console for easier debugging - Search now supports user specified table name - Updated the OpenFlights airport data file source
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var searchlocation = window.location;
|
||||
|
||||
define(function () {
|
||||
return {
|
||||
api: 'http://work.lentolaskuri.fi/api',
|
||||
api: searchlocation + 'api',
|
||||
R: 6371,
|
||||
radiativeForceFactor: function (dist) {
|
||||
return (dist >= 500) ? 2.0 : 1.0;
|
||||
|
||||
@@ -5,7 +5,7 @@ define([
|
||||
'config'
|
||||
], function ($, _, config) {
|
||||
var airportById = function (element, callback) {
|
||||
$.get('http://localhost:8000/search.php?i=' + element.val(), null, function (data) {
|
||||
$.get( config.api + '/search.php?i=' + element.val(), null, function (data) {
|
||||
callback(data[0]);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -48,9 +48,10 @@ require.config({
|
||||
require([
|
||||
'jquery',
|
||||
'app',
|
||||
'config',
|
||||
'bootstrap',
|
||||
'libs/handlebar_helpers'
|
||||
], function ($, App) {
|
||||
], function ($, App, config) {
|
||||
$('html:first').removeClass('no-js').addClass('js'); // JavaScript detection
|
||||
var app = new App();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user