Nike signs Zion Williamson to its Jordan Brand line

0
83

‘; return carouselItem; }; var initWxAlertCarousel = function (el) { var afterAction = function (el) { var actualValue = this.owl.currentItem + 1; el.siblings(‘.carousel-counter’).find(‘.page-current’).text(actualValue); }; var carouselConfig = { navigation : true, singleItem : true, autoHeight : true, afterAction : afterAction }; A.use(‘owl’, function(){ el.owlCarousel(carouselConfig); }); }; var renderWxAlertCarousel = function () { var counterEls, carouselItems = ”, modHeaderEl = ”, carouselWrapEl = $(”), modContentEl = $(”), modWrapEl = $(‘

‘) .css(‘background-color’, config.color); if (model.totalCount > 1) { counterEls = ‘

‘; } if (config.displayBySeverity) { var severityOrder = [‘Extreme’, ‘Severe’, ‘Moderate’, ‘Minor’, ‘Unknown’]; $.each(model.wxAlertMasterBean.weatherAlerts, function(idx, item){ var sIdx = severityOrder.indexOf(item.severity); item.severityRank = sIdx b.alertDesc ? 1 : -1; } } /* END Carousel, if configured */ /* BEGIN non-carousel alert, if configured */ var getWxAlertMsg = function () { var message = ”; var handleCustomText = function (primaryTotal, secondaryTotal) { var replaced = config.customText.replace(‘%’, primaryTotal); /* Use primaryTotal to replace first token… not using a regex, to ensure that only the first token is targeted. */ replaced = replaced.replace(‘%’, secondaryTotal); /* If second token exists, replace with secondaryTotal */ return replaced; }; var assembleMsg = function (key, primaryTotal, secondaryTotal) { var numAlertsKey = primaryTotal === 1 ? ‘single’ : ‘multiple’, defaultMsg = { numberOfAlerts: { single: ‘There is 1 weather alert.’, multiple: ‘There are ‘ + primaryTotal + ‘ weather alerts.’ }, numberOfAreasWithAlerts: { single: ‘There is 1 area with 1 active weather alert.’, singleAreaWithMultiple: ‘There is 1 area with ‘ + secondaryTotal + ‘ active weather alerts.’, multiple: ‘There are ‘ + primaryTotal + ‘ areas with ‘ + secondaryTotal + ‘ active weather alerts.’ }, numberOfAreas: { single: ‘There is 1 area under alert.’, multiple: ‘There are ‘ + primaryTotal + ‘ areas under alert.’ } }; if (key === ‘numberOfAreasWithAlerts’ && primaryTotal === 1 && secondaryTotal > 1) { numAlertsKey = ‘singleAreaWithMultiple’; } if (config.textUsed === ‘custom_text’) { message = handleCustomText(primaryTotal, secondaryTotal); } else { message = defaultMsg[key][numAlertsKey]; } }; switch (config.alertBarText) { case ‘number_of_alerts’: assembleMsg(‘numberOfAlerts’, model.totalCount, model.totalCount); break; case ‘number_of_areas_with_alerts’: assembleMsg(‘numberOfAreasWithAlerts’, model.totalTargetAreas, model.totalCount); break; default: /* “number_of_areas” */ assembleMsg(‘numberOfAreas’, model.totalTargetAreas, model.totalCount); break; } return message + ‘ ‘; }; var getWxAlertImg = function () { var imgEls = ”; if (config.useDefaultImage) { var imgEl = ‘‘, cropPhotoEl = $(”) .append(imgEl) .css(‘background-image’, ‘url(“”)’); imgEls = $(”) .append(cropPhotoEl); } return imgEls; }; var renderWxAlertMsg = function () { var modMessageEl = ‘

‘ + getWxAlertMsg() + ‘

‘, modLinkEl = $(”) .append(getWxAlertImg()) .append(modMessageEl), modAlertItemEl = $(”) .append(modLinkEl), modContentEl = $(”) .append(modAlertItemEl), modHeaderEl = ”, modWrapEl = $(‘

‘) .append(modHeaderEl) .append(modContentEl) .css(‘background-color’, config.color); scriptEl.before(modWrapEl); }; /* END non-carousel alert, if configured */ var renderWxServiceAlertsViewFromModel = function () { model = EP.WeatherService.model; if (model.hasAlerts) { if (config.displayAsCarousel) { renderWxAlertCarousel(); } else { renderWxAlertMsg(); } } }; /** * Instantiate via EP.WeatherService.loadQueueCallback to ensure ajax loaded data is ready for display */ if (EP && EP.WeatherService) { EP.WeatherService.loadQueueCallback(renderWxServiceAlertsViewFromModel); } })(jQuery, AUI()); Read the original article

LEAVE A REPLY

Please enter your comment!
Please enter your name here