svnno****@sourc*****
svnno****@sourc*****
2007年 12月 30日 (日) 21:03:06 JST
Revision: 299 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=299 Author: flyson Date: 2007-12-30 21:03:05 +0900 (Sun, 30 Dec 2007) Log Message: ----------- b2rIGlobalService への移行 Modified Paths: -------------- trunk/bbs2chreader/chrome/content/bbs2chreader/ff-overlay.js -------------- next part -------------- Modified: trunk/bbs2chreader/chrome/content/bbs2chreader/ff-overlay.js =================================================================== --- trunk/bbs2chreader/chrome/content/bbs2chreader/ff-overlay.js 2007-12-30 11:36:13 UTC (rev 298) +++ trunk/bbs2chreader/chrome/content/bbs2chreader/ff-overlay.js 2007-12-30 12:03:05 UTC (rev 299) @@ -90,22 +90,21 @@ if(!gContextMenu || !gContextMenu.onLink) return; - var bbs2chService = Components.classes["@mozilla.org/bbs2ch-service;1"] - .getService(Components.interfaces.nsIBbs2chService); + var b2rService = Components.classes["@bbs2ch.sourceforge.jp/b2r-global-service;1"] + .getService(Components.interfaces.b2rIGlobalService); var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); + var pref = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefBranch); var threadURLSpec = gContextMenu.link.href; + var threadURL = ioService.newURI(threadURLSpec, null, null) .QueryInterface(Components.interfaces.nsIURL); // スレッド表示数の制限 - var disregardURLOption = bbs2chService.pref.getBoolPref( - "extensions.bbs2chreader.browser_contextmenu_disregard_url_option"); - var type = bbs2chService.getBoardType(threadURLSpec); - if(disregardURLOption && (type != bbs2chService.BOARD_TYPE_MACHI)){ - var threadURL = ioService.newURI(threadURLSpec, null, null) - .QueryInterface(Components.interfaces.nsIURL); - var threadViewLimit = Number(bbs2chService.pref.getIntPref( - "extensions.bbs2chreader.board_thread_view_limit")); + var disregardURLOption = pref.getBoolPref("extensions.bbs2chreader.browser_contextmenu_disregard_url_option"); + var type = b2rService.threadUtils.getBoardType(threadURL); + if(disregardURLOption && (type != b2rService.BOARD_TYPE_MACHI)){ + var threadViewLimit = Number(pref.getIntPref("extensions.bbs2chreader.board_thread_view_limit")); if(isNaN(threadViewLimit) || threadViewLimit == 0){ threadViewLimit = "./"; }else{ @@ -114,7 +113,7 @@ threadURLSpec = threadURL.resolve(threadViewLimit); } - threadURLSpec = bbs2chService.serverURL.resolve("./thread/" + threadURLSpec); + threadURLSpec = b2rService.serverURL.resolve("./thread/" + threadURLSpec); if(aNewTab){ var newTab = gBrowser.addTab(threadURLSpec, null);