Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from SimpleMDE to EasyMDE #13333

Merged
merged 9 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"add-asset-webpack-plugin": "1.0.0",
"babel-loader": "8.1.0",
"clipboard": "2.0.6",
"codemirror": "5.58.2",
zeripath marked this conversation as resolved.
Show resolved Hide resolved
"core-js": "3.6.5",
"css-loader": "5.0.0",
"css-minimizer-webpack-plugin": "1.1.5",
"dropzone": "5.7.2",
"easymde": "2.12.1",
"escape-goat": "3.0.0",
"fast-glob": "3.2.4",
"file-loader": "6.1.1",
Expand Down
21 changes: 0 additions & 21 deletions public/vendor/plugins/simplemde/LICENSE

This file was deleted.

7 changes: 0 additions & 7 deletions public/vendor/plugins/simplemde/simplemde.min.css

This file was deleted.

14 changes: 0 additions & 14 deletions public/vendor/plugins/simplemde/simplemde.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion templates/base/footer.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

{{template "base/footer_content" .}}
{{if .RequireSimpleMDE}}
<script src="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.js"></script>
<script src="{{StaticUrlPrefix}}/js/easymde.js?v={{MD5 AppVer}}"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/addon/mode/loadmode.js"></script>
<script src="{{StaticUrlPrefix}}/vendor/plugins/codemirror/mode/meta.js"></script>
zeripath marked this conversation as resolved.
Show resolved Hide resolved
<script>
Expand Down
2 changes: 1 addition & 1 deletion templates/base/head.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<link rel="mask-icon" href="{{StaticUrlPrefix}}/img/gitea-safari.svg" color="#609926">
<link rel="fluid-icon" href="{{StaticUrlPrefix}}/img/gitea-lg.png" title="{{AppName}}">
{{if .RequireSimpleMDE}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/vendor/plugins/simplemde/simplemde.min.css">
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/easymde.css?v={{MD5 AppVer}}">
{{end}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/index.css?v={{MD5 AppVer}}">
<noscript>
Expand Down
8 changes: 8 additions & 0 deletions web_src/js/easymde.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import EasyMDE from 'easymde';

import CodeMirror from 'codemirror/lib/codemirror.js';

window.EasyMDE = EasyMDE;
window.SimpleMDE = EasyMDE;
window.CodeMirror = CodeMirror;

2 changes: 1 addition & 1 deletion web_src/less/_editor.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
opacity: 1 !important;
}

.editor-toolbar a:not(:hover) {
.editor-toolbar button:not(:hover) {
background-color: transparent !important;
}

Expand Down
6 changes: 3 additions & 3 deletions web_src/less/themes/theme-arc-green.less
Original file line number Diff line number Diff line change
Expand Up @@ -1818,12 +1818,12 @@ a.ui.labels .label:hover {
border-right-color: #404552 !important;
}

.editor-toolbar a {
.editor-toolbar button {
color: #87ab63 !important;
}

.editor-toolbar a.active,
.editor-toolbar a:hover {
.editor-toolbar button.active,
.editor-toolbar button:hover {
background: #2a2e3a;
border-color: transparent;
}
Expand Down
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ module.exports = {
'eventsource.sharedworker': [
resolve(__dirname, 'web_src/js/features/eventsource.sharedworker.js'),
],
'easymde': [
resolve(__dirname, 'web_src/js/easymde.js'),
resolve(__dirname, 'node_modules/easymde/dist/easymde.min.css'),
],
...themes,
},
devtool: false,
Expand Down