var angular = require('angular');
var ionic = require('ionic');
require('./modules');
require('./services/HttpProvider');
require('./services/ManifestCache');

var module = angular.module('commons');

module.config(function($compileProvider, $ionicConfigProvider) {
  $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|file|sms):/);
  $ionicConfigProvider.views.swipeBackEnabled(false);
  $ionicConfigProvider.views.maxCache(10);
});

if (ionic.Platform.isAndroid()) {
  window.addEventListener('native.keyboardhide', function() {
    var focusedElement = document.querySelector(':focus');
    if (focusedElement) {
      focusedElement.blur();
    }
  });
}
