「TeX数式のチェック」の版間の差分
ソースコードの整形 |
ソースコードの整形 |
||
| 16行目: | 16行目: | ||
var objIE = new ActiveXObject("InternetExplorer.Application"); | var objIE = new ActiveXObject("InternetExplorer.Application"); | ||
var sel = | 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. | 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 = | 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. | document.Write("<html><head>"); | ||
document. | document.Write("<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML'></script>"); | ||
document. | document.Write("</head><body>"); | ||
document. | document.Write("<br />\\(" + sel.Text + "\\)<br />"); | ||
document. | document.Write("</body></html>"); | ||
refresh(); | refresh(); | ||
Visible = true; | Visible = true; | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
スポンサーリンク