Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/***
* Copyright (c) 2015, 2016 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
import { createStore } from 'fluxible/addons';
const applicationStore = createStore({
storeName: 'ApplicationStore',
handlers: {
'INIT_APP': 'initApplication',
'UPDATE_PAGE_TITLE': 'updatePageTitle'
},
initialize: function () {
this.currentPageTitle = '';
this.defaultPageName = '';
},
/**
* INIT_APP handler.
* Initialize application data from payload.page.
*
/***
* Copyright (c) 2015, 2016 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var createStore = require('fluxible/addons').createStore;
var debounce = require('lodash/debounce');
var buildImageUrl = require('../utils').buildImageUrl;
var BackgroundStore = createStore({
storeName: 'BackgroundStore',
handlers: {
'UPDATE_SIZE': 'updateSize',
'INIT_APP': 'initBackgrounds',
'NAVIGATE_SUCCESS': 'updateBackground'
},
/**
* Set initial store state.
* Wire up debounced sizeChange handler.
*/
initialize: function () {
this.width = 0;
this.height = 0;
this.top = 0;
/***
* Copyright (c) 2016 - 2019 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
import { createStore } from 'fluxible/addons';
export const ContentStore = createStore({
storeName: 'ContentStore',
handlers: {
'INIT_APP': 'initContent',
'RECEIVE_PAGE_CONTENT': 'receivePageContent'
},
/**
* Set ContentStore initial state.
*/
initialize: function () {
this.contents = {};
this.currentResource = '';
this.defaultResource = '';
},
/***
* Copyright (c) 2016 - 2019 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*
* Store for service settings.
*/
import { createStore } from 'fluxible/addons';
export const SettingsStore = createStore({
storeName: 'SettingsStore',
handlers: {
'SETTINGS_STATE': 'updateSettingsState',
'SETTINGS_TRANSITION': 'updateTransition'
},
/**
* Set inital store state.
*/
initialize: function () {
this.hasServiceWorker = false;
this.hasPushMessaging = false;
this.hasPermissions = false;
this.hasNotifications = false;
this.pushBlocked = false;
/***
* Copyright (c) 2016 - 2019 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
import { createStore } from 'fluxible/addons';
export const ModalStore = createStore({
storeName: 'ModalStore',
handlers: {
'MODAL_START': 'modalStart',
'RECEIVE_PAGE_CONTENT': 'updateProps',
'MODAL_COMPONENT': 'updateComponent',
'MODAL_FAILURE': 'modalFailure',
'MODAL_STOP': 'modalStop'
},
/**
* Set inital store state.
*/
initialize: function () {
this.isOpen = false;
this.currentComponent = '';
/***
* Copyright (c) 2016 - 2019 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
import { createStore } from 'fluxible/addons';
export const ContactStore = createStore({
storeName: 'ContactStore',
handlers: {
'UPDATE_CONTACT_FIELDS': 'updateContactFields',
'CREATE_CONTACT_SUCCESS': 'clearContactFields',
'CREATE_CONTACT_FAILURE': 'setContactFailure'
},
/**
* Set ContactStore initial state.
*/
initialize: function () {
this.name = '';
this.email = '';
this.message = '';
this.failure = false;
/***
* Copyright (c) 2015, 2016 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var createStore = require('fluxible/addons').createStore;
var ContentStore = createStore({
storeName: 'ContentStore',
handlers: {
'INIT_APP': 'initContent',
'RECEIVE_PAGE_CONTENT': 'receivePageContent'
},
/**
* Set ContentStore initial state.
*/
initialize: function () {
this.contents = {};
this.currentResource = '';
this.defaultResource = '';
},
/***
* Copyright (c) 2015, 2016 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var createStore = require('fluxible/addons').createStore;
var ApplicationStore = createStore({
storeName: 'ApplicationStore',
handlers: {
'INIT_APP': 'initApplication',
'UPDATE_PAGE_TITLE': 'updatePageTitle'
},
/**
* Set inital store state.
*/
initialize: function () {
this.currentPageTitle = '';
this.defaultPageName = '';
},
/**
/***
* Copyright (c) 2016 - 2019 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
import { createStore } from 'fluxible/addons';
import debounce from 'lodash/debounce';
import { buildImageUrl } from 'utils/imageServiceUrls';
export const BackgroundStore = createStore({
storeName: 'BackgroundStore',
handlers: {
'UPDATE_SIZE': 'updateSize',
'INIT_APP': 'initBackgrounds',
'NAVIGATE_SUCCESS': 'updateBackground'
},
/**
* Set initial store state.
* Wire up debounced sizeChange handler.
*/
initialize: function () {
this.width = 0;
this.height = 0;
this.top = 0;
/***
* Copyright (c) 2015, 2016 Alex Grant (@localnerve), LocalNerve LLC
* Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var createStore = require('fluxible/addons').createStore;
var ContactStore = createStore({
storeName: 'ContactStore',
handlers: {
'UPDATE_CONTACT_FIELDS': 'updateContactFields',
'CREATE_CONTACT_SUCCESS': 'clearContactFields',
'CREATE_CONTACT_FAILURE': 'setContactFailure'
},
/**
* Set ContactStore initial state.
*/
initialize: function () {
this.name = '';
this.email = '';
this.message = '';
this.failure = false;