1 2var extensions = {}; 3extensions['CXExtensibility.CoreContent.1.0.6'] = function(){ 4function getExtensionAssetsPath(asset){ 5return 'extensions/CXExtensibility/CoreContent/1.0.6/' + asset; 6}; 7// Types references for VSCode Intellisense 8/// <reference path="../../../../../node_modules/@types/jquery/index.d.ts"/> 9/// <reference path="../../../../../node_modules/@types/underscore/index.d.ts"/> 10/** 11 * @typedef {import("./types").Item} Item Data for single item to display in the merchandising zone 12 * @typedef {import("./types").ItemImage} ItemImage Container for image url and alt text 13 * @typedef {import("./types").Settings} Settings Sidepanel settings 14 */ 15define('CXExtensibility.CoreContent.CMSMerchzoneCCT.View', [ 16 'CustomContentType.Base.View', 17 'cxextensibility_corecontent_cmsmerchzonecct.tpl', 18 'Utils', 19 'jQuery', 20 'underscore', 21], /** 22 * @param {JQueryStatic} $ 23 * @param {_.UnderscoreStatic} _ 24 */ function (CustomContentTypeBaseView, template, Utils, $, _) { 25 'use strict'; 26 var displayModes = { 27 HORIZONTAL: '1', 28 VERTICAL: '2', 29 GRID: '3', 30 }; 31 var isMobile = false; 32 return CustomContentTypeBaseView.extend({ 33 template: template, 34 /**@type {Settings}*/ 35 settings: null, 36 initialize: function () { 37 this._initialize(); 38 this.on('afterViewRender', function () { 39 var merchRule = this.settings.custrecord_merchzone_merchrule; 40 isMobile = window.matchMedia("(max-width: 767px)").matches 41 if (merchRule && merchRule !== '') { 42 this.fetchMerchZoneEndpoint(merchRule); 43 } 44 }); 45 }, 46 /** 47 * Fetch merchzone information from SMT CMS endpoint 48 * @param {string | number} merchzoneId Merchzone ID to fetch 49 */ 50 fetchMerchZoneEndpoint: function fetchMerchZoneEndpoint(merchzoneId) { 51 $.ajax({ 52 url: '/api/cms/v2/merchzones/' + merchzoneId, 53 }).done( 54 function (res) { 55 this.fetchItems(res.data[0].queryString); 56 }.bind(this) 57 ); 58 }, 59 /** 60 * Fetch items from items enddpoint returned from merchzone endpoint 61 * @param {string} itemsEndpoint 62 */ 63 fetchItems: function fetchItems(itemsEndpoint) { 64 $.ajax({ 65 url: itemsEndpoint, 66 }).done( 67 function (res) { 68 var itemDetails = _.map( 69 res.items, 70 function (item) { 71 /** @type {Item} */ 72 var formattedItem = { 73 name: item.storedisplayname2 || item.displayname, 74 price: item.onlinecustomerprice_formatted, 75 link: '/' + item.urlcomponent, 76 image: this.getDefaultImage(item.itemimages_detail), 77 }; 78 return formattedItem; 79 }.bind(this) 80 ); 81 this.renderMerchzone(itemDetails); 82 }.bind(this) 83 ); 84 }, 85 /** 86 * Render item info to template 87 * @param {Item[]} items 88 */ 89 renderMerchzone: function renderMerchzone(items) { 90 if (items.length === 0) { 91 return; 92 } 93 var heading = this.settings.custrecord_merchzone_heading || ''; 94 if (heading.length === 0) { 95 this.$('.cms-merchzone-heading').remove(); 96 } else { 97 this.$('.cms-merchzone-heading').text(heading); 98 } 99 _.each( 100 items, 101 function (item) { 102 var template = this.$('#item-template').contents().clone(); 103 template.find('.item-name').text(item.name); 104 template.find('.item-price').text(item.price); 105 template.find('.item-link').attr('href', item.link); 106 template.find('.item-name').attr('href', item.link); 107 template.find('.cms-merchzone-see-more').attr('href', item.link); 108 template.find('.item-image').attr('src', item.image.url); 109 template.find('.item-image').attr('alt', item.image.altimagetext); 110 this.$('.cms-merchzone-slider').append(template); 111 }, 112 this 113 ); 114 var sliderRendered = this.$('.cms-merchzone-slider').parent().hasClass('bx-viewport'); 115 var displayMode = this.settings.custrecord_merchzone_display_mode.toString(); 116 if (displayMode !== displayModes.GRID) { 117 if (sliderRendered) { 118 return; 119 } 120 this.renderSlider(); 121 } else { 122 this.renderGrid(); 123 } 124 },
125 renderSlider: function renderSlider() { 126 var displayMode = this.settings.custrecord_merchzone_display_mode || displayModes.HORIZONTAL; 127 var mode = displayMode.toString() === displayModes.VERTICAL ? 'vertical' : 'horizontal'; 128 var numItems = isMobile ? 1 : parseInt(this.settings.custrecord_merchzone_numitems) || 4; 129 var merchzoneWidth = this.$('.cms-merchzone-slider').width(); 130 var slideWidth = Math.floor(merchzoneWidth / numItems); 131 var sliderOptions = { 132 mode: mode, 133 minSlides: numItems, 134 maxSlides: numItems, 135 slideWidth: slideWidth, 136 moveSlides: 1, 137 pager: false, 138 nextText: 139 '<a class="cms-merchzone-slider-next cms-merchzone-' + 140 mode + 141 '-control"><span class="control-text">' + 142 _('next').translate() + 143 '</span> <i class="carousel-next-arrow"></i></a>', 144 prevText: 145 '<a class="cms-merchzone-slider-prev cms-merchzone-' + 146 mode + 147 '-control"><i class="carousel-prev-arrow"></i> <span class="control-text">' + 148 _('prev').translate() + 149 '</span></a>', 150 }; 151 Utils.initBxSlider(this.$('.cms-merchzone-slider'), sliderOptions); 152 this.$('.item-image-wrapper').css({ 'min-height': slideWidth + 'px' }); 153 if (displayMode === displayModes.VERTICAL) { 154 this.$('.bx-wrapper').css({ margin: '0 auto' }); 155 } 156 // Fix incorrect height when SCA rerenders the slider 157 setTimeout( 158 function () { 159 var itemHeight = this.$('.cms-merchzone-item').height(); 160 this.$('.bx-viewport').css({ 'min-height': itemHeight }); 161 }.bind(this) 162 ); 163 }, 164 renderGrid: function renderGrid() { 165 var merchzoneWidth = this.$('.cms-merchzone-slider').width(); 166 var numItems = isMobile ? 1 : parseInt(this.settings.custrecord_merchzone_numitems) || 3; 167 this.$('.cms-merchzone-slider').removeClass('cms-merchzone-slider').addClass('cms-merchzone-grid'); 168 this.$('.cms-merchzone-grid > li').css({ 169 width: Math.floor(merchzoneWidth / numItems), 170 }); 171 }, 172 /** 173 * Get the default image or first image found if not available 174 * @param {Object} itemimages The object contained in the item's itemimages_detail key 175 * @returns {ItemImage} 176 */ 177 getDefaultImage: function getDefaultImage(itemimages) { 178 /** 179 * Flatten method taken from SCA Utils 180 * @param {Object} images 181 * @returns {ItemImage[]} 182 */ 183 function flattenImages(images) { 184 if ('url' in images && 'altimagetext' in images) { 185 return [images]; 186 } 187 return _.flatten( 188 _.map(images, function (item) { 189 if (_.isArray(item)) { 190 return item; 191 } 192 return flattenImages(item); 193 }) 194 ); 195 } 196 var imageData = flattenImages(itemimages); 197 var defaultImage = _.find(imageData, function (image) { 198 var match = image.url.match(/.*\.default\.[A-Za-z]*/i); 199 return !!match && match[0] === image.url; 200 }); 201 return defaultImage || imageData[0]; 202 }, 203 contextDataRequest: [], 204 validateContextDataRequest: function () { 205 return true; 206 }, 207 getContext: function () { 208 return { 209 merchRule: this.settings.custrecord_merchzone_merchrule, 210 displayMode: this.settings.custrecord_merchzone_display_mode, 211 numItems: this.settings.custrecord_merchzone_numitems, 212 }; 213 }, 214 }); 215}); 216// @module CXExtensibility.CoreContent.CMSMerchzoneCCT 217// An example cct that shows a message with the price, using the context data from the item 218// Use: Utils.getAbsoluteUrl(getExtensionAssetsPath('services/service.ss')) 219// to reference services or images available in your extension assets folder 220define('CXExtensibility.CoreContent.CMSMerchzoneCCT', ['CXExtensibility.CoreContent.CMSMerchzoneCCT.View'], function ( 221 CMSMerchzoneCCTView 222) { 223 'use strict'; 224 return { 225 mountToApp: function mountToApp(container) { 226 var environment = container.getComponent('Environment'); 227 environment.setTranslation('fr_CA', [{ key: 'See More', value: 'Voir Plus' }]); 228 environment.setTranslation('es_ES', [{ key: 'See More', value: 'Ver Más' }]); 229 container.getComponent('CMS').registerCustomContentType({ 230 // this property value MUST be lowercase 231 id: 'CMS_MERCHZONETWO', 232 // The view to render the CCT 233 view: CMSMerchzoneCCTView, 234 }); 235 }, 236 }; 237}); 238define('CXExtensibility.CoreContent.CoreContentModule', [ 239 'CXExtensibility.CoreContent.CMSMerchzoneCCT', 240], function (CMSMerchzoneCCT) { 241 'use strict'; 242 return { 243 mountToApp: function mountToApp(container) { 244 CMSMerchzoneCCT.mountToApp(container); 245 }, 246 }; 247}); 248}; 249extensions['SuiteCommerce.CustomFields.1.1.4'] = function(){ 250function getExtensionAssetsPath(asset){ 251return 'extensions/SuiteCommerce/CustomFields/1.1.4/' + asset; 252}; 253/// <amd-module name="SuiteCommerce.CustomFields.Instrumentation.Helper"/> 254define("SuiteCommerce.CustomFields.Instrumentation.Helper", ["require", "exports", "SuiteCommerce.CustomFields.Instrumentation"], function (require, exports, Instrumentation_1) { 255 "use strict"; 256 Object.defineProperty(exports, "__esModule", { value: true }); 257 exports.ComponentArea = 'SC Custom Fields'; 258 exports.ExtensionVersion = '1.1.4'; 259 exports.QueueNameSuffix = '-CustomFields'; 260 var InstrumentationHelper = /** @class */ (function () { 261 function InstrumentationHelper() { 262 } 263 InstrumentationHelper.initializeInstrumentation = function (container) { 264 Instrumentation_1.default.initialize({ 265 environment: container.getComponent('Environment'), 266 queueNameSuffix: exports.QueueNameSuffix, 267 }); 268 }; 269 return InstrumentationHelper; 270 }()); 271 exports.InstrumentationHelper = InstrumentationHelper; 272}); 273/// <amd-module name="SuiteCommerce.CustomFields.JavaScript.Utils"/> 274define("SuiteCommerce.CustomFields.JavaScript.Utils", ["require", "exports", "Utils"], function (require, exports, Utils_1) { 275 "use strict"; 276 Object.defineProperty(exports, "__esModule", { value: true }); 277 var Utils = /** @class */ (function () { 278 function Utils() { 279 } 280 Utils.formatDate = function (receivedDate, dateFormat) { 281 var newDate = dateFormat; 282 var monthReplaced = false;
283 var date = new Date(receivedDate); 284 var replaceMonth = function (monthLength, format) { 285 var matched = newDate.match(monthLength); 286 if (matched && !monthReplaced) { 287 monthReplaced = true; 288 return newDate.replace(monthLength, date.toLocaleString('en-us', { month: format })); 289 } 290 return newDate; 291 }; 292 var ua = navigator.userAgent; 293 var isOldIe = ua.indexOf('MSIE ') > -1; 294 if (isOldIe) { 295 return receivedDate; 296 } 297 newDate = newDate.replace('yyyy', date.toLocaleString('en-us', { year: 'numeric' })); 298 newDate = newDate.replace('yy', date.toLocaleString('en-us', { year: '2-digit' })); 299 newDate = newDate.replace('dd', date.toLocaleString('en-us', { day: '2-digit' })); 300 newDate = newDate.replace('d', date.toLocaleString('en-us', { day: 'numeric' })); 301 newDate = replaceMonth('mmmm', 'long'); 302 newDate = replaceMonth('mmm', 'short'); 303 newDate = replaceMonth('mm', '2-digit'); 304 newDate = replaceMonth('m', 'numeric'); 305 return newDate; 306 }; 307 // @method urlIsAbsolute @param {String} url @returns {Boolean} 308 Utils.isUrlAbsolute = function (url) { 309 return /^https?:\/\//.test(url); 310 }; 311 // @method getAbsoluteUrl @param {String} file @returns {String} 312 Utils.getAbsoluteUrl = function (file, isServices2) { 313 return Utils_1.getAbsoluteUrl(file, isServices2); 314 }; 315 Utils.translate = function (text) { 316 var params = []; 317 for (var _i = 1; _i < arguments.length; _i++) { 318 params[_i - 1] = arguments[_i]; 319 } 320 return Utils_1.translate.apply(void 0, [text].concat(params)); 321 }; 322 return Utils; 323 }()); 324 exports.Utils = Utils; 325}); 326/// <amd-module name="SuiteCommerce.CustomFields.Instrumentation.Log"/> 327var __assign = (this && this.__assign) || function () { 328 __assign = Object.assign || function(t) { 329 for (var s, i = 1, n = arguments.length; i < n; i++) { 330 s = arguments[i]; 331 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 332 t[p] = s[p]; 333 } 334 return t; 335 }; 336 return __assign.apply(this, arguments); 337}; 338define("SuiteCommerce.CustomFields.Instrumentation.Log", ["require", "exports", "SuiteCommerce.CustomFields.Instrumentation.Logger", "SuiteCommerce.CustomFields.Instrumentation.Helper"], function (require, exports, Instrumentation_Logger_1, Instrumentation_Helper_1) { 339 "use strict"; 340 Object.defineProperty(exports, "__esModule", { value: true }); 341 var LogSeverity; 342 (function (LogSeverity) { 343 LogSeverity["INFO"] = "info"; 344 LogSeverity["ERROR"] = "error"; 345 })(LogSeverity = exports.LogSeverity || (exports.LogSeverity = {})); 346 var Log = /** @class */ (function () { 347 function Log(attributes) { 348 if (attributes === void 0) { attributes = { label: '' }; } 349 this.defaultParametersToSubmit = { 350 componentArea: Instrumentation_Helper_1.ComponentArea, 351 extensionVersion: Instrumentation_Helper_1.ExtensionVersion, 352 }; 353 this.setInitialAttributes(attributes); 354 } 355 Log.prototype.setInitialAttributes = function (attributes) { 356 var defaultAttributes = { 357 label: null, 358 parametersToSubmit: this.defaultParametersToSubmit || {}, 359 timer: {}, 360 severity: LogSeverity.INFO, 361 }; 362 var _a = __assign({}, defaultAttributes, attributes), label = _a.label, parametersToSubmit = _a.parametersToSubmit, timer = _a.timer, severity = _a.severity; 363 this.label = label; 364 this.parametersToSubmit = parametersToSubmit; 365 this.timer = timer; 366 this.severity = severity; 367 }; 368 Log.prototype.startTimer = function () { 369 this.timer.startTime = this.getTimestamp(); 370 }; 371 Log.prototype.endTimer = function () { 372 this.timer.endTime = this.getTimestamp(); 373 }; 374 Log.prototype.getTimestamp = function () { 375 if (!this.isOldInternetExplorer()) { 376 return performance.now() || Date.now(); 377 } 378 return Date.now(); 379 }; 380 Log.prototype.getElapsedTimeForTimer = function () { 381 var timer = this.timer; 382 if (timer.startTime && timer.endTime) { 383 if (timer.startTime > timer.endTime) { 384 console.warn('Start time should be minor that end time in timer'); 385 return null; 386 } 387 return timer.endTime - timer.startTime; 388 } 389 if (!timer.startTime) 390 console.warn('The Start time is not defined'); 391 if (!timer.endTime) 392 console.warn('The End time is not defined'); 393 return null; 394 }; 395 Log.prototype.setParameters = function (data) { 396 var _this = this;
397 Object.keys(data).forEach(function (parameter) { 398 _this.setParameter(parameter, data[parameter]); 399 }); 400 }; 401 Log.prototype.setParameter = function (parameter, value) { 402 var logData = this.parametersToSubmit; 403 logData[parameter] = value; 404 this.parametersToSubmit = logData; 405 }; 406 Log.prototype.submit = function () { 407 if (!this.isOldInternetExplorer()) { 408 switch (this.severity) { 409 case LogSeverity.ERROR: 410 this.submitAsError(); 411 break; 412 case LogSeverity.INFO: 413 default: 414 this.submitAsInfo(); 415 } 416 } 417 }; 418 Log.prototype.isOldInternetExplorer = function () { 419 return (!!navigator.userAgent.match(/Trident/g) || 420 !!navigator.userAgent.match(/MSIE/g)); 421 }; 422 Log.prototype.submitAsError = function () { 423 Instrumentation_Logger_1.Logger.getLogger().error(this.parametersToSubmit); 424 }; 425 Log.prototype.submitAsInfo = function () { 426 Instrumentation_Logger_1.Logger.getLogger().info(this.parametersToSubmit); 427 }; 428 return Log; 429 }()); 430 exports.Log = Log; 431}); 432/// <amd-module name="SuiteCommerce.CustomFields.Instrumentation.Logger"/> 433define("SuiteCommerce.CustomFields.Instrumentation.Logger", ["require", "exports", "SuiteCommerce.CustomFields.Instrumentation.MockAppender"], function (require, exports, Instrumentation_MockAppender_1) { 434 "use strict"; 435 Object.defineProperty(exports, "__esModule", { value: true }); 436 var Logger = /** @class */ (function () { 437 function Logger() { 438 } 439 Logger.getLogger = function () { 440 this.instance = this.instance || this.buildLoggerInstance(); 441 return this.instance; 442 }; 443 Logger.buildLoggerInstance = function () { 444 var _a; 445 try { 446 // @ts-ignore 447 var LoggersModule = require('Loggers').Loggers; 448 // @ts-ignore 449 var elasticAppender = require('Loggers.Appender.ElasticLogger') 450 .LoggersAppenderElasticLogger.getInstance(); 451 // Just for test purposes in local environments: the output of MockApppender is the browser console. 452 var mockAppender = Instrumentation_MockAppender_1.MockAppender.getInstance(); 453 // @ts-ignore 454 var configurationModule = require('Loggers.Configuration'); 455 var loggerName = "CommerceExtensions" + Logger.options.queueNameSuffix; 456 LoggersModule.setConfiguration((_a = {}, 457 _a[loggerName] = { 458 log: [ 459 { profile: configurationModule.prod, appenders: [elasticAppender] }, 460 { profile: configurationModule.dev, appenders: [mockAppender] }, 461 ], 462 actions: {}, 463 loggers: {}, 464 }, 465 _a)); 466 return LoggersModule.getLogger(loggerName); 467 } 468 catch (e) { 469 return { 470 info: function (obj) { }, 471 error: function (obj) { }, 472 }; 473 } 474 }; 475 return Logger; 476 }()); 477 exports.Logger = Logger; 478}); 479/// <amd-module name="SuiteCommerce.CustomFields.Instrumentation.MockAppender"/> 480define("SuiteCommerce.CustomFields.Instrumentation.MockAppender", ["require", "exports"], function (require, exports) { 481 "use strict"; 482 Object.defineProperty(exports, "__esModule", { value: true }); 483 var MockAppender = /** @class */ (function () { 484 function MockAppender() { 485 } 486 MockAppender.prototype.info = function (data) { 487 console.info('MockAppender - Info', data); 488 }; 489 MockAppender.prototype.error = function (data) { 490 console.error('MockAppender - Error', data); 491 }; 492 MockAppender.prototype.ready = function () { 493 return true; 494 }; 495 MockAppender.getInstance = function () { 496 if (!MockAppender.instance) { 497 MockAppender.instance = new MockAppender(); 498 } 499 return MockAppender.instance; 500 }; 501 MockAppender.prototype.start = function (action, options) { 502 return options; 503 }; 504 MockAppender.prototype.end = function (startOptions, options) { }; 505 return MockAppender; 506 }()); 507 exports.MockAppender = MockAppender; 508}); 509/// <amd-module name="SuiteCommerce.CustomFields.Instrumentation"/> 510define("SuiteCommerce.CustomFields.Instrumentation", ["require", "exports", "underscore", "SuiteCommerce.CustomFields.Instrumentation.Logger", "SuiteCommerce.CustomFields.Instrumentation.Log"], function (require, exports, _, Instrumentation_Logger_1, Instrumentation_Log_1) { 511 "use strict"; 512 Object.defineProperty(exports, "__esModule", { value: true }); 513 var logs = []; 514 exports.default = { 515 initialize: function (options) { 516 Instrumentation_Logger_1.Logger.options = options; 517 }, 518 getLog: function (logLabel) { 519 return this.getLogModelByLabel(logLabel) || this.registerNewLog(logLabel); 520 }, 521 getLogModelByLabel: function (label) { 522 return _(logs).findWhere({ label: label }); 523 }, 524 registerNewLog: function (label) { 525 var log = new Instrumentation_Log_1.Log({ label: label }); 526 logs.push(log); 527 return log; 528 }, 529 setParameterForAllLogs: function (parameter, value) {
530 logs.forEach(function (log) { 531 log.setParameter(parameter, value); 532 }); 533 }, 534 setParametersForAllLogs: function (data) { 535 logs.forEach(function (log) { 536 log.setParameters(data); 537 }); 538 }, 539 submitLogs: function () { 540 logs.forEach(function (log) { 541 log.submit(); 542 }); 543 }, 544 }; 545}); 546/// <amd-module name="SuiteCommerce.CustomFields.Utils"/> 547define("SuiteCommerce.CustomFields.Utils", ["require", "exports", "underscore"], function (require, exports, _) { 548 "use strict"; 549 Object.defineProperty(exports, "__esModule", { value: true }); 550 var CustomFieldsUtils = /** @class */ (function () { 551 function CustomFieldsUtils() { 552 } 553 CustomFieldsUtils.compileText = function (textInput, variables) { 554 var text = textInput || ''; 555 _(variables || {}).each(function (value, name) { 556 var regex = new RegExp("{{" + name + "}}", 'g'); 557 text = text.replace(regex, value); 558 }); 559 return text; 560 }; 561 return CustomFieldsUtils; 562 }()); 563 exports.CustomFieldsUtils = CustomFieldsUtils; 564}); 565/// <amd-module name="SuiteCommerce.CustomFields.PDP.Configuration"/> 566define("SuiteCommerce.CustomFields.PDP.Configuration", ["require", "exports", "underscore"], function (require, exports, _) { 567 "use strict"; 568 Object.defineProperty(exports, "__esModule", { value: true }); 569 var environment = null; 570 var DataMarkupTypes; 571 (function (DataMarkupTypes) { 572 DataMarkupTypes["JsonLd"] = "JSON-LD"; 573 })(DataMarkupTypes = exports.DataMarkupTypes || (exports.DataMarkupTypes = {})); 574 var Configuration = /** @class */ (function () { 575 function Configuration() { 576 } 577 Configuration.setEnvironment = function (environmentComponent) { 578 environment = environmentComponent; 579 }; 580 Configuration.getFieldsFromConfiguration = function () { 581 var _this = this; 582 var fieldsArray = []; 583 var fieldsArrayUnparsed = Configuration.get('customFields.pdp.fields', []); 584 fieldsArrayUnparsed.forEach(function (unparsedField) { 585 fieldsArray.push({ 586 nameInConfiguration: unparsedField.fieldid, 587 fieldText: unparsedField.fieldid, 588 fieldsToParse: [], 589 schema: unparsedField.schema, 590 show: unparsedField.show, 591 hideFromQuickView: unparsedField.hideFromQuickView, 592 parsedText: '', 593 visible: false, 594 }); 595 }); 596 fieldsArray.forEach(function (fieldObject) { 597 var fieldsToParse = _this.parseField(fieldObject.fieldText); 598 fieldObject.fieldsToParse = fieldsToParse; 599 }); 600 return fieldsArray; 601 }; 602 Configuration.get = function (key, defaultValue) { 603 if (environment) { 604 var configValue = environment.getConfig(key); 605 if (_.isUndefined(configValue) && !_.isUndefined(defaultValue)) { 606 return defaultValue; 607 } 608 return configValue; 609 } 610 console.error('Please set the Environment Component in the Configuration.'); 611 return null; 612 }; 613 Configuration.parseField = function (fieldText) { 614 var regexForParse = /\[\[(.+?)\]\]/g; 615 var matches = fieldText.match(regexForParse); 616 matches = matches ? matches : []; 617 matches = matches.map(function (field) { 618 return field.replace(']]', '').replace('[[', ''); 619 }); 620 return matches; 621 }; 622 Object.defineProperty(Configuration, "structuredDataMarkupType", { 623 get: function () { 624 return this.get('structureddatamarkup.type'); 625 }, 626 enumerable: true, 627 configurable: true 628 }); 629 return Configuration; 630 }()); 631 exports.Configuration = Configuration; 632}); 633/// <amd-module name="SuiteCommerce.CustomFields.PDP.Main.View"/> 634var __extends = (this && this.__extends) || (function () { 635 var extendStatics = function (d, b) { 636 extendStatics = Object.setPrototypeOf || 637 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 638 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 639 return extendStatics(d, b); 640 }; 641 return function (d, b) { 642 extendStatics(d, b); 643 function __() { this.constructor = d; } 644 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 645 }; 646})(); 647define("SuiteCommerce.CustomFields.PDP.Main.View", ["require", "exports", "Backbone", "suitecommerce_customfields_pdp_field.tpl", "SuiteCommerce.CustomFields.Instrumentation"], function (require, exports, Backbone_1, pdpFieldsTpl, Instrumentation_1) { 648 "use strict"; 649 Object.defineProperty(exports, "__esModule", { value: true }); 650 var PDPFieldsView = /** @class */ (function (_super) { 651 __extends(PDPFieldsView, _super); 652 function PDPFieldsView(options) { 653 var _this = _super.call(this, options) || this; 654 _this.template = pdpFieldsTpl; 655 _this.isQuickView = !!options.isQuickView; 656 _this.model.on('childSelected', function () { 657 _this.render(); 658 }); 659 return _this; 660 } 661 PDPFieldsView.prototype.logFieldsQuantity = function (quantity) {
662 var log = Instrumentation_1.default.getLog('usage'); 663 var SECTION = this.isQuickView ? 'Quick View' : 'PDP'; 664 log.setParameters({ 665 activity: "Show custom " + SECTION + " fields.", 666 instanceCount: quantity, 667 }); 668 log.submit(); 669 }; 670 PDPFieldsView.prototype.getContext = function () { 671 var model = this.model; 672 var fieldList = model.get('fieldsList'); 673 var fieldsToShow = fieldList.filter(function (field) { 674 return field.show; 675 }); 676 var fieldQuantityToShow = fieldsToShow.length; 677 this.logFieldsQuantity(fieldQuantityToShow); 678 return { 679 field: fieldsToShow, 680 showContainer: fieldQuantityToShow > 0, 681 }; 682 }; 683 return PDPFieldsView; 684 }(Backbone_1.View)); 685 exports.PDPFieldsView = PDPFieldsView; 686}); 687/// <amd-module name="SuiteCommerce.CustomFields.PDP.Model"/> 688var __extends = (this && this.__extends) || (function () { 689 var extendStatics = function (d, b) { 690 extendStatics = Object.setPrototypeOf || 691 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 692 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 693 return extendStatics(d, b); 694 }; 695 return function (d, b) { 696 extendStatics(d, b); 697 function __() { this.constructor = d; } 698 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 699 }; 700})(); 701define("SuiteCommerce.CustomFields.PDP.Model", ["require", "exports", "Backbone", "SuiteCommerce.CustomFields.PDP.Configuration", "underscore"], function (require, exports, Backbone_1, PDP_Configuration_1, _) { 702 "use strict"; 703 Object.defineProperty(exports, "__esModule", { value: true }); 704 var PDPModel = /** @class */ (function (_super) { 705 __extends(PDPModel, _super); 706 function PDPModel(modelAttributes) { 707 var _this = _super.call(this, modelAttributes) || this; 708 _this.isQuickView = !!modelAttributes.isQuickView; 709 _this.fieldsList = PDP_Configuration_1.Configuration.getFieldsFromConfiguration(); 710 _this.itemInfo = _this.pdp.getItemInfo().item; 711 _this.fieldsForJsonLd = {}; 712 _this.updateFields(); 713 if (PDP_Configuration_1.Configuration.structuredDataMarkupType === PDP_Configuration_1.DataMarkupTypes.JsonLd) { 714 _this.addJsonLdValues(); 715 } 716 _this.pdp.on('afterOptionSelection', function () { 717 _this.updateFields(); 718 _this.trigger('childSelected'); 719 }); 720 return _this; 721 } 722 Object.defineProperty(PDPModel.prototype, "pdp", { 723 get: function () { 724 return this.get('pdp'); 725 }, 726 enumerable: true, 727 configurable: true 728 }); 729 Object.defineProperty(PDPModel.prototype, "fieldsList", { 730 get: function () { 731 return this.get('fieldsList'); 732 }, 733 set: function (fieldsList) { 734 this.set('fieldsList', fieldsList); 735 }, 736 enumerable: true, 737 configurable: true 738 }); 739 Object.defineProperty(PDPModel.prototype, "itemInfo", { 740 get: function () { 741 return this.get('itemInfo'); 742 }, 743 set: function (itemInfo) { 744 this.set('itemInfo', itemInfo); 745 }, 746 enumerable: true, 747 configurable: true 748 }); 749 Object.defineProperty(PDPModel.prototype, "childItemInfo", { 750 get: function () { 751 return this.pdp.getSelectedMatrixChilds(); 752 }, 753 enumerable: true, 754 configurable: true 755 }); 756 PDPModel.prototype.updateFields = function () { 757 var _this = this; 758 var fieldList = this.fieldsList; 759 fieldList.forEach(function (fieldObject) {
760 var show = fieldObject.show, hideFromQuickView = fieldObject.hideFromQuickView, fieldText = fieldObject.fieldText, fieldsToParse = fieldObject.fieldsToParse; 761 fieldObject.show = !!(show && (!_this.isQuickView || !hideFromQuickView)); 762 if (fieldObject.show) { 763 fieldObject.parsedText = _this.replaceFromFieldList(fieldText, fieldsToParse); 764 if (fieldObject.schema) { 765 _this.populateJsonLdValues(fieldObject); 766 } 767 fieldObject.visible = fieldObject.show && _this.updateVisibility(fieldsToParse); 768 } 769 }); 770 this.fieldsList = fieldList; 771 }; 772 PDPModel.prototype.replaceFromFieldList = function (fieldText, stringList) { 773 var _this = this; 774 var resultText = fieldText; 775 stringList.forEach(function (replaceValue) { 776 var replaceString = _this.getItemInfoFieldValue(replaceValue); 777 resultText = resultText 778 .split("[[" + replaceValue + "]]") 779 .join("" + replaceString); 780 }); 781 return resultText; 782 }; 783 PDPModel.prototype.updateVisibility = function (propertyList) { 784 var _this = this; 785 var foundProperties = false; 786 propertyList.forEach(function (property) { 787 var fieldValue = _this.getItemInfoFieldValue(property); 788 if ((fieldValue && fieldValue !== ' ') || fieldValue === 0) { 789 foundProperties = true; 790 } 791 }); 792 return foundProperties; 793 }; 794 PDPModel.prototype.getItemInfoFieldValue = function (fieldId) { 795 var itemInfo = this.itemInfo; 796 var childItemInfo = this.childItemInfo; 797 if (childItemInfo.length === 1) { 798 return childItemInfo[0][fieldId] || itemInfo[fieldId] || ''; 799 } 800 return itemInfo[fieldId] || ''; 801 }; 802 PDPModel.prototype.populateJsonLdValues = function (fieldObject) { 803 var _this = this; 804 var fieldValue = ''; 805 fieldObject.fieldsToParse.forEach(function (field) { 806 fieldValue += _this.getItemInfoFieldValue(field); 807 }); 808 this.fieldsForJsonLd[fieldObject.schema] = fieldValue; 809 }; 810 PDPModel.prototype.addJsonLdValues = function () { 811 var _this = this; 812 this.pdp.modifyViewJsonLd('ProductDetails.Full.View', function (json) { 813 var extendedJson = _.extend(json, _this.fieldsForJsonLd); 814 return jQuery.Deferred().resolve(extendedJson); 815 }); 816 }; 817 return PDPModel; 818 }(Backbone_1.Model)); 819 exports.PDPModel = PDPModel; 820}); 821/// <amd-module name="SuiteCommerce.CustomFields.PDP"/> 822define("SuiteCommerce.CustomFields.PDP", ["require", "exports", "SuiteCommerce.CustomFields.PDP.Configuration", "SuiteCommerce.CustomFields.PDP.Main.View", "SuiteCommerce.CustomFields.PDP.Model"], function (require, exports, PDP_Configuration_1, PDP_Main_View_1, PDP_Model_1) { 823 "use strict"; 824 return { 825 mountToApp: function (container) { 826 PDP_Configuration_1.Configuration.setEnvironment(container.getComponent('Environment')); 827 var pdp = container.getComponent('PDP'); 828 if (pdp) { 829 this.addCustomFields(pdp); 830 } 831 }, 832 addCustomFields: function (pdp) { 833 this.addCustomFieldsToPDP(pdp); 834 this.addCustomFieldsToQuickViews(pdp); 835 }, 836 addCustomFieldsToPDP: function (pdp) { 837 pdp.addChildView('Product.Sku', this.pdpFieldsViewConstructor(pdp)); 838 }, 839 addCustomFieldsToQuickViews: function (pdp) { 840 pdp.addChildViews(pdp.PDP_QUICK_VIEW, { 841 'Product.Sku': { 842 'CustomFields.PDPFields': { 843 childViewIndex: 11, 844 childViewConstructor: this.pdpFieldsViewConstructor(pdp, true), 845 }, 846 }, 847 }); 848 }, 849 pdpFieldsViewConstructor: function (pdp, isQuickView) { 850 if (isQuickView === void 0) { isQuickView = false; } 851 return function () { 852 var model = new PDP_Model_1.PDPModel({ 853 pdp: pdp, 854 isQuickView: isQuickView, 855 }); 856 return new PDP_Main_View_1.PDPFieldsView({ 857 model: model, 858 isQuickView: isQuickView, 859 }); 860 }; 861 }, 862 }; 863}); 864/// <amd-module name="SuiteCommerce.CustomFields.PDP.Main"/> 865define("SuiteCommerce.CustomFields.PDP.Main", ["require", "exports", "SuiteCommerce.CustomFields.PDP", "SuiteCommerce.CustomFields.Instrumentation.Helper"], function (require, exports, PDPFields, Instrumentation_Helper_1) { 866 "use strict"; 867 var Module = { 868 mountToApp: function (container) { 869 Instrumentation_Helper_1.InstrumentationHelper.initializeInstrumentation(container); 870 PDPFields.mountToApp(container); 871 }, 872 }; 873 return Module; 874}); 875}; 876extensions['Maddocks.PaxanpaxMediaLibrary.1.0.0'] = function(){ 877function getExtensionAssetsPath(asset){ 878return 'extensions/Maddocks/PaxanpaxMediaLibrary/1.0.0/' + asset; 879}; 880// Model.js 881// ----------------------- 882// @module Case 883define("Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary.Model", ["Backbone", "Utils"], function( 884 Backbone, 885 Utils 886) { 887 "use strict"; 888 // @class Case.Fields.Model @extends Backbone.Model 889 return Backbone.Model.extend({ 890 891}); 892}); 893// @module Maddocks.PaxanpaxMediaLibrary.PaxanpaxBrandGuide 894define('Maddocks.PaxanpaxMediaLibrary.PaxanpaxBrandGuide.View' 895, [ 896 'maddocks_paxanpaxmedialibrary_paxanpaxbrandguide.tpl', 897 'Backbone', 898 'Utils' 899 ] 900, function ( 901 maddocks_paxanpaxmedialibrary_paxanpaxbrandguide_tpl, 902 Backbone, 903 Utils 904) 905{ 906 'use strict'; 907 // @class Maddocks.PaxanpaxMediaLibrary.PaxanpaxBrandGuide.View @extends Backbone.View 908 return Backbone.View.extend({ 909 template: maddocks_paxanpaxmedialibrary_paxanpaxbrandguide_tpl, 910 title: Utils.translate('Brand Guidelines | Paxanpax') 911 , initialize: function (options) { 912 /* Uncomment to test backend communication with an example service 913 (you'll need to deploy and activate the extension first) 914 */ 915 // this.model = new PaxanpaxMediaLibraryModel(); 916 // var self = this; 917 // this.model.fetch().done(function(result) { 918 // self.message = result.message; 919 // self.render(); 920 // }); 921 } 922 , events: { 923 } 924 , bindings: { 925 } 926 , childViews: { 927 } 928 //@method getContext @return Maddocks.PaxanpaxMediaLibrary.PaxanpaxBrandGuide.View.Context 929 , getContext: function getContext() 930 { 931 //@class Maddocks.PaxanpaxMediaLibrary.PaxanpaxBrandGuide.View.Context 932 933 return { 934 }; 935 } 936 }); 937}); 938// @module Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary 939define('Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary.View' 940, [ 941 'maddocks_paxanpaxmedialibrary_paxanpaxmedialibrary.tpl', 942 'Backbone', 943 'Utils' 944 ] 945, function ( 946 maddocks_paxanpaxmedialibrary_paxanpaxmedialibrary_tpl, 947 Backbone, 948 Utils 949) 950{ 951 'use strict'; 952 // @class Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary.View @extends Backbone.View 953 return Backbone.View.extend({ 954 template: maddocks_paxanpaxmedialibrary_paxanpaxmedialibrary_tpl, 955 title: Utils.translate('Media Library | Paxanpax') 956 , initialize: function (options) { 957 /* Uncomment to test backend communication with an example service 958 (you'll need to deploy and activate the extension first) 959 */ 960 // this.model = new PaxanpaxMediaLibraryModel(); 961 // var self = this; 962 // this.model.fetch().done(function(result) { 963 // self.message = result.message; 964 // self.render(); 965 // }); 966 } 967 , events: { 968 } 969 , bindings: { 970 } 971 , childViews: { 972 } 973 //@method getContext @return Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary.View.Context 974 , getContext: function getContext() 975 { 976 //@class Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary.View.Context 977 978 return { 979 }; 980 } 981 }); 982}); 983define( 984 'Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary' 985, [ 986 'Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary.View', 987 'Maddocks.PaxanpaxMediaLibrary.PaxanpaxBrandGuide.View', 988 'Utils' 989 ] 990, function ( 991 PaxanpaxMediaLibraryView, 992 PaxanpaxBrandGuideView, 993 Utils 994 ) 995{ 996 'use strict'; 997 return { 998 mountToApp: function mountToApp (container) 999 { 1000 var pageType = container.getComponent('PageType'); 1001 if (pageType) { 1002 pageType.registerPageType ({ 1003 name: 'PaxanpaxMediaLibrary', 1004 routes: ['media-library'], 1005 view: PaxanpaxMediaLibraryView, 1006 defaultTemplate: { 1007 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1008 } 1009 }); 1010 1011 pageType.registerPageType ({ 1012 name: 'PaxanpaxBrandGuide', 1013 routes: ['brand-guidelines'], 1014 view: PaxanpaxBrandGuideView, 1015 defaultTemplate: { 1016 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1017 } 1018 }); 1019 } 1020 } 1021 }; 1022}); 1023}; 1024extensions['Maddocks.PaxanpaxRetailInitiative.1.0.0'] = function(){ 1025function getExtensionAssetsPath(asset){ 1026return 'extensions/Maddocks/PaxanpaxRetailInitiative/1.0.0/' + asset; 1027}; 1028// Model.js 1029// ----------------------- 1030// @module Case 1031define("Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Model", ["Backbone", "Utils"], function( 1032 Backbone, 1033 Utils 1034) { 1035 "use strict"; 1036 // @class Case.Fields.Model @extends Backbone.Model 1037 return Backbone.Model.extend({ 1038 1039}); 1040}); 1041// @module Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative 1042define('Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Cooking.View' 1043, [ 1044 'maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_cooking.tpl', 1045 'Backbone', 1046 'Utils' 1047 ] 1048, function ( 1049 maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_cooking_tpl, 1050 Backbone, 1051 Utils 1052) 1053{ 1054 'use strict'; 1055 // @class Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View @extends Backbone.View 1056 return Backbone.View.extend({ 1057 template: maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_cooking_tpl, 1058 title: Utils.translate('Cooking Retail Display Initiative | Paxanpax') 1059 , initialize: function (options) { 1060 /* Uncomment to test backend communication with an example service 1061 (you'll need to deploy and activate the extension first) 1062 */ 1063 // this.model = new PaxanpaxRetailInitiativeModel(); 1064 // var self = this; 1065 // this.model.fetch().done(function(result) { 1066 // self.message = result.message; 1067 // self.render(); 1068 // }); 1069 } 1070 , events: { 1071 } 1072 , bindings: { 1073 } 1074 , childViews: { 1075 } 1076 , getContext: function getContext() 1077 { 1078 return { 1079 }; 1080 } 1081 }); 1082}); 1083// @module Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative 1084define('Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Floorcare.View' 1085, [ 1086 'maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_floorcare.tpl', 1087 'Backbone', 1088 'Utils' 1089 ] 1090, function ( 1091 maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_floorcare_tpl, 1092 Backbone, 1093 Utils 1094) 1095{ 1096 'use strict'; 1097 // @class Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View @extends Backbone.View 1098 return Backbone.View.extend({ 1099 template: maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_floorcare_tpl, 1100 title: Utils.translate('Floorcare Retail Display Initiative | Paxanpax') 1101 , initialize: function (options) { 1102 /* Uncomment to test backend communication with an example service 1103 (you'll need to deploy and activate the extension first) 1104 */ 1105 // this.model = new PaxanpaxRetailInitiativeModel(); 1106 // var self = this; 1107 // this.model.fetch().done(function(result) { 1108 // self.message = result.message; 1109 // self.render(); 1110 // }); 1111 } 1112 , events: { 1113 } 1114 , bindings: { 1115 } 1116 , childViews: { 1117 } 1118 , getContext: function getContext() 1119 { 1120 return { 1121 }; 1122 } 1123 }); 1124}); 1125// @module Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative 1126define('Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Full.View' 1127, [ 1128 'maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_full.tpl', 1129 'Backbone', 1130 'Utils' 1131 ] 1132, function ( 1133 maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_full_tpl, 1134 Backbone, 1135 Utils 1136) 1137{ 1138 'use strict'; 1139 // @class Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View @extends Backbone.View 1140 return Backbone.View.extend({ 1141 template: maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_full_tpl, 1142 title: Utils.translate('Full Retail Display Initiative | Paxanpax') 1143 , initialize: function (options) { 1144 /* Uncomment to test backend communication with an example service 1145 (you'll need to deploy and activate the extension first) 1146 */ 1147 // this.model = new PaxanpaxRetailInitiativeModel(); 1148 // var self = this; 1149 // this.model.fetch().done(function(result) { 1150 // self.message = result.message; 1151 // self.render(); 1152 // }); 1153 } 1154 , events: { 1155 } 1156 , bindings: { 1157 } 1158 , childViews: { 1159 } 1160 , getContext: function getContext() 1161 { 1162 return { 1163 }; 1164 } 1165 }); 1166}); 1167// @module Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative 1168define('Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Laundry.View' 1169, [ 1170 'maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_laundry.tpl', 1171 'Backbone', 1172 'Utils' 1173 ] 1174, function ( 1175 maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_laundry_tpl, 1176 Backbone, 1177 Utils 1178) 1179{ 1180 'use strict'; 1181 // @class Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View @extends Backbone.View 1182 return Backbone.View.extend({ 1183 template: maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_laundry_tpl, 1184 title: Utils.translate('Laundry & Dishwasher Retail Display Initiative | Paxanpax') 1185 , initialize: function (options) { 1186 /* Uncomment to test backend communication with an example service 1187 (you'll need to deploy and activate the extension first) 1188 */ 1189 // this.model = new PaxanpaxRetailInitiativeModel(); 1190 // var self = this; 1191 // this.model.fetch().done(function(result) { 1192 // self.message = result.message; 1193 // self.render(); 1194 // }); 1195 } 1196 , events: { 1197 } 1198 , bindings: { 1199 } 1200 , childViews: { 1201 } 1202 , getContext: function getContext() 1203 { 1204 return { 1205 }; 1206 } 1207 }); 1208}); 1209// @module Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative 1210define('Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Refrigeration.View' 1211, [ 1212 'maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_refrigeration.tpl', 1213 'Backbone', 1214 'Utils' 1215 ] 1216, function ( 1217 maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_refrigeration_tpl, 1218 Backbone, 1219 Utils 1220) 1221{ 1222 'use strict'; 1223 // @class Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View @extends Backbone.View 1224 return Backbone.View.extend({ 1225 template: maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_refrigeration_tpl, 1226 title: Utils.translate('Refrigeration Retail Display Initiative | Paxanpax') 1227 , initialize: function (options) { 1228 /* Uncomment to test backend communication with an example service 1229 (you'll need to deploy and activate the extension first) 1230 */ 1231 // this.model = new PaxanpaxRetailInitiativeModel(); 1232 // var self = this; 1233 // this.model.fetch().done(function(result) { 1234 // self.message = result.message; 1235 // self.render(); 1236 // }); 1237 } 1238 , events: { 1239 } 1240 , bindings: { 1241 } 1242 , childViews: { 1243 } 1244 , getContext: function getContext() 1245 { 1246 return { 1247 }; 1248 } 1249 }); 1250}); 1251// @module Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative 1252define('Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.SmallApp.View' 1253, [ 1254 'maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_smallapp.tpl', 1255 'Backbone', 1256 'Utils' 1257 ] 1258, function ( 1259 maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_smallapp_tpl, 1260 Backbone, 1261 Utils 1262) 1263{ 1264 'use strict'; 1265 // @class Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View @extends Backbone.View 1266 return Backbone.View.extend({ 1267 template: maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_smallapp_tpl, 1268 title: Utils.translate('Small Appliances Retail Display Initiative
1268 | Paxanpax') 1269 , initialize: function (options) { 1270 /* Uncomment to test backend communication with an example service 1271 (you'll need to deploy and activate the extension first) 1272 */ 1273 // this.model = new PaxanpaxRetailInitiativeModel(); 1274 // var self = this; 1275 // this.model.fetch().done(function(result) { 1276 // self.message = result.message; 1277 // self.render(); 1278 // }); 1279 } 1280 , events: { 1281 } 1282 , bindings: { 1283 } 1284 , childViews: { 1285 } 1286 , getContext: function getContext() 1287 { 1288 return { 1289 }; 1290 } 1291 }); 1292}); 1293// @module Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative 1294define('Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View' 1295, [ 1296 'maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative.tpl', 1297 'Backbone', 1298 'Utils' 1299 ] 1300, function ( 1301 maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_tpl, 1302 Backbone, 1303 Utils 1304) 1305{ 1306 'use strict'; 1307 // @class Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View @extends Backbone.View 1308 return Backbone.View.extend({ 1309 template: maddocks_paxanpaxretailinitiative_paxanpaxretailinitiative_tpl, 1310 title: Utils.translate('Retail Display Initiative | Paxanpax') 1311 , initialize: function (options) { 1312 /* Uncomment to test backend communication with an example service 1313 (you'll need to deploy and activate the extension first) 1314 */ 1315 // this.model = new PaxanpaxRetailInitiativeModel(); 1316 // var self = this; 1317 // this.model.fetch().done(function(result) { 1318 // self.message = result.message; 1319 // self.render(); 1320 // }); 1321 } 1322 , events: { 1323 } 1324 , bindings: { 1325 } 1326 , childViews: { 1327 } 1328 , getContext: function getContext() 1329 { 1330 return { 1331 }; 1332 } 1333 }); 1334}); 1335define( 1336 'Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative' 1337, [ 1338 'Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View', 1339 'Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Full.View', 1340 'Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Floorcare.View', 1341 'Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Laundry.View', 1342 'Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Cooking.View', 1343 'Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Refrigeration.View', 1344 'Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.SmallApp.View', 1345 'Utils' 1346 ] 1347, function ( 1348 PaxanpaxRetailInitiativeView, 1349 PaxanpaxRetailInitiativeFullView, 1350 PaxanpaxRetailInitiativeFloorcareView, 1351 PaxanpaxRetailInitiativeLaundryView, 1352 PaxanpaxRetailInitiativeCookingView, 1353 PaxanpaxRetailInitiativeRefrigerationView, 1354 PaxanpaxRetailInitiativeSmallAppView, 1355 Utils 1356 ) 1357{ 1358 'use strict'; 1359 return { 1360 mountToApp: function mountToApp (container) 1361 { 1362 var pageType = container.getComponent('PageType'); 1363 if (pageType) { 1364 pageType.registerPageType ({ 1365 name: 'PaxanpaxRetailInitiative', 1366 routes: ['retail-initiative'], 1367 view: PaxanpaxRetailInitiativeView, 1368 defaultTemplate: { 1369 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1370 } 1371 }); 1372 pageType.registerPageType ({ 1373 name: 'PaxanpaxRetailInitiative', 1374 routes: ['retail-initiative/full'], 1375 view: PaxanpaxRetailInitiativeFullView, 1376 defaultTemplate: { 1377 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1378 } 1379 }); 1380 pageType.registerPageType ({ 1381 name: 'PaxanpaxRetailInitiative', 1382 routes: ['retail-initiative/floorcare'], 1383 view: PaxanpaxRetailInitiativeFloorcareView, 1384 defaultTemplate: { 1385 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1386 } 1387 }); 1388 pageType.registerPageType ({ 1389 name: 'PaxanpaxRetailInitiative', 1390 routes: ['retail-initiative/laundry-dishwasher'], 1391 view: PaxanpaxRetailInitiativeLaundryView, 1392 defaultTemplate: { 1393 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1394 } 1395 }); 1396 pageType.registerPageType ({ 1397 name: 'PaxanpaxRetailInitiative', 1398 routes: ['retail-initiative/cooking'], 1399 view: PaxanpaxRetailInitiativeCookingView, 1400 defaultTemplate: { 1401 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1402 } 1403 }); 1404 pageType.registerPageType ({ 1405 name: 'PaxanpaxRetailInitiative', 1406 routes: ['retail-initiative/refrigeration'], 1407 view: PaxanpaxRetailInitiativeRefrigerationView, 1408 defaultTemplate: { 1409 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1410 } 1411 }); 1412 pageType.registerPageType ({ 1413 name: 'PaxanpaxRetailInitiative', 1414 routes: ['retail-initiative/small-appliances'], 1415 view: PaxanpaxRetailInitiativeSmallAppView, 1416 defaultTemplate: { 1417 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1418 } 1419 }); 1420 } 1421 } 1422 }; 1423}); 1424}; 1425extensions['Maddocks.Purofilter.1.0.0'] = function(){ 1426function getExtensionAssetsPath(asset){ 1427return 'extensions/Maddocks/Purofilter/1.0.0/' + asset; 1428}; 1429// Model.js 1430// ----------------------- 1431// @module Case 1432define("Maddocks.Purofilter.Purofilter.Model", ["Backbone", "Utils"], function( 1433 Backbone, 1434 Utils 1435) { 1436 "use strict"; 1437 // @class Case.Fields.Model @extends Backbone.Model 1438 return Backbone.Model.extend({ 1439 1440}); 1441}); 1442// @module Maddocks.Purofilter.Purofilter 1443define('Maddocks.Purofilter.Purofilter.Refrigeration.View' 1444, [ 1445 'maddocks_purofilter_purofilter_refrigeration.tpl', 1446 'Backbone', 1447 'Profile.Model', 1448 'SC.Configuration', 1449 'Utils' 1450 ] 1451, function ( 1452 maddocks_purofilter_purofilter_refrigeration_tpl, 1453 Backbone, 1454 ProfileModel, 1455 Configuration, 1456 Utils 1457) 1458{ 1459 'use strict'; 1460 // @class Maddocks.Purofilter.Purofilter.View @extends Backbone.View 1461 return Backbone.View.extend({ 1462 template: maddocks_purofilter_purofilter_refrigeration_tpl 1463 , title: Utils.translate('Refrigeration - Purofilter Water Filter Range | Maddocks - Appliance Spare Parts Wholesaler') 1464 , getBreadcrumbPages: function() { 1465 return { 1466 text: this.title, 1467 href: '/purofilter/refrigeration' 1468 }; 1469 } 1470 , initialize: function (options) { 1471 } 1472 , events: { 1473 } 1474 , bindings: { 1475 } 1476 , childViews: { 1477 } 1478 //@method getContext @return Maddocks.Purofilter.Purofilter.View.Context 1479 , getContext: function getContext() 1480 { 1481 //@class Maddocks.Purofilter.Purofilter.View.Context 1482 var profile = ProfileModel.getInstance(); 1483 var is_logged_in = profile.get('isLoggedIn') === 'T' && profile.get('isGuest') === 'F'; 1484 var awaitingApproval = profile.awaitingApproval(); 1485 return { 1486 login: is_logged_in, 1487 awaitingApproval: awaitingApproval ==='T', 1488 purofilterHeader: Configuration.purofilterlandingPageHeader, 1489 purofilterSubHeader: Configuration.purofilterlandingPageSubHeader, 1490 purofilterLogo: Configuration.purofilterlandingPageLogo, 1491 purofilterRefrigeration: Configuration.purofilterRefrigeration || [] 1492 }; 1493 } 1494 }); 1495}); 1496// @module Maddocks.Purofilter.Purofilter 1497define('Maddocks.Purofilter.Purofilter.Small.Appliances.View' 1498, [ 1499 'maddocks_purofilter_purofilter_small_appliances.tpl', 1500 'Backbone', 1501 'Profile.Model', 1502 'SC.Configuration', 1503 'Utils' 1504 ] 1505, function ( 1506 maddocks_purofilter_purofilter_small_appliances_tpl, 1507 Backbone, 1508 ProfileModel, 1509 Configuration, 1510 Utils 1511) 1512{ 1513 'use strict'; 1514 // @class Maddocks.Purofilter.Purofilter.View @extends Backbone.View 1515 return Backbone.View.extend({ 1516 template: maddocks_purofilter_purofilter_small_appliances_tpl 1517 , title: Utils.translate('Small Appliances - Purofilter Water Filter Range | Maddocks - Appliance Spare Parts Wholesaler') 1518 , getBreadcrumbPages: function() { 1519 return { 1520 text: this.title, 1521 href: '/purofilter/small-appliances' 1522 }; 1523 } 1524 , initialize: function (options) { 1525 } 1526 , events: { 1527 } 1528 , bindings: { 1529 } 1530 , childViews: { 1531 } 1532 //@method getContext @return Maddocks.Purofilter.Purofilter.View.Context 1533 , getContext: function getContext() 1534 { 1535 //@class Maddocks.Purofilter.Purofilter.View.Context 1536 var profile = ProfileModel.getInstance(); 1537 var is_logged_in = profile.get('isLoggedIn') === 'T' && profile.get('isGuest') === 'F'; 1538 var awaitingApproval = profile.awaitingApproval(); 1539 return { 1540 login: is_logged_in, 1541 awaitingApproval: awaitingApproval ==='T', 1542 purofilterHeader: Configuration.purofilterlandingPageHeader, 1543 purofilterSubHeader: Configuration.purofilterlandingPageSubHeader, 1544 purofilterLogo: Configuration.purofilterlandingPageLogo, 1545 purofilterSmallAppliances: Configuration.purofilterSmallAppliances || [] 1546 }; 1547 } 1548 }); 1549}); 1550// @module Maddocks.Purofilter.Purofilter 1551define('Maddocks.Purofilter.Purofilter.View' 1552, [ 1553 'maddocks_purofilter_purofilter.tpl', 1554 'Backbone', 1555 'Profile.Model', 1556 'SC.Configuration', 1557 'Utils' 1558 ] 1559, function ( 1560 maddocks_purofilter_purofilter_tpl, 1561 Backbone, 1562 ProfileModel, 1563 Configuration, 1564 Utils 1565) 1566{ 1567 'use strict'; 1568 // @class Maddocks.Purofilter.Purofilter.View @extends Backbone.View 1569 return Backbone.View.extend({ 1570 template: maddocks_purofilter_purofilter_tpl 1571 , title: Utils.translate('Purofilter Water Filter Range | Maddocks - Appliance Spare Parts Wholesaler') 1572 , getBreadcrumbPages: function() { 1573 return { 1574 text: this.title, 1575 href: '/purofilter' 1576 }; 1577 } 1578 , initialize: function (options) { 1579 } 1580 , events: { 1581 } 1582 , bindings: { 1583 } 1584 , childViews: { 1585 } 1586 //@method getContext @return Maddocks.Purofilter.Purofilter.View.Context 1587 , getContext: function getContext() 1588 { 1589 //@class Maddocks.Purofilter.Purofilter.View.Context 1590 var profile = ProfileModel.getInstance(); 1591 var is_logged_in = profile.get('isLoggedIn') === 'T' && profile.get('isGuest') === 'F'; 1592 return { 1593 login: is_logged_in, 1594 purofilterHeader: Configuration.purofilterlandingPageHeader, 1595 purofilterSubHeader: Configuration.purofilterlandingPageSubHeader, 1596 purofilterLogo: Configuration.purofilterlandingPageLogo, 1597 purofilterVideo: Configuration.purofilterlandingPageVideo, 1598 }; 1599 } 1600 }); 1601}); 1602define( 1603 'Maddocks.Purofilter.Purofilter' 1604, [ 1605 'Maddocks.Purofilter.Purofilter.View', 1606 'Maddocks.Purofilter.Purofilter.Refrigeration.View', 1607 'Maddocks.Purofilter.Purofilter.Small.Appliances.View', 1608 'Utils' 1609 ] 1610, function ( 1611 PurofilterView, 1612 PurofilterRefrigerationView, 1613 PurofilterSmallAppliancesView, 1614 Utils 1615 ) 1616{ 1617 'use strict'; 1618 return { 1619 mountToApp: function mountToApp (container) 1620 { 1621 var pageType = container.getComponent('PageType'); 1622 1623 if (pageType) { 1624 pageType.registerPageType ({ 1625 name: 'Purofilter', 1626 routes: ['purofilter'], 1627 view: PurofilterView, 1628 defaultTemplate: { 1629 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1630 } 1631 }); 1632 pageType.registerPageType ({ 1633 name: 'Purofilter', 1634 routes: ['purofilter/refrigeration'], 1635 view: PurofilterRefrigerationView, 1636 defaultTemplate: { 1637 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1638 } 1639 }); 1640 pageType.registerPageType ({ 1641 name: 'Purofilter', 1642 routes: ['purofilter/small-appliances'], 1643 view: PurofilterSmallAppliancesView, 1644 defaultTemplate: { 1645 thumbnail: Utils.getThemeAbsoluteUrlOfNonManagedResources('img/default-layout-address-book-edit.png') 1646 } 1647 }); 1648 } 1649 } 1650 }; 1651}); 1652}; 1653try{ 1654 extensions['CXExtensibility.CoreContent.1.0.6']();
1655 SC.addExtensionModule('CXExtensibility.CoreContent.CoreContentModule'); 1656} 1657catch(error) 1658{ 1659 console.error(error) 1660} 1661try{ 1662 extensions['SuiteCommerce.CustomFields.1.1.4'](); 1663 SC.addExtensionModule('SuiteCommerce.CustomFields.PDP.Main'); 1664} 1665catch(error) 1666{ 1667 console.error(error) 1668} 1669try{ 1670 extensions['Maddocks.PaxanpaxMediaLibrary.1.0.0'](); 1671 SC.addExtensionModule('Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary'); 1672} 1673catch(error) 1674{ 1675 console.error(error) 1676} 1677try{ 1678 extensions['Maddocks.PaxanpaxRetailInitiative.1.0.0'](); 1679 SC.addExtensionModule('Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative'); 1680} 1681catch(error) 1682{ 1683 console.error(error) 1684} 1685try{ 1686 extensions['Maddocks.Purofilter.1.0.0'](); 1687 SC.addExtensionModule('Maddocks.Purofilter.Purofilter'); 1688} 1689catch(error) 1690{ 1691 console.error(error) 1692} 1693SC.ENVIRONMENT.EXTENSIONS_JS_MODULE_NAMES = ["CXExtensibility.CoreContent.CMSMerchzoneCCT.View","CXExtensibility.CoreContent.CMSMerchzoneCCT","CXExtensibility.CoreContent.CoreContentModule","SuiteCommerce.CustomFields.Instrumentation.Helper","SuiteCommerce.CustomFields.JavaScript.Utils","SuiteCommerce.CustomFields.Instrumentation.Log","SuiteCommerce.CustomFields.Instrumentation.Logger","SuiteCommerce.CustomFields.Instrumentation.MockAppender","SuiteCommerce.CustomFields.Instrumentation","SuiteCommerce.CustomFields.PDP.Main","SuiteCommerce.CustomFields.Utils","SuiteCommerce.CustomFields.PDP.Configuration","SuiteCommerce.CustomFields.PDP.Main.View","SuiteCommerce.CustomFields.PDP.Model","SuiteCommerce.CustomFields.PDP","Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary.Model","Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary","Maddocks.PaxanpaxMediaLibrary.PaxanpaxBrandGuide.View","Maddocks.PaxanpaxMediaLibrary.PaxanpaxMediaLibrary.View","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Model","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Cooking.View","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Floorcare.View","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Full.View","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Laundry.View","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.Refrigeration.View","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.SmallApp.View","Maddocks.PaxanpaxRetailInitiative.PaxanpaxRetailInitiative.View","Maddocks.Purofilter.Purofilter.Model","Maddocks.Purofilter.Purofilter","Maddocks.Purofilter.Purofilter.Refrigeration.View","Maddocks.Purofilter.Purofilter.Small.Appliances.View","Maddocks.Purofilter.Purofilter.View"];
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.