「降順で並び替え」の版間の差分

提供: MeryWiki
ナビゲーションに移動 検索に移動
編集の要約なし
編集の要約なし
15行目: 15行目:
if (document.selection.Text == "")
if (document.selection.Text == "")
   document.selection.SelectAll();
   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.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:24時点における版

説明

編集中の文書の行を降順で並べ替えます。


構文
// -----------------------------------------------------------------------------
// 降順で並べ替え
//
// 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();
スポンサーリンク