123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Glass
- *| (C) Copyright IBM Corp. 2020, 2021
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define([
- 'baglass/core-client/js/core-client/ui/core/Class',
- 'underscore',
- 'jquery',
- '../../nls/StringResources',
- 'text!../views/templates/AboutDialog.html',
- 'doT',
- 'bi/commons/utils/Utils',
- 'require-css!css/ca_portal/aboutDialog'
- ], function(Class, _, $, StringResources, template, dot, Utils) {
- var OpenAboutCognosAction = Class.extend({
- init: function(options) {
- OpenAboutCognosAction.inherited('init', this, arguments);
- _.extend(this, options);
- },
- canExecute: function() {
- return true;
- },
- doAction: function(context) {
- return this._showTheAboutDialog(context);
- },
- _options: function(productVersion, kitVersion) {
- return {
- aboutCognosAnalytics: StringResources.get('legalText', { 'year': new Date().getFullYear() }),
- cognosLabel: StringResources.get('productName', {
- version: productVersion
- }),
- kitVersion: kitVersion
- };
- },
- _showTheAboutDialog: function(context) {
- return context.glassContext.getCoreSvc('.Config').getProductVersion().then(function(productVersion) {
- var html = dot.template(template || '')(this._options(productVersion, context.glassContext.versionInfo));
- return context.glassContext.appController.showMessage(html, '', 'info', ['close'], '399px', undefined, true, 'aboutDialog').then(function(dialog) {
- var $dlg = $(dialog._queryId);
- $dlg.find('.dialogCloseX').remove();
- var $dialogHeader = $dlg.find('.dialogHeader');
- var $dialogHeaderContents = $dlg.find('.aboutDialogAnalyticsLogo').children();
- var $dialogTitle = $dlg.find('.dialogTitle');
- $dlg.find('.logoText').attr('id', $dialogTitle.attr('id'));
- $dialogTitle.removeAttr('id');
- $dialogHeader.addClass('aboutDialogHeader');
- $dialogHeaderContents.detach();
- $dialogHeader.find('header').addClass('aboutDialogAnalyticsLogo').append($dialogHeaderContents);
- Utils.setIcon($dlg.find('.aboutDialogAnalyticsLogo').find('.logoImage'), 'common-CA_Avatar_Colour_24');
- });
- }.bind(this));
- }
- });
- return OpenAboutCognosAction;
- });
|