flyson
flyso****@users*****
2005年 9月 16日 (金) 00:09:25 JST
Index: bbs2chreader/components/nsBbs2chContentHandler.js diff -u bbs2chreader/components/nsBbs2chContentHandler.js:1.2 bbs2chreader/components/nsBbs2chContentHandler.js:1.3 --- bbs2chreader/components/nsBbs2chContentHandler.js:1.2 Mon Aug 8 22:32:38 2005 +++ bbs2chreader/components/nsBbs2chContentHandler.js Fri Sep 16 00:09:25 2005 @@ -57,6 +57,8 @@ } // ウィンドウの取得 + var windowMediator = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); var appShellService = Components.classes["@mozilla.org/appshell/appShellService;1"] .getService(Components.interfaces.nsIAppShellService); var win = appShellService.hiddenDOMWindow; @@ -67,8 +69,19 @@ switch(mode){ case "post:": // 書き込みウィザード + // 同じスレッドは開かない + var postWizardEnu = windowMediator.getEnumerator("bbs2ch:postWizard"); + while(postWizardEnu.hasMoreElements()){ + var item = postWizardEnu.getNext() + .QueryInterface(Components.interfaces.nsIDOMWindow); + if(item.gThreadURL.spec == uriSpec.replace(/^bbs2ch:post:/, "")){ + item.focus(); + return; + } + } + win.openDialog("chrome://bbs2chreader/content/post-wizard.xul", - "winBbs2chPostWizard", "chrome, resizable", uriSpec); + "", "chrome, resizable", uriSpec); break; case "void": // 何もしない break;