diff --git a/src/main/scala/gitbucket/core/view/helpers.scala b/src/main/scala/gitbucket/core/view/helpers.scala index 848981a..696782d 100644 --- a/src/main/scala/gitbucket/core/view/helpers.scala +++ b/src/main/scala/gitbucket/core/view/helpers.scala @@ -316,44 +316,6 @@ */ def isPast(date: Date): Boolean = System.currentTimeMillis > date.getTime - /** - * Returns file type for AceEditor. - */ - def editorType(fileName: String): String = { - fileName.toLowerCase match { - case x if (x.endsWith(".bat")) => "batchfile" - case x if (x.endsWith(".java")) => "java" - case x if (x.endsWith(".scala")) => "scala" - case x if (x.endsWith(".js")) => "javascript" - case x if (x.endsWith(".css")) => "css" - case x if (x.endsWith(".md")) => "markdown" - case x if (x.endsWith(".html")) => "html" - case x if (x.endsWith(".xml")) => "xml" - case x if (x.endsWith(".c")) => "c_cpp" - case x if (x.endsWith(".cpp")) => "c_cpp" - case x if (x.endsWith(".coffee")) => "coffee" - case x if (x.endsWith(".ejs")) => "ejs" - case x if (x.endsWith(".hs")) => "haskell" - case x if (x.endsWith(".json")) => "json" - case x if (x.endsWith(".jsp")) => "jsp" - case x if (x.endsWith(".jsx")) => "jsx" - case x if (x.endsWith(".cl")) => "lisp" - case x if (x.endsWith(".clojure")) => "lisp" - case x if (x.endsWith(".lua")) => "lua" - case x if (x.endsWith(".php")) => "php" - case x if (x.endsWith(".py")) => "python" - case x if (x.endsWith(".rdoc")) => "rdoc" - case x if (x.endsWith(".rhtml")) => "rhtml" - case x if (x.endsWith(".ruby")) => "ruby" - case x if (x.endsWith(".sh")) => "sh" - case x if (x.endsWith(".sql")) => "sql" - case x if (x.endsWith(".tcl")) => "tcl" - case x if (x.endsWith(".vbs")) => "vbscript" - case x if (x.endsWith(".yml")) => "yaml" - case _ => "plain_text" - } - } - def pre(value: Html): Html = Html(s"
${value.body.trim.split("\n").map(_.trim).mkString("\n")}") /** diff --git a/src/main/twirl/gitbucket/core/repo/editor.scala.html b/src/main/twirl/gitbucket/core/repo/editor.scala.html index 9b984fe..7e262e0 100644 --- a/src/main/twirl/gitbucket/core/repo/editor.scala.html +++ b/src/main/twirl/gitbucket/core/repo/editor.scala.html @@ -75,6 +75,7 @@ } } +