[Bbs2ch-cvs 470] [452] [][04_BRANCH] 「URL の表示制限を無視して開く」をスレッドリダイレクタにも追加

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2008年 12月 13日 (土) 23:11:24 JST


Revision: 452
          http://svn.sourceforge.jp/view?root=bbs2ch&view=rev&rev=452
Author:   flyson
Date:     2008-12-13 23:11:23 +0900 (Sat, 13 Dec 2008)

Log Message:
-----------
[][04_BRANCH] 「URL の表示制限を無視して開く」をスレッドリダイレクタにも追加

Modified Paths:
--------------
    branches/bbs2chreader/04_BRANCH/chrome/content/bbs2chreader/settings/general-pane.xul
    branches/bbs2chreader/04_BRANCH/components/b2rThreadRedirector.js
    branches/bbs2chreader/04_BRANCH/defaults/preferences/bbs2chreader-pref.js


-------------- next part --------------
Modified: branches/bbs2chreader/04_BRANCH/chrome/content/bbs2chreader/settings/general-pane.xul
===================================================================
--- branches/bbs2chreader/04_BRANCH/chrome/content/bbs2chreader/settings/general-pane.xul	2008-12-13 13:41:26 UTC (rev 451)
+++ branches/bbs2chreader/04_BRANCH/chrome/content/bbs2chreader/settings/general-pane.xul	2008-12-13 14:11:23 UTC (rev 452)
@@ -21,6 +21,8 @@
 				name="extensions.bbs2chreader.thread_redirector.ask" type="bool"/>
 		<preference id="extensions.bbs2chreader.thread_redirector.throw_bookmarks"
 				name="extensions.bbs2chreader.thread_redirector.throw_bookmarks" type="bool"/>
+		<preference id="extensions.bbs2chreader.thread_redirector.disregard_url_option"
+				name="extensions.bbs2chreader.thread_redirector.disregard_url_option" type="bool"/>
 		<preference id="extensions.bbs2chreader.tab_load_in_foreground"
 				name="extensions.bbs2chreader.tab_load_in_foreground" type="bool"/>
 		<preference id="extensions.bbs2chreader.http_proxy_mode"
@@ -54,6 +56,8 @@
 				preference="extensions.bbs2chreader.thread_redirector.ask"/>
 			<checkbox label="ブックマークやスレッド表示からはそのまま開く"
 				preference="extensions.bbs2chreader.thread_redirector.throw_bookmarks"/>
+			<checkbox label="URL の表示制限を無視して開く"
+				preference="extensions.bbs2chreader.thread_redirector.disregard_url_option"/>
 		</vbox>
 	</settingbox>
 

Modified: branches/bbs2chreader/04_BRANCH/components/b2rThreadRedirector.js
===================================================================
--- branches/bbs2chreader/04_BRANCH/components/b2rThreadRedirector.js	2008-12-13 13:41:26 UTC (rev 451)
+++ branches/bbs2chreader/04_BRANCH/components/b2rThreadRedirector.js	2008-12-13 14:11:23 UTC (rev 452)
@@ -164,10 +164,30 @@
 
 			if(viewB2r){
 				var bbs2chService = Cc["@mozilla.org/bbs2ch-service;1"]
-							.getService(Ci.nsIBbs2chService);
-				var serverURL = "./thread/" + aContentLocation.spec;
-				serverURL = bbs2chService.serverURL.resolve(serverURL);
-				aContentLocation.spec = serverURL;
+						.getService(Ci.nsIBbs2chService);
+				var ioService = Cc["@mozilla.org/network/io-service;1"]
+						.getService(Ci.nsIIOService);
+
+				var serverURLSpec = "./thread/" + aContentLocation.spec;
+				serverURLSpec = bbs2chService.serverURL.resolve(serverURLSpec);
+
+				var disregardURLOption = bbs2chService.pref.getBoolPref(
+						"extensions.bbs2chreader.thread_redirector.disregard_url_option");
+				if(disregardURLOption){
+					var serverURL = ioService.newURI(serverURLSpec, null, null)
+							.QueryInterface(Ci.nsIURL);
+
+					var threadViewLimit = Number(bbs2chService.pref.getIntPref(
+								"extensions.bbs2chreader.board_thread_view_limit"));
+					if(isNaN(threadViewLimit) || threadViewLimit == 0){
+						threadViewLimit = "./";
+					}else{
+						threadViewLimit = "./l" + threadViewLimit;
+					}
+					serverURLSpec = serverURL.resolve(threadViewLimit);
+				}
+
+				aContentLocation.spec = serverURLSpec;
 			}
 		}
 

Modified: branches/bbs2chreader/04_BRANCH/defaults/preferences/bbs2chreader-pref.js
===================================================================
--- branches/bbs2chreader/04_BRANCH/defaults/preferences/bbs2chreader-pref.js	2008-12-13 13:41:26 UTC (rev 451)
+++ branches/bbs2chreader/04_BRANCH/defaults/preferences/bbs2chreader-pref.js	2008-12-13 14:11:23 UTC (rev 452)
@@ -1,5 +1,5 @@
 pref("extensions.bbs2chreader.enable_browser_contextmenu", true);
-pref("extensions.bbs2chreader.browser_contextmenu_disregard_url_option", false);
+pref("extensions.bbs2chreader.browser_contextmenu_disregard_url_option", true);
 pref("extensions.bbs2chreader.http_proxy_mode", 0);
 pref("extensions.bbs2chreader.http_proxy_value", "localhost:8080");
 pref("extensions.bbs2chreader.tab_load_in_foreground", false);
@@ -23,6 +23,7 @@
 pref("extensions.bbs2chreader.thread_redirector.enabled", false);
 pref("extensions.bbs2chreader.thread_redirector.ask", true);
 pref("extensions.bbs2chreader.thread_redirector.throw_bookmarks", false);
+pref("extensions.bbs2chreader.thread_redirector.disregard_url_option", true);
 
 pref("extensions.bbs2chreader.bbsmenu_load_url", "http://menu.2ch.net/bbsmenu.html");
 pref("extensions.bbs2chreader.bbsmenu_toggle_open_container", false);


bbs2ch-cvs メーリングリストの案内
Back to archive index