svnno****@sourc*****
svnno****@sourc*****
2007年 11月 22日 (木) 21:12:07 JST
Revision: 254 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=bbs2ch&view=rev&rev=254 Author: flyson Date: 2007-11-22 21:12:07 +0900 (Thu, 22 Nov 2007) Log Message: ----------- ログのディレクトリ構造を変更 Modified Paths: -------------- trunk/bbs2chreader/components/b2rGlobalService.js trunk/bbs2chreader/components/nsBbs2chService.js -------------- next part -------------- Modified: trunk/bbs2chreader/components/b2rGlobalService.js =================================================================== --- trunk/bbs2chreader/components/b2rGlobalService.js 2007-11-09 16:28:39 UTC (rev 253) +++ trunk/bbs2chreader/components/b2rGlobalService.js 2007-11-22 12:12:07 UTC (rev 254) @@ -101,18 +101,30 @@ getLogFileAtURL: function(aURLSpec){ - const LOGS_DIR_NAME = "logs"; + const LOGS_DIR_NAME = "data"; var ioService = XPC.getService("@mozilla.org/network/io-service;1", "nsIIOService"); var fromURL = ioService.newURI(aURLSpec, null, null).QueryInterface(Ci.nsIURL); var logFile = this.getDataDir(); logFile.appendRelativePath(LOGS_DIR_NAME); - logFile.appendRelativePath(fromURL.host); + if(fromURL.host.indexOf(".2ch.net")!=-1){ + logFile.appendRelativePath("2ch"); + }else if(fromURL.host.indexOf(".machi.to")!=-1){ + logFile.appendRelativePath("machi"); + }else if(fromURL.host.indexOf(".bbspink.com")!=-1){ + logFile.appendRelativePath("bbspink"); + }else if(fromURL.host == "jbbs.livedoor.jp"){ + logFile.appendRelativePath("jbbs"); + }else{ + logFile.appendRelativePath("outside"); + logFile.appendRelativePath(fromURL.host); + } + var pathArray = fromURL.path.split("/"); - for(let [i, name] in Iterator(pathArray)){ - if(name) logFile.appendRelativePath(name); + for(let i=0; i<pathArray.length; i++){ + if(pathArray[i]) logFile.appendRelativePath(pathArray[i]); } return logFile; Modified: trunk/bbs2chreader/components/nsBbs2chService.js =================================================================== --- trunk/bbs2chreader/components/nsBbs2chService.js 2007-11-09 16:28:39 UTC (rev 253) +++ trunk/bbs2chreader/components/nsBbs2chService.js 2007-11-22 12:12:07 UTC (rev 254) @@ -340,16 +340,28 @@ }, getLogFileAtURL: function(aURLSpec){ - const LOGS_DIR_NAME = "logs"; + const LOGS_DIR_NAME = "data"; var fromURL = this._ioService.newURI(aURLSpec, null, null).QueryInterface(Ci.nsIURL); var logFile = this.getDataDir(); logFile.appendRelativePath(LOGS_DIR_NAME); - logFile.appendRelativePath(fromURL.host); + if(fromURL.host.indexOf(".2ch.net")!=-1){ + logFile.appendRelativePath("2ch"); + }else if(fromURL.host.indexOf(".machi.to")!=-1){ + logFile.appendRelativePath("machi"); + }else if(fromURL.host.indexOf(".bbspink.com")!=-1){ + logFile.appendRelativePath("bbspink"); + }else if(fromURL.host == "jbbs.livedoor.jp"){ + logFile.appendRelativePath("jbbs"); + }else{ + logFile.appendRelativePath("outside"); + logFile.appendRelativePath(fromURL.host); + } + var pathArray = fromURL.path.split("/"); - for(var i=0; i<pathArray.length; i++){ + for(let i=0; i<pathArray.length; i++){ if(pathArray[i]) logFile.appendRelativePath(pathArray[i]); }