1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- 'use strict';
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['../../lib/@waca/core-client/js/core-client/ui/core/Class', 'underscore', 'doT', '../../lib/@waca/core-client/js/core-client/utils/ClassFactory'], function (Class, _, dot, ClassFactory) {
- /**
- * To show modal dialogs in glass, we need to supply the html & css
- * This utility provides a simple way to use consistent style in all dialogs & make it easier to maintain
- * All the css variables are maintained here and templates are populated using them (similar to variables in stylus)
- */
- // @class
- var GlassDialogUtil = Class.extend({
- cssVars: {
- font: '14px Roboto,Arial,Garuda,sans-serif',
- dialogTextLineHeight: 1,
- dialogHeaderColor: '#231f20',
- dialogHeaderFontSize: '18px',
- dialogInputColor: '#666666',
- dialogInputHeight: '18px',
- dialogHeaderPadding: '12px',
- dialogFooterPadding: '20px',
- primaryButtonBorder: '1px solid #D84E8D',
- primaryButtonColor: '#D84E8D', //pink (not ba blue) is used for authoring, '#319BD4' bablue
- primaryButtonHoverBackgroundColor: '#D84E8D',
- primaryButtonHoverColor: '#fff',
- secondaryButtonBorder: '1px solid #666666',
- secondaryButtonColor: '#666666', //grey_3
- secondaryButtonHoverBackgroundColor: '#666666',
- secondaryButtonHoverColor: '#fff',
- dialogButtonHeight: '32px',
- dialogButtonPadding: ' 0 20px 0 20px',
- dialogButtonLineHeight: '30px',
- dialogButtonFontFamily: 'Helvetica Neue Medium",Roboto,Helvetica,Arial,sans-serif'
- },
- generateMarkup: function generateMarkup(htmlTemplate, htmlParams, cssTemplate, cssParams) {
- var _this = this;
- var modules = ['text!dashboard-core/js/app/util/templates/' + htmlTemplate + '.html'];
- if (cssTemplate) {
- modules.push('text!dashboard-core/js/app/util/templates/' + cssTemplate + '.csstemplate');
- }
- return Promise.all(modules.map(function (module) {
- return ClassFactory.loadModule(module);
- })).then(function (Modules) {
- var htmlString = Modules[0];
- var cssString = Modules[1];
- var output = {};
- output.html = _this._generate(htmlString, htmlParams);
- if (cssString) {
- var _cssParams = _.extend({}, _this.cssVars, cssParams);
- output.css = _this._generate(cssString, _cssParams);
- }
- return output;
- });
- },
- _generate: function _generate(templateString, params) {
- var dotTemplate = dot.template(templateString || '');
- var output = dotTemplate(params);
- return output;
- }
- });
- // Singleton
- return new GlassDialogUtil();
- });
- //# sourceMappingURL=GlassDialogUtil.js.map
|