diff --git a/src/main/twirl/gitbucket/core/helper/attached.scala.html b/src/main/twirl/gitbucket/core/helper/attached.scala.html index 789d3d1..d430a7b 100644 --- a/src/main/twirl/gitbucket/core/helper/attached.scala.html +++ b/src/main/twirl/gitbucket/core/helper/attached.scala.html @@ -1,10 +1,11 @@ -@(owner: String, repository: String)(textarea: Html)(implicit context: gitbucket.core.controller.Context) +@(owner: String, repository: String, generateScript: Boolean = true)(textarea: Html)(implicit context: gitbucket.core.controller.Context) @import context._ @import gitbucket.core.util.FileUtil
@textarea
Attach images or documents by dragging & dropping, or selecting them.
+@if(generateScript){ @defining("(id=\")([\\w\\-]*)(\")".r.findFirstMatchIn(textarea.body).map(_.group(2))){ textareaId => } +} \ No newline at end of file diff --git a/src/main/twirl/gitbucket/core/helper/preview.scala.html b/src/main/twirl/gitbucket/core/helper/preview.scala.html index bec5c02..5618b1f 100644 --- a/src/main/twirl/gitbucket/core/helper/preview.scala.html +++ b/src/main/twirl/gitbucket/core/helper/preview.scala.html @@ -28,11 +28,7 @@ @if(style.nonEmpty){ style="@style"} @if(styleClass.nonEmpty){ class="@styleClass" }>@content } - @if(enableWikiLink){ - @textarea - } else { - @helper.html.attached(repository.owner, repository.name)(textarea) - } + @helper.html.attached(repository.owner, repository.name, enableWikiLink)(textarea)
diff --git a/src/main/twirl/gitbucket/core/wiki/edit.scala.html b/src/main/twirl/gitbucket/core/wiki/edit.scala.html index de7720b..e7466b1 100644 --- a/src/main/twirl/gitbucket/core/wiki/edit.scala.html +++ b/src/main/twirl/gitbucket/core/wiki/edit.scala.html @@ -30,7 +30,6 @@ placeholder = "", uid = 1 ) -
Attach images or documents by dragging & dropping, or selecting them.