PLT-1752/PLT-3567/PLT-3998 Highlighting links in search, unit tests for autolinking (#3865)

* Added highlighting to links when their URL includes the search term

* Decoupling UserStore from react-router to allow for unit tests involving it

* PLT-3998 Added SiteURL as an option to be passed into the text formatting code

* Removed reference to PreferenceStore and window from TextFormatting

* Refactored TextFormatting to remove remaining browser-only code

* Updated ChannelHeader and MessageWrapper to match the changes to TextFormatting

* Increased max listeners for Preference and Emoji stores

* PLT-3832 Added automated unit tests for autolinking

* PLT-3567 Rerender posts when mention keywords change

* Updated RHS and search to match the changes to TextFormatting

* Broke TextFormatting's dependency on the UserStore
Этот коммит содержится в:
Harrison Healey
2016-08-29 09:50:00 -04:00
коммит произвёл Christopher Speller
родитель 55342e8fe1
Коммит 167dd22eef
20 изменённых файлов: 765 добавлений и 142 удалений

Просмотреть файл

@@ -17,6 +17,8 @@ class EmojiStore extends EventEmitter {
this.dispatchToken = AppDispatcher.register(this.handleEventPayload.bind(this));
this.setMaxListeners(600);
this.emojis = new Map(EmojiJson);
this.systemEmojis = new Map(EmojiJson);

Просмотреть файл

@@ -8,7 +8,7 @@ import EventEmitter from 'events';
const CHANGE_EVENT = 'change';
class PreferenceStoreClass extends EventEmitter {
class PreferenceStore extends EventEmitter {
constructor() {
super();
@@ -17,7 +17,7 @@ class PreferenceStoreClass extends EventEmitter {
this.preferences = new Map();
this.setMaxListeners(20);
this.setMaxListeners(600);
}
getKey(category, name) {
@@ -144,7 +144,5 @@ class PreferenceStoreClass extends EventEmitter {
}
}
const PreferenceStore = new PreferenceStoreClass();
PreferenceStore.setMaxListeners(25);
export default PreferenceStore;
global.window.PreferenceStore = PreferenceStore;
global.PreferenceStore = new PreferenceStore();
export default global.PreferenceStore;

Просмотреть файл

@@ -334,7 +334,7 @@ class UserStoreClass extends EventEmitter {
}
var UserStore = new UserStoreClass();
UserStore.setMaxListeners(16);
UserStore.setMaxListeners(600);
UserStore.dispatchToken = AppDispatcher.register((payload) => {
var action = payload.action;