Skip to content

Commit

Permalink
MM-11036: subpath eliminate hardcoded /static/ (mattermost#1389)
Browse files Browse the repository at this point in the history
* include window.basename when resolving emojis via the EmojiStore

* load img_trans.gif via webpack to automatically point into subpath

* use webpack-pwa-manifest to manage manifest.json

This plugin also handled injecting <link rel="apple-touch-icon" ... />
and <meta name="apple-*" ... /> tags into root.html.
  • Loading branch information
lieut-data authored and sudheerDev committed Jun 28, 2018
1 parent 01ed3d0 commit 711bef1
Show file tree
Hide file tree
Showing 9 changed files with 327 additions and 83 deletions.
3 changes: 2 additions & 1 deletion components/emoji_picker/components/emoji_picker_item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React from 'react';
import debounce from 'lodash/debounce';

import EmojiStore from 'stores/emoji_store.jsx';
import imgTrans from 'images/img_trans.gif';

const SCROLLING_ADDITIONAL_VISUAL_SPACING = 10; // to make give the emoji some visual 'breathing room'
const EMOJI_LAZY_LOAD_SCROLL_THROTTLE = 150;
Expand Down Expand Up @@ -74,7 +75,7 @@ export default class EmojiPickerItem extends React.Component {
image = (
<img
onMouseOver={this.handleMouseOverThrottle}
src='/static/images/img_trans.gif'
src={imgTrans}
className={spriteClassName}
onClick={this.handleClick}
/>
Expand Down
3 changes: 2 additions & 1 deletion components/emoji_picker/components/emoji_picker_preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import React from 'react';
import {FormattedMessage} from 'react-intl';

import EmojiStore from 'stores/emoji_store.jsx';
import imgTrans from 'images/img_trans.gif';

export default class EmojiPickerPreview extends React.Component {
static propTypes = {
Expand All @@ -28,7 +29,7 @@ export default class EmojiPickerPreview extends React.Component {
previewImage = (
<span className='sprite-preview'>
<img
src='/static/images/img_trans.gif'
src={imgTrans}
className={'emojisprite-preview emoji-category-' + emoji.category + '-' + emoji.batch + ' emoji-' + emoji.filename}
/>
</span>
Expand Down
3 changes: 2 additions & 1 deletion components/emoji_picker/emoji_picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import throttle from 'lodash/throttle';
import EmojiStore from 'stores/emoji_store.jsx';
import * as Emoji from 'utils/emoji.jsx';
import * as Utils from 'utils/utils.jsx';
import imgTrans from 'images/img_trans.gif';

import EmojiPickerCategory from './components/emoji_picker_category';
import EmojiPickerItem from './components/emoji_picker_item';
Expand Down Expand Up @@ -530,7 +531,7 @@ export default class EmojiPicker extends React.PureComponent {
ref={ref}
>
<img
src='/static/images/img_trans.gif'
src={imgTrans}
className='emojisprite'
/>
</div>
Expand Down
50 changes: 0 additions & 50 deletions config/manifest.json

This file was deleted.

Loading

0 comments on commit 711bef1

Please sign in to comment.