PK ›,D 2 PopupStatusYoutube.js20130911a/PopupStatusYoutube/PK
ΨœCŠ÷r¦üS üS 4 PopupStatusYoutube.js20130911a/PopupStatusYoutube.js//ã€ç™»éŒ²å ´æ‰€ã€‘リンクã€URLExec
//ã€ãƒ©ãƒ™ãƒ«ã€‘Youtubeå‹•ç”»æƒ…å ±
//ã€å†…容】Youtubeå‹•ç”»æƒ…å ±ã®ãƒãƒƒãƒ—アップ
//ã€ã‚³ãƒžãƒ³ãƒ‰ã€‘${SCRIPT:FrxS} PopupStatusYoutube.js
//ã€URLExec*】https?://(?:\w+\.)?youtube\.(?:\w+|co\.\w+)/.*?v=[\-_\w]{11}.* $& ${V2CSCRIPT:FrxS} PopupStatusYoutube.js
//ã€URLExec*(çŸç¸®URL用)】http://youtu\.be/[\-_\w]{11} $& ${V2CSCRIPT:FrxS} PopupStatusYoutube.js
//ã€æ›´æ–°æ—¥æ™‚】2013/09/11 å†ç”Ÿã§ããªã„å‹•ç”»ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã®yt:state name=processing時ã«ã‚¹ã‚¯ãƒªãƒ—トエラーãŒç™ºç”Ÿã™ã‚‹ã‚±ãƒ¼ã‚¹ã®å›žé¿ã‚³ãƒ¼ãƒ‰ã‚’追åŠ
//ã€ã‚¹ã‚¯ãƒªãƒ—ト】
// 実行時間計測用
// var odate = new Date;
// ============ è¨å®šã“ã“ã‹ã‚‰ ============
var closePopup = true;// リンククリックã§ãƒãƒƒãƒ—アップを閉ã˜ã‚‹ã‹ã©ã†ã‹
var browseExt = false;// リンククリック時ã€å¤–部ブラウザã§é–‹ãã‹ã©ã†ã‹(urlExecãŒå„ªå…ˆ)
var urlExec = true;// リンククリック時ã€URLExec.datã®è¨å®šã«å¾“ã†ã‹ã©ã†ã‹
var browserPath = 'C:/Program Files/Internet Explorer/iexplore.exe';//URLEcex.datã®è¨å®šã«å¾“ã†ã¨ãã«ä½¿ç”¨ã™ã‚‹è¦å®šã®ãƒ–ラウザã®ãƒ‘ス(「\ã€ã¯ã€Œ/ã€ã«ç½®æ›ã—ã¦ãã ã•ã„)
var zeroDate = true;// 日付ã®æ¡æƒãˆã‚’ã™ã‚‹ã‹ã©ã†ã‹
var zeroTime = true;// 時間ã®æ¡æƒãˆã‚’ã™ã‚‹ã‹ã©ã†ã‹
var commentMax = 500;// 表示ã™ã‚‹æŠ•ç¨¿è€…コメントã®æœ€å¤§æ–‡å—æ•°(0ã§ç„¡åˆ¶é™)
var formatType = 2;// 数値ã®ãƒ•ã‚©ãƒ¼ãƒžãƒƒãƒˆï¼ˆ0:ãªã— 1:3æ¡ã‚«ãƒ³ãƒžåŒºåˆ‡ã‚Š 2:日本語表記)
var tagSeparater = ' ';//ã‚¿ã‚°ã®åŒºåˆ‡ã‚Šæ–‡å—(åŠè§’スペース㯠)
var maxPopupWidth = 500;// ãƒãƒƒãƒ—アップã®æœ€å¤§æ¨ªå¹…
var closeOnMouseExit = true;// ãƒãƒƒãƒ—アップã‹ã‚‰ãƒžã‚¦ã‚¹ã‚«ãƒ¼ã‚½ãƒ«ã‚’外ã—ãŸæ™‚ã€è‡ªå‹•çš„ã«é–‰ã˜ã‚‹ã‹ã©ã†ã‹
var errorPopup = true;// エラーã®æ™‚ã€ã‚¨ãƒ©ãƒ¼å†…容をãƒãƒƒãƒ—アップã¨ã—ã¦è¡¨ç¤º
var ratingBarWidth = 150;// レーティングãƒãƒ¼ã®é•·ã•ï¼ˆå˜ä½pxを想定)
var downloaderPath = '';// ダウンãƒãƒ¼ãƒ€ã®ãƒ‘ス(「\ã€ã¯ã€Œ/ã€ã«ç½®æ›ã—ã¦ãã ã•ã„)
var downloaderArgs = '$PSYURL';// ダウンãƒãƒ¼ãƒ€ã«æ¸¡ã™å¼•æ•°($PSYURLã‚’å‹•ç”»URLã«ç½®æ›ã—ã¦æ¸¡ã—ã¾ã™)
var popupFocusable = true;// ãƒãƒƒãƒ—アップã®æ–‡å—列をé¸æŠžã§ãるよã†ã«ã™ã‚‹ã‹ã©ã†ã‹
// ============ è¨å®šã“ã“ã¾ã§ ============
var info = [];
v2c.setStatus('PopupStatusYoutubeスクリプト実行ä¸...');
PopupStatusYoutube();
// v2c.print( '実行時間:'+ (new Date - odate) + 'msec\n' );
// リンククリック時ã«å‘¼ã°ã‚Œã‚‹é–¢æ•°
function redirectURL( u ) {
if ( u ) {
// ãƒãƒƒãƒ—アップをå†åº¦é–‹ã
if ( !closePopup ) {
v2c.context.setPopupHTML( html );
v2c.context.setMaxPopupWidth( maxPopupWidth );
v2c.context.setRedirectURL( true );
v2c.context.setPopupID( info.vid );
v2c.context.setPopupFocusable( popupFocusable );
}
// URLExec
if ( urlExec ) {
v2c.println('teste');
var f = openURLExec( u );
if (f) return;
}
// 外部ブラウザã§é–‹ã
if ( browseExt ) {
v2c.println('teste');
v2c.browseURLExt( u );
}
// JDICãŒã‚ã‚Œã°å†…部ブラウザã§é–‹ã
else{
v2c.browseURL( u );
}
}
return;
}
function formSubmitted ( u, sm, sd ) {
var data = '';
if ( sd.match( /(.+)=.+/i ) ) {
var data = RegExp.$1;
data = decodeURIComponent(data);
switch (data) {
case 'Fix':
v2c.context.closeOriginalPanel();
closePopup = true;
v2c.context.setPopupHTML( html );
v2c.context.setCloseOnLinkClick( false )
v2c.context.setCloseOnMouseExit( false );
v2c.context.setMaxPopupWidth( maxPopupWidth );
v2c.context.setTrapFormSubmission( true );
v2c.context.setRedirectURL( true );
v2c.context.setPopupID( info.vid );
v2c.context.setPopupFocusable( popupFocusable );
break;
case 'DL':
if ( downloaderPath ) {
downloaderArgs = downloaderArgs.replace( /\$PSYURL/, info.url );
v2c.exec( [ downloaderPath, downloaderArgs ] );
} else {
v2c.alert( 'ダウンãƒãƒ¼ãƒ€ãƒ¼ã®ãƒ‘スをè¨å®šã—ã¦ãã ã•ã„' );
}
break;
case 'Ext':
// 外部ブラウザボタンクリック時ã€
// ãƒãƒƒãƒ—アップを閉ã˜ãªã„å ´åˆã¯ã“ã®ä¸‹ã®è¡Œã‚’コメントアウト
v2c.context.closeOriginalPanel();
v2c.browseURLExt( info.url );
break;
case 'CopyTitle':
v2c.context.setClipboardText( info.title );
break;
case 'CopyURL':
v2c.context.setClipboardText( info.url );
break;
case 'CopyTytle+URL':
v2c.context.setClipboardText( info.title + '\n' + info.url );
break;
case 'CopyInfo':
var str = info.title + '\n'
+ info.url + '\n'
+ 'å†ç”Ÿæ™‚間:' + info.time
+ '\n投稿者å:' + info.name
+ '\n投稿日時:' + info.ye + '/' + info.mo + '/' + info.da + ' ' + info.ho + ':' + info.mi + ':' + info.se
+ '\nå†ç”Ÿå›žæ•°ï¼š' + info.viewCount
+ '回\nãŠæ°—ã«å…¥ã‚Šï¼š' + info.favCount
+ '\n評価:高評価 ' + info.like + ' 人ã€ä½Žè©•ä¾¡ ' + info.dislike + ' 人';
v2c.context.setClipboardText( str );
break;
}
}
return;
}
function PopupStatusYoutube() {
info.vid = ''; // å‹•ç”»ID
info.url = ''; // å‹•ç”»URL
info.thumb = ''; // サムãƒã‚¤ãƒ«URL
info.title = ''; // 動画タイトル
info.date = ''; // 投稿日時
info.ye = ''; // 西暦
info.mo = ''; // 月
info.da = ''; // æ—¥
info.ho = ''; // 時
info.mi = ''; // 分
info.se = ''; // 秒
info.ms = ''; // ミリ秒 ※多分常ã«0
info.name = ''; // 投稿者å
info.uri = ''; // 投稿者URI
info.keywords = 'ãªã—'; // ã‚ーワード(ã‚¿ã‚°)
info.time = ''; // å†ç”Ÿæ™‚é–“
info.viewCount = '0'; // å†ç”Ÿå›žæ•°
info.favCount = '0'; // ãŠæ°—ã«å…¥ã‚Šæ•°
info.comment = '説明ã¯ã‚ã‚Šã¾ã›ã‚“'; // 投稿者コメント
info.like = 0; // 高評価
info.dislike = 0; // 低評価
info.likeWidth = 0; // 高評価ãƒãƒ¼ã®é•·ã•
info.state = ''; // ã‚¨ãƒ©ãƒ¼æƒ…å ±
// ãƒãƒƒãƒ—アップIDã®åˆæœŸåŒ–
var pid = 'idstring';
// URLオブジェクトã®å–å¾—
var url = v2c.context.link;
info.url = url;
// URLオブジェクトãŒã‚ã‚‹ã‹ã©ã†ã‹ã®ç¢ºèª
if ( !url ) {
v2c.print( 'URLå–得失敗\n\n' );
if ( errorPopup ) onErrorPopup( 'URLå–得失敗' );
return;
}
// URLãŒYoutubeã‹ã©ã†ã‹
if ( url.toString().match( /h?t?tps?:\/\/(?:\w+\.)?youtube\.(?:\w+|co\.\w+)\/.*?v=([\-_\w]{11}).*/i ) ) {
info.vid = RegExp.$1;
var xmlUrl = 'http://gdata.youtube.com/feeds/api/videos/' + info.vid;
} else if ( url.toString().match( /h?t?tps?:\/\/youtu\.be\/([\-_\w]{11})/i ) ) {
info.vid = RegExp.$1;
var xmlUrl = 'http://gdata.youtube.com/feeds/api/videos/' + info.vid;
}
else{
if ( errorPopup ) onErrorPopup( 'Youtubeã®URLã§ã¯ãªã„' );
v2c.print( 'Error:Youtubeã®URLã§ã¯ãªã„\n' );
return;
}
// VIDEO_IDå–得失敗
if ( !info.vid ) {
v2c.print( 'Error:VIDEO_IDå–得失敗\n' + url + '\n' );
if ( errorPopup ) onErrorPopup( 'VIDEO_IDå–得失敗' );
return;
}
// åŒã˜URLã®ãƒãƒƒãƒ—アップを開ã„ã¦ã„ãŸã‚‰çµ‚了
if ( v2c.context.getPopupOfID( info.vid ) ) {
v2c.print( 'Error:åŒã˜URLã®ãƒãƒƒãƒ—アップ\n' );
return;
}
// XML DOMオブジェクトã®ä½œæˆ
try {
var dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance();
var db = dbf.newDocumentBuilder();
var doc = db.parse( xmlUrl ); // GET
}
catch (e) {
v2c.print( 'Error:XMLã®å–å¾—ã«å¤±æ•—\n' + e + '\n' );
if ( errorPopup ) {
if ( e.toString().indexOf('java.io.FileNotFoundException') != -1 ) {
onErrorPopup( 'ã“ã®å‹•ç”»ã¯å‰Šé™¤ã•ã‚Œã¦ã„ã¾ã™', info.vid );
} else if ( e.toString().indexOf('Server returned HTTP response code: 403') != -1 ) {
onErrorPopup( 'å‹•ç”»æƒ…å ±ã«ã‚¢ã‚¯ã‚»ã‚¹å‡ºæ¥ã¾ã›ã‚“\nã“ã®å‹•ç”»ã¯éžå…¬é–‹ç‰ã®ç†ç”±ã§é–²è¦§ã§ããªã„å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™', info.vid );
} else {
onErrorPopup( 'å‹•ç”»æƒ…å ±ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã«å¤±æ•—ã—ã¾ã—ãŸ', info.vid );
}
}
return;
}
// XML解æž
traceNodes( doc );
// 投稿日時をUTC→ãƒãƒ¼ã‚«ãƒ«æ™‚é–“ã« ISO8601å½¢å¼ ä¾‹:2010-01-01T00:00:00.000Z
if( info.date.match( /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d{3})Z/ ) ) {
var dd = new Date( RegExp.$1, RegExp.$2, RegExp.$3, RegExp.$4, RegExp.$5, RegExp.$6, RegExp.$7 );
info.ye = dd.getUTCFullYear().toString();
info.mo = dd.getUTCMonth().toString();
info.da = dd.getUTCDate().toString();
info.ho = dd.getUTCHours().toString();
info.mi = dd.getUTCMinutes().toString();
info.se = dd.getUTCSeconds().toString();
info.ms = dd.getUTCMilliseconds().toString();
// 12月=0月?
if ( info.mo==0 ) {
info.mo = '12';
}
// 日付ã®æ¡æƒãˆ
if ( zeroDate ) {
info.mo = zeroPlus( info.mo );
info.da = zeroPlus( info.da );
}
// 時間ã®æ¡æƒãˆ
if ( zeroTime ) {
info.ho = zeroPlus( info.ho );
info.mi = zeroPlus( info.mi );
info.se = zeroPlus( info.se );
}
}
// ã‚ーワードã«ãƒªãƒ³ã‚¯ã‚’付ã‘ã‚‹
info.keywords = info.keywords.replace( ' ', '' );
info.keywords = info.keywords.replace( ' ', '' );
tmp = info.keywords.split( ',' );
if ( info.keywords != 'ãªã—' ) {
info.keywords = '';
for ( i = 0; i < tmp.length; i++ ) {
info.keywords = info.keywords
+ ''
+ tmp[i] + '' + tagSeparater;
}
}
// å†ç”Ÿæ™‚é–“ã®æ•´å½¢
info.time = zeroPlus( parseInt( info.time / 3600 ) ) + ':'
+ zeroPlus( parseInt ( ( info.time % 3600 ) / 60 ) ) + ':'
+ zeroPlus( ( info.time % 3600 ) % 60 );
// コメントã®æ–‡å—数制é™ã®é©ç”¨
// コメントをjavascriptã®Stringå½¢å¼ã«å¤‰æ›
info.comment += '';
if ( commentMax ) {
tmp = info.comment;
tmp2 = 0;
reg = new RegExp( '(https?:\/\/[\-_\.!~*\'\(\)a-zA-Z0-9;\/\?:\@&=?+\$,%#]+)', 'i' );
// コメントä¸ã®URLãŒé€”ä¸ã§åˆ‡ã‚Œãªã„よã†ã«ã™ã‚‹ãŸã‚ã®å‡¦ç†
while(1){
if( tmp.match( reg ) ) {
tmp2 = tmp2 + RegExp.leftContext.length + RegExp.$1.length;
if( tmp2 > commentMax ){
commentMax = tmp2;
break;
}
tmp = RegExp.rightContext;
}
else{
break;
}
}
// コメントã®ã‚«ãƒƒãƒˆ
if ( info.comment.length > commentMax ) {
info.comment = info.comment.slice( 0, commentMax ) + ' ...';
}
}
// コメントã«ãƒªãƒ³ã‚¯ã‚’付ã‘ã‚‹
tmp = info.comment;
info.comment = '';
while (1) {
if ( tmp.match( reg ) ) {
info.comment = info.comment + RegExp.leftContext
+ '' + RegExp.$1 + '';
tmp = RegExp.rightContext;
}
else {
info.comment += tmp;
break;
}
}
// 数値ã®æ•´å½¢
info.viewCount = formatNum( info.viewCount, formatType );
info.favCount = formatNum( info.favCount, formatType );
// ç½®æ›æ–‡å—ã«ã€Œ$ã€ãŒå…¥ã£ã¦ã„ã‚‹ã¨ã‚¨ãƒ©ãƒ¼ãŒå‡ºã‚‹å•é¡Œã®ä¿®æ£
info.title = (info.title+'').replace( /\$/g, '$' );
info.comment = (info.comment+'').replace( /\$/g, '$' );
info.keywords = (info.keywords+'').replace( /\$/g, '$' );
// エラーã®å ´åˆã‚³ãƒ¡ãƒ³ãƒˆã«ã‚¨ãƒ©ãƒ¼ã®ç†ç”±ã‚’è¨å®š
if ( !info.thumb && info.state ) {
if ( errorPopup ) onErrorPopup( info.state );
v2c.print( 'Error:' + info.state + '\n' );
return;
}
// テンプレートをèªã¿è¾¼ã¿
var fs = java.io.File.separator;
html = v2c.readFile( v2c.saveDir + fs + 'script' + fs + 'PopupStatusYoutube'
+ fs + 'template.txt' );
// デãƒãƒƒã‚°ç”¨ 変数出力
//for ( i in info ) { v2c.print( 'info.' + i + ' = ' + info[i] + '\n' ); }
// パラメータã®ç½®æ›
html = html.replaceAll( '%vid%', info.vid )
.replaceAll( '%thumb%', info.thumb )
.replaceAll( '%title%', info.title )
.replaceAll( '%ye%', info.ye )
.replaceAll( '%mo%', info.mo )
.replaceAll( '%da%', info.da )
.replaceAll( '%ho%', info.ho )
.replaceAll( '%mi%', info.mi )
.replaceAll( '%comment%', info.comment )
.replaceAll( '%name%', info.name )
.replaceAll( '%uri%', info.uri )
.replaceAll( '%keywords%', info.keywords )
.replaceAll( '%time%', info.time )
.replaceAll( '%viewCount%', info.viewCount )
.replaceAll( '%favCount%', info.favCount )
.replaceAll( '%movie%', url )
.replaceAll( '%like%', info.like )
.replaceAll( '%dislike%', info.dislike )
.replaceAll( '%likeWidth%', info.likeWidth );
// ãƒãƒƒãƒ—アップã®è¨å®š
v2c.context.setPopupHTML( html );
v2c.context.setMaxPopupWidth( maxPopupWidth );
v2c.context.setCloseOnMouseExit( closeOnMouseExit );
v2c.context.setTrapFormSubmission( true );
v2c.context.setRedirectURL( true );
v2c.context.setPopupID( info.vid );
v2c.context.setPopupFocusable( popupFocusable );
}
// å…¨ã¦ã®XMLノードを走査
function traceNodes( node ) {
var child = node.getFirstChild();
// åノードãŒç„¡ããªã‚‹ã¾ã§ç¹°ã‚Šè¿”ã—
while ( child != null ) {
// ノードãŒæŒã¤å±žæ€§(NamedNodeMap)
var attrs = child.getAttributes();
// 動画タイトルã®å–å¾—
if ( child.getNodeName() == 'title' ) {
// テã‚ストノード
info.title = child.getFirstChild().getNodeValue();
}
// サムãƒã‚¤ãƒ«URLã®å–å¾—
if ( child.getNodeName() == 'media:thumbnail' ) {
var tmp = attrs.getNamedItem( 'url' ).getNodeValue();
if ( tmp.match( /http:\/\/.+?0\.jpg/i ) ) {
info.thumb = tmp;
}
}
// 投稿日時ã®å–å¾—
if ( child.getNodeName() == 'published' ) {
info.date = child.getFirstChild().getNodeValue();
}
// 投稿者コメントã®å–å¾—
if ( child.getNodeName() == 'content' ) {
//å˜åœ¨ã—ãªã„å ´åˆã‚‚ã‚る為ã€å˜åœ¨ãƒã‚§ãƒƒã‚¯
if( child.getFirstChild() ) {
info.comment = child.getFirstChild().getNodeValue();
}
}
// 投稿者åã®å–å¾—
if ( child.getNodeName() == 'name' ) {
info.name = child.getFirstChild().getNodeValue();
info.uri = 'http://www.youtube.com/user/' + info.name;
}
// 投稿者URLã®å–å¾—
// ã‚ーワード(ã‚¿ã‚°)ã®å–å¾—
if ( child.getNodeName() == 'media:keywords' ) {
// å˜åœ¨ã—ãªã„å ´åˆã‚‚ã‚る為ã€å˜åœ¨ãƒã‚§ãƒƒã‚¯
if( child.getFirstChild() ) {
info.keywords = child.getFirstChild().getNodeValue();
}
}
// å†ç”Ÿæ™‚é–“ã®å–å¾—
if ( child.getNodeName() == 'yt:duration' ) {
// ã‚¿ã‚°ã®å±žæ€§ã¨ã—ã¦æ ¼ç´ã•ã‚Œã¦ã„ã‚‹
if( attrs ) {
// å†ç”Ÿæ™‚é–“(秒)ã®å–å¾—
if( attrs.getNamedItem( 'seconds' ) ) {
info.time = attrs.getNamedItem( 'seconds' ).getNodeValue();
}
}
}
// å†ç”Ÿå›žæ•°ã€ãŠæ°—ã«å…¥ã‚Šæ•°ã®å–å¾—
if ( child.getNodeName() == 'yt:statistics' ) {
if(attrs){
// å†ç”Ÿå›žæ•°ã®å–å¾—
if( attrs.getNamedItem( 'viewCount' ) ) {
info.viewCount = attrs.getNamedItem('viewCount').getNodeValue();
}
// ãŠæ°—ã«å…¥ã‚Šæ•°ã®å–å¾—
if( attrs.getNamedItem( 'favoriteCount' ) ) {
info.favCount = attrs.getNamedItem('favoriteCount').getNodeValue();
}
}
}
// 評価ã®å–å¾—
if ( child.getNodeName() == 'gd:rating' ) {
if(attrs){
var average = attrs.getNamedItem('average').getNodeValue();
var numRaters = attrs.getNamedItem('numRaters').getNodeValue();
// ratingã¯ã€é«˜è©•ä¾¡=5・低評価=1ã®2種ã®ã¿ã¨ã—ã¦ç®—出
if ( average && numRaters ) {
info.like = Math.round( numRaters * ( average - 1 ) / 4 );
info.dislike = numRaters - info.like ;
info.likeWidth = Math.round( ratingBarWidth * ( info.like / numRaters ) );
}
}
}
// å†ç”Ÿã§ããªã„å‹•ç”»ã®ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹
if ( child.getNodeName() == 'yt:state' ) {
if(attrs){
var name = attrs.getNamedItem('name').getNodeValue();
if ( name == 'processing') {
info.state = 'ã“ã®å‹•ç”»ã¯ç¾åœ¨é–²è¦§ã§ãã¾ã›ã‚“。';
} else {
var reasonCode = attrs.getNamedItem('reasonCode').getNodeValue();
if ( reasonCode ) {
if ( reasonCode == 'requesterRegion' ) info.state = 'ã“ã®å‹•ç”»ã¯ãƒ¦ãƒ¼ã‚¶ãƒ¼ã®åœ°åŸŸã§ã¯åˆ©ç”¨ã§ãã¾ã›ã‚“。';
// ã“れ以下ã¯é€šå¸¸403ãŒè¿”る?
else if ( reasonCode == 'private' ) info.state = 'ã“ã®å‹•ç”»ã¯éžå…¬é–‹å‹•ç”»ã§ã™ã€‚';
else if ( reasonCode == 'copyright' ) info.state = 'å‹•ç”»ãŒè‘—作権を侵害ã—ã¦ã„ã¾ã™ã€‚';
else if ( reasonCode == 'inappropriate' ) info.state = 'å‹•ç”»ã«ä¸é©åˆ‡ãªã‚³ãƒ³ãƒ†ãƒ³ãƒ„ãŒå«ã¾ã‚Œã¦ã„ã¾ã™ã€‚';
else if ( reasonCode == 'termsOfUse' ) info.state = 'å‹•ç”»ãŒåˆ©ç”¨è¦ç´„ã«é•åã—ã¦ã„ã¾ã™ã€‚';
else if ( reasonCode == 'suspended' ) info.state = 'å‹•ç”»ã«é–¢é€£ä»˜ã‘られãŸã‚¢ã‚«ã‚¦ãƒ³ãƒˆã¯åœæ¢ã•ã‚Œã¦ã„ã¾ã™ã€‚';
else if ( reasonCode == 'blocked' ) info.state = 'å‹•ç”»ãŒã‚³ãƒ³ãƒ†ãƒ³ãƒ„ã®æ‰€æœ‰è€…ã«ã‚ˆã‚Šãƒ–ãƒãƒƒã‚¯ã•ã‚Œã¦ã„ã¾ã™';
else info.state = '';
}
}
}
}
// å†å¸°
traceNodes( child );
child = child.getNextSibling();
}
return;
}
// æ¡æƒãˆé–¢æ•°
function zeroPlus( str ) {
return ( '0' + str ).slice( -2 );
}
// フォーマット関数
function formatNum( num, type ) {
var str = java.lang.String.valueOf(num);
var tmp = new Array();
var mod,i;
// 3æ¡ã‚«ãƒ³ãƒžåŒºåˆ‡ã‚Š
if ( type == 1 ) {
mod = str.length() % 3;
if ( mod ) {
tmp.push( str.substring( 0, mod ) );
}
for ( i = 0; i < parseInt( str.length() / 3 ); i++) {
tmp.push( str.substring( mod, mod + 3 ) );
mod += 3;
}
return tmp.join(',');
}
// 日本語表記ã€å„„ã¾ã§å¯¾å¿œ
if ( type == 2 ) {
mod = str.length() % 4;
// 億以上
if ( 2 <= parseInt( str.length() / 4 ) ){
if ( mod ) {
tmp.push( str.substring( 0, mod ) + 'å„„' );
}
if ( str.substring( mod, mod + 4 ).match( /0{0,3}([1-9](\d+)?)/ ) ) {
tmp.push( RegExp.$1 + '万' );
}
if ( str.substring( mod + 4, mod + 8 ).match( /0{0,3}([1-9](\d+)?)/ ) ) {
tmp.push( RegExp.$1 );
}
}
// 億未満ã€ä¸‡ä»¥ä¸Š
else if ( 1 <= parseInt( str.length() / 4 ) ) {
if ( mod ) {
tmp.push( str.substring( 0, mod ) + '万' );
}
if ( str.substring( mod, mod + 4 ).match( /0{0,3}([1-9](\d+)?)/ ) ) {
tmp.push( RegExp.$1 );
}
}
// 万未満
else {
tmp.push( str );
}
return tmp.join('');
}
// ãã®ã¾ã¾
else {
return str;
}
}
function onErrorPopup( errStr, vid ) {
if ( !vid ) vid = 'None';
v2c.context.setPopupText( errStr );
v2c.context.setMaxPopupWidth( maxPopupWidth );
v2c.context.setCloseOnMouseExit( true );
v2c.context.setTrapFormSubmission( false );
v2c.context.setRedirectURL( false );
v2c.context.setPopupID( 'PSY_' + vid );
}
function openURLExec( url ) {
var url = new java.lang.String( url );
var fs = java.io.File.separator;
var tmp = v2c.readFile( v2c.saveDir + fs + 'URLExec.dat', 'Shift-JIS' );
if ( !tmp ) {
v2c.println( 'URLExec.datãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“ã§ã—ãŸ' );
return false;
}
var lines = tmp.split( '\n' );
var ptn = java.util.regex.Pattern.compile("^(?