「TeX数式のチェック」の版間の差分
日付のフォーマットを変更 |
ソースコードの整形 |
||
| 14行目: | 14行目: | ||
var baseURL_google = 'http://chart.apis.google.com/chart?cht=tx&chl='; | var baseURL_google = 'http://chart.apis.google.com/chart?cht=tx&chl='; | ||
var url = baseURL_google; | var url = baseURL_google; | ||
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(); | |||
} else { | } else { | ||
var encoded_TeXcode = encodeURIComponent(sel.Text); | |||
url += encoded_TeXcode; | |||
}; | }; | ||
ClipboardData.SetData( "<img alt=\"" + sel.Text + "\"" + " src=\"" + url + "\"/> "); | ClipboardData.SetData("<img alt=\"" + sel.Text + "\"" + " src=\"" + url + "\"/> "); | ||
with(objIE) { | with(objIE) { | ||
Width = 300; | |||
Height = 200; | |||
AddressBar = false; | |||
MenuBar = false; | |||
StatusBar = false; | |||
ToolBar = false; | |||
Navigate(url); | |||
Visible = true; | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| 41行目: | 41行目: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
Navigate(url); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| 47行目: | 47行目: | ||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
Navigate("about:blank"); | |||
document.write("<html><head></head><body>" + "<img src='" + url +"'/><br /><br />" + sel.Text + "</body></html>"); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| 62行目: | 62行目: | ||
// 2013-10-21 | // 2013-10-21 | ||
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 ){ Quit() }; | if (sel.IsEmpty) { | ||
Quit() | |||
}; | |||
with(objIE) { | with(objIE) { | ||
Width = 200; | |||
Height = 150; | |||
AddressBar = false; | |||
MenuBar = false; | |||
StatusBar = false; | |||
ToolBar = false; | |||
Navigate("about:blank"); | |||
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("</head><body>"); | |||
document.write("<br />\\(" + sel.Text + "\\)<br />"); | |||
document.write("</body></html>"); | |||
refresh(); | |||
Visible = true; | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
スポンサーリンク