// ==UserScript== // @name nico_watch_nicozon // @namespace http://nekomimya.blog28.fc2.com/blog-entry-416.html // @include * // ==/UserScript== //--- Playerリンクの表示位置 ---// //--- disp_sts = 1 ; 左上、2 右上、3 左下、4 右下、 0 はページ内 ---// disp_sts = 2 ; //--- Playerリンク表示領域の透過度 ---// //--- tp_sts = 0.7 ; 0 透明 → 1 不透明 ---// tp_sts = 0.9 ; //--- ニコ動ページ内にiframeでnicozonを表示するかどうかの設定 ---// //--- iframe_sts = 1 ; で表示 、 0 は表示しない ---// iframe_sts = 1 ; //--- 設定終了 ---// curURL = document.URL; vid = (document.URL).split('\/'); nicozon = 'http\:\/\/www\.nicozon\.net\/'; if(curURL.match(/nicovideo\.jp\/watch/)){ areaObj = document.createElement('div'); insObj = document.createElement('div'); insPlc = document.getElementById('PAGEHEADER'); nlink = new Array(); tmp_id = vid[vid.length-1]; if(tmp_id .match(/\?/)){ tmp_id = RegExp.leftContext; } if(tmp_id .match(/\s/)){ tmp_id = tmp_id.replace(/\s/g,''); } if(tmp_id .match(/\W/)){ tmp_id = tmp_id.replace(/\W/g,''); } nlink[0] = nicozon + 'player\.html\?video_id\=' + tmp_id; nlink[1] = nicozon + 'player\.html\?video_id\=' + tmp_id; nlink[2] = nicozon + 'watch\/' + tmp_id; urlDisp = document.createElement('input'); urlDisp.setAttribute('type','text'); urlDisp.setAttribute('value',nlink[nlink.length-1]); insObj.appendChild(urlDisp); areaObj.appendChild(insObj); brObj1 = document.createElement('br'); insObj.appendChild(brObj1); ltxt = new Array('Play(このWindow)','Play(別Window)','nicozonへ移動(保存したい場合はこちらへ)'); elsts= new Array(0,1,0); function addEl(){ window.open(nlink[1],'nzPlayer','directories=0,toolbar=0,scrollbars=0,width=640,height=480'); } spcObj = new Array(); spcObj[0] = document.createTextNode('   '); spcObj[1] = document.createElement('br'); spcObj[2] = document.createTextNode(''); linkObj = new Array(); linkTxt = new Array(); for(i=0;i<=2;i++){ linkObj[i] = document.createElement('a'); linkTxt[i] = document.createTextNode(ltxt[i]); linkObj[i].appendChild(linkTxt[i]); insObj.appendChild(linkObj[i]); insObj.appendChild(spcObj[i]); if(elsts[i]){ linkObj[i].setAttribute('href','javascript\:void(0)\;'); linkObj[i].addEventListener('click',addEl,false); }else{ linkObj[i].setAttribute('href',nlink[i]); } } brObj2 = document.createElement('br'); insObj.appendChild(brObj2); function ifinsert(){ ifurl = document.createElement('input'); ifurl.setAttribute('type','text'); ifurl.setAttribute('value',nlink[2]); ifurl.style.width = '35em'; ifurl.style.marginLeft = '7.5em'; brObj3 = document.createElement('br'); areaObj.appendChild(ifurl); areaObj.appendChild(brObj3); ifObj = document.createElement('iframe'); ifObj.setAttribute('src',nlink[2]); ifObj.setAttribute('style','width\:1140px\;height\:28.8em\;border\:none\;'); areaObj.appendChild(ifObj); } if(iframe_sts){ ifinsert(); } insPlc.appendChild(areaObj); insObj.setAttribute('style','font\-size\:1.5em\;border\:dashed 1px gray\;background\-color\:#ffeeee\;padding\:0.5em;width\:19em\;z-index:100'); switch (disp_sts){ case 1: //左上 insObj.style.position = 'fixed'; insObj.style.top = '1em'; insObj.style.left = '0em'; urlDisp.setAttribute('style','width\:19em\;margin\-bottom\:0.5em\;'); break; case 2: //右上 insObj.style.position = 'fixed'; insObj.style.top = '1em'; insObj.style.right = '0em'; urlDisp.setAttribute('style','width\:19em\;margin\-bottom\:0.5em\;'); break; case 3: //右上 insObj.style.position = 'fixed'; insObj.style.bottom = '0em'; insObj.style.left = '0em'; urlDisp.setAttribute('style','width\:19em\;margin\-bottom\:0.5em\;'); break; case 4: //右上 insObj.style.position = 'fixed'; insObj.style.bottom = '0em'; insObj.style.right = '0em'; urlDisp.setAttribute('style','width\:19em\;margin\-bottom\:0.5em\;'); break; default: if(iframe_sts){ insObj.style.marginLeft = '3.7em'; urlDisp.setAttribute('style','width\:19em\;'); }else{ insObj.style.marginLeft = '6.8em'; urlDisp.setAttribute('style','width\:19em\;margin\-bottom\:0.5em\;'); } break; } insObj.style.opacity = tp_sts ; }else if(curURL.match(/nicozon\.net\/watch/)){ nz = (document.URL).split('\/'); logoObj = document.getElementById('logo'); tonico_url = 'http\:\/\/' + 'www\.nicovideo\.jp\/watch\/' + nz[vid.length-1]; tonico_txt = document.createTextNode('ニコニコ動画の該当ページに移動'); tonico = document.createElement('a'); tonico.setAttribute('href',tonico_url); tonico.appendChild(tonico_txt); logoObj.appendChild(tonico); tonico.setAttribute('style','font\-size\:1.5em\;border\:dashed 1px gray\;background\-color\:#ffeeee\;padding\:0.2em 0.5em\;z-index\:100\;position\:fixed\;top\:0.5em\;left\:0.5em\;'); }else if(!(curURL.match(/nicovideo/)) &&!(curURL.match(/nicozon/)) ){ nsObj = document.getElementsByTagName('script'); naObj = new Array(); ntObj = new Array(); nuObj = new Array(); emObj = new Array(); linkObj0 = new Array(); linkObj1 = new Array(); linkObj2 = new Array(); linkTxt0 = new Array(); linkTxt1 = new Array(); linkTxt2 = new Array(); nlink0 = new Array(); nlink1 = new Array(); nlink2 = new Array(); spcObj0 = new Array(); spcObj1 = new Array(); spcObj2 = new Array(); insObj = new Array(); js = new Array(); ltxt = new Array('Play(このWindow)','Play(別Window)','nicozonへ移動(保存したい場合はこちらへ)'); elsts= new Array(0,1,0); for(i=0;i);