Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import Deferred from 'dojo/Deferred';
var store = createStore(reducer, window.devToolsExtension ? window.devToolsExtension() : {});
var _resultDeferred;
// The event is fired in GalleryItem.jsx and end the media picking workflow
topic.subscribe('MEDIA-PICKER-SELECTION', function(selection) {
if (_resultDeferred && selection) {
_resultDeferred.resolve({
type: selection.type, // TODO temporary
[selection.type]: selection
});
}
});
topic.subscribe('MEDIA-PICKER-SWAP-MAP-EDITOR', function() {
_resultDeferred && _resultDeferred.reject('swap-map-editor');
});
class MediaPicker extends React.Component {
constructor(container) {
super();
this.container = container;
this.render();
}
open(params) {
_resultDeferred = new Deferred();
this.render(Object.assign(params, {justOpened: true}));
postCreate(params = {}) {
super.postCreate(params);
this._onToggleMediaConfig = params.onToggleMediaConfig;
this._foregroundOptions = params.foregroundOptions;
this._applySectionConfig = params.applySectionConfig;
this._initConfigPanel();
this.initBuilderUI();
// we subscribe to the scan change for this SPECIFIC video only (hence the scan/video/videoID pattern).
this._scanListener = topic.subscribe('scan/videos/' + this._instanceID, lang.hitch(this, this.checkErrors));
}
postCreate(params) {
super.postCreate(params);
this._onToggleMediaConfig = params.onToggleMediaConfig;
this._initConfigPanel();
// we subscribe to the scan change for this SPECIFIC image only (hence the scan/image/imageID pattern).
this._scanListener = topic.subscribe('scan/audio/' + this._instanceID, lang.hitch(this, this.checkErrors));
this.initBuilderUI();
}
postCreate(params) {
super.postCreate(params);
this._onToggleMediaConfig = params.onToggleMediaConfig;
this._initConfigPanel();
this.initBuilderUI();
this._scanListener = topic.subscribe('scan/webpages/' + this._instanceID, lang.hitch(this, this.checkErrors));
}
postCreate(args) {
this.inherited(arguments);
this._initGraphControls();
this._initTimings();
this._initActivitiesMap();
this._initDialogs();
var context = this;
topic.subscribe(this.id + "OverviewTabContainer-selectChild", function (topic) {
context.refreshActionState();
});
}
import i18n from 'lib-build/i18n!resources/tpl/builder/nls/app';
import NormalizeHelper from 'issue-checker/helpers/NormalizeHelper';
import UndoNotification from './notification/Undo';
import Issues from 'issue-checker/IssueTypes';
import Actions from './Actions';
import UIUtils from 'storymaps/tpl/utils/UI';
import CommonHelper from 'storymaps/tpl/utils/CommonHelper';
topic.subscribe('builder-section-update', function() {
ControllerBuilder.storyChange();
});
topic.subscribe('builder-media-update', function() {
ControllerBuilder.storyChange();
});
export default class ControllerBuilder extends ControllerCore {
static storyChange() {
app.builder.pendingChanges++;
topic.publish('builder-story-update');
}
static storyUndo() {
app.builder.pendingChanges--;
topic.publish('builder-story-update');
}
_initEvents() {
topic.subscribe('tpl-ready', this._onStoryReady.bind(this));
topic.subscribe('builder-section-update', this._updateOverview.bind(this));
topic.subscribe('story-navigated-section', this._onSectionNavigate.bind(this));
topic.subscribe('builder-story-title-update', this._updateStoryTitle.bind(this));
topic.subscribe('builder-story-update', this._updateSaveButtonStatus.bind(this));
topic.subscribe('check-app-started', this._onStoryCheckStarted.bind(this));
topic.subscribe('check-app-complete', this._onStoryCheckComplete.bind(this));
this._node.find('.btn-settings').click(this._onSettings.bind(this));
this._node.find('.btn-preview').click(this._onPreview.bind(this));
this._node.find('.my-stories-link').click(this._onCheck.bind(this));
this._node.find('.btn-save').click(this._onSave.bind(this));
let appName = 'Story Map Cascade';
let betaNoteString = builderI18n.builder.builderPanel.betaNote.replace(/\${APP_NAME}/g, appName);
this._node.find('.beta-tooltip').tooltip({
title: betaNoteString,
placement: 'bottom',
container: '.section-builder-panel'
var promise = new Promise((resolve, reject) => {
if (!app.portal) {
reject(new Error('No app.portal on checkSignin'));
return;
}
if (app.portal.user && app.portal.signedIn) {
resolve();
}
else {
topic.subscribe('portal-signin', function() {
resolve();
});
}
});
_initEvents() {
topic.subscribe('tpl-ready', this._onStoryReady.bind(this));
topic.subscribe('builder-section-update', this._updateOverview.bind(this));
topic.subscribe('story-navigated-section', this._onSectionNavigate.bind(this));
topic.subscribe('builder-story-title-update', this._updateStoryTitle.bind(this));
topic.subscribe('builder-story-update', this._updateSaveButtonStatus.bind(this));
topic.subscribe('check-app-started', this._onStoryCheckStarted.bind(this));
topic.subscribe('check-app-complete', this._onStoryCheckComplete.bind(this));
this._node.find('.btn-settings').click(this._onSettings.bind(this));
this._node.find('.btn-preview').click(this._onPreview.bind(this));
this._node.find('.my-stories-link').click(this._onCheck.bind(this));
this._node.find('.btn-save').click(this._onSave.bind(this));
let appName = 'Story Map Cascade';
let betaNoteString = builderI18n.builder.builderPanel.betaNote.replace(/\${APP_NAME}/g, appName);
this._node.find('.beta-tooltip').tooltip({
title: betaNoteString,
placement: 'bottom',
container: '.section-builder-panel'
});
this._node.find('.check-tooltip').tooltip({
_initEvents() {
topic.subscribe('tpl-ready', this._onStoryReady.bind(this));
topic.subscribe('builder-section-update', this._updateOverview.bind(this));
topic.subscribe('story-navigated-section', this._onSectionNavigate.bind(this));
topic.subscribe('builder-story-title-update', this._updateStoryTitle.bind(this));
topic.subscribe('builder-story-update', this._updateSaveButtonStatus.bind(this));
topic.subscribe('check-app-started', this._onStoryCheckStarted.bind(this));
topic.subscribe('check-app-complete', this._onStoryCheckComplete.bind(this));
this._node.find('.btn-settings').click(this._onSettings.bind(this));
this._node.find('.btn-preview').click(this._onPreview.bind(this));
this._node.find('.my-stories-link').click(this._onCheck.bind(this));
this._node.find('.btn-save').click(this._onSave.bind(this));
let appName = 'Story Map Cascade';
let betaNoteString = builderI18n.builder.builderPanel.betaNote.replace(/\${APP_NAME}/g, appName);
this._node.find('.beta-tooltip').tooltip({