Commit a8139fe3 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Reconoce dominio ecomarcan y retoca logo y meta

Añade comprobación de dominio actual a primer nivel de la aplicación
(módulo App, en el lado del cliente). Propaga flag booleano para evaluar
en cada módulo si debe adaptar algo de su contenido.

Comienza modificando el texto que acompaña al logo del topbar y el valor
de sufijo de título definido en metatags.
parent 0cd41877
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -107,6 +107,10 @@ define([

		constructor: function(args) {

			// TODO medida temporal de comienzo de migración de identidad
			var currDomain = getGlobalContext().location.hostname,
				ecomarcanDomainPattern = /.*ecomarcan\..+/;

			this.config = {
				ownChannel: this.rootChannel,
				events: {
@@ -118,7 +122,8 @@ define([
					CHANGE_MODULE: 'changeModule'
				},

				_reconnectTimeout: 10000
				_reconnectTimeout: 10000,
				_ecomarcan: ecomarcanDomainPattern.test(currDomain)
			};

			lang.mixin(this, this.config, args);
@@ -152,7 +157,8 @@ define([
			});

			new MetaTags({
				parentChannel: parentChannel
				parentChannel: parentChannel,
				ecomarcan: this._ecomarcan
			});

			this._credentials = new Credentials({
@@ -365,7 +371,8 @@ define([
			this._deleteLayout();

			this._currLayoutInstance = new InnerApp({
				parentChannel: this.getChannel()
				parentChannel: this.getChannel(),
				ecomarcan: this._ecomarcan
			});

			this._setCurrentLayout(this._currLayoutInstance);
@@ -383,7 +390,8 @@ define([
			this._deleteLayout();

			this._currLayoutInstance = new OuterApp({
				parentChannel: this.getChannel()
				parentChannel: this.getChannel(),
				ecomarcan: this._ecomarcan
			});

			this._setCurrentLayout(this._currLayoutInstance);
+2 −1
Original line number Diff line number Diff line
@@ -212,7 +212,8 @@ define([

			this.topbar = new Topbar({
				parentChannel: this.getChannel(),
				collapseButtonClass: this.collapseButtonClass
				collapseButtonClass: this.collapseButtonClass,
				ecomarcan: this.ecomarcan
			});

			this.sidebar = new MainSidebarImpl({
+7 −2
Original line number Diff line number Diff line
@@ -36,10 +36,15 @@ define([

				logoClass: 'topbarLogo',
				logoHref: '/home',
				logoImgSrc: '/resources/images/logos/logo.svg',
				logoTextContent: 'REDMIC'
				logoImgSrc: '/resources/images/logos/logo.svg'
			};

			if (args && args.ecomarcan) {
				this.config.logoTextContent = 'ECOMARCAN';
			} else {
				this.config.logoTextContent = 'REDMIC';
			}

			lang.mixin(this, this.config, args);
		},

+6 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ define([
					PUT_META_TAGS: 'putMetaTags'
				},

				nativeTitleSuffix: 'REDMIC',
				ogTitleLimit: 60,
				twitterTitleLimit: 70,
				ogDescriptionLimit: 200,
@@ -42,6 +41,12 @@ define([
				_defaultKey: 'default'
			};

			if (args && args.ecomarcan) {
				this.config.nativeTitleSuffix = 'ECOMARCAN';
			} else {
				this.config.nativeTitleSuffix = 'REDMIC';
			}

			lang.mixin(this, this.config, args);
		},