yuken 3 лет назад
Родитель
Сommit
588082fcbd

+ 2 - 2
packages/app/src/components/Page/DisplaySwitcher.tsx

@@ -16,7 +16,7 @@ import { EditorMode, useEditorMode } from '~/stores/ui';
 import CountBadge from '../Common/CountBadge';
 import CountBadge from '../Common/CountBadge';
 import PageListIcon from '../Icons/PageListIcon';
 import PageListIcon from '../Icons/PageListIcon';
 import { Page } from '../Page';
 import { Page } from '../Page';
-// import PageEditorByHackmd from '../PageEditorByHackmd';
+import { PageEditorByHackmd } from '../PageEditorByHackmd';
 import TableOfContents from '../TableOfContents';
 import TableOfContents from '../TableOfContents';
 import UserInfo from '../User/UserInfo';
 import UserInfo from '../User/UserInfo';
 
 
@@ -131,7 +131,7 @@ const DisplaySwitcher = (): JSX.Element => {
         { isEditable && (
         { isEditable && (
           <TabPane tabId={EditorMode.HackMD}>
           <TabPane tabId={EditorMode.HackMD}>
             <div id="page-editor-with-hackmd">
             <div id="page-editor-with-hackmd">
-              {/* <PageEditorByHackmd /> */}
+              <PageEditorByHackmd />
             </div>
             </div>
           </TabPane>
           </TabPane>
         ) }
         ) }

+ 6 - 6
packages/app/src/server/routes/index.js

@@ -49,7 +49,7 @@ module.exports = function(crowi, app) {
   const tag = require('./tag')(crowi, app);
   const tag = require('./tag')(crowi, app);
   const search = require('./search')(crowi, app);
   const search = require('./search')(crowi, app);
   // == TODO: Replace the code in hackmd.js getting the script path from manifest.json
   // == TODO: Replace the code in hackmd.js getting the script path from manifest.json
-  // const hackmd = require('./hackmd')(crowi, app);
+  const hackmd = require('./hackmd')(crowi, app);
   const ogp = require('./ogp')(crowi);
   const ogp = require('./ogp')(crowi);
 
 
   const next = nextFactory(crowi);
   const next = nextFactory(crowi);
@@ -227,11 +227,11 @@ module.exports = function(crowi, app) {
   app.get('/trash/*/$'                , loginRequired, injectUserUISettings, page.deletedPageListShowWrapper);
   app.get('/trash/*/$'                , loginRequired, injectUserUISettings, page.deletedPageListShowWrapper);
 
 
   // == TODO: Replace the code in hackmd.js getting the script path from manifest.json
   // == TODO: Replace the code in hackmd.js getting the script path from manifest.json
-  // app.get('/_hackmd/load-agent'          , hackmd.loadAgent);
-  // app.get('/_hackmd/load-styles'         , hackmd.loadStyles);
-  // app.post('/_api/hackmd.integrate'      , accessTokenParser , loginRequiredStrictly , hackmd.validateForApi, hackmd.integrate);
-  // app.post('/_api/hackmd.discard'        , accessTokenParser , loginRequiredStrictly , hackmd.validateForApi, hackmd.discard);
-  // app.post('/_api/hackmd.saveOnHackmd'   , accessTokenParser , loginRequiredStrictly , hackmd.validateForApi, hackmd.saveOnHackmd);
+  app.get('/_hackmd/load-agent'          , hackmd.loadAgent);
+  app.get('/_hackmd/load-styles'         , hackmd.loadStyles);
+  app.post('/_api/hackmd.integrate'      , accessTokenParser , loginRequiredStrictly , hackmd.validateForApi, hackmd.integrate);
+  app.post('/_api/hackmd.discard'        , accessTokenParser , loginRequiredStrictly , hackmd.validateForApi, hackmd.discard);
+  app.post('/_api/hackmd.saveOnHackmd'   , accessTokenParser , loginRequiredStrictly , hackmd.validateForApi, hackmd.saveOnHackmd);
 
 
   app.use('/forgot-password', express.Router()
   app.use('/forgot-password', express.Router()
     .use(forgotPassword.checkForgotPasswordEnabledMiddlewareFactory(crowi))
     .use(forgotPassword.checkForgotPasswordEnabledMiddlewareFactory(crowi))