mirrorMan2.08
jquery-ui.jsを読み込むファイル名が間違っていて起動に失敗していたため修正。
自転車と本とJS
var txtfnm = sfs.GetBaseName(fnm) +".txt";
if(ssh.NameSpace(lFol).ParseName(txtfnm))
if(6 != wsh.popup(txtfnm +
"\n\n拡張子がtxtのファイル名はxdoc2txtで使用します。"+
"上書きしてもよいですか?",0,title,36))
return title = fds.titleName;
if(! sfs.GetExtensionName(fnm)){
wsh.popup("拡張子が取得できないファイル名は実行できません。",0,title,64);
return title = fds.titleName;
}
if(6 == wsh.popup(
"xdoc2txtのダンプファイル\n\n"+ txtfnm +"\n\nを削除しますか?",0,title,36)){
ssh.NameSpace(10).MoveHere(txtlPth, 64);
ssh.NameSpace(10).MoveHere(txtrPth, 64);
loadItms(1);
}
<span class="mouseaction"> <select id="downlist"> <option value="クルーグマンと">クルーグマンと</option> <option value="池田信夫って">池田信夫って</option> <option value="似てる?">似てる?</option> </select> <input type=text id="txtbox" value=""/> </span>長押しイベントをアイヤーさせたいタグにclass="mouseaction"します。
<script type="text/javascript">
$('.mouseaction').mousedown(MouseAction._down);
$('.mouseaction').mouseup(MouseAction._up);
$('.mouseaction').mouseover(MouseAction._over);
$('.mouseaction').mouseout(MouseAction._out);
$('.mouseaction').click(MouseAction._click);
$(txtbox).toggle();
MouseAction.click = function(){;}
MouseAction.press = function(){
txtbox.value = downlist.options[downlist.options.selectedIndex].value;
$(downlist).toggle();
$(txtbox).toggle();
}
</script>
プルダウンリストで表示されている値を取ってテキストボックスの値にします。
var fds = {
dfexe : "ap\\DF\\DF.exe",
xdoc2txtexe:"ap\\xdoc2txt\\xdoc2txt.exe",
chkoffImg : "./img/chkoff.png",
chkonImg : "./img/chkon.png",
handImg : "./img/Hand.png",
smkhandImg : "./img/smkHand.png",
refreshImg :"./img/refresh.png",
restartImg :"./img/Restart.png",
mMnIni : "mirrorMan.ini",
folImg : "./img/fol.bmp",
readMeTxt : "readMe.txt",
titleName : "mirrorMan"
}

<div class="contextMenu" id="conMenuLftItms">
<ul>
<li id="deleteItm" >削除 (D)</li>
:
:
<li id="verbPropty" >プロパティ</li>
</ul>
</div>
$('#rhtClkLftItmsAra').contextMenu('conMenuLftItms',{
onContextMenu: function(){return (selItmObj ? true : false)},
menuStyle: { width:'95px' },
itemStyle: { fontFamily:'MS UI Gothic',fontSize:'9pt',border:'none',padding:'0px'},
itemHoverStyle: { border:'none'},
bindings:{
'deleteItm' : function(t){ delItm()},
:
:
'verbPropty' : function(t){ invokeVerbs('properties')},
}
});
selItmObjはマウスオーバーでファイル/フォルダオブジェクトを代入し、マウスアウトで削除している変数です。



try{
ssh.NameSpace(ふぉるだ).ParseName(sfs.GetFileName(ふぁいる)).Name = なまえ;
}catch(e){
if(e.number == -2144927744) rollbackRenameItm();
return;
}
wsh = new ActiveXObject("WScript.Shell");
ssh = new ActiveXObject("Shell.Application");
sfs = new ActiveXObject("Scripting.FileSystemObject");arg = WScript.Arguments;
if(arg.length)Vistaの場合、
WScript.Quit(
ssh.ShellExecute("regsvr32.exe"," /u xdoc2txt.ocx","","runas"));
if(6 != wsh.popup(
"xdoc2txtをレジストリに登録しますか?\n\n"+
"(レジストリから削除したい場合、"+ WScript.ScriptFullName +
"にxdoc2txt.ocxをドラッグドロップしてください)",0,WScript.ScriptName,36))
WScript.Quit();
sy32 = ssh.NameSpace(37);
xdoc = ssh.NameSpace(
sfs.GetParentFolderName(
WScript.ScriptFullName)).ParseName("xdoc2txt.ocx");
zlib = ssh.NameSpace(
sfs.GetParentFolderName(
WScript.ScriptFullName)).ParseName("zlib.dll");
if(!zlib) WScript.Quit(WScript.Echo("zlib.dllファイルがありません"));
sy32.CopyHere(xdoc);
sy32.CopyHere(zlib);
wsh.CurrentDirectory = ssh.NameSpace(37).Self.Path;
ssh.ShellExecute("regsvr32.exe","xdoc2txt.ocx","","runas");
wsh.Run(".\\ap\\d2txt130r2\\OCX\\xdoc2txt登録.js",10,true);
return reloadItmLst(1); その後reloadItmLst()でreturn location.reload(true);しています。



ボタンの押下回数で操作を分けりるれろ。






ボタンでDF起動モードにして、そのダンプテキストを選択すると下のように色分け表示。



html {overflow-y:auto}とすると下の画像のように。bodyタグには指定なしで、htmlにautoを指定しておくと内容がoverflowしたときにはスクロールバーが出ます。
ボタンでの画面のモニター位置スナップ、var a = new Date(f1.ModifyDate).valueOf();
var b = new Date(f2.ModifyDate).valueOf();
if(a < b) …
popupを表示して問い合わせます。
一括コピー時にもチェックして一括処理を中止します。<object id="XDOC2TXT"
classid="clsid:4FD6BD6E-471A-48A6-8C52-5E8391ECBA9F" width=0 height=0></object>
<span id=xdoc2txtSpan></span>objectタグでXDOC2TXTの参照を作成します。
function toggleCmdBtn(i){
if(document.all.filteFnmInBox){
if((!XDOC2TXT.object)||(document.all.xdoc2txtInBox)){
filterFileSpan.innerHTML ="";
xdoc2txtSpan.innerHTML ="";
setTimeout('loadItms(1)',0);
}else
xdoc2txtSpan.innerHTML = "<input type=text id=xdoc2txtInBox size=5 value=xdoc2txt>";
}else
filterFileSpan.innerHTML = "<input type=text id=filteFnmInBox size=5>";ファイル名のフィルタのテキストボックスのidはfilteFnmInBoxで、xdoc2txtの入力ボックスと合わせ、同じイベントで2段階でのテキストボックスをサイクル表示/非表示させます。function名ですがもうトグルじゃないです。if(document.all.xdoc2txtInBox){
rhtStatsbar.innerText ="";
try{var regx = xdoc2txtInBox.value ? new RegExp(xdoc2txtInBox.value,'mgi') : /./}
catch(e){
xdoc2txtInBox.style.backgroundColor='#d8efff';
return rhtStatsbar.innerText = " "+e.description
}
xdoc2txtInBox.style.backgroundColor="";
}rhtStatsbarは正規表現句のエラーを表示する領域です。for(var fc=new Enumerator(erfo.Items()); !fc.atEnd(); fc.moveNext()){
if(regx){ if(!regx.test(XDOC2TXT.Convert(fc.item().Path))) continue}
・・・なのに速いですね。RegExpのオプションは複数行でデータ全体で大文字小文字区別なし

regsvr32 /s xdoc2txt.ocxですが、Vistaではあらかじめコマンドプロンプトを右クリックして管理者権限で実行しないとスカりました。/sを外すと0x80040200エラーが出て分かるのですが。
<OBJECT id="XDOC2TXT"
CLASSID="clsid:4FD6BD6E-471A-48A6-8C52-5E8391ECBA9F"
width=0 height=0></OBJECT>





[bthClr] 1から
[bthClr] 0に変更しておくと、
var IniData = function(p,x,c,t,b){
this.edtPth = p;
this.extNam = x;
this.cpyOpt = c;
this.pstTxt = t;
this.bthClr = b;
}オブジェクトを初期化しておいてvar ini = new IniData("未設定",["txt","ini","log","js","css"],parseInt(80),1,1);起動時のINIファイル読み込みでini.bthClrプロパティに格納します。while(!f.AtEndOfStream){
ars = f.ReadLine().split(/\t/);
switch(ars[0]){
case"[bthClr]": if(ars[1]) ini.bthClr = parseInt(ars[1]);
}
}パラメータのflgは0:左、2:右、1:左右ですが、ini.bthClrプロパティが0ならflgを1に上書きせず、左か右のどちらかのみ処理するようになります。function loadItms(flg){
if(ini.bthClr) flg = 1;
if(flg < 2){左ペイン処理...}
if(flg > 0){右ペイン処理...}
}with(document.body) onkeydown = handleKeydown;textboxに入力された値をonkeydownで取得すると、htaではその入力が取れませんでした。
function handleKeydown(){
setTimeout('loadItms()',0);
}そのsetTimeout、待ちを0秒でsetTimeoutするのはなぜかといと、たとえば画面に「loading中...」と表示させてから次の処理をsetTimeoutし、処理の順序を明示的に最後尾に指定することで、htaで非同期処理的に画面を更新されているように見せることができます。function loadItms(){
createItmsHtML();
}function createItmsHtML(){
if(document.all.filterLstBox){
rhtStatsbar.innerText ="";
try{
var re = filterLstBox.value ? new RegExp(filterLstBox.value,'i') : /./
}catch(e){
filterLstBox.style.backgroundColor='#d8efff';
return rhtStatsbar.innerText = " "+e.description
}
filterLstBox.style.backgroundColor="";
for(var fc=new Enumerator(erfo.Items()); !fc.atEnd(); fc.moveNext()){
if(re) if(!re.test(itm)) continue;
...
}
}
}検索入力textboxのfilterLstBoxが表示されていたら、その値をnew RegExp()してreに入れています。その後、ファイルやフォルダのコレクションでhtmlを組み立てるループの中でre.test()しています。
このボタン↓か、Ctrl+F

var dic = LR ? dicLstRht : dicLstLft;削除すると空いてるKeyが歯抜けになるので、Countプロパティ+1ではなく探して取得。
var sLR = LR ? "Rht" : "Lft";
var arr = new VBArray(dic.Keys()).toArray();
for(var i in arr) if(dic(arr[i]) == pth) var j= i;
if(!j) for(var j=0;j<100;j++)
if(!dic.Exists(sLR+"Lst"+j)){ dic.Add(sLR+"Lst"+j, pth);break}
<meta http-equiv="MSThemeCompatible" content="yes">XP以降でデスクトップのテーマを設定している場合、フォーム部品のデザインがそれに。