Skip to content

Commit

Permalink
syncing book chapters with main app
Browse files Browse the repository at this point in the history
  • Loading branch information
tima101 committed Jul 29, 2019
1 parent eb2dd57 commit 9093f1e
Show file tree
Hide file tree
Showing 85 changed files with 313 additions and 140 deletions.
5 changes: 5 additions & 0 deletions app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ class PostEditor extends React.Component<MyProps, MyState> {
renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}


if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}
Expand Down
5 changes: 5 additions & 0 deletions book/1-begin/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,7 @@

// NProgress.start();
// try {
// await discussion.edit({
// name,
// memberIds: [discussion.store.currentUser._id, ...memberIds],
// notificationType,
// });
// await discussion.edit({ name, memberIds, notificationType });

// this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
// notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/1-begin/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
5 changes: 5 additions & 0 deletions book/1-end/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
6 changes: 1 addition & 5 deletions book/1-end/app/components/discussions/EditDiscussionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,7 @@

// NProgress.start();
// try {
// await discussion.edit({
// name,
// memberIds: [discussion.store.currentUser._id, ...memberIds],
// notificationType,
// });
// await discussion.edit({ name, memberIds, notificationType });

// this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
// notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/1-end/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
5 changes: 5 additions & 0 deletions book/10-begin/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,7 @@

// NProgress.start();
// try {
// await discussion.edit({
// name,
// memberIds: [discussion.store.currentUser._id, ...memberIds],
// notificationType,
// });
// await discussion.edit({ name, memberIds, notificationType });

// this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
// notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/10-begin/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
5 changes: 5 additions & 0 deletions book/10-end/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,7 @@

// NProgress.start();
// try {
// await discussion.edit({
// name,
// memberIds: [discussion.store.currentUser._id, ...memberIds],
// notificationType,
// });
// await discussion.edit({ name, memberIds, notificationType });

// this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
// notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/10-end/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
5 changes: 5 additions & 0 deletions book/11-begin/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,7 @@

// NProgress.start();
// try {
// await discussion.edit({
// name,
// memberIds: [discussion.store.currentUser._id, ...memberIds],
// notificationType,
// });
// await discussion.edit({ name, memberIds, notificationType });

// this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
// notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/11-begin/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@

// renderer.link = (href, title, text) => {
// const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

// return `
// <a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
// ${text}
Expand Down
5 changes: 5 additions & 0 deletions book/11-end/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ function markdownToHtml(content) {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ class EditDiscussionForm extends React.Component<Props, State> {

NProgress.start();
try {
await discussion.edit({
name,
memberIds: [discussion.store.currentUser._id, ...memberIds],
notificationType,
});
await discussion.edit({ name, memberIds, notificationType });

this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/11-end/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ class PostEditor extends React.Component<MyProps, MyState> {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
5 changes: 5 additions & 0 deletions book/12-begin/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ function markdownToHtml(content) {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ class EditDiscussionForm extends React.Component<Props, State> {

NProgress.start();
try {
await discussion.edit({
name,
memberIds: [discussion.store.currentUser._id, ...memberIds],
notificationType,
});
await discussion.edit({ name, memberIds, notificationType });

this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/12-begin/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ class PostEditor extends React.Component<MyProps, MyState> {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
5 changes: 5 additions & 0 deletions book/12-end/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ function markdownToHtml(content) {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ class EditDiscussionForm extends React.Component<Props, State> {

NProgress.start();
try {
await discussion.edit({
name,
memberIds: [discussion.store.currentUser._id, ...memberIds],
notificationType,
});
await discussion.edit({ name, memberIds, notificationType });

this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/12-end/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ class PostEditor extends React.Component<MyProps, MyState> {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
5 changes: 5 additions & 0 deletions book/13-begin/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ function markdownToHtml(content) {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ class EditDiscussionForm extends React.Component<Props, State> {

NProgress.start();
try {
await discussion.edit({
name,
memberIds: [discussion.store.currentUser._id, ...memberIds],
notificationType,
});
await discussion.edit({ name, memberIds, notificationType });

this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/13-begin/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ class PostEditor extends React.Component<MyProps, MyState> {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
5 changes: 5 additions & 0 deletions book/13-end/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ function markdownToHtml(content) {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ class EditDiscussionForm extends React.Component<Props, State> {

NProgress.start();
try {
await discussion.edit({
name,
memberIds: [discussion.store.currentUser._id, ...memberIds],
notificationType,
});
await discussion.edit({ name, memberIds, notificationType });

this.setState({ name: '', memberIds: [], disabled: false, notificationType: 'default' });
notify('You successfully edited Discussion.');
Expand Down
5 changes: 5 additions & 0 deletions book/13-end/app/components/posts/PostEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ class PostEditor extends React.Component<MyProps, MyState> {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
5 changes: 5 additions & 0 deletions book/14-begin/api/server/models/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ function markdownToHtml(content) {

renderer.link = (href, title, text) => {
const t = title ? ` title="${title}"` : '';

if (text.startsWith('<code>@#')) {
return `${text.replace('<code>@#', '<code>@')} `;
}

return `
<a target="_blank" href="${href}" rel="noopener noreferrer"${t}>
${text}
Expand Down
Loading

0 comments on commit 9093f1e

Please sign in to comment.