Skip to content

Commit

Permalink
fixed ACE html mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Frank Hoffmann authored and Dr. Frank Hoffmann committed Jul 13, 2018
1 parent 3547292 commit ac7464e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/zmi/styles/resources/zmi_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,9 @@ function show_ace_editor() {
$("textarea#content").hide();
editor = ace.edit("editor");
var value = $("textarea#content").val();
var content_type = $("input#contenttype").val();
if ( $("textarea#content").attr('data-contenttype') ) {
var content_type = $("textarea#content").attr('data-contenttype');
} else {
var content_type = $("input#contenttype").val();
content_type = $("textarea#content").attr('data-contenttype');
}
if (typeof content_type === "undefined" || ! content_type || content_type === 'text/x-unknown-content-type') {
var absolute_url = $("span#absolute_url").text();
Expand All @@ -221,8 +220,8 @@ function show_ace_editor() {
if ( 0 === value.indexOf("#!/usr/bin/python") || 0 === value.indexOf("## Script (Python)") ) {
content_type = "python";
}
var mode = "text";
if (content_type == "text/html") {
var mode = "html";
if (content_type == "html" || content_type == "text/html") {
mode = "html";
}
else if (content_type == "text/css" || content_type == "application/css" || content_type == "application/x-css") {
Expand Down

0 comments on commit ac7464e

Please sign in to comment.