「フォルダツリーをポップアップ表示」の版間の差分
Snipsnipsnip (トーク | 投稿記録) ページの作成:「今開いているファイルのフォルダの内容をポップアップで表示して、選択するとそのファイルを開きます。 手石さんの[[ポ...」 |
Snipsnipsnip (トーク | 投稿記録) r2 |
||
| 39行目: | 39行目: | ||
* r1(2013-09-10): 初版 | * r1(2013-09-10): 初版 | ||
* r2(2013-09-21): ディレクトリをまたぐと開けなかったバグ修正 | |||
== ソース == | == ソース == | ||
<source lang="javascript"> | <source lang="javascript"> | ||
// 同じフォルダにあるファイルを開く.js | // 同じフォルダにあるファイルを開く.js r2 | ||
// もしくは 簡易フォルダツリー | // もしくは 簡易フォルダツリー | ||
| 55行目: | 56行目: | ||
// 一覧に含めるファイル名の正規表現 | // 一覧に含めるファイル名の正規表現 | ||
CONFIG.file_pattern = /^[^\.]/ | CONFIG.file_pattern = /^[^\.]/ | ||
// 別例: 現在のファイルと同じ拡張子だけ表示 | |||
// CONFIG.file_pattern = document.Name.indexOf('.') == -1 ? /./ : RegExp(document.Name.substr(document.Name.indexOf('.')), "i") | |||
// 一覧から除外するファイル名の正規表現 | // 一覧から除外するファイル名の正規表現 | ||
| 85行目: | 89行目: | ||
if (choosed) | if (choosed) | ||
{ | { | ||
var path = FS.BuildPath(dir, choosed).replace(/\//, '\\') | var path = FS.BuildPath(dir, choosed).replace(/\//g, '\\') | ||
editor.OpenFile(path, 0, meOpenAllowNewWindow) | editor.OpenFile(path, 0, meOpenAllowNewWindow) | ||
} | } | ||
スポンサーリンク