Skip to content

Commit

Permalink
Add changed files after revert
Browse files Browse the repository at this point in the history
  • Loading branch information
aoelen committed Dec 14, 2018
1 parent 43c27d4 commit fbcb88b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion actions/loadDeckView.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export default function loadDeckView(context, payload, done) {
// console.log('loadDeckView params', payload.params, '\n', payload);
res.isRootDeck = payload.params.spath === '';
context.dispatch('LOAD_DECK_CONTENT_SUCCESS', res);
context.dispatch('LOAD_DECK_METADATA_SUCCESS', {thumbnailID: res.slidesData.children[0].id});
context.dispatch('LOAD_DECK_METADATA_SUCCESS', {
thumbnailID: res.slidesData.children[0].id,
thumbnailTheme: res.slidesData.theme,
description: res.deckData.description
});
}
let pageTitle = shortTitle + ' | ' + res.slidesData.title;
let cleanTitle = pageTitle.replace(/<\/?[^>]+(>|$)/g, '').replace(/&#39;/g, '\'').replace(/&#34;/g, '\"');
Expand Down
4 changes: 4 additions & 0 deletions actions/slide/loadSlideView.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export default function loadSlideView(context, payload, done) {
} else {
context.dispatch('LOAD_SLIDE_CONTENT_SUCCESS', res);
context.dispatch('LOAD_SLIDE_EDIT_SUCCESS', res);
context.dispatch('LOAD_DECK_METADATA_SUCCESS', {
thumbnailID: res.selector.sid,
thumbnailTheme: context.getStore(DeckTreeStore).theme
});
}
let deckTitle = context.getStore(DeckTreeStore).getState().deckTree.get('title');
let pageTitle = shortTitle + ' | ' + deckTitle + ' | ' + res.slide.title;
Expand Down
8 changes: 8 additions & 0 deletions components/DefaultHTMLLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ hook({
class DefaultHTMLLayout extends React.Component {
render() {
let user = this.props.context.getUser();
let pageDescription = this.props.context.getStore(ApplicationStore).getPageDescription();

return (
<html lang={ this.props.lang }>
<head>
<meta charSet="utf-8" />
<title>{this.props.context.getStore(ApplicationStore).getPageTitle()}</title>
<meta name="thumbnail" content={this.props.context.getStore(ApplicationStore).getPageThumbnail()} />

<meta property="og:title" content={this.props.context.getStore(ApplicationStore).getPageTitle()} />
<meta property="og:type" content="website" />
<meta property="og:image" content={this.props.context.getStore(ApplicationStore).getPageThumbnail()} />
{pageDescription ? <meta property="og:description" content={pageDescription} /> : ''}

<meta name="viewport" content="width=device-width" />
<link href="/assets/custom-semantic-ui/dist/semantic.min.css" rel="stylesheet" type="text/css" />
<link href="/assets/css/custom.css" rel="stylesheet" type="text/css" />
Expand Down
3 changes: 3 additions & 0 deletions stores/ApplicationStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class ApplicationStore extends BaseStore {
super(dispatcher);
this.pageTitle = '';
this.pageThumbnail = '/assets/images/slideWiki-logo-linear.png'; //can add a default image here
this.pageDescription = '';
this.showActivationMessage = false;
//this.frozen = false;
}
Expand Down Expand Up @@ -55,12 +56,14 @@ class ApplicationStore extends BaseStore {
return {
pageTitle: this.pageTitle,
pageThumbnail: this.pageThumbnail,
pageDescription: this.pageDescription,
showActivationMessage: this.showActivationMessage,
};
}
rehydrate(state) {
this.pageTitle = state.pageTitle;
this.pageThumbnail = state.pageThumbnail;
this.pageDescription = state.pageDescription;
this.showActivationMessage = state.showActivationMessage;
}
}
Expand Down

0 comments on commit fbcb88b

Please sign in to comment.