loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'Remove EasyMDE from various areas' (#2916) from 0ko/forgejo:easymde into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2916
Reviewed-by: Gusted <gusted@noreply.codeberg.org>

0ko 67d6c674 b05a7809

+31 -1
+1
templates/repo/release/new.tmpl
··· 57 57 "TextareaPlaceholder" (ctx.Locale.Tr "repo.release.message") 58 58 "TextareaAriaLabel" (ctx.Locale.Tr "repo.release.message") 59 59 "DropzoneParentContainer" "form" 60 + "EasyMDE" true 60 61 )}} 61 62 </div> 62 63 {{range .attachments}}
+1
templates/repo/wiki/new.tmpl
··· 29 29 "TextareaPlaceholder" (ctx.Locale.Tr "repo.wiki.page_content") 30 30 "TextareaAriaLabel" (ctx.Locale.Tr "repo.wiki.page_content") 31 31 "TextareaContent" $content 32 + "EasyMDE" true 32 33 )}} 33 34 34 35 <div class="field tw-mt-4">
+4 -1
templates/shared/combomarkdowneditor.tmpl
··· 10 10 * TextareaAriaLabel: aria-label attribute for the textarea 11 11 * DropzoneParentContainer: container for file upload (leave it empty if no upload) 12 12 * DisableAutosize: whether to disable automatic height resizing 13 + * EasyMDE: whether to display button for switching to legacy editor 13 14 */}} 14 15 <div {{if .ContainerId}}id="{{.ContainerId}}"{{end}} class="combo-markdown-editor {{.ContainerClasses}}" data-dropzone-parent-container="{{.DropzoneParentContainer}}"> 15 16 {{if .MarkdownPreviewUrl}} ··· 41 42 </div> 42 43 <div class="markdown-toolbar-group"> 43 44 <button class="markdown-toolbar-button markdown-switch-monospace" role="switch" data-enable-text="{{ctx.Locale.Tr "editor.buttons.enable_monospace_font"}}" data-disable-text="{{ctx.Locale.Tr "editor.buttons.disable_monospace_font"}}">{{svg "octicon-typography"}}</button> 44 - <button class="markdown-toolbar-button markdown-switch-easymde" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.switch_to_legacy.tooltip"}}">{{svg "octicon-arrow-switch"}}</button> 45 + {{if .EasyMDE}} 46 + <button class="markdown-toolbar-button markdown-switch-easymde" data-tooltip-content="{{ctx.Locale.Tr "editor.buttons.switch_to_legacy.tooltip"}}">{{svg "octicon-arrow-switch"}}</button> 47 + {{end}} 45 48 </div> 46 49 </markdown-toolbar> 47 50 <text-expander keys=": @" suffix="">
+25
tests/integration/easymde_test.go
··· 1 + // Copyright 2024 The Forgejo Authors. All rights reserved. 2 + // SPDX-License-Identifier: MIT 3 + 4 + package integration 5 + 6 + import ( 7 + "net/http" 8 + "testing" 9 + ) 10 + 11 + func TestEasyMDESwitch(t *testing.T) { 12 + session := loginUser(t, "user2") 13 + testEasyMDESwitch(t, session, "user2/glob/issues/1", false) 14 + testEasyMDESwitch(t, session, "user2/glob/issues/new", false) 15 + testEasyMDESwitch(t, session, "user2/glob/wiki?action=_new", true) 16 + testEasyMDESwitch(t, session, "user2/glob/releases/new", true) 17 + } 18 + 19 + func testEasyMDESwitch(t *testing.T, session *TestSession, url string, expected bool) { 20 + t.Helper() 21 + req := NewRequest(t, "GET", url) 22 + resp := session.MakeRequest(t, req, http.StatusOK) 23 + doc := NewHTMLParser(t, resp.Body) 24 + doc.AssertElement(t, ".combo-markdown-editor button.markdown-switch-easymde", expected) 25 + }