「TeX数式のチェック」の版間の差分

MSY-07 (トーク | 投稿記録)
ソースコードの整形
MSY-07 (トーク | 投稿記録)
ソースコードの整形
16行目: 16行目:
var objIE = new ActiveXObject("InternetExplorer.Application");
var objIE = new ActiveXObject("InternetExplorer.Application");


var sel = Editor.ActiveDocument.Selection;
var sel = editor.ActiveDocument.selection;
if (sel.IsEmpty) {
if (sel.IsEmpty) {
Quit();
Quit();
22行目: 22行目:
var encoded_TeXcode = encodeURIComponent(sel.Text);
var encoded_TeXcode = encodeURIComponent(sel.Text);
url += encoded_TeXcode;
url += encoded_TeXcode;
};
}


ClipboardData.SetData("<img alt=\"" + sel.Text + "\"" + " src=\"" + url + "\"/> ");
ClipboardData.SetData("<img alt=\"" + sel.Text + "\"" + " src=\"" + url + "\"/> ");
48行目: 48行目:
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
Navigate("about:blank");
Navigate("about:blank");
document.write("<html><head></head><body>" + "<img src='" + url +"'/><br /><br />" + sel.Text + "</body></html>");
document.Write("<html><head></head><body>" + "<img src='" + url +"'/><br /><br />" + sel.Text + "</body></html>");
</syntaxhighlight>
</syntaxhighlight>


63行目: 63行目:


var objIE = new ActiveXObject("InternetExplorer.Application");
var objIE = new ActiveXObject("InternetExplorer.Application");
var sel = Editor.ActiveDocument.Selection;
var sel = editor.ActiveDocument.selection;
if (sel.IsEmpty) {
if (sel.IsEmpty) {
Quit()
Quit();
};
}


with(objIE) {
with(objIE) {
76行目: 76行目:
ToolBar = false;
ToolBar = false;
Navigate("about:blank");
Navigate("about:blank");
document.write("<html><head>");
document.Write("<html><head>");
document.write("<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML'></script>");
document.Write("<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML'></script>");
document.write("</head><body>");
document.Write("</head><body>");
document.write("<br />\\(" + sel.Text + "\\)<br />");
document.Write("<br />\\(" + sel.Text + "\\)<br />");
document.write("</body></html>");
document.Write("</body></html>");
refresh();
refresh();
Visible = true;
Visible = true;
}
}
</syntaxhighlight>
</syntaxhighlight>
スポンサーリンク