w.write("\n<meta http-equiv=\"Content-Language\" content=\"" + locale + "\" />");
}
}
public void writeEditTag() throws IOException {
Path linkListPath = new Path(adminRelPath, "tinymce_linklist.jsp");
Locale locale = WebUtils.getPageLocale(pageContext);
ResourceBundle bundle = ResourceBundle.getBundle("org/meshcms/webui/Locales", locale);
String langCode = bundle.getString("TinyMCELangCode");
if (Utils.isNullOrEmpty(langCode)) {
langCode = locale.getLanguage();
}
Writer w = getOut();
w.write(getHeadContent());
Path tinyMCEPath =
webSite.getFile(webSite.getCMSPath().add("tiny_mce")).exists()
? webSite.getCMSPath() : webSite.getAdminScriptsPath();
w.write("\n<script type='text/javascript' src='" +
webSite.getLink(tinyMCEPath, pageDirPath) +
"/tiny_mce/tiny_mce.js'></script>\n");
w.write("<script type='text/javascript'>\n");
w.write("// <![CDATA[\n");
w.write(" var contextPath = \"" + request.getContextPath() + "\";\n");
w.write(" var adminPath = \"" + webSite.getAdminPath() + "\";\n");
w.write(" var languageCode = \"" + langCode + "\";\n");
w.write(" var linkListPath = \"" + linkListPath + "\";\n");
w.write(" var cssPath = \"" + WebUtils.getThemeCSSPath(request, pageDirPath) + "\";\n");
w.write("// ]]>\n");
w.write("</script>\n");
Path p = webSite.getLink(webSite.getAdminScriptsPath(), pageDirPath);
w.write("<script type='text/javascript' src='" +
p.add("/jquery/jquery.min.js") + "'></script>\n");
w.write("<script type='text/javascript' src='" +
p.add("/editor.js") + "'></script>\n");
Path tinyMCEInitPath =
webSite.getFile(webSite.getCMSPath().add("tinymce_init.js")).exists()
? webSite.getCMSPath() : webSite.getAdminScriptsPath();
w.write("<script type='text/javascript' src='" +
webSite.getLink(tinyMCEInitPath, pageDirPath).add("tinymce_init.js") + "'></script>");
}