Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor () {
// Autobind methods
this.updateAppState = this.updateAppState.bind(this);
this.initialLoad = this.initialLoad.bind(this);
this.checkLoginStatus = this.checkLoginStatus.bind(this);
this.loginWithOAuth = this.loginWithOAuth.bind(this);
this.finishOAuthLogin = this.finishOAuthLogin.bind(this);
this.verifyCredentials = this.verifyCredentials.bind(this);
window.signInAfterOauth = this.signInAfterOauth = this.signInAfterOauth.bind(this);
// Subscribe to state changes
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
}
this.enable = this.enable.bind(this);
this.disable = this.disable.bind(this);
this.checkOverlayComponentVisibility = this.checkOverlayComponentVisibility.bind(this);
this.updateAppState = this.updateAppState.bind(this);
this.updateAppView = this.updateAppView.bind(this);
this.refreshDisplay = this.refreshDisplay.bind(this);
this.showIntro = this.showIntro.bind(this);
this.hideIntro = this.hideIntro.bind(this);
this.showMap = this.showMap.bind(this);
this.showGallery = this.showGallery.bind(this);
// Subscribe to state changes
this.visibleComponents = [];
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
}
this.enable = this.enable.bind(this);
this.disable = this.disable.bind(this);
this.checkOverlayComponentVisibility = this.checkOverlayComponentVisibility.bind(this);
this.updateAppState = this.updateAppState.bind(this);
this.updateAppView = this.updateAppView.bind(this);
this.refreshDisplay = this.refreshDisplay.bind(this);
this.showIntro = this.showIntro.bind(this);
this.hideIntro = this.hideIntro.bind(this);
this.showMap = this.showMap.bind(this);
this.showGallery = this.showGallery.bind(this);
// Subscribe to state changes
this.visibleComponents = [];
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
}
constructor() {
// Autobind methods
this.updateAppState = this.updateAppState.bind(this);
this.changeAttachments = this.changeAttachments.bind(this);
this.uploadAttachment = this.uploadAttachment.bind(this);
// Subscribe to state changes
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
this.appItemAttatchments = [];
this.prevIds = [];
}
constructor() {
this.savingGraphic = false;
// Autobind methods
this.updateAppState = this.updateAppState.bind(this);
this.checkContributeView = this.checkContributeView.bind(this);
this.saveGraphic = this.saveGraphic.bind(this);
this.finishSave = this.finishSave.bind(this);
this.displayContributionShownAfterReviewMessage = this.displayContributionShownAfterReviewMessage.bind(this);
this.displayContributeErrorMessage = this.displayContributeErrorMessage.bind(this);
this.hideUncompleted = this.hideUncompleted.bind(this);
// Subscribe to state changes
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
}
constructor() {
// Autobind methods
this.updateAppState = this.updateAppState.bind(this);
this.updatePageTitle = this.updatePageTitle.bind(this);
this.createPortal = this.createPortal.bind(this);
this.disableGlobalDragAndDrop = this.disableGlobalDragAndDrop.bind(this);
// Subscribe to state changes
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
const location = new URI(window.location);
if (location.filename() !== 'index.html') {
window.history.replaceState({},null,location.filename('index.html').href());
}
this.appMode = new AppMode();
this.appConfig = new AppConfig();
if (window.location.protocol === 'https:') {
this.createPortal();
this.layout = new Layout();
this.user = new User();
this.contrbuteController = new ContrbuteController();
}
const defaults = {};
this.settings = $.extend(true,{},defaults,options);
// Autobind methods
this.updateAppState = this.updateAppState.bind(this);
this.createNewStory = this.createNewStory.bind(this);
this.startSaving = this.startSaving.bind(this);
this.finishSaving = this.finishSaving.bind(this);
this.checkAppStateChange = this.checkAppStateChange.bind(this);
this.checkAppShareChange = this.checkAppShareChange.bind(this);
this.checkWebmapStateChange = this.checkWebmapStateChange.bind(this);
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
// Load extra builder controllers
new AppItemAttachments();
new CrowdsourceReviewController();
new ComponentsController();
window.onbeforeunload = () => {
if (!lang.getObject('appState.mode.fromScratch',false,this) && (this.lastSaveAppData || this.lastSaveWebmapData)
&& (lang.getObject('appState.builder.saving',false,this)
|| this.lastSaveAppData !== JSON.stringify(lang.getObject('appState.items.app',false,this)))) {
return builderText.banner.hintText.leavingBeforeSave;
}
};
}
constructor() {
// Autobind methods
this.updateAppState = this.updateAppState.bind(this);
this.layout = false;
this.resizedViewer = false;
this.mapShown = false;
this.adminShown = false;
this.layoutControllers = {};
// Subscribe to state changes
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
this.resizeViewer = function () {
const height = $('.control-banner').height() || 0;
$('.viewer').css({
height: 'calc(100% - ' + height + 'px)'
});
};
$(window).on('resize',this.resizeViewer);
}
constructor() {
// Autobind methods
this.updateAppState = this.updateAppState.bind(this);
this.editReviewedFeatures = this.editReviewedFeatures.bind(this);
this.approved = JSON.stringify([]);
this.rejected = JSON.stringify([]);
// Subscribe to state changes
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
}
// Autobind methods
this.updateAppState = this.updateAppState.bind(this);
this.saveOrgDefaults = this.saveOrgDefaults.bind(this);
this.saveAppFromWebmapDefaults = this.saveAppFromWebmapDefaults.bind(this);
this.saveAppFromScratchApp = this.saveAppFromScratchApp.bind(this);
this.createFeatureService = this.createFeatureService.bind(this);
this.createWebmap = this.createWebmap.bind(this);
this.createApp = this.createApp.bind(this);
this.saveApp = this.saveApp.bind(this);
this.registerApp = this.registerApp.bind(this);
this.redirectToEditor = this.redirectToEditor.bind(this);
// Subscribe to state changes
this.appState = AppStore.getState();
this.updateAppState();
this.unsubscribeAppStore = AppStore.subscribe(this.updateAppState);
if (lang.getObject('appState.config.webmap',false,this)) {
ArcgisItem.getDataById({
id: lang.getObject('appState.config.webmap',false,this),
item: 'webmap'
});
}
this.openFirstDialog('betaMessage');
}