[RTM][JavaScript]非公式ですから!Greasemonkeyスクリプト

Greasemonkeyスクリプトを書いてみた。
(というかGreasemonkeyスクリプトほとんど書いた事無いから、もっとちゃんと調べたいです。

最重要!

動作があやしい
  • 使うとサーバデータが読み込めなくなったりする...?
  • データが変わらない場合もある...?

重要!

あくまで個人で書いた非公式だから、公式の仕様が変わったりしても知らないから。

本当に知らないから。文句はid:rokujyouhitomaにお願いします。

Greasemonkeyスクリプト

これ使うと、タスクの"予測時間"で"1pomo"とか、"pomo"を単位で使える。だれとく?
ひとまず、サーバには保存されてるっぽい。

補足

公式のJSコードを上書きすべく、

(hours|hour|hrs|hr|h)

に"pomo"を足した。

ライセンスとか

ライセンス明記してないけどBSDLisenceでgithubかbitbucketに公開予定です。時間できたらね。

コード
// RTM pomo user script
// version 0.1 BETA!
// 2011-02-21
// Copyright (c) 2011, Ike Tohru
//-------------------------------------------------------------------- //
//-------------------------------------------------------------------- //
// ==UserScript==
// @name rtm pomo
// @namespace 
// @description 
// @include http://www.rememberthemilk.com/home/*
// ==/UserScript==
(function(){
unsafeWindow.rg.prototype.parseTimeEstimate=function(I,H){var O=".",M="0",R="en-GB",U="en-US",Q="undefined";if(!H&&(rtmLanguage!==U&&rtmLanguage!==R)){if(this.timeEstimateCache[I]){return this.timeEstimateCache[I]
}var A=null;if((A=this.parseTimeEstimate(I,true))!==null){return A}var K=this.parseDueDate(I);if(K!==null){I=K[5]}}var J,F,B;var V=false;if(this.timeEstimateCache[I]){return this.timeEstimateCache[I]}J=F=B=0;
var D=/([0-9.]+)\s*(days|day|d)/i.exec(I);if(D!=null){if(typeof D[0]!=Q){J+=parseInt(D[1],10);V=true}}var D=/([0-9.]+)\s*(hours|hour|hrs|hr|h|pomo)/i.exec(I);if(D!=null){if(typeof D[0]!=Q){var E=D[1].indexOf(O);
if(E>-1){if(E>0){F=parseInt(D[1].substring(0,E),10)}else{F=0}B=parseFloat(M+D[1].substring(E,D[1].length))*60}else{F=parseInt(D[1],10)}V=true}}var D=/([0-9.]+)\s*(minutes|minute|mins|min|m)/i.exec(I);if(D!=null){if(typeof D[0]!=Q){B+=parseInt(D[1],10);
V=true}}if(V===false){return null}B=J*24*60+F*60+B;this.timeEstimateCache[I]=B;return B};
unsafeWindow.rg.prototype.parseTimeSpec=function(B,V){var Q=".",O="0",U="_",R="undefined";var A=false;var K,F,D;var V=!!V;var M=null;var I=[B,V].join(U);if(this.timeSpecCache[I]){return this.timeSpecCache[I]
}K=F=D=0;var H=/([0-9]+)\:([0-9]+)\:([0-9]+)/i.exec(B);if(H!=null){if(typeof H[0]!=R){K=parseInt(H[1],10);F=parseInt(H[2],10);D=parseInt(H[3],10);A=true;M=B.indexOf(H[0])}}else{var H=/([0-9.]+)\s*(hours|hour|hrs|hr|h|pomo)/i.exec(B);
if(H!=null){if(typeof H[0]!=R){var J=H[1].indexOf(Q);if(J>-1){K=parseInt(H[1].substring(0,J),10);F=parseFloat(O+H[1].substring(J,H[1].length))*60}else{K=parseInt(H[1],10)}A=true;M=B.indexOf(H[0])}}var H=/([0-9.]+)\s*(minutes|minute|mins|min|m)/i.exec(B);
if(H!=null){if(typeof H[0]!=R){F+=parseInt(H[1],10);A=true;if(M===null){M=B.indexOf(H[0])}}}var H=/([0-9.]+)\s*(seconds|second|secs|sec|s)/i.exec(B);if(H!=null){if(typeof H[0]!=R){D+=parseInt(H[1],10);
A=true;if(M===null){M=B.indexOf(H[0])}}}}D=K*60*60+F*60+D;if(A){var E=V?[D,M]:D;this.timeSpecCache[I]=E;return E}else{return null}};rg.prototype.splitTimeSpec=function(A){var B,E,D;B=E=D=0;D=A;B=Math.floor(D/(60*60));
E=Math.floor(D%(60*60));D=Math.floor(E%60);E=Math.floor(E/60);return[B,E,D]};
}());