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

MSY-07 (トーク | 投稿記録)
日付のフォーマットを変更
MSY-07 (トーク | 投稿記録)
ソースコードの整形
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();
Quit();
} else {
} else {
    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 + "\"/> ");


with(objIE) {
with(objIE) {
    Width = 300;
Width = 300;
    Height = 200;
Height = 200;
    AddressBar = false;
AddressBar = false;
    MenuBar = false;
MenuBar = false;
    StatusBar = false;
StatusBar = false;
    ToolBar = false;
ToolBar = false;
    Navigate( url );
Navigate(url);
    Visible = true;
Visible = true;
}
}
</syntaxhighlight>
</syntaxhighlight>
41行目: 41行目:


<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
    Navigate( url );
Navigate(url);
</syntaxhighlight>
</syntaxhighlight>


47行目: 47行目:


<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>


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;
Width = 200;
    Height = 150;
Height = 150;
    AddressBar = false;
AddressBar = false;
    MenuBar = false;
MenuBar = false;
    StatusBar = false;
StatusBar = false;
    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>
スポンサーリンク