Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
init(callback = () => {}) {
let { config, onUpload } = this.props;
const language = config.language || config.LANGUAGE || CONFIG.language;
// support old config
let activeModules = config.modules || config.MODULES || CONFIG.modules || ["UPLOAD"];
activeModules = activeModules.join('|').replace('UPLOADED_IMAGES', 'MY_GALLERY').split('|');
// end
I18n.setLocale(language);
config.modules = activeModules;
const nextConfig = prepareConfig(config, onUpload);
getTokenSettings(nextConfig)
.then(settings => {
this.props.setAppState(() => ({ ...settings }));
})
.catch(error => {
const response = error && error.response && error.response.data || {};
this.showAlert(response.msg, response.hint, 'error', 10000);
});
this.props.setAppState(() => ({
config: nextConfig,
//
//
// );
// addDecorator(bootstrapWrapperDecorator);
addDecorator(withInfo);
// Option defaults:
setOptions({
name: 'Assembl',
url: '#',
hierarchySeparator: /\//,
hierarchyRootSeparator: /\|/
});
I18n.setTranslations(messages);
I18n.setLocale('fr');
function loadStories() {
require('../js/app/integration/101/components/button101/button101.stories.jsx');
require('../js/app/integration/101/components/checkbox101/checkbox101.stories.jsx');
require('../js/app/integration/101/components/checkboxList101/checkboxList101.stories.jsx');
require('../js/app/stories/components/common/menu/menu.stories.jsx');
require('../js/app/stories/components/debate/common/toggleCommentButton.stories.jsx');
require('../js/app/stories/components/debate/common/replyToCommentButton.stories.jsx');
require('../js/app/stories/components/debate/common/sharePostButton.stories.jsx');
require('../js/app/stories/components/debate/common/commentHelperButton.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/fictionPreview.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/fictionsList.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/instructionsText.stories.jsx');
//
// );
// addDecorator(bootstrapWrapperDecorator);
addDecorator(withInfo);
// Option defaults:
setOptions({
name: 'Assembl',
url: '#',
hierarchySeparator: /\//,
hierarchyRootSeparator: /\|/
});
I18n.setTranslations(messages);
I18n.setLocale('fr');
function loadStories() {
require('../js/app/integration/101/components/button101/button101.stories.jsx');
require('../js/app/integration/101/components/checkbox101/checkbox101.stories.jsx');
require('../js/app/integration/101/components/checkboxList101/checkboxList101.stories.jsx');
require('../js/app/stories/components/common/menu/menu.stories.jsx');
require('../js/app/stories/components/debate/common/toggleCommentButton.stories.jsx');
require('../js/app/stories/components/debate/common/replyToCommentButton.stories.jsx');
require('../js/app/stories/components/debate/common/sharePostButton.stories.jsx');
require('../js/app/stories/components/debate/common/commentHelperButton.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/fictionPreview.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/fictionsList.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/instructionsText.stories.jsx');
require('../js/app/stories/components/debate/brightMirror/circleAvatar.stories.jsx');
}, _this.uploadFromWeb = function () {
var value = _this._uploadFromWebField.value;
var isValid = value && /^(http:\/\/|https:\/\/|\/\/)/.test(value);
if (isValid) _this.upload(true, value);else _this.uploadError(value ? _reactI18nify.I18n.t('upload.url_not_valid') : _reactI18nify.I18n.t('upload.empty_url'), 4000);
}, _temp), _possibleConstructorReturn(_this, _ret);
}
function syncTranslationWithStore(store) {
_reactI18nify.I18n.setTranslationsGetter(function () {
try {
return store.getState().i18n.translations;
} catch (e) {
console.error('Error getting translations from store!');
}
});
_reactI18nify.I18n.setLocaleGetter(function () {
try {
return store.getState().i18n.locale;
} catch (e) {
console.error('Error getting locale from store!');
}
});
}
var _reducer = require('./reducer');
Object.defineProperty(exports, 'i18nReducer', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_reducer).default;
}
});
exports.syncTranslationWithStore = syncTranslationWithStore;
var _reactI18nify = require('react-i18nify');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.I18n = _reactI18nify.I18n;
exports.Translate = _reactI18nify.Translate;
exports.Localize = _reactI18nify.Localize;
function syncTranslationWithStore(store) {
_reactI18nify.I18n.setTranslationsGetter(function () {
try {
return store.getState().i18n.translations;
} catch (e) {
console.error('Error getting translations from store!');
}
});
_reactI18nify.I18n.setLocaleGetter(function () {
try {
return store.getState().i18n.locale;
} catch (e) {
console.error('Error getting locale from store!');
}
Object.defineProperty(exports, 'i18nReducer', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_reducer).default;
}
});
exports.syncTranslationWithStore = syncTranslationWithStore;
var _reactI18nify = require('react-i18nify');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.I18n = _reactI18nify.I18n;
exports.Translate = _reactI18nify.Translate;
exports.Localize = _reactI18nify.Localize;
function syncTranslationWithStore(store) {
_reactI18nify.I18n.setTranslationsGetter(function () {
try {
return store.getState().i18n.translations;
} catch (e) {
console.error('Error getting translations from store!');
}
});
_reactI18nify.I18n.setLocaleGetter(function () {
try {
return store.getState().i18n.locale;
} catch (e) {
console.error('Error getting locale from store!');
}
});
}
var _reducer = require('./reducer');
Object.defineProperty(exports, 'i18nReducer', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_reducer).default;
}
});
exports.syncTranslationWithStore = syncTranslationWithStore;
var _reactI18nify = require('react-i18nify');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.I18n = _reactI18nify.I18n;
exports.Translate = _reactI18nify.Translate;
exports.Localize = _reactI18nify.Localize;
function syncTranslationWithStore(store) {
_reactI18nify.I18n.setTranslationsGetter(function () {
try {
return store.getState().i18n.translations;
} catch (e) {
console.error('Error getting translations from store!');
}
});
_reactI18nify.I18n.setLocaleGetter(function () {
try {
return store.getState().i18n.locale;
} catch (e) {
console.error('Error getting locale from store!');
}
});
as="div"
className={`active-option${operationOpen ? ' active' : ''}`}
onClick={() => { this.setState({ operationOpen: !this.state.operationOpen }); }}
>
{I18n.t(`upload.${operation}`)}
<div>
<div>{I18n.t('upload.smart_crop')}</div>
<div>{I18n.t('upload.face_detection')} </div>
<div>{I18n.t('upload.resize')}</div>
</div>
{I18n.t(`upload.width`)}
private _renderTextArea() {
const { commentable: { id, type }, autoFocus } = this.props;
const { error } = this.state;
const className = classnames({ "is-invalid-input": error });
const textAreaProps: any = {
ref: (textarea: HTMLTextAreaElement) => {this.bodyTextArea = textarea; },
id: `add-comment-${type}-${id}`,
className,
rows: "4",
maxLength: MAX_LENGTH,
required: "required",
pattern: `^(.){0,${MAX_LENGTH}}$`,
placeholder: I18n.t("components.add_comment_form.form.body.placeholder"),
onChange: (evt: React.ChangeEvent) => this._checkCommentBody(evt.target.value),
};
if (autoFocus) {
textAreaProps.autoFocus = "autoFocus";
}
return (
<textarea> );
}
</textarea>