「降順で並び替え」の版間の差分
ナビゲーションに移動
検索に移動
ページの作成:「;説明 編集中の文書の行を降順で並べ替えます。 ;構文 <source lang="javascript"> // --------------------------------------------------------------...」 |
編集の要約なし |
||
| 15行目: | 15行目: | ||
if (document.selection.Text == "") | if (document.selection.Text == "") | ||
document.selection.SelectAll(); | document.selection.SelectAll(); | ||
document.selection.Text = document.selection.Text.split("\n") | document.selection.Text = document.selection.Text.split("\n").sort(function(a, b){ return ((a < b) ? 1 : ((a > b) ? -1 : 0)) }).join("\n"); | ||
document.selection.StartOfDocument(); | document.selection.StartOfDocument(); | ||
</source> | </source> | ||
2012年5月30日 (水) 00:23時点における版
- 説明
編集中の文書の行を降順で並べ替えます。
- 構文
// -----------------------------------------------------------------------------
// 降順で並べ替え
//
// Copyright (c) Kuro. All Rights Reserved.
// e-mail: kuro@haijin-boys.com
// www: http://www.haijin-boys.com/
// -----------------------------------------------------------------------------
if (document.selection.Text == "")
document.selection.SelectAll();
document.selection.Text = document.selection.Text.split("\n").sort(function(a, b){ return ((a < b) ? 1 : ((a > b) ? -1 : 0)) }).join("\n");
document.selection.StartOfDocument();
スポンサーリンク