// ==UserScript== // @name 動畫瘋·Plus // @namespace none // @version 1.6.1 // @description 修改彈幕字型、分級標識自動同意、自動點擊按此跳過廣告、分級鎖定、可在全螢幕環境下發送彈幕 // @author xu3u04u48 // @match *://ani.gamer.com.tw/animeVideo.php?sn=* // @grant none // @icon https://i2.bahamut.com.tw/anime/baha_s.png // @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js // @downloadURL none // ==/UserScript== $(document).on("mozfullscreenchange webkitfullscreenchange fullscreenchange", fullscreenChange); function fullscreenChange(){ var isFullScreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen; var fullScreen_bullet_send = ''; if(isFullScreen){ plus_bullet_control(); plus_bullet_save(); $(".vjs-res-button").after(fullScreen_bullet_send); $(".bullet-send").draggable({ containment: "html", stop: function () { var top = $("#plus_bullet-send").css("top"); var win_height = $(window).height(); if(parseInt(top) > (win_height - 100)){ $("#plus_bullet-send").css("top",(win_height - 100)); } var top_save = $("#plus_bullet-send").css("top"); var left_save = $("#plus_bullet-send").css("left"); localStorage.setItem('top_save',top_save); localStorage.setItem('left_save',left_save); } }); $("input[type='button']").click(function(){ $("#plus_bullet-control").css("display","none"); }); }else{ $("#plus_bullet-send").remove(); $("#plus_bullet-control").remove(); $(".bullet-control").css("display","none"); $("#plus_fullScreen-bullet-send").remove(); } } function plus_bullet_control(){ var bullet_send = '
'; var bullet_control = ' '; $("video").after(bullet_send); $("video").after(bullet_control); $("#plus_bullet-send").addClass("plus_bullet-send"); $("#plus_bullet-control").addClass("plus_bullet-control"); } function plus_bullet_save(){ var top_save = localStorage.getItem('top_save'); var left_save = localStorage.getItem('left_save'); if(top_save == null || left_save == null ){ $("#plus_bullet-send").css("top","538px"); $("#plus_bullet-send").css("left","805px"); var top_setup = "538px"; var left_setup = "805px"; localStorage.setItem('top_save',top_setup); localStorage.setItem('left_save',left_setup); }else{ $("#plus_bullet-send").css("top",top_save); $("#plus_bullet-send").css("left",left_save); } } $('head').append(` `); $(document).on('DOMSubtreeModified',function () { //console.log(); /*GM_deleteValue('password_save'); GM_deleteValue('grading'); GM_deleteValue('ad'); GM_deleteValue('font'); GM_deleteValue('grading_save');*/ //取得先前的儲存值 var ncc_save = localStorage.getItem("grading"); //自動同意分級標識 var advertising_save = localStorage.getItem('ad'); //自動點擊按此跳過廣告 var font_save = localStorage.getItem('font'); //文字 var password_save = localStorage.getItem('password_save');//密碼 var grading_save = localStorage.getItem('grading_save');//分級 //如果沒有先前的儲存值,設定預設值 if(ncc_save == null){ncc_save = localStorage.setItem('grading','false');} if(advertising_save == null){advertising_save = localStorage.setItem('ad','false');} if(font_save == null){font_save = localStorage.setItem('font','none');} if(grading_save == null){grading_save = localStorage.setItem('grading_save','none');} //載入偵測是否有password_save if(password_save != null ){ $("#plus-value").remove(); $("#plus-value2").css("display",''); } var grading_selected = $('#grading-password').val(grading_save);//載入時預設分級選單的值 var grading = $('#grading-password :selected').val();//載入時取分級選單的值 if( $('#grading-password').val() != "none"){ //分級選單 var rating_img = $(".rating > img").attr("src");//取動畫標題旁邊的圖片連結 var rating_img_cut = rating_img.substr(30);//切割圖片連結字串 switch (grading_save) { case '6': if(rating_img_cut == "TW-ALL.gif"){ $(".plus-frame").remove(); } break; case '12': if(rating_img_cut == "TW-ALL.gif" || rating_img_cut == "TW-6TO12.gif"){ $(".plus-frame").remove(); } break; case '15': if(rating_img_cut == "TW-ALL.gif" || rating_img_cut == "TW-6TO12.gif" || rating_img_cut == "TW-12TO18.gif"){ $(".plus-frame").remove(); } break; case '18': if(rating_img_cut != "TW-18UP.gif"){ $(".plus-frame").remove(); } break; } }else{ $(".plus-frame").remove(); } $("#grading-password").change(function(){ grading = $('#grading-password :selected').val();//取