<commit_before>/// <reference path="../lib/DefinitelyTyped/requirejs/require.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/lodash/lodash.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/modernizr/modernizr.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/moment/moment.d.ts"/>
/// <reference path="./_all.d.ts"/>

import angular = require("angular");

import angularAnimate = require("angularAnimate");  if (angularAnimate) { ; };
import angularAria = require("angularAria");  if (angularAria) { ; };
import angularMessages = require("angularMessages");  if (angularMessages) { ; };
import angularTranslate = require("angularTranslate");  if (angularTranslate) { ; };
import angularTranslateLoader = require("angularTranslateLoader");  if (angularTranslateLoader) { ; };
import angularElastic = require("angularElastic");  if (angularElastic) { ; };

import modernizr = require("modernizr");
import moment = require("moment");

import AdhConfig = require("./Packages/Config/Config");
import AdhComment = require("./Packages/Comment/Comment");
import AdhCrossWindowMessaging = require("./Packages/CrossWindowMessaging/CrossWindowMessaging");
import AdhDateTime = require("./Packages/DateTime/DateTime");
import AdhDocumentWorkbench = require("./Packages/DocumentWorkbench/DocumentWorkbench");
import AdhDone = require("./Packages/Done/Done");
import AdhEmbed = require("./Packages/Embed/Embed");
import AdhEventHandler = require("./Packages/EventHandler/EventHandler");
import AdhHttp = require("./Packages/Http/Http");
import AdhInject = require("./Packages/Inject/Inject");
import AdhListing = require("./Packages/Listing/Listing");
import AdhLocale = require("./Packages/Locale/Locale");
import AdhMovingColumns = require("./Packages/MovingColumns/MovingColumns");
import AdhPermissions = require("./Packages/Permissions/Permissions");
import AdhPreliminaryNames = require("./Packages/PreliminaryNames/PreliminaryNames");
import AdhProposal = require("./Packages/Proposal/Proposal");
import AdhRate = require("./Packages/Rate/Rate");
import AdhAngularHelpers = require("./Packages/AngularHelpers/AngularHelpers");
import AdhResourceArea = require("./Packages/ResourceArea/ResourceArea");
import AdhResourceWidgets = require("./Packages/ResourceWidgets/ResourceWidgets");
import AdhSocialShare = require("./Packages/SocialShare/SocialShare");
import AdhSticky = require("./Packages/Sticky/Sticky");
import AdhTopLevelState = require("./Packages/TopLevelState/TopLevelState");
import AdhUser = require("./Packages/User/User");
import AdhUserViews = require("./Packages/User/Views");
import AdhWebSocket = require("./Packages/WebSocket/WebSocket");
import AdhTemplates = require("adhTemplates");  if (AdhTemplates) { ; };


var loadComplete = () : void => {
    var w = (<any>window);
    w.adhocracy = w.adhocracy || {};
    w.adhocracy.loadState = "complete";
};


export var init = (config : AdhConfig.IService, meta_api) => {
    "use strict";

    // detect wheter we are running in iframe
    config.embedded = (window !== top);
    if (config.embedded) {
        window.document.body.className += " is-embedded";
    }

    var app = angular.module("a3", [
        "monospaced.elastic",
        "pascalprecht.translate",
        "ngAnimate",
        "ngAria",
        "ngMessages",
        "templates",
        AdhComment.moduleName,
        AdhDocumentWorkbench.moduleName,
        AdhDone.moduleName,
        AdhCrossWindowMessaging.moduleName,
        AdhEmbed.moduleName,
        AdhResourceArea.moduleName,
        AdhProposal.moduleName,
        AdhSticky.moduleName
    ]);

    app.config(["adhTopLevelStateProvider", "$translateProvider", "$locationProvider", "$ariaProvider", (
        adhTopLevelStateProvider : AdhTopLevelState.Provider,
        $translateProvider,
        $locationProvider,
        $ariaProvider
    ) => {
        adhTopLevelStateProvider
            .when("", ["$location", ($location) : AdhTopLevelState.IAreaInput => {
                $location.replace();
                $location.path("/r/adhocracy/");
                return {
                    skip: true
                };
            }])
            .otherwise(() : AdhTopLevelState.IAreaInput => {
                return {
                    template: "<adh-page-wrapper><h1>404 - Not Found</h1></adh-page-wrapper>"
                };
            });

        // Make sure HTML5 history API works.  (If support for older
        // browsers is required, we may have to study angular support
        // for conversion between history API and #!-URLs.  See
        // angular documentation for details.)
        $locationProvider.html5Mode(true);

        $translateProvider.useStaticFilesLoader({
            prefix: "/static/i18n/",
            suffix: ".json"
        });<commit_msg>Disable templatecache also in base Adhocracy.ts<commit_after>/// <reference path="../lib/DefinitelyTyped/requirejs/require.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/angularjs/angular.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/lodash/lodash.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/modernizr/modernizr.d.ts"/>
/// <reference path="../lib/DefinitelyTyped/moment/moment.d.ts"/>
/// <reference path="./_all.d.ts"/>

import angular = require("angular");

import angularAnimate = require("angularAnimate");  if (angularAnimate) { ; };
import angularAria = require("angularAria");  if (angularAria) { ; };
import angularMessages = require("angularMessages");  if (angularMessages) { ; };
import angularTranslate = require("angularTranslate");  if (angularTranslate) { ; };
import angularTranslateLoader = require("angularTranslateLoader");  if (angularTranslateLoader) { ; };
import angularElastic = require("angularElastic");  if (angularElastic) { ; };

import modernizr = require("modernizr");
import moment = require("moment");

import AdhConfig = require("./Packages/Config/Config");
import AdhComment = require("./Packages/Comment/Comment");
import AdhCrossWindowMessaging = require("./Packages/CrossWindowMessaging/CrossWindowMessaging");
import AdhDateTime = require("./Packages/DateTime/DateTime");
import AdhDocumentWorkbench = require("./Packages/DocumentWorkbench/DocumentWorkbench");
import AdhDone = require("./Packages/Done/Done");
import AdhEmbed = require("./Packages/Embed/Embed");
import AdhEventHandler = require("./Packages/EventHandler/EventHandler");
import AdhHttp = require("./Packages/Http/Http");
import AdhInject = require("./Packages/Inject/Inject");
import AdhListing = require("./Packages/Listing/Listing");
import AdhLocale = require("./Packages/Locale/Locale");
import AdhMovingColumns = require("./Packages/MovingColumns/MovingColumns");
import AdhPermissions = require("./Packages/Permissions/Permissions");
import AdhPreliminaryNames = require("./Packages/PreliminaryNames/PreliminaryNames");
import AdhProposal = require("./Packages/Proposal/Proposal");
import AdhRate = require("./Packages/Rate/Rate");
import AdhAngularHelpers = require("./Packages/AngularHelpers/AngularHelpers");
import AdhResourceArea = require("./Packages/ResourceArea/ResourceArea");
import AdhResourceWidgets = require("./Packages/ResourceWidgets/ResourceWidgets");
import AdhSocialShare = require("./Packages/SocialShare/SocialShare");
import AdhSticky = require("./Packages/Sticky/Sticky");
import AdhTopLevelState = require("./Packages/TopLevelState/TopLevelState");
import AdhUser = require("./Packages/User/User");
import AdhUserViews = require("./Packages/User/Views");
import AdhWebSocket = require("./Packages/WebSocket/WebSocket");
import AdhTemplates = require("adhTemplates");  if (AdhTemplates) { ; };


var loadComplete = () : void => {
    var w = (<any>window);
    w.adhocracy = w.adhocracy || {};
    w.adhocracy.loadState = "complete";
};


export var init = (config : AdhConfig.IService, meta_api) => {
    "use strict";

    // detect wheter we are running in iframe
    config.embedded = (window !== top);
    if (config.embedded) {
        window.document.body.className += " is-embedded";
    }

    var appDependencies = [
        "monospaced.elastic",
        "pascalprecht.translate",
        "ngAnimate",
        "ngAria",
        "ngMessages",
        AdhComment.moduleName,
        AdhDocumentWorkbench.moduleName,
        AdhDone.moduleName,
        AdhCrossWindowMessaging.moduleName,
        AdhEmbed.moduleName,
        AdhResourceArea.moduleName,
        AdhProposal.moduleName,
        AdhSticky.moduleName
    ];

    if (config.cachebust) {
        appDependencies.push("templates");
    }

    var app = angular.module("a3", appDependencies);

    app.config(["adhTopLevelStateProvider", "$translateProvider", "$locationProvider", "$ariaProvider", (
        adhTopLevelStateProvider : AdhTopLevelState.Provider,
        $translateProvider,
        $locationProvider,
        $ariaProvider
    ) => {
        adhTopLevelStateProvider
            .when("", ["$location", ($location) : AdhTopLevelState.IAreaInput => {
                $location.replace();
                $location.path("/r/adhocracy/");
                return {
                    skip: true
                };
            }])
            .otherwise(() : AdhTopLevelState.IAreaInput => {
                return {
                    template: "<adh-page-wrapper><h1>404 - Not Found</h1></adh-page-wrapper>"
                };
            });

        // Make sure HTML5 history API works.  (If support for older
        // browsers is required, we may have to study angular support
        // for conversion between history API and #!-URLs.  See
        // angular documentation for details.)
        $locationProvider.html5Mode(true);

        $translateProvider.useStaticFilesLoader({
            prefix: "/static/i18n/",
            suffix: ".json"
        });
{'fraction_non_alphanumeric': 0.1464180768061607, 'fraction_numerical': 0.002026547775863816, 'mean_word_length': 3.492489758761948, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6743289', 'n_tokens_mistral': 2856, 'n_tokens_neox': 2767, 'n_words': 506}