/g;
var result;var arr=new Array();
while ((result = patt.exec(Content)) != null) {
arr.push(result[1]);
}
if(arr.length==0){
ac_alert('error', 'bili脚本提示:特殊API返回错误,无法继续执行脚本', 5000);
}else{
ac_alert('success', '请求特殊api成功重构播放器', 3000);
var div='';
for(var i in arr){
div+=''+(parseInt(i)+1)+'P';
}
$('div.z').html('');
var cid=arr[(parseInt(page)-1)];
Replace_player(aid, cid, '#bofqi',page,1); //自动修复--在视频页面,宽度高度是固定值
}
}
}
});
}
//api获取cid
function api_get_cid(aid, cid, page) {
if ($("#bofqi_embed,#bofqi").size() == 0) {
special_get_cids(aid, page);
init_video_page('未获取[本页面使用了特殊替换功能]', aid, cid, page);
ac_alert('success', '本页面使用了特殊替换功能[比如原本需要登录才能查看的视频]', 3000);
} else {
if (cid) { //cid已知的情况下不请求api
init_video_page('未获取[由于已知cid不请求api]', aid, cid, page);
ac_alert('success', '此页面cid已知的情况下不请求api', 3000);
} else { //cid无法获取的时候请求api
var url = 'http://api.bilibili.com/view?type=json&appkey=8e9fc618fbd41e28&batch=1&id=' + aid;
GM_xmlhttpRequest({
method: 'GET',
url: url,
synchronous: false,
onload: function(responseDetails) {
if (responseDetails.status == 200) {
var Content = eval('(' + responseDetails.responseText + ')');
var list = Content.list;
var p = page - 1;
if (typeof(list) != 'undefined') {
var lp = (typeof(list[p]) == 'undefined') ? list[0] : list[p]; //针对某些aid只有一个cid但是有分P的情况
var cid = lp.cid;
var type = lp.type;
init_video_page(type, aid, cid, page);
ac_alert('success', '请求api得到了相关信息', 3000);
} else {
//alert('bili脚本提示:API返回错误');
ac_alert('error', 'bili脚本提示:API返回错误', 3000);
}
}
}
});
}
if (GM_getValue('auto_locate') == 1) { //自动滚动功能前置,以便api缓慢的时候也能及时响应
$('html,body').animate({
scrollTop: $("#bofqi_embed,#bofqi").offset().top - 30
}, 500);
}
}
}
function init_video_page(type, aid, cid,page) {
insert_html(type, 'video_page'); //UI
//修复360浏览器flash霸占脚本设置区域
if (GM_getValue('init360') == 1) {
$("#bili_fix_script,#bili-fix-player-installed").mouseover(function() {
$("#bofqi,#bofqi_embed").addClass("hide");
});
$("#bili_fix_script,#bili-fix-player-installed").mouseout(function() {
$("#bofqi,#bofqi_embed").removeClass("hide");
});
}
var cid_xml_url = 'http://comment.bilibili.com/' + cid + '.xml';
$('#down_cid_xml').attr('href', cid_xml_url); //弹幕下载
if (GM_getValue('auto') == '1') { //如果打开了自动修复
Replace_player(aid, cid, '#bofqi',page,1); //自动修复--在视频页面,宽度高度是固定值
}
$('#av_source').attr('cid', cid); //给av_source设置cid
$("#app_qrcode_box").before('');
$('#div_fix_letv_button').click(function() {
$('#bofqi').html(window_player.fix_letv(aid, cid));
});
}
//在新番页面,通过弹窗,获取aid,cid然后进行播放
function aid_build_player(aid) {
//aid=971415;这个aid奇葩出错
var url = 'http://api.bilibili.com/view?type=json&appkey=8e9fc618fbd41e28&batch=1&id=' + aid;
GM_xmlhttpRequest({
method: 'GET',
url: url,
synchronous: false,
onload: function(responseDetails) {
if (responseDetails.status == 200) {
var Content = eval('(' + responseDetails.responseText + ')');
var list = Content.list;
if (typeof(list) != 'undefined') {
//默认播放第一个分P-------------------
var p = 0;
var lp = (typeof(list[p]) == 'undefined') ? list[0] : list[p];
var cid = lp.cid;
Replace_player(aid, cid, '#player_content #bofqi',1,0);
$('#div_fix_letv_button').attr('aid', aid);
$('#div_fix_letv_button').attr('cid', cid);
//分P列表和播放器------------------------------
for (var z in list) {
if (!isNaN(z)) { //擦,遍历这个数组居然跑出多两个bsearch和binsert字段,明明是数字,处理掉
var cid = list[z].cid;
var p = parseInt(z) + 1;
var title = list[z].part;
if(p==1){
var lclass="on";
}else{
var lclass="";
}
$('#window_play_list').append('[' + p + 'p]' + title + '');
}
}
if (!unsafeWindow.player_fullwin)
setTimeout(fix_player_fullwin.fix_window, 0);
//弹窗的分P播放
$('.single_play_list').click(
function() {
$('#window_play_info').html('正在播放第' + $(this).find('a').html() + '');
var info = $(this).attr('data-field');
var pattern = /aid=(\d+)&cid=(\d+)&page=(\d+)/ig;
var val = pattern.exec(info);
var aid = val === null ? '' : val[1];
var cid = val === null ? '' : val[2];
var page=val === null ? '' : val[3];
window.location.hash = "page=" + page;
$('#div_fix_letv_button').attr('aid', aid);
$('#div_fix_letv_button').attr('cid', cid);
Replace_player(aid, cid, '#player_content #bofqi',page,0);
});
} else {
ac_alert('info', '弹窗解析错误,请关闭弹窗重试,如果再次出现,请直接打开播放页播放', 3000);
}
}
}
});
}
/**
-------------------------------控制 Control-------------------------------------
*/
function window_player_init() {
//弹窗------------------------------
//2015-09-24番剧bangumi页面的弹窗
$('#episode_list li .t').each(
function() {
if (typeof($(this).attr('has_window_btn')) == 'undefined') {
$(this).attr('has_window_btn', 'true');
var href = $(this).parent('a').attr('href');
var pattern = /\/video\/av(\d+)\//ig;
var content = pattern.exec(href);
var aid = content ? (content[1]) : '';
if (aid != '') {
var title = $(this).html();
$(this).prepend('弹▶');
$(this).find('a').click(function() {
single_player(aid, title)
});
}
}
});
//新番列表弹窗UI
$('.vd_list .title').each(
function() {
if (typeof($(this).attr('has_window_btn')) == 'undefined') {
$(this).attr('has_window_btn', 'true');
var href = $(this).attr('href');
var pattern = /\/video\/av(\d+)\//ig;
var content = pattern.exec(href);
var aid = content ? (content[1]) : '';
if (aid != '') {
var title = $(this).html();
$(this).prepend('弹▶');
$(this).find('a').click(function() {
single_player(aid, title)
});
}
}
});
//搜索列表专题List
$('.s_bgmlist li a').each(
function() {
if (typeof($(this).attr('has_window_btn')) == 'undefined') {
$(this).attr('has_window_btn', 'true');
var href = $(this).attr('href');
var pattern = /\/video\/av(\d+)/ig;
var content = pattern.exec(href);
var aid = content ? (content[1]) : '';
$('.s_v_l li .s_bgmlist ul li a').css('display', 'inline'); //防止A标签换行导致无法点击
if (aid != '') {
var title = '第<' + $(this).html() + '>P';
$(this).parent('li').prepend('弹▶ ');
$(this).parent('li').find('bl').click(function() {
single_player(aid, title)
});
}
}
});
//搜索列表弹窗UI
$('#video-list li .title').each(
function() {
if (typeof($(this).attr('has_window_btn')) == 'undefined') {
$(this).attr('has_window_btn', 'true');
var href = $(this).attr('href');
var pattern = /\/video\/av(\d+)\//ig;
var content = pattern.exec(href);
var aid = content ? (content[1]) : '';
if (aid != '') {
var title = $(this).html();
$('#video-list li .title').css('display', 'inline'); //不换行
$(this).prepend('弹▶');
$(this).find('a').click(function() {
single_player(aid, title)
});
}
}
});
//带缩略图弹窗UI、和侧栏新投稿弹窗UI、首页的推荐栏弹窗、侧栏列表弹窗UI
$('.vidbox.v-list li a,.bgm-calendar.bgmbox li a,.rlist li a,.rm-list li a,.r-list li a,.top-list li a').each(
function() {
if (typeof($(this).attr('has_window_btn')) == 'undefined') {
$(this).attr('has_window_btn', 'true');
var href = $(this).attr('href');
var pattern = /\/video\/av(\d+)\//ig;
var content = pattern.exec(href);
var aid = content ? (content[1]) : '';
if (aid != '') {
var title = $(this).find('.t').html();
$(this).find('.t').prepend('弹▶');
$(this).find('a').click(function() {
single_player(aid, title)
});
}
}
});
//专题
$('.vidbox.zt .t').each(
function() {
if (typeof($(this).attr('has_window_btn')) == 'undefined') {
$(this).attr('has_window_btn', 'true');
var href = typeof($(this).attr('href')) == 'undefined' ? $(this).parent('a').attr('href') : $(this).attr('href');
var pattern = /\/video\/av(\d+)\//ig;
var content = pattern.exec(href);
var aid = content ? (content[1]) : '';
//$('.vidbox.zt li a').css('display','inline');//防止A标签换行导致无法点击
if (aid != '') {
var title = $(this).html();
$(this).prepend('弹▶');
$(this).find('a').click(function() {
single_player(aid, title)
});
}
}
});
//旧版首页分区列表
$('.video li a,.video-wrapper li a').each(
function() {
if (typeof($(this).attr('has_window_btn')) == 'undefined') {
$(this).attr('has_window_btn', 'true');
var href = $(this).attr('href');
var pattern = /\/video\/av(\d+)\//ig;
var content = pattern.exec(href);
var aid = content ? (content[1]) : '';
if (aid != '') {
var title = $(this).find('.t').html();
$(this).find('.t').prepend('弹▶');
$(this).find('.t a').click(function() {
single_player(aid, title)
});
}
}
});
//2016新列表
$('.v-list li a').each(
function() {
if (typeof($(this).attr('has_window_btn')) == 'undefined') {
$(this).attr('has_window_btn', 'true');
var href = $(this).attr('href');
var pattern = /\/video\/av(\d+)\//ig;
var content = pattern.exec(href);
var aid = content ? (content[1]) : '';
if (aid != '') {
var title = $(this).find('.t').html();
$(this).find('.t').prepend('弹▶');
$(this).find('.t a').click(function() {
single_player(aid, title)
});
}
}
});
//弹窗初始化
}
//弹窗默认的第一P,建立弹窗播放器并建立分P列表===click事件应该在each事件之后执行
function single_player(aid, title) {
$('.player-list').remove(); //移除播放列表
window.location.hash = "page=1" ;
var a = '脚本(`・ω・´)正在加载中
';
var list_html = '';
var title_html = '★Mrak Go ' + title.replace('弹▶', '') + ' ▶';
setTimeout(function() {
creat(title_html, a); //创建可视化窗口
$('.dialogcontainter').after(list_html);
$('#window_play_info').html('正在播放第1P');
$('#window_play_title').html('固定播放器收缩分P列表[在左边]点我专治乐视、搜狐源(乐视源或者搜狐源无法播放的情况请点击)');
//切换分P按钮
$('#list_control_button').click(function() {
var flag = $(".player-list").css("display");
if (flag == "none") {
$(".player-list").show();
$('#list_control_button').html('收缩分P列表');
$('#list_control_button').css('background', 'none repeat scroll 0% 0% #0CB3EE');
} else {
$(".player-list").hide();
$('#list_control_button').html('显示分P列表');
$('#list_control_button').css('background', 'none repeat scroll 0% 0% #FF2C14');
}
});
//固定播放器按钮
$('#div_positon_button').click(function() {
var p = $('.dialogcontainter').css('position');
if (p == "fixed") {
$('.dialogcontainter').css('position', 'absolute');
$('.player-list').css('position', 'absolute');
$('#div_positon_button').html('浮动播放器');
$('#div_positon_button').css('background', 'none repeat scroll 0% 0% #FECD3E');
} else {
$('.dialogcontainter').css('position', 'fixed');
$('.player-list').css('position', 'fixed');
$('#div_positon_button').html('固定播放器');
$('#div_positon_button').css('background', 'none repeat scroll 0% 0% #E54C7E');
}
});
//专治乐视
$('#div_fix_letv_button').click(function() {
var aid = $('#div_fix_letv_button').attr('aid');
var cid = $('#div_fix_letv_button').attr('cid');
$('#player_content #bofqi').html(window_player.fix_letv(aid, cid));
});
//弹窗播放器收藏功能
$('.mark_my_video').click(function() {
var aid = $(this).attr('data-field');
$.ajax({
type: 'POST',
url: 'http://www.bilibili.com/m/stow',
data: 'dopost=save&aid=' + aid + '&stow_target=stow&ajax=1',
success: function(r) {
ac_alert('success', '收藏成功!!!!("▔□▔)/', 3000);
},
error: function(r) {
//alert('出错,请重试!');
ac_alert('error', '出错,请重试!', 3000);
},
dataType: 'text'
});
});
}, 0);
setTimeout(function() {
aid_build_player(aid);
}, 0);
}
//END弹窗------------------------------
//模仿AC娘的消息通知效果
function ac_alert(type, text, time) {
switch (type) {
case 'success':
$('#notice_area').append('
' + text + '
');
element_action(time);
break;
case 'error':
$('#notice_area').append(' ' + text + '
');
element_action(time);
break;
case 'info':
$('#notice_area').append(' ' + text + '
');
element_action(time);
break;
case 'warn':
$('#notice_area').append(' ' + text + '
');
element_action(time);
break;
case 'inverse':
$('#notice_area').append(' ' + text + '
');
element_action(time);
break;
case 'normal':
$('#notice_area').append(' ' + text + '
');
element_action(time);
break;
default:
return false;
}
}
function element_action(time) {
$(".notice_item:last-child").each(function() {
var t = $(this);
setTimeout(function() {
t.css({
'margin-left': 0,
'margin-bottom': '8px'
});
}, 10);
setTimeout(function() {
t.css({
'margin-left': '-' + t.width() - 40 + "px",
opacity: "0.3"
});
}, time);
setTimeout(function() {
t.remove();
}, time + 1000);
});
}
//替换播放器----------------------------
//取出aid和分P
var url = document.location.href;
var aid_reg = /\/av(\d+)\/(?:index_(\d+)\.html)?/ig;
var aid_array = aid_reg.exec(url);
var aid = aid_array === null ? '' : aid_array[1]; //aid
var page = aid_array === null ? '1' : typeof(aid_array[2]) == 'undefined' ? '1' : aid_array[2]; //分p
//模仿AC娘的消息通知效果
var html = '';
$('body').append(html);
//播放器的html
if (aid == '') {
insert_html('', '');
if (GM_getValue('window_play')) {
//ac_alert('info', '弹窗使能初始化...', 3000);
window_player_init(); //执行弹窗函数
addNodeInsertedListener('.vidbox.v-list li a,.bgm-calendar.bgmbox li a,.rlist li a,.rm-list li a,.r-list li a,.top-list li a,.vidbox.zt .t,#video-list li a', function() {
window_player_init(); //ajax重新渲染,有可能导致浏览器卡顿,若卡顿请删除此行(仅此一行)
});
}
} else { //cid=3841639
//ac_alert('info', '视频页面使能初始化...', 3000);
var content = $('#bofqi').html();
var cid_reg = /cid=(\d+)/;
var cid_array = cid_reg.exec(content);
var cid = cid_array === null ? '' : cid_array[1]; //cid
api_get_cid(aid, cid, page); //按照aid和分p获取cid并且替换播放器
//当设置悬浮评论分页栏时,增加css
if (GM_getValue('pagebox_display') == 1) {
if (url.indexOf('video/av') > -1) {
var css = '.pagelistbox.top{z-index:999;position:fixed;bottom:10px; left:0px;background-image:url("http://nightlyfantasy.github.io/Bili_Fix_Player/bg.png");box-shadow: 3px 3px 13px rgba(34, 25, 25, 0.4);}';
GM_addStyle(css);
}
}
//当设置评论移除和谐娘时,增加css
if (GM_getValue('pagebox_harm') == 1) {
if (url.indexOf('video/av') > -1) {
var css = '.quote{display:block!important;}span.content a,.content>a[href="javascript:;"]{display:none!important;}';
GM_addStyle(css);
}
}
}
//HTML5弹幕播放
function html5_cm_play(aid,cid, div, cm, page,width,height,type) {
if (typeof(cid) == 'undefined') {
cid = $('#div_fix_letv_button').attr('cid');
}
//ac_alert('inverse', 'HTML5弹幕播放', 3000);
var url = 'http://interface.bilibili.com/playurl?platform=android&cid=' + cid + '&quality=3&otype=json&appkey=8e9fc618fbd41e28&type=mp4';
GM_xmlhttpRequest({
method: 'GET',
url: url,
synchronous: false,
onload: function(responseDetails) {
if (responseDetails.status == 200) {
var content = responseDetails.responseText;
var c = eval('(' + content + ')');
console.log(c);
var durl = c.durl;
if (typeof(durl) == 'undefined') {
ac_alert('error', 'bili脚本提示:API返回错误:api调用失败,无法解析,请重试一次!', 3000);
} else {
var url = durl[0]['url'];
if (cm) { //HTML5弹幕播放
if(div=='#bofqi'){//视频页面
//摘自http://tieba.baidu.com/p/4355490187
unsafeWindow.location.href = ['javascript:(function(d){window.loadHTML5=function(g,f){var h=1==Number(f)?"":"#page="+f;$.getJSON("http://www.bilibili.com/m/html5?aid="+g+"&page="+f+"&sid="+__GetCookie("sid"),function(a){a.src&&(window.html5data=a,$("#bofqi").html(\'\'),$.getScript("http://static.hdslb.com/js/simple.v2.min.js",function(){(new BiliH5Player).create({get_from_local:!0,comment:window.html5data.cid,image:window.html5data.img,video_url:\''+url+'\'})}))})};d&&loadHTML5(d[0].split(\'=\')[1],d[1].split(\'=\')[1])})(document.querySelector(\'[itemprop="embedURL"]\').content.match(/(aid=[^&]*|page=[^&]*)/g));void(0)'].join('');
}else{//弹窗页面
unsafeWindow.location.href = ['javascript:function loadHTML5(){$.getJSON("http://www.bilibili.com/m/html5?aid='+aid+'&page='+page+'&sid="+__GetCookie("sid"),function(a){a.src&&(window.html5data=a,$("#bofqi").html(\'\'),$.getScript("http://static.hdslb.com/js/simple.v2.min.js",function(){(new BiliH5Player).create({get_from_local:!0,comment:\'http://comment.bilibili.com/'+cid+'.xml\',image:window.html5data.img,video_url:\''+url+'\'})}))})};loadHTML5();void(0)'].join('');
//console.log('javascript:function loadHTML5(){$.getJSON("http://www.bilibili.com/m/html5?aid='+aid+'&page='+page+'&sid="+__GetCookie("sid"),function(a){a.src&&(window.html5data=a,$("#bofqi").html(\'\'),$.getScript("http://static.hdslb.com/js/simple.v2.min.js",function(){(new BiliH5Player).create({get_from_local:!0,comment:\'http://comment.bilibili.com/'+cid+'.xml\',image:window.html5data.img,video_url:\''+url+'\'})}))})};loadHTML5();void(0)');
$(div).css({
width: width+"px",
height: height+"px"
});
}
} else { //html5无弹幕播放
if(!type){
$(div).css({
width: width+"px",
height: height+"px"
});
}
$(div).html('');
}
}
}
}
});
}
//css插入
var css = '#load_manual_window{z-index:300;width:30px;cursor: pointer;left:40px;bottom:50px;position:fixed;padding: 0px 0px 10px;transition: all 0.1s linear 0s;background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.5);color: #FFF;border: medium none;}#load_manual_window:hover{background-color: rgba(0, 0, 0, 0.7);}.singleplaybtn{cursor:pointer;box-shadow: 0px 1px 1px rgba(34, 25, 25, 0.4);background:none repeat scroll 0% 0% #684D75!important;border-radius: 4px;line-height: 14px;padding: 1px 3px;text-align: center;font-family: Calibri;font-size: 12px;min-width: 18px;}.bfpbtn{font-size:12px;height:25.6px;line-height:25.6px;padding:0px 2px;transition-property:#000,color;transition-duration:0.3s;box-shadow:none;color:#FFF;text-shadow:none;border:medium none;background:none repeat scroll 0% 0% #00A1CB!important;}.bfpbtn.active{background:none repeat scroll 0% 0% #F489AD!important;}.bfpbtn.normal{background:none repeat scroll 0% 0% #B9B9B9!important;}.bfpbtn.notice{background-color:#A300C0!important;}.font{font-size:11px!important;}#window_play_list li{float:left;position:relative;width:30em;border-bottom:1px solid #B0C4DE;font:100% Verdana,Geneva,Arial,Helvetica,sans-serif;}.ui.corner.label{height:0px;border-width:0px 3em 3em 0px;border-style:solid;border-top:0px solid transparent;border-bottom:3em solid transparent;border-left:0px solid transparent;border-right-color:rgb(217,92,92)!important;transition:border-color 0.2s ease 0s;position:absolute;content:"";right:0px;top:0px;z-index:-1;width:0px;}.ui.corner.label i{display:inline-block;margin:3px 0.25em 0px 17px;width:1.23em;height:1em;font-weight:800!important;}.dialogcontainter{z-index:20000!important;}.dialogcontainter{height:400px;width:400px;border:1px solid #14495f;position:fixed;font-size:13px;}.dialogtitle{height:26px;width:auto;background-color:#C6C6C6;}.dialogtitleinfo{float:left;height:20px;margin-top:2px;margin-left:10px;line-height:20px;vertical-align:middle;color:#FFFFFF;font-weight:bold;}.dialogtitleico{float:right;height:20px;width:21px;margin-top:2px;margin-right:5px;text-align:center;line-height:20px;vertical-align:middle;background-image:url("http://nightlyfantasy.github.io/Bili_Fix_Player/bg.gif");background-position:-21px 0px}.dialogbody{padding:10px;width:auto;background-color:#FFFFFF;background-image:url("http://nightlyfantasy.github.io/Bili_Fix_Player/bg.png");}.dialogbottom{bottom:1px;right:1px;cursor:nw-resize;position:absolute;background-image:url("http://nightlyfantasy.github.io/Bili_Fix_Player/bg.gif");background-position:-42px -10px;width:10px;height:10px;font-size:0;}.button-small{font-size:12px;height:25.6px;line-height:25.6px;padding:0px 5px;}.button-flat-action{transition-duration:0.3s;box-shadow:none;background:none repeat scroll 0% 0% #7DB500;color:#FFF!important;text-shadow:none;border:medium none;border-radius:3px;}.player-list{box-shadow: 3px 3px 13px rgba(34, 25, 25, 0.4);position:fixed;z-index:1000;left:10px;top:50px;width:400px!important;background-image:url("http://nightlyfantasy.github.io/Bili_Fix_Player/bg.png");min-height:200px;max-height:400px;overflow: auto;}#player_content #bofqi{position:absolute;top:65px;left:10px;right:10px;bottom:10px;}#window-player{bottom:0;height:100%;left:0;right:0;top:0;width:100%;}.title:hover .single_player{display:inline;}.t:hover .single_player{display:inline;}a.single_player{display:none;}#bofqi_embed.hide,#bofqi.hide,#player_content.hide{margin-left:3000px!important;transition:0.5s;-moz-transition:0.5s;-webkit-transition:0.5s;-o-transition:0.5s;}#bofqi_embed,#bofqi,#player_content{transition:0.5s;-moz-transition:0.5s;-webkit-transition:0.5s;-o-transition:0.5s;}';
var css1='#notice_area{position:fixed;bottom:24px;left:0;z-index:10;margin:0;padding:0;width:auto;text-align:left;z-index:9999}.notice_item{position:relative;z-index:11;display:table;margin:0 -500px 0;padding:0 8px 0 2px;width:auto;height:auto;border-left:4px solid #288ECF;border-radius:1px;background-color:#3A9BD9;box-shadow:0 1px 3px rgba(0,0,0,.302);color:#FFF;white-space:pre-wrap;word-break:break-all;font-weight:700;font-size:12px;line-height:24px;transition:all .5s ease 0s}.notice_success{background:#54A954 none repeat scroll 0 0;border-left:4px solid #54A954}.notice_error{background:#C13932 none repeat scroll 0 0;border-left:4px solid #C13932}.notice_info{background:#58BDDB none repeat scroll 0 0;border-left:4px solid #58BDDB}.notice_warn{background:#F9A125 none repeat scroll 0 0;border-left:4px solid #F9A125}.notice_inverse{background:#262626 none repeat scroll 0 0;border-left:4px solid #262626}.notice_normal{background:#004FCC none repeat scroll 0 0;border-left:4px solid #004FCC}';//这是仿ac娘消息框的UI
GM_addStyle(css);GM_addStyle(css1);
//高大上的拖动DIV和改变DIV大小功能,来自互联网脚本之家www.jb51.net,还有大花猫的元素监听
var z=1,i=1,left=10;var isIE=(document.all)?true:false;var Extend=function(destination,source){for(var property in source){destination[property]=source[property];}}
var Bind=function(object,fun,args){return function(){return fun.apply(object,args||[]);}}
var BindAsEventListener=function(object,fun){var args=Array.prototype.slice.call(arguments).slice(2);return function(event){return fun.apply(object,[event||window.event].concat(args));}}
var CurrentStyle=function(element){return element.currentStyle||document.defaultView.getComputedStyle(element,null);}
function create(elm,parent,fn){var element=document.createElement(elm);fn&&fn(element);parent&&parent.appendChild(element);return element};function addListener(element,e,fn){element.addEventListener?element.addEventListener(e,fn,false):element.attachEvent("on"+e,fn)};function removeListener(element,e,fn){element.removeEventListener?element.removeEventListener(e,fn,false):element.detachEvent("on"+e,fn)};var Class=function(properties){var _class=function(){return(arguments[0]!==null&&this.initialize&&typeof(this.initialize)=='function')?this.initialize.apply(this,arguments):this;};_class.prototype=properties;return _class;};var Dialog=new Class({options:{Width:400,Height:400,Left:100,Top:10,Titleheight:26,Minwidth:200,Minheight:200,CancelIco:true,ResizeIco:true,Info:"标题",Content:"无内容",Zindex:2},initialize:function(options){this._dragobj=null;this._resize=null;this._cancel=null;this._body=null;this._x=0;this._y=0;this._fM=BindAsEventListener(this,this.Move);this._fS=Bind(this,this.Stop);this._isdrag=null;this._Css=null;this.Width=this.options.Width;this.Height=this.options.Height;this.Left=this.options.Left;this.Top=this.options.Top;this.CancelIco=this.options.CancelIco;this.Info=this.options.Info;this.Content=this.options.Content;this.Minwidth=this.options.Minwidth;this.Minheight=this.options.Minheight;this.Titleheight=this.options.Titleheight;this.Zindex=this.options.Zindex;Extend(this,options);Dialog.Zindex=this.Zindex
var obj=['dialogcontainter','dialogtitle','dialogtitleinfo','dialogtitleico','dialogbody','dialogbottom'];for(var i=0;i