Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Router = require('react-router'),
{ Link } = Router,
// components
Spinner = require('../commons/Spinner.jsx'),
// stores
AuthStore = require('../../stores/authentication/AuthStore'),
ComponentMessageStore = require('../../stores/subs/ComponentMessageStore'),
// actions
AuthAccountActions = require('../../actions/authentication/AuthAccountActions');
var Login = React.createClass({
mixins: [
PureRenderMixin,
Reflux.listenTo(AuthStore, 'resetForm'),
Reflux.listenTo(ComponentMessageStore, 'onErrorMessage'),
],
getInitialState: function() {
return {
loggedIn: false,
errors: '',
submitted: false
};
},
resetForm: function() {
var auth = AuthStore.getAuth();
if(this.state.loggedIn !== auth.loggedIn){
this.refs.email.getDOMNode().value = '';
this.refs.password.getDOMNode().value = '';
Router = require('react-router'),
{ Link } = Router,
// components
Spinner = require('../commons/Spinner.jsx'),
// stores
AuthStore = require('../../stores/authentication/AuthStore'),
ComponentMessageStore = require('../../stores/subs/ComponentMessageStore'),
// actions
AuthAccountActions = require('../../actions/authentication/AuthAccountActions');
var Register = React.createClass({
mixins: [
PureRenderMixin,
Reflux.listenTo(AuthStore, 'resetForm'),
Reflux.listenTo(ComponentMessageStore, 'onErrorMessage')
],
getInitialState: function() {
return {
errorPrescriptions: null,
errors: null,
submitted: false
};
},
resetForm: function() {
this.refs.email.getDOMNode().value = '';
this.refs.username.getDOMNode().value = '';
this.refs.password.getDOMNode().value = '';
this.refs.confirmPassword.getDOMNode().value = '';
var ace = require('brace');
var React = require('react');
var Reflux = require('reflux');
var editorStore = require('../stores/editorStore');
var spellStore = require('../stores/spellStore');
// Setup module url
var ACE_HOST = 'http://webapi.coodict.com/brace/mode/';
for (var k in require('../mixins/lang').MODE_LABEL_MAP) {
ace.config.setModuleUrl('ace/mode/'+k, ACE_HOST+k+'.js');
}
var AceEditor = React.createClass({
mixins:[
Reflux.listenTo(editorStore, 'changeMode'),
],
getValue: function(){
return this.editor.getValue();
},
changeMode: function(lang){
this.setState({
mode: lang.mode,
});
// this.editor.setValue(this.props.value, 1);
this.editor.getSession().setMode({
path: 'ace/mode/' + lang.mode,
v: Date.now()
})
},
propTypes: {
name: React.PropTypes.string,
function group(route, field, name) {
return React.createClass({
mixins: [Reflux.listenTo(Stores.tracks, 'setState')],
getInitialState: function() {
return Stores.tracks.data || {};
},
render: function() {
var entries = {};
_.each(this.state.Tracks, function(val) {
var f = val.Info[field];
if (f) {
entries[f] = true;
}
});
var list = _.keys(entries);
list.sort(function(a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase());
});
var lis = _.map(list, function(val) {
module.exports = function (stateKey) {
return {
mixins: [Reflux.listenTo(KeyStore, 'onKeyCast')],
componentDidMount: function () {
var newState = {}
newState[stateKey] = true
KeyStore.setState(newState)
},
componentWillUnmount: function () {
var newState = {}
newState[stateKey] = false
KeyStore.setState(newState)
}
}
}