Update client dependencies

This commit is contained in:
Ken-Håvard Lieng 2016-02-04 03:35:50 +01:00
parent dbe9d03352
commit 7108fa572c
19 changed files with 109 additions and 116 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,19 +4,19 @@
"description": "",
"main": "index.js",
"devDependencies": {
"babel-core": "^6.4.0",
"babel-core": "^6.4.5",
"babel-eslint": "^5.0.0-beta6",
"babel-loader": "^6.2.1",
"babel-loader": "^6.2.2",
"babel-plugin-react-transform": "^2.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"eslint": "^1.10.3",
"eslint-config-airbnb": "^3.1.0",
"eslint-loader": "^1.2.0",
"eslint-plugin-react": "^3.15.0",
"express": "^4.13.3",
"eslint-config-airbnb": "^4.0.0",
"eslint-loader": "^1.2.1",
"eslint-plugin-react": "^3.16.1",
"express": "^4.13.4",
"express-http-proxy": "^0.6.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "3.1.0",
@ -26,33 +26,33 @@
"gulp-gzip": "1.2.0",
"gulp-htmlmin": "^1.3.0",
"gulp-util": "^3.0.7",
"react-transform-catch-errors": "^1.0.1",
"react-transform-hmr": "^1.0.1",
"redbox-react": "^1.2.0",
"redux-devtools": "^3.0.1",
"react-transform-catch-errors": "^1.0.2",
"react-transform-hmr": "^1.0.2",
"redbox-react": "^1.2.2",
"redux-devtools": "^3.1.0",
"redux-devtools-dock-monitor": "^1.0.1",
"redux-devtools-log-monitor": "^1.0.2",
"webpack": "^1.12.11",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0"
"redux-devtools-log-monitor": "^1.0.4",
"webpack": "^1.12.12",
"webpack-dev-middleware": "^1.5.1",
"webpack-hot-middleware": "^2.6.4"
},
"dependencies": {
"autolinker": "^0.22.0",
"backo": "^1.1.0",
"base64-arraybuffer": "^0.1.5",
"eventemitter2": "^0.4.14",
"history": "^2.0.0-rc2",
"history": "^2.0.0-rc3",
"immutable": "^3.7.6",
"lodash": "^4.0.0",
"lodash": "^4.2.1",
"pure-render-decorator": "^0.2.0",
"react": "^0.14.6",
"react-dom": "^0.14.6",
"react-infinite": "0.7.3",
"react-redux": "^4.0.6",
"react": "^0.14.7",
"react-dom": "^0.14.7",
"react-infinite": "0.8.0",
"react-redux": "^4.2.1",
"react-router": "^2.0.0-rc5",
"redux": "^3.0.5",
"redux-simple-router": "^2.0.2",
"react-router-redux": "^3.0.0",
"redux": "^3.2.1",
"redux-thunk": "^1.0.3",
"reselect": "^2.0.2"
"reselect": "^2.0.3"
}
}

View File

@ -1,20 +1,18 @@
import * as actions from '../actions';
export function sendMessage(message, to, server) {
return (dispatch, getState) => {
return dispatch({
type: actions.SEND_MESSAGE,
from: getState().servers.getIn([server, 'nick']),
message,
to,
server,
time: new Date(),
socket: {
type: 'chat',
data: { message, to, server }
}
});
};
return (dispatch, getState) => dispatch({
type: actions.SEND_MESSAGE,
from: getState().servers.getIn([server, 'nick']),
message,
to,
server,
time: new Date(),
socket: {
type: 'chat',
data: { message, to, server }
}
});
}
export function addMessage(message) {
@ -37,26 +35,22 @@ export function addMessages(messages) {
}
export function broadcast(message, server, channels) {
return addMessages(channels.map(channel => {
return {
server,
to: channel,
message,
type: 'info'
};
}));
return addMessages(channels.map(channel => ({
server,
to: channel,
message,
type: 'info'
})));
}
export function inform(message, server, channel) {
if (Array.isArray(message)) {
return addMessages(message.map(msg => {
return {
server,
to: channel,
message: msg,
type: 'info'
};
}));
return addMessages(message.map(msg => ({
server,
to: channel,
message: msg,
type: 'info'
})));
}
return addMessage({

View File

@ -1,4 +1,4 @@
import { routeActions } from 'redux-simple-router';
import { routeActions } from 'react-router-redux';
import * as actions from '../actions';
export function select(server, channel, pm) {

View File

@ -68,7 +68,7 @@ export default class MessageBox extends Component {
for (let i = 1; i < message.lines.length; i++) {
lines.push(
<MessageLine key={key + '-' + i} type={message.type} line={message.lines[i]} />
<MessageLine key={`${key}-${i}`} type={message.type} line={message.lines[i]} />
);
}
});

View File

@ -39,7 +39,7 @@ export default class MessageHeader extends Component {
<p className={classes.join(' ')}>
<span className="message-time">{timestamp(message.time)}</span>
{sender}
<span dangerouslySetInnerHTML={{ __html: ' ' + line }}></span>
<span dangerouslySetInnerHTML={{ __html: ` ${line}` }}></span>
</p>
);
}

View File

@ -14,7 +14,7 @@ export default class MessageLine extends Component {
}
const style = {
paddingLeft: window.messageIndent + 'px'
paddingLeft: `${window.messageIndent}px`
};
return (

View File

@ -10,8 +10,8 @@ export default class Search extends Component {
const content = Autolinker.link(result.content, { stripPrefix: false });
const style = {
paddingLeft: window.messageIndent + 'px',
textIndent: -window.messageIndent + 'px'
paddingLeft: `${window.messageIndent}px`,
textIndent: `-${window.messageIndent}px`
};
return (
@ -21,7 +21,7 @@ export default class Search extends Component {
{' '}
<span className="message-sender">{result.from}</span>
</span>
<span dangerouslySetInnerHTML={{ __html: ' ' + content }}></span>
<span dangerouslySetInnerHTML={{ __html: ` ${content}` }}></span>
</p>
);
}

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { routeActions } from 'redux-simple-router';
import { routeActions } from 'react-router-redux';
import pure from 'pure-render-decorator';
import TabList from '../components/TabList';
import { select } from '../actions/tab';

View File

@ -1,7 +1,7 @@
import React from 'react';
import { render } from 'react-dom';
import { browserHistory } from 'react-router';
import { routeActions } from 'redux-simple-router';
import { routeActions } from 'react-router-redux';
import configureStore from './store';
import createRoutes from './routes';
import Socket from './util/Socket';

View File

@ -12,9 +12,9 @@ function updateRenderName(user) {
let name = user.nick;
if (user.mode.indexOf('o') !== -1) {
name = '@' + name;
name = `@${name}`;
} else if (user.mode.indexOf('v') !== -1) {
name = '+' + name;
name = `+${name}`;
}
return user.set('renderName', name);
@ -79,9 +79,9 @@ export default createReducer(Map(), {
[actions.SOCKET_JOIN](state, action) {
const { server, channels, user } = action;
return state.updateIn([server, channels[0], 'users'], List(), users => {
return users.push(createUser(user)).sort(compareUsers);
});
return state.updateIn([server, channels[0], 'users'], List(), users =>
users.push(createUser(user)).sort(compareUsers)
);
},
[actions.SOCKET_PART](state, action) {
@ -110,9 +110,9 @@ export default createReducer(Map(), {
channels.forEach(channel => {
s.updateIn([server, channel, 'users'], users => {
const i = users.findIndex(user => user.nick === action.old);
return users.update(i, user => {
return updateRenderName(user.set('nick', action.new));
}).sort(compareUsers);
return users.update(i, user =>
updateRenderName(user.set('nick', action.new))
).sort(compareUsers);
});
});
});

View File

@ -1,5 +1,5 @@
import { combineReducers } from 'redux';
import { routeReducer } from 'redux-simple-router';
import { routeReducer } from 'react-router-redux';
import channels from './channels';
import environment from './environment';
import input from './input';

View File

@ -1,5 +1,5 @@
import { Record, List } from 'immutable';
import { UPDATE_LOCATION } from 'redux-simple-router';
import { UPDATE_LOCATION } from 'react-router-redux';
import createReducer from '../util/createReducer';
import * as actions from '../actions';
@ -39,7 +39,7 @@ export default createReducer(new State(), {
},
[UPDATE_LOCATION](state, action) {
if (action.location.pathname.indexOf('.') === -1 && state.selected.server) {
if (action.payload.pathname.indexOf('.') === -1 && state.selected.server) {
return state.set('selected', new Tab());
}

View File

@ -1,4 +1,4 @@
import { routeActions } from 'redux-simple-router';
import { routeActions } from 'react-router-redux';
import { broadcast, inform, addMessage, addMessages } from './actions/message';
import { select } from './actions/tab';
import { normalizeChannel } from './util';
@ -58,13 +58,11 @@ export default function handleSocket(socket, { dispatch, getState }) {
);
socket.on('motd', ({ content, server }) =>
dispatch(addMessages(content.map(line => {
return {
server,
to: server,
message: line
};
})))
dispatch(addMessages(content.map(line => ({
server,
to: server,
message: line
}))))
);
socket.on('whois', data => {

View File

@ -1,6 +1,6 @@
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import { syncHistory } from 'redux-simple-router';
import { syncHistory } from 'react-router-redux';
import reducer from '../reducers';
import createSocketMiddleware from '../middleware/socket';
import commands from '../commands';

View File

@ -1,6 +1,6 @@
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { syncHistory } from 'redux-simple-router';
import { syncHistory } from 'react-router-redux';
import reducer from '../reducers';
import createSocketMiddleware from '../middleware/socket';
import commands from '../commands';

View File

@ -13,7 +13,7 @@ export function normalizeChannel(channel) {
export function timestamp(date = new Date()) {
const h = padStart(date.getHours(), 2, '0');
const m = padStart(date.getMinutes(), 2, '0');
return h + ':' + m;
return `${h}:${m}`;
}
const canvas = document.createElement('canvas');

View File

@ -37,7 +37,7 @@ export default function wrapMessages(messages, width, charWidth, indent = 0) {
wrapped.push(line);
if (i !== wlen - 1) {
line = word + ' ';
line = `${word} `;
lineWidth = (word.length + 1) * charWidth;
wordCount = 1;
} else {
@ -51,7 +51,7 @@ export default function wrapMessages(messages, width, charWidth, indent = 0) {
hasWrapped = true;
} else if (i !== wlen - 1) {
line += word + ' ';
line += `${word} `;
lineWidth += charWidth;
} else {
line += word;

View File

@ -8,6 +8,7 @@ import (
"io/ioutil"
"log"
"net/http"
"path"
"path/filepath"
"strconv"
"strings"
@ -78,12 +79,12 @@ func initFileServer() {
}
for _, font := range fonts {
path := strings.TrimSuffix(font, ".gz")
p := strings.TrimSuffix(font, ".gz")
files = append(files, &File{
Path: filepath.Join("font", path),
Asset: filepath.Join("font", font),
ContentType: contentTypes[filepath.Ext(path)],
Path: path.Join("font", p),
Asset: path.Join("font", font),
ContentType: contentTypes[filepath.Ext(p)],
CacheControl: "max-age=31536000",
Gzip: strings.HasSuffix(font, ".gz"),
})