mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Wiki: UI for page new
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
"files": {
|
||||
"\/css\/dropzone-4.2.0.css": {
|
||||
"fileType": 16,
|
||||
"ignore": 0,
|
||||
"ignoreWasSetByUser": 0,
|
||||
"ignore": 1,
|
||||
"ignoreWasSetByUser": 1,
|
||||
"inputAbbreviatedPath": "\/css\/dropzone-4.2.0.css",
|
||||
"outputAbbreviatedPath": "No Output Path",
|
||||
"outputPathIsOutsideProject": 0,
|
||||
@@ -92,6 +92,15 @@
|
||||
"outputPathIsOutsideProject": 0,
|
||||
"outputPathIsSetByUser": 0
|
||||
},
|
||||
"\/css\/simplemde-1.8.1.min.css": {
|
||||
"fileType": 16,
|
||||
"ignore": 1,
|
||||
"ignoreWasSetByUser": 1,
|
||||
"inputAbbreviatedPath": "\/css\/simplemde-1.8.1.min.css",
|
||||
"outputAbbreviatedPath": "No Output Path",
|
||||
"outputPathIsOutsideProject": 0,
|
||||
"outputPathIsSetByUser": 0
|
||||
},
|
||||
"\/css\/themes\/default\/assets\/images\/flags.png": {
|
||||
"fileType": 32768,
|
||||
"ignore": 0,
|
||||
|
@@ -1758,6 +1758,11 @@ footer .container .links > *:first-child {
|
||||
line-height: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.repository .navbar .ui.label {
|
||||
margin-top: -2px;
|
||||
margin-left: 7px;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
.repository .owner.dropdown {
|
||||
min-width: 40% !important;
|
||||
}
|
||||
@@ -2513,6 +2518,19 @@ footer .container .links > *:first-child {
|
||||
.repository.forks .list .item .link {
|
||||
padding-top: 5px;
|
||||
}
|
||||
.repository.wiki.start .ui.segment {
|
||||
padding-top: 70px;
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
.repository.wiki.start .ui.segment .mega-octicon {
|
||||
font-size: 48px;
|
||||
}
|
||||
.repository.wiki.new .CodeMirror .CodeMirror-code .cm-comment {
|
||||
background: inherit;
|
||||
}
|
||||
.repository.wiki.new .editor-preview {
|
||||
background-color: white;
|
||||
}
|
||||
.repository.settings.collaboration .collaborator.list {
|
||||
padding: 0;
|
||||
}
|
||||
|
7
public/css/simplemde-1.8.1.min.css
vendored
Executable file
7
public/css/simplemde-1.8.1.min.css
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -445,6 +445,53 @@ function initRepository() {
|
||||
}
|
||||
}
|
||||
|
||||
function initWiki() {
|
||||
if ($('.repository.wiki').length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ($('.repository.wiki.new').length > 0) {
|
||||
var $edit_area = $('#edit-area');
|
||||
var simplemde = new SimpleMDE({
|
||||
autoDownloadFontAwesome: false,
|
||||
element: $edit_area[0],
|
||||
previewRender: function (plainText, preview) { // Async method
|
||||
setTimeout(function () {
|
||||
if ($('.editor-preview-active').length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.post($edit_area.data('url'), {
|
||||
"_csrf": csrf,
|
||||
"mode": "gfm",
|
||||
"context": $edit_area.data('context'),
|
||||
"text": plainText
|
||||
},
|
||||
function (data) {
|
||||
preview.innerHTML = '<div class="markdown">' + data + '</div>';
|
||||
emojify.run($('.editor-preview')[0]);
|
||||
}
|
||||
);
|
||||
}, 0);
|
||||
|
||||
return "Loading...";
|
||||
},
|
||||
renderingConfig: {
|
||||
singleLineBreaks: false
|
||||
},
|
||||
spellChecker: false,
|
||||
tabSize: 4,
|
||||
toolbar: ["bold", "italic", "strikethrough", "|",
|
||||
"heading", "heading-1", "heading-2", "heading-3", "|",
|
||||
"code", "quote", "|",
|
||||
"unordered-list", "ordered-list", "|",
|
||||
"link", "image", "horizontal-rule", "|",
|
||||
"preview", "fullscreen"]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function initOrganization() {
|
||||
if ($('.organization').length == 0) {
|
||||
return;
|
||||
@@ -835,6 +882,7 @@ $(document).ready(function () {
|
||||
initCommentForm();
|
||||
initInstall();
|
||||
initRepository();
|
||||
initWiki();
|
||||
initOrganization();
|
||||
initUser();
|
||||
initWebhook();
|
||||
|
14
public/js/libs/simplemde-1.8.1.min.js
vendored
Executable file
14
public/js/libs/simplemde-1.8.1.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -32,6 +32,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
.navbar {
|
||||
.ui.label {
|
||||
margin-top: -2px;
|
||||
margin-left: 7px;
|
||||
padding: 3px 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.owner.dropdown {
|
||||
min-width: 40% !important;
|
||||
}
|
||||
@@ -939,6 +947,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
&.wiki {
|
||||
&.start {
|
||||
.ui.segment {
|
||||
padding-top: 70px;
|
||||
padding-bottom: 100px;
|
||||
|
||||
.mega-octicon {
|
||||
font-size: 48px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.new {
|
||||
.CodeMirror {
|
||||
.CodeMirror-code .cm-comment {
|
||||
background: inherit;
|
||||
}
|
||||
}
|
||||
|
||||
.editor-preview {
|
||||
background-color: white;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.settings {
|
||||
&.collaboration {
|
||||
.collaborator.list {
|
||||
|
Reference in New Issue
Block a user