main.js revision fcfeab652394e5fddf0101c230ea3d30b9649538
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne/**
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne *
e217869edbae075c18fd85c2d468a7ce9050b3b3Jake Feasel * Copyright (c) 2014-2015 ForgeRock AS. All rights reserved.
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne *
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * The contents of this file are subject to the terms
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * of the Common Development and Distribution License
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * (the License). You may not use this file except in
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * compliance with the License.
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne *
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * You can obtain a copy of the License at
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * http://forgerock.org/license/CDDLv1.0.html
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * See the License for the specific language governing
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * permission and limitations under the License.
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne *
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * When distributing Covered Code, include this CDDL
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * Header Notice in each file and include the License file
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * at http://forgerock.org/license/CDDLv1.0.html
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * If applicable, add the following below the CDDL Header,
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * with the fields enclosed by brackets [] replaced by
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * your own identifying information:
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * "Portions Copyrighted [year] [name of copyright owner]"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne */
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne
9ad7d0020702ab233be7bce3c52cf209ebec0e35huck.elliott/*global require, define, window, JSONEditor */
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Brownerequire.config({
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne paths: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne less: "libs/less-1.5.1-min",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne i18next: "libs/i18next-1.7.3-min",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne i18nGrid: "libs/i18n/grid.locale-en",
40cf8018f65835fdf706efcbf62e9a3a06cb3179Jake Feasel backbone: "libs/backbone-1.1.2-min",
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel underscore: "libs/lodash-2.4.1-min",
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel js2form: "libs/js2form-2.0",
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel form2js: "libs/form2js-2.0",
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel spin: "libs/spin-2.0.1-min",
e217869edbae075c18fd85c2d468a7ce9050b3b3Jake Feasel jquery: "libs/jquery-2.1.1-min",
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel jqueryui: "libs/jquery-ui-1.11.1-min",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne jqgrid: "libs/jquery.jqGrid-4.5.4-min",
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne gentleSelect: "libs/jquery-gentleSelect-0.1.3.1-min",
da94b90a76ad985d8b442a0571f96a2cf8e1d551Elizabeth Browne cron: "libs/jquery-cron-r2427",
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel xdate: "libs/xdate-0.8-min",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne doTimeout: "libs/jquery.ba-dotimeout-1.0-min",
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel handlebars: "libs/handlebars-1.3.0-min",
8d7f4062530cb28c3500555d87f62ed1a95cc630Jason Browne bootstrap: "libs/bootstrap.min",
8d7f4062530cb28c3500555d87f62ed1a95cc630Jason Browne "bootstrap-dialog": "libs/bootstrap-dialog.min",
5ba21fe7054811ca234da9534ff33b26242a3c70Elizabeth Browne "bootstrap-tabdrop": "libs/bootstrap-tabdrop-1.0",
95f6a8dff82d34449590f9a50ccc70df924d5a8fJason Browne placeholder: "libs/jquery.placeholder",
15b38efb2ff497ce4f3efd3bd89d2c0e8e8eca1eJason Browne selectize : "libs/selectize-0.12.1-min",
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel moment: "libs/moment-2.8.1-min",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne AuthnDelegate: "org/forgerock/openidm/ui/common/delegates/AuthnDelegate",
cbbe3a4aab44b4352cec9dac8831028f16c392d2Elizabeth Browne jsonEditor: "libs/jsoneditor-0.7.9-min",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne ThemeManager: "org/forgerock/openidm/ui/common/util/ThemeManager",
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel "ldapjs-filter": "libs/ldapjs-filter-2253-min"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne shim: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne underscore: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "_"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne backbone: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne deps: ["underscore"],
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "Backbone"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne js2form: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "js2form"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne form2js: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "form2js"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne spin: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "spin"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
cbbe3a4aab44b4352cec9dac8831028f16c392d2Elizabeth Browne jsonEditor: {
fcfeab652394e5fddf0101c230ea3d30b9649538huck.elliott exports: "JSONEditor"
cbbe3a4aab44b4352cec9dac8831028f16c392d2Elizabeth Browne },
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne cron: {
da94b90a76ad985d8b442a0571f96a2cf8e1d551Elizabeth Browne deps: ["jquery"]
da94b90a76ad985d8b442a0571f96a2cf8e1d551Elizabeth Browne },
da94b90a76ad985d8b442a0571f96a2cf8e1d551Elizabeth Browne gentleSelect: {
da94b90a76ad985d8b442a0571f96a2cf8e1d551Elizabeth Browne deps: ["jquery"]
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne jqueryui: {
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel deps: ["jquery"],
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "jqueryui"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel i18nGrid: {
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel deps: ["jquery"]
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne jqgrid: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne deps: ["jqueryui", "i18nGrid"]
da94b90a76ad985d8b442a0571f96a2cf8e1d551Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne xdate: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "xdate"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne doTimeout: {
26a6ec53bb06b3fb881e2a0cf5855c300513cad6Jake Feasel deps: ["jquery"],
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "doTimeout"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne handlebars: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "handlebars"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne i18next: {
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel deps: ["jquery", "handlebars"],
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "i18next"
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne },
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne moment: {
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne exports: "moment"
95f6a8dff82d34449590f9a50ccc70df924d5a8fJason Browne },
15b38efb2ff497ce4f3efd3bd89d2c0e8e8eca1eJason Browne selectize: {
15b38efb2ff497ce4f3efd3bd89d2c0e8e8eca1eJason Browne deps: ["jquery"]
15b38efb2ff497ce4f3efd3bd89d2c0e8e8eca1eJason Browne },
8d7f4062530cb28c3500555d87f62ed1a95cc630Jason Browne bootstrap: {
8d7f4062530cb28c3500555d87f62ed1a95cc630Jason Browne deps: ["jquery"]
95f6a8dff82d34449590f9a50ccc70df924d5a8fJason Browne },
95f6a8dff82d34449590f9a50ccc70df924d5a8fJason Browne placeholder: {
95f6a8dff82d34449590f9a50ccc70df924d5a8fJason Browne deps: ["jquery"]
8d7f4062530cb28c3500555d87f62ed1a95cc630Jason Browne },
8d7f4062530cb28c3500555d87f62ed1a95cc630Jason Browne 'bootstrap-dialog': {
8d7f4062530cb28c3500555d87f62ed1a95cc630Jason Browne deps: ["jquery", "underscore","backbone", "bootstrap"]
5ba21fe7054811ca234da9534ff33b26242a3c70Elizabeth Browne },
5ba21fe7054811ca234da9534ff33b26242a3c70Elizabeth Browne 'bootstrap-tabdrop': {
5ba21fe7054811ca234da9534ff33b26242a3c70Elizabeth Browne deps: ["jquery", "bootstrap"]
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne }
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne }
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne});
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne/**
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * Loads all application on start, so each module will be available to
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne * required synchronously
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne */
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Brownerequire([
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel "jquery",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "underscore",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "backbone",
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel "less",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "form2js",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "js2form",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "spin",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "jqgrid",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "jqueryui",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "xdate",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "moment",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "doTimeout",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "handlebars",
95f6a8dff82d34449590f9a50ccc70df924d5a8fJason Browne "placeholder",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "i18next",
cbbe3a4aab44b4352cec9dac8831028f16c392d2Elizabeth Browne "jsonEditor",
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel "gentleSelect",
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel "cron",
15b38efb2ff497ce4f3efd3bd89d2c0e8e8eca1eJason Browne "selectize",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "org/forgerock/commons/ui/common/main/i18nManager",
cbbe3a4aab44b4352cec9dac8831028f16c392d2Elizabeth Browne "org/forgerock/commons/ui/common/util/Constants",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "org/forgerock/commons/ui/common/main/EventManager",
cbbe3a4aab44b4352cec9dac8831028f16c392d2Elizabeth Browne "org/forgerock/openidm/ui/common/main",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "org/forgerock/openidm/ui/admin/main",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "org/forgerock/commons/ui/common/main",
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel "AuthnDelegate",
c54f5c9f018cfaf6792ae351d3f0be15efdd175eJake Feasel "ThemeManager",
48ddd46e9e22ee57a7fb400c6296f977c11173b3Elizabeth Browne "config/main"
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne], function(
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel $,
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel _,
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel Backbone,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne less,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne form2js,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne js2form,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne spin,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne jqgrid,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne jqueryui,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne xdate,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne moment,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne doTimeout,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne handlebars,
95f6a8dff82d34449590f9a50ccc70df924d5a8fJason Browne placeholder,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne i18next,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne jsonEditor,
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel gentleSelect,
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel cron,
15b38efb2ff497ce4f3efd3bd89d2c0e8e8eca1eJason Browne selectize,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne i18n,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne constants,
d5b7485f164e9584d8b84bd882cb8df10c61bfa9Elizabeth Browne eventManager) {
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel // Helpers for the code that hasn't been properly migrated to require these as explicit dependencies:
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel window.$ = $;
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel window._ = _;
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel window.Backbone = Backbone;
4e74818e3d2f5b362c256e8d08ea2da2222f7a4bJake Feasel
da94b90a76ad985d8b442a0571f96a2cf8e1d551Elizabeth Browne eventManager.sendEvent(constants.EVENT_DEPENDECIES_LOADED);
15b38efb2ff497ce4f3efd3bd89d2c0e8e8eca1eJason Browne
9ad7d0020702ab233be7bce3c52cf209ebec0e35huck.elliott JSONEditor.defaults.options.theme = 'bootstrap3';
9ad7d0020702ab233be7bce3c52cf209ebec0e35huck.elliott JSONEditor.defaults.options.iconlib = "fontawesome4";
8d7f4062530cb28c3500555d87f62ed1a95cc630Jason Browne});