require('./src/ng/quiz.app.js');

// libs
require('./src/lib/confetti.js');
require('./src/lib/jquery.kinetic.js');
require('datatable');

// services
require('./src/ng/quiz/resources.service.js');
require('./src/ng/quiz/interceptor.service.js');
require('./src/ng/quiz/tracker.service.js');
require('./src/ng/quiz/actions.service.js');
require('./src/ng/quiz/redirect.service.js');

// controllers
require('./src/ng/quiz/intro.controller.js');
require('./src/ng/quiz/start.controller.js');
require('./src/ng/quiz/review.controller.js');
require('./src/ng/quiz/finish.controller.js');

// directives
require('./src/ng/quiz/nav.directive.js');
require('./src/ng/quiz/navbar.directive.js');
require('./src/ng/quiz/keyboard.directive.js');
require('./src/ng/quiz/finish.modal.js');

module.exports = {};


// polyfills
if (!String.format) {
    String.format = function (format) {
        var args = Array.prototype.slice.call(arguments, 1);
        return format.replace(/{(\d+)}/g, function (match, number) {
            return typeof args[number] != 'undefined'
                ? args[number]
                : match
                ;
        });
    };
}

if (!String.localise) {
    String.localise = function () {
        return lmsg.apply(this, arguments);
    }
}
