main-device.js revision ff3f4c521304768d37313711129dfe6c31a5d595
0N/A/**
553N/A * The contents of this file are subject to the terms of the Common Development and
0N/A * Distribution License (the License). You may not use this file except in compliance with the
0N/A * License.
0N/A *
0N/A * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
0N/A * specific language governing permission and limitations under the License.
0N/A *
0N/A * When distributing Covered Software, include this CDDL Header Notice in each file and include
0N/A * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
0N/A * Header, with the fields enclosed by brackets [] replaced by your own identifying
0N/A * information: "Portions copyright [year] [name of copyright owner]".
0N/A *
0N/A * Copyright 2015 ForgeRock AS.
0N/A */
0N/A
0N/Arequire.config({
0N/A map: {
553N/A "*" : {
553N/A "ThemeManager" : "org/forgerock/openam/ui/common/util/ThemeManager",
553N/A "Router": "org/forgerock/openam/ui/common/SingleRouteRouter",
0N/A // TODO: Remove this when there are no longer any references to the "underscore" dependency
0N/A "underscore" : "lodash"
0N/A }
0N/A },
0N/A paths: {
0N/A "lodash": "libs/lodash-3.10.1-min",
0N/A "handlebars": "libs/handlebars-4.0.5",
0N/A "i18next": "libs/i18next-1.7.3-min",
0N/A "jquery": "libs/jquery-2.1.1-min",
0N/A "text": "libs/text"
0N/A },
516N/A shim: {
516N/A "handlebars": {
0N/A exports: "handlebars"
0N/A },
0N/A "i18next": {
0N/A deps: ["jquery", "handlebars"],
0N/A exports: "i18next"
0N/A },
0N/A "underscore": {
0N/A exports: "_"
0N/A }
0N/A }
0N/A});
0N/A
0N/Arequire([
0N/A "jquery",
0N/A "handlebars",
0N/A "org/forgerock/commons/ui/common/main/Configuration",
0N/A "org/forgerock/openam/ui/common/util/Constants",
0N/A "text!templates/user/DeviceTemplate.html",
0N/A "text!templates/user/DeviceDoneTemplate.html",
0N/A "text!templates/common/LoginBaseTemplate.html",
0N/A "text!templates/common/FooterTemplate.html",
0N/A "text!templates/common/LoginHeaderTemplate.html",
"org/forgerock/commons/ui/common/main/i18nManager",
"ThemeManager",
"Router"
], function ($, HandleBars, Configuration, Constants, DeviceTemplate, DeviceDoneTemplate,
LoginBaseTemplate, FooterTemplate, LoginHeaderTemplate, i18nManager, ThemeManager, Router) {
var data = window.pageData,
template = data.done ? DeviceDoneTemplate : DeviceTemplate;
i18nManager.init({
paramLang: {
locale: data.locale
},
defaultLang: Constants.DEFAULT_LANGUAGE,
nameSpace: "device"
});
Configuration.globalData = { realm : data.realm };
Router.currentRoute = {
navGroup: "user"
};
ThemeManager.getTheme().always(function (theme) {
data.theme = theme;
$("#wrapper").html(HandleBars.compile(LoginBaseTemplate)(data));
$("#footer").html(HandleBars.compile(FooterTemplate)(data));
$("#loginBaseLogo").html(HandleBars.compile(LoginHeaderTemplate)(data));
$("#content").html(HandleBars.compile(template)(data));
});
});