「JavaScript を実行」の版間の差分

MSY-07 (トーク | 投稿記録)
<source>タグを<syntaxhighlight>タグに置き換える
MSY-07 (トーク | 投稿記録)
文の末尾にセミコロンを追加
6行目: 6行目:


if (document.selection.IsEmpty) {
if (document.selection.IsEmpty) {
   document.selection.EndOfLine(false, mePosLogical)
   document.selection.EndOfLine(false, mePosLogical);
   document.selection.StartOfLine(true, mePosLogical)
   document.selection.StartOfLine(true, mePosLogical);
}
}
if (document.selection.Text) {
if (document.selection.Text) {
   document.selection.Text = eval(document.selection.Text)
   document.selection.Text = eval(document.selection.Text);
}
}
</syntaxhighlight>
</syntaxhighlight>
19行目: 19行目:


if (document.selection.IsEmpty) {
if (document.selection.IsEmpty) {
   document.selection.EndOfLine(false, mePosLogical)
   document.selection.EndOfLine(false, mePosLogical);
   document.selection.StartOfLine(true, mePosLogical)
   document.selection.StartOfLine(true, mePosLogical);
}
}


if (document.selection.Text) {
if (document.selection.Text) {
   document.selection.Text = document.selection.Text + ' => ' + eval(document.selection.Text)
   document.selection.Text = document.selection.Text + ' => ' + eval(document.selection.Text);
}
}
</syntaxhighlight>
</syntaxhighlight>
33行目: 33行目:


if (document.selection.IsEmpty) {
if (document.selection.IsEmpty) {
   document.selection.EndOfLine(false, mePosLogical)
   document.selection.EndOfLine(false, mePosLogical);
   document.selection.StartOfLine(true, mePosLogical)
   document.selection.StartOfLine(true, mePosLogical);
}
}


if (document.selection.Text) {
if (document.selection.Text) {
   outputbar.visible = true;
   outputbar.visible = true;
   // outputbar.Writeln(">> " + document.selection.Text)
   // outputbar.Writeln(">> " + document.selection.Text);
   outputbar.Writeln("=> " + eval(document.selection.Text).toString())
   outputbar.Writeln("=> " + eval(document.selection.Text).toString());
}
}
</syntaxhighlight>
</syntaxhighlight>
スポンサーリンク