diff -u5r chrome_/content/moz2ch/bbs/jbbs/ita.js chrome/content/moz2ch/bbs/jbbs/ita.js --- chrome_/content/moz2ch/bbs/jbbs/ita.js 2006-05-31 03:11:04.000000000 +0900 +++ chrome/content/moz2ch/bbs/jbbs/ita.js 2007-11-07 23:40:51.828125000 +0900 @@ -69,11 +69,11 @@ moz2chJbbsIta.prototype = new moz2chIta(); moz2chJbbsIta.prototype.getSureURL = function (dat) { var datNum = dat.split(".")[0]; - return "http://jbbs.livedoor.jp/" + this.sabaID + "/" + this.itaID + "/" + datNum + "/l50"; + return "http://jbbs.livedoor.jp/bbs/read.cgi/" + this.sabaID + "/" + this.itaID + "/" + datNum + "/l50"; }; ///////////////// // parse the data moz2chJbbsIta.prototype.parse = diff -u5r chrome_/content/moz2ch/bbs/jbbs/kakiko.js chrome/content/moz2ch/bbs/jbbs/kakiko.js --- chrome_/content/moz2ch/bbs/jbbs/kakiko.js 2006-06-01 16:39:06.000000000 +0900 +++ chrome/content/moz2ch/bbs/jbbs/kakiko.js 2007-11-08 21:09:24.157875000 +0900 @@ -45,16 +45,16 @@ * | Mogillaのescapeは何か変なのでここで実装するモナー * \________________________ * */ -const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"] +/*const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"] .getService(Components.interfaces.nsITextToSubURI); moz2chEscape = function(charset,str){ return textToSubURI.ConvertAndEscape(charset,str); -} +}*/ //const submit = moz2chCharset.euc2uni("書き込む"); //外部でmoz2chオブジェクトを取得しておくこと。 //var moz2ch = opener.moz2ch; @@ -74,11 +74,13 @@ channel: null, uiStream: null, //Upload InputStream dbiStream: null, //Download InputStream htmlRes: null, - sure: null, + target: null, + KAKIKO: 0, + SURETATE: 0, bundle: null, submit: null, setSubmit: function () { @@ -97,77 +99,51 @@ }, setRequestHeaders: function () { this.channel.setRequestHeader("User-Agent", opener.moz2ch.ua, false); this.channel.setRequestHeader("Accept","image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*", false); - this.channel.setRequestHeader("Referer","http://" + this.sure.sabaID + "/test/read.cgi/" + this.sure.itaID + "/" + this.sure.datID + "/", false); - this.channel.setRequestHeader("Content-Type","application/x-www-form-urlencoded", false); - if(this.sure.itaID == "be.2ch.net"){ - this.channel.setRequestHeader("Accept-Charset","euc-jp", true); - }else{ - this.channel.setRequestHeader("Accept-Charset","Shift_JIS", true); - } + if(this.SURETATE){ + this.channel.setRequestHeader("Referer","http://jbbs.livedoor.jp/" + this.target.sabaID + "/" + this.target.itaID + "/", false); + }else{ + this.channel.setRequestHeader("Referer","http://jbbs.livedoor.jp/bbs/read.cgi/" + this.target.sabaID + "/" + this.target.itaID + "/" + this.target.datID + "/", false); + } + this.channel.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=euc-jp", false); + this.channel.setRequestHeader("Accept-Charset","euc-jp", true); }, setPostData: function () { try{ var uChannel = this.channel.QueryInterface(Components.interfaces.nsIUploadChannel); if(!this.submit) this.setSubmit(); - var sub; - if(this.sure.itaID == "be.2ch.net"){ - sub = moz2chEscape("euc-jp",this.submit); - }else{ - sub = moz2chEscape("Shift_JIS",this.submit); - } + var sub = moz2chEscape("euc-jp",this.submit); - var kakikoDate = this.sure.lastAccess; - if( ! kakikoDate ) { - kakikoDate = new Date(Date.parse(this.sure.ita.getAttribute(this.sure.sureId, "lastModified"))); - } - if( ! kakikoDate ) { - kakikoDate = new Date(); - } - - if(this.sure.itaID == "be.2ch.net"){ - var postData = "submit=" + sub + - "&FROM=" + moz2chEscape("euc-jp",this.kakikoInfo.name) + - "&mail=" + moz2chEscape("euc-jp",this.kakikoInfo.mail) + - "&MESSAGE=" + moz2chEscape("euc-jp",this.kakikoInfo.msg) + - "&bbs=" + this.sure.itaID + - "&key=" + this.sure.datID + - "&time=" + Math.ceil((kakikoDate.getTime())/1000) + - "&hana=mogera"; - postData = moz2chCharset.uni2euc(postData); - }else{ - var postData = "submit=" + sub + - "&FROM=" + moz2chEscape("Shift_JIS",this.kakikoInfo.name) + - "&mail=" + moz2chEscape("Shift_JIS",this.kakikoInfo.mail) + - "&MESSAGE=" + moz2chEscape("Shift_JIS",this.kakikoInfo.msg) + - "&bbs=" + this.sure.itaID + - "&key=" + this.sure.datID + - "&time=" + Math.ceil((kakikoDate.getTime())/1000) + - "&hana=mogera"; - postData = moz2chCharset.uni2sjis(postData); - } - + var postData = "submit=" + sub + + "&NAME=" + moz2chEscape("euc-jp",this.kakikoInfo.name) + + "&MAIL=" + moz2chEscape("euc-jp",this.kakikoInfo.mail) + + "&MESSAGE=" + moz2chEscape("euc-jp",this.kakikoInfo.msg) + + "&DIR=" + this.target.sabaID + + "&BBS=" + this.target.itaID + + (this.SURETATE ? "&SUBJECT=" + moz2chEscape("euc-jp",this.kakikoInfo.subject) : + "&KEY=" + this.target.datID) + + "&TIME=1"; + postData = moz2chCharset.uni2euc(postData); this.uiStream.setData(postData, postData.length); - if(this.sure.itaID == "be.2ch.net"){ - uChannel.setUploadStream(this.uiStream, "text/plain; charset=euc-jp", -1); - }else{ - uChannel.setUploadStream(this.uiStream, "text/plain; charset=Shift_JIS", -1); - } + uChannel.setUploadStream(this.uiStream, "application/x-www-form-urlencoded; charset=euc-jp", -1); }catch(e){ moz2ch.debug(e); } }, post: function () { try{ var uri = Components.classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIURI); //uri.spec = "http://baniisan.s12.xrea.com/x/test/bbs.cgi"; - uri.spec = "http://" + this.sure.sabaID + "/test/bbs.cgi"; + uri.spec = "http://jbbs.livedoor.jp/bbs/write.cgi/" + + this.target.sabaID + "/" + + this.target.itaID + "/" + + (this.SURETATE ? "new" : this.target.datID) + "/"; if (! this.channel ) { this.channel = this.ioService.newChannelFromURI(uri) .QueryInterface(Components.interfaces.nsIHttpChannel); } @@ -213,11 +189,11 @@ onStopRequest: function (request, ctxt, status) { try{ this.statusCode = this.channel.responseStatus; this.parse(); if( this.htmlRes.length > 0 ) { - this.msg = moz2chCharset.sjis2uni(this.msg); + this.msg = moz2chCharset.euc2uni(this.msg); } else { //Response-Bodyがない場合は、ステータスコードで成功判定 switch( this.statusCode ){ case 301: //30Xはカキコ成功でRedirectと判定 case 302: @@ -272,11 +248,11 @@ if ( this.htmlRes.length <= 0 ) { rv = true; } else { //if ( moz2chCharset.sjis2uni(this.htmlTitle) == moz2chCharset.euc2uni("書きこみました。")){ //|| this.tag2ch == "" ) { - if( moz2chCharset.sjis2uni(this.htmlTitle) == this.getString("writeSuccess")){ + if( moz2chCharset.euc2uni(this.htmlTitle) == this.getString("writeSuccess")){ rv = true; } } return rv; }, diff -u5r chrome_/content/moz2ch/kakiko.xul chrome/content/moz2ch/kakiko.xul --- chrome_/content/moz2ch/kakiko.xul 2007-06-09 02:34:32.000000000 +0900 +++ chrome/content/moz2ch/kakiko.xul 2007-11-08 21:00:25.282875000 +0900 @@ -349,10 +349,13 @@ var targetView = this.SURETATE ? moz2ch.itaView : moz2ch.sureView; switch(targetView.data.bbsId){ case "2ch": this.kakiko = new moz2ch2chKakiko(); break; + case "jbbs": + this.kakiko = new moz2chJbbsKakiko(); + break; default: alert(moz2ch.getString("noSupportKakiko")); close(); return; } @@ -418,11 +421,11 @@ var ks = document.getElementById("kakikoStatus"); ks.value = ks.value + this.kakiko.msg; function asyncReload ( _this ) { moz2ch.itaView.saveCurSurePos(); - if((_this.SURETATE && moz2ch.itaView.data.url == _this.kakiko.ita.url) || + if((_this.SURETATE && moz2ch.itaView.data.url == _this.kakiko.target.url) || (_this.KAKIKO && moz2ch.itaView.data.url == moz2ch.sureView.data.ita.url)) moz2ch.itaView.reload(); if(_this.KAKIKO) moz2ch.sureView.reload(); close();