Skip to content

Commit

Permalink
不再支持阅读模式的渲染
Browse files Browse the repository at this point in the history
  • Loading branch information
akof1314 committed Sep 2, 2018
1 parent ce92361 commit 4fcb151
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 46 deletions.
62 changes: 31 additions & 31 deletions Editor.md/plugins/options-dialog/options-dialog.js
Expand Up @@ -11,7 +11,7 @@
dialog : {
options : {
title : "选项",
readTitle : "阅读",
readTitle : "阅读 (不再支持)",
editTitle : "编辑",
markdownStyle : "渲染风格",
selectStyle : ["Editor.md 风格", "为知风格"],
Expand Down Expand Up @@ -47,11 +47,11 @@

var dialogContent = [
"<div class=\"editormd-form\" style=\"padding: 13px 0;height: 352px;overflow: hidden;overflow-y: auto;\">",
"<h4 style=\"margin: 0 0px 10px;\">" + dialogLang.readTitle + "</h4>",
"<label style=\"width:94px;\">" + dialogLang.markdownStyle + "</label>",
"<div class=\"fa-btns\" id=\"read-preview-area-markdown-style\"></div><br/>",
"<label style=\"width:94px;\">" + dialogLang.readTheme + "</label>",
"<select id=\"read-preview-area-theme-select\"style=\"width:245px;margin:3px 0 0 0;\"></select><br/>",
// "<h4 style=\"margin: 0 0px 10px;\">" + dialogLang.readTitle + "</h4>",
// "<label style=\"width:94px;\">" + dialogLang.markdownStyle + "</label>",
// "<div class=\"fa-btns\" id=\"read-preview-area-markdown-style\"></div><br/>",
// "<label style=\"width:94px;\">" + dialogLang.readTheme + "</label>",
// "<select id=\"read-preview-area-theme-select\"style=\"width:245px;margin:3px 0 0 0;\"></select><br/>",
"<h4 style=\"margin: 0 0px 10px;\">" + dialogLang.featuresOnOff + "</h4>",
"<label style=\"width:94px;\">" + dialogLang.keymapModes + "</label>",
"<select id=\"edit-toolbar-area-keymapmodes-select\"style=\"width:245px;margin:3px 0 0 0;\"></select><br/>",
Expand Down Expand Up @@ -95,8 +95,8 @@
buttons : {
enter : [lang.buttons.enter, function() {
var optionsValue = {
MarkdownStyle : this.find("[name=\"markdown-style\"]:checked").val().toString(),
ReadTheme : this.find("#read-preview-area-theme-select").val(),
// MarkdownStyle : this.find("[name=\"markdown-style\"]:checked").val().toString(),
// ReadTheme : this.find("#read-preview-area-theme-select").val(),
EditToolbarButton : this.find("#edit-toolbar-area-button-select").val(),
EditToolbarTheme : this.find("#edit-toolbar-area-theme-select").val(),
EditEditorTheme : this.find("#edit-editor-area-theme-select").val(),
Expand All @@ -120,23 +120,23 @@
});
}

var faBtns = dialog.find("#read-preview-area-markdown-style");
if (faBtns.html() === "")
{
var _lang = dialogLang.selectStyle;
var values = ["Editor_md", "WizDefault"];
// var faBtns = dialog.find("#read-preview-area-markdown-style");
// if (faBtns.html() === "")
// {
// var _lang = dialogLang.selectStyle;
// var values = ["Editor_md", "WizDefault"];

for (var i = 0; i < 2; i++)
{
var checked = (i === 0) ? " checked=\"checked\"" : "";
var btn = "<a href=\"javascript:;\"><label for=\"editormd-table-dialog-radio"+i+"\" >";
btn += "<input type=\"radio\" name=\"markdown-style\" id=\"editormd-table-dialog-radio"+i+"\" value=\"" + values[i] + "\"" +checked + " />&nbsp;";
btn += _lang[i];
btn += "</label></a>";
// for (var i = 0; i < 2; i++)
// {
// var checked = (i === 0) ? " checked=\"checked\"" : "";
// var btn = "<a href=\"javascript:;\"><label for=\"editormd-table-dialog-radio"+i+"\" >";
// btn += "<input type=\"radio\" name=\"markdown-style\" id=\"editormd-table-dialog-radio"+i+"\" value=\"" + values[i] + "\"" +checked + " />&nbsp;";
// btn += _lang[i];
// btn += "</label></a>";

faBtns.append(btn);
}
}
// faBtns.append(btn);
// }
// }

var faEmojiBtns = dialog.find("#edit-emoji-support");
if (faEmojiBtns.html() === "")
Expand All @@ -157,13 +157,13 @@
}

var optionsNowValue = $.proxy(settings.ongetOptions, this)();
var markdownStyle = optionsNowValue["MarkdownStyle"];
var markdownStyleChecked = 1;
if (markdownStyle == "Editor_md") {
markdownStyleChecked = 0;
}
faBtns.find("[name=\"markdown-style\"]:checked").removeAttr("checked");
faBtns.find("input#editormd-table-dialog-radio" + markdownStyleChecked).attr("checked", "checked").click();
// var markdownStyle = optionsNowValue["MarkdownStyle"];
// var markdownStyleChecked = 1;
// if (markdownStyle == "Editor_md") {
// markdownStyleChecked = 0;
// }
// faBtns.find("[name=\"markdown-style\"]:checked").removeAttr("checked");
// faBtns.find("input#editormd-table-dialog-radio" + markdownStyleChecked).attr("checked", "checked").click();

var emojiSupport = optionsNowValue["EmojiSupport"];
var emojiSupportChecked = 0;
Expand Down Expand Up @@ -195,7 +195,7 @@
return select;
}

themeSelect("#read-preview-area-theme-select", editormd.previewThemes, optionsNowValue["ReadTheme"]);
//themeSelect("#read-preview-area-theme-select", editormd.previewThemes, optionsNowValue["ReadTheme"]);
themeSelect("#edit-toolbar-area-button-select", dialogLang.toolbarButtonStyle, optionsNowValue["EditToolbarButton"]);
themeSelect("#edit-toolbar-area-theme-select", editormd.themes, optionsNowValue["EditToolbarTheme"]);
themeSelect("#edit-editor-area-theme-select", editormd.editorThemes, optionsNowValue["EditEditorTheme"]);
Expand Down
20 changes: 10 additions & 10 deletions md_editor_core.js
Expand Up @@ -204,8 +204,8 @@ $(function() {
// 获得选项配置值
function getOptionSettings() {
var optionsValue = {
MarkdownStyle : getConfigValue("MarkdownStyle", "WizDefault"),
ReadTheme : getConfigValue("ReadTheme", "default"),
// MarkdownStyle : getConfigValue("MarkdownStyle", "WizDefault"),
// ReadTheme : getConfigValue("ReadTheme", "default"),
EditToolbarButton : getConfigValue("EditToolbarButton", "default"),
EditToolbarTheme : getConfigValue("EditToolbarTheme", "default"),
EditEditorTheme : getConfigValue("EditEditorTheme", "default"),
Expand Down Expand Up @@ -237,14 +237,14 @@ $(function() {
}

var showMsg = false;
if (optionSettings.MarkdownStyle != optionsValue.MarkdownStyle) {
setConfigValue("MarkdownStyle", optionsValue.MarkdownStyle);
showMsg = true;
setHookRead(optionsValue.MarkdownStyle == "Editor_md");
}
if (optionSettings.ReadTheme != optionsValue.ReadTheme) {
setConfigValue("ReadTheme", optionsValue.ReadTheme);
}
// if (optionSettings.MarkdownStyle != optionsValue.MarkdownStyle) {
// setConfigValue("MarkdownStyle", optionsValue.MarkdownStyle);
// showMsg = true;
// setHookRead(optionsValue.MarkdownStyle == "Editor_md");
// }
// if (optionSettings.ReadTheme != optionsValue.ReadTheme) {
// setConfigValue("ReadTheme", optionsValue.ReadTheme);
// }
if (optionSettings.EmojiSupport != optionsValue.EmojiSupport) {
setConfigValue("EmojiSupport", optionsValue.EmojiSupport);
wizEditor.config("emoji", optionsValue.EmojiSupport == "1" ? true : false);
Expand Down
10 changes: 5 additions & 5 deletions md_editor_global.js
Expand Up @@ -144,11 +144,11 @@ function WizMDEditorTabClose(objHtmlDocument, objWizDocument) {
doc = objWindow.CurrentDocumentHtmlDocument;
}
if (doc == null) {
doc = objBrowser; // 4.5
objBrowser.ExecuteScriptFile(WizMD_pluginPath + "md_editor_inject.js", function(ret) {
objBrowser.ExecuteFunction3("WizEditormdMarkdown", null, WizMD_pluginPath, objCommon, function(ret) {
});
});
// doc = objBrowser; // 4.5
// objBrowser.ExecuteScriptFile(WizMD_pluginPath + "md_editor_inject.js", function(ret) {
// objBrowser.ExecuteFunction3("WizEditormdMarkdown", null, WizMD_pluginPath, objCommon, function(ret) {
// });
// });
}
else {
WizEditormdMarkdown2(doc, WizMD_pluginPath);
Expand Down

0 comments on commit 4fcb151

Please sign in to comment.