// The cookie name to use for storing the blog-side comment session cookie. var mtCookieName = "mt_blog4_user"; var mtCookieDomain = ".liquiddive.com"; var mtCookiePath = "/frostbite/"; var mtCookieTimeout = 14400; function mtHide(id) { var el = (typeof id == "string") ? document.getElementById(id) : id; if (el) el.style.display = 'none'; } function mtShow(id) { var el = (typeof id == "string") ? document.getElementById(id) : id; if (el) el.style.display = 'block'; } function mtAttachEvent(eventName,func) { var onEventName = 'on' + eventName; var old = window[onEventName]; if( typeof old != 'function' ) window[onEventName] = func; else { window[onEventName] = function( evt ) { old( evt ); return func( evt ); }; } } function mtFireEvent(eventName,param) { var fn = window['on' + eventName]; if (typeof fn == 'function') return fn(param); return; } if(!this.JSON){JSON={};}(function(){function f(n){return n<10?'0'+n:n;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z';};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}if(typeof rep==='function'){value=rep.call(holder,key,value);}switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i= 1 && pageNum !== commentsTotalPages) { u.toggleVisibility.show('next-comments'); u.toggleVisibility.show('top-next-comments'); } if(pageNum===1 || nav.style.visibility==='hidden') { u.toggleVisibility.hide('prev-comments'); u.toggleVisibility.hide('top-prev-comments'); } if(pageNum===commentsTotalPages || nav.style.visibility==='hidden') { u.toggleVisibility.hide('next-comments'); u.toggleVisibility.hide('top-next-comments'); } } function _nextPage () { if(pageNum < commentsTotalPages) { pageNum++; _updateComments(); } } function _previousPage() { if(pageNum > 1) { pageNum--; _updateComments(); } } function _findIdMatch (id) { var len = MT.commentIds.length; while (len--) { if (MT.commentIds[len] == id) { commentAnchor = "comment-" + id; commentArrId = len; return true; } } return false; } function _setCurrentComments() { var commentsOnPage = pageNum != commentsTotalPages ? commentsOffset + commentsPerPage : totalComments; _setCurrentCommentsContent([commentsOffset+1," - ",commentsOnPage].join('')); } function _setCurrentCommentsContent(currentCommentsHTML) { currentCommentsSpan.innerHTML = currentCommentsHTML; topCurrentCommentsSpan.innerHTML = currentCommentsHTML; } function _setCommentContent(commentHTML) { commentContentDiv.innerHTML = commentHTML; } function _updateComments() { var comments, jsonUrl; isLoading = true; _setCurrentCommentsContent(loadingIcon); _setCommentOffset(); jsonUrl = [ "http://www.liquiddive.com/mt5/mt-comments.cgi?__mode=comment_listing&direction=", direction, "&entry_id=", entryID, "&limit=", commentsPerPage, "&offset=", _getCommentOffset() ].join(''); if (!commentAnchor) { commentAnchor = "comments-content"; } if(cache.hasOwnProperty(jsonUrl)) { _refreshComments(cache[jsonUrl]); isLoading = false; } else { M.connect(jsonUrl,c.JSON,function (json) { cache[jsonUrl] = json.comments; _refreshComments(json.comments); isLoading = false; }); } } function _refreshComments(commentData) { _setCommentContent(commentData); _setCurrentComments(); window.location.hash = 'reset'; window.location.hash = commentAnchor; _toggleNavLinks(); } })(); function mtRelativeDate(ts, fds) { var now = new Date(); var ref = ts; var delta = Math.floor((now.getTime() - ref.getTime()) / 1000); var str; if (delta < 60) { str = '直前'; } else if (delta <= 86400) { // less than 1 day var hours = Math.floor(delta / 3600); var min = Math.floor((delta % 3600) / 60); if (hours == 1) str = '1 時間前'; else if (hours > 1) str = '2 時間前'.replace(/2/, hours); else if (min == 1) str = '1 分前'; else str = '2 分前'.replace(/2/, min); } else if (delta <= 604800) { // less than 1 week var days = Math.floor(delta / 86400); var hours = Math.floor((delta % 86400) / 3600); if (days == 1) str = '1 日前'; else if (days > 1) str = '2 日前'.replace(/2/, days); else if (hours == 1) str = '1 時間前'; else str = '2 時間前'.replace(/2/, hours); } return str ? str : fds; } function mtEditLink(entry_id, author_id) { var u = mtGetUser(); if (! u) return; if (! entry_id) return; if (! author_id) return; if (u.id != author_id) return; var link = '編集'; document.write(link); } function mtCommentFormOnFocus() { // if CAPTCHA is enabled, this causes the captcha image to be // displayed if it hasn't been already. mtShowCaptcha(); } var mtCaptchaVisible = false; function mtShowCaptcha() { var u = mtGetUser(); if ( u && u.is_authenticated ) return; if (mtCaptchaVisible) return; var div = document.getElementById('comments-open-captcha'); if (div) { div.innerHTML = '
Fatal error: Uncaught exception 'MTException' with message 'Undefined captcha provider. (none)' in /virtual/frostbite/public_html/mt5/php/lib/captcha_lib.php:59 Stack trace: #0 /virtual/frostbite/public_html/mt5/php/lib/function.mtcaptchafields.php(18): CaptchaFactory::get_provider('none') #1 /virtual/frostbite/public_html/frostbite/templates_c/%%EE^EE2^EE2F3DF3%%mt%3A1405.php(561): smarty_function_mtcaptchafields(Array, Object(MTViewer)) #2 /virtual/frostbite/public_html/mt5/php/extlib/smarty/libs/Smarty.class.php(1265): include('/virtual/frostb...') #3 /virtual/frostbite/public_html/mt5/php/mt.php(593): Smarty->fetch('mt:1405', '4;/frostbite/mt...') #4 /virtual/frostbite/public_html/frostbite/mtview.php(5): MT->view() #5 {main} thrown in /virtual/frostbite/public_html/mt5/php/lib/captcha_lib.php on line 59