function init() { // get our config and set defaults var config = app.getConfig(); app_config = util.defaults(config.settings, { 'api_key' : '', //YOUR API KEY HERE 'zipcode' : '90210', 'temp_scale' : 1, // 1=f or 2=c 'wind_units' : 1 // 1=mph or 2=kph }); try { var configFile = digium.readFile('nv', 'settings.json'); local_config = JSON.parse(configFile); } catch (e) { local_config = {}; } current_weather = { "location" : "", "temp" : "", "description" : "", "relative_humidity" : "", "wind_speed" : "", "wind_dir" : "", "icon" : "unknown.gif" }; form_items = get_form_items(); digium.app.exitAfterBackground = false; setup(digium.app.idleWindow) ; }
alert911.init = function() { digium.app.exitAfterBackground = false; var config = app.getConfig(); this.config = config; this.setupSoftKeys(); this.startLongPolling(); digium.event.observe({ 'eventName' : 'digium.app.foreground', 'callback' : this.app_foreground.bind(this) }); digium.event.observe({ 'eventName': '', 'callback': this.checkForEmergencyCall.bind(this) }); };