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