「Editor.OpenFile()のポリフィル」の版間の差分
ナビゲーションに移動
検索に移動
細編集の要約なし |
編集の要約なし |
||
(同じ利用者による、間の1版が非表示) | |||
1行目: | 1行目: | ||
Editor.OpenFile() | Editor.OpenFile()は開いたDocumentオブジェクトを返さないので、Documentオブジェクトを返すようにするポリフィルです。Editor.OpenFile()が開いたDocumentオブジェクトを返すようになるまでは使えます。 | ||
<source lang="javascript"> | <source lang="javascript"> | ||
function OpenFile(file, encoding, flags){ | function OpenFile(file, encoding, flags){ | ||
var i, j, e, d; | var i, j, e, d; | ||
file = new ActiveXObject("Scripting.FileSystemObject").GetAbsolutePathName(file); | |||
window.Editor.OpenFile(file, encoding, flags); | window.Editor.OpenFile(file, encoding, flags); | ||
for(i = 0; i < window.Editors.Count; i++){ | for(i = 0; i < window.Editors.Count; i++){ |
2018年8月30日 (木) 19:24時点における版
Editor.OpenFile()は開いたDocumentオブジェクトを返さないので、Documentオブジェクトを返すようにするポリフィルです。Editor.OpenFile()が開いたDocumentオブジェクトを返すようになるまでは使えます。
function OpenFile(file, encoding, flags){
var i, j, e, d;
file = new ActiveXObject("Scripting.FileSystemObject").GetAbsolutePathName(file);
window.Editor.OpenFile(file, encoding, flags);
for(i = 0; i < window.Editors.Count; i++){
e = window.Editors.Item(i);
for(j = 0; j < e.Documents.Count; j++){
d = e.Documents.Item(j);
if(d.FullName){
if(d.FullName === file){
return d;
}
}
}
}
}
スポンサーリンク