2
0
Эх сурвалжийг харах

move client source to 'src/client'

Yuki Takei 7 жил өмнө
parent
commit
46a40cf4b4
100 өөрчлөгдсөн 280 нэмэгдсэн , 277 устгасан
  1. 1 1
      .eslintignore
  2. 23 21
      config/webpack.common.js
  3. 3 3
      config/webpack.dev.js
  4. 1 1
      config/webpack.prod.js
  5. 1 1
      src/client/js/app.js
  6. 0 0
      src/client/js/components/Admin/CustomCssEditor.js
  7. 0 0
      src/client/js/components/Admin/CustomHeaderEditor.js
  8. 0 0
      src/client/js/components/Admin/CustomScriptEditor.js
  9. 0 0
      src/client/js/components/BookmarkButton.js
  10. 0 0
      src/client/js/components/Common/UserDate.js
  11. 0 0
      src/client/js/components/CopyButton.js
  12. 0 0
      src/client/js/components/HeaderSearchBox.js
  13. 0 0
      src/client/js/components/HeaderSearchBox/SearchForm.js
  14. 0 0
      src/client/js/components/HeaderSearchBox/SearchSuggest.js
  15. 0 0
      src/client/js/components/NewPageNameInput.js
  16. 0 0
      src/client/js/components/Page.js
  17. 0 0
      src/client/js/components/Page/PagePath.js
  18. 0 0
      src/client/js/components/Page/RevisionBody.js
  19. 0 0
      src/client/js/components/Page/RevisionPath.js
  20. 0 0
      src/client/js/components/Page/RevisionUrl.js
  21. 0 0
      src/client/js/components/PageAttachment.js
  22. 0 0
      src/client/js/components/PageAttachment/Attachment.js
  23. 0 0
      src/client/js/components/PageAttachment/DeleteAttachmentModal.js
  24. 0 0
      src/client/js/components/PageAttachment/PageAttachmentList.js
  25. 0 0
      src/client/js/components/PageComment/Comment.js
  26. 0 0
      src/client/js/components/PageComment/CommentForm.js
  27. 0 0
      src/client/js/components/PageComment/CommentPreview.js
  28. 0 0
      src/client/js/components/PageComment/DeleteCommentModal.js
  29. 0 0
      src/client/js/components/PageComments.js
  30. 0 0
      src/client/js/components/PageEditor.js
  31. 0 0
      src/client/js/components/PageEditor/AbstractEditor.js
  32. 3 3
      src/client/js/components/PageEditor/CodeMirrorEditor.js
  33. 0 0
      src/client/js/components/PageEditor/Editor.js
  34. 0 0
      src/client/js/components/PageEditor/EmojiAutoCompleteHelper.js
  35. 0 0
      src/client/js/components/PageEditor/MarkdownListUtil.js
  36. 0 0
      src/client/js/components/PageEditor/MarkdownTableInterceptor.js
  37. 0 0
      src/client/js/components/PageEditor/MarkdownTableUtil.js
  38. 0 0
      src/client/js/components/PageEditor/OptionsSelector.js
  39. 0 0
      src/client/js/components/PageEditor/PasteHelper.js
  40. 0 0
      src/client/js/components/PageEditor/PreventMarkdownListInterceptor.js
  41. 0 0
      src/client/js/components/PageEditor/Preview.js
  42. 0 0
      src/client/js/components/PageEditor/ScrollSyncHelper.js
  43. 2 2
      src/client/js/components/PageEditor/TextAreaEditor.js
  44. 0 0
      src/client/js/components/PageEditorByHackmd.jsx
  45. 0 0
      src/client/js/components/PageEditorByHackmd/HackmdEditor.jsx
  46. 0 0
      src/client/js/components/PageHistory.js
  47. 0 0
      src/client/js/components/PageHistory/PageRevisionList.js
  48. 0 0
      src/client/js/components/PageHistory/Revision.js
  49. 0 0
      src/client/js/components/PageHistory/RevisionDiff.js
  50. 0 0
      src/client/js/components/PageList/ListView.js
  51. 0 0
      src/client/js/components/PageList/Page.js
  52. 1 1
      src/client/js/components/PageList/PageListMeta.js
  53. 0 0
      src/client/js/components/PageList/PagePath.js
  54. 0 0
      src/client/js/components/PageListSearch.js
  55. 0 0
      src/client/js/components/PageStatusAlert.jsx
  56. 0 0
      src/client/js/components/ReactUtils.js
  57. 0 0
      src/client/js/components/SavePageControls.jsx
  58. 0 0
      src/client/js/components/SavePageControls/GrantSelector.jsx
  59. 0 0
      src/client/js/components/SearchPage.js
  60. 0 0
      src/client/js/components/SearchPage/DeletePageListModal.js
  61. 0 0
      src/client/js/components/SearchPage/SearchForm.js
  62. 0 0
      src/client/js/components/SearchPage/SearchResult.js
  63. 0 0
      src/client/js/components/SearchPage/SearchResultList.js
  64. 0 0
      src/client/js/components/SearchTypeahead.js
  65. 0 0
      src/client/js/components/SeenUserList.js
  66. 0 0
      src/client/js/components/SeenUserList/UserList.js
  67. 0 0
      src/client/js/components/SlackNotification.jsx
  68. 0 0
      src/client/js/components/User/User.js
  69. 0 0
      src/client/js/components/User/UserPicture.js
  70. 0 0
      src/client/js/dev.js
  71. 1 1
      src/client/js/hackmd-agent.js
  72. 1 1
      src/client/js/hackmd-styles.js
  73. 0 0
      src/client/js/i18n.js
  74. 0 0
      src/client/js/ie11-polyfill.js
  75. 0 0
      src/client/js/legacy/crowi-admin.js
  76. 0 0
      src/client/js/legacy/crowi-presentation.js
  77. 4 4
      src/client/js/legacy/crowi.js
  78. 0 0
      src/client/js/legacy/thirdparty-js/agile-admin.js
  79. 233 233
      src/client/js/legacy/thirdparty-js/jQuery.style.switcher.js
  80. 0 0
      src/client/js/legacy/thirdparty-js/switchery/switchery.css
  81. 0 0
      src/client/js/legacy/thirdparty-js/switchery/switchery.js
  82. 0 0
      src/client/js/legacy/thirdparty-js/waves.js
  83. 1 1
      src/client/js/plugin.js
  84. 3 2
      src/client/js/util/Crowi.js
  85. 0 0
      src/client/js/util/GrowiRenderer.js
  86. 0 0
      src/client/js/util/PostProcessor/CrowiTemplate.js
  87. 0 0
      src/client/js/util/PreProcessor/CsvToTable.js
  88. 0 0
      src/client/js/util/PreProcessor/Linker.js
  89. 2 2
      src/client/js/util/PreProcessor/XssFilter.js
  90. 0 0
      src/client/js/util/codemirror/autorefresh.ext.js
  91. 0 0
      src/client/js/util/emojione/emoji_strategy_shrinked.json
  92. 0 0
      src/client/js/util/interceptor/detach-code-blocks.js
  93. 0 0
      src/client/js/util/markdown-it/blockdiag.js
  94. 0 0
      src/client/js/util/markdown-it/emoji.js
  95. 0 0
      src/client/js/util/markdown-it/footernote.js
  96. 0 0
      src/client/js/util/markdown-it/header-line-number.js
  97. 0 0
      src/client/js/util/markdown-it/header.js
  98. 0 0
      src/client/js/util/markdown-it/mathjax.js
  99. 0 0
      src/client/js/util/markdown-it/plantuml.js
  100. 0 0
      src/client/js/util/markdown-it/table.js

+ 1 - 1
.eslintignore

@@ -2,6 +2,6 @@
 /.vscode/**
 /node_modules/**
 /public/**
-/resource/js/legacy/thirdparty-js/**
+/src/client/js/legacy/thirdparty-js/**
 /test/**
 /tmp/**

+ 23 - 21
config/webpack.common.js

@@ -20,26 +20,26 @@ module.exports = (options) => {
   return {
     mode: options.mode,
     entry: Object.assign({
-      'js/app':                   './resource/js/app',
-      'js/legacy':                './resource/js/legacy/crowi',
-      'js/legacy-admin':          './resource/js/legacy/crowi-admin',
-      'js/legacy-presentation':   './resource/js/legacy/crowi-presentation',
-      'js/plugin':                './resource/js/plugin',
-      'js/ie11-polyfill':         './resource/js/ie11-polyfill',
-      'js/hackmd-agent':          './resource/js/hackmd-agent',
-      'js/hackmd-styles':         './resource/js/hackmd-styles',
+      'js/app':                       './src/client/js/app',
+      'js/legacy':                    './src/client/js/legacy/crowi',
+      'js/legacy-admin':              './src/client/js/legacy/crowi-admin',
+      'js/legacy-presentation':       './src/client/js/legacy/crowi-presentation',
+      'js/plugin':                    './src/client/js/plugin',
+      'js/ie11-polyfill':             './src/client/js/ie11-polyfill',
+      'js/hackmd-agent':              './src/client/js/hackmd-agent',
+      'js/hackmd-styles':             './src/client/js/hackmd-styles',
       // styles
-      'styles/style':                './resource/styles/scss/style.scss',
-      'styles/style-presentation':   './resource/styles/scss/style-presentation.scss',
+      'styles/style':                 './src/client/styles/scss/style.scss',
+      'styles/style-presentation':    './src/client/styles/scss/style-presentation.scss',
       // themes
-      'styles/theme-default':        './resource/styles/scss/theme/default.scss',
-      'styles/theme-default-dark':   './resource/styles/scss/theme/default-dark.scss',
-      'styles/theme-nature':         './resource/styles/scss/theme/nature.scss',
-      'styles/theme-mono-blue':      './resource/styles/scss/theme/mono-blue.scss',
-      'styles/theme-future':         './resource/styles/scss/theme/future.scss',
-      'styles/theme-blue-night':     './resource/styles/scss/theme/blue-night.scss',
+      'styles/theme-default':         './src/client/styles/scss/theme/default.scss',
+      'styles/theme-default-dark':    './src/client/styles/scss/theme/default-dark.scss',
+      'styles/theme-nature':          './src/client/styles/scss/theme/nature.scss',
+      'styles/theme-mono-blue':       './src/client/styles/scss/theme/mono-blue.scss',
+      'styles/theme-future':          './src/client/styles/scss/theme/future.scss',
+      'styles/theme-blue-night':      './src/client/styles/scss/theme/blue-night.scss',
       // styles for external services
-      'styles/style-hackmd':         './resource/styles/hackmd/style.scss',
+      'styles/style-hackmd':          './src/client/styles/hackmd/style.scss',
     }, options.entry || {}),  // Merge with env dependent settings
     output: Object.assign({
       path: helpers.root('public'),
@@ -55,9 +55,11 @@ module.exports = (options) => {
     },
     resolve: {
       extensions: ['.js', '.jsx', '.json'],
-      modules: [helpers.root('src'), helpers.root('node_modules')],
+      modules: [helpers.root('node_modules')],
       alias: {
         '@root': helpers.root('/'),
+        '@commons': helpers.root('lib'),
+        '@tmp': helpers.root('tmp'),
         '@alias/logger': helpers.root('lib/service/logger'),
         '@alias/locales': helpers.root('lib/locales'),
         // replace bunyan
@@ -93,12 +95,12 @@ module.exports = (options) => {
         {
           test: /\.css$/,
           use: ['style-loader', 'css-loader'],
-          exclude: [helpers.root('resource/styles')]
+          exclude: [helpers.root('src/client/styles')]
         },
         {
           test: /\.scss$/,
           use: ['style-loader', 'css-loader', 'sass-loader'],
-          exclude: [helpers.root('resource/styles')]
+          exclude: [helpers.root('src/client/styles')]
         },
         /*
          * File loader for supporting images, for example, in CSS files.
@@ -144,7 +146,7 @@ module.exports = (options) => {
       splitChunks: {
         cacheGroups: {
           commons: {
-            test: /resource/,
+            test: /src/,
             chunks: 'initial',
             name: 'js/commons',
             minChunks: 2,

+ 3 - 3
config/webpack.dev.js

@@ -21,7 +21,7 @@ module.exports = require('./webpack.common')({
   mode: 'development',
   devtool: 'cheap-module-eval-source-map',
   entry: {
-    'js/dev': './resource/js/dev',
+    'js/dev': './src/client/js/dev',
   },
   resolve: {
     // TODO merge in webpack.common.js
@@ -36,7 +36,7 @@ module.exports = require('./webpack.common')({
           { loader: 'css-loader', options: { sourceMap: true } },
           { loader: 'sass-loader', options: { sourceMap: true } },
         ],
-        include: [helpers.root('resource/styles/scss')]
+        include: [helpers.root('src/client/styles/scss')]
       },
       { // Dump CSS for HackMD
         test: /\.scss$/,
@@ -46,7 +46,7 @@ module.exports = require('./webpack.common')({
             'sass-loader'
           ]
         }),
-        include: [helpers.root('resource/styles/hackmd')]
+        include: [helpers.root('src/client/styles/hackmd')]
       },
     ],
   },

+ 1 - 1
config/webpack.prod.js

@@ -40,7 +40,7 @@ module.exports = require('./webpack.common')({
             'sass-loader'
           ]
         }),
-        include: [helpers.root('resource/styles/scss'), helpers.root('resource/styles/hackmd')]
+        include: [helpers.root('src/client/styles/scss'), helpers.root('src/client/styles/hackmd')]
       }
     ]
   },

+ 1 - 1
resource/js/app.js → src/client/js/app.js

@@ -8,7 +8,7 @@ import io from 'socket.io-client';
 import i18nFactory from './i18n';
 
 import loggerFactory from '@alias/logger';
-import Xss from '../../lib/util/xss';
+import Xss from '@commons/util/xss';
 
 import Crowi from './util/Crowi';
 // import CrowiRenderer from './util/CrowiRenderer';

+ 0 - 0
resource/js/components/Admin/CustomCssEditor.js → src/client/js/components/Admin/CustomCssEditor.js


+ 0 - 0
resource/js/components/Admin/CustomHeaderEditor.js → src/client/js/components/Admin/CustomHeaderEditor.js


+ 0 - 0
resource/js/components/Admin/CustomScriptEditor.js → src/client/js/components/Admin/CustomScriptEditor.js


+ 0 - 0
resource/js/components/BookmarkButton.js → src/client/js/components/BookmarkButton.js


+ 0 - 0
resource/js/components/Common/UserDate.js → src/client/js/components/Common/UserDate.js


+ 0 - 0
resource/js/components/CopyButton.js → src/client/js/components/CopyButton.js


+ 0 - 0
resource/js/components/HeaderSearchBox.js → src/client/js/components/HeaderSearchBox.js


+ 0 - 0
resource/js/components/HeaderSearchBox/SearchForm.js → src/client/js/components/HeaderSearchBox/SearchForm.js


+ 0 - 0
resource/js/components/HeaderSearchBox/SearchSuggest.js → src/client/js/components/HeaderSearchBox/SearchSuggest.js


+ 0 - 0
resource/js/components/NewPageNameInput.js → src/client/js/components/NewPageNameInput.js


+ 0 - 0
resource/js/components/Page.js → src/client/js/components/Page.js


+ 0 - 0
resource/js/components/Page/PagePath.js → src/client/js/components/Page/PagePath.js


+ 0 - 0
resource/js/components/Page/RevisionBody.js → src/client/js/components/Page/RevisionBody.js


+ 0 - 0
resource/js/components/Page/RevisionPath.js → src/client/js/components/Page/RevisionPath.js


+ 0 - 0
resource/js/components/Page/RevisionUrl.js → src/client/js/components/Page/RevisionUrl.js


+ 0 - 0
resource/js/components/PageAttachment.js → src/client/js/components/PageAttachment.js


+ 0 - 0
resource/js/components/PageAttachment/Attachment.js → src/client/js/components/PageAttachment/Attachment.js


+ 0 - 0
resource/js/components/PageAttachment/DeleteAttachmentModal.js → src/client/js/components/PageAttachment/DeleteAttachmentModal.js


+ 0 - 0
resource/js/components/PageAttachment/PageAttachmentList.js → src/client/js/components/PageAttachment/PageAttachmentList.js


+ 0 - 0
resource/js/components/PageComment/Comment.js → src/client/js/components/PageComment/Comment.js


+ 0 - 0
resource/js/components/PageComment/CommentForm.js → src/client/js/components/PageComment/CommentForm.js


+ 0 - 0
resource/js/components/PageComment/CommentPreview.js → src/client/js/components/PageComment/CommentPreview.js


+ 0 - 0
resource/js/components/PageComment/DeleteCommentModal.js → src/client/js/components/PageComment/DeleteCommentModal.js


+ 0 - 0
resource/js/components/PageComments.js → src/client/js/components/PageComments.js


+ 0 - 0
resource/js/components/PageEditor.js → src/client/js/components/PageEditor.js


+ 0 - 0
resource/js/components/PageEditor/AbstractEditor.js → src/client/js/components/PageEditor/AbstractEditor.js


+ 3 - 3
resource/js/components/PageEditor/CodeMirrorEditor.js → src/client/js/components/PageEditor/CodeMirrorEditor.js

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
 
 import Modal from 'react-bootstrap/es/Modal';
 
-import AbstractEditor from './AbstractEditor';
+import InterceptorManager from '@commons/util/interceptor-manager';
 
 import urljoin from 'url-join';
 const loadScript = require('simple-load-script');
@@ -41,11 +41,11 @@ require('codemirror/addon/display/placeholder');
 require('codemirror/mode/gfm/gfm');
 require('../../util/codemirror/autorefresh.ext');
 
+import AbstractEditor from './AbstractEditor';
+
 import pasteHelper from './PasteHelper';
 import EmojiAutoCompleteHelper from './EmojiAutoCompleteHelper';
 
-import InterceptorManager from '../../../../lib/util/interceptor-manager';
-
 import PreventMarkdownListInterceptor from './PreventMarkdownListInterceptor';
 import MarkdownTableInterceptor from './MarkdownTableInterceptor';
 import mtu from './MarkdownTableUtil';

+ 0 - 0
resource/js/components/PageEditor/Editor.js → src/client/js/components/PageEditor/Editor.js


+ 0 - 0
resource/js/components/PageEditor/EmojiAutoCompleteHelper.js → src/client/js/components/PageEditor/EmojiAutoCompleteHelper.js


+ 0 - 0
resource/js/components/PageEditor/MarkdownListUtil.js → src/client/js/components/PageEditor/MarkdownListUtil.js


+ 0 - 0
resource/js/components/PageEditor/MarkdownTableInterceptor.js → src/client/js/components/PageEditor/MarkdownTableInterceptor.js


+ 0 - 0
resource/js/components/PageEditor/MarkdownTableUtil.js → src/client/js/components/PageEditor/MarkdownTableUtil.js


+ 0 - 0
resource/js/components/PageEditor/OptionsSelector.js → src/client/js/components/PageEditor/OptionsSelector.js


+ 0 - 0
resource/js/components/PageEditor/PasteHelper.js → src/client/js/components/PageEditor/PasteHelper.js


+ 0 - 0
resource/js/components/PageEditor/PreventMarkdownListInterceptor.js → src/client/js/components/PageEditor/PreventMarkdownListInterceptor.js


+ 0 - 0
resource/js/components/PageEditor/Preview.js → src/client/js/components/PageEditor/Preview.js


+ 0 - 0
resource/js/components/PageEditor/ScrollSyncHelper.js → src/client/js/components/PageEditor/ScrollSyncHelper.js


+ 2 - 2
resource/js/components/PageEditor/TextAreaEditor.js → src/client/js/components/PageEditor/TextAreaEditor.js

@@ -3,13 +3,13 @@ import React from 'react';
 
 import FormControl from 'react-bootstrap/es/FormControl';
 
+import InterceptorManager from '@commons/util/interceptor-manager';
+
 import AbstractEditor from './AbstractEditor';
 
 import pasteHelper from './PasteHelper';
 import mlu from './MarkdownListUtil';
 
-import InterceptorManager from '../../../../lib/util/interceptor-manager';
-
 import PreventMarkdownListInterceptor from './PreventMarkdownListInterceptor';
 
 export default class TextAreaEditor extends AbstractEditor {

+ 0 - 0
resource/js/components/PageEditorByHackmd.jsx → src/client/js/components/PageEditorByHackmd.jsx


+ 0 - 0
resource/js/components/PageEditorByHackmd/HackmdEditor.jsx → src/client/js/components/PageEditorByHackmd/HackmdEditor.jsx


+ 0 - 0
resource/js/components/PageHistory.js → src/client/js/components/PageHistory.js


+ 0 - 0
resource/js/components/PageHistory/PageRevisionList.js → src/client/js/components/PageHistory/PageRevisionList.js


+ 0 - 0
resource/js/components/PageHistory/Revision.js → src/client/js/components/PageHistory/Revision.js


+ 0 - 0
resource/js/components/PageHistory/RevisionDiff.js → src/client/js/components/PageHistory/RevisionDiff.js


+ 0 - 0
resource/js/components/PageList/ListView.js → src/client/js/components/PageList/ListView.js


+ 0 - 0
resource/js/components/PageList/Page.js → src/client/js/components/PageList/Page.js


+ 1 - 1
resource/js/components/PageList/PageListMeta.js → src/client/js/components/PageList/PageListMeta.js

@@ -14,7 +14,7 @@ export default class PageListMeta extends React.Component {
   render() {
     // TODO isPortal()
     const page = this.props.page;
-    const templateChecker = require('../../../../lib/util/templateChecker');
+    const templateChecker = require('@commons/util/templateChecker');
 
     // portal check
     let PortalLabel;

+ 0 - 0
resource/js/components/PageList/PagePath.js → src/client/js/components/PageList/PagePath.js


+ 0 - 0
resource/js/components/PageListSearch.js → src/client/js/components/PageListSearch.js


+ 0 - 0
resource/js/components/PageStatusAlert.jsx → src/client/js/components/PageStatusAlert.jsx


+ 0 - 0
resource/js/components/ReactUtils.js → src/client/js/components/ReactUtils.js


+ 0 - 0
resource/js/components/SavePageControls.jsx → src/client/js/components/SavePageControls.jsx


+ 0 - 0
resource/js/components/SavePageControls/GrantSelector.jsx → src/client/js/components/SavePageControls/GrantSelector.jsx


+ 0 - 0
resource/js/components/SearchPage.js → src/client/js/components/SearchPage.js


+ 0 - 0
resource/js/components/SearchPage/DeletePageListModal.js → src/client/js/components/SearchPage/DeletePageListModal.js


+ 0 - 0
resource/js/components/SearchPage/SearchForm.js → src/client/js/components/SearchPage/SearchForm.js


+ 0 - 0
resource/js/components/SearchPage/SearchResult.js → src/client/js/components/SearchPage/SearchResult.js


+ 0 - 0
resource/js/components/SearchPage/SearchResultList.js → src/client/js/components/SearchPage/SearchResultList.js


+ 0 - 0
resource/js/components/SearchTypeahead.js → src/client/js/components/SearchTypeahead.js


+ 0 - 0
resource/js/components/SeenUserList.js → src/client/js/components/SeenUserList.js


+ 0 - 0
resource/js/components/SeenUserList/UserList.js → src/client/js/components/SeenUserList/UserList.js


+ 0 - 0
resource/js/components/SlackNotification.jsx → src/client/js/components/SlackNotification.jsx


+ 0 - 0
resource/js/components/User/User.js → src/client/js/components/User/User.js


+ 0 - 0
resource/js/components/User/UserPicture.js → src/client/js/components/User/UserPicture.js


+ 0 - 0
resource/js/dev.js → src/client/js/dev.js


+ 1 - 1
resource/js/hackmd-agent.js → src/client/js/hackmd-agent.js

@@ -2,7 +2,7 @@
  * GROWI agent for HackMD
  *
  * This file will be transpiled as a single JS
- *  and should be load from HackMD head via 'lib/routes/hackmd.js' route
+ *  and should be load from HackMD head via 'routes/hackmd.js' route
  *
  * USAGE:
  *  <script src="${hostname of GROWI}/_hackmd/load-agent"></script>

+ 1 - 1
resource/js/hackmd-styles.js → src/client/js/hackmd-styles.js

@@ -2,7 +2,7 @@
  * GROWI styles loader for HackMD
  *
  * This file will be transpiled as a single JS
- *  and should be load from HackMD head via 'lib/routes/hackmd.js' route
+ *  and should be load from HackMD head via 'routes/hackmd.js' route
  *
  * USAGE:
  *  <script src="${hostname of GROWI}/_hackmd/load-styles"></script>

+ 0 - 0
resource/js/i18n.js → src/client/js/i18n.js


+ 0 - 0
resource/js/ie11-polyfill.js → src/client/js/ie11-polyfill.js


+ 0 - 0
resource/js/legacy/crowi-admin.js → src/client/js/legacy/crowi-admin.js


+ 0 - 0
resource/js/legacy/crowi-presentation.js → src/client/js/legacy/crowi-presentation.js


+ 4 - 4
resource/js/legacy/crowi.js → src/client/js/legacy/crowi.js

@@ -10,16 +10,16 @@ import ReactDOM from 'react-dom';
 
 import { debounce } from 'throttle-debounce';
 
-import GrowiRenderer from '../util/GrowiRenderer';
-import Page from '../components/Page';
-
+const pagePathUtil = require('@commons/util/pagePathUtil');
 const entities = require('entities');
 const escapeStringRegexp = require('escape-string-regexp');
 require('jquery.cookie');
 require('bootstrap-select');
 
+import GrowiRenderer from '../util/GrowiRenderer';
+import Page from '../components/Page';
+
 require('./thirdparty-js/agile-admin');
-const pagePathUtil = require('../../../lib/util/pagePathUtil');
 
 let Crowi = {};
 

+ 0 - 0
resource/js/legacy/thirdparty-js/agile-admin.js → src/client/js/legacy/thirdparty-js/agile-admin.js


+ 233 - 233
resource/js/legacy/thirdparty-js/jQuery.style.switcher.js → src/client/js/legacy/thirdparty-js/jQuery.style.switcher.js

@@ -1,233 +1,233 @@
-/**
-@author Cameron Manavian
-jQuery Style Switcher
-
-The MIT License (MIT)
-
-Copyright (c) 2014 Cameron Manavian
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-**/
-(function ($) {
-	var jStyleSwitcher,
-		_defaultOptions = {
-			hasPreview: true,
-			defaultThemeId: 'jssDefault',
-			fullPath: 'css/',
-			cookie: {
-				expires: 30,
-				isManagingLoad: true
-			}
-		},
-		// private
-		_cookieKey = 'jss_selected',
-		_docCookies = {};
-
-	/*\
-	|*|
-	|*|  :: cookies.js ::
-	|*|
-	|*|  A complete cookies reader/writer framework with full unicode support.
-	|*|
-	|*|  revision #1
-	|*|
-	|*|  https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
-	|*|
-	|*|  This framework is released under the GNU Public License, version 3 or later.
-	|*|  http://www.gnu.org/licenses/gpl-3.0-standalone.html
-	|*|
-	|*|  Syntaxes:
-	|*|
-	|*|  * docCookies.setItem(name, value[, end[, path[, domain[, secure]]]])
-	|*|  * docCookies.getItem(name)
-	|*|  * docCookies.removeItem(name[, path[, domain]])
-	|*|  * docCookies.hasItem(name)
-	|*|  * docCookies.keys()
-	|*|
-	\*/
-	_docCookies = {
-		getItem: function (sKey) {
-			if (!sKey) {
-				return null;
-			}
-			return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
-		},
-		setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
-			if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) {
-				return false;
-			}
-			var sExpires = "";
-			if (vEnd) {
-				switch (vEnd.constructor) {
-					case Number:
-						sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
-						break;
-					case String:
-						sExpires = "; expires=" + vEnd;
-						break;
-					case Date:
-						sExpires = "; expires=" + vEnd.toUTCString();
-						break;
-				}
-			}
-			document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
-			return true;
-		},
-		removeItem: function (sKey, sPath, sDomain) {
-			if (!this.hasItem(sKey)) {
-				return false;
-			}
-			document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
-			return true;
-		},
-		hasItem: function (sKey) {
-			if (!sKey) {
-				return false;
-			}
-			return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
-		},
-		keys: function () {
-			var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/);
-			for (var nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) {
-				aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]);
-			}
-			return aKeys;
-		}
-	};
-
-	jStyleSwitcher = function ($root, config) {
-		return this.init($root, config);
-	};
-
-	jStyleSwitcher.prototype = {
-
-		/**
-		 * {Object} DOM reference to style option list
-		 */
-		$root: null,
-
-		/**
-		 * {Object} configs for the style switcher
-		 */
-		config: {},
-
-		/**
-		 * {Object} jQuery reference to <link> tag for swapping CSS
-		 */
-		$themeCss: null,
-
-		/**
-		 * {String} default theme page was loaded with
-		 */
-		defaultTheme: null,
-
-		init: function ($root, config) {
-			this.$root = $root;
-			this.config = config ? config : {};
-			this.setDefaultTheme();
-			if(this.defaultTheme) {
-				// try cookies
-				if (this.config.cookie) {
-					this.checkCookie();
-				}
-				// try hover
-				if (this.config.hasPreview) {
-					this.addHoverEvents();
-				}
-				// finally, add click events
-				this.addClickEvents();
-			} else {
-				this.$root.addClass('jssError error level0');
-			}
-		},
-
-		setDefaultTheme: function () {
-			this.$themeCss = $('link[id=' + this.config.defaultThemeId + ']');
-			if(this.$themeCss.length) {
-				this.defaultTheme = this.$themeCss.attr('href');
-			}
-		},
-
-		resetStyle: function() {
-			this.updateStyle(this.defaultTheme);
-		},
-
-		updateStyle: function(newStyle) {
-			this.$themeCss.attr('href', newStyle);
-		},
-
-		getFullAssetPath: function(asset) {
-			return this.config.fullPath + asset;
-		},
-
-		checkCookie: function () {
-			var styleCookie;
-			// if using cookies and using JavaScript to load css
-			if (this.config.cookie && this.config.cookie.isManagingLoad) {
-				// check if css is set in cookie
-				styleCookie = _docCookies.getItem(_cookieKey);
-				if (styleCookie) {
-					newStyle = this.getFullAssetPath(styleCookie);
-					// update link tag
-					this.updateStyle(newStyle);
-					// update default ref
-					this.defaultTheme = newStyle;
-				}
-			}
-		},
-
-		addHoverEvents: function () {
-			var self = this;
-			this.$root.find('a').hover(
-				function () {
-					var asset = $(this).data('theme'),
-						newStyle = self.getFullAssetPath(asset);
-					// update link tag
-					self.updateStyle(newStyle);
-				},
-				function () {
-					// reset link tag
-					self.resetStyle();
-				}
-			);
-		},
-
-		addClickEvents: function () {
-			var self = this;
-			this.$root.find('a').click(
-				function () {
-					var asset = $(this).data('theme'),
-            newStyle = self.getFullAssetPath(asset);
-					// update link tag
-					self.updateStyle(newStyle);
-					// update default ref
-					self.defaultTheme = newStyle;
-					// try to store cookie
-					if (self.config.cookie) {
-						_docCookies.setItem(_cookieKey, asset, self.config.cookie.expires, '/');
-					}
-				}
-			);
-		}
-	};
-
-	$.fn.styleSwitcher = function (options) {
-		return new jStyleSwitcher(this, $.extend(true, _defaultOptions, options));
-	};
-})(jQuery);
+/**
+@author Cameron Manavian
+jQuery Style Switcher
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Cameron Manavian
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+**/
+(function ($) {
+	var jStyleSwitcher,
+		_defaultOptions = {
+			hasPreview: true,
+			defaultThemeId: 'jssDefault',
+			fullPath: 'css/',
+			cookie: {
+				expires: 30,
+				isManagingLoad: true
+			}
+		},
+		// private
+		_cookieKey = 'jss_selected',
+		_docCookies = {};
+
+	/*\
+	|*|
+	|*|  :: cookies.js ::
+	|*|
+	|*|  A complete cookies reader/writer framework with full unicode support.
+	|*|
+	|*|  revision #1
+	|*|
+	|*|  https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
+	|*|
+	|*|  This framework is released under the GNU Public License, version 3 or later.
+	|*|  http://www.gnu.org/licenses/gpl-3.0-standalone.html
+	|*|
+	|*|  Syntaxes:
+	|*|
+	|*|  * docCookies.setItem(name, value[, end[, path[, domain[, secure]]]])
+	|*|  * docCookies.getItem(name)
+	|*|  * docCookies.removeItem(name[, path[, domain]])
+	|*|  * docCookies.hasItem(name)
+	|*|  * docCookies.keys()
+	|*|
+	\*/
+	_docCookies = {
+		getItem: function (sKey) {
+			if (!sKey) {
+				return null;
+			}
+			return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
+		},
+		setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
+			if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) {
+				return false;
+			}
+			var sExpires = "";
+			if (vEnd) {
+				switch (vEnd.constructor) {
+					case Number:
+						sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
+						break;
+					case String:
+						sExpires = "; expires=" + vEnd;
+						break;
+					case Date:
+						sExpires = "; expires=" + vEnd.toUTCString();
+						break;
+				}
+			}
+			document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
+			return true;
+		},
+		removeItem: function (sKey, sPath, sDomain) {
+			if (!this.hasItem(sKey)) {
+				return false;
+			}
+			document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
+			return true;
+		},
+		hasItem: function (sKey) {
+			if (!sKey) {
+				return false;
+			}
+			return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
+		},
+		keys: function () {
+			var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/);
+			for (var nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) {
+				aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]);
+			}
+			return aKeys;
+		}
+	};
+
+	jStyleSwitcher = function ($root, config) {
+		return this.init($root, config);
+	};
+
+	jStyleSwitcher.prototype = {
+
+		/**
+		 * {Object} DOM reference to style option list
+		 */
+		$root: null,
+
+		/**
+		 * {Object} configs for the style switcher
+		 */
+		config: {},
+
+		/**
+		 * {Object} jQuery reference to <link> tag for swapping CSS
+		 */
+		$themeCss: null,
+
+		/**
+		 * {String} default theme page was loaded with
+		 */
+		defaultTheme: null,
+
+		init: function ($root, config) {
+			this.$root = $root;
+			this.config = config ? config : {};
+			this.setDefaultTheme();
+			if(this.defaultTheme) {
+				// try cookies
+				if (this.config.cookie) {
+					this.checkCookie();
+				}
+				// try hover
+				if (this.config.hasPreview) {
+					this.addHoverEvents();
+				}
+				// finally, add click events
+				this.addClickEvents();
+			} else {
+				this.$root.addClass('jssError error level0');
+			}
+		},
+
+		setDefaultTheme: function () {
+			this.$themeCss = $('link[id=' + this.config.defaultThemeId + ']');
+			if(this.$themeCss.length) {
+				this.defaultTheme = this.$themeCss.attr('href');
+			}
+		},
+
+		resetStyle: function() {
+			this.updateStyle(this.defaultTheme);
+		},
+
+		updateStyle: function(newStyle) {
+			this.$themeCss.attr('href', newStyle);
+		},
+
+		getFullAssetPath: function(asset) {
+			return this.config.fullPath + asset;
+		},
+
+		checkCookie: function () {
+			var styleCookie;
+			// if using cookies and using JavaScript to load css
+			if (this.config.cookie && this.config.cookie.isManagingLoad) {
+				// check if css is set in cookie
+				styleCookie = _docCookies.getItem(_cookieKey);
+				if (styleCookie) {
+					newStyle = this.getFullAssetPath(styleCookie);
+					// update link tag
+					this.updateStyle(newStyle);
+					// update default ref
+					this.defaultTheme = newStyle;
+				}
+			}
+		},
+
+		addHoverEvents: function () {
+			var self = this;
+			this.$root.find('a').hover(
+				function () {
+					var asset = $(this).data('theme'),
+						newStyle = self.getFullAssetPath(asset);
+					// update link tag
+					self.updateStyle(newStyle);
+				},
+				function () {
+					// reset link tag
+					self.resetStyle();
+				}
+			);
+		},
+
+		addClickEvents: function () {
+			var self = this;
+			this.$root.find('a').click(
+				function () {
+					var asset = $(this).data('theme'),
+            newStyle = self.getFullAssetPath(asset);
+					// update link tag
+					self.updateStyle(newStyle);
+					// update default ref
+					self.defaultTheme = newStyle;
+					// try to store cookie
+					if (self.config.cookie) {
+						_docCookies.setItem(_cookieKey, asset, self.config.cookie.expires, '/');
+					}
+				}
+			);
+		}
+	};
+
+	$.fn.styleSwitcher = function (options) {
+		return new jStyleSwitcher(this, $.extend(true, _defaultOptions, options));
+	};
+})(jQuery);

+ 0 - 0
resource/js/legacy/thirdparty-js/switchery/switchery.css → src/client/js/legacy/thirdparty-js/switchery/switchery.css


+ 0 - 0
resource/js/legacy/thirdparty-js/switchery/switchery.js → src/client/js/legacy/thirdparty-js/switchery/switchery.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
src/client/js/legacy/thirdparty-js/waves.js


+ 1 - 1
resource/js/plugin.js → src/client/js/plugin.js

@@ -12,7 +12,7 @@ export default class CrowiPlugin {
     // import plugin definitions
     let definitions = [];
     try {
-      definitions = require('../../tmp/plugins/plugin-definitions');
+      definitions = require('@tmp/plugins/plugin-definitions');
     }
     catch (e) {
       // TODO show warning

+ 3 - 2
resource/js/util/Crowi.js → src/client/js/util/Crowi.js

@@ -4,8 +4,9 @@
 
 import axios from 'axios';
 
+import InterceptorManager from '@commons/util/interceptor-manager';
+
 import emojiStrategy from './emojione/emoji_strategy_shrinked.json';
-import InterceptorManager from '../../../lib/util/interceptor-manager';
 
 import {
   DetachCodeBlockInterceptor,
@@ -51,7 +52,7 @@ export default class Crowi {
   }
 
   /**
-   * @return {Object} window.Crowi (/resource/js/crowi.js)
+   * @return {Object} window.Crowi (js/legacy/crowi.js)
    */
   getCrowiForJquery() {
     return window.Crowi;

+ 0 - 0
resource/js/util/GrowiRenderer.js → src/client/js/util/GrowiRenderer.js


+ 0 - 0
resource/js/util/PostProcessor/CrowiTemplate.js → src/client/js/util/PostProcessor/CrowiTemplate.js


+ 0 - 0
resource/js/util/PreProcessor/CsvToTable.js → src/client/js/util/PreProcessor/CsvToTable.js


+ 0 - 0
resource/js/util/PreProcessor/Linker.js → src/client/js/util/PreProcessor/Linker.js


+ 2 - 2
resource/js/util/PreProcessor/XssFilter.js → src/client/js/util/PreProcessor/XssFilter.js

@@ -1,5 +1,5 @@
-import Xss from '../../../../lib/util/xss';
-import xssOption from '../../../../lib/util/xssOption';
+import Xss from '@commons/util/xss';
+import xssOption from '@commons/util/xssOption';
 
 export default class XssFilter {
 

+ 0 - 0
resource/js/util/codemirror/autorefresh.ext.js → src/client/js/util/codemirror/autorefresh.ext.js


+ 0 - 0
resource/js/util/emojione/emoji_strategy_shrinked.json → src/client/js/util/emojione/emoji_strategy_shrinked.json


+ 0 - 0
resource/js/util/interceptor/detach-code-blocks.js → src/client/js/util/interceptor/detach-code-blocks.js


+ 0 - 0
resource/js/util/markdown-it/blockdiag.js → src/client/js/util/markdown-it/blockdiag.js


+ 0 - 0
resource/js/util/markdown-it/emoji.js → src/client/js/util/markdown-it/emoji.js


+ 0 - 0
resource/js/util/markdown-it/footernote.js → src/client/js/util/markdown-it/footernote.js


+ 0 - 0
resource/js/util/markdown-it/header-line-number.js → src/client/js/util/markdown-it/header-line-number.js


+ 0 - 0
resource/js/util/markdown-it/header.js → src/client/js/util/markdown-it/header.js


+ 0 - 0
resource/js/util/markdown-it/mathjax.js → src/client/js/util/markdown-it/mathjax.js


+ 0 - 0
resource/js/util/markdown-it/plantuml.js → src/client/js/util/markdown-it/plantuml.js


+ 0 - 0
resource/js/util/markdown-it/table.js → src/client/js/util/markdown-it/table.js


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно