require('./src/ng/poll.app');

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

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

// controllers
require('./src/ng/poll/intro.controller');
require('./src/ng/poll/finish.controller');

require('./src/ng/poll/clang-picker.directive');
require('./src/ng/poll/clang-label.directive');

// 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);
    }
}
