Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(newMedia => {
if (SectionCommon.isSameMediaWithSecureProtocol(params.media, newMedia)) {
// if all that's changed is that the media URL is now https, keep the existing media but change it to be https.
// This preserves captions, alt media, and config options.
params.media.convertToHttps();
topic.publish('builder-should-check-story');
}
else {
this._onEditMedia(params.media, newMedia);
}
},
() => {
this._image.dataUrl = null;
}
if (this._uploadNotification) {
this._uploadNotification.update({
type: 'success',
label: text.media.mediaUploadSuccess
});
}
this._isLoaded = false;
// Preload the image so that there is no flashing
this.preload().then(this.load.bind(this));
topic.publish('builder-media-update');
if (!this._isAlternate) {
this._node.find('.img-gallery-invite').removeClass('disabled');
}
}
if (! newSection || this._disableScrollEvents) {
return;
}
newSection.onScroll(lang.mixin(params, {
status: 'current',
webSceneCache: this._webSceneCache
}));
// If changing section
if (params.currentSectionIndex != this._currentSectionIndex) {
// Activate new section
params.$currentSection.addClass('active');
// Dev event
topic.publish('story-navigated-section', {
index: params.currentSectionIndex,
data: this._currentSection
});
//
// Preload next section
//
var nextSection = this._sections[params.currentSectionIndex + 1];
if (nextSection) {
if (params.currentSectionIndex != this._currentSectionIndex) {
this.preloadSection(nextSection, params);
}
}
Object.assign(broadcastDetails, {uploadDeferred: fileDetails.uploadDeferred});
}
if (fileDetails.dataUrl) {
Object.assign(broadcastDetails, {dataUrl: fileDetails.dataUrl});
}
if (fileDetails.url) {
Object.assign(broadcastDetails, {url: fileDetails.url});
}
if (fileDetails.thumbUrl) {
Object.assign(broadcastDetails, {thumbUrl: fileDetails.thumbUrl});
}
topic.publish('MEDIA-PICKER-SELECTION', broadcastDetails);
}
response.GetComponentStatusResponse.ComponentStatusList.ComponentStatus.forEach(function (row) {
topic.publish("hpcc/monitoring_component_update", {
response: response,
status: response.GetComponentStatusResponse.ComponentStatus
});
});
}
_onContentChange() {
this.serialize(false);
topic.publish('builder-section-update');
}
_onConfigChange() {
topic.publish('builder-media-update');
if (this._onConfigChangeCallback) {
this._onConfigChangeCallback();
}
}
_onContentChange() {
this.serialize(false);
topic.publish('builder-section-update');
}
this._gallery.on('resize', () => {
topic.publish('media-dynamic-resize');
});
});
_onContentChange() {
topic.publish('builder-section-update');
}