B站直播间SC记录板

实时同步SC、同接、高能和舰长数据,可拖拽移动,可导出,可单个SC折叠,可侧折,可搜索,可记忆配置,可生成图片(右键菜单),活动页可用,直播全屏可用,黑名单功能,不用登录,多种主题切换,自动清除超过12小时的房间SC存储,可自定义SC过期时间,可指定用户进入直播间提示、弹幕高亮和SC转弹幕,可让所有的实时SC以弹幕方式展现,可自动点击天选,可自动跟风发送combo弹幕

  1. // ==UserScript==
  2. // @name B站直播间SC记录板
  3. // @namespace http://tampermonkey.net/
  4. // @homepage https://greasyfork.org/zh-CN/scripts/484381
  5. // @version 12.2.0
  6. // @description 实时同步SC、同接、高能和舰长数据,可拖拽移动,可导出,可单个SC折叠,可侧折,可搜索,可记忆配置,可生成图片(右键菜单),活动页可用,直播全屏可用,黑名单功能,不用登录,多种主题切换,自动清除超过12小时的房间SC存储,可自定义SC过期时间,可指定用户进入直播间提示、弹幕高亮和SC转弹幕,可让所有的实时SC以弹幕方式展现,可自动点击天选,可自动跟风发送combo弹幕
  7. // @author ltxlong
  8. // @match *://live.bilibili.com/1*
  9. // @match *://live.bilibili.com/2*
  10. // @match *://live.bilibili.com/3*
  11. // @match *://live.bilibili.com/4*
  12. // @match *://live.bilibili.com/5*
  13. // @match *://live.bilibili.com/6*
  14. // @match *://live.bilibili.com/7*
  15. // @match *://live.bilibili.com/8*
  16. // @match *://live.bilibili.com/9*
  17. // @match *://live.bilibili.com/blanc/1*
  18. // @match *://live.bilibili.com/blanc/2*
  19. // @match *://live.bilibili.com/blanc/3*
  20. // @match *://live.bilibili.com/blanc/4*
  21. // @match *://live.bilibili.com/blanc/5*
  22. // @match *://live.bilibili.com/blanc/6*
  23. // @match *://live.bilibili.com/blanc/7*
  24. // @match *://live.bilibili.com/blanc/8*
  25. // @match *://live.bilibili.com/blanc/9*
  26. // @icon https://www.bilibili.com/favicon.ico
  27. // @require https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js
  28. // @require https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/html2canvas/1.4.1/html2canvas.min.js
  29. // @grant unsafeWindow
  30. // @grant GM_registerMenuCommand
  31. // @license GPL-3.0-or-later
  32. // ==/UserScript==
  33.  
  34. (function() {
  35. 'use strict';
  36.  
  37. function sc_catch_log(...msg) {
  38. console.log('%c[sc_catch]', 'font-weight: bold; color: white; background-color: #A7C9D3; padding: 2px; border-radius: 2px;', ...msg);
  39. }
  40.  
  41. // 抓取SC :https://api.live.bilibili.com/xlive/web-room/v1/index/getInfoByRoom?room_id=
  42. // 进入直播间的时候开始记录SC
  43. // 开始固定在屏幕左上方一侧,为圆形小图标,可以点击展开,可以拖拽移动,活动页可用,直播全屏也在顶层显示
  44. // 通过Hook实时抓取数据
  45. // 每个直播间隔离保留,用localstorage,并且自动清理时间长的数据
  46. // SC标明发送时间和距离当前的时间差
  47. // SC可折叠,可生成图片(折叠和展开都可以),可搜索
  48. // 黑名单功能
  49. // 右键菜单功能
  50. // 侧折模式功能
  51. // 记忆模式选择功能
  52. // 记忆模式说明:
  53. // 没记:没有记忆配置
  54. // 题记:只记忆主题,所有<题记>房间共用一个主题配置
  55. // 个记:独立记忆当前房间的所有配置
  56. // 全记:所有的房间共用的记忆配置
  57. // 记忆的优先级:
  58. // 全记 > 个记 > 题记
  59. // 进入直播房间的时候会依次检查优先级,来进行自动加载配置
  60. // 例子说明:
  61. // 有四个直播房间:
  62. // A、B、C、D
  63. // 已经打开:A[题记],B[个记]
  64. // 现在打开C房间,会从[全记]->[个记]->[题记]依次检查,都没有则默认是[没记]。
  65. // 当C从[没记]切换到[题记]时,如果[题记]存在记忆的主题,C的主题会自动切换到[题记]记忆的主题,当C切换主题时候,会更新[题记]记忆的主题
  66. // 这个时候,虽然A和C都是[题记]模式,但是主题却不一样,其中C的主题才是[题记]记忆的最新主题,当A页面刷新后,会变为[题记]最新记忆的主题
  67. // 当C从[题记]切换到[个记],[题记]的房间中剔除C,并且C会立即生成自己的独立配置,处于[个记]模式下,C的所有配置操作都会独立记忆
  68. // 当C从[个记]切换到[全记],C的[个记]独立配置会立即删除,并且会将自己的所有配置生成[全记]的配置,如果这个时候,A、B页面刷新,会自动加载[全记]的配置
  69. // 现在打开D房间,由于已经存在[全记]的配置,所以D会自动加载[全记]的配置。
  70. // 如果这个时候,D从[全记]切换到[没记],那么所有页面的[全记]都会失效,最多30秒后,其余[全记]页面的按钮会变为[没记](因为每30秒检查一次)
  71. // 刷新A、B页面,A会自动加载[题记], B会自动加载[个记],即都会恢复为被[全记]影响之前的配置模式
  72. // 总结:
  73. // [个记]的删除时机:从[个记]点击按钮,手动切换到[全记]
  74. // [全记]的删除时机:从[全记]点击按钮,手动切换到[没记]
  75. // [题记]和[全记]的区别:
  76. // [题记]是一个小圈子,这个圈子有自己的主题颜色,每个房间都可以加入其中,切换加入的时候,该房间会被动的染上圈子的主题颜色,并且也有权限改变圈子的颜色
  77. // [全记]是一个全局权限,当有一个房间切换到[全记]时,即拿到了这个全局权限,并且复制自己的所有配置附加在上面,
  78. // 后续每一个新进入/刷新的房间都会自动获得这个全局权限并且自动加载上面的配置,
  79. // 当其中一个房间从[全记]模式切换到[没记]的时候,这个全局权限就会失效,最多30秒后,其余[全记]页面的按钮会变为[没记](因为每30秒检查一次),其余房间刷新页面会恢复被[全记]影响之前的配置模式
  80.  
  81. let room_id = unsafeWindow.location.pathname.split('/').pop();
  82. let sc_url_api = 'https://api.live.bilibili.com/xlive/web-room/v1/index/getInfoByRoom?room_id=';
  83.  
  84. sc_catch_log('url_room_id:', room_id);
  85.  
  86. if (!room_id) { sc_catch_log('获取room_id失败,插件已停止正确的SC存储'); }
  87.  
  88. let sc_url = sc_url_api + room_id; // 请求sc的url(请求是为了获取进入直播间时已经存在的SC)
  89.  
  90. let real_room_id = room_id;
  91.  
  92. let sc_panel_list_height = 400; // 显示面板的最大高度(单位是px,后面会拼接)
  93. let sc_rectangle_width = 302; // 默认302,右侧合适325/388/428(SC刚刚好在弹幕框内/侧折模式记录板紧贴在弹幕框右侧外/侧折模式记录板紧贴在屏幕右侧)(单位是px,后面会拼接)
  94.  
  95. let data_show_top_flag = true; // 是否在页面右侧弹幕滚动框的顶部动态显示数据
  96. let data_show_bottom_flag = true; // 是否在页面右侧弹幕滚动框的底部动态显示数据
  97.  
  98. let sc_localstorage_key = 'live_' + room_id + '_sc';
  99. let sc_sid_localstorage_key = 'live_' + room_id + '_sc_sid';
  100. let sc_live_room_title = '';
  101.  
  102. let sc_keep_time_key = 'live_' + room_id + '_sc_keep_time';
  103. let sc_clear_time_hour = 12; // 大于sc_clear_time_hour(默认12)小时即清除上一次的存储(会自动遍历检测所有存储的房间)
  104. let sc_now_time = (new Date()).getTime();
  105. let sc_keep_time = unsafeWindow.localStorage.getItem(sc_keep_time_key);
  106. let sc_keep_time_flag = 0;
  107.  
  108. let high_energy_num = 0; // 高能数
  109. let high_energy_contribute_num = 0; // 同接数
  110. let sc_guard_num = 0; // 舰长数
  111. let sc_update_date_guard_once = false;
  112. let sc_nesting_live_room_flag = false;
  113. let sc_date_num_nesting_judge_n = 0;
  114.  
  115. let sc_room_blacklist_flag = false;
  116.  
  117. let sc_follow_api = 'https://api.bilibili.com/x/relation?fid=';
  118. let sc_live_room_up_uid = 0; // 主播的uid,查询关注关系用
  119.  
  120. let sc_dm_send_api = 'https://api.live.bilibili.com/msg/send';
  121. let sc_u_frsc = (document.cookie.split(';').map(c=>c.trim()).find(c => c.startsWith('bili_jct=')) || '').split('bili_jct=')[1] || ''; // 发送弹幕用
  122. let sc_combo_dm_recent_send_arr = []; // 已经跟风发送的combo弹幕,发送后,30秒剔除
  123. let sc_auto_dm_send_last_rnd = 0; // 上一次跟风发送combo弹幕的时间s,用于判断至少间隔20秒才再次查询关注
  124. let sc_last_follow_check_flag = false; // 上一次查询关注结果
  125. let sc_combo_dm_send_fail_arr = []; // 发送失败的combo弹幕,用于再次发送判断,失败10秒后或者发送成功后剔除
  126.  
  127. // 0-侧折模式下显示所有的按钮
  128. // 1-侧折模式下隐藏所有的按钮
  129. // 2-侧折模式下按钮的极简模式(只显示菜单和折叠按钮)
  130. // 3-侧折模式下只显示折叠按钮
  131. // 4-侧折模式下只显示菜单按钮
  132. let sc_func_btn_mode = 0;
  133.  
  134. let sc_panel_allow_drag_flag = true; // 是否可以拖拽
  135.  
  136. let sc_side_fold_custom_config = 0; // 侧折模式的自定义:0-默认,1-第一个展开,2-第一个展开时间自定义
  137. let sc_side_fold_custom_time = 0;
  138. let sc_side_fold_custom_first_class = '';
  139. let sc_side_fold_custom_first_timeout_id = '';
  140.  
  141. let sc_start_time_simple_flag = false; // 是否设置SC发送的时间显示为简单的时分
  142. let sc_start_time_show_flag = true; // 是否显示SC发送的具体时间
  143.  
  144. let sc_welt_hide_circle_half_flag = false; // 是否小图标贴边半隐藏
  145.  
  146. let sc_side_fold_custom_each_same_time_flag = false; // 是否每个实时SC都有相同的展开时间
  147. let sc_side_fold_custom_each_same_time_class = '';
  148. let sc_side_fold_custom_each_same_time_timeout_id = '';
  149. let sc_side_fold_custom_auto_run_flag = false; // 是否在运行自动展现SC了
  150. let sc_side_fold_custom_stop_from_auto_flag = false; // 是否自动运行时间到的停止
  151.  
  152. let sc_panel_show_time_mode = 0; // 展开模式下,SC的显示模式:0-默认一直显示,1-停留30秒,2-停留1~120分钟,3-依照SC的时间停留,4-依照SC的时间,同时最多停留1~120分钟
  153. let sc_panel_show_time_each_same = 0.5; // 模式1和2、4,所有SC停留多少分钟,默认半分钟,即30秒
  154. let sc_live_panel_show_time_click_stop_flag = false; // 是否点击【不记忆地显示醒目留言列表】后,过期检查暂停;点击【不记忆地隐藏过期醒目留言】后,过期检查继续
  155.  
  156. let sc_memory = 0; // 0-没记,1-题记,2-个记,3-全记
  157. let sc_switch = 0;
  158. let sc_panel_fold_mode = 0; // 0-最小化,1-侧折,2-展开
  159. let sc_panel_side_fold_simple = false; // 侧折的极简模式
  160. let sc_panel_drag_left = -1;
  161. let sc_panel_drag_top = -1;
  162. let sc_panel_side_fold_flag = false; // 侧折
  163. let sc_item_side_fold_touch_flag = false;
  164. let sc_item_side_fold_touch_oj = {};
  165. let sc_self_memory_config_key = 'live_' + room_id + '_sc_self_memory_config';
  166.  
  167. let sc_isDragging = false;
  168. let sc_isClickAllowed = true;
  169. let sc_drag_start = 0; // 兼容有的时候点击触发拖拽的情况
  170. let sc_offsetX = 0;
  171. let sc_offsetY = 0;
  172. let sc_isListEmpty = true;
  173. let sc_isFullscreen = false;
  174.  
  175. let sc_rectangle_is_slide_down = false;
  176. let sc_rectangle_is_slide_up = false;
  177. let sc_rectangle_mouse_out = true;
  178.  
  179. let sc_live_sidebar_left_flag = false; // 是否设置直播间的右侧滑动按钮在左侧
  180.  
  181. let sc_item_order_up_flag = false; // 是否设置SC的排列顺序是从下往上(最新的在底部)
  182.  
  183. let sc_data_show_high_energy_num_flag = false; // 是否设置数据模块显示高能(默认显示同接)
  184.  
  185. let sc_side_fold_fullscreen_auto_hide_list_flag = false; // 是否设置侧折模式下,切换全屏时,自动隐藏醒目留言列表
  186.  
  187. let sc_side_fold_hide_list_ing_flag = false; // 是否已经不记忆的隐藏醒目留言列表
  188.  
  189. let sc_live_fullscreen_config_separate_memory_flag = false; // 是否设置全屏状态下一些功能设置分开单独记忆
  190.  
  191. let sc_live_special_tip_location = 0; // 0-显示在顶部,1-显示在中间,2-显示在底部
  192. let sc_live_special_tip_uid_arr = []; // 特定用户进入直播间进行提示的用户id数组
  193. let sc_live_special_tip_remark_arr = []; // 特定用户进入直播间进行提示的用户id:备注映射数组
  194. let sc_live_special_tip_await_arr = []; // 正待展示的用户id数组
  195. let sc_live_special_msg_await_arr = []; // 正待展示的用户id数组
  196. let sc_live_special_sc_await_arr = []; // 正待展示的用户id数组
  197. let sc_live_special_tip_str = ''; // 设置提示的原始字符串
  198.  
  199. let sc_live_special_msg_flag = false; // 特定用户的弹幕高亮
  200. let sc_live_special_sc_flag = false; // 特定用户的SC以高亮弹幕出现(记录板还是会显示)
  201. let sc_live_special_sc_no_remain_flag = false; // 是否SC的弹幕到达左侧后不再停留(默认停留10s,是为了看清SC内容,如果SC长度超过屏幕则自动不停留)
  202. let sc_live_special_danmu_mode = 0; // 0-半透明 [样式较大],1-半透明 [样式较小],2-不透明 [样式较大],3-不透明 [样式较小]
  203. let sc_live_sc_to_danmu_show_mode = 0; // 0-半透明 [样式较大],1-半透明 [样式较小],2-不透明 [样式较大],3-不透明 [样式较小]
  204. let sc_live_sc_to_danmu_show_location = 0; // 0-显示在顶部,1-显示在中间,2-显示在底部
  205. let sc_live_sc_to_danmu_show_flag = false; // 是否设置醒目留言以弹幕来展现(侧折模式不再将SC自动展现)
  206. let sc_live_sc_to_danmu_no_remain_flag = false; // 是否SC的弹幕到达左侧后不再停留(默认停留10s,是为了看清SC内容,如果SC长度超过屏幕则自动不停留)
  207. let sc_live_sc_routine_price_arr = [30, 50, 100, 500, 1000, 2000]; // 常规电池价格数组,如果SC2弹幕的价格不在里面就显示
  208.  
  209. let sc_live_special_danmu_show_index_arr = [0, 0, 0, 0, 0, 0]; // 将屏幕分为6个弹幕道:顶部,top 17%,top 34%,top 51%,top 68%,底部。0-没弹幕存在,1-有弹幕存在
  210. let sc_live_special_tip_danmu_cache_arr = []; // 特定用户进入直播间的缓存弹幕
  211. let sc_live_special_msg_danmu_cache_arr = []; // 特定用户的弹幕缓存
  212. let sc_live_sc_to_danmu_cache_arr = []; // 所有用户SC的缓存弹幕
  213. let sc_live_tip_danmu_show_n = 0; // -1-所有在等待,0-解锁,1-上锁
  214. let sc_live_msg_danmu_show_n = 0; // -1-所有在等待,0-解锁,1-上锁
  215. let sc_live_sc_danmu_show_n = 0; // -1-所有在等待,0-解锁,1-上锁
  216. let sc_live_middle_danmu_index_arr = [1, 2, 3, 4];
  217. let sc_live_last_middle_danmu_index = 0; // 记录最后一个中间弹幕的index,1~4,0-还没初始化,则先随机一个
  218. let sc_live_middle_danmu_index_crash_handle_arr = [[3, 1, 4, 2], [4, 3, 2], [3, 4, 1], [1, 2, 4], [2, 1, 3]];
  219. // 弹道冲突后的选择优先级,这样选择观感比较好
  220. // 0: 3->1->4->2
  221. // 1: 4->3->2
  222. // 2: 3->4->1
  223. // 3: 1->2->4
  224. // 4: 2->1->3
  225.  
  226. // fullscreen var 全屏的变量
  227. let sc_panel_list_height_fullscreen = 400; // 高
  228. let sc_rectangle_width_fullscreen = 302; // 宽
  229. let sc_func_btn_mode_fullscreen = 0; // 侧折的按钮模式
  230. let sc_switch_fullscreen = 0; // 主题
  231. let sc_panel_fold_mode_fullscreen = 0; // 折叠模式
  232. let sc_panel_side_fold_simple_fullscreen = false; // 侧折的极简模式
  233. let sc_panel_drag_left_fullscreen = -1; // 位置left
  234. let sc_panel_drag_top_fullscreen = -1; // 位置top
  235. let sc_panel_side_fold_flag_fullscreen = false; // 侧折
  236. let sc_data_show_high_energy_num_flag_fullscreen = false; // 是否设置数据模块显示高能(默认显示同接)
  237.  
  238. // 屏幕分辨率和位置相关的变量
  239. let sc_screen_resolution_change_flag = false; // 屏幕分辨率是否改变
  240. let sc_panel_drag_left_percent = 0;
  241. let sc_panel_drag_top_percent = 0;
  242. let sc_panel_drag_left_fullscreen_percent = 0;
  243. let sc_panel_drag_top_fullscreen_percent = 0;
  244.  
  245. // SC搜索相关变量
  246. let sc_list_search_result_time = 0; // 同一个弹窗的上一次搜索结果的时间戳
  247. let sc_list_search_str = ''; // 同一个弹窗的上一次的搜索关键字符串
  248.  
  249. let sc_list_search_shortkey_flag = true; // 是否开启SC搜索快捷键 ctrl + f,默认开启
  250.  
  251. let sc_last_item_timestamp = 0; // 精确到s的
  252. let sc_last_item_sort = 0; // 区分相同时间s的发送
  253.  
  254. let sc_list_search_div_bg_opacity_range = 90; // 搜索弹窗的透明度0~100
  255.  
  256. // 自动天选的变量
  257. let sc_live_auto_tianxuan_flag = false; // 开启自动点击天选(当前直播间,并且已经关注主播), 默认关闭
  258.  
  259. // 跟风发送combo弹幕的变量
  260. let sc_live_send_dm_combo_flag = false; // 开启跟风发送combo弹幕(当前直播间,并且已经关注主播),默认关闭
  261.  
  262. function sc_screen_resolution_change_check() {
  263. let the_sc_screen_resolution_change_flag = sc_screen_resolution_change_flag;
  264. let live_sc_screen_resolution_str = unsafeWindow.localStorage.getItem('live_sc_screen_resolution_str');
  265. let the_now_screen_resolution_str = unsafeWindow.screen.width + '_' + unsafeWindow.screen.height;
  266. if (live_sc_screen_resolution_str !== null && live_sc_screen_resolution_str !== 'null' && live_sc_screen_resolution_str !== '') {
  267.  
  268. the_sc_screen_resolution_change_flag = the_now_screen_resolution_str !== live_sc_screen_resolution_str;
  269.  
  270. if (the_sc_screen_resolution_change_flag) {
  271. unsafeWindow.localStorage.setItem('live_sc_screen_resolution_str', the_now_screen_resolution_str);
  272. }
  273. } else {
  274. unsafeWindow.localStorage.setItem('live_sc_screen_resolution_str', the_now_screen_resolution_str);
  275. }
  276.  
  277. return the_sc_screen_resolution_change_flag;
  278. }
  279.  
  280. sc_screen_resolution_change_flag = sc_screen_resolution_change_check();
  281.  
  282. function sc_live_special_tip_str_to_arr() {
  283. let sc_special_tip_arr = [];
  284. if (sc_live_special_tip_str) {
  285. sc_special_tip_arr = sc_live_special_tip_str.split(",");
  286.  
  287. for (let t = 0; t < sc_special_tip_arr.length; t++) {
  288. let sc_special_tip_item_str = sc_special_tip_arr[t].replace(/\n/g, '');
  289. let sc_special_tip_item_arr = sc_special_tip_item_str.split("-");
  290. let sc_special_tip_uid = sc_special_tip_item_arr[0];
  291. if (!isNaN(sc_special_tip_uid)) {
  292. sc_live_special_tip_uid_arr.push(sc_special_tip_uid)
  293.  
  294. if (sc_special_tip_item_arr.length > 1 && sc_special_tip_item_arr[1] !== '') {
  295. sc_live_special_tip_remark_arr['"' + sc_special_tip_uid + '"'] = sc_special_tip_item_arr[1] ?? '';
  296. }
  297. }
  298. }
  299.  
  300. sc_live_special_tip_uid_arr = sc_live_special_tip_uid_arr.filter((value, index, self) => {
  301. return self.indexOf(value) === index;
  302. });
  303.  
  304. } else {
  305. sc_live_special_tip_uid_arr = [];
  306. sc_live_special_tip_remark_arr = [];
  307. }
  308. }
  309.  
  310. function sc_config_get_live_special_tip_location() {
  311. let sc_live_special_tip_location_get = unsafeWindow.localStorage.getItem('live_sc_special_tip_location');
  312. if (sc_live_special_tip_location_get !== null && sc_live_special_tip_location_get !== 'null' && sc_live_special_tip_location_get !== '') {
  313. sc_live_special_tip_location = parseInt(sc_live_special_tip_location_get, 10);
  314. }
  315. }
  316.  
  317. function sc_config_get_live_special_tip_str() {
  318. let sc_live_special_tip_str_get = unsafeWindow.localStorage.getItem('live_sc_special_tip_str');
  319. if (sc_live_special_tip_str_get !== null && sc_live_special_tip_str_get !== 'null' && sc_live_special_tip_str_get !== '') {
  320. sc_live_special_tip_str = sc_live_special_tip_str_get;
  321. }
  322. }
  323.  
  324. function sc_config_get_live_special_msg_flag() {
  325. let sc_live_special_msg_flag_get = unsafeWindow.localStorage.getItem('live_sc_special_msg_flag');
  326. if (sc_live_special_msg_flag_get !== null && sc_live_special_msg_flag_get !== 'null' && sc_live_special_msg_flag_get !== '') {
  327. sc_live_special_msg_flag = sc_live_special_msg_flag_get === 'true';
  328. }
  329. }
  330.  
  331. function sc_config_get_live_special_sc_flag() {
  332. let sc_live_special_sc_flag_get = unsafeWindow.localStorage.getItem('live_sc_special_sc_flag');
  333. if (sc_live_special_sc_flag_get !== null && sc_live_special_sc_flag_get !== 'null' && sc_live_special_sc_flag_get !== '') {
  334. sc_live_special_sc_flag = sc_live_special_sc_flag_get === 'true';
  335. }
  336. }
  337.  
  338. function sc_config_get_live_special_danmu_mode() {
  339. let sc_live_special_danmu_mode_get = unsafeWindow.localStorage.getItem('live_sc_special_danmu_mode');
  340. if (sc_live_special_danmu_mode_get !== null && sc_live_special_danmu_mode_get !== 'null' && sc_live_special_danmu_mode_get !== '') {
  341. sc_live_special_danmu_mode = parseInt(sc_live_special_danmu_mode_get, 10);
  342. }
  343. }
  344.  
  345. function sc_config_get_live_sc_to_danmu_show_flag() {
  346. let sc_live_sc_to_danmu_show_flag_get = unsafeWindow.localStorage.getItem('live_sc_to_danmu_show_flag');
  347. if (sc_live_sc_to_danmu_show_flag_get !== null && sc_live_sc_to_danmu_show_flag_get !== 'null' && sc_live_sc_to_danmu_show_flag_get !== '') {
  348. sc_live_sc_to_danmu_show_flag = sc_live_sc_to_danmu_show_flag_get === 'true';
  349. }
  350. }
  351.  
  352. function sc_config_get_live_sc_to_danmu_show_location() {
  353. let sc_live_sc_to_danmu_show_location_get = unsafeWindow.localStorage.getItem('live_sc_to_danmu_show_location');
  354. if (sc_live_sc_to_danmu_show_location_get !== null && sc_live_sc_to_danmu_show_location_get !== 'null' && sc_live_sc_to_danmu_show_location_get !== '') {
  355. sc_live_sc_to_danmu_show_location = parseInt(sc_live_sc_to_danmu_show_location_get, 10);
  356. }
  357. }
  358.  
  359. function sc_config_get_live_sc_to_danmu_show_mode() {
  360. let sc_live_sc_to_danmu_show_mode_get = unsafeWindow.localStorage.getItem('live_sc_to_danmu_show_mode');
  361. if (sc_live_sc_to_danmu_show_mode_get !== null && sc_live_sc_to_danmu_show_mode_get !== 'null' && sc_live_sc_to_danmu_show_mode_get !== '') {
  362. sc_live_sc_to_danmu_show_mode = parseInt(sc_live_sc_to_danmu_show_mode_get, 10);
  363. }
  364. }
  365.  
  366. function sc_config_get_live_special_sc_no_remain_flag() {
  367. let sc_live_special_sc_no_remain_flag_get = unsafeWindow.localStorage.getItem('live_special_sc_no_remain_flag');
  368. if (sc_live_special_sc_no_remain_flag_get !== null && sc_live_special_sc_no_remain_flag_get !== 'null' && sc_live_special_sc_no_remain_flag_get !== '') {
  369. sc_live_special_sc_no_remain_flag = sc_live_special_sc_no_remain_flag_get === 'true';
  370. }
  371. }
  372.  
  373. function sc_config_get_live_sc_to_danmu_no_remain_flag() {
  374. let sc_live_sc_to_danmu_no_remain_flag_get = unsafeWindow.localStorage.getItem('live_sc_to_danmu_no_remain_flag');
  375. if (sc_live_sc_to_danmu_no_remain_flag_get !== null && sc_live_sc_to_danmu_no_remain_flag_get !== 'null' && sc_live_sc_to_danmu_no_remain_flag_get !== '') {
  376. sc_live_sc_to_danmu_no_remain_flag = sc_live_sc_to_danmu_no_remain_flag_get === 'true';
  377. }
  378. }
  379.  
  380. function sc_memory_get_store_mode_all(sc_all_memory_config_json) {
  381. let sc_all_memory_config = JSON.parse(sc_all_memory_config_json);
  382.  
  383. sc_switch = sc_all_memory_config['sc_switch'] ?? 0;
  384. sc_panel_fold_mode = sc_all_memory_config['sc_panel_fold_mode'] ?? 0;
  385. sc_panel_side_fold_flag = sc_all_memory_config['sc_panel_side_fold_flag'] ?? false;
  386. sc_panel_side_fold_simple = sc_all_memory_config['sc_panel_side_fold_simple'] ?? false;
  387. sc_panel_drag_left = sc_all_memory_config['sc_panel_drag_left'] ?? -1;
  388. sc_panel_drag_top = sc_all_memory_config['sc_panel_drag_top'] ?? -1;
  389. sc_func_btn_mode = sc_all_memory_config['sc_func_btn_mode'] ?? 0;
  390. data_show_bottom_flag = sc_all_memory_config['data_show_bottom_flag'] ?? true;
  391. sc_panel_allow_drag_flag = sc_all_memory_config['sc_panel_allow_drag_flag'] ?? true;
  392. sc_side_fold_custom_config = sc_all_memory_config['sc_side_fold_custom_config'] ?? 0;
  393. sc_side_fold_custom_time = sc_all_memory_config['sc_side_fold_custom_time'] ?? 10;
  394. sc_start_time_simple_flag = sc_all_memory_config['sc_start_time_simple_flag'] ?? false;
  395. sc_start_time_show_flag = sc_all_memory_config['sc_start_time_show_flag'] ?? true;
  396. sc_welt_hide_circle_half_flag = sc_all_memory_config['sc_welt_hide_circle_half_flag'] ?? false;
  397. sc_side_fold_custom_each_same_time_flag = sc_all_memory_config['sc_side_fold_custom_each_same_time_flag'] ?? false;
  398. sc_rectangle_width = sc_all_memory_config['sc_rectangle_width'] ?? 302;
  399. sc_panel_list_height = sc_all_memory_config['sc_panel_list_height'] ?? 400;
  400. sc_live_sidebar_left_flag = sc_all_memory_config['sc_live_sidebar_left_flag'] ?? false;
  401. sc_item_order_up_flag = sc_all_memory_config['sc_item_order_up_flag'] ?? false;
  402. sc_data_show_high_energy_num_flag = sc_all_memory_config['sc_data_show_high_energy_num_flag'] ?? false;
  403. sc_side_fold_fullscreen_auto_hide_list_flag = sc_all_memory_config['sc_side_fold_fullscreen_auto_hide_list_flag'] ?? false;
  404. sc_live_fullscreen_config_separate_memory_flag = sc_all_memory_config['sc_live_fullscreen_config_separate_memory_flag'] ?? false;
  405. sc_panel_show_time_mode = sc_all_memory_config['sc_panel_show_time_mode'] ?? 0;
  406. sc_panel_show_time_each_same = sc_all_memory_config['sc_panel_show_time_each_same'] ?? 0.5;
  407. sc_live_panel_show_time_click_stop_flag = sc_all_memory_config['sc_live_panel_show_time_click_stop_flag'] ?? false;
  408. sc_list_search_shortkey_flag = sc_all_memory_config['sc_list_search_shortkey_flag'] ?? true;
  409. sc_list_search_div_bg_opacity_range = sc_all_memory_config['sc_list_search_div_bg_opacity_range'] ?? 90;
  410. sc_live_auto_tianxuan_flag = sc_all_memory_config['sc_live_auto_tianxuan_flag'] ?? false;
  411. sc_live_send_dm_combo_flag = sc_all_memory_config['sc_live_send_dm_combo_flag'] ?? false;
  412.  
  413. sc_panel_drag_left_percent = sc_all_memory_config['sc_panel_drag_left_percent'] ?? 0;
  414. sc_panel_drag_top_percent = sc_all_memory_config['sc_panel_drag_top_percent'] ?? 0;
  415.  
  416. if (sc_panel_drag_left_percent) { sc_panel_drag_left = unsafeWindow.top.document.documentElement.clientWidth * parseFloat(sc_panel_drag_left_percent); }
  417. if (sc_panel_drag_top_percent) { sc_panel_drag_top = unsafeWindow.top.document.documentElement.clientHeight * parseFloat(sc_panel_drag_top_percent); }
  418.  
  419. sc_config_get_live_special_tip_location();
  420. sc_config_get_live_special_tip_str();
  421. sc_live_special_tip_str_to_arr();
  422. sc_config_get_live_special_msg_flag();
  423. sc_config_get_live_special_sc_flag();
  424. sc_config_get_live_special_danmu_mode();
  425. sc_config_get_live_sc_to_danmu_show_flag();
  426. sc_config_get_live_sc_to_danmu_show_location();
  427. sc_config_get_live_sc_to_danmu_show_mode();
  428. sc_config_get_live_special_sc_no_remain_flag();
  429. sc_config_get_live_sc_to_danmu_no_remain_flag();
  430.  
  431. if (sc_panel_fold_mode === 1 && (unsafeWindow.innerWidth - sc_panel_drag_left) < 72) {
  432. sc_panel_drag_left = unsafeWindow.innerWidth - 72;
  433. }
  434. if (sc_panel_fold_mode === 2 && (unsafeWindow.innerWidth - sc_panel_drag_left) < sc_rectangle_width) {
  435. sc_panel_drag_left = unsafeWindow.innerWidth - sc_rectangle_width;
  436. }
  437.  
  438. if (sc_panel_drag_top <= 0) {
  439. sc_panel_drag_top = 0;
  440. }
  441. if (sc_panel_drag_top >= unsafeWindow.innerHeight) {
  442. sc_panel_drag_top = unsafeWindow.innerHeight - sc_panel_list_height;
  443. }
  444.  
  445. // fullscreen var
  446. sc_panel_list_height_fullscreen = sc_all_memory_config['sc_panel_list_height_fullscreen'] ?? 400;
  447. sc_rectangle_width_fullscreen = sc_all_memory_config['sc_rectangle_width_fullscreen'] ?? 302;
  448. sc_func_btn_mode_fullscreen = sc_all_memory_config['sc_func_btn_mode_fullscreen'] ?? 0;
  449. sc_switch_fullscreen = sc_all_memory_config['sc_switch_fullscreen'] ?? 0;
  450. sc_panel_fold_mode_fullscreen = sc_all_memory_config['sc_panel_fold_mode_fullscreen'] ?? 0;
  451. sc_panel_side_fold_simple_fullscreen = sc_all_memory_config['sc_panel_side_fold_simple_fullscreen'] ?? false;
  452. sc_panel_drag_left_fullscreen = sc_all_memory_config['sc_panel_drag_left_fullscreen'] ?? -1;
  453. sc_panel_drag_top_fullscreen = sc_all_memory_config['sc_panel_drag_top_fullscreen'] ?? -1;
  454. sc_panel_side_fold_flag_fullscreen = sc_all_memory_config['sc_panel_side_fold_flag_fullscreen'] ?? false;
  455. sc_data_show_high_energy_num_flag_fullscreen = sc_all_memory_config['sc_data_show_high_energy_num_flag_fullscreen'] ?? false;
  456.  
  457. sc_panel_drag_left_fullscreen_percent = sc_all_memory_config['sc_panel_drag_left_fullscreen_percent'] ?? 0;
  458. sc_panel_drag_top_fullscreen_percent = sc_all_memory_config['sc_panel_drag_top_fullscreen_percent'] ?? 0;
  459.  
  460. if (sc_panel_drag_left_fullscreen_percent) { sc_panel_drag_left_fullscreen = unsafeWindow.top.document.documentElement.clientWidth * parseFloat(sc_panel_drag_left_fullscreen_percent); }
  461. if (sc_panel_drag_top_fullscreen_percent) { sc_panel_drag_top_fullscreen = unsafeWindow.top.document.documentElement.clientHeight * parseFloat(sc_panel_drag_top_fullscreen_percent); }
  462.  
  463. if (sc_panel_fold_mode_fullscreen === 1 && (unsafeWindow.innerWidth - sc_panel_drag_left_fullscreen) < 72) {
  464. sc_panel_drag_left_fullscreen = unsafeWindow.innerWidth - 72;
  465. }
  466. if (sc_panel_fold_mode_fullscreen === 2 && (unsafeWindow.innerWidth - sc_panel_drag_left_fullscreen) < sc_rectangle_width_fullscreen) {
  467. sc_panel_drag_left_fullscreen = unsafeWindow.innerWidth - sc_rectangle_width_fullscreen;
  468. }
  469.  
  470. if (sc_panel_drag_top_fullscreen <= 0) {
  471. sc_panel_drag_top_fullscreen = 0;
  472. }
  473. if (sc_panel_drag_top_fullscreen >= unsafeWindow.innerHeight) {
  474. sc_panel_drag_top_fullscreen = unsafeWindow.innerHeight - sc_panel_list_height_fullscreen;
  475. }
  476. }
  477.  
  478. function sc_memory_get_store_mode_self(sc_self_memory_config_json) {
  479. let sc_self_memory_config = JSON.parse(sc_self_memory_config_json);
  480.  
  481. sc_switch = sc_self_memory_config['sc_switch'] ?? 0;
  482. sc_panel_fold_mode = sc_self_memory_config['sc_panel_fold_mode'] ?? 0;
  483. sc_panel_side_fold_flag = sc_self_memory_config['sc_panel_side_fold_flag'] ?? false;
  484. sc_panel_side_fold_simple = sc_self_memory_config['sc_panel_side_fold_simple'] ?? false;
  485. sc_panel_drag_left = sc_self_memory_config['sc_panel_drag_left'] ?? -1;
  486. sc_panel_drag_top = sc_self_memory_config['sc_panel_drag_top'] ?? -1;
  487. sc_func_btn_mode = sc_self_memory_config['sc_func_btn_mode'] ?? 0;
  488. data_show_bottom_flag = sc_self_memory_config['data_show_bottom_flag'] ?? true;
  489. sc_panel_allow_drag_flag = sc_self_memory_config['sc_panel_allow_drag_flag'] ?? true;
  490. sc_side_fold_custom_config = sc_self_memory_config['sc_side_fold_custom_config'] ?? 0;
  491. sc_side_fold_custom_time = sc_self_memory_config['sc_side_fold_custom_time'] ?? 10;
  492. sc_start_time_simple_flag = sc_self_memory_config['sc_start_time_simple_flag'] ?? false;
  493. sc_start_time_show_flag = sc_self_memory_config['sc_start_time_show_flag'] ?? true;
  494. sc_welt_hide_circle_half_flag = sc_self_memory_config['sc_welt_hide_circle_half_flag'] ?? false;
  495. sc_side_fold_custom_each_same_time_flag = sc_self_memory_config['sc_side_fold_custom_each_same_time_flag'] ?? false;
  496. sc_rectangle_width = sc_self_memory_config['sc_rectangle_width'] ?? 302;
  497. sc_panel_list_height = sc_self_memory_config['sc_panel_list_height'] ?? 400;
  498. sc_live_sidebar_left_flag = sc_self_memory_config['sc_live_sidebar_left_flag'] ?? false;
  499. sc_item_order_up_flag = sc_self_memory_config['sc_item_order_up_flag'] ?? false;
  500. sc_data_show_high_energy_num_flag = sc_self_memory_config['sc_data_show_high_energy_num_flag'] ?? false;
  501. sc_side_fold_fullscreen_auto_hide_list_flag = sc_self_memory_config['sc_side_fold_fullscreen_auto_hide_list_flag'] ?? false;
  502. sc_live_fullscreen_config_separate_memory_flag = sc_self_memory_config['sc_live_fullscreen_config_separate_memory_flag'] ?? false;
  503. sc_panel_show_time_mode = sc_self_memory_config['sc_panel_show_time_mode'] ?? 0;
  504. sc_panel_show_time_each_same = sc_self_memory_config['sc_panel_show_time_each_same'] ?? 0.5;
  505. sc_live_panel_show_time_click_stop_flag = sc_self_memory_config['sc_live_panel_show_time_click_stop_flag'] ?? false;
  506. sc_list_search_shortkey_flag = sc_self_memory_config['sc_list_search_shortkey_flag'] ?? true;
  507. sc_list_search_div_bg_opacity_range = sc_self_memory_config['sc_list_search_div_bg_opacity_range'] ?? 90;
  508. sc_live_auto_tianxuan_flag = sc_self_memory_config['sc_live_auto_tianxuan_flag'] ?? false;
  509. sc_live_send_dm_combo_flag = sc_self_memory_config['sc_live_send_dm_combo_flag'] ?? false;
  510.  
  511. sc_panel_drag_left_percent = sc_self_memory_config['sc_panel_drag_left_percent'] ?? 0;
  512. sc_panel_drag_top_percent = sc_self_memory_config['sc_panel_drag_top_percent'] ?? 0;
  513.  
  514. if (sc_panel_drag_left_percent) { sc_panel_drag_left = unsafeWindow.top.document.documentElement.clientWidth * parseFloat(sc_panel_drag_left_percent); }
  515. if (sc_panel_drag_top_percent) { sc_panel_drag_top = unsafeWindow.top.document.documentElement.clientHeight * parseFloat(sc_panel_drag_top_percent); }
  516.  
  517. sc_config_get_live_special_tip_location();
  518. sc_config_get_live_special_tip_str();
  519. sc_live_special_tip_str_to_arr();
  520. sc_config_get_live_special_msg_flag();
  521. sc_config_get_live_special_sc_flag();
  522. sc_config_get_live_special_danmu_mode();
  523. sc_config_get_live_sc_to_danmu_show_flag();
  524. sc_config_get_live_sc_to_danmu_show_location();
  525. sc_config_get_live_sc_to_danmu_show_mode();
  526. sc_config_get_live_special_sc_no_remain_flag();
  527. sc_config_get_live_sc_to_danmu_no_remain_flag();
  528.  
  529. if (sc_panel_fold_mode === 1 && (unsafeWindow.innerWidth - sc_panel_drag_left) < 72) {
  530. sc_panel_drag_left = unsafeWindow.innerWidth - 72;
  531. }
  532. if (sc_panel_fold_mode === 2 && (unsafeWindow.innerWidth - sc_panel_drag_left) < sc_rectangle_width) {
  533. sc_panel_drag_left = unsafeWindow.innerWidth - sc_rectangle_width;
  534. }
  535.  
  536. if (sc_panel_drag_top <= 0) {
  537. sc_panel_drag_top = 0;
  538. }
  539. if (sc_panel_drag_top >= unsafeWindow.innerHeight) {
  540. sc_panel_drag_top = unsafeWindow.innerHeight - sc_panel_list_height;
  541. }
  542.  
  543. sc_memory = 2;
  544.  
  545. // fullscreen var
  546. sc_panel_list_height_fullscreen = sc_self_memory_config['sc_panel_list_height_fullscreen'] ?? 400;
  547. sc_rectangle_width_fullscreen = sc_self_memory_config['sc_rectangle_width_fullscreen'] ?? 302;
  548. sc_func_btn_mode_fullscreen = sc_self_memory_config['sc_func_btn_mode_fullscreen'] ?? 0;
  549. sc_switch_fullscreen = sc_self_memory_config['sc_switch_fullscreen'] ?? 0;
  550. sc_panel_fold_mode_fullscreen = sc_self_memory_config['sc_panel_fold_mode_fullscreen'] ?? 0;
  551. sc_panel_side_fold_simple_fullscreen = sc_self_memory_config['sc_panel_side_fold_simple_fullscreen'] ?? false;
  552. sc_panel_drag_left_fullscreen = sc_self_memory_config['sc_panel_drag_left_fullscreen'] ?? -1;
  553. sc_panel_drag_top_fullscreen = sc_self_memory_config['sc_panel_drag_top_fullscreen'] ?? -1;
  554. sc_panel_side_fold_flag_fullscreen = sc_self_memory_config['sc_panel_side_fold_flag_fullscreen'] ?? false;
  555. sc_data_show_high_energy_num_flag_fullscreen = sc_self_memory_config['sc_data_show_high_energy_num_flag_fullscreen'] ?? false;
  556.  
  557. sc_panel_drag_left_fullscreen_percent = sc_self_memory_config['sc_panel_drag_left_fullscreen_percent'] ?? 0;
  558. sc_panel_drag_top_fullscreen_percent = sc_self_memory_config['sc_panel_drag_top_fullscreen_percent'] ?? 0;
  559.  
  560. if (sc_panel_drag_left_fullscreen_percent) { sc_panel_drag_left_fullscreen = unsafeWindow.top.document.documentElement.clientWidth * parseFloat(sc_panel_drag_left_fullscreen_percent); }
  561. if (sc_panel_drag_top_fullscreen_percent) { sc_panel_drag_top_fullscreen = unsafeWindow.top.document.documentElement.clientHeight * parseFloat(sc_panel_drag_top_fullscreen_percent); }
  562.  
  563. if (sc_panel_fold_mode_fullscreen === 1 && (unsafeWindow.innerWidth - sc_panel_drag_left_fullscreen) < 72) {
  564. sc_panel_drag_left_fullscreen = unsafeWindow.innerWidth - 72;
  565. }
  566. if (sc_panel_fold_mode_fullscreen === 2 && (unsafeWindow.innerWidth - sc_panel_drag_left_fullscreen) < sc_rectangle_width_fullscreen) {
  567. sc_panel_drag_left_fullscreen = unsafeWindow.innerWidth - sc_rectangle_width_fullscreen;
  568. }
  569.  
  570. if (sc_panel_drag_top_fullscreen <= 0) {
  571. sc_panel_drag_top_fullscreen = 0;
  572. }
  573. if (sc_panel_drag_top_fullscreen >= unsafeWindow.innerHeight) {
  574. sc_panel_drag_top_fullscreen = unsafeWindow.innerHeight - sc_panel_list_height_fullscreen;
  575. }
  576. }
  577.  
  578. function sc_memory_get_store_mode_switch(sc_switch_memory_rooms_json) {
  579. let sc_switch_memory_rooms = JSON.parse(sc_switch_memory_rooms_json);
  580. if (sc_switch_memory_rooms.includes(room_id)) {
  581. let sc_switch_record = unsafeWindow.localStorage.getItem('live_sc_switch_record');
  582. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  583. sc_switch_record = unsafeWindow.localStorage.getItem('live_sc_switch_record_fullscreen');
  584. }
  585. if (sc_switch_record !== null && sc_switch_record !== 'null' && sc_switch_record !== '') {
  586. sc_switch = parseInt(sc_switch_record, 10);
  587. }
  588.  
  589. sc_memory = 1;
  590. }
  591. }
  592.  
  593. // 记忆配置检查
  594. // 优先级:3-全记 > 2-个记 > 1-题记
  595. let sc_memory_all_rooms_mode = unsafeWindow.localStorage.getItem('live_sc_memory_all_rooms_mode');
  596. if (sc_memory_all_rooms_mode !== null && sc_memory_all_rooms_mode !== 'null' && sc_memory_all_rooms_mode !== '') {
  597. sc_memory = parseInt(sc_memory_all_rooms_mode, 10);
  598.  
  599. // sc_memory_all_rooms_mode的值目前只能是3-全记
  600. if (sc_memory !== 3) {
  601. sc_memory = 0;
  602. }
  603.  
  604. if (sc_memory === 3) {
  605. // 全记
  606. let sc_all_memory_config_json = unsafeWindow.localStorage.getItem('live_sc_all_memory_config');
  607. if (sc_all_memory_config_json !== null && sc_all_memory_config_json !== 'null' && sc_all_memory_config_json !== '[]' && sc_all_memory_config_json !== '{}' && sc_all_memory_config_json !== '') {
  608. sc_memory_get_store_mode_all(sc_all_memory_config_json);
  609. }
  610. } else {
  611. // 个记
  612. let sc_self_memory_config_json = unsafeWindow.localStorage.getItem(sc_self_memory_config_key);
  613. if (sc_self_memory_config_json !== null && sc_self_memory_config_json !== 'null' && sc_self_memory_config_json !== '[]' && sc_self_memory_config_json !== '{}' && sc_self_memory_config_json !== '') {
  614. sc_memory_get_store_mode_self(sc_self_memory_config_json);
  615. } else {
  616. // 题记
  617. let sc_switch_memory_rooms_json = unsafeWindow.localStorage.getItem('live_sc_switch_memory_rooms');
  618. if (sc_switch_memory_rooms_json !== null && sc_switch_memory_rooms_json !== 'null' && sc_switch_memory_rooms_json !== '[]' && sc_switch_memory_rooms_json !== '') {
  619. sc_memory_get_store_mode_switch(sc_switch_memory_rooms_json);
  620. }
  621. }
  622. }
  623. } else {
  624. // 个记
  625. let sc_self_memory_config_json = unsafeWindow.localStorage.getItem(sc_self_memory_config_key);
  626. if (sc_self_memory_config_json !== null && sc_self_memory_config_json !== 'null' && sc_self_memory_config_json !== '[]' && sc_self_memory_config_json !== '{}' && sc_self_memory_config_json !== '') {
  627. sc_memory_get_store_mode_self(sc_self_memory_config_json);
  628. } else {
  629. // 题记
  630. let sc_switch_memory_rooms_json = unsafeWindow.localStorage.getItem('live_sc_switch_memory_rooms');
  631. if (sc_switch_memory_rooms_json !== null && sc_switch_memory_rooms_json !== 'null' && sc_switch_memory_rooms_json !== '[]' && sc_switch_memory_rooms_json !== '') {
  632. sc_memory_get_store_mode_switch(sc_switch_memory_rooms_json);
  633. }
  634. }
  635. }
  636.  
  637. if (sc_keep_time !== null && sc_keep_time !== 'null' && sc_keep_time !== 0 && sc_keep_time !== '') {
  638. sc_keep_time_flag = 1;
  639. }
  640.  
  641. // 先检测并处理本房间的
  642. if (sc_keep_time_flag && (sc_now_time - parseInt(sc_keep_time, 10)) > 1000 * 60 * 60 * sc_clear_time_hour) {
  643. unsafeWindow.localStorage.removeItem(sc_localstorage_key);
  644. unsafeWindow.localStorage.removeItem(sc_sid_localstorage_key);
  645. }
  646.  
  647. function check_and_clear_all_sc_store() {
  648. // 遍历清除所有过期的sc存储
  649. let live_sc_rooms_json = unsafeWindow.localStorage.getItem('live_sc_rooms');
  650. if (live_sc_rooms_json !== null && live_sc_rooms_json !== 'null' && live_sc_rooms_json !== '[]' && live_sc_rooms_json !== '') {
  651. let live_sc_rooms = JSON.parse(live_sc_rooms_json);
  652. let live_sc_rooms_new = [];
  653. for (let m = 0; m < live_sc_rooms.length; m++) {
  654. let sc_keep_time_item = unsafeWindow.localStorage.getItem('live_' + live_sc_rooms[m] + '_sc_keep_time');
  655. if (sc_keep_time_item === null || sc_keep_time_item === 'null' || sc_keep_time_item === 0 || sc_keep_time_item === '') {
  656. continue;
  657. } else if (sc_keep_time_item !== null && sc_keep_time_item !== 'null' && sc_keep_time_item !== 0 && sc_keep_time_item !== '' && ((sc_now_time - parseInt(sc_keep_time_item, 10)) / (1000 * 60 * 60)) > sc_clear_time_hour) {
  658. unsafeWindow.localStorage.removeItem('live_' + live_sc_rooms[m] + '_sc'); // 清除sc存储
  659. unsafeWindow.localStorage.removeItem('live_' + live_sc_rooms[m] + '_sc_sid'); // 清除sc的sid存储
  660. unsafeWindow.localStorage.removeItem('live_' + live_sc_rooms[m] + '_sc_keep_time'); //清除sc的keep time存储
  661. } else {
  662. live_sc_rooms_new.push(live_sc_rooms[m]);
  663. }
  664. }
  665. // 更新live_sc_rooms
  666. unsafeWindow.localStorage.setItem('live_sc_rooms', JSON.stringify(live_sc_rooms_new));
  667. }
  668. }
  669.  
  670. function check_blacklist_menu(room_id) {
  671. let sc_room_black_list_json = unsafeWindow.localStorage.getItem('live_sc_room_blacklist');
  672. if (sc_room_black_list_json === null || sc_room_black_list_json === 'null' || sc_room_black_list_json === '[]' || sc_room_black_list_json === '') {
  673. // 显示加入黑名单
  674. GM_registerMenuCommand('点击将当前直播房间加入黑名单', function() {
  675. unsafeWindow.localStorage.setItem('live_sc_room_blacklist', JSON.stringify([room_id]));
  676. sc_catch_log('直播房间id:' + room_id + ' 已加入黑名单!');
  677. alert("当前直播房间已加入黑名单,刷新页面生效!");
  678. unsafeWindow.location.reload();
  679. });
  680.  
  681. return true;
  682. } else {
  683. let sc_room_black_list = JSON.parse(sc_room_black_list_json);
  684. if (sc_room_black_list.includes(room_id)) {
  685. // 显示移除黑名单
  686. GM_registerMenuCommand('当前直播房间已加入黑名单,点击移出黑名单', function() {
  687. sc_room_black_list = sc_room_black_list.filter(item => item !== room_id);
  688. unsafeWindow.localStorage.setItem('live_sc_room_blacklist', JSON.stringify(sc_room_black_list));
  689. sc_catch_log('直播房间id:' + room_id + ' 已移出黑名单!');
  690. alert("当前直播房间已除出黑名单,刷新页面生效!");
  691. unsafeWindow.location.reload();
  692. });
  693.  
  694. return false;
  695. } else {
  696. // 显示加入黑名单
  697. GM_registerMenuCommand('点击将当前直播房间加入黑名单', function() {
  698. sc_room_black_list.push(room_id);
  699. unsafeWindow.localStorage.setItem('live_sc_room_blacklist', JSON.stringify(sc_room_black_list));
  700. sc_catch_log('直播房间id:' + room_id + ' 已加入黑名单!');
  701. alert("当前直播房间已加入黑名单,刷新页面生效!");
  702. unsafeWindow.location.reload();
  703. });
  704.  
  705. return true;
  706. }
  707. }
  708. }
  709.  
  710. function getTimestampConversion(timestamp, the_sc_start_time_simple_flag = false) {
  711. let timeStamp;
  712. let timeStampLen = timestamp.toString().length;
  713.  
  714. if (timeStampLen === 10) {
  715. timeStamp = timestamp * 1000
  716. } else if (timeStampLen === 13) {
  717. timeStamp = timestamp
  718. } else {
  719. timeStamp = timestamp
  720. }
  721.  
  722. let date = new Date(timeStamp); // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
  723. let Y = (date.getFullYear() + '-');
  724. let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  725. let D = (date.getDate() < 10 ? '0' + date.getDate() + ' ' : date.getDate() + ' ');
  726. let h = (date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':');
  727. let m = (date.getMinutes() < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':');
  728. let s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
  729.  
  730. if (the_sc_start_time_simple_flag) {
  731. m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
  732.  
  733. return h + m;
  734. } else {
  735. return Y + M + D + h + m + s;
  736. }
  737.  
  738. }
  739.  
  740. function get_timestamp_diff(timestamp, sc_price) {
  741. let the_time_stamp = parseInt(timestamp);
  742. let the_sc_price = parseInt(sc_price);
  743. let the_sc_item_expire_flag = false;
  744.  
  745. if (timestamp.toString().length === 10) {
  746. the_time_stamp = timestamp * 1000;
  747. }
  748.  
  749. let now_time = (new Date()).getTime();
  750. let time_diff_value = now_time - the_time_stamp;
  751.  
  752. let time_diff_second = parseInt(time_diff_value / 1000, 10);
  753.  
  754. if (sc_panel_show_time_mode) {
  755. // 所有的SC至少停留30秒(开始循环的第一个30秒)
  756. if (sc_panel_show_time_mode === 3) {
  757. // 依照SC的时间停留
  758. if (the_sc_price >= 30 && the_sc_price < 50) {
  759. // 1分钟过期
  760. if (time_diff_second >= 60) { the_sc_item_expire_flag = true; }
  761. } else if (the_sc_price >= 50 && the_sc_price < 100) {
  762. // 2分钟过期
  763. if (time_diff_second >= 60 * 2) { the_sc_item_expire_flag = true; }
  764. } else if (the_sc_price >= 100 && the_sc_price < 500) {
  765. // 5分钟过期
  766. if (time_diff_second >= 60 * 5) { the_sc_item_expire_flag = true; }
  767. } else if (the_sc_price >= 500 && the_sc_price < 1000) {
  768. // 30分钟过期
  769. if (time_diff_second >= 60 * 30) { the_sc_item_expire_flag = true; }
  770. } else if (the_sc_price >= 1000 && the_sc_price < 2000) {
  771. // 1小时过期
  772. if (time_diff_second >= 60 * 60) { the_sc_item_expire_flag = true; }
  773. } else if (the_sc_price >= 2000) {
  774. // 2小时过期
  775. if (time_diff_second >= 60 * 120) { the_sc_item_expire_flag = true; }
  776. }
  777. } else if (sc_panel_show_time_mode === 4) {
  778. // 依照SC的时间,同时最多停留1~120分钟(取两者最小值)
  779. if (the_sc_price >= 30 && the_sc_price < 50) {
  780. // 1分钟过期
  781. if (time_diff_second >= 60 || time_diff_second >= 60 * sc_panel_show_time_each_same) { the_sc_item_expire_flag = true; }
  782. } else if (the_sc_price >= 50 && the_sc_price < 100) {
  783. // 2分钟过期
  784. if (time_diff_second >= 60 * 2 || time_diff_second >= 60 * sc_panel_show_time_each_same) { the_sc_item_expire_flag = true; }
  785. } else if (the_sc_price >= 100 && the_sc_price < 500) {
  786. // 5分钟过期
  787. if (time_diff_second >= 60 * 5 || time_diff_second >= 60 * sc_panel_show_time_each_same) { the_sc_item_expire_flag = true; }
  788. } else if (the_sc_price >= 500 && the_sc_price < 1000) {
  789. // 30分钟过期
  790. if (time_diff_second >= 60 * 30 || time_diff_second >= 60 * sc_panel_show_time_each_same) { the_sc_item_expire_flag = true; }
  791. } else if (the_sc_price >= 1000 && the_sc_price < 2000) {
  792. // 1小时过期
  793. if (time_diff_second >= 60 * 60 || time_diff_second >= 60 * sc_panel_show_time_each_same) { the_sc_item_expire_flag = true; }
  794. } else if (the_sc_price >= 2000) {
  795. // 2小时过期
  796. if (time_diff_second >= 60 * 120 || time_diff_second >= 60 * sc_panel_show_time_each_same) { the_sc_item_expire_flag = true; }
  797. }
  798. } else {
  799. // 所有的SC停留 sc_panel_show_time_each_same 分钟
  800. if (time_diff_second >= 60 * sc_panel_show_time_each_same) { the_sc_item_expire_flag = true; }
  801. }
  802. }
  803.  
  804. let result_str = '';
  805. if (time_diff_value < 0) {
  806. return [result_str, the_sc_item_expire_flag];
  807. }
  808.  
  809. let day_diff = time_diff_value / (1000 * 60 * 60 * 24);
  810. let hour_diff = time_diff_value / (1000 * 60 * 60);
  811. let min_diff = time_diff_value / (1000 * 60);
  812.  
  813. if (day_diff >= 1) {
  814. result_str = '' + parseInt(day_diff) + '天前';
  815. } else if (hour_diff >= 1) {
  816. result_str = '' + parseInt(hour_diff) + '小时前';
  817. } else if (min_diff >= 1) {
  818. result_str = '' + parseInt(min_diff) + '分钟前';
  819. } else {
  820. result_str = '刚刚';
  821. }
  822.  
  823. return [result_str, the_sc_item_expire_flag];
  824. }
  825.  
  826. // 更新每条SC距离当前时间,并且检查SC是否过期
  827. function update_timestamp_diff() {
  828. let sc_timestamp_item = $(document).find('.sc_start_timestamp');
  829. let sc_expire_check_stop_flag = $(document).find('.sc_long_list').hasClass('sc_long_expire_check_stop');
  830.  
  831. sc_timestamp_item.each(function() {
  832. let [new_timestamp_diff, the_sc_item_expire_flag] = get_timestamp_diff($(this).html(), $(this).next().html());
  833. $(this).prev().html(new_timestamp_diff);
  834. if (sc_panel_fold_mode !== 0 && the_sc_item_expire_flag && !sc_expire_check_stop_flag) {
  835. $(this).closest('.sc_long_item').addClass('sc_long_expire_tag_item').fadeOut(500);
  836. }
  837. });
  838. }
  839.  
  840. // 查找距离指定时间最近的div
  841. function find_time_closest_div(list_class_name, minutes_ago) {
  842. let the_target_time = Date.now() - (minutes_ago * 60 * 1000); // 计算几分钟前的时间戳
  843. let the_list_items = document.querySelectorAll(list_class_name);
  844.  
  845. if (the_list_items.length === 0) {
  846. return null; // 没有找到任何符合条件的元素
  847. } else if (the_list_items.length === 1) {
  848. return the_list_items[0]; // 只有一个元素时直接返回
  849. }
  850.  
  851. if (the_target_time >= parseInt(the_list_items[0].getAttribute('data-start'), 10)) {
  852. return the_list_items[0];
  853. }
  854.  
  855. if (the_target_time <= parseInt(the_list_items[the_list_items.length - 1].getAttribute('data-start'), 10)) {
  856. return the_list_items[the_list_items.length - 1];
  857. }
  858.  
  859. let index_left = 0;
  860. let index_right = the_list_items.length - 1;
  861.  
  862. while (index_left <= index_right) {
  863. let index_mid = Math.floor((index_left + index_right) / 2);
  864. let the_mid_time = parseInt(the_list_items[index_mid].getAttribute('data-start'), 10);
  865.  
  866. if (the_mid_time > the_target_time) {
  867. index_left = index_mid + 1;
  868. } else {
  869. index_right = index_mid - 1;
  870. }
  871. }
  872.  
  873. if (index_left >= the_list_items.length) {
  874. // 所有元素的时间戳都小于目标时间
  875. return the_list_items[the_list_items.length - 1];
  876. } else if (index_right < 0) {
  877. // 所有元素的时间戳都大于目标时间
  878. return the_list_items[0];
  879. } else {
  880. // 比较 left 和 right 哪个更接近目标时间
  881. let the_left_time = parseInt(the_list_items[index_left].getAttribute('data-start'), 10);
  882. let the_right_time = parseInt(the_list_items[index_right].getAttribute('data-start'), 10);
  883.  
  884. if (Math.abs(the_left_time - the_target_time) < Math.abs(the_right_time - the_target_time)) {
  885. return the_list_items[index_left];
  886. } else {
  887. return the_list_items[index_right];
  888. }
  889. }
  890. }
  891.  
  892. function custom_search_sc_div(the_search_user_name, the_search_content, the_search_time, list_class_name, type = 1) {
  893.  
  894. let the_list_items = document.querySelectorAll(list_class_name);
  895. let the_list_items_arr = [...the_list_items];
  896.  
  897. if ((sc_item_order_up_flag || !type) && !(sc_item_order_up_flag && !type)) {
  898. // default: 0_time_大,end_time_小
  899. // reverse: 0_time_小,end_time_大
  900. the_list_items_arr = the_list_items_arr.reverse();
  901. }
  902.  
  903. // 格式化参数
  904. let the_search_first_flag = true;
  905.  
  906. the_search_user_name = the_search_user_name.trim();
  907. the_search_content = the_search_content.trim();
  908.  
  909. let the_default_result = null;
  910.  
  911. // 条件为空直接返回空
  912. if (the_search_user_name === '' && the_search_content === '' && the_search_time === '' && !sc_list_search_result_time) {
  913. sc_list_search_str = '__';
  914.  
  915. return the_default_result;
  916. } else if (the_search_user_name === '' && the_search_content === '' && the_search_time === '' && sc_list_search_result_time) {
  917. // 条件为空但有上一次搜索的结果,直接返回上一个/下一个相邻的SC
  918. let the_sc_live_search_last_div = document.querySelector(list_class_name + '[data-start="' + sc_list_search_result_time + '"]');
  919.  
  920. the_default_result = the_sc_live_search_last_div;
  921.  
  922. if (type) {
  923. let the_sc_live_search_next_div = $(the_sc_live_search_last_div).next();
  924.  
  925. if (the_sc_live_search_next_div.length) {
  926. sc_list_search_result_time = parseInt(the_sc_live_search_next_div.attr('data-start'), 10);
  927. the_default_result = the_sc_live_search_next_div[0];
  928. }
  929. } else {
  930. let the_sc_live_search_prev_div = $(the_sc_live_search_last_div).prev();
  931.  
  932. if (the_sc_live_search_prev_div.length) {
  933. sc_list_search_result_time = parseInt(the_sc_live_search_prev_div.attr('data-start'), 10);
  934. the_default_result = the_sc_live_search_prev_div[0];
  935. }
  936. }
  937.  
  938. sc_list_search_str = '__';
  939.  
  940. return the_default_result;
  941. }
  942.  
  943. if (the_search_time !== '' && the_search_time < 0) {
  944. the_search_time = 0;
  945. }
  946.  
  947. if (sc_list_search_str === the_search_user_name + '_' + the_search_content + '_' + the_search_time) {
  948. the_search_first_flag = false;
  949. // 非初次搜索,但没结果的直接返回空
  950. if (!sc_list_search_result_time) {
  951. return the_default_result;
  952. }
  953. }
  954.  
  955. sc_list_search_str = the_search_user_name + '_' + the_search_content + '_' + the_search_time;
  956.  
  957. let the_last_search_start_time = 0;
  958.  
  959. for (let the_sc_item of the_list_items_arr) {
  960. let the_item_start_time = parseInt(the_sc_item.getAttribute('data-start'), 10);
  961. if (!the_search_first_flag) {
  962. // 非初次搜索
  963. if (type) {
  964. // 下一个
  965. if (the_item_start_time >= sc_list_search_result_time) {
  966. continue;
  967. }
  968. } else {
  969. the_last_search_start_time = sc_list_search_result_time; // 上一个
  970. }
  971. }
  972.  
  973. // 上一次
  974. if (the_last_search_start_time) {
  975.  
  976. if (the_item_start_time <= the_last_search_start_time) {
  977. continue;
  978. }
  979. }
  980.  
  981. // time
  982. if (the_search_time !== '' && !the_last_search_start_time) {
  983. let the_now_search_start_time = Date.now() - (the_search_time * 60 * 1000); // 计算几分钟前的时间戳
  984.  
  985. if ((the_item_start_time > the_now_search_start_time) && the_search_time > 0) {
  986. continue;
  987. } else {
  988. if (the_search_user_name === '' && the_search_content === '') {
  989. the_default_result = the_sc_item;
  990. sc_list_search_result_time = the_item_start_time;
  991. }
  992. }
  993. }
  994.  
  995. // user
  996. let the_item_user_name = the_sc_item.querySelector('.sc_font_color').textContent;
  997.  
  998. // content
  999. let the_item_content = the_sc_item.querySelector('.sc_msg_body span').textContent;
  1000.  
  1001. let the_search_user_name_condition = true;
  1002. let the_search_user_name_condition_in = true;
  1003. let the_search_user_name_condition_out = true;
  1004. let the_search_content_condition = true;
  1005.  
  1006. if (the_search_user_name) {
  1007. the_search_user_name_condition = the_item_user_name === the_search_user_name; // 精准
  1008. the_search_user_name_condition_in = the_item_user_name.toLowerCase().includes(the_search_user_name.toLowerCase()); // 模糊
  1009. the_search_user_name_condition_out = the_search_user_name.toLowerCase().includes(the_item_user_name.toLowerCase()); // 模糊
  1010. }
  1011.  
  1012. if (the_search_content) {
  1013. the_search_content_condition = the_item_content.toLowerCase().includes(the_search_content.toLowerCase()); // 模糊
  1014. }
  1015.  
  1016. // 昵称精准匹配优先级最高
  1017. if (the_search_user_name_condition && the_search_content_condition) {
  1018. sc_list_search_result_time = the_item_start_time;
  1019.  
  1020. return the_sc_item;
  1021. } else if (the_search_user_name && the_search_user_name_condition_in && the_search_content_condition) {
  1022. sc_list_search_result_time = the_item_start_time;
  1023.  
  1024. return the_sc_item;
  1025. } else if (the_search_user_name && the_search_user_name_condition_out && the_search_content_condition) {
  1026. sc_list_search_result_time = the_item_start_time;
  1027.  
  1028. return the_sc_item;
  1029. } else {
  1030. continue;
  1031. }
  1032.  
  1033. }
  1034.  
  1035. if (!the_default_result && the_search_first_flag) {
  1036. sc_list_search_result_time = 0;
  1037. }
  1038.  
  1039. if (!the_default_result && sc_list_search_result_time) {
  1040. the_default_result = document.querySelector(list_class_name + '[data-start="' + sc_list_search_result_time + '"]');
  1041. }
  1042.  
  1043. return the_default_result;
  1044. }
  1045.  
  1046. // 同步特定用户提示的设置
  1047. function sycn_live_special_tip_config() {
  1048. sc_config_get_live_special_tip_location();
  1049. sc_config_get_live_special_tip_str();
  1050. sc_live_special_tip_str_to_arr();
  1051. sc_config_get_live_special_msg_flag();
  1052. sc_config_get_live_special_sc_flag();
  1053. sc_config_get_live_special_danmu_mode();
  1054. sc_config_get_live_special_sc_no_remain_flag();
  1055. }
  1056.  
  1057. // 同步SC以弹幕展现的设置
  1058. function sycn_live_sc_to_danmu_show_config() {
  1059. sc_config_get_live_sc_to_danmu_show_flag();
  1060. sc_config_get_live_sc_to_danmu_show_location();
  1061. sc_config_get_live_sc_to_danmu_show_mode();
  1062. sc_config_get_live_sc_to_danmu_no_remain_flag();
  1063. }
  1064.  
  1065. function close_and_remove_sc_modal() {
  1066. // 关闭模态框
  1067. $(document).find('.sc_cp_mod').hide();
  1068.  
  1069. // 从 body 中移除模态框
  1070. $(document).find('.sc_cp_mod').remove();
  1071. }
  1072.  
  1073. function open_and_close_sc_modal(show_str, show_color, e, mode = 0) {
  1074. $(document).find('.sc_long_rectangle').css('cursor', 'grab');
  1075. let sc_copy_modal = document.createElement('div');
  1076. sc_copy_modal.className = 'sc_cp_mod';
  1077. sc_copy_modal.style.position = 'fixed';
  1078. sc_copy_modal.style.display = 'none';
  1079. sc_copy_modal.style.color = show_color;
  1080. sc_copy_modal.style.textAlign = 'center';
  1081. sc_copy_modal.style.backgroundColor = '#ffffff';
  1082. sc_copy_modal.style.border = 0;
  1083. sc_copy_modal.style.boxShadow = '0 0 3px rgba(0, 0, 0, 0.3)';
  1084. sc_copy_modal.innerHTML = show_str;
  1085. sc_copy_modal.style.zIndex = 3333;
  1086.  
  1087. if (mode === 0) {
  1088. sc_copy_modal.style.width = '30px';
  1089. sc_copy_modal.style.height = '30px';
  1090. sc_copy_modal.style.lineHeight = '30px';
  1091. sc_copy_modal.style.borderRadius = '50%';
  1092. sc_copy_modal.style.left = e.clientX + 10 + 'px';
  1093. sc_copy_modal.style.top = e.clientY - 10 + 'px';
  1094. } else if(mode === 1) {
  1095. sc_copy_modal.style.borderRadius = '10px';
  1096. sc_copy_modal.style.padding = '10px';
  1097. sc_copy_modal.style.left = e.target.getBoundingClientRect().left + 10 + 'px';
  1098. sc_copy_modal.style.top = e.target.getBoundingClientRect().top - 30 + 'px';
  1099. } else {
  1100. sc_copy_modal.style.borderRadius = '10px';
  1101. sc_copy_modal.style.padding = '10px';
  1102. sc_copy_modal.style.left = unsafeWindow.innerWidth / 2 + 'px';
  1103. sc_copy_modal.style.top = unsafeWindow.innerHeight / 2 + 'px';
  1104. }
  1105.  
  1106. if (sc_isFullscreen) {
  1107. $(document).find('#live-player').append(sc_copy_modal);
  1108. } else {
  1109. document.body.appendChild(sc_copy_modal);
  1110. }
  1111.  
  1112. // 显示模态框
  1113. sc_copy_modal.style.display = 'block';
  1114.  
  1115. // 在一定时间后关闭并删除模态框
  1116. setTimeout(() => {
  1117. close_and_remove_sc_modal();
  1118. }, 1500);
  1119. }
  1120.  
  1121. function check_and_join_live_sc_room() {
  1122. if (!sc_keep_time_flag) {
  1123.  
  1124. sc_keep_time_flag = 1;
  1125.  
  1126. // 加入记录组
  1127. let live_sc_rooms_json = unsafeWindow.localStorage.getItem('live_sc_rooms');
  1128. if (live_sc_rooms_json === null || live_sc_rooms_json === 'null' || live_sc_rooms_json === '[]' || live_sc_rooms_json === '') {
  1129. unsafeWindow.localStorage.setItem('live_sc_rooms', JSON.stringify([room_id]));
  1130. } else {
  1131. let live_sc_rooms = JSON.parse(live_sc_rooms_json);
  1132. live_sc_rooms.push(room_id);
  1133. unsafeWindow.localStorage.setItem('live_sc_rooms', JSON.stringify(live_sc_rooms));
  1134. }
  1135. }
  1136. }
  1137.  
  1138. function sc_sleep(ms) {
  1139. return new Promise(resolve => setTimeout(resolve, ms));
  1140. }
  1141.  
  1142. let sc_live_sidebar_try_find = 2; // 最多再尝试2次
  1143. function sc_live_sidebar_position_left_apply() {
  1144. let sc_live_sidebar = $(document).find('#sidebar-vm');
  1145.  
  1146. if (sc_live_sidebar.length) {
  1147. let sc_live_sidebar_cntr = sc_live_sidebar.find('.side-bar-cntr');
  1148. let sc_live_sidebar_popup_cntr = sc_live_sidebar.find('.side-bar-popup-cntr');
  1149.  
  1150. if (sc_live_sidebar_cntr.length) {
  1151. sc_live_sidebar_cntr.css('right', 'unset');
  1152. sc_live_sidebar_cntr.css('left', 0);
  1153. sc_live_sidebar_cntr.css('border-radius', '0 12px 12px 0');
  1154. }
  1155.  
  1156. if (sc_live_sidebar_popup_cntr.length) {
  1157. sc_live_sidebar_popup_cntr.css('left', sc_live_sidebar_popup_cntr.css('right'));
  1158. sc_live_sidebar_popup_cntr.css('right', 'unset');
  1159.  
  1160. let sc_live_sidebar_popup_cntr_arrow = sc_live_sidebar_popup_cntr.find('.arrow');
  1161. if (sc_live_sidebar_popup_cntr_arrow.length) {
  1162. sc_live_sidebar_popup_cntr_arrow.css('left', 'unset');
  1163. sc_live_sidebar_popup_cntr_arrow.css('right', '100%');
  1164. sc_live_sidebar_popup_cntr_arrow.css('border-color', 'transparent var(--bg1_float, "#FFFFFF") transparent transparent');
  1165. }
  1166. }
  1167. } else {
  1168. if (sc_live_sidebar_try_find) {
  1169. setTimeout(() => { sc_live_sidebar_position_left_apply() }, 2000);
  1170. sc_live_sidebar_try_find--;
  1171. }
  1172. }
  1173. }
  1174.  
  1175. function sc_live_sidebar_position_right_apply() {
  1176. let sc_live_sidebar = $(document).find('#sidebar-vm');
  1177.  
  1178. if (sc_live_sidebar.length) {
  1179. let sc_live_sidebar_cntr = sc_live_sidebar.find('.side-bar-cntr');
  1180. let sc_live_sidebar_popup_cntr = sc_live_sidebar.find('.side-bar-popup-cntr');
  1181.  
  1182. if (sc_live_sidebar_cntr.length) {
  1183. sc_live_sidebar_cntr.css('left', 'unset');
  1184. sc_live_sidebar_cntr.css('right', 0);
  1185. sc_live_sidebar_cntr.css('border-radius', '12px 0 0 12px');
  1186. }
  1187. if (sc_live_sidebar_popup_cntr.length) {
  1188. sc_live_sidebar_popup_cntr.css('right', sc_live_sidebar_popup_cntr.css('left'));
  1189. sc_live_sidebar_popup_cntr.css('left', 'unset');
  1190.  
  1191. let sc_live_sidebar_popup_cntr_arrow = sc_live_sidebar_popup_cntr.find('.arrow');
  1192. if (sc_live_sidebar_popup_cntr_arrow.length) {
  1193. sc_live_sidebar_popup_cntr_arrow.css('right', 'unset');
  1194. sc_live_sidebar_popup_cntr_arrow.css('left', '100%');
  1195. sc_live_sidebar_popup_cntr_arrow.css('border-color', 'transparent transparent transparent var(--bg1_float, "#FFFFFF")');
  1196. }
  1197. }
  1198. }
  1199. }
  1200.  
  1201. function sc_side_fold_in_one(target_oj) {
  1202. target_oj.css('border-radius', '8px');
  1203. target_oj.find('.sc_msg_body').hide();
  1204. target_oj.find('.sc_msg_head').css('border-radius', '6px');
  1205. target_oj.find('.sc_msg_head_left').hide();
  1206. target_oj.find('.sc_msg_head_right').hide();
  1207. }
  1208.  
  1209. function sc_side_fold_out_one(target_oj, mouse_enter_flag = false) {
  1210. target_oj.css('border-radius', '8px 8px 6px 6px');
  1211.  
  1212. let sc_item_fold_flag = target_oj.attr('data-fold');
  1213.  
  1214. if (sc_item_fold_flag === '0') {
  1215. target_oj.find('.sc_msg_body').show();
  1216. target_oj.find('.sc_msg_head').css('border-radius', '6px 6px 0px 0px');
  1217.  
  1218. if (mouse_enter_flag) {
  1219. target_oj.attr('data-height', target_oj.outerHeight())
  1220. }
  1221. }
  1222.  
  1223. target_oj.find('.sc_msg_head_left').show();
  1224. target_oj.find('.sc_msg_head_right').show();
  1225. }
  1226.  
  1227. function sc_side_fold_in_all() {
  1228. $(document).find('.sc_long_item').each(function() {
  1229. sc_side_fold_in_one($(this));
  1230. });
  1231. }
  1232.  
  1233. function sc_side_fold_out_all() {
  1234. $(document).find('.sc_long_item').each(function() {
  1235. sc_side_fold_out_one($(this));
  1236. });
  1237. }
  1238.  
  1239. function sc_trigger_item_side_fold_in(target_oj_class) {
  1240. let target_oj = $(document).find('.' + target_oj_class);
  1241.  
  1242. target_oj.css('position', '');
  1243. target_oj.css('top', '');
  1244. target_oj.css('z-index', '');
  1245. target_oj.css('width', '50px');
  1246. target_oj.css('height', '50px');
  1247. target_oj.css('left', '');
  1248.  
  1249. sc_side_fold_in_one(target_oj);
  1250. }
  1251.  
  1252. function sc_auto_trigger_side_fold_out_next() {
  1253. let the_atn_sc_panel_fold_mode = sc_panel_fold_mode;
  1254. let the_atn_sc_rectangle_width = sc_rectangle_width;
  1255. let the_atn_sc_panel_list_height = sc_panel_list_height;
  1256. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1257. the_atn_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  1258. the_atn_sc_rectangle_width = sc_rectangle_width_fullscreen;
  1259. the_atn_sc_panel_list_height = sc_panel_list_height_fullscreen;
  1260. }
  1261.  
  1262. if (the_atn_sc_panel_fold_mode === 1) {
  1263. sc_side_fold_custom_auto_run_flag = true;
  1264.  
  1265. let auto_target_oj = $(document).find('.' + sc_side_fold_custom_each_same_time_class);
  1266.  
  1267. if (auto_target_oj.length === 0) { sc_side_fold_custom_auto_run_flag = false; return; }
  1268.  
  1269. if (sc_side_fold_custom_stop_from_auto_flag) {
  1270. let auto_target_oj_next = auto_target_oj.prev();
  1271. if (sc_item_order_up_flag) {
  1272. auto_target_oj_next = auto_target_oj.next();
  1273. }
  1274.  
  1275. if (auto_target_oj_next.length) {
  1276. auto_target_oj = auto_target_oj_next;
  1277. sc_side_fold_custom_each_same_time_class = auto_target_oj.attr('class').split(' ').find((scClassName) => { return scClassName !== 'sc_long_item'; });
  1278. }
  1279. }
  1280.  
  1281. auto_target_oj.css('position', 'absolute');
  1282. auto_target_oj.css('top', '0px'); // 第一个SC的位置
  1283. auto_target_oj.css('translateY', '-100%');
  1284. auto_target_oj.css('opacity', 0);
  1285. auto_target_oj.css('z-index', '10');
  1286. auto_target_oj.css('width', (the_atn_sc_rectangle_width - 22) + 'px'); // 22 约为总padding
  1287. auto_target_oj.css('height', '');
  1288.  
  1289. if ((auto_target_oj.offset().left - (unsafeWindow.innerWidth / 2)) > 0) {
  1290. if (the_atn_sc_panel_list_height === 0 || sc_side_fold_hide_list_ing_flag) {
  1291. auto_target_oj.css('left', -(the_atn_sc_rectangle_width - 22 - 72 + 10 + 60)); // 22 约为总padding, 72为侧折后的宽,10为一个padding
  1292. } else {
  1293. auto_target_oj.css('left', -(the_atn_sc_rectangle_width - 22 - 72 + 10)); // 22 约为总padding, 72为侧折后的宽,10为一个padding
  1294. }
  1295. } else {
  1296. if (the_atn_sc_panel_list_height === 0 || sc_side_fold_hide_list_ing_flag) {
  1297. auto_target_oj.css('left', 70);
  1298. }
  1299. }
  1300.  
  1301. sc_side_fold_out_one(auto_target_oj, true);
  1302.  
  1303. auto_target_oj.hide();
  1304.  
  1305. auto_target_oj.animate({
  1306. 'translateY': '0',
  1307. 'opacity' : 1
  1308. }, {
  1309. duration: 1000,
  1310. easing: 'linear'
  1311. });
  1312.  
  1313. auto_target_oj.show();
  1314.  
  1315. sc_side_fold_custom_each_same_time_timeout_id = setTimeout(function() {
  1316. let the_sto_sc_panel_fold_mode = sc_panel_fold_mode;
  1317. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1318. the_sto_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  1319. }
  1320.  
  1321. if (sc_side_fold_custom_each_same_time_class && the_sto_sc_panel_fold_mode === 1) {
  1322. // 下一个SC
  1323. let prev_target_oj = auto_target_oj.prev();
  1324. if (sc_item_order_up_flag) {
  1325. prev_target_oj = auto_target_oj.next();
  1326. }
  1327.  
  1328. if (prev_target_oj.length > 0) {
  1329.  
  1330. sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class);
  1331.  
  1332. sc_side_fold_custom_each_same_time_class = prev_target_oj.attr('class').split(' ').find((scClassName) => { return scClassName !== 'sc_long_item'; });
  1333.  
  1334. sc_side_fold_custom_stop_from_auto_flag = false;
  1335.  
  1336. sc_sleep(1500).then(() => { sc_auto_trigger_side_fold_out_next() });
  1337.  
  1338. } else {
  1339. if (sc_side_fold_custom_config === 2) {
  1340. sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class);
  1341. }
  1342.  
  1343. sc_side_fold_custom_auto_run_flag = false;
  1344.  
  1345. sc_side_fold_custom_stop_from_auto_flag = true;
  1346.  
  1347. }
  1348. }
  1349. }, sc_side_fold_custom_time * 1000);
  1350. }
  1351. }
  1352.  
  1353. function sc_auto_trigger_side_fold_out_start(target_oj_class) {
  1354. if (sc_side_fold_custom_each_same_time_class === '') {
  1355. // 如果是刚刚开始
  1356. sc_side_fold_custom_each_same_time_class = target_oj_class;
  1357. sc_auto_trigger_side_fold_out_next();
  1358. } else {
  1359. // 如果已经暂停了
  1360. if (!sc_side_fold_custom_auto_run_flag) {
  1361. sc_auto_trigger_side_fold_out_next();
  1362. }
  1363. }
  1364. }
  1365.  
  1366. function sc_trigger_item_side_fold_out(target_oj_class) {
  1367.  
  1368. let the_tio_sc_panel_fold_mode = sc_panel_fold_mode;
  1369. let the_tio_sc_rectangle_width = sc_rectangle_width;
  1370. let the_tio_sc_panel_list_height = sc_panel_list_height;
  1371. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1372. the_tio_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  1373. the_tio_sc_rectangle_width = sc_rectangle_width_fullscreen;
  1374. the_tio_sc_panel_list_height = sc_panel_list_height_fullscreen;
  1375. }
  1376.  
  1377. let target_oj = $(document).find('.' + target_oj_class);
  1378.  
  1379. if (sc_side_fold_custom_each_same_time_flag) {
  1380. sc_auto_trigger_side_fold_out_start(target_oj_class);
  1381. } else {
  1382. target_oj.css('position', 'absolute');
  1383. target_oj.css('top', '0px'); // 第一个SC的位置
  1384. target_oj.css('z-index', '10');
  1385. target_oj.css('width', (the_tio_sc_rectangle_width - 22) + 'px'); // 22 约为总padding
  1386. target_oj.css('height', '');
  1387.  
  1388. if ((target_oj.offset().left - (unsafeWindow.innerWidth / 2)) > 0) {
  1389. if (the_tio_sc_panel_fold_mode === 1 && (the_tio_sc_panel_list_height === 0 || sc_side_fold_hide_list_ing_flag)) {
  1390. target_oj.css('left', -(the_tio_sc_rectangle_width - 22 - 72 + 10 + 60)); // 22 约为总padding, 72为侧折后的宽,10为一个padding
  1391. } else {
  1392. target_oj.css('left', -(the_tio_sc_rectangle_width - 22 - 72 + 10)); // 22 约为总padding, 72为侧折后的宽,10为一个padding
  1393. }
  1394. } else {
  1395. if (the_tio_sc_panel_fold_mode === 1 && (the_tio_sc_panel_list_height === 0 || sc_side_fold_hide_list_ing_flag)) {
  1396. target_oj.css('left', 70);
  1397. }
  1398. }
  1399.  
  1400. sc_side_fold_out_one(target_oj, true);
  1401. }
  1402. }
  1403.  
  1404. function sc_custom_config_start_class_by_fetch(sc_catch_new_arr) {
  1405. if (Array.isArray(sc_catch_new_arr)) {
  1406. let first_catch_sc = sc_catch_new_arr[0];
  1407.  
  1408. if (first_catch_sc) {
  1409. sc_side_fold_custom_each_same_time_class = 'sc_' + first_catch_sc["uid"] + '_' + first_catch_sc["start_time"];
  1410. }
  1411. }
  1412. }
  1413.  
  1414. function sc_custom_config_start_class_by_store(sc_store_arr) {
  1415. if (Array.isArray(sc_store_arr)) {
  1416. let first_store_sc = sc_store_arr.at(-1);
  1417.  
  1418. if (first_store_sc) {
  1419. sc_side_fold_custom_each_same_time_class = 'sc_' + first_store_sc["uid"] + '_' + first_store_sc["start_time"];
  1420. }
  1421. }
  1422. }
  1423.  
  1424. function sc_custom_config_apply(new_sc_side_fold_custom_first_class) {
  1425. let the_cca_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  1426. let the_cca_sc_panel_fold_mode = sc_panel_fold_mode;
  1427. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1428. the_cca_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  1429. the_cca_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  1430. }
  1431.  
  1432. if (the_cca_sc_panel_side_fold_flag) {
  1433. if (sc_side_fold_custom_config === 1) {
  1434. // 第一个SC保持展开
  1435. if (sc_side_fold_custom_first_class && the_cca_sc_panel_fold_mode === 1 && sc_side_fold_custom_first_class !== new_sc_side_fold_custom_first_class && !sc_side_fold_custom_auto_run_flag) {
  1436. sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class);
  1437. }
  1438.  
  1439. if (new_sc_side_fold_custom_first_class && the_cca_sc_panel_fold_mode === 1) {
  1440. sc_trigger_item_side_fold_out(new_sc_side_fold_custom_first_class);
  1441. }
  1442. } else if (sc_side_fold_custom_config === 2) {
  1443. // 第一个SC不保持展开
  1444. if (sc_side_fold_custom_first_class && the_cca_sc_panel_fold_mode === 1 && sc_side_fold_custom_first_class !== new_sc_side_fold_custom_first_class && !sc_side_fold_custom_auto_run_flag) {
  1445. sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class);
  1446. }
  1447. if (sc_side_fold_custom_first_timeout_id) {
  1448. clearTimeout(sc_side_fold_custom_first_timeout_id);
  1449. }
  1450.  
  1451. if (new_sc_side_fold_custom_first_class && the_cca_sc_panel_fold_mode === 1) {
  1452. sc_trigger_item_side_fold_out(new_sc_side_fold_custom_first_class);
  1453. }
  1454.  
  1455. if (!sc_side_fold_custom_each_same_time_flag) {
  1456. sc_side_fold_custom_first_timeout_id = setTimeout(function() {
  1457. if (new_sc_side_fold_custom_first_class && the_cca_sc_panel_fold_mode === 1) {
  1458. sc_trigger_item_side_fold_in(new_sc_side_fold_custom_first_class);
  1459. }
  1460. }, sc_side_fold_custom_time * 1000);
  1461. }
  1462.  
  1463. }
  1464. }
  1465. }
  1466.  
  1467. // 检查全记的状态
  1468. function check_all_memory_status() {
  1469. // 只有当前的记忆模式是全记时才检查
  1470. if (sc_memory === 3) {
  1471. let sc_btn_memory = $(document).find('.sc_button_memory');
  1472. let sc_memory_all_rooms_mode = unsafeWindow.localStorage.getItem('live_sc_memory_all_rooms_mode');
  1473. if (sc_memory_all_rooms_mode !== null && sc_memory_all_rooms_mode !== 'null' && sc_memory_all_rooms_mode !== '') {
  1474. if (parseInt(sc_memory_all_rooms_mode, 10) !== 3) {
  1475. sc_memory = 0;
  1476. sc_btn_memory.text('没记');
  1477. }
  1478. } else {
  1479. sc_memory = 0;
  1480. sc_btn_memory.text('没记');
  1481. }
  1482. }
  1483. }
  1484.  
  1485. function sc_fullscreen_separate_memory_var_copy() {
  1486. sc_panel_list_height_fullscreen = sc_panel_list_height;
  1487. sc_rectangle_width_fullscreen = sc_rectangle_width;
  1488. sc_func_btn_mode_fullscreen = sc_func_btn_mode;
  1489. sc_switch_fullscreen = sc_switch;
  1490. sc_panel_fold_mode_fullscreen = sc_panel_fold_mode;
  1491. sc_panel_side_fold_simple_fullscreen = sc_panel_side_fold_simple;
  1492. sc_panel_drag_left_fullscreen = sc_panel_drag_left;
  1493. sc_panel_drag_top_fullscreen = sc_panel_drag_top;
  1494. sc_panel_side_fold_flag_fullscreen = sc_panel_side_fold_flag;
  1495. sc_data_show_high_energy_num_flag_fullscreen = sc_data_show_high_energy_num_flag;
  1496. }
  1497.  
  1498. function sc_live_panel_width_change(new_width) {
  1499. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1500. sc_rectangle_width_fullscreen = new_width;
  1501. } else {
  1502. sc_rectangle_width = new_width;
  1503. }
  1504. }
  1505.  
  1506. function sc_live_panel_height_change(new_height) {
  1507. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1508. sc_panel_list_height_fullscreen = new_height;
  1509. } else {
  1510. sc_panel_list_height = new_height;
  1511. }
  1512. }
  1513.  
  1514. function sc_live_panel_fold_mode_change(new_mode) {
  1515. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1516. sc_panel_fold_mode_fullscreen = new_mode;
  1517. } else {
  1518. sc_panel_fold_mode = new_mode;
  1519. }
  1520. }
  1521.  
  1522. function sc_live_panel_side_fold_flag_change(new_flag) {
  1523. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1524. sc_panel_side_fold_flag_fullscreen = new_flag;
  1525. } else {
  1526. sc_panel_side_fold_flag = new_flag;
  1527. }
  1528. }
  1529.  
  1530. function sc_live_panel_side_fold_simple_change(new_flag) {
  1531. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1532. sc_panel_side_fold_simple_fullscreen = new_flag;
  1533. } else {
  1534. sc_panel_side_fold_simple = new_flag;
  1535. }
  1536. }
  1537.  
  1538. function sc_live_data_show_high_energy_num_flag_change(new_flag) {
  1539. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1540. sc_data_show_high_energy_num_flag_fullscreen = new_flag;
  1541. } else {
  1542. sc_data_show_high_energy_num_flag = new_flag;
  1543. }
  1544. }
  1545.  
  1546. function sc_live_drag_location_change(new_left_val, new_top_val) {
  1547. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1548. sc_panel_drag_left_fullscreen = new_left_val;
  1549. sc_panel_drag_top_fullscreen = new_top_val;
  1550. } else {
  1551. sc_panel_drag_left = new_left_val;
  1552. sc_panel_drag_top = new_top_val;
  1553. }
  1554. }
  1555.  
  1556. // 记忆存储
  1557. function update_sc_memory_config(config_item_name, config_item_val, type = 'self') {
  1558. let sc_memory_config_key = sc_self_memory_config_key
  1559. if (type === 'all') {
  1560. sc_memory_config_key = 'live_sc_all_memory_config';
  1561. }
  1562.  
  1563. let sc_memory_config = {};
  1564. let sc_memory_config_json = unsafeWindow.localStorage.getItem(sc_memory_config_key);
  1565. if (sc_memory_config_json !== null && sc_memory_config_json !== 'null' && sc_memory_config_json !== '[]' && sc_memory_config_json !== '{}' && sc_memory_config_json !== '') {
  1566. sc_memory_config = JSON.parse(sc_memory_config_json);
  1567. }
  1568.  
  1569. if (config_item_name === 'sc_panel_drag' && Array.isArray(config_item_val)) {
  1570. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1571. sc_memory_config['sc_panel_drag_left_fullscreen'] = config_item_val[0] ?? -1;
  1572. sc_memory_config['sc_panel_drag_top_fullscreen'] = config_item_val[1] ?? -1;
  1573.  
  1574. if (config_item_val[0] >= 0) {
  1575. sc_panel_drag_left_fullscreen_percent = (config_item_val[0] / unsafeWindow.top.document.documentElement.clientWidth).toFixed(7);
  1576. sc_memory_config['sc_panel_drag_left_fullscreen_percent'] = sc_panel_drag_left_fullscreen_percent;
  1577. }
  1578. if (config_item_val[1] >= 0) {
  1579. sc_panel_drag_top_fullscreen_percent = (config_item_val[1] / unsafeWindow.top.document.documentElement.clientHeight).toFixed(7);
  1580. sc_memory_config['sc_panel_drag_top_fullscreen_percent'] = sc_panel_drag_top_fullscreen_percent;
  1581. }
  1582. } else {
  1583. sc_memory_config['sc_panel_drag_left'] = config_item_val[0] ?? -1;
  1584. sc_memory_config['sc_panel_drag_top'] = config_item_val[1] ?? -1;
  1585.  
  1586. if (config_item_val[0] >= 0) {
  1587. sc_panel_drag_left_percent = (config_item_val[0] / unsafeWindow.top.document.documentElement.clientWidth).toFixed(7);
  1588. sc_memory_config['sc_panel_drag_left_percent'] = sc_panel_drag_left_percent;
  1589. }
  1590. if (config_item_val[1] >= 0) {
  1591. sc_panel_drag_top_percent = (config_item_val[1] / unsafeWindow.top.document.documentElement.clientHeight).toFixed(7);
  1592. sc_memory_config['sc_panel_drag_top_percent'] = sc_panel_drag_top_percent;
  1593. }
  1594.  
  1595. }
  1596. } else {
  1597. sc_memory_config[config_item_name] = config_item_val;
  1598.  
  1599. // drag 分辨率适配相关
  1600. if (config_item_name === 'sc_panel_drag_left' && config_item_val >= 0) {
  1601. sc_panel_drag_left_percent = (config_item_val / unsafeWindow.top.document.documentElement.clientWidth).toFixed(7);
  1602. sc_memory_config['sc_panel_drag_left_percent'] = sc_panel_drag_left_percent;
  1603. }
  1604.  
  1605. if (config_item_name === 'sc_panel_drag_left_fullscreen' && config_item_val >= 0) {
  1606. sc_panel_drag_left_fullscreen_percent = (config_item_val / unsafeWindow.top.document.documentElement.clientWidth).toFixed(7);
  1607. sc_memory_config['sc_panel_drag_left_fullscreen_percent'] = sc_panel_drag_left_fullscreen_percent;
  1608. }
  1609.  
  1610. if (config_item_name === 'sc_panel_drag_top' && config_item_val >= 0) {
  1611. sc_panel_drag_top_percent = (config_item_val / unsafeWindow.top.document.documentElement.clientHeight).toFixed(7);
  1612. sc_memory_config['sc_panel_drag_top_percent'] = sc_panel_drag_top_percent;
  1613. }
  1614.  
  1615. if (config_item_name === 'sc_panel_drag_top_fullscreen' && config_item_val >= 0) {
  1616. sc_panel_drag_top_fullscreen_percent = (config_item_val / unsafeWindow.top.document.documentElement.clientHeight).toFixed(7);
  1617. sc_memory_config['sc_panel_drag_top_fullscreen_percent'] = sc_panel_drag_top_fullscreen_percent;
  1618. }
  1619. }
  1620.  
  1621. unsafeWindow.localStorage.setItem(sc_memory_config_key, JSON.stringify(sc_memory_config));
  1622. }
  1623.  
  1624. function sc_switch_store() {
  1625. if (sc_memory === 1) {
  1626. // 题记
  1627. unsafeWindow.localStorage.setItem('live_sc_switch_record_fullscreen', sc_switch_fullscreen);
  1628. unsafeWindow.localStorage.setItem('live_sc_switch_record', sc_switch);
  1629. } else if (sc_memory === 2) {
  1630. // 个记
  1631. update_sc_memory_config('sc_switch', sc_switch, 'self');
  1632. update_sc_memory_config('sc_switch_fullscreen', sc_switch_fullscreen, 'self');
  1633. } else if (sc_memory === 3) {
  1634. // 全记
  1635. update_sc_memory_config('sc_switch', sc_switch, 'all');
  1636. update_sc_memory_config('sc_switch_fullscreen', sc_switch_fullscreen, 'all');
  1637. }
  1638. }
  1639.  
  1640. function sc_fold_mode_store() {
  1641. if (sc_memory === 2) {
  1642. // 个记
  1643. update_sc_memory_config('sc_panel_fold_mode', sc_panel_fold_mode, 'self');
  1644. update_sc_memory_config('sc_panel_fold_mode_fullscreen', sc_panel_fold_mode_fullscreen, 'self');
  1645. } else if (sc_memory === 3) {
  1646. // 全记
  1647. update_sc_memory_config('sc_panel_fold_mode', sc_panel_fold_mode, 'all');
  1648. update_sc_memory_config('sc_panel_fold_mode_fullscreen', sc_panel_fold_mode_fullscreen, 'all');
  1649. }
  1650. }
  1651.  
  1652. function sc_panel_side_fold_flag_store() {
  1653. if (sc_memory === 2) {
  1654. // 个记
  1655. update_sc_memory_config('sc_panel_side_fold_flag', sc_panel_side_fold_flag, 'self');
  1656. update_sc_memory_config('sc_panel_side_fold_flag_fullscreen', sc_panel_side_fold_flag_fullscreen, 'self');
  1657. } else if (sc_memory === 3) {
  1658. // 全记
  1659. update_sc_memory_config('sc_panel_side_fold_flag', sc_panel_side_fold_flag, 'all');
  1660. update_sc_memory_config('sc_panel_side_fold_flag_fullscreen', sc_panel_side_fold_flag_fullscreen, 'all');
  1661. }
  1662. }
  1663.  
  1664. function sc_side_fold_simple_store() {
  1665. if (sc_memory === 2) {
  1666. // 个记
  1667. update_sc_memory_config('sc_panel_side_fold_simple', sc_panel_side_fold_simple, 'self');
  1668. update_sc_memory_config('sc_panel_side_fold_simple_fullscreen', sc_panel_side_fold_simple_fullscreen, 'self');
  1669. } else if (sc_memory === 3) {
  1670. // 全记
  1671. update_sc_memory_config('sc_panel_side_fold_simple', sc_panel_side_fold_simple, 'all');
  1672. update_sc_memory_config('sc_panel_side_fold_simple_fullscreen', sc_panel_side_fold_simple_fullscreen, 'all');
  1673. }
  1674. }
  1675.  
  1676. function sc_panel_drag_store(sc_panel_drag_left_val, sc_panel_drag_top_val) {
  1677. let the_pds_sc_panel_fold_mode = sc_panel_fold_mode;
  1678. let the_pds_sc_rectangle_width = sc_rectangle_width;
  1679. let the_pds_sc_panel_list_height = sc_panel_list_height;
  1680. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1681. the_pds_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  1682. the_pds_sc_rectangle_width = sc_rectangle_width_fullscreen;
  1683. the_pds_sc_panel_list_height = sc_panel_list_height_fullscreen;
  1684. }
  1685.  
  1686. if (sc_panel_drag_left_val <= 0) {
  1687. sc_panel_drag_left_val = 0;
  1688. }
  1689. if (sc_panel_drag_top_val <= 0) {
  1690. sc_panel_drag_top_val = 0;
  1691. }
  1692. if (sc_panel_drag_left_val >= unsafeWindow.innerWidth) {
  1693. if (the_pds_sc_panel_fold_mode === 1) {
  1694. sc_panel_drag_left_val = unsafeWindow.innerWidth - 72;
  1695. } else {
  1696. sc_panel_drag_left_val = unsafeWindow.innerWidth - the_pds_sc_rectangle_width;
  1697. }
  1698. }
  1699. if (sc_panel_drag_top_val >= unsafeWindow.innerHeight) {
  1700. sc_panel_drag_top_val = unsafeWindow.innerHeight - the_pds_sc_panel_list_height;
  1701. }
  1702.  
  1703. sc_live_drag_location_change(sc_panel_drag_left_val, sc_panel_drag_top_val);
  1704.  
  1705. if (sc_memory === 2) {
  1706. // 个记
  1707. update_sc_memory_config('sc_panel_drag', [sc_panel_drag_left_val, sc_panel_drag_top_val], 'self');
  1708. } else if (sc_memory === 3) {
  1709. // 全记
  1710. update_sc_memory_config('sc_panel_drag', [sc_panel_drag_left_val, sc_panel_drag_top_val], 'all');
  1711. }
  1712. }
  1713.  
  1714. function sc_func_btn_mode_store() {
  1715. if (sc_memory === 2) {
  1716. // 个记
  1717. update_sc_memory_config('sc_func_btn_mode', sc_func_btn_mode, 'self');
  1718. update_sc_memory_config('sc_func_btn_mode_fullscreen', sc_func_btn_mode_fullscreen, 'self');
  1719. } else if (sc_memory === 3) {
  1720. // 全记
  1721. update_sc_memory_config('sc_func_btn_mode', sc_func_btn_mode, 'all');
  1722. update_sc_memory_config('sc_func_btn_mode_fullscreen', sc_func_btn_mode_fullscreen, 'all');
  1723. }
  1724. }
  1725.  
  1726. function sc_data_show_bottom_store() {
  1727. if (sc_memory === 2) {
  1728. // 个记
  1729. update_sc_memory_config('data_show_bottom_flag', data_show_bottom_flag, 'self');
  1730. } else if (sc_memory === 3) {
  1731. // 全记
  1732. update_sc_memory_config('data_show_bottom_flag', data_show_bottom_flag, 'all');
  1733. }
  1734. }
  1735.  
  1736. function sc_panel_allow_drag_store() {
  1737. if (sc_memory === 2) {
  1738. // 个记
  1739. update_sc_memory_config('sc_panel_allow_drag_flag', sc_panel_allow_drag_flag, 'self');
  1740. } else if (sc_memory === 3) {
  1741. // 全记
  1742. update_sc_memory_config('sc_panel_allow_drag_flag', sc_panel_allow_drag_flag, 'all');
  1743. }
  1744. }
  1745.  
  1746. function sc_start_time_show_store() {
  1747. if (sc_memory === 2) {
  1748. // 个记
  1749. update_sc_memory_config('sc_start_time_show_flag', sc_start_time_show_flag, 'self');
  1750. } else if (sc_memory === 3) {
  1751. // 全记
  1752. update_sc_memory_config('sc_start_time_show_flag', sc_start_time_show_flag, 'all');
  1753. }
  1754. }
  1755.  
  1756. function sc_start_time_simple_store() {
  1757. if (sc_memory === 2) {
  1758. // 个记
  1759. update_sc_memory_config('sc_start_time_simple_flag', sc_start_time_simple_flag, 'self');
  1760. } else if (sc_memory === 3) {
  1761. // 全记
  1762. update_sc_memory_config('sc_start_time_simple_flag', sc_start_time_simple_flag, 'all');
  1763. }
  1764. }
  1765.  
  1766. function sc_side_fold_custom_config_store() {
  1767. if (sc_memory === 2) {
  1768. // 个记
  1769. update_sc_memory_config('sc_side_fold_custom_config', sc_side_fold_custom_config, 'self');
  1770. update_sc_memory_config('sc_side_fold_custom_time', sc_side_fold_custom_time, 'self');
  1771. update_sc_memory_config('sc_side_fold_custom_each_same_time_flag', sc_side_fold_custom_each_same_time_flag, 'self');
  1772. } else if (sc_memory === 3) {
  1773. // 全记
  1774. update_sc_memory_config('sc_side_fold_custom_config', sc_side_fold_custom_config, 'all');
  1775. update_sc_memory_config('sc_side_fold_custom_time', sc_side_fold_custom_time, 'all');
  1776. update_sc_memory_config('sc_side_fold_custom_each_same_time_flag', sc_side_fold_custom_each_same_time_flag, 'all');
  1777. }
  1778. }
  1779.  
  1780. function sc_welt_hide_circle_half_store() {
  1781. if (sc_memory === 2) {
  1782. // 个记
  1783. update_sc_memory_config('sc_welt_hide_circle_half_flag', sc_welt_hide_circle_half_flag, 'self');
  1784. } else if (sc_memory === 3) {
  1785. // 全记
  1786. update_sc_memory_config('sc_welt_hide_circle_half_flag', sc_welt_hide_circle_half_flag, 'all');
  1787. }
  1788. }
  1789.  
  1790. function sc_rectangle_width_store() {
  1791. if (sc_memory === 2) {
  1792. // 个记
  1793. update_sc_memory_config('sc_rectangle_width', sc_rectangle_width, 'self');
  1794. update_sc_memory_config('sc_rectangle_width_fullscreen', sc_rectangle_width_fullscreen, 'self');
  1795. } else if (sc_memory === 3) {
  1796. // 全记
  1797. update_sc_memory_config('sc_rectangle_width', sc_rectangle_width, 'all');
  1798. update_sc_memory_config('sc_rectangle_width_fullscreen', sc_rectangle_width_fullscreen, 'all');
  1799. }
  1800. }
  1801.  
  1802. function sc_panel_list_height_store() {
  1803. if (sc_memory === 2) {
  1804. // 个记
  1805. update_sc_memory_config('sc_panel_list_height', sc_panel_list_height, 'self');
  1806. update_sc_memory_config('sc_panel_list_height_fullscreen', sc_panel_list_height_fullscreen, 'self');
  1807. } else if (sc_memory === 3) {
  1808. // 全记
  1809. update_sc_memory_config('sc_panel_list_height', sc_panel_list_height, 'all');
  1810. update_sc_memory_config('sc_panel_list_height_fullscreen', sc_panel_list_height_fullscreen, 'all');
  1811. }
  1812. }
  1813.  
  1814. function sc_live_sidebar_left_flag_store() {
  1815. if (sc_memory === 2) {
  1816. // 个记
  1817. update_sc_memory_config('sc_live_sidebar_left_flag', sc_live_sidebar_left_flag, 'self');
  1818. } else if (sc_memory === 3) {
  1819. // 全记
  1820. update_sc_memory_config('sc_live_sidebar_left_flag', sc_live_sidebar_left_flag, 'all');
  1821. }
  1822. }
  1823.  
  1824. function sc_item_order_up_flag_store() {
  1825. if (sc_memory === 2) {
  1826. // 个记
  1827. update_sc_memory_config('sc_item_order_up_flag', sc_item_order_up_flag, 'self');
  1828. } else if (sc_memory === 3) {
  1829. // 全记
  1830. update_sc_memory_config('sc_item_order_up_flag', sc_item_order_up_flag, 'all');
  1831. }
  1832. }
  1833.  
  1834. function sc_fullscreen_separate_memory_config_store() {
  1835. if (sc_memory === 2) {
  1836. // 个记
  1837. update_sc_memory_config('sc_live_fullscreen_config_separate_memory_flag', sc_live_fullscreen_config_separate_memory_flag, 'self');
  1838. } else if (sc_memory === 3) {
  1839. // 全记
  1840. update_sc_memory_config('sc_live_fullscreen_config_separate_memory_flag', sc_live_fullscreen_config_separate_memory_flag, 'all');
  1841. }
  1842. }
  1843.  
  1844. function sc_panel_show_time_mode_config_store() {
  1845. if (sc_memory === 2) {
  1846. // 个记
  1847. update_sc_memory_config('sc_panel_show_time_mode', sc_panel_show_time_mode, 'self');
  1848. } else if (sc_memory === 3) {
  1849. // 全记
  1850. update_sc_memory_config('sc_panel_show_time_mode', sc_panel_show_time_mode, 'all');
  1851. }
  1852. }
  1853.  
  1854. function sc_panel_show_time_each_same_config_store() {
  1855. if (sc_memory === 2) {
  1856. // 个记
  1857. update_sc_memory_config('sc_panel_show_time_each_same', sc_panel_show_time_each_same, 'self');
  1858. } else if (sc_memory === 3) {
  1859. // 全记
  1860. update_sc_memory_config('sc_panel_show_time_each_same', sc_panel_show_time_each_same, 'all');
  1861. }
  1862. }
  1863.  
  1864. function sc_live_panel_show_time_click_stop_flag_config_store() {
  1865. if (sc_memory === 2) {
  1866. // 个记
  1867. update_sc_memory_config('sc_live_panel_show_time_click_stop_flag', sc_live_panel_show_time_click_stop_flag, 'self');
  1868. } else if (sc_memory === 3) {
  1869. // 全记
  1870. update_sc_memory_config('sc_live_panel_show_time_click_stop_flag', sc_live_panel_show_time_click_stop_flag, 'all');
  1871. }
  1872. }
  1873.  
  1874. function sc_search_shortkey_flag_config_store() {
  1875. if (sc_memory === 2) {
  1876. // 个记
  1877. update_sc_memory_config('sc_list_search_shortkey_flag', sc_list_search_shortkey_flag, 'self');
  1878. } else if (sc_memory === 3) {
  1879. // 全记
  1880. update_sc_memory_config('sc_list_search_shortkey_flag', sc_list_search_shortkey_flag, 'all');
  1881. }
  1882. }
  1883.  
  1884. function sc_search_div_bg_opacity_range_config_store() {
  1885. if (sc_memory === 2) {
  1886. // 个记
  1887. update_sc_memory_config('sc_list_search_div_bg_opacity_range', sc_list_search_div_bg_opacity_range, 'self');
  1888. } else if (sc_memory === 3) {
  1889. // 全记
  1890. update_sc_memory_config('sc_list_search_div_bg_opacity_range', sc_list_search_div_bg_opacity_range, 'all');
  1891. }
  1892. }
  1893.  
  1894. function sc_live_auto_tianxuan_flag_config_store() {
  1895. if (sc_memory === 2) {
  1896. // 个记
  1897. update_sc_memory_config('sc_live_auto_tianxuan_flag', sc_live_auto_tianxuan_flag, 'self');
  1898. } else if (sc_memory === 3) {
  1899. // 全记
  1900. update_sc_memory_config('sc_live_auto_tianxuan_flag', sc_live_auto_tianxuan_flag, 'all');
  1901. }
  1902. }
  1903.  
  1904. function sc_live_send_dm_combo_flag_config_store() {
  1905. if (sc_memory === 2) {
  1906. // 个记
  1907. update_sc_memory_config('sc_live_send_dm_combo_flag', sc_live_send_dm_combo_flag, 'self');
  1908. } else if (sc_memory === 3) {
  1909. // 全记
  1910. update_sc_memory_config('sc_live_send_dm_combo_flag', sc_live_send_dm_combo_flag, 'all');
  1911. }
  1912. }
  1913.  
  1914. // SC搜索上一个
  1915. function sc_live_search_confirm_prev() {
  1916. let the_fullscreen_str = '';
  1917. let the_list_class_name = '.sc_long_item';
  1918. if (sc_isFullscreen) {
  1919. the_fullscreen_str = '_fullscreen';
  1920. the_list_class_name = '#live-player .sc_long_item';
  1921. }
  1922.  
  1923. let the_search_user_name = $(document).find('#sc_live_search_user_name' + the_fullscreen_str).val();
  1924. let the_search_content = $(document).find('#sc_live_search_content' + the_fullscreen_str).val();
  1925. let the_search_time = $(document).find('#sc_live_search_time' + the_fullscreen_str).val();
  1926.  
  1927. let the_search_result_div = custom_search_sc_div(the_search_user_name, the_search_content, the_search_time, the_list_class_name, 0);
  1928.  
  1929. if (the_search_result_div) {
  1930. the_search_result_div.scrollIntoView({block: 'center' });
  1931.  
  1932. let the_search_result_div_clone = $(the_search_result_div).clone();
  1933. let the_copy_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  1934. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  1935. the_copy_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  1936. }
  1937. if (the_copy_sc_panel_side_fold_flag) {
  1938. sc_side_fold_out_one(the_search_result_div_clone);
  1939. }
  1940.  
  1941. the_search_result_div_clone.css('width', '100%');
  1942. the_search_result_div_clone.css('height', 'auto');
  1943. the_search_result_div_clone.css('animation', 'unset');
  1944. the_search_result_div_clone.show();
  1945. the_search_result_div_clone.find('.sc_font_color').css('color', '#000000');
  1946. the_search_result_div_clone.find('.sc_start_time').show();
  1947. the_search_result_div_clone.find('.sc_msg_head_left').css('text-align', 'left');
  1948. the_search_result_div_clone.find('.sc_msg_head').removeClass('sc_msg_head');
  1949.  
  1950. let the_search_result_div_clone_msg_body = the_search_result_div_clone.find('.sc_msg_body');
  1951. the_search_result_div_clone_msg_body.css('padding', '10px');
  1952. if (!the_search_result_div_clone_msg_body.is(":visible")) {
  1953. the_search_result_div_clone.css('border-radius', '8px 8px 6px 6px');
  1954. the_search_result_div_clone_msg_body.prev().css('border-radius', '6px 6px 0px 0px');
  1955. the_search_result_div_clone_msg_body.show();
  1956. the_search_result_div_clone.find('.sc_value_font span').css('color', '#000');
  1957. the_search_result_div_clone.attr('data-fold', '0');
  1958. }
  1959.  
  1960. the_search_result_div_clone.removeClass();
  1961.  
  1962. let the_search_result_div_clone_clone = the_search_result_div_clone.clone();
  1963.  
  1964. $(document).find('.sc_live_search_result_div').html(the_search_result_div_clone);
  1965. $(document).find('.sc_live_search_result_div_fullscreen').html(the_search_result_div_clone_clone);
  1966. } else {
  1967. $(document).find('.sc_live_search_result_div').html('');
  1968. $(document).find('.sc_live_search_result_div_fullscreen').html('');
  1969. }
  1970.  
  1971. if (sc_isFullscreen) {
  1972. $(document).find('#sc_live_search_user_name').val(the_search_user_name);
  1973. $(document).find('#sc_live_search_content').val(the_search_content);
  1974. $(document).find('#sc_live_search_time').val(the_search_time);
  1975. } else {
  1976. $(document).find('#sc_live_search_user_name_fullscreen').val(the_search_user_name);
  1977. $(document).find('#sc_live_search_content_fullscreen').val(the_search_content);
  1978. $(document).find('#sc_live_search_time_fullscreen').val(the_search_time);
  1979. }
  1980. }
  1981.  
  1982. // SC搜索下一个
  1983. function sc_live_search_confirm_next() {
  1984. let the_fullscreen_str = '';
  1985. let the_list_class_name = '.sc_long_item';
  1986. if (sc_isFullscreen) {
  1987. the_fullscreen_str = '_fullscreen';
  1988. the_list_class_name = '#live-player .sc_long_item';
  1989. }
  1990.  
  1991. let the_search_user_name = $(document).find('#sc_live_search_user_name' + the_fullscreen_str).val();
  1992. let the_search_content = $(document).find('#sc_live_search_content' + the_fullscreen_str).val();
  1993. let the_search_time = $(document).find('#sc_live_search_time' + the_fullscreen_str).val();
  1994.  
  1995. let the_search_result_div = custom_search_sc_div(the_search_user_name, the_search_content, the_search_time, the_list_class_name, 1);
  1996.  
  1997. if (the_search_result_div) {
  1998. the_search_result_div.scrollIntoView({block: 'center' });
  1999.  
  2000. let the_search_result_div_clone = $(the_search_result_div).clone();
  2001. let the_copy_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  2002. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2003. the_copy_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  2004. }
  2005. if (the_copy_sc_panel_side_fold_flag) {
  2006. sc_side_fold_out_one(the_search_result_div_clone);
  2007. }
  2008.  
  2009. the_search_result_div_clone.css('width', '100%');
  2010. the_search_result_div_clone.css('height', 'auto');
  2011. the_search_result_div_clone.css('animation', 'unset');
  2012. the_search_result_div_clone.show();
  2013. the_search_result_div_clone.find('.sc_font_color').css('color', '#000000');
  2014. the_search_result_div_clone.find('.sc_start_time').show();
  2015. the_search_result_div_clone.find('.sc_msg_head_left').css('text-align', 'left');
  2016. the_search_result_div_clone.find('.sc_msg_head').removeClass('sc_msg_head');
  2017.  
  2018. let the_search_result_div_clone_msg_body = the_search_result_div_clone.find('.sc_msg_body');
  2019. the_search_result_div_clone_msg_body.css('padding', '10px');
  2020. if (!the_search_result_div_clone_msg_body.is(":visible")) {
  2021. the_search_result_div_clone.css('border-radius', '8px 8px 6px 6px');
  2022. the_search_result_div_clone_msg_body.prev().css('border-radius', '6px 6px 0px 0px');
  2023. the_search_result_div_clone_msg_body.show();
  2024. the_search_result_div_clone.find('.sc_value_font span').css('color', '#000');
  2025. the_search_result_div_clone.attr('data-fold', '0');
  2026. }
  2027.  
  2028. the_search_result_div_clone.removeClass();
  2029.  
  2030. let the_search_result_div_clone_clone = the_search_result_div_clone.clone();
  2031.  
  2032. $(document).find('.sc_live_search_result_div').html(the_search_result_div_clone);
  2033. $(document).find('.sc_live_search_result_div_fullscreen').html(the_search_result_div_clone_clone);
  2034. } else {
  2035. $(document).find('.sc_live_search_result_div').html('');
  2036. $(document).find('.sc_live_search_result_div_fullscreen').html('');
  2037. }
  2038.  
  2039. if (sc_isFullscreen) {
  2040. $(document).find('#sc_live_search_user_name').val(the_search_user_name);
  2041. $(document).find('#sc_live_search_content').val(the_search_content);
  2042. $(document).find('#sc_live_search_time').val(the_search_time);
  2043. } else {
  2044. $(document).find('#sc_live_search_user_name_fullscreen').val(the_search_user_name);
  2045. $(document).find('#sc_live_search_content_fullscreen').val(the_search_content);
  2046. $(document).find('#sc_live_search_time_fullscreen').val(the_search_time);
  2047. }
  2048. }
  2049.  
  2050. // 将ctrl+f替换为SC搜索框打开快捷键
  2051. function sc_search_shortkey_ctrlf(e) {
  2052. e = e || unsafeWindow.event;
  2053.  
  2054. if (e.ctrlKey && (e.key === 'f' || e.key === 'F')) {
  2055. e.preventDefault();
  2056.  
  2057. let sc_live_search_config_div_id = 'sc_live_search_config_div';
  2058. if (sc_isFullscreen) {
  2059. sc_live_search_config_div_id = 'sc_live_search_config_div_fullscreen';
  2060. }
  2061. let the_sc_live_search_modal_div = $(document).find('#' + sc_live_search_config_div_id);
  2062. if (the_sc_live_search_modal_div.is(':visible')) {
  2063. the_sc_live_search_modal_div.hide();
  2064. } else {
  2065. the_sc_live_search_modal_div.show();
  2066. }
  2067.  
  2068. } else if (e.ctrlKey && e.key === 'ArrowLeft') {
  2069. e.preventDefault();
  2070.  
  2071. sc_live_search_confirm_prev();
  2072. } else if (e.ctrlKey && e.key === 'ArrowRight') {
  2073. e.preventDefault();
  2074.  
  2075. sc_live_search_confirm_next();
  2076. } else if (e.ctrlKey && e.key === 'ArrowUp') {
  2077. e.preventDefault();
  2078.  
  2079. sc_live_search_confirm_prev();
  2080. } else if (e.ctrlKey && e.key === 'ArrowDown') {
  2081. e.preventDefault();
  2082.  
  2083. sc_live_search_confirm_next();
  2084. }
  2085. }
  2086.  
  2087. function sc_search_shortkey_flag_config_apply() {
  2088. if (sc_list_search_shortkey_flag) {
  2089. $(document).off('keydown', sc_search_shortkey_ctrlf);
  2090.  
  2091. $(document).on('keydown', sc_search_shortkey_ctrlf);
  2092. } else {
  2093. $(document).off('keydown', sc_search_shortkey_ctrlf);
  2094. }
  2095. }
  2096.  
  2097. function sc_live_special_tip_location_store() {
  2098. unsafeWindow.localStorage.setItem('live_sc_special_tip_location', sc_live_special_tip_location);
  2099. }
  2100.  
  2101. function sc_live_special_tip_str_store() {
  2102. unsafeWindow.localStorage.setItem('live_sc_special_tip_str', sc_live_special_tip_str);
  2103. }
  2104.  
  2105. function sc_live_special_msg_flag_config_store() {
  2106. unsafeWindow.localStorage.setItem('live_sc_special_msg_flag', sc_live_special_msg_flag);
  2107. }
  2108.  
  2109. function sc_live_special_sc_flag_config_store() {
  2110. unsafeWindow.localStorage.setItem('live_sc_special_sc_flag', sc_live_special_sc_flag);
  2111. }
  2112.  
  2113. function sc_live_special_danmu_mode_config_store() {
  2114. unsafeWindow.localStorage.setItem('live_sc_special_danmu_mode', sc_live_special_danmu_mode);
  2115. }
  2116.  
  2117. function sc_live_sc_to_danmu_show_flag_config_store() {
  2118. unsafeWindow.localStorage.setItem('live_sc_to_danmu_show_flag', sc_live_sc_to_danmu_show_flag);
  2119. }
  2120.  
  2121. function sc_live_sc_to_danmu_show_location_config_store() {
  2122. unsafeWindow.localStorage.setItem('live_sc_to_danmu_show_location', sc_live_sc_to_danmu_show_location);
  2123. }
  2124.  
  2125. function sc_live_sc_to_danmu_show_mode_config_store() {
  2126. unsafeWindow.localStorage.setItem('live_sc_to_danmu_show_mode', sc_live_sc_to_danmu_show_mode);
  2127. }
  2128.  
  2129. function sc_live_special_sc_no_remain_flag_config_store() {
  2130. unsafeWindow.localStorage.setItem('live_special_sc_no_remain_flag', sc_live_special_sc_no_remain_flag);
  2131. }
  2132.  
  2133. function sc_live_sc_to_danmu_no_remain_flag_config_store() {
  2134. unsafeWindow.localStorage.setItem('live_sc_to_danmu_no_remain_flag', sc_live_sc_to_danmu_no_remain_flag);
  2135. }
  2136.  
  2137. function sc_live_other_config_store() {
  2138. if (sc_memory === 2) {
  2139. // 个记
  2140. update_sc_memory_config('sc_data_show_high_energy_num_flag', sc_data_show_high_energy_num_flag, 'self');
  2141. update_sc_memory_config('sc_data_show_high_energy_num_flag_fullscreen', sc_data_show_high_energy_num_flag_fullscreen, 'self');
  2142. update_sc_memory_config('sc_side_fold_fullscreen_auto_hide_list_flag', sc_side_fold_fullscreen_auto_hide_list_flag, 'self');
  2143. } else if (sc_memory === 3) {
  2144. // 全记
  2145. update_sc_memory_config('sc_data_show_high_energy_num_flag', sc_data_show_high_energy_num_flag, 'all');
  2146. update_sc_memory_config('sc_data_show_high_energy_num_flag_fullscreen', sc_data_show_high_energy_num_flag_fullscreen, 'all');
  2147. update_sc_memory_config('sc_side_fold_fullscreen_auto_hide_list_flag', sc_side_fold_fullscreen_auto_hide_list_flag, 'all');
  2148. }
  2149. }
  2150.  
  2151. function update_sc_switch_rooms(type = 'add') {
  2152. let sc_switch_memory_rooms = [];
  2153. let sc_switch_memory_rooms_json = unsafeWindow.localStorage.getItem('live_sc_switch_memory_rooms');
  2154. if (sc_switch_memory_rooms_json !== null && sc_switch_memory_rooms_json !== 'null' && sc_switch_memory_rooms_json !== '[]' && sc_switch_memory_rooms_json !== '') {
  2155. sc_switch_memory_rooms = JSON.parse(sc_switch_memory_rooms_json);
  2156. }
  2157.  
  2158. if (type === 'add') {
  2159. sc_switch_memory_rooms.push(room_id);
  2160. } else {
  2161. sc_switch_memory_rooms = sc_switch_memory_rooms.filter(item => item !== room_id);
  2162. }
  2163.  
  2164. unsafeWindow.localStorage.setItem('live_sc_switch_memory_rooms', JSON.stringify(sc_switch_memory_rooms));
  2165. }
  2166.  
  2167. // 显示所有按钮
  2168. function sc_menu() {
  2169. $(document).find('.sc_button_item').show();
  2170. $(document).find('.sc_button_menu').hide();
  2171. }
  2172.  
  2173. function sc_scroll_list_to_bottom() {
  2174. let the_sc_list = $(document).find('.sc_long_list');
  2175. the_sc_list.each(function() {
  2176. $(this).scrollTop($(this)[0].scrollHeight);
  2177. });
  2178. }
  2179.  
  2180. // 折叠/展开单个消息
  2181. function sc_toggle_msg_body() {
  2182. let this_sc_item_class_arr = $(this).attr('class').split(' ');
  2183. let this_sc_item_dynamic_className = this_sc_item_class_arr.find((scClassName) => { return scClassName !== 'sc_long_item'; });
  2184. let this_sc_msg_body = $('.' + this_sc_item_dynamic_className).find('.sc_msg_body');
  2185. let this_sc_item_bg_color = $('.' + this_sc_item_dynamic_className).css('background-color');
  2186.  
  2187. if (this_sc_msg_body.is(":visible")) {
  2188. this_sc_msg_body.slideUp(200);
  2189. $('.' + this_sc_item_dynamic_className).css('border-radius', '8px');
  2190. this_sc_msg_body.prev().css('border-radius', '6px');
  2191. $('.' + this_sc_item_dynamic_className).find('.sc_value_font span').css('color', this_sc_item_bg_color);
  2192. $('.' + this_sc_item_dynamic_className).attr('data-fold', '1');
  2193. } else {
  2194. $('.' + this_sc_item_dynamic_className).css('border-radius', '8px 8px 6px 6px');
  2195. this_sc_msg_body.prev().css('border-radius', '6px 6px 0px 0px');
  2196. this_sc_msg_body.slideDown(200);
  2197. $('.' + this_sc_item_dynamic_className).find('.sc_value_font span').css('color', '#000');
  2198. $('.' + this_sc_item_dynamic_className).attr('data-fold', '0');
  2199. }
  2200. }
  2201.  
  2202. // 按钮模式选择
  2203. function sc_btn_mode_apply() {
  2204. let the_bma_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  2205. let the_bma_sc_func_btn_mode = sc_func_btn_mode;
  2206. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2207. the_bma_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  2208. the_bma_sc_func_btn_mode = sc_func_btn_mode_fullscreen;
  2209. }
  2210.  
  2211. if (the_bma_sc_panel_side_fold_flag) {
  2212. if (the_bma_sc_func_btn_mode === 0) {
  2213. // 侧折模式下显示所有的按钮
  2214. sc_menu();
  2215. } else if (the_bma_sc_func_btn_mode === 1) {
  2216. // 侧折模式下隐藏所有的按钮
  2217. $(document).find('.sc_button_item').hide();
  2218. } else if (the_bma_sc_func_btn_mode === 2) {
  2219. // 侧折模式下按钮的极简模式
  2220. $(document).find('.sc_button_item').hide();
  2221. $(document).find('.sc_button_menu').show();
  2222. $(document).find('.sc_button_min').show();
  2223. } else if (the_bma_sc_func_btn_mode === 3) {
  2224. // 侧折模式下只显示折叠按钮
  2225. $(document).find('.sc_button_item').hide();
  2226. $(document).find('.sc_button_min').show();
  2227. } else if (the_bma_sc_func_btn_mode === 4) {
  2228. // 侧折模式下只显示菜单按钮
  2229. $(document).find('.sc_button_item').hide();
  2230. $(document).find('.sc_button_menu').show();
  2231. }
  2232.  
  2233. sc_rectangle_is_slide_down = false;
  2234. }
  2235.  
  2236. }
  2237.  
  2238. // 贴边半隐藏
  2239. function sc_circle_welt_hide_half(sc_circle_left = -10, sc_circle_top = -10) {
  2240. let sc_circle_oj = $(document).find('.sc_long_circle');
  2241. let rect_circle = sc_circle_oj[0].getBoundingClientRect();
  2242.  
  2243. if (rect_circle.width === 0 && rect_circle.height === 0) {
  2244. return;
  2245. }
  2246.  
  2247. if (sc_circle_left === -10 && sc_circle_top === -10) {
  2248. sc_circle_left = sc_circle_oj.position().left;
  2249. sc_circle_top = sc_circle_oj.position().top;
  2250. }
  2251.  
  2252. if (sc_circle_left <= 1) {
  2253. sc_circle_oj.removeClass('sc_circle_x_left_show_animate');
  2254. sc_circle_oj.addClass('sc_circle_x_left_hide_animate');
  2255. } else if (sc_circle_top <= 1) {
  2256. sc_circle_oj.removeClass('sc_circle_y_top_show_animate');
  2257. sc_circle_oj.addClass('sc_circle_y_top_hide_animate');
  2258. } else if (sc_circle_left >= unsafeWindow.innerWidth - 39) {
  2259. sc_circle_oj.removeClass('sc_circle_x_right_show_animate');
  2260. sc_circle_oj.addClass('sc_circle_x_right_hide_animate');
  2261. } else if (sc_circle_top >= unsafeWindow.innerHeight - 39) {
  2262. sc_circle_oj.removeClass('sc_circle_y_bottom_show_animate');
  2263. sc_circle_oj.addClass('sc_circle_y_bottom_hide_animate');
  2264. }
  2265. }
  2266.  
  2267. function sc_panel_width_config_apply() {
  2268. let the_pwa_sc_panel_fold_mode = sc_panel_fold_mode;
  2269. let the_pwa_sc_rectangle_width = sc_rectangle_width;
  2270. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2271. the_pwa_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  2272. the_pwa_sc_rectangle_width = sc_rectangle_width_fullscreen;
  2273. }
  2274.  
  2275. if (the_pwa_sc_panel_fold_mode === 1) {
  2276.  
  2277. if (sc_side_fold_custom_first_class) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  2278. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  2279.  
  2280. if (sc_side_fold_custom_each_same_time_class) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  2281. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  2282.  
  2283. if (sc_side_fold_custom_first_class && !sc_live_sc_to_danmu_show_flag) { sc_side_fold_custom_auto_run_flag = false; sc_custom_config_apply(sc_side_fold_custom_first_class); }
  2284.  
  2285. } else if (the_pwa_sc_panel_fold_mode === 2) {
  2286. $(document).find('.sc_long_rectangle').width(the_pwa_sc_rectangle_width);
  2287. }
  2288.  
  2289. $(document).find('.sc_uname_div').width(the_pwa_sc_rectangle_width / 2 + 5);
  2290. }
  2291.  
  2292. function sc_panel_list_height_config_apply() {
  2293. let height_apply_sc_long_list = $(document).find('.sc_long_list');
  2294. let height_apply_sc_long_rectangle = $(document).find('.sc_long_rectangle');
  2295.  
  2296. let the_sc_panel_list_height = sc_panel_list_height;
  2297. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2298. the_sc_panel_list_height = sc_panel_list_height_fullscreen;
  2299. }
  2300.  
  2301. if (the_sc_panel_list_height === 0) {
  2302. height_apply_sc_long_rectangle.css('border-top', 'unset');
  2303. } else {
  2304. height_apply_sc_long_rectangle.css('border-top', '10px solid transparent');
  2305. }
  2306.  
  2307. if (the_sc_panel_list_height >= 200) {
  2308. height_apply_sc_long_list.css('min-height', '200px');
  2309. height_apply_sc_long_list.css('max-height', the_sc_panel_list_height + 'px');
  2310. } else {
  2311. height_apply_sc_long_list.css('min-height', the_sc_panel_list_height + 'px');
  2312. height_apply_sc_long_list.css('max-height', the_sc_panel_list_height + 'px');
  2313. }
  2314. }
  2315.  
  2316. function sc_panel_list_no_remember_hide() {
  2317. sc_side_fold_hide_list_ing_flag = true;
  2318.  
  2319. let the_plh_sc_panel_fold_mode = sc_panel_fold_mode;
  2320. let the_plh_sc_panel_list_height = sc_panel_list_height;
  2321. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2322. the_plh_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  2323. the_plh_sc_panel_list_height = sc_panel_list_height_fullscreen;
  2324. }
  2325. sc_live_panel_height_change(0);
  2326.  
  2327. let func_btn_sc_long_list = $(document).find('.sc_long_list');
  2328. func_btn_sc_long_list.attr('data-height', the_plh_sc_panel_list_height);
  2329. sc_panel_list_height_config_apply();
  2330.  
  2331. if (sc_side_fold_custom_first_class && the_plh_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  2332. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  2333.  
  2334. if (sc_side_fold_custom_each_same_time_class && the_plh_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  2335. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  2336.  
  2337. if (sc_side_fold_custom_first_class && the_plh_sc_panel_fold_mode === 1 && !sc_live_sc_to_danmu_show_flag) { sc_side_fold_custom_auto_run_flag = false; sc_custom_config_apply(sc_side_fold_custom_first_class); }
  2338.  
  2339. sc_live_panel_height_change(the_plh_sc_panel_list_height);
  2340. }
  2341.  
  2342. function sc_panel_list_no_remember_show(btn_click_flag = true) {
  2343. sc_side_fold_hide_list_ing_flag = false;
  2344.  
  2345. let func_btn_sc_long_list = $(document).find('.sc_long_list');
  2346. let old_rect_height = func_btn_sc_long_list.attr('data-height');
  2347.  
  2348. let the_pls_sc_panel_list_height = sc_panel_list_height;
  2349. let the_pls_sc_panel_fold_mode = sc_panel_fold_mode;
  2350. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag && btn_click_flag) {
  2351. the_pls_sc_panel_list_height = sc_panel_list_height_fullscreen;
  2352. the_pls_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  2353. }
  2354.  
  2355. if (old_rect_height !== undefined && old_rect_height !== 0 && btn_click_flag) {
  2356. sc_live_panel_height_change(parseInt(old_rect_height, 10));
  2357. }
  2358. if (the_pls_sc_panel_list_height === 0 && btn_click_flag) {
  2359. sc_live_panel_height_change(400);
  2360. }
  2361.  
  2362. sc_panel_list_height_config_apply();
  2363.  
  2364. if (btn_click_flag) {
  2365. $(document).find('.sc_long_item').show();
  2366. }
  2367.  
  2368. if (sc_side_fold_custom_first_class && the_pls_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  2369. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  2370.  
  2371. if (sc_side_fold_custom_each_same_time_class && the_pls_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  2372. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  2373.  
  2374. if (sc_side_fold_custom_first_class && the_pls_sc_panel_fold_mode === 1 && !sc_live_sc_to_danmu_show_flag) { sc_side_fold_custom_auto_run_flag = false; sc_custom_config_apply(sc_side_fold_custom_first_class); }
  2375. }
  2376.  
  2377. // 数据显示模块设置
  2378. function sc_live_other_config_data_show_apply() {
  2379. let the_loa_sc_data_show_high_energy_num_flag = sc_data_show_high_energy_num_flag;
  2380.  
  2381. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2382. the_loa_sc_data_show_high_energy_num_flag = sc_data_show_high_energy_num_flag_fullscreen;
  2383. }
  2384.  
  2385. if (the_loa_sc_data_show_high_energy_num_flag) {
  2386. // 记录板的
  2387. $(document).find('.sc_high_energy_num_left').text('高能:');
  2388. $(document).find('.sc_high_energy_num_right').text(high_energy_num);
  2389. if (high_energy_contribute_num === 0) {
  2390. $(document).find('.sc_data_show_label').attr('title', '');
  2391. } else {
  2392. $(document).find('.sc_data_show_label').attr('title', '同接/高能('+ high_energy_contribute_num + '/' + high_energy_num +') = ' + (high_energy_contribute_num / high_energy_num * 100).toFixed(2) + '%');
  2393. }
  2394.  
  2395. // 页面的
  2396. if (data_show_bottom_flag) {
  2397. const sc_loa_data_show_bottom_rank_num_div = $(document).find('#sc_data_show_bottom_rank_num');
  2398. if (sc_loa_data_show_bottom_rank_num_div.length) {
  2399. const sc_loa_urc_data_show_bottom_div = $(document).find('#sc_data_show_bottom_div');
  2400. sc_loa_data_show_bottom_rank_num_div.text('高能:'+ high_energy_num);
  2401. if (high_energy_contribute_num === 0) {
  2402. sc_loa_urc_data_show_bottom_div.attr('title', '');
  2403. } else {
  2404. sc_loa_urc_data_show_bottom_div.attr('title', '同接/高能('+ high_energy_contribute_num + '/' + high_energy_num +') = ' + (high_energy_contribute_num / high_energy_num * 100).toFixed(2) + '%');
  2405. }
  2406. }
  2407. }
  2408. } else {
  2409. // 记录板的
  2410. if (high_energy_contribute_num === 0) {
  2411. $(document).find('.sc_high_energy_num_left').text('高能:');
  2412. $(document).find('.sc_high_energy_num_right').text(high_energy_num);
  2413. $(document).find('.sc_data_show_label').attr('title', '');
  2414. } else {
  2415. $(document).find('.sc_high_energy_num_left').text('同接:');
  2416. $(document).find('.sc_high_energy_num_right').text(high_energy_contribute_num);
  2417. $(document).find('.sc_data_show_label').attr('title', '同接/高能('+ high_energy_contribute_num + '/' + high_energy_num +') = ' + (high_energy_contribute_num / high_energy_num * 100).toFixed(2) + '%');
  2418. }
  2419.  
  2420. // 页面的
  2421. if (data_show_bottom_flag) {
  2422. const sc_loa_data_show_bottom_rank_num_div = $(document).find('#sc_data_show_bottom_rank_num');
  2423. if (sc_loa_data_show_bottom_rank_num_div.length) {
  2424. const sc_loa_urc_data_show_bottom_div = $(document).find('#sc_data_show_bottom_div');
  2425. if (high_energy_contribute_num === 0) {
  2426. sc_loa_data_show_bottom_rank_num_div.text('高能:'+ high_energy_num);
  2427. sc_loa_urc_data_show_bottom_div.attr('title', '');
  2428. } else {
  2429. sc_loa_data_show_bottom_rank_num_div.text('同接:'+ high_energy_contribute_num);
  2430. sc_loa_urc_data_show_bottom_div.attr('title', '同接/高能('+ high_energy_contribute_num + '/' + high_energy_num +') = ' + (high_energy_contribute_num / high_energy_num * 100).toFixed(2) + '%');
  2431. }
  2432. }
  2433. }
  2434. }
  2435. }
  2436.  
  2437. function sc_live_fullscreen_config_all_store() {
  2438. sc_switch_store();
  2439. sc_fold_mode_store();
  2440. sc_panel_side_fold_flag_store();
  2441. sc_side_fold_simple_store();
  2442. sc_func_btn_mode_store();
  2443. sc_rectangle_width_store();
  2444. sc_panel_list_height_store();
  2445. sc_fullscreen_separate_memory_config_store();
  2446. sc_live_other_config_store();
  2447.  
  2448. if (sc_panel_drag_left_fullscreen === -1 && sc_panel_drag_top_fullscreen === -1) {
  2449. const rect_circle = $(document).find('.sc_long_circle')[0].getBoundingClientRect();
  2450. if (rect_circle.width === 0 && rect_circle.height === 0) {
  2451. const rect_rectangle = $(document).find('.sc_long_rectangle')[0].getBoundingClientRect();
  2452. sc_panel_drag_store(rect_rectangle.left, rect_rectangle.top);
  2453. } else {
  2454. sc_panel_drag_store(rect_circle.left, rect_circle.top);
  2455. }
  2456. }
  2457. }
  2458.  
  2459. // 侧折显示板
  2460. function sc_sidefold(flag = true) {
  2461. $(document).find('.sc_long_rectangle').css('width', '72px');
  2462. $(document).find('.sc_long_list').css('padding-left', '11px');
  2463. $(document).find('.sc_long_item').css('width', '50px');
  2464. $(document).find('.sc_long_item').css('height', '50px');
  2465. let sc_btn_item = $(document).find('.sc_button_item');
  2466. sc_btn_item.css('margin-top', '6px');
  2467. sc_btn_item.css('margin-bottom', '0px');
  2468. sc_btn_item.css('margin-right', '0px');
  2469.  
  2470. let sc_btn_sidefold = $(document).find('.sc_button_sidefold');
  2471. sc_btn_sidefold.addClass('sc_button_foldback');
  2472. sc_btn_sidefold.removeClass('sc_button_sidefold');
  2473. sc_btn_sidefold.text('展开');
  2474.  
  2475. let sc_data_show = $(document).find('.sc_data_show');
  2476. sc_data_show.css('margin-bottom', '5px');
  2477. sc_data_show.css('height', '70px');
  2478.  
  2479. $(document).find('.sc_label_data_br').show();
  2480.  
  2481. let sc_label_high_energy_left = $(document).find('.sc_high_energy_num_left');
  2482. let sc_label_high_energy_right = $(document).find('.sc_high_energy_num_right');
  2483. let sc_label_captain_left = $(document).find('.sc_captain_num_left');
  2484. let sc_label_captain_right = $(document).find('.sc_captain_num_right');
  2485. let sc_label_num_br3 = $(document).find('.sc_label_num_br3');
  2486. let clone_sc_label_captain_right = sc_label_captain_right.last().clone(true);
  2487. let clone_sc_label_num_br3 = sc_label_num_br3.last().clone(true);
  2488. clone_sc_label_captain_right.css('float', 'none');
  2489. sc_data_show.append(clone_sc_label_num_br3);
  2490. sc_data_show.append(clone_sc_label_captain_right);
  2491. sc_label_captain_right.remove();
  2492. sc_label_num_br3.remove();
  2493. sc_label_high_energy_left.css('float', 'right');
  2494. sc_label_high_energy_right.css('float', 'none');
  2495. sc_label_captain_left.css('margin-top', '10px');
  2496.  
  2497. let sc_long_rectangle = $(document).find('.sc_long_rectangle');
  2498. let sc_long_buttons = $(document).find('.sc_long_buttons');
  2499. let clone_sc_data_show = sc_data_show.last().clone(true);
  2500. let clone_sc_long_buttons = sc_long_buttons.last().clone(true);
  2501. clone_sc_long_buttons.hide();
  2502.  
  2503. let the_sf_sc_panel_side_fold_simple = sc_panel_side_fold_simple;
  2504. let the_sf_sc_panel_list_height = sc_panel_list_height;
  2505. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2506. the_sf_sc_panel_side_fold_simple = sc_panel_side_fold_simple_fullscreen;
  2507. the_sf_sc_panel_list_height = sc_panel_list_height_fullscreen;
  2508. }
  2509.  
  2510. if (the_sf_sc_panel_side_fold_simple) {
  2511. clone_sc_data_show.hide();
  2512. } else {
  2513. sc_long_rectangle.css('border-bottom', 'unset');
  2514. }
  2515. sc_long_rectangle.append(clone_sc_data_show);
  2516. sc_long_rectangle.append(clone_sc_long_buttons);
  2517. sc_data_show.remove();
  2518. sc_long_buttons.remove();
  2519.  
  2520. sc_side_fold_in_all();
  2521.  
  2522. sc_live_panel_side_fold_flag_change(true);
  2523.  
  2524. if (flag) {
  2525. if (unsafeWindow.innerHeight - sc_long_rectangle.position().top < the_sf_sc_panel_list_height + 280) {
  2526. sc_long_rectangle.each(function() {
  2527. $(this).css('top', unsafeWindow.innerHeight - the_sf_sc_panel_list_height - 280);
  2528. });
  2529. }
  2530.  
  2531. sc_live_panel_fold_mode_change(1);
  2532.  
  2533. sc_fold_mode_store();
  2534. sc_panel_side_fold_flag_store();
  2535.  
  2536. if (sc_item_order_up_flag) {
  2537. sc_scroll_list_to_bottom();
  2538. }
  2539. }
  2540.  
  2541. sc_btn_mode_apply();
  2542.  
  2543. if (!sc_live_sc_to_danmu_show_flag) {
  2544. sc_side_fold_custom_auto_run_flag = false;
  2545.  
  2546. sc_custom_config_apply(sc_side_fold_custom_first_class);
  2547. }
  2548. }
  2549.  
  2550. // 侧折后恢复展开显示板
  2551. function sc_foldback(flag = true) {
  2552. let the_fb_sc_panel_fold_mode = sc_panel_fold_mode;
  2553. let the_fb_sc_rectangle_width = sc_rectangle_width;
  2554. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag && flag) {
  2555. the_fb_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  2556. the_fb_sc_rectangle_width = sc_rectangle_width_fullscreen;
  2557. }
  2558.  
  2559. if (sc_side_fold_custom_first_class && the_fb_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  2560. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  2561.  
  2562. if (sc_side_fold_custom_each_same_time_class && the_fb_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  2563. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  2564.  
  2565. $(document).find('.sc_long_rectangle').css('width', the_fb_sc_rectangle_width + 'px');
  2566. $(document).find('.sc_long_list').css('padding-left', '10px');
  2567. $(document).find('.sc_long_item').css('width', 'unset');
  2568. $(document).find('.sc_long_item').css('height', 'unset');
  2569. let sc_btn_item = $(document).find('.sc_button_item');
  2570. sc_btn_item.css('margin-top', '15px');
  2571. sc_btn_item.css('margin-bottom', '15px');
  2572. sc_btn_item.css('margin-right', '7px');
  2573. $(document).find('.sc_button_min').css('margin-right', '0px');
  2574.  
  2575. let sc_btn_foldback = $(document).find('.sc_button_foldback');
  2576. sc_btn_foldback.addClass('sc_button_sidefold');
  2577. sc_btn_foldback.removeClass('sc_button_foldback');
  2578. sc_btn_foldback.text('侧折');
  2579.  
  2580. let sc_data_show = $(document).find('.sc_data_show');
  2581. sc_data_show.css('margin-bottom', '10px');
  2582. sc_data_show.css('height', '20px');
  2583.  
  2584. $(document).find('.sc_label_data_br').hide();
  2585.  
  2586. let sc_label_high_energy_left = $(document).find('.sc_high_energy_num_left');
  2587. let sc_label_high_energy_right = $(document).find('.sc_high_energy_num_right');
  2588. let sc_label_captain_left = $(document).find('.sc_captain_num_left');
  2589. let sc_label_captain_right = $(document).find('.sc_captain_num_right');
  2590. let sc_label_num_br3 = $(document).find('.sc_label_num_br3');
  2591. let clone_sc_label_captain_left = sc_label_captain_left.last().clone(true);
  2592. let clone_sc_label_num_br3 = sc_label_num_br3.last().clone(true);
  2593. clone_sc_label_captain_left.css('margin-top', '0px');
  2594. sc_data_show.append(clone_sc_label_num_br3);
  2595. sc_data_show.append(clone_sc_label_captain_left);
  2596. sc_label_captain_left.remove();
  2597. sc_label_num_br3.remove();
  2598. sc_label_high_energy_left.css('float', 'left');
  2599. sc_label_high_energy_right.css('float', 'left');
  2600. sc_label_captain_right.css('float', 'right');
  2601.  
  2602. let sc_long_rectangle = $(document).find('.sc_long_rectangle');
  2603. let sc_long_buttons = $(document).find('.sc_long_buttons');
  2604.  
  2605. sc_data_show.hide();
  2606. sc_long_buttons.hide();
  2607.  
  2608. let clone_sc_data_show = sc_data_show.last().clone(true);
  2609. let clone_sc_long_buttons = sc_long_buttons.last().clone(true);
  2610. sc_long_rectangle.css('border-bottom', '10px solid transparent');
  2611. sc_long_rectangle.prepend(clone_sc_data_show);
  2612. sc_long_rectangle.prepend(clone_sc_long_buttons);
  2613. sc_data_show.remove();
  2614. sc_long_buttons.remove();
  2615.  
  2616. if (unsafeWindow.innerWidth - sc_long_rectangle.position().left < the_fb_sc_rectangle_width) {
  2617. sc_long_rectangle.each(function() {
  2618. $(this).css('left', unsafeWindow.innerWidth - the_fb_sc_rectangle_width - 15);
  2619. });
  2620. }
  2621.  
  2622. sc_side_fold_out_all();
  2623.  
  2624. if (the_fb_sc_panel_fold_mode === 1 && sc_side_fold_fullscreen_auto_hide_list_flag) {
  2625. sc_panel_list_height_config_apply();
  2626. }
  2627.  
  2628. sc_live_panel_fold_mode_change(2);
  2629. sc_live_panel_side_fold_flag_change(false);
  2630.  
  2631. sc_fold_mode_store();
  2632. sc_panel_side_fold_flag_store();
  2633.  
  2634. sc_menu();
  2635.  
  2636. if (sc_item_order_up_flag) {
  2637. sc_scroll_list_to_bottom();
  2638. }
  2639. }
  2640.  
  2641. // 折叠显示板
  2642. function sc_minimize(flag = true) {
  2643. let the_min_sc_panel_fold_mode = sc_panel_fold_mode;
  2644. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag && flag) {
  2645. the_min_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  2646. }
  2647.  
  2648. if (sc_side_fold_custom_first_class && the_min_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  2649. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  2650.  
  2651. if (sc_side_fold_custom_each_same_time_class && the_min_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  2652. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  2653.  
  2654. $(document).find('.sc_long_circle').show();
  2655. $(document).find('.sc_long_rectangle').hide();
  2656. $(document).find('.sc_long_buttons').hide(); // 优化回弹问题
  2657.  
  2658. sc_live_panel_fold_mode_change(0);
  2659.  
  2660. sc_fold_mode_store();
  2661.  
  2662. if (sc_welt_hide_circle_half_flag) { sc_circle_welt_hide_half(); }
  2663. }
  2664.  
  2665. // 切换主题
  2666. function sc_switch_css(flag = false) {
  2667. if (flag) {
  2668. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2669. sc_switch_fullscreen++;
  2670. } else {
  2671. sc_switch++;
  2672. }
  2673.  
  2674. // 记录主题
  2675. sc_switch_store();
  2676. }
  2677.  
  2678. let sc_rectangle = $(document).find('.sc_long_rectangle');
  2679. let sc_item = $(document).find('.sc_long_item');
  2680. let sc_list = $(document).find('.sc_long_list');
  2681. let sc_data_show = $(document).find('.sc_data_show');
  2682. let sc_button_item = $(document).find('.sc_button_item');
  2683.  
  2684. let the_theme_sc_switch = sc_switch;
  2685. let the_theme_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  2686. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2687. the_theme_sc_switch = sc_switch_fullscreen;
  2688. the_theme_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  2689. }
  2690.  
  2691. if (the_theme_sc_switch === 0) {
  2692. // 白色
  2693. sc_rectangle.css('background-color', 'rgba(255,255,255,1)');
  2694. sc_rectangle.css('box-shadow', '2px 2px 5px black');
  2695. sc_item.css('box-shadow', 'rgba(0, 0, 0, 0.5) 2px 2px 2px');
  2696. if (the_theme_sc_panel_side_fold_flag) {
  2697. sc_list.css('padding', '0px 14px 0px 11px');
  2698. } else {
  2699. sc_list.css('padding', '0px 13px 0px 10px');
  2700. }
  2701. sc_data_show.css('color', '#000');
  2702. sc_button_item.css('background', 'linear-gradient(90deg, #A7C9D3, #eeeeee, #5c95d7, #A7C9D3)');
  2703. sc_button_item.css('background-size', '350%');
  2704. sc_button_item.css('border', 0);
  2705. $(document).find('#sc_scrollbar_style').text(`
  2706. .sc_long_list::-webkit-scrollbar {
  2707. width: 6px;
  2708. }
  2709. .sc_long_list:hover::-webkit-scrollbar-thumb {
  2710. background: rgba(204,204,204,0.5);
  2711. border-radius: 6px;
  2712. }
  2713. .sc_long_list::-webkit-scrollbar-thumb {
  2714. background: rgba(204,204,204,0);
  2715. }
  2716. `);
  2717. } else if(the_theme_sc_switch === 1) {
  2718. // 透明
  2719. sc_rectangle.css('background-color', 'rgba(255,255,255,0)');
  2720. sc_rectangle.css('box-shadow', '');
  2721. sc_item.css('box-shadow', '');
  2722. if (the_theme_sc_panel_side_fold_flag){
  2723. sc_list.css('padding', '0px 12px 0px 11px');
  2724. } else {
  2725. sc_list.css('padding', '0px 11px 0px 10px');
  2726. }
  2727. sc_data_show.css('color', '#ffffff');
  2728. sc_button_item.css('background', 'rgba(255,255,255,0)');
  2729. sc_button_item.css('border', '1px solid #ffffff');
  2730. $(document).find('#sc_scrollbar_style').text(`
  2731. .sc_long_list::-webkit-scrollbar {
  2732. width: 6px;
  2733. }
  2734. .sc_long_list:hover::-webkit-scrollbar-thumb {
  2735. background: rgba(255,255,255,0.1);
  2736. border-radius: 6px;
  2737. }
  2738. .sc_long_list::-webkit-scrollbar-thumb {
  2739. background: rgba(255,255,255,0);
  2740. }
  2741. `);
  2742. } else if(the_theme_sc_switch === 2) {
  2743. // 半透明(白0.1)
  2744. sc_rectangle.css('background-color', 'rgba(255,255,255,0.1)');
  2745. sc_item.css('box-shadow', 'rgba(0, 0, 0, 0.5) 2px 2px 2px');
  2746. if (the_theme_sc_panel_side_fold_flag) {
  2747. sc_list.css('padding', '0px 14px 0px 11px');
  2748. } else {
  2749. sc_list.css('padding', '0px 13px 0px 10px');
  2750. }
  2751. sc_data_show.css('color', '#ffffff');
  2752. sc_button_item.css('background', 'linear-gradient(90deg, #A7C9D3, #eeeeee, #5c95d7, #A7C9D3)');
  2753. sc_button_item.css('background-size', '350%');
  2754. sc_button_item.css('border', 0);
  2755. $(document).find('#sc_scrollbar_style').text(`
  2756. .sc_long_list::-webkit-scrollbar {
  2757. width: 6px;
  2758. }
  2759. .sc_long_list:hover::-webkit-scrollbar-thumb {
  2760. background: rgba(204,204,204,0.2);
  2761. border-radius: 6px;
  2762. }
  2763. .sc_long_list::-webkit-scrollbar-thumb {
  2764. background: rgba(204,204,204,0);
  2765. }
  2766. `);
  2767. } else if(the_theme_sc_switch === 3) {
  2768. // 半透明(白0.5)
  2769. sc_rectangle.css('background-color', 'rgba(255,255,255,0.5)');
  2770. sc_item.css('box-shadow', 'rgba(0, 0, 0, 0.5) 2px 2px 2px');
  2771. if (the_theme_sc_panel_side_fold_flag) {
  2772. sc_list.css('padding', '0px 14px 0px 11px');
  2773. } else {
  2774. sc_list.css('padding', '0px 13px 0px 10px');
  2775. }
  2776. sc_data_show.css('color', '#000');
  2777. sc_button_item.css('background', 'linear-gradient(90deg, #A7C9D3, #eeeeee, #5c95d7, #A7C9D3)');
  2778. sc_button_item.css('background-size', '350%');
  2779. sc_button_item.css('border', 0);
  2780. $(document).find('#sc_scrollbar_style').text(`
  2781. .sc_long_list::-webkit-scrollbar {
  2782. width: 6px;
  2783. }
  2784. .sc_long_list:hover::-webkit-scrollbar-thumb {
  2785. background: rgba(204,204,204,0.5);
  2786. border-radius: 6px;
  2787. }
  2788. .sc_long_list::-webkit-scrollbar-thumb {
  2789. background: rgba(204,204,204,0);
  2790. }
  2791. `);
  2792. } else if(the_theme_sc_switch === 4) {
  2793. // 半透明(黑色0.1)
  2794. sc_rectangle.css('background-color', 'rgba(0,0,0,0.1)');
  2795. sc_rectangle.css('box-shadow', '');
  2796. sc_item.css('box-shadow', '');
  2797. if (the_theme_sc_panel_side_fold_flag) {
  2798. sc_list.css('padding', '0px 12px 0px 11px');
  2799. } else {
  2800. sc_list.css('padding', '0px 11px 0px 10px');
  2801. }
  2802. sc_data_show.css('color', '#ffffff');
  2803. sc_button_item.css('background', 'rgba(255,255,255,0)');
  2804. sc_button_item.css('border', '1px solid #ffffff');
  2805. $(document).find('#sc_scrollbar_style').text(`
  2806. .sc_long_list::-webkit-scrollbar {
  2807. width: 6px;
  2808. }
  2809. .sc_long_list:hover::-webkit-scrollbar-thumb {
  2810. background: rgba(255,255,255,0.2);
  2811. border-radius: 6px;
  2812. }
  2813. .sc_long_list::-webkit-scrollbar-thumb {
  2814. background: rgba(255,255,255,0);
  2815. }
  2816. `);
  2817. } else if(the_theme_sc_switch === 5) {
  2818. // 半透明(黑色0.5)
  2819. sc_rectangle.css('background-color', 'rgba(0,0,0,0.5)');
  2820. sc_rectangle.css('box-shadow', '');
  2821. sc_item.css('box-shadow', '');
  2822. if (the_theme_sc_panel_side_fold_flag) {
  2823. sc_list.css('padding', '0px 12px 0px 11px');
  2824. } else {
  2825. sc_list.css('padding', '0px 12px 0px 10px');
  2826. }
  2827. sc_data_show.css('color', '#ffffff');
  2828. sc_button_item.css('background', 'rgba(255,255,255,0)');
  2829. sc_button_item.css('border', '1px solid #ffffff');
  2830. $(document).find('#sc_scrollbar_style').text(`
  2831. .sc_long_list::-webkit-scrollbar {
  2832. width: 6px;
  2833. }
  2834. .sc_long_list:hover::-webkit-scrollbar-thumb {
  2835. background: rgba(255,255,255,0.2);
  2836. border-radius: 6px;
  2837. }
  2838. .sc_long_list::-webkit-scrollbar-thumb {
  2839. background: rgba(255,255,255,0);
  2840. }
  2841. `);
  2842. } else {
  2843. // 白色
  2844. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2845. sc_switch_fullscreen = 0;
  2846. } else {
  2847. sc_switch = 0;
  2848. }
  2849.  
  2850. sc_rectangle.css('background-color', 'rgba(255,255,255,1)');
  2851. sc_item.css('box-shadow', 'rgba(0, 0, 0, 0.5) 2px 2px 2px');
  2852. if (the_theme_sc_panel_side_fold_flag) {
  2853. sc_list.css('padding', '0px 14px 0px 11px');
  2854. } else {
  2855. sc_list.css('padding', '0px 13px 0px 10px');
  2856. }
  2857.  
  2858. sc_data_show.css('color', '#000');
  2859. sc_button_item.css('background', 'linear-gradient(90deg, #A7C9D3, #eeeeee, #5c95d7, #A7C9D3)');
  2860. sc_button_item.css('background-size', '350%');
  2861. sc_button_item.css('border', 0);
  2862. $(document).find('#sc_scrollbar_style').text(`
  2863. .sc_long_list::-webkit-scrollbar {
  2864. width: 6px;
  2865. }
  2866. .sc_long_list:hover::-webkit-scrollbar-thumb {
  2867. background: rgba(204,204,204,0.5);
  2868. border-radius: 6px;
  2869. }
  2870. .sc_long_list::-webkit-scrollbar-thumb {
  2871. background: rgba(204,204,204,0);
  2872. }
  2873. `);
  2874. }
  2875. }
  2876.  
  2877. // 记忆模式
  2878. function sc_memory_modify() {
  2879. let sc_btn_memory = $(document).find('.sc_button_memory');
  2880.  
  2881. if (sc_memory === 1) {
  2882. // 从[题记]切换到其他模式时,在题记房间中剔除当前房间
  2883. update_sc_switch_rooms('del');
  2884. } else if (sc_memory === 2) {
  2885. // 从[个记]切换到其他模式时,删除当前的个记配置
  2886. unsafeWindow.localStorage.removeItem(sc_self_memory_config_key);
  2887. } else if (sc_memory=== 3) {
  2888. // 从[全记]切换到其他模式时,删除全记配置
  2889. unsafeWindow.localStorage.removeItem('live_sc_memory_all_rooms_mode');
  2890. unsafeWindow.localStorage.removeItem('live_sc_all_memory_config');
  2891. }
  2892.  
  2893. sc_memory++;
  2894. if (sc_memory === 0) {
  2895. sc_btn_memory.text('没记');
  2896. } else if(sc_memory === 1) {
  2897. sc_btn_memory.text('题记');
  2898. update_sc_switch_rooms('add');
  2899. // 切换到题记的配置
  2900. let sc_switch_record = unsafeWindow.localStorage.getItem('live_sc_switch_record');
  2901. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2902. sc_switch_record = unsafeWindow.localStorage.getItem('live_sc_switch_record_fullscreen');
  2903. }
  2904. if (sc_switch_record !== null && sc_switch_record !== 'null' && sc_switch_record !== '') {
  2905. sc_switch = parseInt(sc_switch_record, 10);
  2906. sc_switch_css();
  2907. }
  2908. } else if(sc_memory === 2) {
  2909. sc_btn_memory.text('个记');
  2910. // 保存个记的配置
  2911. sc_switch_store();
  2912. sc_fold_mode_store();
  2913. sc_panel_side_fold_flag_store();
  2914. sc_side_fold_simple_store();
  2915. sc_func_btn_mode_store();
  2916. sc_side_fold_custom_config_store();
  2917. sc_rectangle_width_store();
  2918. sc_panel_list_height_store();
  2919. sc_item_order_up_flag_store();
  2920. sc_data_show_bottom_store();
  2921. sc_panel_allow_drag_store();
  2922. sc_welt_hide_circle_half_store();
  2923. sc_start_time_simple_store();
  2924. sc_start_time_show_store();
  2925. sc_live_sidebar_left_flag_store();
  2926. sc_fullscreen_separate_memory_config_store();
  2927. sc_live_other_config_store();
  2928. sc_panel_show_time_mode_config_store();
  2929. sc_panel_show_time_each_same_config_store();
  2930. sc_live_panel_show_time_click_stop_flag_config_store();
  2931. sc_search_shortkey_flag_config_store();
  2932. sc_search_div_bg_opacity_range_config_store();
  2933. sc_live_auto_tianxuan_flag_config_store();
  2934. sc_live_send_dm_combo_flag_config_store();
  2935.  
  2936. const rect_circle = $(document).find('.sc_long_circle')[0].getBoundingClientRect();
  2937. if (rect_circle.width === 0 && rect_circle.height === 0) {
  2938. const rect_rectangle = $(document).find('.sc_long_rectangle')[0].getBoundingClientRect();
  2939. sc_panel_drag_store(rect_rectangle.left, rect_rectangle.top);
  2940. } else {
  2941. sc_panel_drag_store(rect_circle.left, rect_circle.top);
  2942. }
  2943. } else if(sc_memory=== 3) {
  2944. sc_btn_memory.text('全记');
  2945. unsafeWindow.localStorage.setItem('live_sc_memory_all_rooms_mode', sc_memory);
  2946. // 保存全记的配置
  2947. sc_switch_store();
  2948. sc_fold_mode_store();
  2949. sc_panel_side_fold_flag_store();
  2950. sc_side_fold_simple_store();
  2951. sc_func_btn_mode_store();
  2952. sc_side_fold_custom_config_store();
  2953. sc_rectangle_width_store();
  2954. sc_panel_list_height_store();
  2955. sc_item_order_up_flag_store();
  2956. sc_data_show_bottom_store();
  2957. sc_panel_allow_drag_store();
  2958. sc_welt_hide_circle_half_store();
  2959. sc_start_time_simple_store();
  2960. sc_start_time_show_store();
  2961. sc_live_sidebar_left_flag_store();
  2962. sc_fullscreen_separate_memory_config_store();
  2963. sc_live_other_config_store();
  2964. sc_panel_show_time_mode_config_store();
  2965. sc_panel_show_time_each_same_config_store();
  2966. sc_live_panel_show_time_click_stop_flag_config_store();
  2967. sc_search_shortkey_flag_config_store();
  2968. sc_search_div_bg_opacity_range_config_store();
  2969. sc_live_auto_tianxuan_flag_config_store();
  2970. sc_live_send_dm_combo_flag_config_store();
  2971.  
  2972. const rect_circle = $(document).find('.sc_long_circle')[0].getBoundingClientRect();
  2973. if (rect_circle.width === 0 && rect_circle.height === 0) {
  2974. const rect_rectangle = $(document).find('.sc_long_rectangle')[0].getBoundingClientRect();
  2975. sc_panel_drag_store(rect_rectangle.left, rect_rectangle.top);
  2976. } else {
  2977. sc_panel_drag_store(rect_circle.left, rect_circle.top);
  2978. }
  2979. } else {
  2980. sc_memory = 0;
  2981. sc_btn_memory.text('没记');
  2982. }
  2983. }
  2984.  
  2985. function sc_memory_show() {
  2986. let sc_circles = $(document).find('.sc_long_circle');
  2987. let sc_rectangles = $(document).find('.sc_long_rectangle');
  2988.  
  2989. let the_ms_sc_panel_fold_mode = sc_panel_fold_mode;
  2990. let the_ms_sc_panel_drag_left = sc_panel_drag_left;
  2991. let the_ms_sc_panel_drag_top = sc_panel_drag_top;
  2992. let the_ms_sc_panel_side_fold_simple = sc_panel_side_fold_simple;
  2993. let the_ms_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  2994.  
  2995. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  2996. the_ms_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  2997. the_ms_sc_panel_drag_left = sc_panel_drag_left_fullscreen;
  2998. the_ms_sc_panel_drag_top = sc_panel_drag_top_fullscreen;
  2999. the_ms_sc_panel_side_fold_simple = sc_panel_side_fold_simple_fullscreen;
  3000. the_ms_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  3001. }
  3002.  
  3003. if (the_ms_sc_panel_fold_mode) {
  3004. sc_circles.each(function() {
  3005. if (the_ms_sc_panel_drag_left >= 0) {
  3006. $(this).css('left', the_ms_sc_panel_drag_left + 'px');
  3007. }
  3008.  
  3009. if (the_ms_sc_panel_drag_top >= 0) {
  3010. $(this).css('top', the_ms_sc_panel_drag_top + 'px');
  3011. }
  3012.  
  3013. $(this).hide();
  3014. });
  3015.  
  3016. sc_rectangles.each(function() {
  3017. if (the_ms_sc_panel_drag_left >= 0) {
  3018. $(this).css('left', the_ms_sc_panel_drag_left + 'px');
  3019. }
  3020.  
  3021. if (the_ms_sc_panel_drag_top >= 0) {
  3022. $(this).css('top', the_ms_sc_panel_drag_top + 'px');
  3023. }
  3024.  
  3025. if (the_ms_sc_panel_fold_mode === 1 && !the_ms_sc_panel_side_fold_simple) {
  3026. $(document).find('.sc_data_show').show();
  3027. }
  3028.  
  3029. $(this).slideDown(500);
  3030. });
  3031.  
  3032. if (the_ms_sc_panel_fold_mode === 1) { sc_sidefold(false); sc_btn_mode_apply(); }
  3033. } else {
  3034.  
  3035. if (the_ms_sc_panel_side_fold_flag) { sc_sidefold(false); sc_btn_mode_apply(); }
  3036.  
  3037. sc_circles.each(function() {
  3038. if (the_ms_sc_panel_drag_left >= 0) {
  3039. $(this).css('left', the_ms_sc_panel_drag_left + 'px');
  3040. }
  3041.  
  3042. if (the_ms_sc_panel_drag_top >= 0) {
  3043. $(this).css('top', the_ms_sc_panel_drag_top + 'px');
  3044. }
  3045. });
  3046.  
  3047. if (sc_welt_hide_circle_half_flag) { sc_circle_welt_hide_half(the_ms_sc_panel_drag_left, the_ms_sc_panel_drag_top); }
  3048. }
  3049.  
  3050. if (sc_live_sidebar_left_flag) { setTimeout(() => { sc_live_sidebar_position_left_apply() }, 1000); }
  3051.  
  3052. sc_search_shortkey_flag_config_apply();
  3053. }
  3054.  
  3055. // 导出
  3056. function sc_export() {
  3057. let sc_localstorage_json_export = unsafeWindow.localStorage.getItem(sc_localstorage_key);
  3058. if (sc_localstorage_json_export === null || sc_localstorage_json_export === 'null' || sc_localstorage_json_export === '[]' || sc_localstorage_json_export === '') {
  3059. return;
  3060. } else {
  3061. let sc_localstorage_export = JSON.parse(sc_localstorage_json_export);
  3062. let sc_export_str = '';
  3063. for (let j = 0; j < sc_localstorage_export.length; j++) {
  3064. let sc_export_timestamp = '[' + getTimestampConversion(sc_localstorage_export[j]["start_time"]) + ']';
  3065. let sc_export_uname = '[ ' + sc_localstorage_export[j]["user_info"]["uname"] + ' ]';
  3066. let sc_export_uid = '[ uid: ' + sc_localstorage_export[j]["uid"] + ' ]';
  3067. let sc_export_guard_level = sc_localstorage_export[j]["user_info"]["guard_level"];
  3068. let sc_export_guard = '';
  3069. if (sc_export_guard_level === 1) {
  3070. sc_export_guard = '[总督]'
  3071. } else if (sc_export_guard_level === 2) {
  3072. sc_export_guard = '[提督]';
  3073. } else if (sc_export_guard_level === 3) {
  3074. sc_export_guard = '[舰长]';
  3075. } else {
  3076. sc_export_guard = '[普通]';
  3077. }
  3078.  
  3079. let sc_export_price = '[ ¥' + sc_localstorage_export[j]["price"] + ' ]';
  3080. let sc_export_message = '[ ' + sc_localstorage_export[j]["message"] + ' ]';
  3081.  
  3082. sc_export_str += sc_export_timestamp + sc_export_guard + sc_export_uid + sc_export_uname + sc_export_price + ' : ' + sc_export_message + '\n\n';
  3083. }
  3084.  
  3085. // 创建一个Blob对象,将字符串放入其中
  3086. const sc_export_blob = new Blob([sc_export_str], { type: 'text/plain' });
  3087.  
  3088. // 创建一个下载链接
  3089. const sc_export_downloadLink = document.createElement('a');
  3090. sc_export_downloadLink.href = URL.createObjectURL(sc_export_blob);
  3091.  
  3092. // 设置文件名
  3093. sc_export_downloadLink.download = 'B站SC记录_' + sc_live_room_title + '_' + getTimestampConversion((new Date()).getTime()) + '.txt';
  3094.  
  3095. // 将链接添加到页面中,模拟点击下载
  3096. document.body.appendChild(sc_export_downloadLink);
  3097. sc_export_downloadLink.click();
  3098.  
  3099. // 移除链接
  3100. document.body.removeChild(sc_export_downloadLink);
  3101. }
  3102. }
  3103.  
  3104. function sc_startDragging(e) {
  3105. if (!sc_panel_allow_drag_flag) {
  3106. return;
  3107. }
  3108.  
  3109. e = e || unsafeWindow.event;
  3110.  
  3111. let the_sd_sc_panel_fold_mode = sc_panel_fold_mode;
  3112. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  3113. the_sd_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  3114. }
  3115.  
  3116. let sc_drag_target_classname = e.target.className;
  3117. if (the_sd_sc_panel_fold_mode === 1 && sc_drag_target_classname !== 'sc_long_list' && sc_drag_target_classname !== 'sc_data_show' && sc_drag_target_classname !== 'sc_long_buttons' && !sc_drag_target_classname.includes('sc_button_item')) {
  3118. // 侧折模式下,禁止用SC拖拽
  3119. return;
  3120. }
  3121.  
  3122. if (e.button === 0) {
  3123. sc_isDragging = true;
  3124. sc_isClickAllowed = true;
  3125.  
  3126. const rect_circle = $(document).find('.sc_long_circle')[0].getBoundingClientRect();
  3127. if (rect_circle.width === 0 && rect_circle.height === 0) {
  3128. const rect_rectangle = $(document).find('.sc_long_rectangle')[0].getBoundingClientRect();
  3129. sc_offsetX = e.clientX - rect_rectangle.left;
  3130. sc_offsetY = e.clientY - rect_rectangle.top;
  3131. } else {
  3132. sc_offsetX = e.clientX - rect_circle.left;
  3133. sc_offsetY = e.clientY - rect_circle.top;
  3134. }
  3135.  
  3136. sc_drag_start = (new Date()).getTime();
  3137. }
  3138. }
  3139.  
  3140. function sc_stopDragging() {
  3141. if (!sc_panel_allow_drag_flag) {
  3142. return;
  3143. }
  3144.  
  3145. if (!sc_isClickAllowed) {
  3146. const rect_circle = $(document).find('.sc_long_circle')[0].getBoundingClientRect();
  3147. if (rect_circle.width === 0 && rect_circle.height === 0) {
  3148. const rect_rectangle = $(document).find('.sc_long_rectangle')[0].getBoundingClientRect();
  3149. sc_panel_drag_store(rect_rectangle.left, rect_rectangle.top);
  3150. if (sc_welt_hide_circle_half_flag) { sc_circle_welt_hide_half(rect_rectangle.left, rect_rectangle.top); }
  3151. } else {
  3152. sc_panel_drag_store(rect_circle.left, rect_circle.top);
  3153. if (sc_welt_hide_circle_half_flag) { sc_circle_welt_hide_half(rect_circle.left, rect_circle.top); }
  3154. }
  3155. }
  3156.  
  3157. sc_isDragging = false;
  3158. }
  3159.  
  3160. function sc_drag(e) {
  3161. if (!sc_panel_allow_drag_flag) {
  3162. return;
  3163. }
  3164.  
  3165. e = e || unsafeWindow.event;
  3166. if (sc_isDragging && ((new Date()).getTime() - sc_drag_start) > 30) {
  3167. let sc_elements = $(document).find('.sc_drag_div');
  3168. sc_elements.each(function() {
  3169. const rect = this.getBoundingClientRect();
  3170.  
  3171. const maxX = unsafeWindow.innerWidth - rect.width;
  3172. const maxY = unsafeWindow.innerHeight - rect.height;
  3173.  
  3174. let x = Math.min(maxX, Math.max(0, e.clientX - sc_offsetX)) + 0.5; // 这个0.5交给浏览器吧,至少chrome上是完美的
  3175. let y = Math.min(maxY, Math.max(0, e.clientY - sc_offsetY));
  3176.  
  3177. this.style.left = x + 'px';
  3178. this.style.top = y + 'px';
  3179. });
  3180.  
  3181. sc_isClickAllowed = false;
  3182.  
  3183. if (e.clientY <= 0 || e.clientX <= 0 || e.clientY >= unsafeWindow.innerHeight || e.clientX >= unsafeWindow.innerWidth - 5) {
  3184. // 页面外时触发 mouseup 事件的逻辑
  3185. sc_isDragging = false;
  3186. sc_stopDragging();
  3187. }
  3188. }
  3189. }
  3190.  
  3191. function sc_after_click_func_btn_apply(e, animate_flag = false) {
  3192. let click_page_x = e.clientX;
  3193. let click_page_y = e.clientY;
  3194.  
  3195. let sc_rectangle_model = document.getElementsByClassName('sc_long_rectangle');
  3196. let sc_rect_left = $(sc_rectangle_model).position().left;
  3197. let sc_rect_top = $(sc_rectangle_model).position().top;
  3198. let sc_data_model = document.getElementsByClassName('sc_data_show');
  3199. let sc_btn_model = document.getElementsByClassName('sc_long_buttons');
  3200.  
  3201. let the_aca_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  3202. let the_aca_sc_panel_side_fold_simple = sc_panel_side_fold_simple;
  3203. let the_aca_sc_func_btn_mode = sc_func_btn_mode;
  3204. let the_aca_sc_panel_fold_mode = sc_panel_fold_mode;
  3205. let the_aca_sc_rectangle_width = sc_rectangle_width;
  3206. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  3207. the_aca_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  3208. the_aca_sc_panel_side_fold_simple = sc_panel_side_fold_simple_fullscreen;
  3209. the_aca_sc_func_btn_mode = sc_func_btn_mode_fullscreen;
  3210. the_aca_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  3211. the_aca_sc_rectangle_width = sc_rectangle_width_fullscreen;
  3212. }
  3213.  
  3214. if (the_aca_sc_panel_side_fold_flag) {
  3215.  
  3216. if (click_page_x < sc_rect_left || click_page_x - sc_rect_left > 72
  3217. || click_page_y < sc_rect_top
  3218. || (click_page_y > sc_rect_top && click_page_y - sc_rect_top > $(sc_rectangle_model).outerHeight())) {
  3219.  
  3220. if (animate_flag && the_aca_sc_panel_side_fold_simple) {
  3221. $(sc_data_model).slideUp(500);
  3222. }
  3223.  
  3224. $(sc_btn_model).slideUp(500, () => {
  3225. sc_rectangle_is_slide_up = false;
  3226. });
  3227.  
  3228. if (!the_aca_sc_panel_side_fold_simple) {
  3229. $(sc_rectangle_model).css('border-bottom', 'unset');
  3230. }
  3231. }
  3232.  
  3233. if (!the_aca_sc_panel_side_fold_simple && the_aca_sc_func_btn_mode === 1) {
  3234. $(sc_rectangle_model).css('border-bottom', 'unset');
  3235. }
  3236. } else if (the_aca_sc_panel_fold_mode == 2) {
  3237.  
  3238. if (click_page_x < sc_rect_left || click_page_x - sc_rect_left > the_aca_sc_rectangle_width
  3239. || click_page_y < sc_rect_top
  3240. || (click_page_y > sc_rect_top && click_page_y - sc_rect_top > $(sc_rectangle_model).outerHeight())) {
  3241. $(sc_data_model).slideUp(500);
  3242. $(sc_btn_model).slideUp(500, () => {
  3243. sc_rectangle_is_slide_up = false;
  3244. });
  3245. }
  3246. }
  3247. }
  3248.  
  3249. function update_guard_count(sc_data_guard_count) {
  3250. if (sc_guard_num !== sc_data_guard_count) {
  3251. sc_guard_num = sc_data_guard_count;
  3252.  
  3253. $(document).find('.sc_captain_num_right').text(sc_data_guard_count);
  3254.  
  3255. if (data_show_bottom_flag) {
  3256. const ugc_sc_data_show_bottom_guard_num_div = $(document).find('#sc_data_show_bottom_guard_num');
  3257. if (ugc_sc_data_show_bottom_guard_num_div.length) {
  3258. ugc_sc_data_show_bottom_guard_num_div.text('舰长:' + sc_data_guard_count);
  3259. }
  3260.  
  3261. // 兼容页面的不会自动更新舰长数的问题
  3262. const ugc_rank_list_ctnr_box_li = $(document).find('#rank-list-ctnr-box > div.tabs > ul > li.item');
  3263. if (ugc_rank_list_ctnr_box_li.length) {
  3264. const ugc_guard_n = ugc_rank_list_ctnr_box_li.last().text().match(/\d+/) ?? 0;
  3265.  
  3266. if (sc_data_guard_count !== parseInt(ugc_guard_n, 10)) {
  3267. ugc_rank_list_ctnr_box_li.last().text('大航海('+ sc_data_guard_count +')');
  3268. }
  3269. }
  3270. }
  3271. }
  3272. }
  3273.  
  3274. // 返回true-已关注,false-未关注。需要.then()链式调用获取结果
  3275. function sc_get_follow_up_flag() {
  3276. return fetch(sc_follow_api + sc_live_room_up_uid, {
  3277. credentials: 'include'
  3278. }).then(response => {
  3279. return response.json();
  3280. }).then(ret => {
  3281. if (ret.code === 0 && ret.data.attribute !== 0 && ret.data.attribute !== 128) {
  3282. return true;
  3283. } else {
  3284. return false;
  3285. }
  3286. }).catch(error => {
  3287. return false;
  3288. });
  3289. }
  3290.  
  3291. // 自动天选
  3292. function handle_auto_tianxuan(the_sc_follow_up_flag) {
  3293. setTimeout(() => {
  3294. let the_anchor_box_iframe_obj = $('#anchor-guest-box-id iframe').contents();
  3295. let the_click_btn = the_anchor_box_iframe_obj.find('#app .participation-box .particitation-btn img.btn-name');
  3296. let the_close_btn = the_anchor_box_iframe_obj.find('#app .participation-box .close-btn');
  3297.  
  3298. let sc_anchor_auto_joinTimeout;
  3299. let sc_anchor_auto_closeTimeout;
  3300.  
  3301. if (the_sc_follow_up_flag && the_click_btn.length) {
  3302.  
  3303. clearTimeout(sc_anchor_auto_joinTimeout);
  3304. clearTimeout(sc_anchor_auto_closeTimeout);
  3305.  
  3306. // 延时2s后
  3307. sc_anchor_auto_joinTimeout = setTimeout(() => {
  3308. the_click_btn.trigger('click');
  3309.  
  3310. open_and_close_sc_modal('成功自动点击天选 ✓', '#A7C9D3', null, 3);
  3311.  
  3312. }, 2000);
  3313.  
  3314. // 延时2s后
  3315. sc_anchor_auto_closeTimeout = setTimeout(() => {
  3316. the_close_btn.trigger('click');
  3317. }, 2000);
  3318. }
  3319. }, 1000); // 等渲染完成
  3320. }
  3321.  
  3322. // 发送弹幕
  3323. function sc_send_dm_fetch(msg, rnd) {
  3324. return fetch(sc_dm_send_api, {
  3325. method: 'POST',
  3326. credentials: 'include',
  3327. headers: {
  3328. 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
  3329. },
  3330. body: `color=16777215&fontsize=25&mode=1&msg=${msg}&rnd=${rnd}&roomid=${real_room_id}&csrf=${sc_u_frsc}`
  3331. }).then(response => {
  3332. return response.json();
  3333. }).then(ret => {
  3334. if (ret.code === 0) {
  3335. return true;
  3336. } else {
  3337. return false;
  3338. }
  3339. }).catch(error => {
  3340. return false;
  3341. });
  3342. }
  3343.  
  3344. function sc_handle_dm_fetch(the_combo_dm_msg, the_time_rnd) {
  3345.  
  3346. sc_send_dm_fetch(the_combo_dm_msg, the_time_rnd).then(the_dm_send_flag => {
  3347. if (the_dm_send_flag) {
  3348. // 定时、剔除(相同的combo弹幕相隔30秒)
  3349. setTimeout(() => {
  3350. sc_combo_dm_recent_send_arr = sc_combo_dm_recent_send_arr.filter(dm_item => dm_item !== the_combo_dm_msg);
  3351. sc_combo_dm_send_fail_arr = sc_combo_dm_send_fail_arr.filter(dm_item => dm_item !== the_combo_dm_msg);
  3352. }, 30 * 1000);
  3353.  
  3354. } else {
  3355.  
  3356. if (sc_combo_dm_send_fail_arr.includes(the_combo_dm_msg)) {
  3357. // 连续两次发送失败,10s后再给机会
  3358. setTimeout(() => {
  3359. sc_combo_dm_recent_send_arr = sc_combo_dm_recent_send_arr.filter(dm_item => dm_item !== the_combo_dm_msg);
  3360. sc_combo_dm_send_fail_arr = sc_combo_dm_send_fail_arr.filter(dm_item => dm_item !== the_combo_dm_msg);
  3361. }, 10 * 1000);
  3362.  
  3363. } else {
  3364. sc_combo_dm_recent_send_arr = sc_combo_dm_recent_send_arr.filter(dm_item => dm_item !== the_combo_dm_msg);
  3365. sc_combo_dm_send_fail_arr.push(the_combo_dm_msg);
  3366. }
  3367. }
  3368. });
  3369. }
  3370.  
  3371. // 自动跟风发送combo弹幕
  3372. function handle_auto_dm_combo(parsedArr_info) {
  3373.  
  3374. const the_combo_dm_msg = parsedArr_info[1];
  3375.  
  3376. // 因有时候combo弹幕会额外的带 x/×/X数字结尾,故过滤掉
  3377. if (!/[x×X]\d+$/.test(the_combo_dm_msg)) {
  3378.  
  3379. sc_combo_dm_recent_send_arr.push(the_combo_dm_msg);
  3380.  
  3381. const the_time_rnd = parseInt((new Date).getTime() / 1000);
  3382.  
  3383. // 查询关注至少相隔20s(10s好像太少,30s又太多,那就20s吧)
  3384. if (the_time_rnd - sc_auto_dm_send_last_rnd > 20) {
  3385.  
  3386. sc_get_follow_up_flag().then(the_sc_follow_up_flag => {
  3387.  
  3388. sc_auto_dm_send_last_rnd = the_time_rnd;
  3389. sc_last_follow_check_flag = the_sc_follow_up_flag;
  3390.  
  3391. if (the_sc_follow_up_flag) {
  3392. sc_handle_dm_fetch(the_combo_dm_msg, the_time_rnd);
  3393. }
  3394. });
  3395.  
  3396. } else {
  3397.  
  3398. if (sc_last_follow_check_flag) {
  3399. sc_handle_dm_fetch(the_combo_dm_msg, the_time_rnd);
  3400. }
  3401. }
  3402. }
  3403. }
  3404.  
  3405. // danmu_location_val_type-0: 特定的
  3406. // danmu_location_val_type-1: 所有的
  3407. function get_free_danmu_show_index(danmu_location_val_type = 0) {
  3408. let the_sc_live_danmu_location = sc_live_special_tip_location;
  3409. let the_free_danmu_show_index = 0;
  3410. let the_free_danmu_show_flag = false;
  3411.  
  3412. if (danmu_location_val_type === 1) {
  3413. the_sc_live_danmu_location = sc_live_sc_to_danmu_show_location;
  3414. }
  3415.  
  3416. if (the_sc_live_danmu_location === 0) {
  3417. // 顶部
  3418. if (!sc_live_special_danmu_show_index_arr[0]) {
  3419. // 发送
  3420. the_free_danmu_show_index = 0;
  3421. the_free_danmu_show_flag = true;
  3422. sc_live_special_danmu_show_index_arr[0] = 1;
  3423. } else if (!sc_live_special_danmu_show_index_arr[5]) {
  3424. // 发送
  3425. the_free_danmu_show_index = 5;
  3426. the_free_danmu_show_flag = true;
  3427. sc_live_special_danmu_show_index_arr[5] = 1;
  3428. }
  3429. } else if (the_sc_live_danmu_location === 1) {
  3430. // 中间
  3431. let the_rand_middle_danmu_index = sc_live_last_middle_danmu_index;
  3432. if (sc_live_last_middle_danmu_index === 0) {
  3433. the_rand_middle_danmu_index = sc_live_middle_danmu_index_arr[Math.floor(Math.random() * 4)];
  3434. } else {
  3435. the_rand_middle_danmu_index = sc_live_middle_danmu_index_crash_handle_arr[the_rand_middle_danmu_index][0];
  3436. }
  3437.  
  3438. if (!sc_live_special_danmu_show_index_arr[the_rand_middle_danmu_index]) {
  3439. // 发送
  3440. sc_live_last_middle_danmu_index = the_rand_middle_danmu_index;
  3441. sc_live_special_danmu_show_index_arr[the_rand_middle_danmu_index] = 1;
  3442. the_free_danmu_show_index = the_rand_middle_danmu_index;
  3443. the_free_danmu_show_flag = true;
  3444. } else {
  3445. let the_now_middle_danmu_index = 0;
  3446. let the_now_middle_danmu_crash_handle_arr = sc_live_middle_danmu_index_crash_handle_arr[the_rand_middle_danmu_index];
  3447. for(let i = 0; i < the_now_middle_danmu_crash_handle_arr.length; ++i) {
  3448. if (!sc_live_special_danmu_show_index_arr[the_now_middle_danmu_crash_handle_arr[i]]) {
  3449. the_now_middle_danmu_index = the_now_middle_danmu_crash_handle_arr[i];
  3450. break;
  3451. }
  3452. }
  3453. if (the_now_middle_danmu_index) {
  3454. // 发送
  3455. sc_live_last_middle_danmu_index = the_now_middle_danmu_index;
  3456. sc_live_special_danmu_show_index_arr[the_now_middle_danmu_index] = 1;
  3457. the_free_danmu_show_index = the_now_middle_danmu_index;
  3458. the_free_danmu_show_flag = true;
  3459. }
  3460. }
  3461. } else if (the_sc_live_danmu_location === 2) {
  3462. // 底部
  3463. if (!sc_live_special_danmu_show_index_arr[5]) {
  3464. // 发送
  3465. the_free_danmu_show_index = 5;
  3466. the_free_danmu_show_flag = true;
  3467. sc_live_special_danmu_show_index_arr[5] = 1;
  3468. } else if (!sc_live_special_danmu_show_index_arr[0]) {
  3469. // 发送
  3470. the_free_danmu_show_index = 0;
  3471. the_free_danmu_show_flag = true;
  3472. sc_live_special_danmu_show_index_arr[0] = 1;
  3473. }
  3474. }
  3475.  
  3476. return {'the_free_danmu_show_index' : the_free_danmu_show_index, 'the_free_danmu_show_flag' : the_free_danmu_show_flag};
  3477. }
  3478.  
  3479. // 检查弹幕分类数组是否没有自驱动,没有则驱动
  3480. function sc_check_danmu_pause_arr_and_start(exclude_arr_type) {
  3481. if (exclude_arr_type === 'tip') {
  3482. if (sc_live_msg_danmu_show_n < 0 && sc_live_special_msg_danmu_cache_arr.length) {
  3483. handle_special_msg(sc_live_special_msg_danmu_cache_arr.shift());
  3484. }
  3485.  
  3486. if (sc_live_sc_danmu_show_n < 0 && sc_live_sc_to_danmu_cache_arr.length) {
  3487. let the_now_sc_to_danmu_data = sc_live_sc_to_danmu_cache_arr.shift();
  3488. handle_special_sc(the_now_sc_to_danmu_data['sc_data'], the_now_sc_to_danmu_data['all_sc_to_danmu_show_flag']);
  3489. }
  3490. } else if (exclude_arr_type === 'msg') {
  3491. if (sc_live_tip_danmu_show_n < 0 && sc_live_special_tip_danmu_cache_arr.length) {
  3492. handle_special_tip(sc_live_special_tip_danmu_cache_arr.shift());
  3493. }
  3494.  
  3495. if (sc_live_sc_danmu_show_n < 0 && sc_live_sc_to_danmu_cache_arr.length) {
  3496. let the_now_sc_to_danmu_data = sc_live_sc_to_danmu_cache_arr.shift();
  3497. handle_special_sc(the_now_sc_to_danmu_data['sc_data'], the_now_sc_to_danmu_data['all_sc_to_danmu_show_flag']);
  3498. }
  3499. } else if (exclude_arr_type === 'sc') {
  3500. if (sc_live_tip_danmu_show_n < 0 && sc_live_special_tip_danmu_cache_arr.length) {
  3501. handle_special_tip(sc_live_special_tip_danmu_cache_arr.shift());
  3502. }
  3503.  
  3504. if (sc_live_msg_danmu_show_n < 0 && sc_live_special_msg_danmu_cache_arr.length) {
  3505. handle_special_msg(sc_live_special_msg_danmu_cache_arr.shift());
  3506. }
  3507. }
  3508. }
  3509.  
  3510. function handle_special_tip(parseArr_data) {
  3511.  
  3512. if (sc_live_special_tip_uid_arr.includes(parseArr_data?.uid.toString() ?? '0')) {
  3513.  
  3514. let sc_live_the_enter_uid = parseArr_data?.uid.toString() ?? '0';
  3515.  
  3516. if (sc_live_special_tip_await_arr.includes(sc_live_the_enter_uid)) { return; }
  3517.  
  3518. let get_free_danmu_show_arr = get_free_danmu_show_index(0);
  3519.  
  3520. if (get_free_danmu_show_arr['the_free_danmu_show_flag']) {
  3521. sc_live_special_tip_await_arr.push(sc_live_the_enter_uid);
  3522. // 发送
  3523. let sc_special_tip_div_class = 'sc_special_tip_div';
  3524. let sc_special_tip_img_px = '50';
  3525. let sc_special_msg_margin_left = '10';
  3526. if (sc_live_special_danmu_mode === 1) {
  3527. sc_special_tip_div_class = 'sc_special_tip_div_no_padding';
  3528. sc_special_tip_img_px = '40';
  3529. sc_special_msg_margin_left = '5';
  3530. } else if (sc_live_special_danmu_mode === 2) {
  3531. sc_special_tip_div_class = 'sc_special_tip_div_no_opaque';
  3532. } else if (sc_live_special_danmu_mode === 3) {
  3533. sc_special_tip_div_class = 'sc_special_tip_div_no_opaque_no_padding';
  3534. sc_special_tip_img_px = '40';
  3535. sc_special_msg_margin_left = '5';
  3536. }
  3537.  
  3538. let sc_special_tip_div_custom_style = 'style="top: 2px"';
  3539.  
  3540. if (get_free_danmu_show_arr['the_free_danmu_show_index'] === 5) {
  3541. sc_special_tip_div_custom_style = 'style="bottom: 2px"';
  3542. } else {
  3543. sc_special_tip_div_custom_style = 'style="top: '+ get_free_danmu_show_arr['the_free_danmu_show_index'] * 17 +'%"';
  3544. }
  3545.  
  3546. let sc_special_tip_remark = sc_live_special_tip_remark_arr['"' + sc_live_the_enter_uid + '"'] ?? '';
  3547. let sc_special_tip_remark_html = '';
  3548. if (sc_special_tip_remark && sc_special_tip_remark !== parseArr_data.uname) {
  3549. sc_special_tip_remark_html = '(' + sc_special_tip_remark + ')';
  3550. }
  3551.  
  3552. let sc_special_tip_div_the_id = sc_live_the_enter_uid + '_' + (new Date()).getTime();
  3553.  
  3554. let sc_special_tip_face = parseArr_data?.uinfo?.base?.face ?? '';
  3555.  
  3556. let sc_special_tip_div = '<div id="'+ sc_special_tip_div_the_id +'"'+ sc_special_tip_div_custom_style + 'class="'+ sc_special_tip_div_class +'">' +
  3557. '<div style="height: '+ sc_special_tip_img_px +'px;width: '+ sc_special_tip_img_px +'px;"><img style="border-radius: '+ sc_special_tip_img_px +'px;" src="' + sc_special_tip_face + '" height="'+ sc_special_tip_img_px +'" width="'+ sc_special_tip_img_px +'"></div>' +
  3558. '<div style="margin-left: '+ sc_special_msg_margin_left +'px;margin-right: 50px;"><span>' + parseArr_data.uname + sc_special_tip_remark_html + ' 进入直播间</span></div>' +
  3559. '</div>';
  3560.  
  3561. if (sc_special_tip_remark) {
  3562. sc_catch_log('['+ getTimestampConversion(parseArr_data.timestamp) +'][用户id]' + sc_live_the_enter_uid + '_[用户名]' + parseArr_data.uname + '_[备注]' + sc_special_tip_remark + '_进入直播间');
  3563. } else {
  3564. sc_catch_log('['+ getTimestampConversion(parseArr_data.timestamp) +'][用户id]' + sc_live_the_enter_uid + '_[用户名]' + parseArr_data.uname + '_进入直播间');
  3565. }
  3566.  
  3567. $(document).find('#live-player').append(sc_special_tip_div);
  3568.  
  3569. // 发送后定时
  3570. setTimeout(() => {
  3571. $(document).find('#' + sc_special_tip_div_the_id).remove();
  3572. sc_live_special_tip_await_arr = sc_live_special_tip_await_arr.filter(item => item !== sc_live_the_enter_uid);
  3573. sc_live_special_danmu_show_index_arr[get_free_danmu_show_arr['the_free_danmu_show_index']] = 0;
  3574.  
  3575. // 先检测出其他的分类弹幕是否有-1
  3576. sc_check_danmu_pause_arr_and_start('tip');
  3577.  
  3578. if (sc_live_special_tip_danmu_cache_arr.length) {
  3579. handle_special_tip(sc_live_special_tip_danmu_cache_arr.shift());
  3580. }
  3581. }, 16000);
  3582. } else {
  3583. // 缓存
  3584. sc_live_special_tip_danmu_cache_arr.push(parseArr_data);
  3585.  
  3586. if (sc_live_tip_danmu_show_n === 0) {
  3587. sc_live_tip_danmu_show_n = -1;
  3588. }
  3589. }
  3590.  
  3591. }
  3592. }
  3593.  
  3594. function handle_special_msg(parseArr_data_info) {
  3595.  
  3596. if (sc_live_special_tip_uid_arr.includes(parseArr_data_info[0]?.[15]?.["user"]?.["uid"].toString() ?? '0')) {
  3597. let sc_special_user = parseArr_data_info[0]?.[15]?.["user"] ?? '';
  3598. let sc_special_msg = parseArr_data_info[1];
  3599. let sc_sp_msg_ts = parseArr_data_info[9]?.["ts"].toString() ?? (new Date()).getTime() + '';
  3600.  
  3601. let sc_live_the_enter_uid = sc_special_user?.["uid"].toString() ?? '0';
  3602.  
  3603. if (sc_live_special_msg_await_arr.includes(sc_live_the_enter_uid + sc_sp_msg_ts)) { return; }
  3604.  
  3605. let get_free_danmu_show_arr = get_free_danmu_show_index(0);
  3606.  
  3607. if (get_free_danmu_show_arr['the_free_danmu_show_flag']) {
  3608. sc_live_special_msg_await_arr.push(sc_live_the_enter_uid + sc_sp_msg_ts);
  3609. // 发送
  3610. let sc_special_msg_div_class = 'sc_special_tip_div';
  3611. let sc_special_msg_img_px = '50';
  3612. let sc_special_msg_margin_left = '10';
  3613. if (sc_live_special_danmu_mode === 1) {
  3614. sc_special_msg_div_class = 'sc_special_tip_div_no_padding';
  3615. sc_special_msg_img_px = '40';
  3616. sc_special_msg_margin_left = '5';
  3617. } else if (sc_live_special_danmu_mode === 2) {
  3618. sc_special_msg_div_class = 'sc_special_tip_div_no_opaque';
  3619. } else if (sc_live_special_danmu_mode === 3) {
  3620. sc_special_msg_div_class = 'sc_special_tip_div_no_opaque_no_padding';
  3621. sc_special_msg_img_px = '40';
  3622. sc_special_msg_margin_left = '5';
  3623. }
  3624.  
  3625. let sc_special_msg_div_custom_style = 'style="top: 2px"';
  3626.  
  3627. if (get_free_danmu_show_arr['the_free_danmu_show_index'] === 5) {
  3628. sc_special_msg_div_custom_style = 'style="bottom: 2px"';
  3629. } else {
  3630. sc_special_msg_div_custom_style = 'style="top: '+ get_free_danmu_show_arr['the_free_danmu_show_index'] * 17 +'%"';
  3631. }
  3632.  
  3633. let sc_special_msg_div_the_id = sc_live_the_enter_uid + '_' + (new Date()).getTime();
  3634.  
  3635. let sc_special_msg_face = sc_special_user?.["base"]?.["face"] ?? '';
  3636. let sc_special_msg_uname = sc_special_user?.["base"]?.["name"] ?? '';
  3637.  
  3638. let sc_special_msg_remark = sc_live_special_tip_remark_arr['"' + sc_live_the_enter_uid + '"'] ?? '';
  3639. let sc_special_msg_remark_html = '';
  3640. if (sc_special_msg_remark && sc_special_msg_remark !== sc_special_msg_uname) {
  3641. sc_special_msg_remark_html = '(' + sc_special_msg_remark + ')';
  3642. }
  3643.  
  3644.  
  3645.  
  3646. let sc_special_msg_div = '<div id="'+ sc_special_msg_div_the_id +'"'+ sc_special_msg_div_custom_style + 'class="'+ sc_special_msg_div_class +'">' +
  3647. '<div style="height: '+ sc_special_msg_img_px +'px;width: '+ sc_special_msg_img_px +'px;"><img style="border-radius: '+ sc_special_msg_img_px +'px;" src="' + sc_special_msg_face + '" height="'+ sc_special_msg_img_px +'" width="'+ sc_special_msg_img_px +'"></div>' +
  3648. '<div style="margin-left: '+ sc_special_msg_margin_left +'px;margin-right: 50px;"><span>' + sc_special_msg_uname + sc_special_msg_remark_html + ':' + sc_special_msg + '</span></div>' +
  3649. '</div>';
  3650.  
  3651. if (sc_special_msg_remark) {
  3652. sc_catch_log('['+ getTimestampConversion(parseInt(sc_sp_msg_ts)) +'][弹幕][用户id]' + sc_live_the_enter_uid + '_[用户名]' + sc_special_msg_uname + '_[备注]' + sc_special_msg_remark + ':' + sc_special_msg);
  3653. } else {
  3654. sc_catch_log('['+ getTimestampConversion(parseInt(sc_sp_msg_ts)) +'][弹幕][用户id]' + sc_live_the_enter_uid + '_[用户名]' + sc_special_msg_uname + ':' + sc_special_msg);
  3655. }
  3656.  
  3657. $(document).find('#live-player').append(sc_special_msg_div);
  3658.  
  3659. setTimeout(() => {
  3660. sc_live_special_msg_await_arr = sc_live_special_msg_await_arr.filter(item => item !== (sc_live_the_enter_uid + sc_sp_msg_ts));
  3661. }, 1000);
  3662.  
  3663. setTimeout(() => {
  3664. sc_live_special_danmu_show_index_arr[get_free_danmu_show_arr['the_free_danmu_show_index']] = 0;
  3665.  
  3666. // 先检测出其他的分类弹幕是否有-1
  3667. sc_check_danmu_pause_arr_and_start('msg');
  3668.  
  3669. if (sc_live_special_msg_danmu_cache_arr.length) {
  3670. handle_special_msg(sc_live_special_msg_danmu_cache_arr.shift());
  3671. }
  3672. }, 10000);
  3673.  
  3674. setTimeout(() => {
  3675. $(document).find('#' + sc_special_msg_div_the_id).remove();
  3676. }, 16000);
  3677. } else {
  3678. // 缓存
  3679. sc_live_special_msg_danmu_cache_arr.push(parseArr_data_info);
  3680.  
  3681. if (sc_live_msg_danmu_show_n === 0) {
  3682. sc_live_msg_danmu_show_n = -1;
  3683. }
  3684. }
  3685. }
  3686. }
  3687.  
  3688. function handle_special_sc(sc_data, all_sc_to_danmu_show_flag = false, first_time_flag = false) {
  3689.  
  3690. if (all_sc_to_danmu_show_flag || sc_live_special_tip_uid_arr.includes(sc_data["uid"].toString() ?? '0')) {
  3691.  
  3692. let sc_live_the_sc_uid = sc_data["uid"].toString() ?? '0';
  3693. let sc_live_the_sc_id = sc_data["id"].toString() ?? '0';
  3694.  
  3695. if (first_time_flag) {
  3696. if (sc_live_special_sc_await_arr.includes(sc_live_the_sc_uid + sc_live_the_sc_id)) { return; }
  3697.  
  3698. sc_live_special_sc_await_arr.push(sc_live_the_sc_uid + sc_live_the_sc_id);
  3699. }
  3700.  
  3701. let the_sc_live_no_remain_flag = true;
  3702. let the_danmu_location_val_type = 0;
  3703. let the_sc_live_danmu_mode = sc_live_special_danmu_mode;
  3704. if (all_sc_to_danmu_show_flag) {
  3705. the_danmu_location_val_type = 1;
  3706. the_sc_live_danmu_mode = sc_live_sc_to_danmu_show_mode;
  3707. if (!sc_live_sc_to_danmu_no_remain_flag) {
  3708. the_sc_live_no_remain_flag = false;
  3709. }
  3710. } else {
  3711. if (!sc_live_special_sc_no_remain_flag) {
  3712. the_sc_live_no_remain_flag = false;
  3713. }
  3714. }
  3715.  
  3716. if (sc_live_sc_danmu_show_n <= 0) {
  3717. let get_free_danmu_show_arr = get_free_danmu_show_index(the_danmu_location_val_type);
  3718. if (get_free_danmu_show_arr['the_free_danmu_show_flag']) {
  3719. sc_live_sc_danmu_show_n = 1;
  3720. // 发送
  3721. let sc_speical_sc_div_class = 'sc_special_tip_div';
  3722. let sc_special_sc_img_px = '50';
  3723. let sc_special_sc_msg_margin_left = '10';
  3724. let sc_special_sc_div_custom_style = ' style="background:linear-gradient(to right, '+ sc_data["background_bottom_color"] +',transparent);';
  3725. if (the_sc_live_danmu_mode === 1) {
  3726. sc_speical_sc_div_class = 'sc_special_tip_div_no_padding';
  3727. sc_special_sc_img_px = '40';
  3728. sc_special_sc_msg_margin_left = '5';
  3729. } else if (the_sc_live_danmu_mode === 2) {
  3730. sc_speical_sc_div_class = 'sc_special_tip_div_no_opaque';
  3731. sc_special_sc_div_custom_style = ' style="background:linear-gradient(to right, '+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +',transparent);';
  3732. } else if (the_sc_live_danmu_mode === 3) {
  3733. sc_speical_sc_div_class = 'sc_special_tip_div_no_opaque_no_padding';
  3734. sc_special_sc_img_px = '40';
  3735. sc_special_sc_msg_margin_left = '5';
  3736. sc_special_sc_div_custom_style = ' style="background:linear-gradient(to right, '+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +','+ sc_data["background_bottom_color"] +',transparent);';
  3737. }
  3738.  
  3739. if (get_free_danmu_show_arr['the_free_danmu_show_index'] === 0) {
  3740. sc_special_sc_div_custom_style += 'top: 2px;" ';
  3741. } else if (get_free_danmu_show_arr['the_free_danmu_show_index'] === 5) {
  3742. sc_special_sc_div_custom_style += 'bottom: 2px;" ';
  3743. } else {
  3744. sc_special_sc_div_custom_style += 'top: '+ get_free_danmu_show_arr['the_free_danmu_show_index'] * 17 +'%;" ';
  3745. }
  3746.  
  3747. let sc_special_sc_remark = sc_live_special_tip_remark_arr['"' + sc_live_the_sc_uid + '"'] ?? '';
  3748. let sc_special_sc_remark_html = '';
  3749. if (sc_special_sc_remark && sc_special_sc_remark !== sc_data["user_info"]["uname"]) {
  3750. sc_special_sc_remark_html = '(' + sc_special_sc_remark + ')';
  3751. }
  3752.  
  3753. let sc_special_sc_div_the_id = sc_live_the_sc_uid + '_' + (new Date()).getTime();
  3754.  
  3755. let sc_special_sc_face = sc_data["user_info"]["face"];
  3756.  
  3757. let sc_special_sc_price = parseInt(sc_data["price"]);
  3758. let sc_special_sc_no_routine_pric_tip = '';
  3759. if (!sc_live_sc_routine_price_arr.includes(sc_special_sc_price)) {
  3760. sc_special_sc_no_routine_pric_tip = '[' + sc_special_sc_price * 10 + ']';
  3761. }
  3762.  
  3763. let sc_special_sc_div = '<div id="'+ sc_special_sc_div_the_id +'"'+ sc_special_sc_div_custom_style + 'class="'+ sc_speical_sc_div_class +'">' +
  3764. '<div style="height: '+ sc_special_sc_img_px +'px;width: '+ sc_special_sc_img_px +'px;"><img style="border-radius: '+ sc_special_sc_img_px +'px;" src="' + sc_special_sc_face + '" height="'+ sc_special_sc_img_px +'" width="'+ sc_special_sc_img_px +'"></div>' +
  3765. '<div style="margin-left: '+ sc_special_sc_msg_margin_left +'px;margin-right: 50px;"><span>[SC]'+ sc_special_sc_no_routine_pric_tip + ' ' + sc_data["user_info"]["uname"] + sc_special_sc_remark_html + ':' + sc_data["message"] + '</span></div>' +
  3766. '</div>';
  3767.  
  3768. if (sc_special_sc_remark) {
  3769. sc_catch_log('['+ getTimestampConversion(sc_data['start_time']) +'][SC][¥'+ sc_special_sc_price +'][用户id]' + sc_live_the_sc_uid + '_[用户名]' + sc_data["user_info"]["uname"] + '_[备注]' + sc_special_sc_remark + ':' + sc_data["message"]);
  3770. } else {
  3771. sc_catch_log('['+ getTimestampConversion(sc_data['start_time']) +'][SC][¥'+ sc_special_sc_price +'][用户id]' + sc_live_the_sc_uid + '_[用户名]' + sc_data["user_info"]["uname"] + ':' + sc_data["message"]);
  3772. }
  3773.  
  3774. $(document).find('#live-player').append(sc_special_sc_div);
  3775.  
  3776. let the_sc_special_sc_div_width = $(document).find('#' + sc_special_sc_div_the_id).width();
  3777. let the_live_player_width = $(document).find('#live-player').width();
  3778.  
  3779. if (the_sc_live_no_remain_flag) {
  3780. $(document).find('#' + sc_special_sc_div_the_id).css('animation', 'slideInFromRightToLeftOut 25s linear forwards');
  3781. } else {
  3782. if (the_sc_special_sc_div_width > the_live_player_width) {
  3783. $(document).find('#' + sc_special_sc_div_the_id).css('animation', 'slideInFromRightToLeftOut 25s linear forwards');
  3784. }
  3785. }
  3786.  
  3787. setTimeout(() => {
  3788. $(document).find('#' + sc_special_sc_div_the_id).remove();
  3789. sc_live_special_sc_await_arr = sc_live_special_sc_await_arr.filter(item => item !== (sc_live_the_sc_uid + sc_live_the_sc_id));
  3790.  
  3791. sc_live_special_danmu_show_index_arr[get_free_danmu_show_arr['the_free_danmu_show_index']] = 0;
  3792.  
  3793. sc_live_sc_danmu_show_n = 0;
  3794.  
  3795. // 先检测出其他的分类弹幕是否有-1
  3796. sc_check_danmu_pause_arr_and_start('sc');
  3797.  
  3798. if (sc_live_sc_to_danmu_cache_arr.length) {
  3799. let the_now_sc_to_danmu_data = sc_live_sc_to_danmu_cache_arr.shift();
  3800. handle_special_sc(the_now_sc_to_danmu_data['sc_data'], the_now_sc_to_danmu_data['all_sc_to_danmu_show_flag']);
  3801. }
  3802.  
  3803. }, 25000);
  3804. } else {
  3805. if (first_time_flag) {
  3806. // 缓存
  3807. sc_live_sc_to_danmu_cache_arr.push({ 'sc_data': sc_data, 'all_sc_to_danmu_show_flag': all_sc_to_danmu_show_flag});
  3808. } else {
  3809. // 回退缓存
  3810. sc_live_sc_to_danmu_cache_arr.unshift({ 'sc_data': sc_data, 'all_sc_to_danmu_show_flag': all_sc_to_danmu_show_flag});
  3811. }
  3812.  
  3813. sc_live_sc_danmu_show_n = -1;
  3814. }
  3815. } else {
  3816. // 缓存
  3817. if (first_time_flag) {
  3818. sc_live_sc_to_danmu_cache_arr.push({ 'sc_data': sc_data, 'all_sc_to_danmu_show_flag': all_sc_to_danmu_show_flag});
  3819. }
  3820. }
  3821. }
  3822. }
  3823.  
  3824. function update_sc_item(sc_data, realtime = true) {
  3825. let the_usi_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  3826. let the_usi_sc_rectangle_width = sc_rectangle_width;
  3827. let the_usi_sc_panel_fold_mode = sc_panel_fold_mode;
  3828. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  3829. the_usi_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  3830. the_usi_sc_rectangle_width = sc_rectangle_width_fullscreen;
  3831. the_usi_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  3832. }
  3833.  
  3834. // 追加SC 显示
  3835. let sc_background_bottom_color = sc_data["background_bottom_color"];
  3836. let sc_background_image = sc_data["background_image"];
  3837. let sc_background_color = sc_data["background_color"];
  3838. let sc_uid = sc_data["uid"];
  3839. let sc_user_info_face = sc_data["user_info"]["face"];
  3840. let sc_user_info_face_frame = sc_data["user_info"]["face_frame"];
  3841. let sc_user_info_uname = sc_data["user_info"]["uname"];
  3842. let sc_price = sc_data["price"];
  3843. let sc_message = sc_data["message"];
  3844. let sc_start_timestamp = sc_data["start_time"];
  3845.  
  3846. let the_int_sc_start_timestamp = parseInt(sc_start_timestamp, 10);
  3847. if (the_int_sc_start_timestamp === sc_last_item_timestamp) {
  3848. sc_last_item_sort++;
  3849. } else {
  3850. sc_last_item_timestamp = the_int_sc_start_timestamp;
  3851. sc_last_item_sort = 0;
  3852. }
  3853.  
  3854. let sc_medal_flag = false;
  3855. let sc_medal_color = '';
  3856. let sc_medal_name = '';
  3857. let sc_medal_level = 0;
  3858.  
  3859. if (sc_data["medal_info"] && sc_data["medal_info"]["anchor_roomid"]) {
  3860. sc_medal_flag = true;
  3861. sc_medal_color = sc_data["medal_info"]["medal_color"];
  3862. sc_medal_name = sc_data["medal_info"]["medal_name"];
  3863. sc_medal_level = sc_data["medal_info"]["medal_level"];
  3864. }
  3865.  
  3866. let sc_background_image_html = '';
  3867. if (sc_background_image !== '') {
  3868. sc_background_image_html = 'background-image: url('+ sc_background_image +');';
  3869. }
  3870.  
  3871. let sc_font_color = '#666666';
  3872. let sc_font_color_data = sc_data["user_info"]["name_color"] ?? '#666666';
  3873.  
  3874. let sc_start_time_all = getTimestampConversion(sc_start_timestamp, false);
  3875. let sc_start_time_simple = getTimestampConversion(sc_start_timestamp, true);
  3876. let [sc_diff_time, the_sc_item_expire_flag] = get_timestamp_diff(sc_start_timestamp, sc_price);
  3877.  
  3878. let sc_user_info_face_img = '<img src="'+ sc_user_info_face +'" height="40" width="40" style="border-radius: 20px; float: left; position: absolute; z-index:1;">';
  3879. let sc_user_info_face_frame_img = '';
  3880. if (sc_user_info_face_frame !== '') {
  3881. sc_user_info_face_img = '<img src="'+ sc_user_info_face +'" height="35" width="35" style="border-radius: 20px; float: left; position: absolute; z-index: 1;top: 3px;left: 2px;">';
  3882. sc_user_info_face_frame_img = '<img src="'+ sc_user_info_face_frame +'" height="40" width="40" style="float: left; position: absolute; z-index: 2;">';
  3883. }
  3884.  
  3885. let box_shadow_css = '';
  3886. if (sc_switch === 0 || sc_switch === 2 || sc_switch === 3) {
  3887. box_shadow_css = 'box-shadow: rgba(0, 0, 0, 0.5) 2px 2px 2px;';
  3888. }
  3889.  
  3890. let sc_start_time_display = '';
  3891. if (!sc_start_time_show_flag) {
  3892. sc_start_time_display = 'display: none;';
  3893. }
  3894. let sc_start_time_str = '<span class="sc_start_time_all_span" style="color: rgba(0,0,0,0.3); font-size: 10px;">'+ sc_start_time_all +'</span><span class="sc_start_time_simple_span" style="color: rgba(0,0,0,0.3); font-size: 10px; display: none;">'+ sc_start_time_simple +'</span>';
  3895. if (sc_start_time_simple_flag) {
  3896. sc_start_time_str = '<span class="sc_start_time_all_span" style="color: rgba(0,0,0,0.3); font-size: 10px; display: none;">'+ sc_start_time_all +'</span><span class="sc_start_time_simple_span" style="color: rgba(0,0,0,0.3); font-size: 10px;">'+ sc_start_time_simple +'</span>';
  3897. }
  3898. let metal_and_start_time_html = '<div class="sc_start_time" style="height: 20px; padding-left: 5px; margin-top: -1px;'+ sc_start_time_display +'">'+ sc_start_time_str +'</div>';
  3899. if (sc_medal_flag) {
  3900. metal_and_start_time_html = '<div style="display: inline-flex;"><div class="fans_medal_item" style="background-color: '+ sc_medal_color +';border: 1px solid '+ sc_medal_color +';"><div class="fans_medal_label"><span class="fans_medal_content">'+ sc_medal_name +'</span></div><div class="fans_medal_level">'+ sc_medal_level +'</div></div>' +
  3901. '<div class="sc_start_time" style="height: 20px; padding-left: 5px;'+ sc_start_time_display +'">'+ sc_start_time_str +'</div></div>'
  3902. }
  3903.  
  3904. let sc_msg_item_style_width = '';
  3905. let sc_msg_item_style_border_radius = 'border-radius: 8px 8px 6px 6px;';
  3906. let sc_msg_body_style_display = '';
  3907. let sc_msg_head_style_border_radius = 'border-radius: 6px 6px 0px 0px;';
  3908. let sc_msg_head_left_style_display = '';
  3909. let sc_msg_head_right_style_display = '';
  3910. if (the_usi_sc_panel_side_fold_flag) {
  3911. sc_msg_item_style_width = 'width: 50px;';
  3912. sc_msg_item_style_border_radius = 'border-radius: 8px;';
  3913. sc_msg_body_style_display = 'display: none;';
  3914. sc_msg_head_style_border_radius = 'border-radius: 6px;';
  3915. sc_msg_head_left_style_display = 'display: none;';
  3916. sc_msg_head_right_style_display = 'display: none;';
  3917. }
  3918.  
  3919. let sc_item_show_animation = 'animation: sc_fadenum 1s linear forwards;';
  3920. if (sc_item_order_up_flag) {
  3921. sc_item_show_animation = 'animation: sc_fadenum_reverse 1s linear forwards;';
  3922. }
  3923.  
  3924. let sc_item_html = '<div class="sc_long_item sc_' + sc_uid + '_' + sc_start_timestamp + '" data-fold="0" data-start="'+ (sc_start_timestamp * 1000 + sc_last_item_sort)+'" style="'+ sc_msg_item_style_width +'background-color: '+ sc_background_bottom_color +';margin-bottom: 10px;'+ sc_item_show_animation + sc_msg_item_style_border_radius + box_shadow_css +'">'+
  3925. '<div class="sc_msg_head" style="' + sc_background_image_html + 'height: 40px;background-color: '+ sc_background_color +';padding:5px;background-size: contain;background-repeat: no-repeat;background-position: right center;'+ sc_msg_head_style_border_radius +'">'+
  3926. '<div style="float: left; box-sizing: border-box; height: 40px; position: relative;"><a href="//space.bilibili.com/'+ sc_uid +'" target="_blank">'+
  3927. sc_user_info_face_img+ sc_user_info_face_frame_img +'</a></div>'+
  3928. '<div class="sc_msg_head_left" style="float: left; box-sizing: border-box; height: 40px; margin-left: 40px; padding-top: 2px;'+ sc_msg_head_left_style_display +'">'+
  3929. metal_and_start_time_html+
  3930. '<div class="sc_uname_div" style="height: 20px; padding-left: 5px; white-space: nowrap; width: ' + ((the_usi_sc_rectangle_width / 2) + 5) + 'px; overflow: hidden; text-overflow: ellipsis;"><span class="sc_font_color" style="color: ' + sc_font_color + ';font-size: 15px;text-decoration: none;" data-color="'+ sc_font_color_data +'">' + sc_user_info_uname + '</span></div>'+
  3931. '</div>'+
  3932. '<div class="sc_msg_head_right" style="float: right; box-sizing: border-box; height: 40px; padding: 2px 2px 0px 0px;'+ sc_msg_head_right_style_display +'">'+
  3933. '<div class="sc_value_font" style="height: 20px;"><span style="font-size: 15px; float: right; color: #000;">¥'+ sc_price +'</span></div>'+
  3934. '<div style="height: 20px; color: #666666" data-html2canvas-ignore><span class="sc_diff_time" style="font-size: 15px; float: right;">'+ sc_diff_time +'</span><span class="sc_start_timestamp" style="display:none;">'+ sc_start_timestamp +'</span><span style="display:none">'+ sc_price +'</span></div>'+
  3935. '</div>'+
  3936. '</div>'+
  3937. '<div class="sc_msg_body" style="padding-left: 14px; padding-right: 10px; padding-top: 10px; padding-bottom: 10px; overflow-wrap: break-word; line-height: 2;'+ sc_msg_body_style_display +'"><span style="color: white; font-size: 14px;">'+ sc_message +'</span></div>'+
  3938. '</div>';
  3939.  
  3940. if (sc_item_order_up_flag) {
  3941. $(document).find('.sc_long_list').append(sc_item_html);
  3942. if (realtime && the_usi_sc_panel_fold_mode === 2) {
  3943. sc_scroll_list_to_bottom();
  3944. }
  3945. } else {
  3946. $(document).find('.sc_long_list').prepend(sc_item_html);
  3947. }
  3948.  
  3949. if (!sc_live_sc_to_danmu_show_flag) {
  3950. sc_custom_config_apply('sc_' + sc_uid + '_' + sc_start_timestamp);
  3951. }
  3952.  
  3953. sc_side_fold_custom_first_class = 'sc_' + sc_uid + '_' + sc_start_timestamp;
  3954.  
  3955. }
  3956.  
  3957. function store_sc_item(sc_data) {
  3958. check_and_join_live_sc_room();
  3959. // 追加SC 存储
  3960. let sc_localstorage = [];
  3961. let sc_sid_localstorage = [];
  3962. let sid = String(sc_data["id"]) + '_' + String(sc_data["uid"]) + '_' + String(sc_data["price"]);
  3963. let sc_localstorage_json = unsafeWindow.localStorage.getItem(sc_localstorage_key);
  3964.  
  3965. if (sc_localstorage_json === null || sc_localstorage_json === 'null' || sc_localstorage_json === '[]' || sc_localstorage_json === '') {
  3966. sc_localstorage.push(sc_data);
  3967. sc_sid_localstorage.push(sid);
  3968. // 保存/更新sc_keep_time (最后sc的时间戳)
  3969. unsafeWindow.localStorage.setItem(sc_keep_time_key, (new Date()).getTime());
  3970.  
  3971. // 追加存储
  3972. unsafeWindow.localStorage.setItem(sc_localstorage_key, JSON.stringify(sc_localstorage));
  3973. unsafeWindow.localStorage.setItem(sc_sid_localstorage_key, JSON.stringify(sc_sid_localstorage));
  3974.  
  3975. return true;
  3976. } else {
  3977. sc_localstorage = JSON.parse(sc_localstorage_json);
  3978. sc_sid_localstorage = JSON.parse(unsafeWindow.localStorage.getItem(sc_sid_localstorage_key));
  3979.  
  3980. if (sc_sid_localstorage.includes(sid)) {
  3981. return false;
  3982. } else {
  3983. sc_localstorage.push(sc_data);
  3984. sc_sid_localstorage.push(sid);
  3985. // 保存/更新sc_keep_time (最后sc的时间戳)
  3986. unsafeWindow.localStorage.setItem(sc_keep_time_key, (new Date()).getTime());
  3987.  
  3988. // 追加存储
  3989. unsafeWindow.localStorage.setItem(sc_localstorage_key, JSON.stringify(sc_localstorage));
  3990. unsafeWindow.localStorage.setItem(sc_sid_localstorage_key, JSON.stringify(sc_sid_localstorage));
  3991.  
  3992. return true;
  3993. }
  3994. }
  3995. }
  3996.  
  3997. function update_rank_count(n_count, n_online_count) {
  3998. // n_count 贡献用户数(同接数)
  3999. // n_online_count 高能用户数(App显示的)(在线的)
  4000.  
  4001. let the_urc_sc_data_show_high_energy_num_flag = sc_data_show_high_energy_num_flag;
  4002. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  4003. the_urc_sc_data_show_high_energy_num_flag = sc_data_show_high_energy_num_flag_fullscreen;
  4004. }
  4005.  
  4006. if (n_count) {
  4007. high_energy_contribute_num = n_count;
  4008. }
  4009.  
  4010. if (n_online_count) {
  4011. high_energy_num = n_online_count;
  4012. }
  4013.  
  4014. if (sc_update_date_guard_once) {
  4015. if (high_energy_contribute_num >= high_energy_num * 2 && n_online_count === 0) {
  4016. // 这种情况,应该是,非直播态直播间 或者 嵌套直播间,如虚拟区官方频道,同接就是App的高能
  4017. // 如果连续5个数据包是这样就判定
  4018. if (sc_date_num_nesting_judge_n === 5) {
  4019. sc_nesting_live_room_flag = true;
  4020. } else {
  4021. sc_date_num_nesting_judge_n++;
  4022. }
  4023. } else {
  4024. sc_date_num_nesting_judge_n = 0;
  4025. }
  4026.  
  4027. if (sc_nesting_live_room_flag) {
  4028. high_energy_num = high_energy_contribute_num;
  4029. }
  4030. } else {
  4031. const rank_data_show_div = $(document).find('#rank-list-ctnr-box > div.tabs > ul > li.item');
  4032. if (rank_data_show_div.length) {
  4033. $(document).find('.sc_captain_num_right').text(rank_data_show_div.last().text().match(/\d+/) ?? 0);
  4034. sc_update_date_guard_once = true;
  4035. }
  4036. }
  4037.  
  4038. // SC记录板的
  4039. if (the_urc_sc_data_show_high_energy_num_flag) {
  4040. $(document).find('.sc_high_energy_num_left').text('高能:');
  4041. if (high_energy_num >= 100000) {
  4042. $(document).find('.sc_high_energy_num_right').text(parseInt(high_energy_num/10000) + 'w+');
  4043. } else {
  4044. $(document).find('.sc_high_energy_num_right').text(high_energy_num);
  4045. }
  4046.  
  4047. } else {
  4048. $(document).find('.sc_high_energy_num_left').text('同接:');
  4049. if (high_energy_contribute_num >= 100000) {
  4050. $(document).find('.sc_high_energy_num_right').text(parseInt(high_energy_contribute_num/10000) + 'w+');
  4051. } else {
  4052. $(document).find('.sc_high_energy_num_right').text(high_energy_contribute_num);
  4053. }
  4054.  
  4055. }
  4056.  
  4057. $(document).find('.sc_data_show_label').attr('title', '同接/高能('+ high_energy_contribute_num + '/' + high_energy_num +') = ' + (high_energy_contribute_num / high_energy_num * 100).toFixed(2) + '%');
  4058.  
  4059.  
  4060. // 页面的
  4061. // 弹幕框顶部
  4062. if (data_show_top_flag) {
  4063. const rank_data_show_div = $(document).find('#rank-list-ctnr-box > div.tabs > ul > li.item');
  4064.  
  4065. if (rank_data_show_div.length) {
  4066. const default_high_energy_pattern1 = /房间观众/;
  4067. const rank_data_show_div_first_text_str = rank_data_show_div.first().text();
  4068.  
  4069. if (default_high_energy_pattern1.test(rank_data_show_div_first_text_str)) {
  4070. if (high_energy_num >= 100000) {
  4071. rank_data_show_div.first().text('房间观众(' + parseInt(high_energy_num/10000) + '万+)');
  4072. } else {
  4073. rank_data_show_div.first().text('房间观众(' + high_energy_num + ')');
  4074. }
  4075. } else {
  4076. const default_high_energy_pattern2 = /高能用户/;
  4077. if (default_high_energy_pattern2.test(rank_data_show_div_first_text_str)) {
  4078. if (high_energy_num >= 100000) {
  4079. rank_data_show_div.first().text('高能用户(' + parseInt(high_energy_num/10000) + '万+)');
  4080. } else {
  4081. rank_data_show_div.first().text('高能用户(' + high_energy_num + ')');
  4082. }
  4083. }
  4084. }
  4085.  
  4086. rank_data_show_div.first().attr('title', '同接/高能('+ high_energy_contribute_num + '/' + high_energy_num +') = ' + (high_energy_contribute_num / high_energy_num * 100).toFixed(2) + '%');
  4087. }
  4088. }
  4089.  
  4090. // 弹幕框底部
  4091. if (data_show_bottom_flag) {
  4092. const sc_urc_data_show_bottom_rank_num_div = $(document).find('#sc_data_show_bottom_rank_num');
  4093. if (sc_urc_data_show_bottom_rank_num_div.length) {
  4094. const sc_urc_data_show_bottom_div = $(document).find('#sc_data_show_bottom_div');
  4095.  
  4096. if (the_urc_sc_data_show_high_energy_num_flag) {
  4097. if (high_energy_num >= 100000) {
  4098. sc_urc_data_show_bottom_rank_num_div.text('高能:'+ parseInt(high_energy_num/10000) + '万+');
  4099. } else {
  4100. sc_urc_data_show_bottom_rank_num_div.text('高能:'+ high_energy_num);
  4101. }
  4102.  
  4103. } else {
  4104. if (high_energy_contribute_num >= 100000) {
  4105. sc_urc_data_show_bottom_rank_num_div.text('同接:'+ parseInt(high_energy_contribute_num/10000) + '万+');
  4106. } else {
  4107. sc_urc_data_show_bottom_rank_num_div.text('同接:'+ high_energy_contribute_num);
  4108. }
  4109.  
  4110. }
  4111.  
  4112. sc_urc_data_show_bottom_div.attr('title', '同接/高能('+ high_energy_contribute_num + '/' + high_energy_num +') = ' + (high_energy_contribute_num / high_energy_num * 100).toFixed(2) + '%');
  4113.  
  4114. } else {
  4115. const rank_data_show_div = $(document).find('#rank-list-ctnr-box > div.tabs > ul > li.item');
  4116. if (rank_data_show_div.length) {
  4117. const guard_text = rank_data_show_div.last().text();
  4118.  
  4119. // 不同发送框UI适配
  4120. let bili_live_send_ui_one_flag = $('#chat-control-panel-vm .bottom-actions .bl-button span').text() === '发送';
  4121. let sc_data_show_bottom_div_width = 'width: 50%;';
  4122. let sc_data_show_bottom_div_style = '';
  4123. let sc_data_show_bottom_div_item_width = 'width: 100%; ';
  4124. if (!bili_live_send_ui_one_flag) {
  4125. sc_data_show_bottom_div_width = 'width: 100%;';
  4126. sc_data_show_bottom_div_style = 'margin-top: 3px; display: flex; ';
  4127. sc_data_show_bottom_div_item_width = 'width: 42%; ';
  4128. }
  4129.  
  4130. let sc_data_show_bottom_div_color = '#ffffff; ' + sc_data_show_bottom_div_style;
  4131. const chat_control_panel_vm_div = $(document).find('#chat-control-panel-vm');
  4132. if (chat_control_panel_vm_div.length) {
  4133. const chat_control_panel_vm_div_bg = chat_control_panel_vm_div.css('background-image');
  4134. if (!chat_control_panel_vm_div_bg || chat_control_panel_vm_div_bg === 'none') {
  4135. sc_data_show_bottom_div_color = '#666666; ' + sc_data_show_bottom_div_style;
  4136. }
  4137. }
  4138.  
  4139. if (the_urc_sc_data_show_high_energy_num_flag) {
  4140. $(document).find('#control-panel-ctnr-box').append('<div style="'+ sc_data_show_bottom_div_width +' position: relative;color: '+ sc_data_show_bottom_div_color +'" id="sc_data_show_bottom_div" title="'+ (high_energy_contribute_num / high_energy_num * 100).toFixed(2) +'%"><div id="sc_data_show_bottom_rank_num" style="'+ sc_data_show_bottom_div_item_width +' margin-bottom: 5px;">高能:'+ high_energy_num +'</div><div id="sc_data_show_bottom_guard_num" >舰长:'+ (guard_text.match(/\d+/) ?? 0) +'</div></div>');
  4141. } else {
  4142. $(document).find('#control-panel-ctnr-box').append('<div style="'+ sc_data_show_bottom_div_width +' position: relative;color: '+ sc_data_show_bottom_div_color +'" id="sc_data_show_bottom_div" title="'+ (high_energy_contribute_num / high_energy_num * 100).toFixed(2) +'%"><div id="sc_data_show_bottom_rank_num" style="'+ sc_data_show_bottom_div_item_width +' margin-bottom: 5px;">同接:'+ high_energy_contribute_num +'</div><div id="sc_data_show_bottom_guard_num" >舰长:'+ (guard_text.match(/\d+/) ?? 0) +'</div></div>');
  4143. }
  4144. }
  4145. }
  4146. }
  4147. }
  4148.  
  4149. function sc_fetch_and_show() {
  4150. // 抓取SC
  4151. fetch(sc_url).then(response => {
  4152. return response.json();
  4153. }).then(ret => {
  4154. let sc_catch = [];
  4155. if (ret.code === 0) {
  4156. // 高能数
  4157. high_energy_num = ret.data?.room_rank_info?.user_rank_entry?.user_contribution_rank_entry?.count || 0;
  4158.  
  4159. // 舰长数
  4160. let captain_num = ret.data?.guard_info?.count || 0;
  4161. $(document).find('.sc_captain_num_right').text(captain_num);
  4162.  
  4163. sc_live_room_title = (ret.data?.anchor_info?.base_info?.uname || '') + '_' + (ret.data?.room_info?.title || '');
  4164.  
  4165. sc_catch = ret.data?.super_chat_info?.message_list || [];
  4166.  
  4167. sc_live_room_up_uid = ret.data?.room_info?.uid || 0;
  4168.  
  4169. real_room_id = ret.data?.room_info?.room_id || room_id;
  4170. }
  4171.  
  4172. // 追加到localstorage 和 SC显示板
  4173. let sc_localstorage = [];
  4174. let sc_sid_localstorage = [];
  4175. let diff_arr_new_sc = [];
  4176. let sc_add_arr = [];
  4177. let sc_localstorage_json = unsafeWindow.localStorage.getItem(sc_localstorage_key);
  4178. if (sc_localstorage_json === null || sc_localstorage_json === 'null' || sc_localstorage_json === '[]' || sc_localstorage_json === '') {
  4179. diff_arr_new_sc = sc_catch;
  4180. } else {
  4181. sc_localstorage = JSON.parse(sc_localstorage_json);
  4182. sc_sid_localstorage = JSON.parse(unsafeWindow.localStorage.getItem(sc_sid_localstorage_key));
  4183. diff_arr_new_sc = sc_catch.filter(v => {
  4184. let sid = String(v.id) + '_' + String(v.uid) + '_' + String(v.price);
  4185.  
  4186. return !sc_sid_localstorage.includes(sid);
  4187. });
  4188. }
  4189.  
  4190. diff_arr_new_sc = diff_arr_new_sc.sort((a, b) => a.start_time - b.start_time);
  4191.  
  4192. if (sc_isListEmpty) {
  4193. // 一开始进入
  4194. sc_add_arr = sc_localstorage.concat(diff_arr_new_sc);
  4195.  
  4196. if (diff_arr_new_sc.length) {
  4197. // 有抓取到实时已经存在的
  4198. sc_custom_config_start_class_by_fetch(diff_arr_new_sc);
  4199. }
  4200.  
  4201. if (!diff_arr_new_sc.length && sc_localstorage.length) {
  4202. // 没抓取到实时已经存在的,但有存储的
  4203. sc_custom_config_start_class_by_store(sc_localstorage);
  4204. }
  4205.  
  4206. } else {
  4207. // 实时
  4208. sc_add_arr = diff_arr_new_sc;
  4209. }
  4210.  
  4211. if (sc_add_arr.length) {
  4212. for (let i = 0; i < sc_add_arr.length; i++){
  4213. // 追加到SC显示板
  4214. update_sc_item(sc_add_arr[i], false);
  4215. }
  4216.  
  4217. if (sc_item_order_up_flag) {
  4218. setTimeout(() => { sc_scroll_list_to_bottom(); }, 1000);
  4219. }
  4220.  
  4221. // 追加到localstorage(存储就不用GM_setValue了,直接localstorage,控制台就可以看到)
  4222. if (diff_arr_new_sc.length) {
  4223. // 加入记录组
  4224. check_and_join_live_sc_room();
  4225.  
  4226. for (let d = 0; d < diff_arr_new_sc.length; d++) {
  4227. sc_localstorage.push(diff_arr_new_sc[d]);
  4228. sc_sid_localstorage.push(String(diff_arr_new_sc[d]["id"]) + '_' + String(diff_arr_new_sc[d]["uid"]) + '_' + String(diff_arr_new_sc[d]["price"]));
  4229. }
  4230.  
  4231. // 保存/更新sc_keep_time (最后sc的时间戳)
  4232. unsafeWindow.localStorage.setItem(sc_keep_time_key, (new Date()).getTime());
  4233.  
  4234. // 追加存储
  4235. unsafeWindow.localStorage.setItem(sc_localstorage_key, JSON.stringify(sc_localstorage));
  4236. unsafeWindow.localStorage.setItem(sc_sid_localstorage_key, JSON.stringify(sc_sid_localstorage));
  4237. }
  4238.  
  4239. sc_isListEmpty = false;
  4240. }
  4241. }).catch(error => {
  4242. sc_catch_log('请求api失败!抓取已存在的SC失败!请刷新页面来解决~');
  4243. let sc_localstorage_json = unsafeWindow.localStorage.getItem(sc_localstorage_key);
  4244. if (sc_localstorage_json !== null && sc_localstorage_json !== 'null' && sc_localstorage_json !== '[]' && sc_localstorage_json !== '') {
  4245. if (sc_isListEmpty) {
  4246. let sc_localstorage = JSON.parse(sc_localstorage_json);
  4247. if (sc_localstorage.length) {
  4248. sc_custom_config_start_class_by_store(sc_localstorage);
  4249.  
  4250. for (let r = 0; r < sc_localstorage.length; r++){
  4251. // 追加到SC显示板
  4252. update_sc_item(sc_localstorage[r], false);
  4253. }
  4254.  
  4255. sc_isListEmpty = false;
  4256.  
  4257. if (sc_item_order_up_flag) {
  4258. setTimeout(() => { sc_scroll_list_to_bottom(); }, 1000);
  4259. }
  4260. }
  4261. }
  4262. }
  4263. });
  4264. }
  4265.  
  4266. function sc_fullscreen_width_high_mode_show() {
  4267. let the_whm_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  4268. let the_whm_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  4269. let the_whm_sc_rectangle_width = sc_rectangle_width;
  4270.  
  4271. let the_reset_sc_panel_fold_mode = sc_panel_fold_mode;
  4272. let the_reset_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  4273. if (sc_isFullscreen) {
  4274. the_whm_sc_panel_fold_mode = sc_panel_fold_mode;
  4275. the_whm_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  4276.  
  4277. if (sc_live_fullscreen_config_separate_memory_flag) {
  4278. the_whm_sc_rectangle_width = sc_rectangle_width_fullscreen;
  4279.  
  4280. the_reset_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  4281. the_reset_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  4282. }
  4283. }
  4284.  
  4285. $(document).find('.sc_long_rectangle').width(the_whm_sc_rectangle_width);
  4286. $(document).find('.sc_uname_div').width(the_whm_sc_rectangle_width / 2 + 5);
  4287.  
  4288. sc_panel_list_height_config_apply();
  4289.  
  4290. if (the_whm_sc_panel_fold_mode === 1) {
  4291. if (sc_side_fold_custom_first_class) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  4292. sc_foldback(false);
  4293. sc_minimize();
  4294. } else if (the_whm_sc_panel_fold_mode === 2) {
  4295. sc_minimize();
  4296. } else {
  4297. if (the_whm_sc_panel_side_fold_flag) {
  4298. sc_foldback();
  4299. }
  4300. }
  4301.  
  4302. sc_live_panel_fold_mode_change(the_reset_sc_panel_fold_mode);
  4303. sc_live_panel_side_fold_flag_change(the_reset_sc_panel_side_fold_flag);
  4304. sc_fold_mode_store();
  4305. sc_panel_side_fold_flag_store();
  4306.  
  4307. sc_memory_show();
  4308. }
  4309.  
  4310. function sc_fullscreen_separate_memory_apply() {
  4311.  
  4312. sc_fullscreen_width_high_mode_show();
  4313. sc_switch_css();
  4314. sc_live_other_config_data_show_apply();
  4315.  
  4316. sc_live_fullscreen_config_all_store();
  4317. }
  4318.  
  4319. function sc_process_start() {
  4320. if (sc_panel_list_height < 0) { sc_panel_list_height = 0; }
  4321. if (sc_panel_list_height > 500) { sc_panel_list_height = 500; }
  4322.  
  4323. // Create a container for the circle
  4324. const sc_circleContainer = document.createElement('div');
  4325. sc_circleContainer.classList.add('sc_long_circle', 'sc_drag_div');
  4326. sc_circleContainer.style.width = '30px';
  4327. sc_circleContainer.style.height = '30px';
  4328. sc_circleContainer.style.backgroundColor = 'rgb(167,201,211,0.5)'; //#A7C9D3 (恬豆应援色)
  4329. sc_circleContainer.style.borderRadius = '50%';
  4330. sc_circleContainer.style.border = '2px solid #ffffff';
  4331. sc_circleContainer.style.position = 'fixed';
  4332. sc_circleContainer.style.left = 0;
  4333. sc_circleContainer.style.top = 0;
  4334. sc_circleContainer.style.color = '#ffffff';
  4335. sc_circleContainer.style.lineHeight = '30px';
  4336. sc_circleContainer.textContent = 'SC';
  4337. sc_circleContainer.style.textAlign = 'center';
  4338. sc_circleContainer.style.cursor = 'grab';
  4339. sc_circleContainer.style.userSelect = 'none';
  4340. sc_circleContainer.style.zIndex = '2233';
  4341.  
  4342. // Create a container for the rectangle
  4343. const sc_rectangleContainer = document.createElement('div');
  4344. sc_rectangleContainer.classList.add('sc_long_rectangle', 'sc_drag_div');
  4345. sc_rectangleContainer.style.width = sc_rectangle_width + 'px';
  4346. sc_rectangleContainer.style.height = 'auto';
  4347. sc_rectangleContainer.style.backgroundColor = 'rgba(255,255,255,1)';
  4348. sc_rectangleContainer.style.position = 'fixed';
  4349. sc_rectangleContainer.style.display = 'none';
  4350. sc_rectangleContainer.style.borderBottom = '10px solid transparent';
  4351. sc_rectangleContainer.style.cursor = 'grab';
  4352. sc_rectangleContainer.style.userSelect = 'none';
  4353. sc_rectangleContainer.style.zIndex = '2233';
  4354. if (sc_panel_list_height > 0) {
  4355. sc_rectangleContainer.style.borderTop = '10px solid transparent';
  4356. }
  4357.  
  4358. // Add a button to the page to trigger minimize function
  4359. const sc_minimizeButton = document.createElement('button');
  4360. sc_minimizeButton.textContent = '折叠';
  4361. sc_minimizeButton.classList.add('sc_button_min', 'sc_button_item');
  4362. sc_minimizeButton.style.cursor = 'pointer';
  4363. sc_minimizeButton.style.marginRight = '0px';
  4364. $(document).on('click', '.sc_button_min', sc_minimize);
  4365.  
  4366. // Add a button to the page to trigger sidefold function
  4367. const sc_sidefoldButton = document.createElement('button');
  4368. sc_sidefoldButton.textContent = '侧折';
  4369. sc_sidefoldButton.classList.add('sc_button_sidefold', 'sc_button_item');
  4370. sc_sidefoldButton.style.cursor = 'pointer';
  4371. $(document).on('click', '.sc_button_sidefold', sc_sidefold);
  4372. $(document).on('click', '.sc_button_foldback', sc_foldback);
  4373.  
  4374. // Add a button to the page to trigger memory function
  4375. let sc_memory_text_arr = ['没记', '题记', '个记', '全记'];
  4376. const sc_memoryButton = document.createElement('button');
  4377. sc_memoryButton.textContent = sc_memory_text_arr[sc_memory];
  4378. sc_memoryButton.title = '[没记]-没记忆配置;[题记]-所有<题记>房间共用一个主题配置;[个记]-独立记忆当前的所有配置;[全记]-所有房间共用当前的所有配置';
  4379. sc_memoryButton.classList.add('sc_button_memory', 'sc_button_item');
  4380. sc_memoryButton.style.cursor = 'pointer';
  4381. $(document).on('click', '.sc_button_memory', sc_memory_modify);
  4382.  
  4383.  
  4384. // Add a button to the page to trigger export function
  4385. const sc_exportButton = document.createElement('button');
  4386. sc_exportButton.textContent = '导出';
  4387. sc_exportButton.classList.add('sc_button_export', 'sc_button_item');
  4388. sc_exportButton.style.cursor = 'pointer';
  4389. $(document).on('click', '.sc_button_export', sc_export);
  4390.  
  4391. // Add a button to the page to trigger switch function
  4392. const sc_switchButton = document.createElement('button');
  4393. sc_switchButton.textContent = '切换';
  4394. sc_switchButton.title = '主题切换';
  4395. sc_switchButton.classList.add('sc_button_switch', 'sc_button_item');
  4396. sc_switchButton.style.cursor = 'pointer';
  4397. $(document).on('click', '.sc_button_switch', () => sc_switch_css(true));
  4398.  
  4399. // Add a button to the page to trigger menu function
  4400. const sc_menuButton = document.createElement('button');
  4401. sc_menuButton.textContent = '菜单';
  4402. sc_menuButton.classList.add('sc_button_menu', 'sc_button_item');
  4403. sc_menuButton.style.cursor = 'pointer';
  4404. sc_menuButton.style.display = 'none';
  4405. $(document).on('click', '.sc_button_menu', sc_menu);
  4406.  
  4407. // Create a container for the buttons
  4408. const sc_buttonsContainer = document.createElement('div');
  4409. sc_buttonsContainer.className = 'sc_long_buttons';
  4410. sc_buttonsContainer.style.display = 'none';
  4411. sc_buttonsContainer.style.backgroundColor = 'rgba(255,255,255,0)';
  4412. sc_buttonsContainer.style.textAlign = 'center';
  4413. sc_buttonsContainer.style.position = 'sticky';
  4414. sc_buttonsContainer.style.top = '0';
  4415. sc_buttonsContainer.style.zIndex = '3';
  4416. sc_buttonsContainer.style.height = 'auto';
  4417.  
  4418. // Create a container for the dataShow
  4419. const sc_dataShowContainer = document.createElement('div');
  4420. sc_dataShowContainer.className = 'sc_data_show';
  4421. sc_dataShowContainer.style.display = 'none';
  4422. sc_dataShowContainer.style.backgroundColor = 'rgba(255,255,255,0)';
  4423. sc_dataShowContainer.style.color = '#000';
  4424. sc_dataShowContainer.style.textAlign = 'center';
  4425. sc_dataShowContainer.style.position = 'sticky';
  4426. sc_dataShowContainer.style.zIndex = '3';
  4427. sc_dataShowContainer.style.height = '20px';
  4428. sc_dataShowContainer.style.fontSize = '15px';
  4429. sc_dataShowContainer.style.padding = '10px';
  4430. sc_dataShowContainer.style.marginBottom = '10px';
  4431.  
  4432. // Create labels for the dataShow
  4433. const sc_label_high_energy_num_left = document.createElement('label');
  4434. sc_label_high_energy_num_left.textContent = '同接:';
  4435. sc_label_high_energy_num_left.classList.add('sc_data_show_label', 'sc_high_energy_num_left');
  4436. sc_label_high_energy_num_left.style.float = 'left';
  4437. if (sc_data_show_high_energy_num_flag) {
  4438. sc_label_high_energy_num_left.textContent = '高能:';
  4439. }
  4440.  
  4441. const sc_label_high_energy_num_right = document.createElement('label');
  4442. sc_label_high_energy_num_right.textContent = '0';
  4443. sc_label_high_energy_num_right.classList.add('sc_data_show_label', 'sc_high_energy_num_right');
  4444. sc_label_high_energy_num_right.style.float = 'left';
  4445.  
  4446. const sc_label_captain_num_left = document.createElement('label');
  4447. sc_label_captain_num_left.textContent = '舰长:';
  4448. sc_label_captain_num_left.classList.add('sc_data_show_label', 'sc_captain_num_left');
  4449. sc_label_captain_num_left.style.float = 'right';
  4450.  
  4451. const sc_label_captain_num_right = document.createElement('label');
  4452. sc_label_captain_num_right.textContent = '0';
  4453. sc_label_captain_num_right.classList.add('sc_data_show_label', 'sc_captain_num_right');
  4454. sc_label_captain_num_right.style.float = 'right';
  4455.  
  4456. const sc_label_data_br1 = document.createElement('br');
  4457. sc_label_data_br1.style.display = 'none';
  4458. sc_label_data_br1.className = 'sc_label_data_br';
  4459. const sc_label_data_br2 = document.createElement('br');
  4460. sc_label_data_br2.style.display = 'none';
  4461. sc_label_data_br2.className = 'sc_label_data_br';
  4462. const sc_label_data_br3 = document.createElement('br');
  4463. sc_label_data_br3.style.display = 'none';
  4464. sc_label_data_br3.classList.add('sc_label_data_br', 'sc_label_num_br3');
  4465.  
  4466. // Append buttons to the container
  4467. sc_buttonsContainer.appendChild(sc_switchButton);
  4468. sc_buttonsContainer.appendChild(sc_exportButton);
  4469. sc_buttonsContainer.appendChild(sc_memoryButton);
  4470. sc_buttonsContainer.appendChild(sc_sidefoldButton);
  4471. sc_buttonsContainer.appendChild(sc_menuButton);
  4472. sc_buttonsContainer.appendChild(sc_minimizeButton);
  4473.  
  4474. // Append the container to the rectangle
  4475. sc_rectangleContainer.appendChild(sc_buttonsContainer);
  4476.  
  4477. sc_dataShowContainer.appendChild(sc_label_high_energy_num_left);
  4478. sc_dataShowContainer.appendChild(sc_label_data_br1);
  4479. sc_dataShowContainer.appendChild(sc_label_high_energy_num_right);
  4480. sc_dataShowContainer.appendChild(sc_label_data_br2);
  4481. sc_dataShowContainer.appendChild(sc_label_captain_num_right);
  4482. sc_dataShowContainer.appendChild(sc_label_data_br3);
  4483. sc_dataShowContainer.appendChild(sc_label_captain_num_left);
  4484. sc_rectangleContainer.appendChild(sc_dataShowContainer);
  4485.  
  4486. let sc_panel_list_height_min = '200';
  4487. if (sc_panel_list_height < 200) { sc_panel_list_height_min = sc_panel_list_height; }
  4488. // Create a container for sc list
  4489. const sc_listContainer = document.createElement('div');
  4490. sc_listContainer.className = 'sc_long_list';
  4491. sc_listContainer.id = 'sc_normal_list';
  4492. sc_listContainer.style.minHeight = sc_panel_list_height_min + 'px';
  4493. sc_listContainer.style.maxHeight = sc_panel_list_height + 'px';
  4494. sc_listContainer.style.overflowY = 'scroll';
  4495. sc_listContainer.style.overflowX = 'hidden';
  4496. sc_listContainer.style.scrollbarGutter = 'stable'; // 滚动条不占位置
  4497. sc_listContainer.style.paddingLeft = '10px';
  4498. sc_listContainer.style.paddingTop = '0px';
  4499. sc_listContainer.style.paddingBottom = '0px';
  4500. sc_listContainer.style.paddingRight = '13px';
  4501. sc_listContainer.style.marginRight = '-7px'; // 可能scrollbarGutter不是所有浏览器都支持,加多这个和设置'scroll'兼容下
  4502. if (navigator.userAgent.indexOf("Firefox") > -1) {
  4503. // Firefox浏览器兼容美化
  4504. sc_listContainer.style.marginRight = '-2px';
  4505. sc_listContainer.style.scrollbarWidth = 'thin';
  4506. sc_listContainer.style.scrollbarColor = 'rgba(0, 0, 0, 0.3) transparent';
  4507. }
  4508.  
  4509. // Append the container to the rectangle
  4510. sc_rectangleContainer.appendChild(sc_listContainer);
  4511.  
  4512. // scrollbar css
  4513. let sc_scrollbar_style = document.createElement('style');
  4514. sc_scrollbar_style.id = 'sc_scrollbar_style';
  4515. sc_scrollbar_style.textContent = `
  4516. .sc_long_list::-webkit-scrollbar {
  4517. width: 6px;
  4518. }
  4519. .sc_long_list:hover::-webkit-scrollbar-thumb {
  4520. background: rgba(204,204,204,0.5);
  4521. border-radius: 6px;
  4522. }
  4523. .sc_long_list::-webkit-scrollbar-thumb {
  4524. background: rgba(204,204,204,0);
  4525. }
  4526. `;
  4527. document.head.appendChild(sc_scrollbar_style);
  4528.  
  4529. let sc_other_style = document.createElement('style');
  4530. sc_other_style.textContent = `
  4531. @keyframes sc_fadenum {
  4532. 0%{transform: translateY(-100%);opacity: 0;}
  4533. 100%{transform: translateY(0);opacity: 1;}
  4534. }
  4535. @keyframes sc_sun {
  4536. 100%{ background-position: -350% 0; }
  4537. }
  4538. @keyframes sc_fadenum_reverse {
  4539. 0%{transform: translateY(100%);opacity: 0;}
  4540. 100%{transform: translateY(0);opacity: 1;}
  4541. }
  4542.  
  4543. .sc_button_item {
  4544. text-decoration: none;
  4545. width: 50px;
  4546. padding: 5px;
  4547. margin-top: 15px;
  4548. margin-bottom: 15px;
  4549. margin-right: 7px;
  4550. background: linear-gradient(90deg, #A7C9D3, #eeeeee, #5c95d7, #A7C9D3);
  4551. background-size: 350%;
  4552. color: #ffffff;
  4553. border: none;
  4554. }
  4555. .sc_button_item:hover {
  4556. animation: sc_sun 7s infinite;
  4557. }
  4558.  
  4559. .sc_copy_btn {
  4560. text-decoration: none;
  4561. width: 'auto';
  4562. padding: 5px;
  4563. background: linear-gradient(90deg, #A7C9D3, #eeeeee, #5c95d7, #A7C9D3);
  4564. background-size: 350%;
  4565. color: #ffffff;
  4566. border: none;
  4567. box-shadow: '0 0 3px rgba(0, 0, 0, 0.3)';
  4568. }
  4569. .sc_copy_btn:hover {
  4570. animation: sc_sun 7s infinite;
  4571. }
  4572.  
  4573. .sc_search_btn {
  4574. text-decoration: none;
  4575. width: 'auto';
  4576. padding: 5px;
  4577. background: linear-gradient(90deg, #A7C9D3, #eeeeee, #5c95d7, #A7C9D3);
  4578. background-size: 350%;
  4579. color: #ffffff;
  4580. border: none;
  4581. box-shadow: '0 0 3px rgba(0, 0, 0, 0.3)';
  4582. }
  4583. .sc_search_btn:hover {
  4584. animation: sc_sun 7s infinite;
  4585. }
  4586.  
  4587. .sc_func_btn {
  4588. text-decoration: none;
  4589. width: 'auto';
  4590. padding: 5px;
  4591. background: linear-gradient(90deg, #A7C9D3, #eeeeee, #5c95d7, #A7C9D3);
  4592. background-size: 350%;
  4593. color: #ffffff;
  4594. border: none;
  4595. box-shadow: '0 0 3px rgba(0, 0, 0, 0.3)';
  4596. }
  4597. .sc_func_btn:hover {
  4598. animation: sc_sun 7s infinite;
  4599. }
  4600.  
  4601. .fans_medal_item {
  4602. color: #ffffff;
  4603. height: 14px;
  4604. line-height: 14px;
  4605. border-radius: 2px;
  4606. display: inline-flex;
  4607. margin-left: 5px;
  4608. align-items: center;
  4609. justify-content: center;
  4610. margin-bottom: 5px;
  4611. }
  4612. .fans_medal_label {
  4613. padding: 0 3px;
  4614. }
  4615. .fans_medal_content {
  4616. font-size: 10px;
  4617. }
  4618. .fans_medal_level {
  4619. color: #06154c;
  4620. background-color: #ffffff;
  4621. font-size: 10px;
  4622. padding: 0 3px;
  4623. border-top-right-radius: 1px;
  4624. border-bottom-right-radius: 1px;
  4625. align-items: center;
  4626. justify-content: center;
  4627. }
  4628.  
  4629. @keyframes sc_circle_hide_x_left {
  4630. 0%{transform: translateX(0);}
  4631. 100%{transform: translateX(-50%);}
  4632. }
  4633. @keyframes sc_circle_hide_x_right {
  4634. 0%{transform: translateX(0);}
  4635. 100%{transform: translateX(50%);}
  4636. }
  4637. @keyframes sc_circle_hide_y_top {
  4638. 0%{transform: translateY(0);}
  4639. 100%{transform: translateY(-50%);}
  4640. }
  4641. @keyframes sc_circle_hide_y_bottom {
  4642. 0%{transform: translateY(0);}
  4643. 100%{transform: translateY(50%);}
  4644. }
  4645. .sc_circle_x_left_hide_animate {
  4646. animation: sc_circle_hide_x_left .2s linear forwards;
  4647. }
  4648. .sc_circle_x_right_hide_animate {
  4649. animation: sc_circle_hide_x_right .2s linear forwards;
  4650. }
  4651. .sc_circle_y_top_hide_animate {
  4652. animation: sc_circle_hide_y_top .2s linear forwards;
  4653. }
  4654. .sc_circle_y_bottom_hide_animate {
  4655. animation: sc_circle_hide_y_bottom .2s linear forwards;
  4656. }
  4657.  
  4658. @keyframes sc_circle_show_x_left {
  4659. 0%{transform: translateX(-50%);}
  4660. 100%{transform: translateX(0);}
  4661. }
  4662. @keyframes sc_circle_show_x_right {
  4663. 0%{transform: translateX(50%);}
  4664. 100%{transform: translateX(0);}
  4665. }
  4666. @keyframes sc_circle_show_y_top {
  4667. 0%{transform: translateY(-50%);}
  4668. 100%{transform: translateY(0);}
  4669. }
  4670. @keyframes sc_circle_show_y_bottom {
  4671. 0%{transform: translateY(50%);}
  4672. 100%{transform: translateY(0);}
  4673. }
  4674. .sc_circle_x_left_show_animate {
  4675. animation: sc_circle_show_x_left .2s linear forwards;
  4676. }
  4677. .sc_circle_x_right_show_animate {
  4678. animation: sc_circle_show_x_right .2s linear forwards;
  4679. }
  4680. .sc_circle_y_top_show_animate {
  4681. animation: sc_circle_show_y_top .2s linear forwards;
  4682. }
  4683. .sc_circle_y_bottom_show_animate {
  4684. animation: sc_circle_show_y_bottom .2s linear forwards;
  4685. }
  4686.  
  4687. @keyframes slideInFromRightToLeft {
  4688. from {
  4689. left: 100%;
  4690. }
  4691. to {
  4692. left: 0;
  4693. }
  4694. }
  4695. @keyframes slideInFromRightToLeftOut {
  4696. from {
  4697. left: 100%;
  4698. }
  4699. to {
  4700. left: -120%;
  4701. }
  4702. }
  4703. .sc_special_tip_div {
  4704. font-size: 16px;
  4705. color: #fff;
  4706. height: auto;
  4707. width: auto;
  4708. background: linear-gradient(to right, lightblue,transparent);
  4709. position: absolute;
  4710. left: 100%;
  4711. height: 50px;
  4712. animation: slideInFromRightToLeft 15s linear forwards;
  4713. border-radius: 50px 0 0 50px;
  4714. padding: 10px;
  4715. display: flex;
  4716. align-items: center;
  4717. white-space: nowrap;
  4718. z-index: 2222;
  4719. }
  4720. .sc_special_tip_div_no_padding {
  4721. font-size: 14px;
  4722. color: #fff;
  4723. height: auto;
  4724. width: auto;
  4725. background: linear-gradient(to right, lightblue,transparent);
  4726. position: absolute;
  4727. left: 100%;
  4728. height: 40px;
  4729. animation: slideInFromRightToLeft 15s linear forwards;
  4730. border-radius: 40px 0 0 40px;
  4731. display: flex;
  4732. align-items: center;
  4733. white-space: nowrap;
  4734. z-index: 2222;
  4735. }
  4736. .sc_special_tip_div_no_opaque {
  4737. font-size: 16px;
  4738. color: #fff;
  4739. height: auto;
  4740. width: auto;
  4741. background: linear-gradient(to right, lightblue, lightblue, lightblue, lightblue, lightblue, lightblue, lightblue, lightblue, lightblue, transparent);
  4742. position: absolute;
  4743. left: 100%;
  4744. height: 50px;
  4745. animation: slideInFromRightToLeft 15s linear forwards;
  4746. border-radius: 50px 0 0 50px;
  4747. padding: 10px;
  4748. display: flex;
  4749. align-items: center;
  4750. white-space: nowrap;
  4751. z-index: 2222;
  4752. }
  4753. .sc_special_tip_div_no_opaque_no_padding {
  4754. font-size: 14px;
  4755. color: #fff;
  4756. height: auto;
  4757. width: auto;
  4758. background: linear-gradient(to right, lightblue, lightblue, lightblue, lightblue, lightblue, lightblue, lightblue, lightblue, lightblue, transparent);
  4759. position: absolute;
  4760. left: 100%;
  4761. height: 40px;
  4762. animation: slideInFromRightToLeft 15s linear forwards;
  4763. border-radius: 40px 0 0 40px;
  4764. display: flex;
  4765. align-items: center;
  4766. white-space: nowrap;
  4767. z-index: 2222;
  4768. }
  4769. `;
  4770. document.head.appendChild(sc_other_style);
  4771.  
  4772. let live_player_div = document.getElementById('live-player');
  4773. if (!live_player_div) { return; }
  4774.  
  4775. // 黑名单相关
  4776. if (!check_blacklist_menu(room_id)) { sc_room_blacklist_flag = true; return; }
  4777.  
  4778. document.body.appendChild(sc_circleContainer);
  4779. document.body.appendChild(sc_rectangleContainer);
  4780.  
  4781. // Set initial position
  4782. sc_circleContainer.style.top = `${unsafeWindow.innerHeight / 4}px`;
  4783.  
  4784. $(document).on('mousedown', '.sc_drag_div', sc_startDragging);
  4785. $(document).on('mousemove', sc_drag);
  4786. $(document).on('mouseup', '.sc_drag_div', sc_stopDragging);
  4787.  
  4788. function sc_handleFullscreenChange() {
  4789. let the_hfc_sc_panel_fold_mode = sc_panel_fold_mode;
  4790. if (sc_live_fullscreen_config_separate_memory_flag) {
  4791. the_hfc_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  4792. }
  4793.  
  4794. let the_normal_list_div = $(document).find('#sc_normal_list');
  4795.  
  4796. if (document.fullscreenElement ||
  4797. document.webkitFullscreenElement ||
  4798. document.mozFullScreenElement ||
  4799. document.msFullscreenElement) {
  4800. let sc_circle_clone = $(sc_circleContainer).clone(true);
  4801. let sc_rectangle_clone = $(sc_rectangleContainer).clone(true);
  4802. $(live_player_div).append(sc_circle_clone);
  4803. $(live_player_div).append(sc_rectangle_clone);
  4804. sc_isFullscreen = true;
  4805.  
  4806. sc_fullscreen_separate_memory_apply();
  4807.  
  4808. if (the_hfc_sc_panel_fold_mode === 1 && sc_side_fold_fullscreen_auto_hide_list_flag) {
  4809. sc_panel_list_no_remember_hide();
  4810. }
  4811.  
  4812. $(sc_rectangle_clone).find('.sc_long_list').attr('id', 'sc_fullscreen_list').scrollTop(the_normal_list_div.scrollTop());
  4813. } else {
  4814.  
  4815. let the_live_list_div_scrolltop = $(document).find('#sc_fullscreen_list').scrollTop() ?? 0;
  4816.  
  4817. $(live_player_div).find('.sc_drag_div').remove();
  4818. sc_isFullscreen = false;
  4819. sc_side_fold_hide_list_ing_flag = false;
  4820.  
  4821. // 判断sc_circle界限
  4822. let xPos = 0;
  4823. let yPos = 0;
  4824. let sc_circles = $(document).find('.sc_long_circle');
  4825. let sc_circles_width = sc_circles.width();
  4826. let sc_circles_height = sc_circles.height();
  4827. sc_circles.each(function() {
  4828. let rect = this.getBoundingClientRect();
  4829. xPos = rect.left;
  4830. yPos = rect.top;
  4831. });
  4832.  
  4833. if (unsafeWindow.innerWidth - xPos < sc_circles_width) {
  4834. xPos = unsafeWindow.innerWidth - sc_circles_width;
  4835. sc_circles.css('left', xPos + 'px');
  4836. }
  4837.  
  4838. if (unsafeWindow.innerHeight - yPos < sc_circles_height) {
  4839. yPos = unsafeWindow.innerHeight - sc_circles_height - 5;
  4840. sc_circles.css('top', yPos + 'px');
  4841. }
  4842.  
  4843. // 判断sc_rectangle界限
  4844. let sc_rectangles = $(document).find('.sc_long_rectangle');
  4845. let sc_rectangles_width = sc_rectangles.width();
  4846. let sc_rectangles_height = sc_rectangles.height();
  4847. sc_rectangles.each(function() {
  4848. let rect = this.getBoundingClientRect();
  4849. xPos = rect.left;
  4850. yPos = rect.top;
  4851. });
  4852. if (unsafeWindow.innerWidth - xPos < sc_rectangles_width) {
  4853. xPos = unsafeWindow.innerWidth - sc_rectangles_width;
  4854. sc_rectangles.css('left', xPos + 'px');
  4855. }
  4856.  
  4857. if (unsafeWindow.innerHeight - yPos < sc_rectangles_height) {
  4858. yPos = unsafeWindow.innerHeight - sc_rectangles_height - 10;
  4859. sc_rectangles.css('top', yPos + 'px');
  4860. }
  4861.  
  4862. if (the_hfc_sc_panel_fold_mode === 1 && sc_side_fold_fullscreen_auto_hide_list_flag) {
  4863. sc_panel_list_no_remember_show(false);
  4864. }
  4865.  
  4866. sc_fullscreen_separate_memory_apply();
  4867.  
  4868. the_normal_list_div.scrollTop(the_live_list_div_scrolltop);
  4869.  
  4870. }
  4871. }
  4872.  
  4873. // 让全屏直播的情况下也显示
  4874. live_player_div.addEventListener('fullscreenchange', sc_handleFullscreenChange);
  4875. live_player_div.addEventListener('webkitfullscreenchange', sc_handleFullscreenChange);
  4876. live_player_div.addEventListener('mozfullscreenchange', sc_handleFullscreenChange);
  4877. live_player_div.addEventListener('MSFullscreenChange', sc_handleFullscreenChange);
  4878.  
  4879. $(document).on('click', '.sc_long_circle', () => {
  4880. if (sc_isClickAllowed) {
  4881. let the_cc_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  4882. let the_cc_sc_rectangle_width = sc_rectangle_width;
  4883. let the_cc_sc_panel_list_height = sc_panel_list_height;
  4884. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  4885. the_cc_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  4886. the_cc_sc_rectangle_width = sc_rectangle_width_fullscreen;
  4887. the_cc_sc_panel_list_height = sc_panel_list_height_fullscreen;
  4888. }
  4889.  
  4890. let xPos = 0;
  4891. let yPos = 0;
  4892. let sc_circles = $(document).find('.sc_long_circle');
  4893.  
  4894. sc_circles.removeClass('sc_circle_x_left_hide_animate');
  4895. sc_circles.removeClass('sc_circle_x_right_hide_animate');
  4896. sc_circles.removeClass('sc_circle_y_top_hide_animate');
  4897. sc_circles.removeClass('sc_circle_y_bottom_hide_animate');
  4898. sc_circles.removeClass('sc_circle_x_left_show_animate');
  4899. sc_circles.removeClass('sc_circle_x_right_show_animate');
  4900. sc_circles.removeClass('sc_circle_y_top_show_animate');
  4901. sc_circles.removeClass('sc_circle_y_bottom_show_animate');
  4902.  
  4903. sc_circles.each(function() {
  4904. let rect = this.getBoundingClientRect();
  4905. xPos = rect.left;
  4906. yPos = rect.top;
  4907. $(this).hide();
  4908. });
  4909.  
  4910. if (the_cc_sc_panel_side_fold_flag) {
  4911. if (unsafeWindow.innerWidth - xPos < 72) {
  4912. xPos = unsafeWindow.innerWidth - 72;
  4913. }
  4914.  
  4915. sc_live_panel_fold_mode_change(1);
  4916. } else {
  4917. if (unsafeWindow.innerWidth - xPos < the_cc_sc_rectangle_width) {
  4918. xPos = unsafeWindow.innerWidth - the_cc_sc_rectangle_width;
  4919. }
  4920.  
  4921. sc_live_panel_fold_mode_change(2);
  4922. }
  4923.  
  4924. if (unsafeWindow.innerHeight - yPos < the_cc_sc_panel_list_height) {
  4925. yPos = unsafeWindow.innerHeight - the_cc_sc_panel_list_height - 150;
  4926. }
  4927.  
  4928. let sc_rectangles = $(document).find('.sc_long_rectangle');
  4929. sc_rectangles.each(function() {
  4930. $(this).css('left', xPos + 'px');
  4931. $(this).css('top', yPos + 'px');
  4932.  
  4933. $(document).find('.sc_long_buttons').show();
  4934. $(document).find('.sc_data_show').show();
  4935.  
  4936. $(this).slideDown(500);
  4937. });
  4938.  
  4939. sc_fold_mode_store();
  4940.  
  4941. if (!sc_live_sc_to_danmu_show_flag) {
  4942. sc_side_fold_custom_auto_run_flag = false;
  4943.  
  4944. sc_custom_config_apply(sc_side_fold_custom_first_class);
  4945. }
  4946. } else {
  4947. sc_isClickAllowed = true;
  4948. }
  4949. });
  4950.  
  4951. $(document).on('mouseenter', '.sc_long_circle', () => {
  4952. let sc_circles = $(document).find('.sc_long_circle');
  4953. sc_circles.css('border', '3px solid rgba(255,255,255,0.5)');
  4954.  
  4955. let sc_circles_animate_class = sc_circles.attr('class').split(' ').find((scClassName) => { return scClassName !== 'sc_long_circle' && scClassName !== 'sc_drag_div'; });
  4956. if (sc_circles_animate_class === 'sc_circle_x_left_hide_animate') {
  4957. sc_circles.removeClass('sc_circle_x_right_show_animate');
  4958. sc_circles.removeClass('sc_circle_y_top_show_animate');
  4959. sc_circles.removeClass('sc_circle_y_bottom_show_animate');
  4960. sc_circles.addClass('sc_circle_x_left_show_animate');
  4961. } else if (sc_circles_animate_class === 'sc_circle_x_right_hide_animate') {
  4962. sc_circles.removeClass('sc_circle_x_left_show_animate');
  4963. sc_circles.removeClass('sc_circle_y_top_show_animate');
  4964. sc_circles.removeClass('sc_circle_y_bottom_show_animate');
  4965. sc_circles.addClass('sc_circle_x_right_show_animate');
  4966. } else if (sc_circles_animate_class === 'sc_circle_y_top_hide_animate') {
  4967. sc_circles.removeClass('sc_circle_x_left_show_animate');
  4968. sc_circles.removeClass('sc_circle_x_right_show_animate');
  4969. sc_circles.removeClass('sc_circle_y_bottom_show_animate');
  4970. sc_circles.addClass('sc_circle_y_top_show_animate');
  4971. } else if (sc_circles_animate_class === 'sc_circle_y_bottom_hide_animate') {
  4972. sc_circles.removeClass('sc_circle_x_left_show_animate');
  4973. sc_circles.removeClass('sc_circle_x_right_show_animate');
  4974. sc_circles.removeClass('sc_circle_y_top_show_animate');
  4975. sc_circles.addClass('sc_circle_y_bottom_show_animate');
  4976. }
  4977.  
  4978. sc_circles.removeClass('sc_circle_x_left_hide_animate');
  4979. sc_circles.removeClass('sc_circle_x_right_hide_animate');
  4980. sc_circles.removeClass('sc_circle_y_top_hide_animate');
  4981. sc_circles.removeClass('sc_circle_y_bottom_hide_animate');
  4982. });
  4983.  
  4984. $(document).on('mouseleave', '.sc_long_circle', () => {
  4985. let sc_circles = $(document).find('.sc_long_circle');
  4986. sc_circles.css('border', '2px solid #ffffff');
  4987. sc_circles.removeClass('sc_circle_x_left_show_animate');
  4988. sc_circles.removeClass('sc_circle_x_right_show_animate');
  4989. sc_circles.removeClass('sc_circle_y_top_show_animate');
  4990. sc_circles.removeClass('sc_circle_y_bottom_show_animate');
  4991.  
  4992. if (sc_welt_hide_circle_half_flag) { sc_circle_welt_hide_half(sc_circles.position().left, sc_circles.position().top); }
  4993. });
  4994.  
  4995. // 优化回弹问题
  4996. $(document).on('mouseenter', '.sc_long_rectangle, .sc_long_buttons, .sc_data_show', () => {
  4997. sc_rectangle_mouse_out = false;
  4998. if (sc_rectangle_is_slide_down || sc_rectangle_is_slide_up) {
  4999. return;
  5000. }
  5001. sc_rectangle_is_slide_down = true;
  5002.  
  5003. let sc_btn_model = document.getElementsByClassName('sc_long_buttons');
  5004. let sc_data_model = document.getElementsByClassName('sc_data_show');
  5005. let sc_data_lable_model = document.getElementsByClassName('sc_data_show label');
  5006. let sc_rectangle_model = document.getElementsByClassName('sc_long_rectangle');
  5007. let sc_list_model = document.getElementsByClassName('sc_long_list');
  5008.  
  5009. let the_enter_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  5010. let the_enter_sc_func_btn_mode = sc_func_btn_mode;
  5011. let the_enter_sc_panel_fold_mode = sc_panel_fold_mode;
  5012. let the_enter_sc_panel_side_fold_simple = sc_panel_side_fold_simple;
  5013. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5014. the_enter_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  5015. the_enter_sc_func_btn_mode = sc_func_btn_mode_fullscreen;
  5016. the_enter_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  5017. the_enter_sc_panel_side_fold_simple = sc_panel_side_fold_simple_fullscreen;
  5018. }
  5019.  
  5020. function sc_change_show() {
  5021.  
  5022. if (!the_enter_sc_panel_side_fold_flag || (the_enter_sc_panel_side_fold_flag && the_enter_sc_func_btn_mode !== 1)) {
  5023.  
  5024. $(sc_btn_model).slideDown(500, () => {
  5025. sc_rectangle_is_slide_down = false;
  5026. $(sc_btn_model).css('height', 'auto');
  5027.  
  5028. if (sc_rectangle_mouse_out) {
  5029. $(sc_btn_model).slideUp(500);
  5030. }
  5031. });
  5032. }
  5033.  
  5034. if (!the_enter_sc_panel_side_fold_flag || (the_enter_sc_panel_side_fold_flag && the_enter_sc_panel_side_fold_simple)) {
  5035.  
  5036. $(sc_data_model).slideDown(500, () => {
  5037. $(sc_btn_model).show();
  5038. $(sc_btn_model).css('height', 'auto');
  5039. sc_rectangle_is_slide_down = false;
  5040. if (sc_rectangle_mouse_out) {
  5041. $(sc_data_model).slideUp(500);
  5042. }
  5043. });
  5044. $(sc_data_lable_model).animate({opacity: 1}, 1000);
  5045. }
  5046.  
  5047. // 设置动画完成标志,用于处理鼠标的快速移入移出
  5048. $(sc_data_model).attr('data-anime', '0');
  5049. }
  5050.  
  5051. if (the_enter_sc_panel_fold_mode === 1) {
  5052.  
  5053. let sc_extra_height = 0;
  5054. let sc_enter_change = $(sc_btn_model).outerHeight() + $(sc_data_model).outerHeight() + 20;
  5055. let sc_diff_height = unsafeWindow.innerHeight - sc_rectangle_model[0].offsetTop - $(sc_list_model).outerHeight() - $(sc_btn_model).outerHeight() - $(sc_data_model).outerHeight() - 25;
  5056.  
  5057. if (!the_enter_sc_panel_side_fold_simple) {
  5058. sc_extra_height = $(sc_data_model).outerHeight();
  5059. if (the_enter_sc_func_btn_mode !== 1) {
  5060. sc_enter_change = $(sc_btn_model).outerHeight() + 10;
  5061. } else {
  5062. sc_enter_change = $(sc_btn_model).outerHeight();
  5063. }
  5064. }
  5065.  
  5066. if (Math.abs(unsafeWindow.innerHeight - sc_rectangle_model[0].offsetTop - $(sc_list_model).outerHeight() - sc_extra_height - 10) <= 10) {
  5067.  
  5068. // 直接计算动画后的数据,用于处理鼠标的快速移入移出
  5069. $(sc_data_model).attr('data-rectangleTop', sc_rectangle_model[0].offsetTop - sc_enter_change);
  5070. // 设置动画进行时标志,用于处理鼠标的快速移入移出
  5071. $(sc_data_model).attr('data-anime', '1');
  5072. // 优化鼠标从数据模块移入时的动画
  5073. $(sc_data_lable_model).show();
  5074. $(sc_data_model).show();
  5075. $(sc_btn_model).show();
  5076. $(sc_btn_model).css('height', 'auto');
  5077.  
  5078. $(sc_rectangle_model).animate({top: sc_rectangle_model[0].offsetTop - sc_enter_change}, 500, () => {
  5079. sc_rectangle_is_slide_down = false;
  5080.  
  5081. sc_change_show();
  5082. });
  5083. } else if (sc_diff_height < 0) {
  5084.  
  5085. // 直接计算动画后的数据,用于处理鼠标的快速移入移出
  5086. $(sc_data_model).attr('data-rectangleTop', sc_rectangle_model[0].offsetTop + sc_diff_height);
  5087. // 设置动画进行时标志,用于处理鼠标的快速移入移出
  5088. $(sc_data_model).attr('data-anime', '1');
  5089.  
  5090. $(sc_rectangle_model).animate({top: sc_rectangle_model[0].offsetTop + sc_diff_height}, 500, () => {
  5091. sc_rectangle_is_slide_down = false;
  5092.  
  5093. // 设置动画完成标志,用于处理鼠标的快速移入移出
  5094. $(sc_data_model).attr('data-anime', '0');
  5095.  
  5096. });
  5097. sc_change_show();
  5098. } else {
  5099. sc_change_show();
  5100. }
  5101. } else {
  5102. sc_change_show();
  5103. }
  5104.  
  5105. if (the_enter_sc_panel_side_fold_flag && the_enter_sc_func_btn_mode !== 1) {
  5106. $(sc_rectangle_model).css('border-bottom', '10px solid transparent');
  5107. }
  5108.  
  5109. });
  5110.  
  5111. $(document).on('mouseleave', '.sc_long_rectangle', (e) => {
  5112. sc_rectangle_mouse_out = true;
  5113. if (sc_rectangle_is_slide_up) {
  5114. return;
  5115. }
  5116.  
  5117. e = e || unsafeWindow.event;
  5118. let sc_mouseleave_next_class_name = (e.relatedTarget && e.relatedTarget.className) || '';
  5119. if (sc_mouseleave_next_class_name === 'sc_ctx_copy_menu' || sc_mouseleave_next_class_name === 'sc_ctx_func_menu') {
  5120. return;
  5121. }
  5122.  
  5123. sc_rectangle_is_slide_up = true;
  5124.  
  5125. let sc_btn_model = document.getElementsByClassName('sc_long_buttons');
  5126. let sc_data_model = document.getElementsByClassName('sc_data_show');
  5127. let sc_data_lable_model = document.getElementsByClassName('sc_data_show label');
  5128. let sc_rectangle_model = document.getElementsByClassName('sc_long_rectangle');
  5129. let sc_list_model = document.getElementsByClassName('sc_long_list');
  5130.  
  5131. let the_leave_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  5132. let the_leave_sc_panel_fold_mode = sc_panel_fold_mode;
  5133. let the_leave_sc_panel_side_fold_simple = sc_panel_side_fold_simple;
  5134. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5135. the_leave_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  5136. the_leave_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  5137. the_leave_sc_panel_side_fold_simple = sc_panel_side_fold_simple_fullscreen;
  5138. }
  5139.  
  5140. let sc_rectangle_top = sc_rectangle_model[0].offsetTop;
  5141.  
  5142. sc_btn_mode_apply();
  5143.  
  5144. $(sc_btn_model).slideUp(500, () => {
  5145. sc_rectangle_is_slide_up = false;
  5146. if (!sc_rectangle_mouse_out) {
  5147. $(sc_btn_model).slideDown(500);
  5148. if (the_leave_sc_panel_side_fold_flag && !the_leave_sc_panel_side_fold_simple) {
  5149. $(sc_rectangle_model).css('border-bottom', '10px solid transparent');
  5150. }
  5151. }
  5152. });
  5153.  
  5154. if (the_leave_sc_panel_side_fold_flag) {
  5155. // 应对鼠标的快速移入移出时,动画进行中的情况
  5156. let sc_edge_mouse_enter_anime = $(sc_data_model).attr('data-anime');
  5157. if (sc_edge_mouse_enter_anime === '1') {
  5158. sc_rectangle_top = parseInt($(sc_data_model).attr('data-rectangleTop'), 10);
  5159. }
  5160.  
  5161. if (the_leave_sc_panel_side_fold_simple) {
  5162. $(sc_data_lable_model).animate({opacity: 0}, 200);
  5163. $(sc_data_model).slideUp(500, () => {
  5164. // 预防快速操作
  5165. let the_leave_delay_sc_panel_side_fold_simple = sc_panel_side_fold_simple;
  5166. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5167. the_leave_delay_sc_panel_side_fold_simple = sc_panel_side_fold_simple_fullscreen;
  5168. }
  5169.  
  5170. sc_rectangle_is_slide_up = false;
  5171. if (!sc_rectangle_mouse_out || !the_leave_delay_sc_panel_side_fold_simple) {
  5172. $(sc_data_model).slideDown(500);
  5173. $(sc_rectangle_model).css('border-bottom', 'unset');
  5174. }
  5175. });
  5176. $(sc_rectangle_model).css('border-bottom', '10px solid transparent');
  5177.  
  5178. } else {
  5179. $(sc_rectangle_model).css('border-bottom', 'unset');
  5180.  
  5181. // 预防快速操作
  5182. setTimeout(()=> {
  5183. if ($(sc_data_model).css('display') === 'none') {
  5184. $(sc_data_model).slideDown(500);
  5185. }
  5186. }, 1000)
  5187. }
  5188. } else {
  5189. $(sc_data_lable_model).animate({opacity: 0}, 200);
  5190. $(sc_data_model).slideUp(500, () => {
  5191. sc_rectangle_is_slide_up = false;
  5192. if (!sc_rectangle_mouse_out) {
  5193. $(sc_data_model).slideDown(500);
  5194. $(sc_btn_model).show();
  5195. }
  5196. });
  5197. }
  5198.  
  5199. let sc_change_height = $(sc_btn_model).outerHeight() + $(sc_data_model).outerHeight();
  5200. let sc_leave_change = sc_change_height + 20;
  5201. if (the_leave_sc_panel_fold_mode === 1 && !the_leave_sc_panel_side_fold_simple) {
  5202. sc_leave_change = $(sc_btn_model).outerHeight() + 10;
  5203. }
  5204.  
  5205. if (Math.abs(unsafeWindow.innerHeight - sc_rectangle_top - $(sc_list_model).outerHeight() - sc_change_height - 30) <= 10) {
  5206. $(sc_rectangle_model).animate({top: sc_rectangle_top + sc_leave_change}, 500, () => {
  5207. sc_panel_drag_store(sc_rectangle_model[0].offsetLeft, sc_rectangle_model[0].offsetTop);
  5208. });
  5209. }
  5210.  
  5211. });
  5212.  
  5213. $(document).on('mouseenter', '.sc_msg_head', function(e) {
  5214. let the_enter_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  5215. let the_enter_sc_panel_list_height = sc_panel_list_height;
  5216. let the_enter_sc_rectangle_width = sc_rectangle_width;
  5217. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5218. the_enter_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  5219. the_enter_sc_panel_list_height = sc_panel_list_height_fullscreen;
  5220. the_enter_sc_rectangle_width = sc_rectangle_width_fullscreen;
  5221. }
  5222.  
  5223. if (!the_enter_sc_panel_side_fold_flag || sc_item_side_fold_touch_flag) { return; }
  5224.  
  5225. let sc_fold_out_show_top = $(this).offset().top - $(this).parent().parent().parent().offset().top - 10;
  5226. if (the_enter_sc_panel_list_height === 0 || sc_side_fold_hide_list_ing_flag) {
  5227. sc_fold_out_show_top = sc_fold_out_show_top + 10;
  5228. }
  5229. $(this).parent().css('position', 'absolute');
  5230. $(this).parent().css('top', sc_fold_out_show_top);
  5231. $(this).parent().css('z-index', '10');
  5232. $(this).parent().css('width', (the_enter_sc_rectangle_width - 22) + 'px'); // 22 约为总padding
  5233. $(this).parent().css('height', '');
  5234.  
  5235. if (($(this).offset().left - (unsafeWindow.innerWidth / 2)) > 0) {
  5236. if (the_enter_sc_panel_list_height === 0 || sc_side_fold_hide_list_ing_flag) {
  5237. $(this).parent().css('left', -(the_enter_sc_rectangle_width - 22 - 72 + 10 + 60)); // 22 约为总padding, 72为侧折后的宽,10为一个padding
  5238. } else {
  5239. $(this).parent().css('left', -(the_enter_sc_rectangle_width - 22 - 72 + 10)); // 22 约为总padding, 72为侧折后的宽,10为一个padding
  5240. }
  5241. }
  5242. sc_side_fold_out_one($(this).parent(), true);
  5243.  
  5244. sc_item_side_fold_touch_flag = true;
  5245. sc_item_side_fold_touch_oj = $(this).parent();
  5246. });
  5247.  
  5248. $(document).on('mouseleave', '.sc_msg_head', function() {
  5249. let the_leave_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  5250. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5251. the_leave_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  5252. }
  5253.  
  5254. if (!the_leave_sc_panel_side_fold_flag) { return; }
  5255.  
  5256. $(this).parent().css('position', '');
  5257. $(this).parent().css('top', '');
  5258. $(this).parent().css('z-index', '');
  5259. $(this).parent().css('width', '50px');
  5260. $(this).parent().css('height', '50px');
  5261. $(this).parent().css('left', '');
  5262. sc_side_fold_in_one($(this).parent());
  5263.  
  5264. sc_item_side_fold_touch_flag = false;
  5265. sc_item_side_fold_touch_oj = {};
  5266. });
  5267.  
  5268. $(document).on('click', '.sc_long_item', sc_toggle_msg_body);
  5269.  
  5270. $(document).on('click', '.sc_data_show', function(e) {
  5271. let the_cds_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  5272. let the_cds_sc_panel_side_fold_simple = sc_panel_side_fold_simple;
  5273. let the_cds_sc_func_btn_mode = sc_func_btn_mode;
  5274. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5275. the_cds_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  5276. the_cds_sc_panel_side_fold_simple = sc_panel_side_fold_simple_fullscreen;
  5277. the_cds_sc_func_btn_mode = sc_func_btn_mode_fullscreen;
  5278. }
  5279.  
  5280. if (the_cds_sc_panel_side_fold_flag) {
  5281. e = e || unsafeWindow.event;
  5282.  
  5283. if (the_cds_sc_panel_side_fold_simple) {
  5284. sc_live_panel_side_fold_simple_change(false);
  5285. open_and_close_sc_modal('已退出 侧折的极简模式 ✓', '#A7C9D3', e, 1);
  5286. } else {
  5287. sc_live_panel_side_fold_simple_change(true);
  5288. open_and_close_sc_modal('已设置 侧折的极简模式 ✓', '#A7C9D3', e, 1);
  5289. }
  5290.  
  5291. sc_side_fold_simple_store();
  5292.  
  5293. if (the_cds_sc_func_btn_mode === 1) {
  5294. sc_rectangle_is_slide_down = false;
  5295. }
  5296. }
  5297. });
  5298.  
  5299. // 侧折状态下,展开一个SC时也可以滚动
  5300. $(document).on('wheel', '.sc_long_list', function(e) {
  5301. let the_wl_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  5302. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5303. the_wl_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  5304. }
  5305.  
  5306. if (the_wl_sc_panel_side_fold_flag && sc_item_side_fold_touch_flag) {
  5307. e = e || unsafeWindow.event;
  5308.  
  5309. let the_sc_item_mov = 60; // 60是侧折后头像框高度+间隙
  5310. if (e.originalEvent.deltaY < 0) {
  5311. the_sc_item_mov = -60;
  5312. }
  5313. let the_sc_list = $(document).find('.sc_long_list');
  5314. the_sc_list.scrollTop(the_sc_list.scrollTop() + the_sc_item_mov);
  5315. if (the_sc_list.scrollTop() !== 0 || the_sc_list.scrollTop() + the_sc_list.height() !== the_sc_list[0].scrollHeight) {
  5316. sc_item_side_fold_touch_oj.css('top', sc_item_side_fold_touch_oj.position().top + the_sc_item_mov);
  5317. }
  5318. }
  5319. });
  5320.  
  5321. let sc_custom_modal_style = document.createElement('style');
  5322. sc_custom_modal_style.textContent = `
  5323. .sc_custom_config_modal {
  5324. display: none;
  5325. position: fixed;
  5326. z-index: 3333;
  5327. left: 0;
  5328. top: 0;
  5329. width: 100%;
  5330. height: 100%;
  5331. overflow: auto;
  5332. background-color: rgba(0, 0, 0, 0.3);
  5333. }
  5334.  
  5335. .sc_custom_modal_content {
  5336. background-color: #fefefe;
  5337. margin: 15% auto;
  5338. padding: 20px;
  5339. border: 1px solid #888;
  5340. width: 42%;
  5341. }
  5342.  
  5343. .sc_custom_modal_content p {
  5344. color: #000;
  5345. }
  5346.  
  5347. .sc_custom_close {
  5348. color: #aaa;
  5349. float: right;
  5350. font-size: 28px;
  5351. font-weight: bold;
  5352. }
  5353.  
  5354. .sc_custom_close:hover,
  5355. .sc_custom_close:focus {
  5356. color: black;
  5357. text-decoration: none;
  5358. cursor: pointer;
  5359. }
  5360.  
  5361. .sc_custom_radio_group {
  5362. display: inline-flex;
  5363. color: #000;
  5364. }
  5365.  
  5366. .sc_custom_radio_group_fullscreen {
  5367. display: inline-flex;
  5368. color: #000;
  5369. }
  5370.  
  5371. .sc_custom_radio_group label {
  5372. padding-right: 80px;
  5373. padding-left: 10px;
  5374. }
  5375.  
  5376. .sc_custom_radio_group_fullscreen label {
  5377. padding-right: 80px;
  5378. padding-left: 10px;
  5379. }
  5380.  
  5381. .sc_custom_btn_div {
  5382. margin-top: 30px;
  5383. }
  5384.  
  5385. .sc_custom_btn_div_fullscreen {
  5386. margin-top: 30px;
  5387. }
  5388.  
  5389. .sc_custom_checkbox_div,
  5390. .sc_custom_input_div {
  5391. display: none;
  5392. text-align: center;
  5393. margin-top: 20px;
  5394. }
  5395.  
  5396. .sc_custom_checkbox_inline {
  5397. vertical-align: middle;
  5398. display: inline-block;
  5399. color: #000;
  5400. }
  5401.  
  5402. .sc_custom_form {
  5403. margin-top: 30px;
  5404. text-align: right;
  5405. }
  5406.  
  5407. .sc_custom_input_div label {
  5408. color: #000;
  5409. }
  5410.  
  5411. #sc_custom_confirm_btn {
  5412. float: right;
  5413. }
  5414.  
  5415. #sc_custom_confirm_btn_fullscreen {
  5416. float: right;
  5417. }
  5418.  
  5419. .sc_custom_modal_btn {
  5420. padding: 5px 20px;
  5421. }
  5422. `;
  5423.  
  5424. document.head.appendChild(sc_custom_modal_style);
  5425.  
  5426. let sc_custom_modal_html = document.createElement('div');
  5427. sc_custom_modal_html.id = 'sc_custom_config_div';
  5428. sc_custom_modal_html.className = 'sc_custom_config_modal';
  5429. sc_custom_modal_html.innerHTML = `
  5430. <div class="sc_custom_modal_content">
  5431. <span class="sc_custom_close">&times;</span>
  5432. <p>侧折模式下留言显示设置:</p>
  5433. <form class="sc_custom_form">
  5434. <div class="sc_custom_radio_group">
  5435. <input type="radio" id="sc_custom_default_option" name="sc_custom_option" value="0" checked />
  5436. <label for="sc_custom_default_option">默认</label>
  5437.  
  5438. <input type="radio" id="sc_custom_open_option" name="sc_custom_option" value="1" />
  5439. <label for="sc_custom_open_option">第一个SC保持展开</label>
  5440.  
  5441. <input type="radio" id="sc_custom_time_option" name="sc_custom_option" value="2" />
  5442. <label for="sc_custom_time_option">第一个SC不保持展开</label>
  5443. </div>
  5444. <div class="sc_custom_checkbox_div sc_custom_checkbox_div_default">
  5445. <input type="checkbox" id="sc_custom_each_same_time_input" class="sc_custom_checkbox_inline" />
  5446. <label for="sc_custom_each_same_time_input" class="sc_custom_checkbox_inline" >确保每个实时SC都有相同的展开时间</label>
  5447. </div>
  5448. <div class="sc_custom_input_div sc_custom_input_div_default">
  5449. <label for="sc_custom_time_input">展开时间设定 (5-150/秒):</label>
  5450. <input type="number" id="sc_custom_time_input" min="5" max="150" value="10" />
  5451. </div>
  5452. </form>
  5453. <div class="sc_custom_btn_div">
  5454. <button id="sc_custom_cancel_btn" class="sc_custom_modal_btn">取消</button>
  5455. <button id="sc_custom_confirm_btn" class="sc_custom_modal_btn">确定</button>
  5456. </div>
  5457. </div>
  5458. `;
  5459.  
  5460. document.body.appendChild(sc_custom_modal_html);
  5461.  
  5462. let sc_custom_modal_html_fullscreen = document.createElement('div');
  5463. sc_custom_modal_html_fullscreen.id = 'sc_custom_config_div_fullscreen';
  5464. sc_custom_modal_html_fullscreen.className = 'sc_custom_config_modal';
  5465. sc_custom_modal_html_fullscreen.innerHTML = `
  5466. <div class="sc_custom_modal_content">
  5467. <span class="sc_custom_close">&times;</span>
  5468. <p>侧折模式下留言显示设置:</p>
  5469. <form class="sc_custom_form">
  5470. <div class="sc_custom_radio_group_fullscreen">
  5471. <input type="radio" id="sc_custom_default_option_fullscreen" name="sc_custom_option_fullscreen" value="0" checked />
  5472. <label for="sc_custom_default_option_fullscreen">默认</label>
  5473.  
  5474. <input type="radio" id="sc_custom_open_option_fullscreen" name="sc_custom_option_fullscreen" value="1" />
  5475. <label for="sc_custom_open_option_fullscreen">第一个SC保持展开</label>
  5476.  
  5477. <input type="radio" id="sc_custom_time_option_fullscreen" name="sc_custom_option_fullscreen" value="2" />
  5478. <label for="sc_custom_time_option_fullscreen">第一个SC不保持展开</label>
  5479. </div>
  5480. <div class="sc_custom_checkbox_div sc_custom_checkbox_div_fullscreen">
  5481. <input type="checkbox" id="sc_custom_each_same_time_input_fullscreen" class="sc_custom_checkbox_inline" />
  5482. <label for="sc_custom_each_same_time_input_fullscreen" class="sc_custom_checkbox_inline" >确保每个实时SC都有相同的展开时间</label>
  5483. </div>
  5484. <div class="sc_custom_input_div sc_custom_input_div_fullscreen">
  5485. <label for="sc_custom_time_input_fullscreen">展开时间设定 (5-150/秒):</label>
  5486. <input type="number" id="sc_custom_time_input_fullscreen" min="5" max="150" value="10" />
  5487. </div>
  5488. </form>
  5489. <div class="sc_custom_btn_div_fullscreen">
  5490. <button id="sc_custom_cancel_btn_fullscreen" class="sc_custom_modal_btn">取消</button>
  5491. <button id="sc_custom_confirm_btn_fullscreen" class="sc_custom_modal_btn">确定</button>
  5492. </div>
  5493. </div>
  5494. `;
  5495.  
  5496. $(live_player_div).append(sc_custom_modal_html_fullscreen);
  5497.  
  5498. function sc_close_custom_modal() {
  5499. $(document).find('.sc_custom_config_modal').hide();
  5500. }
  5501.  
  5502. $(document).on('click', '.sc_custom_close, .sc_custom_modal_btn', function() {
  5503. sc_close_custom_modal();
  5504. });
  5505.  
  5506. $(document).on('change', '#sc_custom_each_same_time_input', function() {
  5507. let sc_custom_select_val = $(document).find('.sc_custom_radio_group input[name="sc_custom_option"]:checked').val();
  5508. if (sc_custom_select_val === '1') {
  5509. if ($(this).is(':checked')) {
  5510. $(document).find('.sc_custom_input_div').show();
  5511. } else {
  5512. $(document).find('.sc_custom_input_div').hide();
  5513. }
  5514. }
  5515. });
  5516.  
  5517. $(document).on('change', '#sc_custom_each_same_time_input_fullscreen', function() {
  5518. let sc_custom_select_val = $(document).find('.sc_custom_radio_group_fullscreen input[name="sc_custom_option_fullscreen"]:checked').val();
  5519. if (sc_custom_select_val === '1') {
  5520. if ($(this).is(':checked')) {
  5521. $(document).find('.sc_custom_input_div').show();
  5522. } else {
  5523. $(document).find('.sc_custom_input_div').hide();
  5524. }
  5525. }
  5526. });
  5527.  
  5528. $(document).on('click', '#sc_custom_confirm_btn', function(e) {
  5529. let the_ccb_sc_panel_fold_mode = sc_panel_fold_mode;
  5530. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5531. the_ccb_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  5532. }
  5533.  
  5534. let sc_custom_select_val = $(document).find('.sc_custom_radio_group input[name="sc_custom_option"]:checked').val();
  5535.  
  5536. if (sc_side_fold_custom_first_class && the_ccb_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  5537. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  5538.  
  5539. if (sc_side_fold_custom_each_same_time_class && the_ccb_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  5540. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  5541.  
  5542. sc_side_fold_custom_auto_run_flag = false;
  5543.  
  5544. if (sc_custom_select_val === '0') {
  5545. sc_side_fold_custom_each_same_time_flag = false;
  5546.  
  5547. } else if (sc_custom_select_val === '1') {
  5548. sc_side_fold_custom_each_same_time_flag = $(document).find('#sc_custom_each_same_time_input').is(':checked');
  5549.  
  5550. if (sc_side_fold_custom_each_same_time_flag) {
  5551. let sc_custom_config_time = $(document).find('#sc_custom_time_input').val();
  5552. sc_custom_config_time = parseInt(sc_custom_config_time, 10);
  5553.  
  5554. if (sc_custom_config_time >= 5 && sc_custom_config_time <= 150) {
  5555. sc_side_fold_custom_time = sc_custom_config_time;
  5556. } else {
  5557.  
  5558. if (sc_custom_config_time < 5) {
  5559. sc_side_fold_custom_time = 5;
  5560. } else if (sc_custom_config_time > 150) {
  5561. sc_side_fold_custom_time = 150;
  5562. } else {
  5563. sc_side_fold_custom_time = 10;
  5564. }
  5565. }
  5566.  
  5567. sc_side_fold_custom_time = sc_side_fold_custom_time + 1.5; // 1.5s是动画时间,补回来
  5568. }
  5569.  
  5570. if (sc_side_fold_custom_first_class && the_ccb_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_out(sc_side_fold_custom_first_class); }
  5571.  
  5572. } else if (sc_custom_select_val === '2') {
  5573. sc_side_fold_custom_each_same_time_flag = $(document).find('#sc_custom_each_same_time_input').is(':checked');
  5574.  
  5575. let sc_custom_config_time = $(document).find('#sc_custom_time_input').val();
  5576. sc_custom_config_time = parseInt(sc_custom_config_time, 10);
  5577.  
  5578. if (sc_custom_config_time >= 5 && sc_custom_config_time <= 150) {
  5579. sc_side_fold_custom_time = sc_custom_config_time;
  5580. } else {
  5581.  
  5582. if (sc_custom_config_time < 5) {
  5583. sc_side_fold_custom_time = 5;
  5584. } else if (sc_custom_config_time > 150) {
  5585. sc_side_fold_custom_time = 150;
  5586. } else {
  5587. sc_side_fold_custom_time = 10;
  5588. }
  5589. }
  5590.  
  5591. sc_side_fold_custom_time = sc_side_fold_custom_time + 1.5; // 1.5s是动画时间,补回来
  5592.  
  5593. if (sc_side_fold_custom_first_class && the_ccb_sc_panel_fold_mode === 1) {
  5594. sc_trigger_item_side_fold_out(sc_side_fold_custom_first_class);
  5595.  
  5596. if (!sc_side_fold_custom_each_same_time_flag) {
  5597. sc_side_fold_custom_first_timeout_id = setTimeout(function() {
  5598. if (sc_side_fold_custom_first_class && the_ccb_sc_panel_fold_mode === 1) {
  5599. sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class);
  5600. }
  5601. }, sc_side_fold_custom_time * 1000);
  5602. }
  5603.  
  5604. }
  5605. }
  5606.  
  5607. sc_side_fold_custom_config = parseInt(sc_custom_select_val, 10);
  5608. sc_side_fold_custom_config_store();
  5609.  
  5610. sc_close_custom_modal();
  5611. open_and_close_sc_modal('✓', '#A7C9D3', e);
  5612. });
  5613.  
  5614. $(document).on('click', '#sc_custom_confirm_btn_fullscreen', function(e) {
  5615. let the_ccb_sc_panel_fold_mode = sc_panel_fold_mode;
  5616. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  5617. the_ccb_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  5618. }
  5619.  
  5620. let sc_custom_select_val = $(document).find('.sc_custom_radio_group_fullscreen input[name="sc_custom_option_fullscreen"]:checked').val();
  5621.  
  5622. if (sc_side_fold_custom_first_class && the_ccb_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  5623. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  5624.  
  5625. if (sc_side_fold_custom_each_same_time_class && the_ccb_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  5626. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  5627.  
  5628. sc_side_fold_custom_auto_run_flag = false;
  5629.  
  5630. if (sc_custom_select_val === '0') {
  5631. sc_side_fold_custom_each_same_time_flag = false;
  5632.  
  5633. } else if (sc_custom_select_val === '1') {
  5634. sc_side_fold_custom_each_same_time_flag = $(document).find('#sc_custom_each_same_time_input_fullscreen').is(':checked');
  5635.  
  5636. if (sc_side_fold_custom_each_same_time_flag) {
  5637. let sc_custom_config_time = $(document).find('#sc_custom_time_input_fullscreen').val();
  5638. sc_custom_config_time = parseInt(sc_custom_config_time, 10);
  5639.  
  5640. if (sc_custom_config_time >= 5 && sc_custom_config_time <= 150) {
  5641. sc_side_fold_custom_time = sc_custom_config_time;
  5642. } else {
  5643.  
  5644. if (sc_custom_config_time < 5) {
  5645. sc_side_fold_custom_time = 5;
  5646. } else if (sc_custom_config_time > 150) {
  5647. sc_side_fold_custom_time = 150;
  5648. } else {
  5649. sc_side_fold_custom_time = 10;
  5650. }
  5651. }
  5652.  
  5653. sc_side_fold_custom_time = sc_side_fold_custom_time + 1.5; // 1.5s是动画时间,补回来
  5654.  
  5655. }
  5656.  
  5657. if (sc_side_fold_custom_first_class && the_ccb_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_out(sc_side_fold_custom_first_class); }
  5658.  
  5659. } else if (sc_custom_select_val === '2') {
  5660. sc_side_fold_custom_each_same_time_flag = $(document).find('#sc_custom_each_same_time_input_fullscreen').is(':checked');
  5661.  
  5662. let sc_custom_config_time = $(document).find('#sc_custom_time_input_fullscreen').val();
  5663. sc_custom_config_time = parseInt(sc_custom_config_time, 10);
  5664.  
  5665. if (sc_custom_config_time >= 5 && sc_custom_config_time <= 150) {
  5666. sc_side_fold_custom_time = sc_custom_config_time;
  5667. } else {
  5668.  
  5669. if (sc_custom_config_time < 5) {
  5670. sc_side_fold_custom_time = 5;
  5671. } else if (sc_custom_config_time > 150) {
  5672. sc_side_fold_custom_time = 150;
  5673. } else {
  5674. sc_side_fold_custom_time = 10;
  5675. }
  5676. }
  5677.  
  5678. sc_side_fold_custom_time = sc_side_fold_custom_time + 1.5; // 1.5s是动画时间,补回来
  5679.  
  5680. if (sc_side_fold_custom_first_class && the_ccb_sc_panel_fold_mode === 1) {
  5681. sc_trigger_item_side_fold_out(sc_side_fold_custom_first_class);
  5682.  
  5683. if (!sc_side_fold_custom_each_same_time_flag) {
  5684. sc_side_fold_custom_first_timeout_id = setTimeout(function() {
  5685. if (sc_side_fold_custom_first_class && the_ccb_sc_panel_fold_mode === 1) {
  5686. sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class);
  5687. }
  5688. }, sc_side_fold_custom_time * 1000);
  5689. }
  5690.  
  5691. }
  5692. }
  5693.  
  5694. sc_side_fold_custom_config = parseInt(sc_custom_select_val, 10);
  5695. sc_side_fold_custom_config_store();
  5696.  
  5697. sc_close_custom_modal();
  5698. open_and_close_sc_modal('✓', '#A7C9D3', e);
  5699. });
  5700.  
  5701. $(document).on('change', '.sc_custom_radio_group input[type="radio"], .sc_custom_radio_group_fullscreen input[type="radio"]', function () {
  5702. if ($(this).val() === '1') {
  5703. $(document).find('.sc_custom_checkbox_div').show();
  5704. $(document).find('.sc_custom_input_div').hide();
  5705. if ($(document).find('#sc_custom_each_same_time_input').is(':checked')) {
  5706. $(document).find('.sc_custom_input_div_default').show();
  5707. }
  5708.  
  5709. if ($(document).find('#sc_custom_each_same_time_input_fullscreen').is(':checked')) {
  5710. $(document).find('.sc_custom_input_div_fullscreen').show();
  5711. }
  5712. } else if ($(this).val() === '2') {
  5713. $(document).find('.sc_custom_checkbox_div').show();
  5714. $(document).find('.sc_custom_input_div').show();
  5715. } else {
  5716. $(document).find('.sc_custom_checkbox_div').hide();
  5717. $(document).find('.sc_custom_input_div').hide();
  5718. }
  5719. });
  5720.  
  5721. let sc_live_panel_show_time_modal_style = document.createElement('style');
  5722. sc_live_panel_show_time_modal_style.textContent = `
  5723. .sc_live_panel_show_time_config_modal {
  5724. display: none;
  5725. position: fixed;
  5726. z-index: 3333;
  5727. left: 0;
  5728. top: 0;
  5729. width: 100%;
  5730. height: 100%;
  5731. overflow: auto;
  5732. background-color: rgba(0, 0, 0, 0.3);
  5733. }
  5734.  
  5735. .sc_live_panel_show_time_modal_content {
  5736. background-color: #fefefe;
  5737. margin: 15% auto;
  5738. padding: 20px;
  5739. border: 1px solid #888;
  5740. width: 45%;
  5741. }
  5742.  
  5743. .sc_live_panel_show_time_modal_content p {
  5744. color: #000;
  5745. }
  5746.  
  5747. .sc_live_panel_show_time_close {
  5748. color: #aaa;
  5749. float: right;
  5750. font-size: 28px;
  5751. font-weight: bold;
  5752. }
  5753.  
  5754. .sc_live_panel_show_time_close:hover,
  5755. .sc_live_panel_show_time_close:focus {
  5756. color: black;
  5757. text-decoration: none;
  5758. cursor: pointer;
  5759. }
  5760.  
  5761. .sc_live_panel_show_time_radio_group {
  5762. display: inline-flex;
  5763. color: #000;
  5764. flex-direction: column;
  5765. }
  5766.  
  5767. .sc_live_panel_show_time_radio_group_fullscreen {
  5768. display: inline-flex;
  5769. color: #000;
  5770. flex-direction: column;
  5771. }
  5772.  
  5773. .sc_live_panel_show_time_radio_group label {
  5774. padding-right: 30px;
  5775. padding-left: 10px;
  5776. }
  5777.  
  5778. .sc_live_panel_show_time_radio_group_fullscreen label {
  5779. padding-right: 80px;
  5780. padding-left: 10px;
  5781. }
  5782.  
  5783. .sc_live_panel_show_time_btn_div {
  5784. margin-top: 30px;
  5785. }
  5786.  
  5787. .sc_live_panel_show_time_btn_div_fullscreen {
  5788. margin-top: 30px;
  5789. }
  5790.  
  5791. .sc_live_panel_show_time_checkbox_div{
  5792. text-align: center;
  5793. margin-top: 20px;
  5794. }
  5795.  
  5796. .sc_live_panel_show_time_checkbox_inline {
  5797. vertical-align: middle;
  5798. display: inline-block;
  5799. color: #000;
  5800. }
  5801.  
  5802. #sc_live_panel_show_time_form {
  5803. margin-top: 30px;
  5804. text-align: center;
  5805. }
  5806.  
  5807. #sc_live_panel_show_time_form_fullscreen {
  5808. margin-top: 30px;
  5809. text-align: center;
  5810. }
  5811.  
  5812. .sc_live_panel_show_time_form_item {
  5813. display: flex;
  5814. align-items: center;
  5815. margin-top: 5px;
  5816. margin-bottom: 5px;
  5817. }
  5818.  
  5819. #sc_live_panel_show_time_confirm_btn {
  5820. float: right;
  5821. }
  5822.  
  5823. #sc_live_panel_show_time_confirm_btn_fullscreen {
  5824. float: right;
  5825. }
  5826.  
  5827. .sc_live_panel_show_time_modal_btn {
  5828. padding: 5px 20px;
  5829. }
  5830. `;
  5831.  
  5832. document.head.appendChild(sc_live_panel_show_time_modal_style);
  5833.  
  5834. let sc_live_panel_show_time_modal_html = document.createElement('div');
  5835. sc_live_panel_show_time_modal_html.id = 'sc_live_panel_show_time_config_div';
  5836. sc_live_panel_show_time_modal_html.className = 'sc_live_panel_show_time_config_modal';
  5837. sc_live_panel_show_time_modal_html.innerHTML = `
  5838. <div class="sc_live_panel_show_time_modal_content">
  5839. <span class="sc_live_panel_show_time_close">&times;</span>
  5840. <p>所有模式下留言显示自定义设置:</p>
  5841. <form id="sc_live_panel_show_time_form">
  5842. <label class="sc_model_div_label">若选择非默认选项,过期检查启动 / 继续(SC过期则自动隐藏)</label>
  5843. <br>
  5844. <br>
  5845. <div class="sc_live_panel_show_time_radio_group">
  5846. <div class="sc_live_panel_show_time_form_item">
  5847. <input type="radio" id="sc_live_panel_show_time_always_show_option" name="sc_live_panel_show_time_option" value="0" checked />
  5848. <label for="sc_live_panel_show_time_always_show_option">默认一直显示</label>
  5849. </div>
  5850.  
  5851. <div class="sc_live_panel_show_time_form_item">
  5852. <input type="radio" id="sc_live_panel_show_time_30s_option" name="sc_live_panel_show_time_option" value="1" />
  5853. <label for="sc_live_panel_show_time_30s_option">过期距离SC发送30秒</label>
  5854. </div>
  5855.  
  5856. <div class="sc_live_panel_show_time_form_item">
  5857. <input type="radio" id="sc_live_panel_show_time_minute_option" name="sc_live_panel_show_time_option" value="2" />
  5858. <label for="sc_live_panel_show_time_minute_option">过期距离SC发送1~120分钟</label>
  5859. <input id="sc_live_panel_show_time_sc_input" type="number" min="1" max="120" value="2" style="color: #999;"/>
  5860. </div>
  5861.  
  5862. <div class="sc_live_panel_show_time_form_item">
  5863. <input type="radio" id="sc_live_panel_show_time_sc_option" name="sc_live_panel_show_time_option" value="3" />
  5864. <label for="sc_live_panel_show_time_sc_option">依照SC的时间过期</label>
  5865. </div>
  5866.  
  5867. <div class="sc_live_panel_show_time_form_item">
  5868. <input type="radio" id="sc_live_panel_show_time_sc_and_minute_option" name="sc_live_panel_show_time_option" value="4" />
  5869. <label for="sc_live_panel_show_time_sc_and_minute_option">依照SC的时间过期,同时最多距离SC发送1~120分钟</label>
  5870. <input id="sc_live_panel_show_time_sc_and_most_time_input" type="number" min="1" max="120" value="2" style="color: #999;"/>
  5871. </div>
  5872. <br>
  5873. </div>
  5874. <div class="sc_live_panel_show_time_checkbox_div">
  5875. <input type="checkbox" id="sc_live_panel_show_time_click_stop" class="sc_live_panel_show_time_checkbox_inline"/>
  5876. <label for="sc_live_panel_show_time_click_stop" class="sc_live_panel_show_time_checkbox_inline">点击【不记忆地显示醒目留言列表】后,过期检查暂停;点击【不记忆地隐藏过期醒目留言】后,过期检查继续</label>
  5877. </div>
  5878. </form>
  5879. <div class="sc_live_panel_show_time_btn_div">
  5880. <button id="sc_live_panel_show_time_cancel_btn" class="sc_live_panel_show_time_modal_btn sc_live_panel_show_time_modal_close_btn">取消</button>
  5881. <button id="sc_live_panel_show_time_confirm_btn" class="sc_live_panel_show_time_modal_btn sc_live_panel_show_time_modal_close_btn">确定</button>
  5882. </div>
  5883. </div>
  5884. `;
  5885.  
  5886. document.body.appendChild(sc_live_panel_show_time_modal_html);
  5887.  
  5888. let sc_live_panel_show_time_modal_html_fullscreen = document.createElement('div');
  5889. sc_live_panel_show_time_modal_html_fullscreen.id = 'sc_live_panel_show_time_config_div_fullscreen';
  5890. sc_live_panel_show_time_modal_html_fullscreen.className = 'sc_live_panel_show_time_config_modal';
  5891. sc_live_panel_show_time_modal_html_fullscreen.innerHTML = `
  5892. <div class="sc_live_panel_show_time_modal_content">
  5893. <span class="sc_live_panel_show_time_close">&times;</span>
  5894. <p>所有模式下留言显示自定义设置:</p>
  5895. <form id="sc_live_panel_show_time_form_fullscreen">
  5896. <label class="sc_model_div_label">若选择非默认选项,过期检查启动 / 继续(SC过期则自动隐藏)</label>
  5897. <br>
  5898. <br>
  5899. <div class="sc_live_panel_show_time_radio_group_fullscreen">
  5900. <div class="sc_live_panel_show_time_form_item">
  5901. <input type="radio" id="sc_live_panel_show_time_always_show_option_fullscreen" name="sc_live_panel_show_time_option_fullscreen" value="0" checked />
  5902. <label for="sc_live_panel_show_time_always_show_option_fullscreen">默认一直显示</label>
  5903. </div>
  5904.  
  5905. <div class="sc_live_panel_show_time_form_item">
  5906. <input type="radio" id="sc_live_panel_show_time_30s_option_fullscreen" name="sc_live_panel_show_time_option_fullscreen" value="1" />
  5907. <label for="sc_live_panel_show_time_30s_option_fullscreen">过期距离SC发送30秒</label>
  5908. </div>
  5909.  
  5910. <div class="sc_live_panel_show_time_form_item">
  5911. <input type="radio" id="sc_live_panel_show_time_minute_option_fullscreen" name="sc_live_panel_show_time_option_fullscreen" value="2" />
  5912. <label for="sc_live_panel_show_time_minute_option_fullscreen">过期距离SC发送1~120分钟</label>
  5913. <input id="sc_live_panel_show_time_sc_input_fullscreen" type="number" min="1" max="120" value="2" style="color: #999;"/>
  5914. </div>
  5915.  
  5916. <div class="sc_live_panel_show_time_form_item">
  5917. <input type="radio" id="sc_live_panel_show_time_sc_option_fullscreen" name="sc_live_panel_show_time_option_fullscreen" value="3" />
  5918. <label for="sc_live_panel_show_time_sc_option_fullscreen">依照SC的时间过期</label>
  5919. </div>
  5920.  
  5921. <div class="sc_live_panel_show_time_form_item">
  5922. <input type="radio" id="sc_live_panel_show_time_sc_and_minute_option_fullscreen" name="sc_live_panel_show_time_option_fullscreen" value="4" />
  5923. <label for="sc_live_panel_show_time_sc_and_minute_option_fullscreen">依照SC的时间过期,同时最多距离SC发送1~120分钟</label>
  5924. <input id="sc_live_panel_show_time_sc_and_most_time_input_fullscreen" type="number" min="1" max="120" value="2" style="color: #999;"/>
  5925. </div>
  5926. <br>
  5927. </div>
  5928. <div class="sc_live_panel_show_time_checkbox_div">
  5929. <input type="checkbox" id="sc_live_panel_show_time_click_stop_fullscreen" class="sc_live_panel_show_time_checkbox_inline"/>
  5930. <label for="sc_live_panel_show_time_click_stop_fullscreen" class="sc_live_panel_show_time_checkbox_inline">点击【不记忆地显示醒目留言列表】后,过期检查暂停;点击【不记忆地隐藏过期醒目留言】后,过期检查继续</label>
  5931. </div>
  5932. </form>
  5933. <div class="sc_live_panel_show_time_btn_div_fullscreen">
  5934. <button id="sc_live_panel_show_time_cancel_btn" class="sc_live_panel_show_time_modal_btn sc_live_panel_show_time_modal_close_btn">取消</button>
  5935. <button id="sc_live_panel_show_time_confirm_btn_fullscreen" class="sc_live_panel_show_time_modal_btn sc_live_panel_show_time_modal_close_btn">确定</button>
  5936. </div>
  5937. </div>
  5938. `;
  5939.  
  5940. $(live_player_div).append(sc_live_panel_show_time_modal_html_fullscreen);
  5941.  
  5942. function sc_close_live_panel_show_time_modal() {
  5943. $(document).find('.sc_live_panel_show_time_config_modal').hide();
  5944. }
  5945.  
  5946. $(document).on('click', '.sc_live_panel_show_time_close, .sc_live_panel_show_time_modal_close_btn', function() {
  5947. sc_close_live_panel_show_time_modal();
  5948. });
  5949.  
  5950. $(document).on('click', '#sc_live_panel_show_time_confirm_btn', function(e) {
  5951.  
  5952. let sc_panel_show_time_option_val = $(document).find('.sc_live_panel_show_time_radio_group input[name="sc_live_panel_show_time_option"]:checked').val();
  5953. sc_panel_show_time_mode = parseInt(sc_panel_show_time_option_val, 10);
  5954.  
  5955. sc_panel_show_time_each_same = 0.5;
  5956. if (sc_panel_show_time_mode === 0) {
  5957. $(document).find('.sc_long_item').show();
  5958. } else if (sc_panel_show_time_mode === 2) {
  5959. let the_sc_panel_show_time_sc_val = $(document).find('#sc_live_panel_show_time_sc_input').val();
  5960. if (the_sc_panel_show_time_sc_val) {
  5961. sc_panel_show_time_each_same = parseInt(the_sc_panel_show_time_sc_val, 10);
  5962. } else {
  5963. sc_panel_show_time_each_same = 1;
  5964. }
  5965. } else if (sc_panel_show_time_mode === 4) {
  5966. let the_sc_panel_show_time_sc_and_most_time_val = $(document).find('#sc_live_panel_show_time_sc_and_most_time_input').val();
  5967. if (the_sc_panel_show_time_sc_and_most_time_val) {
  5968. sc_panel_show_time_each_same = parseInt(the_sc_panel_show_time_sc_and_most_time_val, 10);
  5969. } else {
  5970. sc_panel_show_time_each_same = 1;
  5971. }
  5972. }
  5973.  
  5974. sc_live_panel_show_time_click_stop_flag = $(document).find('#sc_live_panel_show_time_click_stop').is(':checked');
  5975.  
  5976. sc_panel_show_time_mode_config_store();
  5977. sc_panel_show_time_each_same_config_store();
  5978. sc_live_panel_show_time_click_stop_flag_config_store();
  5979.  
  5980. if (sc_panel_show_time_mode) {
  5981. // 重启过期检查
  5982. $(document).find('.sc_long_list').removeClass('sc_long_expire_check_stop');
  5983. }
  5984.  
  5985. open_and_close_sc_modal('✓', '#A7C9D3', e);
  5986. });
  5987.  
  5988. $(document).on('click', '#sc_live_panel_show_time_confirm_btn_fullscreen', function(e) {
  5989.  
  5990. let sc_panel_show_time_option_val = $(document).find('.sc_live_panel_show_time_radio_group_fullscreen input[name="sc_live_panel_show_time_option_fullscreen"]:checked').val();
  5991. sc_panel_show_time_mode = parseInt(sc_panel_show_time_option_val, 10);
  5992.  
  5993. sc_panel_show_time_each_same = 0.5;
  5994. if (sc_panel_show_time_mode === 0) {
  5995. $(document).find('.sc_long_item').show();
  5996. } else if (sc_panel_show_time_mode === 2) {
  5997. let the_sc_panel_show_time_sc_val = $(document).find('#sc_live_panel_show_time_sc_input_fullscreen').val();
  5998. if (the_sc_panel_show_time_sc_val) {
  5999. sc_panel_show_time_each_same = parseInt(the_sc_panel_show_time_sc_val, 10);
  6000. } else {
  6001. sc_panel_show_time_each_same = 1;
  6002. }
  6003. } else if (sc_panel_show_time_mode === 4) {
  6004. let the_sc_panel_show_time_sc_and_most_time_val = $(document).find('#sc_live_panel_show_time_sc_and_most_time_input_fullscreen').val();
  6005. if (the_sc_panel_show_time_sc_and_most_time_val) {
  6006. sc_panel_show_time_each_same = parseInt(the_sc_panel_show_time_sc_and_most_time_val, 10);
  6007. } else {
  6008. sc_panel_show_time_each_same = 1;
  6009. }
  6010. }
  6011.  
  6012. sc_live_panel_show_time_click_stop_flag = $(document).find('#sc_live_panel_show_time_click_stop_fullscreen').is(':checked');
  6013.  
  6014. sc_panel_show_time_mode_config_store();
  6015. sc_panel_show_time_each_same_config_store();
  6016. sc_live_panel_show_time_click_stop_flag_config_store();
  6017.  
  6018. if (sc_panel_show_time_mode) {
  6019. // 重启过期检查
  6020. $(document).find('.sc_long_list').removeClass('sc_long_expire_check_stop');
  6021. }
  6022.  
  6023. open_and_close_sc_modal('✓', '#A7C9D3', e);
  6024. });
  6025.  
  6026. let sc_panel_width_modal_style = document.createElement('style');
  6027. sc_panel_width_modal_style.textContent = `
  6028. .sc_panel_width_config_modal {
  6029. display: none;
  6030. position: fixed;
  6031. z-index: 3333;
  6032. left: 0;
  6033. top: 0;
  6034. width: 100%;
  6035. height: 100%;
  6036. overflow: auto;
  6037. background-color: rgba(0, 0, 0, 0.3);
  6038. }
  6039.  
  6040. .sc_panel_width_modal_content {
  6041. background-color: #fefefe;
  6042. margin: 15% auto;
  6043. padding: 20px;
  6044. border: 1px solid #888;
  6045. width: 42%;
  6046. }
  6047.  
  6048. .sc_panel_width_modal_content p {
  6049. color: #000;
  6050. }
  6051.  
  6052. .sc_panel_width_close {
  6053. color: #aaa;
  6054. float: right;
  6055. font-size: 28px;
  6056. font-weight: bold;
  6057. }
  6058.  
  6059. .sc_panel_width_close:hover,
  6060. .sc_panel_width_close:focus {
  6061. color: black;
  6062. text-decoration: none;
  6063. cursor: pointer;
  6064. }
  6065.  
  6066. .sc_panel_width_btn_div {
  6067. text-align: center;
  6068. margin-top: 20px;
  6069. }
  6070.  
  6071. .sc_panel_width_btn_div_fullscreen {
  6072. text-align: center;
  6073. margin-top: 30px;
  6074. }
  6075.  
  6076. #sc_panel_width_input_div {
  6077. text-align: center;
  6078. margin-top: 20px;
  6079. }
  6080.  
  6081. #sc_panel_width_input_div label {
  6082. color: #000;
  6083. }
  6084.  
  6085. #sc_panel_width_input_div_fullscreen {
  6086. text-align: center;
  6087. margin-top: 20px;
  6088. }
  6089.  
  6090. #sc_panel_width_input_div_fullscreen label {
  6091. color: #000;
  6092. }
  6093.  
  6094. #sc_panel_width_cancel_btn {
  6095. float: left;
  6096. }
  6097.  
  6098. #sc_panel_width_cancel_btn_fullscreen {
  6099. float: left;
  6100. }
  6101.  
  6102. #sc_panel_width_confirm_btn {
  6103. float: right;
  6104. }
  6105.  
  6106. #sc_panel_width_confirm_btn_fullscreen {
  6107. float: right;
  6108. }
  6109.  
  6110. .sc_panel_width_modal_btn {
  6111. padding: 3px 10px;
  6112. }
  6113. .sc_panel_width_modal_width_1_btn,
  6114. .sc_panel_width_modal_width_2_btn,
  6115. .sc_panel_width_modal_width_3_btn{
  6116. margin-left: 10px;
  6117. }
  6118. `;
  6119.  
  6120. document.head.appendChild(sc_panel_width_modal_style);
  6121.  
  6122. let sc_panel_width_modal_html = document.createElement('div');
  6123. sc_panel_width_modal_html.id = 'sc_panel_width_config_div';
  6124. sc_panel_width_modal_html.className = 'sc_panel_width_config_modal';
  6125. sc_panel_width_modal_html.innerHTML = `
  6126. <div class="sc_panel_width_modal_content">
  6127. <span class="sc_panel_width_close">&times;</span>
  6128. <p>醒目留言(记录板)宽度自定义设置:</p>
  6129. <form id="sc_panel_width_form">
  6130. <div id="sc_panel_width_input_div">
  6131. <label for="sc_panel_width_input">300-500(px):</label>
  6132. <input type="number" class="sc_panel_width_input_value" id="sc_panel_width_input" min="300" max="500" value="302"/>
  6133. </div>
  6134. </form>
  6135.  
  6136. <div class="sc_panel_width_btn_div">
  6137. <button id="sc_panel_width_cancel_btn" class="sc_panel_width_modal_btn sc_panel_width_modal_close_btn">取消</button>
  6138. <button id="sc_panel_width_default_btn" class="sc_panel_width_modal_btn sc_panel_width_modal_default_btn">默认</button>
  6139. <button id="sc_panel_width_1_btn" class="sc_panel_width_modal_btn sc_panel_width_modal_width_1_btn">宽一</button>
  6140. <button id="sc_panel_width_2_btn" class="sc_panel_width_modal_btn sc_panel_width_modal_width_2_btn">宽二</button>
  6141. <button id="sc_panel_width_3_btn" class="sc_panel_width_modal_btn sc_panel_width_modal_width_3_btn">宽三</button>
  6142. <button id="sc_panel_width_confirm_btn" class="sc_panel_width_modal_btn sc_panel_width_modal_close_btn">确定</button>
  6143. </div>
  6144. </div>
  6145. `;
  6146.  
  6147. document.body.appendChild(sc_panel_width_modal_html);
  6148.  
  6149. let sc_panel_width_modal_html_fullscreen = document.createElement('div');
  6150. sc_panel_width_modal_html_fullscreen.id = 'sc_panel_width_config_div_fullscreen';
  6151. sc_panel_width_modal_html_fullscreen.className = 'sc_panel_width_config_modal';
  6152. sc_panel_width_modal_html_fullscreen.innerHTML = `
  6153. <div class="sc_panel_width_modal_content">
  6154. <span class="sc_panel_width_close">&times;</span>
  6155. <p>醒目留言(记录板)宽度自定义设置:</p>
  6156. <form id="sc_panel_width_form_fullscreen">
  6157. <div id="sc_panel_width_input_div_fullscreen">
  6158. <label for="sc_panel_width_input_fullscreen">300-500(px):</label>
  6159. <input type="number" class="sc_panel_width_input_value" id="sc_panel_width_input_fullscreen" min="300" max="500" value="302"/>
  6160. </div>
  6161. </form>
  6162.  
  6163. <div class="sc_panel_width_btn_div_fullscreen">
  6164. <button id="sc_panel_width_cancel_btn_fullscreen" class="sc_panel_width_modal_btn sc_panel_width_modal_close_btn">取消</button>
  6165. <button id="sc_panel_width_default_btn_fullscreen" class="sc_panel_width_modal_btn sc_panel_width_modal_default_btn">默认</button>
  6166. <button id="sc_panel_width_1_btn_fullscreen" class="sc_panel_width_modal_btn sc_panel_width_modal_width_1_btn">宽一</button>
  6167. <button id="sc_panel_width_2_btn_fullscreen" class="sc_panel_width_modal_btn sc_panel_width_modal_width_2_btn">宽二</button>
  6168. <button id="sc_panel_width_3_btn_fullscreen" class="sc_panel_width_modal_btn sc_panel_width_modal_width_3_btn">宽三</button>
  6169. <button id="sc_panel_width_confirm_btn_fullscreen" class="sc_panel_width_modal_btn sc_panel_width_modal_close_btn">确定</button>
  6170. </div>
  6171. </div>
  6172. `;
  6173.  
  6174. $(live_player_div).append(sc_panel_width_modal_html_fullscreen);
  6175.  
  6176. function sc_close_panel_width_modal() {
  6177. $(document).find('.sc_panel_width_config_modal').hide();
  6178. }
  6179.  
  6180. $(document).on('click', '.sc_panel_width_close, .sc_panel_width_modal_close_btn', function() {
  6181. sc_close_panel_width_modal();
  6182. });
  6183.  
  6184. $(document).on('click', '.sc_panel_width_modal_default_btn', function() {
  6185. $(document).find('.sc_panel_width_input_value').val(302);
  6186. });
  6187.  
  6188. $(document).on('click', '.sc_panel_width_modal_width_1_btn', function() {
  6189. $(document).find('.sc_panel_width_input_value').val(325);
  6190. });
  6191.  
  6192. $(document).on('click', '.sc_panel_width_modal_width_2_btn', function() {
  6193. $(document).find('.sc_panel_width_input_value').val(388);
  6194. });
  6195.  
  6196. $(document).on('click', '.sc_panel_width_modal_width_3_btn', function() {
  6197. $(document).find('.sc_panel_width_input_value').val(428);
  6198. });
  6199.  
  6200. $(document).on('click', '#sc_panel_width_confirm_btn', function(e) {
  6201. let sc_panel_width_config = $(document).find('#sc_panel_width_input').val();
  6202. sc_panel_width_config = parseInt(sc_panel_width_config, 10);
  6203. if (sc_panel_width_config >= 300 && sc_panel_width_config <= 500) {
  6204. sc_live_panel_width_change(sc_panel_width_config);
  6205. } else {
  6206. if (sc_panel_width_config < 300) {
  6207. sc_live_panel_width_change(300);
  6208. } else if (sc_panel_width_config > 500) {
  6209. sc_live_panel_width_change(500);
  6210. } else {
  6211. sc_live_panel_width_change(325);
  6212. }
  6213. }
  6214. sc_rectangle_width_store();
  6215. sc_panel_width_config_apply();
  6216.  
  6217. sc_close_panel_width_modal();
  6218. open_and_close_sc_modal('✓', '#A7C9D3', e);
  6219. });
  6220.  
  6221. $(document).on('click', '#sc_panel_width_confirm_btn_fullscreen', function(e) {
  6222. let sc_panel_width_config = $(document).find('#sc_panel_width_input_fullscreen').val();
  6223. sc_panel_width_config = parseInt(sc_panel_width_config, 10);
  6224. if (sc_panel_width_config >= 300 && sc_panel_width_config <= 500) {
  6225. sc_live_panel_width_change(sc_panel_width_config);
  6226. } else {
  6227. if (sc_panel_width_config < 300) {
  6228. sc_live_panel_width_change(300);
  6229. } else if (sc_panel_width_config > 500) {
  6230. sc_live_panel_width_change(500);
  6231. } else {
  6232. sc_live_panel_width_change(325);
  6233. }
  6234. }
  6235. sc_rectangle_width_store();
  6236. sc_panel_width_config_apply();
  6237.  
  6238. sc_close_panel_width_modal();
  6239. open_and_close_sc_modal('✓', '#A7C9D3', e);
  6240. });
  6241.  
  6242. let sc_panel_height_modal_style = document.createElement('style');
  6243. sc_panel_height_modal_style.textContent = `
  6244. .sc_panel_height_config_modal {
  6245. display: none;
  6246. position: fixed;
  6247. z-index: 3333;
  6248. left: 0;
  6249. top: 0;
  6250. width: 100%;
  6251. height: 100%;
  6252. overflow: auto;
  6253. background-color: rgba(0, 0, 0, 0.3);
  6254. }
  6255.  
  6256. .sc_panel_height_modal_content {
  6257. background-color: #fefefe;
  6258. margin: 15% auto;
  6259. padding: 20px;
  6260. border: 1px solid #888;
  6261. width: 42%;
  6262. }
  6263.  
  6264. .sc_panel_height_modal_content p {
  6265. color: #000;
  6266. }
  6267.  
  6268. .sc_panel_height_close {
  6269. color: #aaa;
  6270. float: right;
  6271. font-size: 28px;
  6272. font-weight: bold;
  6273. }
  6274.  
  6275. .sc_panel_height_close:hover,
  6276. .sc_panel_height_close:focus {
  6277. color: black;
  6278. text-decoration: none;
  6279. cursor: pointer;
  6280. }
  6281.  
  6282. .sc_panel_height_btn_div {
  6283. text-align: center;
  6284. margin-top: 20px;
  6285. }
  6286.  
  6287. .sc_panel_height_btn_div_fullscreen {
  6288. text-align: center;
  6289. margin-top: 30px;
  6290. }
  6291.  
  6292. #sc_panel_height_input_div {
  6293. text-align: center;
  6294. margin-top: 20px;
  6295. }
  6296.  
  6297. #sc_panel_height_input_div label {
  6298. color: #000;
  6299. }
  6300.  
  6301. #sc_panel_height_input_div_fullscreen {
  6302. text-align: center;
  6303. margin-top: 20px;
  6304. }
  6305.  
  6306. #sc_panel_height_input_div_fullscreen label {
  6307. color: #000;
  6308. }
  6309.  
  6310. #sc_panel_height_cancel_btn {
  6311. float: left;
  6312. }
  6313.  
  6314. #sc_panel_height_cancel_btn_fullscreen {
  6315. float: left;
  6316. }
  6317.  
  6318. #sc_panel_height_confirm_btn {
  6319. float: right;
  6320. }
  6321.  
  6322. #sc_panel_height_confirm_btn_fullscreen {
  6323. float: right;
  6324. }
  6325.  
  6326. .sc_panel_height_modal_btn {
  6327. padding: 3px 10px;
  6328. }
  6329. .sc_panel_height_modal_width_1_btn,
  6330. .sc_panel_height_modal_width_2_btn,
  6331. .sc_panel_height_modal_width_3_btn,
  6332. .sc_panel_height_modal_width_4_btn,
  6333. .sc_panel_height_modal_width_5_btn{
  6334. margin-left: 10px;
  6335. }
  6336. `;
  6337.  
  6338. document.head.appendChild(sc_panel_height_modal_style);
  6339.  
  6340. let sc_panel_height_modal_html = document.createElement('div');
  6341. sc_panel_height_modal_html.id = 'sc_panel_height_config_div';
  6342. sc_panel_height_modal_html.className = 'sc_panel_height_config_modal';
  6343. sc_panel_height_modal_html.innerHTML = `
  6344. <div class="sc_panel_height_modal_content">
  6345. <span class="sc_panel_height_close">&times;</span>
  6346. <p>记录板高度自定义设置:</p>
  6347. <form id="sc_panel_height_form">
  6348. <div id="sc_panel_height_input_div">
  6349. <label for="sc_panel_height_input">0-500(px):</label>
  6350. <input type="number" class="sc_panel_height_input_value" id="sc_panel_height_input" min="0" max="500" value="170"/>
  6351. </div>
  6352. </form>
  6353.  
  6354. <div class="sc_panel_height_btn_div">
  6355. <button id="sc_panel_height_cancel_btn" class="sc_panel_height_modal_btn sc_panel_height_modal_close_btn">取消</button>
  6356. <button id="sc_panel_height_default_btn" class="sc_panel_height_modal_btn sc_panel_height_modal_default_btn">默认</button>
  6357. <button id="sc_panel_height_1_btn" class="sc_panel_height_modal_btn sc_panel_height_modal_width_1_btn">最小</button>
  6358. <button id="sc_panel_height_2_btn" class="sc_panel_height_modal_btn sc_panel_height_modal_width_2_btn">高一</button>
  6359. <button id="sc_panel_height_3_btn" class="sc_panel_height_modal_btn sc_panel_height_modal_width_3_btn">高二</button>
  6360. <button id="sc_panel_height_4_btn" class="sc_panel_height_modal_btn sc_panel_height_modal_width_4_btn">高三</button>
  6361. <button id="sc_panel_height_5_btn" class="sc_panel_height_modal_btn sc_panel_height_modal_width_5_btn">最大</button>
  6362. <button id="sc_panel_height_confirm_btn" class="sc_panel_height_modal_btn sc_panel_height_modal_close_btn">确定</button>
  6363. </div>
  6364. </div>
  6365. `;
  6366.  
  6367. document.body.appendChild(sc_panel_height_modal_html);
  6368.  
  6369. let sc_panel_height_modal_html_fullscreen = document.createElement('div');
  6370. sc_panel_height_modal_html_fullscreen.id = 'sc_panel_height_config_div_fullscreen';
  6371. sc_panel_height_modal_html_fullscreen.className = 'sc_panel_height_config_modal';
  6372. sc_panel_height_modal_html_fullscreen.innerHTML = `
  6373. <div class="sc_panel_height_modal_content">
  6374. <span class="sc_panel_height_close">&times;</span>
  6375. <p>记录板高度自定义设置:</p>
  6376. <form id="sc_panel_height_form_fullscreen">
  6377. <div id="sc_panel_height_input_div_fullscreen">
  6378. <label for="sc_panel_height_input_fullscreen">0-500(px):</label>
  6379. <input type="number" class="sc_panel_height_input_value" id="sc_panel_height_input_fullscreen" min="0" max="500" value="170"/>
  6380. </div>
  6381. </form>
  6382.  
  6383. <div class="sc_panel_height_btn_div_fullscreen">
  6384. <button id="sc_panel_height_cancel_btn_fullscreen" class="sc_panel_height_modal_btn sc_panel_height_modal_close_btn">取消</button>
  6385. <button id="sc_panel_height_default_btn_fullscreen" class="sc_panel_height_modal_btn sc_panel_height_modal_default_btn">默认</button>
  6386. <button id="sc_panel_height_1_btn_fullscreen" class="sc_panel_height_modal_btn sc_panel_height_modal_width_1_btn">最小</button>
  6387. <button id="sc_panel_height_2_btn_fullscreen" class="sc_panel_height_modal_btn sc_panel_height_modal_width_2_btn">高一</button>
  6388. <button id="sc_panel_height_3_btn_fullscreen" class="sc_panel_height_modal_btn sc_panel_height_modal_width_3_btn">高二</button>
  6389. <button id="sc_panel_height_4_btn_fullscreen" class="sc_panel_height_modal_btn sc_panel_height_modal_width_4_btn">高三</button>
  6390. <button id="sc_panel_height_5_btn_fullscreen" class="sc_panel_height_modal_btn sc_panel_height_modal_width_5_btn">最大</button>
  6391. <button id="sc_panel_height_confirm_btn_fullscreen" class="sc_panel_height_modal_btn sc_panel_height_modal_close_btn">确定</button>
  6392. </div>
  6393. </div>
  6394. `;
  6395.  
  6396. $(live_player_div).append(sc_panel_height_modal_html_fullscreen);
  6397.  
  6398. function sc_close_panel_height_modal() {
  6399. $(document).find('.sc_panel_height_config_modal').hide();
  6400. }
  6401.  
  6402. $(document).on('click', '.sc_panel_height_close, .sc_panel_height_modal_close_btn', function() {
  6403. sc_close_panel_height_modal();
  6404. });
  6405.  
  6406. $(document).on('click', '.sc_panel_height_modal_default_btn', function() {
  6407. $(document).find('.sc_panel_height_input_value').val(400);
  6408. });
  6409.  
  6410. $(document).on('click', '.sc_panel_height_modal_width_1_btn', function() {
  6411. $(document).find('.sc_panel_height_input_value').val(0);
  6412. });
  6413.  
  6414. $(document).on('click', '.sc_panel_height_modal_width_2_btn', function() {
  6415. $(document).find('.sc_panel_height_input_value').val(50);
  6416. });
  6417.  
  6418. $(document).on('click', '.sc_panel_height_modal_width_3_btn', function() {
  6419. $(document).find('.sc_panel_height_input_value').val(110);
  6420. });
  6421.  
  6422. $(document).on('click', '.sc_panel_height_modal_width_4_btn', function() {
  6423. $(document).find('.sc_panel_height_input_value').val(170);
  6424. });
  6425.  
  6426. $(document).on('click', '.sc_panel_height_modal_width_5_btn', function() {
  6427. $(document).find('.sc_panel_height_input_value').val(500);
  6428. });
  6429.  
  6430. $(document).on('click', '#sc_panel_height_confirm_btn', function(e) {
  6431. sc_side_fold_hide_list_ing_flag = false;
  6432.  
  6433. let the_phc_sc_panel_fold_mode = sc_panel_fold_mode;
  6434. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  6435. the_phc_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  6436. }
  6437.  
  6438. let sc_phc_long_list = $(document).find('.sc_long_list');
  6439. let sc_panel_height_config = $(document).find('#sc_panel_height_input').val();
  6440. sc_panel_height_config = parseInt(sc_panel_height_config, 10);
  6441. if (sc_panel_height_config >= 0 && sc_panel_height_config <= 500) {
  6442. sc_live_panel_height_change(sc_panel_height_config);
  6443. sc_phc_long_list.attr('data-height', sc_panel_height_config);
  6444.  
  6445. if (sc_panel_height_config === 0) {
  6446. sc_side_fold_hide_list_ing_flag = true;
  6447. }
  6448. } else {
  6449. if (sc_panel_height_config < 0) {
  6450. sc_live_panel_height_change(0);
  6451. sc_phc_long_list.attr('data-height', 0);
  6452.  
  6453. sc_side_fold_hide_list_ing_flag = true;
  6454. } else if (sc_panel_height_config > 500) {
  6455. sc_live_panel_height_change(500);
  6456. sc_phc_long_list.attr('data-height', 500);
  6457. } else {
  6458. sc_live_panel_height_change(170);
  6459. sc_phc_long_list.attr('data-height', 170);
  6460. }
  6461. }
  6462. sc_panel_list_height_store();
  6463. sc_panel_list_height_config_apply();
  6464.  
  6465. if (sc_side_fold_custom_first_class && the_phc_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  6466. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  6467.  
  6468. if (sc_side_fold_custom_each_same_time_class && the_phc_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  6469. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  6470.  
  6471. if (sc_side_fold_custom_first_class && the_phc_sc_panel_fold_mode === 1 && !sc_live_sc_to_danmu_show_flag) { sc_side_fold_custom_auto_run_flag = false; sc_custom_config_apply(sc_side_fold_custom_first_class); }
  6472.  
  6473. sc_close_panel_height_modal();
  6474. open_and_close_sc_modal('✓', '#A7C9D3', e);
  6475. });
  6476.  
  6477. $(document).on('click', '#sc_panel_height_confirm_btn_fullscreen', function(e) {
  6478. sc_side_fold_hide_list_ing_flag = false;
  6479.  
  6480. let the_phc_sc_panel_fold_mode = sc_panel_fold_mode;
  6481. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  6482. the_phc_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  6483. }
  6484.  
  6485. let sc_phc_long_list = $(document).find('.sc_long_list');
  6486. let sc_panel_height_config = $(document).find('#sc_panel_height_input_fullscreen').val();
  6487. sc_panel_height_config = parseInt(sc_panel_height_config, 10);
  6488. if (sc_panel_height_config >= 0 && sc_panel_height_config <= 500) {
  6489. sc_live_panel_height_change(sc_panel_height_config);
  6490. sc_phc_long_list.attr('data-height', sc_panel_height_config);
  6491.  
  6492. if (sc_panel_height_config === 0) {
  6493. sc_side_fold_hide_list_ing_flag = true;
  6494. }
  6495. } else {
  6496. if (sc_panel_height_config < 0) {
  6497. sc_live_panel_height_change(0);
  6498. sc_phc_long_list.attr('data-height', 0);
  6499.  
  6500. sc_side_fold_hide_list_ing_flag = true;
  6501. } else if (sc_panel_height_config > 500) {
  6502. sc_live_panel_height_change(500);
  6503. sc_phc_long_list.attr('data-height', 500);
  6504. } else {
  6505. sc_live_panel_height_change(170);
  6506. sc_phc_long_list.attr('data-height', 170);
  6507. }
  6508. }
  6509. sc_panel_list_height_store();
  6510. sc_panel_list_height_config_apply();
  6511.  
  6512. if (sc_side_fold_custom_first_class && the_phc_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  6513. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  6514.  
  6515. if (sc_side_fold_custom_each_same_time_class && the_phc_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  6516. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  6517.  
  6518. if (sc_side_fold_custom_first_class && the_phc_sc_panel_fold_mode === 1 && !sc_live_sc_to_danmu_show_flag) { sc_side_fold_custom_auto_run_flag = false; sc_custom_config_apply(sc_side_fold_custom_first_class); }
  6519.  
  6520. sc_close_panel_height_modal();
  6521. open_and_close_sc_modal('✓', '#A7C9D3', e);
  6522. });
  6523.  
  6524. let sc_item_order_modal_style = document.createElement('style');
  6525. sc_item_order_modal_style.textContent = `
  6526. .sc_item_order_config_modal {
  6527. display: none;
  6528. position: fixed;
  6529. z-index: 3333;
  6530. left: 0;
  6531. top: 0;
  6532. width: 100%;
  6533. height: 100%;
  6534. overflow: auto;
  6535. background-color: rgba(0, 0, 0, 0.3);
  6536. }
  6537.  
  6538. .sc_item_order_modal_content {
  6539. background-color: #fefefe;
  6540. margin: 15% auto;
  6541. padding: 20px;
  6542. border: 1px solid #888;
  6543. width: 42%;
  6544. }
  6545.  
  6546. .sc_item_order_modal_content p {
  6547. color: #000;
  6548. }
  6549.  
  6550. .sc_item_order_close {
  6551. color: #aaa;
  6552. float: right;
  6553. font-size: 28px;
  6554. font-weight: bold;
  6555. }
  6556.  
  6557. .sc_item_order_close:hover,
  6558. .sc_item_order_close:focus {
  6559. color: black;
  6560. text-decoration: none;
  6561. cursor: pointer;
  6562. }
  6563.  
  6564. .sc_item_order_radio_group {
  6565. display: inline-flex;
  6566. color: #000;
  6567. }
  6568.  
  6569. .sc_item_order_radio_group_fullscreen {
  6570. display: inline-flex;
  6571. color: #000;
  6572. }
  6573.  
  6574. .sc_item_order_radio_group label {
  6575. padding-right: 80px;
  6576. padding-left: 10px;
  6577. }
  6578.  
  6579. .sc_item_order_radio_group_fullscreen label {
  6580. padding-right: 80px;
  6581. padding-left: 10px;
  6582. }
  6583.  
  6584. .sc_item_order_btn_div {
  6585. margin-top: 30px;
  6586. }
  6587.  
  6588. .sc_item_order_btn_div_fullscreen {
  6589. margin-top: 30px;
  6590. }
  6591.  
  6592. #sc_item_order_form {
  6593. margin-top: 30px;
  6594. text-align: center;
  6595. }
  6596.  
  6597. #sc_item_order_form_fullscreen {
  6598. margin-top: 30px;
  6599. text-align: center;
  6600. }
  6601.  
  6602. #sc_item_order_confirm_btn {
  6603. float: right;
  6604. }
  6605.  
  6606. #sc_item_order_confirm_btn_fullscreen {
  6607. float: right;
  6608. }
  6609.  
  6610. .sc_item_order_modal_btn {
  6611. padding: 5px 20px;
  6612. }
  6613. `;
  6614.  
  6615. document.head.appendChild(sc_item_order_modal_style);
  6616.  
  6617. let sc_item_order_modal_html = document.createElement('div');
  6618. sc_item_order_modal_html.id = 'sc_item_order_config_div';
  6619. sc_item_order_modal_html.className = 'sc_item_order_config_modal';
  6620. sc_item_order_modal_html.innerHTML = `
  6621. <div class="sc_item_order_modal_content">
  6622. <span class="sc_item_order_close">&times;</span>
  6623. <p>设置记录板留言的排列顺序:</p>
  6624. <form id="sc_item_order_form">
  6625. <div class="sc_item_order_radio_group">
  6626. <input type="radio" id="sc_item_order_down_option" name="sc_item_order_option" value="0" checked />
  6627. <label for="sc_item_order_down_option">从上往下(最新的在顶部)</label>
  6628.  
  6629. <input type="radio" id="sc_item_order_up_option" name="sc_item_order_option" value="1" />
  6630. <label for="sc_item_order_up_option">从下往上(最新的在底部)</label>
  6631. </div>
  6632. </form>
  6633. <div class="sc_item_order_btn_div">
  6634. <button id="sc_item_order_cancel_btn" class="sc_item_order_modal_btn sc_item_order_modal_close_btn">取消</button>
  6635. <button id="sc_item_order_confirm_btn" class="sc_item_order_modal_btn sc_item_order_modal_close_btn">确定</button>
  6636. </div>
  6637. </div>
  6638. `;
  6639.  
  6640. document.body.appendChild(sc_item_order_modal_html);
  6641.  
  6642. let sc_item_order_modal_html_fullscreen = document.createElement('div');
  6643. sc_item_order_modal_html_fullscreen.id = 'sc_item_order_config_div_fullscreen';
  6644. sc_item_order_modal_html_fullscreen.className = 'sc_item_order_config_modal';
  6645. sc_item_order_modal_html_fullscreen.innerHTML = `
  6646. <div class="sc_item_order_modal_content">
  6647. <span class="sc_item_order_close">&times;</span>
  6648. <p>设置记录板留言的排列顺序:</p>
  6649. <form id="sc_item_order_form_fullscreen">
  6650. <div class="sc_item_order_radio_group_fullscreen">
  6651. <input type="radio" id="sc_item_order_down_option_fullscreen" name="sc_item_order_option_fullscreen" value="0" checked />
  6652. <label for="sc_item_order_down_option_fullscreen">从上往下(最新的在顶部)</label>
  6653.  
  6654. <input type="radio" id="sc_item_order_up_option_fullscreen" name="sc_item_order_option_fullscreen" value="1" />
  6655. <label for="sc_item_order_up_option_fullscreen">从下往上(最新的在底部)</label>
  6656. </div>
  6657. </form>
  6658. <div class="sc_item_order_btn_div_fullscreen">
  6659. <button id="sc_item_order_cancel_btn_fullscreen" class="sc_item_order_modal_btn sc_item_order_modal_close_btn">取消</button>
  6660. <button id="sc_item_order_confirm_btn_fullscreen" class="sc_item_order_modal_btn sc_item_order_modal_close_btn">确定</button>
  6661. </div>
  6662. </div>
  6663. `;
  6664.  
  6665. $(live_player_div).append(sc_item_order_modal_html_fullscreen);
  6666.  
  6667. function sc_close_item_order_modal() {
  6668. $(document).find('.sc_item_order_config_modal').hide();
  6669. }
  6670.  
  6671. $(document).on('click', '.sc_item_order_close, .sc_item_order_modal_close_btn', function() {
  6672. sc_close_item_order_modal();
  6673. });
  6674.  
  6675. $(document).on('click', '#sc_item_order_confirm_btn', function(e) {
  6676. let sc_item_order_select_val = $(document).find('.sc_item_order_radio_group input[name="sc_item_order_option"]:checked').val();
  6677. let old_sc_item_order_up_flag = sc_item_order_up_flag;
  6678. if (sc_item_order_select_val === '0') {
  6679. sc_item_order_up_flag = false;
  6680. } else if (sc_item_order_select_val === '1') {
  6681. sc_item_order_up_flag = true;
  6682. }
  6683.  
  6684. sc_close_item_order_modal();
  6685.  
  6686. if (old_sc_item_order_up_flag === sc_item_order_up_flag) {
  6687. open_and_close_sc_modal('✓', '#A7C9D3', e);
  6688. } else {
  6689. sc_item_order_up_flag_store();
  6690. alert('更新设置成功!刷新页面后生效~');
  6691. unsafeWindow.location.reload();
  6692. }
  6693. });
  6694.  
  6695. $(document).on('click', '#sc_item_order_confirm_btn_fullscreen', function(e) {
  6696. let sc_item_order_select_val = $(document).find('.sc_item_order_radio_group_fullscreen input[name="sc_item_order_option_fullscreen"]:checked').val();
  6697. let old_sc_item_order_up_flag = sc_item_order_up_flag;
  6698. if (sc_item_order_select_val === '0') {
  6699. sc_item_order_up_flag = false;
  6700. } else if (sc_item_order_select_val === '1') {
  6701. sc_item_order_up_flag = true;
  6702. }
  6703.  
  6704. sc_close_item_order_modal();
  6705.  
  6706. if (old_sc_item_order_up_flag === sc_item_order_up_flag) {
  6707. open_and_close_sc_modal('✓', '#A7C9D3', e);
  6708. } else {
  6709. sc_item_order_up_flag_store();
  6710. alert('更新设置成功!刷新页面后生效~');
  6711. unsafeWindow.location.reload();
  6712. }
  6713. });
  6714.  
  6715. let sc_live_sc_to_danmu_show_modal_style = document.createElement('style');
  6716. sc_live_sc_to_danmu_show_modal_style.textContent = `
  6717. .sc_live_sc_to_danmu_show_config_modal {
  6718. display: none;
  6719. position: fixed;
  6720. z-index: 3333;
  6721. left: 0;
  6722. top: 0;
  6723. width: 100%;
  6724. height: 100%;
  6725. overflow: auto;
  6726. background-color: rgba(0, 0, 0, 0.3);
  6727. }
  6728.  
  6729. .sc_live_sc_to_danmu_show_modal_content {
  6730. background-color: #fefefe;
  6731. margin: 15% auto;
  6732. padding: 20px;
  6733. border: 1px solid #888;
  6734. width: 45%;
  6735. }
  6736.  
  6737. .sc_live_sc_to_danmu_show_modal_content p {
  6738. color: #000;
  6739. }
  6740.  
  6741. .sc_modal_label_tip {
  6742. color: #000;
  6743. }
  6744.  
  6745. .sc_live_sc_to_danmu_show_close {
  6746. color: #aaa;
  6747. float: right;
  6748. font-size: 28px;
  6749. font-weight: bold;
  6750. }
  6751.  
  6752. .sc_live_sc_to_danmu_show_close:hover,
  6753. .sc_live_sc_to_danmu_show_close:focus {
  6754. color: black;
  6755. text-decoration: none;
  6756. cursor: pointer;
  6757. }
  6758.  
  6759. .sc_live_sc_to_danmu_show_radio_group {
  6760. display: inline-flex;
  6761. text-align: center;
  6762. color: #000;
  6763. margin-top: 10px;
  6764. margin-bottom: 10px;
  6765. }
  6766. .sc_live_sc_to_danmu_show_radio_group input[type="radio"] {
  6767. margin-right: 10px;
  6768. }
  6769.  
  6770. .sc_live_sc_to_danmu_show_radio_group label {
  6771. margin-right: 30px;
  6772. }
  6773.  
  6774. .sc_live_sc_to_danmu_show_radio_group_fullscreen {
  6775. display: inline-flex;
  6776. text-align: center;
  6777. color: #000;
  6778. }
  6779. .sc_live_sc_to_danmu_show_radio_group_fullscreen input[type="radio"] {
  6780. margin-right: 10px;
  6781. }
  6782.  
  6783. .sc_live_sc_to_danmu_show_radio_group_fullscreen label {
  6784. margin-right: 30px;
  6785. }
  6786.  
  6787. .sc_live_sc_to_danmu_show_btn_div {
  6788. margin-top: 30px;
  6789. }
  6790.  
  6791. .sc_live_sc_to_danmu_show_btn_div_fullscreen {
  6792. margin-top: 30px;
  6793. }
  6794.  
  6795. #sc_live_sc_to_danmu_show_confirm_btn {
  6796. float: right;
  6797. }
  6798.  
  6799. #sc_live_sc_to_danmu_show_confirm_btn_fullscreen {
  6800. float: right;
  6801. }
  6802.  
  6803. .sc_live_sc_to_danmu_show_modal_btn {
  6804. padding: 3px 10px;
  6805. }
  6806.  
  6807. #sc_live_sc_to_danmu_show_form {
  6808. text-align: center;
  6809. }
  6810. #sc_live_sc_to_danmu_show_form_fullscreen {
  6811. margin-top: 20px;
  6812. text-align: center;
  6813. }
  6814. .sc_live_sc_to_danmu_show_checkbox_inline {
  6815. vertical-align: middle;
  6816. display: inline-block;
  6817. color: #000;
  6818. }
  6819. .sc_model_div_label {
  6820. color: #000;
  6821. }
  6822. `;
  6823.  
  6824. document.head.appendChild(sc_live_sc_to_danmu_show_modal_style);
  6825.  
  6826. let sc_live_sc_to_danmu_show_modal_html = document.createElement('div');
  6827. sc_live_sc_to_danmu_show_modal_html.id = 'sc_live_sc_to_danmu_show_config_div';
  6828. sc_live_sc_to_danmu_show_modal_html.className = 'sc_live_sc_to_danmu_show_config_modal';
  6829. sc_live_sc_to_danmu_show_modal_html.innerHTML = `
  6830. <div class="sc_live_sc_to_danmu_show_modal_content">
  6831. <span class="sc_live_sc_to_danmu_show_close">&times;</span>
  6832. <p>设置醒目留言以弹幕来展现:</p>
  6833. <form id="sc_live_sc_to_danmu_show_form">
  6834. <br>
  6835. <div>
  6836. <input type="checkbox" id="sc_live_sc_to_danmu_show_checkbox" class="sc_live_sc_to_danmu_show_checkbox_inline"/>
  6837. <label for="sc_live_sc_to_danmu_show_checkbox" class="sc_live_sc_to_danmu_show_checkbox_inline">设置醒目留言以弹幕来展现(侧折模式不再将SC自动展现)</label>
  6838. </div>
  6839. <br>
  6840. <div class="sc_live_sc_to_danmu_show_radio_group">
  6841. <input type="radio" id="sc_live_sc_to_danmu_show_top_option" name="sc_live_sc_to_danmu_show_location_option" value="0" checked />
  6842. <label for="sc_live_sc_to_danmu_show_top_option">显示在顶部 / 底部(优先顶部)</label>
  6843.  
  6844. <input type="radio" id="sc_live_sc_to_danmu_show_middle_option" name="sc_live_sc_to_danmu_show_location_option" value="1" />
  6845. <label for="sc_live_sc_to_danmu_show_middle_option">显示在中间随机</label>
  6846.  
  6847. <input type="radio" id="sc_live_sc_to_danmu_show_bottom_option" name="sc_live_sc_to_danmu_show_location_option" value="2" />
  6848. <label for="sc_live_sc_to_danmu_show_bottom_option">显示在底部 / 顶部(优先底部)</label>
  6849. </div>
  6850. <br>
  6851. <br>
  6852. <label class="sc_model_div_label">高亮弹幕样式选择:</label>
  6853. <div class="sc_live_sc_to_danmu_show_radio_group">
  6854. <input type="radio" id="sc_live_sc_to_danmu_show_half_opaque_big_option" name="sc_live_sc_to_danmu_show_mode_option" value="0" checked />
  6855. <label for="sc_live_sc_to_danmu_show_half_opaque_big_option">半透明 [样式较大]</label>
  6856.  
  6857. <input type="radio" id="sc_live_sc_to_danmu_show_half_opaque_small_option" name="sc_live_sc_to_danmu_show_mode_option" value="1" />
  6858. <label for="sc_live_sc_to_danmu_show_half_opaque_small_option">半透明 [样式较小]</label>
  6859.  
  6860. <input type="radio" id="sc_live_sc_to_danmu_show_no_opaque_big_option" name="sc_live_sc_to_danmu_show_mode_option" value="2" />
  6861. <label for="sc_live_sc_to_danmu_show_no_opaque_big_option">不透明 [样式较大]</label>
  6862.  
  6863. <input type="radio" id="sc_live_sc_to_danmu_show_no_opaque_small_option" name="sc_live_sc_to_danmu_show_mode_option" value="3" />
  6864. <label for="sc_live_sc_to_danmu_show_no_opaque_small_option">不透明 [样式较小]</label>
  6865. </div>
  6866. <br>
  6867. <br>
  6868. <div>
  6869. <input type="checkbox" id="sc_live_sc_to_danmu_no_remain_checkbox" class="sc_live_sc_to_danmu_show_checkbox_inline"/>
  6870. <label for="sc_live_sc_to_danmu_no_remain_checkbox" class="sc_live_sc_to_danmu_show_checkbox_inline">SC的弹幕到达左侧后不再停留(默认停留10s,是为了看清SC内容,如果SC长度超过屏幕则自动不停留)</label>
  6871. </div>
  6872. </form>
  6873. <div class="sc_live_sc_to_danmu_show_btn_div">
  6874. <button id="sc_live_sc_to_danmu_show_cancel_btn" class="sc_live_sc_to_danmu_show_modal_btn sc_live_sc_to_danmu_show_modal_close_btn">取消</button>
  6875. <button id="sc_live_sc_to_danmu_show_confirm_btn" class="sc_live_sc_to_danmu_show_modal_btn sc_live_sc_to_danmu_show_modal_close_btn">确定</button>
  6876. </div>
  6877. </div>
  6878. `;
  6879.  
  6880. document.body.appendChild(sc_live_sc_to_danmu_show_modal_html);
  6881.  
  6882. let sc_live_sc_to_danmu_show_modal_html_fullscreen = document.createElement('div');
  6883. sc_live_sc_to_danmu_show_modal_html_fullscreen.id = 'sc_live_sc_to_danmu_show_config_div_fullscreen';
  6884. sc_live_sc_to_danmu_show_modal_html_fullscreen.className = 'sc_live_sc_to_danmu_show_config_modal';
  6885. sc_live_sc_to_danmu_show_modal_html_fullscreen.innerHTML = `
  6886. <div class="sc_live_sc_to_danmu_show_modal_content">
  6887. <span class="sc_live_sc_to_danmu_show_close">&times;</span>
  6888. <p>设置醒目留言以弹幕来展现:</p>
  6889. <form id="sc_live_sc_to_danmu_show_form_fullscreen">
  6890. <br>
  6891. <div>
  6892. <input type="checkbox" id="sc_live_sc_to_danmu_show_checkbox_fullscreen" class="sc_live_sc_to_danmu_show_checkbox_inline"/>
  6893. <label for="sc_live_sc_to_danmu_show_checkbox_fullscreen" class="sc_live_sc_to_danmu_show_checkbox_inline">设置醒目留言以弹幕来展现(侧折模式不再将SC自动展现)</label>
  6894. </div>
  6895. <br>
  6896. <div class="sc_live_sc_to_danmu_show_radio_group_fullscreen">
  6897. <input type="radio" id="sc_live_sc_to_danmu_show_top_option_fullscreen" name="sc_live_sc_to_danmu_show_location_option_fullscreen" value="0" checked />
  6898. <label for="sc_live_sc_to_danmu_show_top_option_fullscreen">显示在顶部 / 底部(优先顶部)</label>
  6899.  
  6900. <input type="radio" id="sc_live_sc_to_danmu_show_middle_option_fullscreen" name="sc_live_sc_to_danmu_show_location_option_fullscreen" value="1" />
  6901. <label for="sc_live_sc_to_danmu_show_middle_option_fullscreen">显示在中间随机</label>
  6902.  
  6903. <input type="radio" id="sc_live_sc_to_danmu_show_bottom_option_fullscreen" name="sc_live_sc_to_danmu_show_location_option_fullscreen" value="2" />
  6904. <label for="sc_live_sc_to_danmu_show_bottom_option_fullscreen">显示在底部 / 顶部(优先底部)</label>
  6905. </div>
  6906. <br>
  6907. <br>
  6908. <label class="sc_model_div_label">高亮弹幕样式选择:</label>
  6909. <div class="sc_live_sc_to_danmu_show_radio_group_fullscreen">
  6910. <input type="radio" id="sc_live_sc_to_danmu_show_half_opaque_big_option_fullscreen" name="sc_live_sc_to_danmu_show_mode_option_fullscreen" value="0" checked />
  6911. <label for="sc_live_sc_to_danmu_show_half_opaque_big_option_fullscreen">半透明 [样式较大]</label>
  6912.  
  6913. <input type="radio" id="sc_live_sc_to_danmu_show_half_opaque_small_option_fullscreen" name="sc_live_sc_to_danmu_show_mode_option_fullscreen" value="1" />
  6914. <label for="sc_live_sc_to_danmu_show_half_opaque_small_option_fullscreen">半透明 [样式较小]</label>
  6915.  
  6916. <input type="radio" id="sc_live_sc_to_danmu_show_no_opaque_big_option_fullscreen" name="sc_live_sc_to_danmu_show_mode_option_fullscreen" value="2" />
  6917. <label for="sc_live_sc_to_danmu_show_no_opaque_big_option_fullscreen">不透明 [样式较大]</label>
  6918.  
  6919. <input type="radio" id="sc_live_sc_to_danmu_show_no_opaque_small_option_fullscreen" name="sc_live_sc_to_danmu_show_mode_option_fullscreen" value="3" />
  6920. <label for="sc_live_sc_to_danmu_show_no_opaque_small_option_fullscreen">不透明 [样式较小]</label>
  6921. </div>
  6922. <br>
  6923. <br>
  6924. <div>
  6925. <input type="checkbox" id="sc_live_sc_to_danmu_no_remain_checkbox_fullscreen" class="sc_live_sc_to_danmu_show_checkbox_inline"/>
  6926. <label for="sc_live_sc_to_danmu_no_remain_checkbox_fullscreen" class="sc_live_sc_to_danmu_show_checkbox_inline">SC的弹幕到达左侧后不再停留(默认停留10s,是为了看清SC内容,如果SC长度超过屏幕则自动不停留)</label>
  6927. </div>
  6928. </form>
  6929. <div class="sc_live_sc_to_danmu_show_btn_div_fullscreen">
  6930. <button id="sc_live_sc_to_danmu_show_cancel_btn" class="sc_live_sc_to_danmu_show_modal_btn sc_live_sc_to_danmu_show_modal_close_btn">取消</button>
  6931. <button id="sc_live_sc_to_danmu_show_confirm_btn_fullscreen" class="sc_live_sc_to_danmu_show_modal_btn sc_live_sc_to_danmu_show_modal_close_btn">确定</button>
  6932. </div>
  6933. </div>
  6934. `;
  6935.  
  6936. $(live_player_div).append(sc_live_sc_to_danmu_show_modal_html_fullscreen);
  6937.  
  6938. function sc_close_live_sc_to_danmu_show_modal() {
  6939. $(document).find('.sc_live_sc_to_danmu_show_config_modal').hide();
  6940. }
  6941.  
  6942. $(document).on('click', '.sc_live_sc_to_danmu_show_close, .sc_live_sc_to_danmu_show_modal_close_btn', function() {
  6943. sc_close_live_sc_to_danmu_show_modal();
  6944. });
  6945.  
  6946. $(document).on('click', '#sc_live_sc_to_danmu_show_confirm_btn', function(e) {
  6947.  
  6948. sc_live_sc_to_danmu_show_flag = $(document).find('#sc_live_sc_to_danmu_show_checkbox').is(':checked');
  6949. sc_live_sc_to_danmu_show_flag_config_store();
  6950.  
  6951. let sc_live_sc_to_danmu_show_location_select_val = $(document).find('.sc_live_sc_to_danmu_show_radio_group input[name="sc_live_sc_to_danmu_show_location_option"]:checked').val();
  6952. sc_live_sc_to_danmu_show_location = parseInt(sc_live_sc_to_danmu_show_location_select_val, 10);
  6953. sc_live_sc_to_danmu_show_location_config_store();
  6954.  
  6955. let sc_live_sc_to_danmu_show_mode_select_val = $(document).find('.sc_live_sc_to_danmu_show_radio_group input[name="sc_live_sc_to_danmu_show_mode_option"]:checked').val();
  6956. sc_live_sc_to_danmu_show_mode = parseInt(sc_live_sc_to_danmu_show_mode_select_val, 10);
  6957. sc_live_sc_to_danmu_show_mode_config_store();
  6958.  
  6959. sc_live_sc_to_danmu_no_remain_flag = $(document).find('#sc_live_sc_to_danmu_no_remain_checkbox').is(':checked');
  6960. sc_live_sc_to_danmu_no_remain_flag_config_store();
  6961.  
  6962. if (sc_live_sc_to_danmu_show_flag) {
  6963. let the_sds_sc_panel_fold_mode = sc_panel_fold_mode;
  6964. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  6965. the_sds_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  6966. }
  6967.  
  6968. if (sc_side_fold_custom_first_class && the_sds_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  6969. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  6970.  
  6971. if (sc_side_fold_custom_each_same_time_class && the_sds_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  6972. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  6973. } else {
  6974. sc_side_fold_custom_auto_run_flag = false;
  6975.  
  6976. sc_custom_config_apply(sc_side_fold_custom_first_class);
  6977. }
  6978.  
  6979. open_and_close_sc_modal('✓', '#A7C9D3', e);
  6980. });
  6981.  
  6982. $(document).on('click', '#sc_live_sc_to_danmu_show_confirm_btn_fullscreen', function(e) {
  6983.  
  6984. sc_live_sc_to_danmu_show_flag = $(document).find('#sc_live_sc_to_danmu_show_checkbox_fullscreen').is(':checked');
  6985. sc_live_sc_to_danmu_show_flag_config_store();
  6986.  
  6987. let sc_live_sc_to_danmu_show_location_select_val = $(document).find('.sc_live_sc_to_danmu_show_radio_group_fullscreen input[name="sc_live_sc_to_danmu_show_location_option_fullscreen"]:checked').val();
  6988. sc_live_sc_to_danmu_show_location = parseInt(sc_live_sc_to_danmu_show_location_select_val, 10);
  6989. sc_live_sc_to_danmu_show_location_config_store();
  6990.  
  6991. let sc_live_sc_to_danmu_show_mode_select_val = $(document).find('.sc_live_sc_to_danmu_show_radio_group_fullscreen input[name="sc_live_sc_to_danmu_show_mode_option_fullscreen"]:checked').val();
  6992. sc_live_sc_to_danmu_show_mode = parseInt(sc_live_sc_to_danmu_show_mode_select_val, 10);
  6993. sc_live_sc_to_danmu_show_mode_config_store();
  6994.  
  6995. sc_live_sc_to_danmu_no_remain_flag = $(document).find('#sc_live_sc_to_danmu_no_remain_checkbox_fullscreen').is(':checked');
  6996. sc_live_sc_to_danmu_no_remain_flag_config_store();
  6997.  
  6998. if (sc_live_sc_to_danmu_show_flag) {
  6999. let the_sds_sc_panel_fold_mode = sc_panel_fold_mode;
  7000. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  7001. the_sds_sc_panel_fold_mode = sc_panel_fold_mode_fullscreen;
  7002. }
  7003.  
  7004. if (sc_side_fold_custom_first_class && the_sds_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_first_class); }
  7005. if (sc_side_fold_custom_first_timeout_id) { clearTimeout(sc_side_fold_custom_first_timeout_id); }
  7006.  
  7007. if (sc_side_fold_custom_each_same_time_class && the_sds_sc_panel_fold_mode === 1) { sc_trigger_item_side_fold_in(sc_side_fold_custom_each_same_time_class); }
  7008. if (sc_side_fold_custom_each_same_time_timeout_id) { clearTimeout(sc_side_fold_custom_each_same_time_timeout_id); }
  7009. } else {
  7010. sc_side_fold_custom_auto_run_flag = false;
  7011.  
  7012. sc_custom_config_apply(sc_side_fold_custom_first_class);
  7013. }
  7014.  
  7015. open_and_close_sc_modal('✓', '#A7C9D3', e);
  7016. });
  7017.  
  7018.  
  7019.  
  7020. let sc_fullscreen_separate_memory_modal_style = document.createElement('style');
  7021. sc_fullscreen_separate_memory_modal_style.textContent = `
  7022. .sc_fullscreen_separate_memory_config_modal {
  7023. display: none;
  7024. position: fixed;
  7025. z-index: 3333;
  7026. left: 0;
  7027. top: 0;
  7028. width: 100%;
  7029. height: 100%;
  7030. overflow: auto;
  7031. background-color: rgba(0, 0, 0, 0.3);
  7032. }
  7033.  
  7034. .sc_fullscreen_separate_memory_modal_content {
  7035. background-color: #fefefe;
  7036. margin: 15% auto;
  7037. padding: 20px;
  7038. border: 1px solid #888;
  7039. width: 42%;
  7040. }
  7041.  
  7042. .sc_fullscreen_separate_memory_modal_content p {
  7043. color: #000;
  7044. }
  7045.  
  7046. .sc_modal_label_tip {
  7047. color: #000;
  7048. }
  7049.  
  7050. .sc_fullscreen_separate_memory_close {
  7051. color: #aaa;
  7052. float: right;
  7053. font-size: 28px;
  7054. font-weight: bold;
  7055. }
  7056.  
  7057. .sc_fullscreen_separate_memory_close:hover,
  7058. .sc_fullscreen_separate_memory_close:focus {
  7059. color: black;
  7060. text-decoration: none;
  7061. cursor: pointer;
  7062. }
  7063.  
  7064. .sc_fullscreen_separate_memory_btn_div {
  7065. margin-top: 30px;
  7066. }
  7067.  
  7068. .sc_fullscreen_separate_memory_btn_div_fullscreen {
  7069. margin-top: 30px;
  7070. }
  7071.  
  7072. .sc_fullscreen_separate_memory_checkbox_div{
  7073. text-align: center;
  7074. margin-top: 20px;
  7075. }
  7076.  
  7077. .sc_fullscreen_separate_memory_checkbox_inline {
  7078. vertical-align: middle;
  7079. display: inline-block;
  7080. color: #000;
  7081. }
  7082.  
  7083. #sc_fullscreen_separate_memory_form {
  7084. margin-top: 30px;
  7085. text-align: center;
  7086. }
  7087.  
  7088. #sc_fullscreen_separate_memory_form_fullscreen {
  7089. margin-top: 30px;
  7090. text-align: center;
  7091. }
  7092.  
  7093. #sc_fullscreen_separate_memory_confirm_btn {
  7094. float: right;
  7095. }
  7096.  
  7097. #sc_fullscreen_separate_memory_confirm_btn_fullscreen {
  7098. float: right;
  7099. }
  7100.  
  7101. .sc_fullscreen_separate_memory_modal_btn {
  7102. padding: 5px 20px;
  7103. }
  7104. `;
  7105.  
  7106. document.head.appendChild(sc_fullscreen_separate_memory_modal_style);
  7107.  
  7108. let sc_fullscreen_separate_memory_modal_html = document.createElement('div');
  7109. sc_fullscreen_separate_memory_modal_html.id = 'sc_fullscreen_separate_memory_config_div';
  7110. sc_fullscreen_separate_memory_modal_html.className = 'sc_fullscreen_separate_memory_config_modal';
  7111. sc_fullscreen_separate_memory_modal_html.innerHTML = `
  7112. <div class="sc_fullscreen_separate_memory_modal_content">
  7113. <span class="sc_fullscreen_separate_memory_close">&times;</span>
  7114. <p>一些设置在全屏时分开记忆:</p>
  7115. <form id="sc_fullscreen_separate_memory_form">
  7116. <div class="sc_fullscreen_separate_memory_checkbox_div">
  7117. <input type="checkbox" id="sc_some_fullscreen_separate_memory" class="sc_fullscreen_separate_memory_checkbox_inline"/>
  7118. <label for="sc_some_fullscreen_separate_memory" class="sc_fullscreen_separate_memory_checkbox_inline">全屏状态下一些配置分开单独记忆</label>
  7119. </div>
  7120. <div class="sc_modal_label_tip" style="padding: 10px 0px 10px 0px;">(宽高、主题、模式、位置、数据)</div>
  7121. </form>
  7122. <div class="sc_fullscreen_separate_memory_btn_div">
  7123. <button id="sc_fullscreen_separate_memory_cancel_btn" class="sc_fullscreen_separate_memory_modal_btn sc_fullscreen_separate_memory_modal_close_btn">取消</button>
  7124. <button id="sc_fullscreen_separate_memory_confirm_btn" class="sc_fullscreen_separate_memory_modal_btn sc_fullscreen_separate_memory_modal_close_btn">确定</button>
  7125. </div>
  7126. </div>
  7127. `;
  7128.  
  7129. document.body.appendChild(sc_fullscreen_separate_memory_modal_html);
  7130.  
  7131. let sc_fullscreen_separate_memory_modal_html_fullscreen = document.createElement('div');
  7132. sc_fullscreen_separate_memory_modal_html_fullscreen.id = 'sc_fullscreen_separate_memory_config_div_fullscreen';
  7133. sc_fullscreen_separate_memory_modal_html_fullscreen.className = 'sc_fullscreen_separate_memory_config_modal';
  7134. sc_fullscreen_separate_memory_modal_html_fullscreen.innerHTML = `
  7135. <div class="sc_fullscreen_separate_memory_modal_content">
  7136. <span class="sc_fullscreen_separate_memory_close">&times;</span>
  7137. <p>一些设置在全屏时分开记忆:</p>
  7138. <form id="sc_fullscreen_separate_memory_form_fullscreen">
  7139. <div class="sc_fullscreen_separate_memory_checkbox_div">
  7140. <input type="checkbox" id="sc_some_fullscreen_separate_memory_fullscreen" class="sc_fullscreen_separate_memory_checkbox_inline"/>
  7141. <label for="sc_some_fullscreen_separate_memory_fullscreen" class="sc_fullscreen_separate_memory_checkbox_inline">全屏状态下一些配置分开单独记忆</label>
  7142. </div>
  7143. <div class="sc_modal_label_tip" style="padding: 10px 0px 10px 0px;">(宽高、主题、模式、位置、数据)</div>
  7144. </form>
  7145. <div class="sc_fullscreen_separate_memory_btn_div_fullscreen">
  7146. <button id="sc_fullscreen_separate_memory_cancel_btn" class="sc_fullscreen_separate_memory_modal_btn sc_fullscreen_separate_memory_modal_close_btn">取消</button>
  7147. <button id="sc_fullscreen_separate_memory_confirm_btn_fullscreen" class="sc_fullscreen_separate_memory_modal_btn sc_fullscreen_separate_memory_modal_close_btn">确定</button>
  7148. </div>
  7149. </div>
  7150. `;
  7151.  
  7152. $(live_player_div).append(sc_fullscreen_separate_memory_modal_html_fullscreen);
  7153.  
  7154. function sc_close_fullscreen_separate_memory_modal() {
  7155. $(document).find('.sc_fullscreen_separate_memory_config_modal').hide();
  7156. }
  7157.  
  7158. $(document).on('click', '.sc_fullscreen_separate_memory_close, .sc_fullscreen_separate_memory_modal_close_btn', function() {
  7159. sc_close_fullscreen_separate_memory_modal();
  7160. });
  7161.  
  7162. $(document).on('click', '#sc_fullscreen_separate_memory_confirm_btn', function(e) {
  7163. let old_fullscreen_config_separate_memory_flag = sc_live_fullscreen_config_separate_memory_flag;
  7164. sc_live_fullscreen_config_separate_memory_flag = $(document).find('#sc_some_fullscreen_separate_memory').is(':checked');
  7165.  
  7166. if (sc_live_fullscreen_config_separate_memory_flag && !old_fullscreen_config_separate_memory_flag) {
  7167. sc_fullscreen_separate_memory_var_copy();
  7168. }
  7169.  
  7170. sc_live_fullscreen_config_all_store();
  7171.  
  7172. open_and_close_sc_modal('✓', '#A7C9D3', e);
  7173. });
  7174.  
  7175. $(document).on('click', '#sc_fullscreen_separate_memory_confirm_btn_fullscreen', function(e) {
  7176. let old_fullscreen_config_separate_memory_flag = sc_live_fullscreen_config_separate_memory_flag;
  7177. sc_live_fullscreen_config_separate_memory_flag = $(document).find('#sc_some_fullscreen_separate_memory_fullscreen').is(':checked');
  7178.  
  7179. if (sc_live_fullscreen_config_separate_memory_flag && !old_fullscreen_config_separate_memory_flag) {
  7180. sc_fullscreen_separate_memory_var_copy();
  7181. }
  7182.  
  7183. sc_live_fullscreen_config_all_store();
  7184.  
  7185. open_and_close_sc_modal('✓', '#A7C9D3', e);
  7186. });
  7187.  
  7188. let sc_live_special_tip_modal_style = document.createElement('style');
  7189. sc_live_special_tip_modal_style.textContent = `
  7190. .sc_live_special_tip_config_modal {
  7191. display: none;
  7192. position: fixed;
  7193. z-index: 3333;
  7194. left: 0;
  7195. top: 0;
  7196. width: 100%;
  7197. height: 100%;
  7198. overflow: auto;
  7199. background-color: rgba(0, 0, 0, 0.3);
  7200. }
  7201.  
  7202. .sc_live_special_tip_modal_content {
  7203. background-color: #fefefe;
  7204. margin: 15% auto;
  7205. padding: 20px;
  7206. border: 1px solid #888;
  7207. width: 45%;
  7208. }
  7209.  
  7210. .sc_live_special_tip_modal_content p {
  7211. color: #000;
  7212. }
  7213.  
  7214. .sc_modal_label_tip {
  7215. color: #000;
  7216. }
  7217.  
  7218. .sc_live_special_tip_close {
  7219. color: #aaa;
  7220. float: right;
  7221. font-size: 28px;
  7222. font-weight: bold;
  7223. }
  7224.  
  7225. .sc_live_special_tip_close:hover,
  7226. .sc_live_special_tip_close:focus {
  7227. color: black;
  7228. text-decoration: none;
  7229. cursor: pointer;
  7230. }
  7231.  
  7232. .sc_live_special_tip_radio_group {
  7233. display: inline-flex;
  7234. text-align: center;
  7235. color: #000;
  7236. margin-top: 10px;
  7237. margin-bottom: 10px;
  7238. }
  7239. .sc_live_special_tip_radio_group input[type="radio"] {
  7240. margin-right: 10px;
  7241. }
  7242.  
  7243. .sc_live_special_tip_radio_group label {
  7244. margin-right: 30px;
  7245. }
  7246.  
  7247. .sc_live_special_tip_radio_group_fullscreen {
  7248. display: inline-flex;
  7249. text-align: center;
  7250. color: #000;
  7251. }
  7252. .sc_live_special_tip_radio_group_fullscreen input[type="radio"] {
  7253. margin-right: 10px;
  7254. }
  7255.  
  7256. .sc_live_special_tip_radio_group_fullscreen label {
  7257. margin-right: 30px;
  7258. }
  7259.  
  7260. .sc_live_special_tip_btn_div {
  7261. margin-top: 30px;
  7262. }
  7263.  
  7264. .sc_live_special_tip_btn_div_fullscreen {
  7265. margin-top: 30px;
  7266. }
  7267.  
  7268. #sc_live_special_tip_confirm_btn {
  7269. float: right;
  7270. }
  7271.  
  7272. #sc_live_special_tip_confirm_btn_fullscreen {
  7273. float: right;
  7274. }
  7275.  
  7276. .sc_live_special_tip_modal_btn {
  7277. padding: 3px 10px;
  7278. }
  7279.  
  7280. #sc_live_special_tip_form {
  7281. text-align: center;
  7282. }
  7283. #sc_live_special_tip_form_fullscreen {
  7284. margin-top: 20px;
  7285. text-align: center;
  7286. }
  7287. .sc_live_special_msg_checkbox_inline {
  7288. vertical-align: middle;
  7289. display: inline-block;
  7290. color: #000;
  7291. }
  7292. .sc_model_div_label {
  7293. color: #000;
  7294. }
  7295. `;
  7296.  
  7297. document.head.appendChild(sc_live_special_tip_modal_style);
  7298.  
  7299. let sc_live_special_tip_modal_html = document.createElement('div');
  7300. sc_live_special_tip_modal_html.id = 'sc_live_special_tip_config_div';
  7301. sc_live_special_tip_modal_html.className = 'sc_live_special_tip_config_modal';
  7302. sc_live_special_tip_modal_html.innerHTML = `
  7303. <div class="sc_live_special_tip_modal_content">
  7304. <span class="sc_live_special_tip_close">&times;</span>
  7305. <p>对特定用户进入直播间提示(基于数据包解析,活动页面若没数据包会失效)(本窗口所有功能都需要用户登录):</p>
  7306. <form id="sc_live_special_tip_form">
  7307. <div class="sc_live_special_tip_radio_group">
  7308. <input type="radio" id="sc_live_special_tip_top_option" name="sc_live_special_tip_option" value="0" checked />
  7309. <label for="sc_live_special_tip_top_option">显示在顶部 / 底部(优先顶部)</label>
  7310.  
  7311. <input type="radio" id="sc_live_special_tip_middle_option" name="sc_live_special_tip_option" value="1" />
  7312. <label for="sc_live_special_tip_middle_option">显示在中间随机</label>
  7313.  
  7314. <input type="radio" id="sc_live_special_tip_bottom_option" name="sc_live_special_tip_option" value="2" />
  7315. <label for="sc_live_special_tip_bottom_option">显示在底部 / 顶部(优先底部)</label>
  7316. </div>
  7317. <div class="sc_live_special_tip_textarea_div">
  7318. <div class="sc_modal_label_tip" style="padding: 10px 0px 10px 0px;">规则:用户id,用户id-备注(逗号,以及横杠,逗号后可换行,不加备注就只显示用户名)</div>
  7319. <textarea id="sc_live_special_tip_textarea_content" style="min-width: 60%; min-height: 100px; max-width: 90%; max-height: 160px;" placeholder="示例:111111,222222,333333,444444-小张"></textarea>
  7320. </div>
  7321. <br>
  7322. <label class="sc_model_div_label">高亮弹幕样式选择:</label>
  7323. <div class="sc_live_special_tip_radio_group">
  7324. <input type="radio" id="sc_live_special_danmu_half_opaque_big_option" name="sc_live_special_danmu_mode_option" value="0" checked />
  7325. <label for="sc_live_special_danmu_half_opaque_big_option">半透明 [样式较大]</label>
  7326.  
  7327. <input type="radio" id="sc_live_special_danmu_half_opaque_small_option" name="sc_live_special_danmu_mode_option" value="1" />
  7328. <label for="sc_live_special_danmu_half_opaque_small_option">半透明 [样式较小]</label>
  7329.  
  7330. <input type="radio" id="sc_live_special_danmu_no_opaque_big_option" name="sc_live_special_danmu_mode_option" value="2" />
  7331. <label for="sc_live_special_danmu_no_opaque_big_option">不透明 [样式较大]</label>
  7332.  
  7333. <input type="radio" id="sc_live_special_danmu_no_opaque_small_option" name="sc_live_special_danmu_mode_option" value="3" />
  7334. <label for="sc_live_special_danmu_no_opaque_small_option">不透明 [样式较小]</label>
  7335. </div>
  7336. <div>
  7337. <input type="checkbox" id="sc_live_special_msg_checkbox" class="sc_live_special_msg_checkbox_inline"/>
  7338. <label for="sc_live_special_msg_checkbox" class="sc_live_special_msg_checkbox_inline">相应用户的弹幕高亮</label>
  7339. </div>
  7340. <br>
  7341. <div>
  7342. <input type="checkbox" id="sc_live_special_sc_checkbox" class="sc_live_special_msg_checkbox_inline"/>
  7343. <label for="sc_live_special_sc_checkbox" class="sc_live_special_msg_checkbox_inline">相应用户的SC以高亮弹幕出现(记录板还是会显示)</label>
  7344. </div>
  7345. <br>
  7346. <div>
  7347. <input type="checkbox" id="sc_live_special_sc_no_remain_checkbox" class="sc_live_special_msg_checkbox_inline"/>
  7348. <label for="sc_live_special_sc_no_remain_checkbox" class="sc_live_special_msg_checkbox_inline">SC的弹幕到达左侧后不再停留(默认停留10s,是为了看清SC内容,如果SC长度超过屏幕则自动不停留)</label>
  7349. </div>
  7350. </form>
  7351. <div class="sc_live_special_tip_btn_div">
  7352. <button id="sc_live_special_tip_cancel_btn" class="sc_live_special_tip_modal_btn sc_live_special_tip_modal_close_btn">取消</button>
  7353. <button id="sc_live_special_tip_confirm_btn" class="sc_live_special_tip_modal_btn sc_live_special_tip_modal_close_btn">确定</button>
  7354. </div>
  7355. </div>
  7356. `;
  7357.  
  7358. document.body.appendChild(sc_live_special_tip_modal_html);
  7359.  
  7360. let sc_live_special_tip_modal_html_fullscreen = document.createElement('div');
  7361. sc_live_special_tip_modal_html_fullscreen.id = 'sc_live_special_tip_config_div_fullscreen';
  7362. sc_live_special_tip_modal_html_fullscreen.className = 'sc_live_special_tip_config_modal';
  7363. sc_live_special_tip_modal_html_fullscreen.innerHTML = `
  7364. <div class="sc_live_special_tip_modal_content">
  7365. <span class="sc_live_special_tip_close">&times;</span>
  7366. <p>对特定用户进入直播间提示(基于数据包解析,活动页面若没数据包会失效)(本窗口所有功能都需要用户登录):</p>
  7367. <form id="sc_live_special_tip_form_fullscreen">
  7368. <div class="sc_live_special_tip_radio_group_fullscreen">
  7369. <input type="radio" id="sc_live_special_tip_top_option_fullscreen" name="sc_live_special_tip_option_fullscreen" value="0" checked />
  7370. <label for="sc_live_special_tip_top_option_fullscreen">显示在顶部 / 底部(优先顶部)</label>
  7371.  
  7372. <input type="radio" id="sc_live_special_tip_middle_option_fullscreen" name="sc_live_special_tip_option_fullscreen" value="1" />
  7373. <label for="sc_live_special_tip_middle_option_fullscreen">显示在中间随机</label>
  7374.  
  7375. <input type="radio" id="sc_live_special_tip_bottom_option_fullscreen" name="sc_live_special_tip_option_fullscreen" value="2" />
  7376. <label for="sc_live_special_tip_bottom_option_fullscreen">显示在底部 / 顶部(优先底部)</label>
  7377. </div>
  7378. <div class="sc_live_special_tip_textarea_div">
  7379. <div class="sc_modal_label_tip" style="padding: 10px 0px 10px 0px;">规则:用户id,用户id-备注(逗号,以及横杠,逗号后可换行,不加备注就只显示用户名)</div>
  7380. <textarea id="sc_live_special_tip_textarea_content_fullscreen" style="min-width: 60%; min-height: 100px; max-width: 90%; max-height: 160px;" placeholder="示例:111111,222222,333333,444444-小张"></textarea>
  7381. </div>
  7382. <br>
  7383. <label class="sc_model_div_label">高亮弹幕样式选择:</label>
  7384. <div class="sc_live_special_tip_radio_group_fullscreen">
  7385. <input type="radio" id="sc_live_special_danmu_half_opaque_big_option_fullscreen" name="sc_live_special_danmu_mode_option_fullscreen" value="0" checked />
  7386. <label for="sc_live_special_danmu_half_opaque_big_option_fullscreen">半透明 [样式较大]</label>
  7387.  
  7388. <input type="radio" id="sc_live_special_danmu_half_opaque_small_option_fullscreen" name="sc_live_special_danmu_mode_option_fullscreen" value="1" />
  7389. <label for="sc_live_special_danmu_half_opaque_small_option_fullscreen">半透明 [样式较小]</label>
  7390.  
  7391. <input type="radio" id="sc_live_special_danmu_no_opaque_big_option_fullscreen" name="sc_live_special_danmu_mode_option_fullscreen" value="2" />
  7392. <label for="sc_live_special_danmu_no_opaque_big_option_fullscreen">不透明 [样式较大]</label>
  7393.  
  7394. <input type="radio" id="sc_live_special_danmu_no_opaque_small_option_fullscreen" name="sc_live_special_danmu_mode_option_fullscreen" value="3" />
  7395. <label for="sc_live_special_danmu_no_opaque_small_option_fullscreen">不透明 [样式较小]</label>
  7396. </div>
  7397. <div>
  7398. <input type="checkbox" id="sc_live_special_msg_checkbox_fullscreen" class="sc_live_special_msg_checkbox_inline"/>
  7399. <label for="sc_live_special_msg_checkbox_fullscreen" class="sc_live_special_msg_checkbox_inline">相应用户的弹幕高亮</label>
  7400. </div>
  7401. <br>
  7402. <div>
  7403. <input type="checkbox" id="sc_live_special_sc_checkbox_fullscreen" class="sc_live_special_msg_checkbox_inline"/>
  7404. <label for="sc_live_special_sc_checkbox_fullscreen" class="sc_live_special_msg_checkbox_inline">相应用户的SC以高亮弹幕出现(记录板还是会显示)</label>
  7405. </div>
  7406. <br>
  7407. <div>
  7408. <input type="checkbox" id="sc_live_special_sc_no_remain_checkbox_fullscreen" class="sc_live_special_msg_checkbox_inline"/>
  7409. <label for="sc_live_special_sc_no_remain_checkbox_fullscreen" class="sc_live_special_msg_checkbox_inline">SC的弹幕到达左侧后不再停留(默认停留10s,是为了看清SC内容,如果SC长度超过屏幕则自动不停留)</label>
  7410. </div>
  7411. </form>
  7412. <div class="sc_live_special_tip_btn_div_fullscreen">
  7413. <button id="sc_live_special_tip_cancel_btn" class="sc_live_special_tip_modal_btn sc_live_special_tip_modal_close_btn">取消</button>
  7414. <button id="sc_live_special_tip_confirm_btn_fullscreen" class="sc_live_special_tip_modal_btn sc_live_special_tip_modal_close_btn">确定</button>
  7415. </div>
  7416. </div>
  7417. `;
  7418.  
  7419. $(live_player_div).append(sc_live_special_tip_modal_html_fullscreen);
  7420.  
  7421. function sc_close_live_special_tip_modal() {
  7422. $(document).find('.sc_live_special_tip_config_modal').hide();
  7423. }
  7424.  
  7425. $(document).on('click', '.sc_live_special_tip_close, .sc_live_special_tip_modal_close_btn', function() {
  7426. sc_close_live_special_tip_modal();
  7427. });
  7428.  
  7429. $(document).on('click', '#sc_live_special_tip_confirm_btn', function(e) {
  7430.  
  7431. let sc_live_special_tip_select_val = $(document).find('.sc_live_special_tip_radio_group input[name="sc_live_special_tip_option"]:checked').val();
  7432. sc_live_special_tip_location = parseInt(sc_live_special_tip_select_val, 10);
  7433. sc_live_special_tip_location_store();
  7434.  
  7435. sc_live_special_tip_str = $(document).find('#sc_live_special_tip_textarea_content').val().replace(/ /g, '');
  7436. sc_live_special_tip_str = sc_live_special_tip_str.replace(/,/g, ',');
  7437. sc_live_special_tip_str_store();
  7438.  
  7439. sc_live_special_tip_str_to_arr();
  7440.  
  7441. let sc_live_special_danmu_mode_select_val = $(document).find('.sc_live_special_tip_radio_group input[name="sc_live_special_danmu_mode_option"]:checked').val();
  7442. sc_live_special_danmu_mode = parseInt(sc_live_special_danmu_mode_select_val, 10);
  7443. sc_live_special_danmu_mode_config_store();
  7444.  
  7445. sc_live_special_msg_flag = $(document).find('#sc_live_special_msg_checkbox').is(':checked');
  7446.  
  7447. sc_live_special_msg_flag_config_store();
  7448.  
  7449. sc_live_special_sc_flag = $(document).find('#sc_live_special_sc_checkbox').is(':checked');
  7450.  
  7451. sc_live_special_sc_flag_config_store();
  7452.  
  7453. sc_live_special_sc_no_remain_flag = $(document).find('#sc_live_special_sc_no_remain_checkbox').is(':checked');
  7454.  
  7455. sc_live_special_sc_no_remain_flag_config_store();
  7456.  
  7457. open_and_close_sc_modal('✓', '#A7C9D3', e);
  7458. });
  7459.  
  7460. $(document).on('click', '#sc_live_special_tip_confirm_btn_fullscreen', function(e) {
  7461.  
  7462. let sc_live_special_tip_select_val = $(document).find('.sc_live_special_tip_radio_group_fullscreen input[name="sc_live_special_tip_option_fullscreen"]:checked').val();
  7463. sc_live_special_tip_location = parseInt(sc_live_special_tip_select_val, 10);
  7464. sc_live_special_tip_location_store();
  7465.  
  7466. sc_live_special_tip_str = $(document).find('#sc_live_special_tip_textarea_content_fullscreen').val().replace(/ /g, '');
  7467. sc_live_special_tip_str = sc_live_special_tip_str.replace(/,/g, ',');
  7468. sc_live_special_tip_str_store();
  7469.  
  7470. sc_live_special_tip_str_to_arr();
  7471.  
  7472. let sc_live_special_danmu_mode_select_val = $(document).find('.sc_live_special_tip_radio_group_fullscreen input[name="sc_live_special_danmu_mode_option_fullscreen"]:checked').val();
  7473. sc_live_special_danmu_mode = parseInt(sc_live_special_danmu_mode_select_val, 10);
  7474. sc_live_special_danmu_mode_config_store();
  7475.  
  7476. sc_live_special_msg_flag = $(document).find('#sc_live_special_msg_checkbox_fullscreen').is(':checked');
  7477.  
  7478. sc_live_special_msg_flag_config_store();
  7479.  
  7480. sc_live_special_sc_flag = $(document).find('#sc_live_special_sc_checkbox_fullscreen').is(':checked');
  7481.  
  7482. sc_live_special_sc_flag_config_store();
  7483.  
  7484. sc_live_special_sc_no_remain_flag = $(document).find('#sc_live_special_sc_no_remain_checkbox_fullscreen').is(':checked');
  7485.  
  7486. sc_live_special_sc_no_remain_flag_config_store();
  7487.  
  7488. open_and_close_sc_modal('✓', '#A7C9D3', e);
  7489. });
  7490.  
  7491. let sc_live_other_modal_style = document.createElement('style');
  7492. sc_live_other_modal_style.textContent = `
  7493. .sc_live_other_config_modal {
  7494. display: none;
  7495. position: fixed;
  7496. z-index: 3333;
  7497. left: 0;
  7498. top: 0;
  7499. width: 100%;
  7500. height: 100%;
  7501. overflow: auto;
  7502. background-color: rgba(0, 0, 0, 0.3);
  7503. }
  7504.  
  7505. .sc_live_other_modal_content {
  7506. background-color: #fefefe;
  7507. margin: 15% auto;
  7508. padding: 20px;
  7509. border: 1px solid #888;
  7510. width: 42%;
  7511. }
  7512.  
  7513. .sc_live_other_modal_content p {
  7514. color: #000;
  7515. }
  7516.  
  7517. .sc_live_other_close {
  7518. color: #aaa;
  7519. float: right;
  7520. font-size: 28px;
  7521. font-weight: bold;
  7522. }
  7523.  
  7524. .sc_live_other_close:hover,
  7525. .sc_live_other_close:focus {
  7526. color: black;
  7527. text-decoration: none;
  7528. cursor: pointer;
  7529. }
  7530.  
  7531. .sc_live_other_radio_group {
  7532. display: inline-flex;
  7533. color: #000;
  7534. }
  7535.  
  7536. .sc_live_other_radio_group_fullscreen {
  7537. display: inline-flex;
  7538. color: #000;
  7539. }
  7540.  
  7541. .sc_live_other_radio_group label {
  7542. padding-right: 80px;
  7543. padding-left: 10px;
  7544. }
  7545.  
  7546. .sc_live_other_radio_group_fullscreen label {
  7547. padding-right: 80px;
  7548. padding-left: 10px;
  7549. }
  7550.  
  7551. .sc_live_other_btn_div {
  7552. margin-top: 30px;
  7553. }
  7554.  
  7555. .sc_live_other_btn_div_fullscreen {
  7556. margin-top: 30px;
  7557. }
  7558.  
  7559. .sc_live_other_checkbox_div{
  7560. text-align: center;
  7561. margin-top: 20px;
  7562. }
  7563.  
  7564. .sc_live_other_checkbox_inline {
  7565. vertical-align: middle;
  7566. display: inline-block;
  7567. color: #000;
  7568. }
  7569.  
  7570. #sc_live_other_form {
  7571. margin-top: 30px;
  7572. text-align: center;
  7573. }
  7574.  
  7575. #sc_live_other_form_fullscreen {
  7576. margin-top: 30px;
  7577. text-align: center;
  7578. }
  7579.  
  7580. #sc_live_other_confirm_btn {
  7581. float: right;
  7582. }
  7583.  
  7584. #sc_live_other_confirm_btn_fullscreen {
  7585. float: right;
  7586. }
  7587.  
  7588. .sc_live_other_modal_btn {
  7589. padding: 5px 20px;
  7590. }
  7591. `;
  7592.  
  7593. document.head.appendChild(sc_live_other_modal_style);
  7594.  
  7595. let sc_live_other_modal_html = document.createElement('div');
  7596. sc_live_other_modal_html.id = 'sc_live_other_config_div';
  7597. sc_live_other_modal_html.className = 'sc_live_other_config_modal';
  7598. sc_live_other_modal_html.innerHTML = `
  7599. <div class="sc_live_other_modal_content">
  7600. <span class="sc_live_other_close">&times;</span>
  7601. <p>其他一些功能的自定义设置:</p>
  7602. <form id="sc_live_other_form">
  7603. <div class="sc_live_other_radio_group">
  7604. <input type="radio" id="sc_live_other_default_option" name="sc_live_other_option" value="1" checked />
  7605. <label for="sc_live_other_default_option">数据模块显示 [同接]</label>
  7606.  
  7607. <input type="radio" id="sc_live_other_open_option" name="sc_live_other_option" value="0" />
  7608. <label for="sc_live_other_open_option">数据模块显示 [高能]</label>
  7609. </div>
  7610. <div class="sc_live_other_checkbox_div">
  7611. <input type="checkbox" id="sc_live_other_fullscreen_auto_hide_list" class="sc_live_other_checkbox_inline"/>
  7612. <label for="sc_live_other_fullscreen_auto_hide_list" class="sc_live_other_checkbox_inline">侧折模式下,切换全屏时,自动隐藏醒目留言列表</label>
  7613. </div>
  7614. <div class="sc_live_other_checkbox_div">
  7615. <input type="checkbox" id="sc_live_other_start_time_simple_flag" class="sc_live_other_checkbox_inline"/>
  7616. <label for="sc_live_other_start_time_simple_flag" class="sc_live_other_checkbox_inline">设置SC发送的时间显示为简单的时分</label>
  7617. </div>
  7618. <div class="sc_live_other_checkbox_div">
  7619. <input type="checkbox" id="sc_live_other_search_shortkey_flag" class="sc_live_other_checkbox_inline" checked/>
  7620. <label for="sc_live_other_search_shortkey_flag" class="sc_live_other_checkbox_inline">设置SC搜索快捷键[ 开启/关闭:ctrl + f ][ 上一个:ctrl + 方向左/上 ][ 下一个:ctrl + 方向右/下 ]</label>
  7621. </div>
  7622. <div class="sc_live_other_checkbox_div">
  7623. <input type="checkbox" id="sc_live_other_auto_tianxuan_flag" class="sc_live_other_checkbox_inline" />
  7624. <label for="sc_live_other_auto_tianxuan_flag" class="sc_live_other_checkbox_inline">开启自动点击天选(当前直播间,并且已经关注主播)</label>
  7625. </div>
  7626. <div class="sc_live_other_checkbox_div">
  7627. <input type="checkbox" id="sc_live_other_auto_dm_combo_flag" class="sc_live_other_checkbox_inline" />
  7628. <label for="sc_live_other_auto_dm_combo_flag" class="sc_live_other_checkbox_inline">开启跟风发送combo弹幕(当前直播间,并且已经关注主播)</label>
  7629. </div>
  7630. </form>
  7631. <div class="sc_live_other_btn_div">
  7632. <button id="sc_live_other_cancel_btn" class="sc_live_other_modal_btn sc_live_other_modal_close_btn">取消</button>
  7633. <button id="sc_live_other_confirm_btn" class="sc_live_other_modal_btn sc_live_other_modal_close_btn">确定</button>
  7634. </div>
  7635. </div>
  7636. `;
  7637.  
  7638. document.body.appendChild(sc_live_other_modal_html);
  7639.  
  7640. let sc_live_other_modal_html_fullscreen = document.createElement('div');
  7641. sc_live_other_modal_html_fullscreen.id = 'sc_live_other_config_div_fullscreen';
  7642. sc_live_other_modal_html_fullscreen.className = 'sc_live_other_config_modal';
  7643. sc_live_other_modal_html_fullscreen.innerHTML = `
  7644. <div class="sc_live_other_modal_content">
  7645. <span class="sc_live_other_close">&times;</span>
  7646. <p>其他一些功能的自定义设置:</p>
  7647. <form id="sc_live_other_form_fullscreen">
  7648. <div class="sc_live_other_radio_group_fullscreen">
  7649. <input type="radio" id="sc_live_other_default_option_fullscreen" name="sc_live_other_option_fullscreen" value="1" checked />
  7650. <label for="sc_live_other_default_option_fullscreen">数据模块显示 [同接]</label>
  7651.  
  7652. <input type="radio" id="sc_live_other_open_option_fullscreen" name="sc_live_other_option_fullscreen" value="0" />
  7653. <label for="sc_live_other_open_option_fullscreen">数据模块显示 [高能]</label>
  7654. </div>
  7655. <div class="sc_live_other_checkbox_div">
  7656. <input type="checkbox" id="sc_live_other_fullscreen_auto_hide_list_fullscreen" class="sc_live_other_checkbox_inline"/>
  7657. <label for="sc_live_other_fullscreen_auto_hide_list_fullscreen" class="sc_live_other_checkbox_inline">侧折模式下,切换全屏时,自动隐藏醒目留言列表</label>
  7658. </div>
  7659. <div class="sc_live_other_checkbox_div">
  7660. <input type="checkbox" id="sc_live_other_start_time_simple_flag_fullscreen" class="sc_live_other_checkbox_inline"/>
  7661. <label for="sc_live_other_start_time_simple_flag_fullscreen" class="sc_live_other_checkbox_inline">设置SC发送的时间显示为简单的时分</label>
  7662. </div>
  7663. <div class="sc_live_other_checkbox_div">
  7664. <input type="checkbox" id="sc_live_other_search_shortkey_flag_fullscreen" class="sc_live_other_checkbox_inline" checked/>
  7665. <label for="sc_live_other_search_shortkey_flag_fullscreen" class="sc_live_other_checkbox_inline">设置SC搜索快捷键[ 开启/关闭:ctrl + f ][ 上一个:ctrl + 方向左/上 ][ 下一个:ctrl + 方向右/下 ]</label>
  7666. </div>
  7667. <div class="sc_live_other_checkbox_div">
  7668. <input type="checkbox" id="sc_live_other_auto_tianxuan_flag_fullscreen" class="sc_live_other_checkbox_inline" />
  7669. <label for="sc_live_other_auto_tianxuan_flag_fullscreen" class="sc_live_other_checkbox_inline">开启自动点击天选(当前直播间,并且已经关注主播)</label>
  7670. </div>
  7671. <div class="sc_live_other_checkbox_div">
  7672. <input type="checkbox" id="sc_live_other_auto_dm_combo_flag_fullscreen" class="sc_live_other_checkbox_inline" />
  7673. <label for="sc_live_other_auto_dm_combo_flag_fullscreen" class="sc_live_other_checkbox_inline">开启跟风发送combo弹幕(当前直播间,并且已经关注主播)</label>
  7674. </div>
  7675. </form>
  7676. <div class="sc_live_other_btn_div_fullscreen">
  7677. <button id="sc_live_other_cancel_btn" class="sc_live_other_modal_btn sc_live_other_modal_close_btn">取消</button>
  7678. <button id="sc_live_other_confirm_btn_fullscreen" class="sc_live_other_modal_btn sc_live_other_modal_close_btn">确定</button>
  7679. </div>
  7680. </div>
  7681. `;
  7682.  
  7683. $(live_player_div).append(sc_live_other_modal_html_fullscreen);
  7684.  
  7685. function sc_close_live_other_modal() {
  7686. $(document).find('.sc_live_other_config_modal').hide();
  7687. }
  7688.  
  7689. $(document).on('click', '.sc_live_other_close, .sc_live_other_modal_close_btn', function() {
  7690. sc_close_live_other_modal();
  7691. });
  7692.  
  7693. $(document).on('click', '#sc_live_other_confirm_btn', function(e) {
  7694.  
  7695. let sc_live_other_select_val = $(document).find('.sc_live_other_radio_group input[name="sc_live_other_option"]:checked').val();
  7696. if (sc_live_other_select_val === '0') {
  7697. sc_live_data_show_high_energy_num_flag_change(true);
  7698. } else if (sc_live_other_select_val === '1') {
  7699. sc_live_data_show_high_energy_num_flag_change(false);
  7700. }
  7701.  
  7702. sc_side_fold_fullscreen_auto_hide_list_flag = $(document).find('#sc_live_other_fullscreen_auto_hide_list').is(':checked');
  7703.  
  7704. sc_live_other_config_store();
  7705.  
  7706. sc_start_time_simple_flag = $(document).find('#sc_live_other_start_time_simple_flag').is(':checked');
  7707.  
  7708. sc_start_time_simple_store();
  7709.  
  7710. if (sc_start_time_simple_flag) {
  7711. $(document).find('.sc_start_time_all_span').hide();
  7712. $(document).find('.sc_start_time_simple_span').show();
  7713. } else {
  7714. $(document).find('.sc_start_time_all_span').show();
  7715. $(document).find('.sc_start_time_simple_span').hide();
  7716. }
  7717.  
  7718. sc_list_search_shortkey_flag = $(document).find('#sc_live_other_search_shortkey_flag').is(':checked');
  7719.  
  7720. sc_search_shortkey_flag_config_store();
  7721.  
  7722. sc_search_shortkey_flag_config_apply();
  7723.  
  7724. sc_live_auto_tianxuan_flag = $(document).find('#sc_live_other_auto_tianxuan_flag').is(':checked');
  7725.  
  7726. sc_live_auto_tianxuan_flag_config_store();
  7727.  
  7728. sc_live_send_dm_combo_flag = $(document).find('#sc_live_other_auto_dm_combo_flag').is(':checked');
  7729.  
  7730. sc_live_send_dm_combo_flag_config_store();
  7731.  
  7732. sc_live_other_config_data_show_apply();
  7733.  
  7734. open_and_close_sc_modal('✓', '#A7C9D3', e);
  7735. });
  7736.  
  7737. $(document).on('click', '#sc_live_other_confirm_btn_fullscreen', function(e) {
  7738.  
  7739. let sc_live_other_select_val = $(document).find('.sc_live_other_radio_group_fullscreen input[name="sc_live_other_option_fullscreen"]:checked').val();
  7740. if (sc_live_other_select_val === '0') {
  7741. sc_live_data_show_high_energy_num_flag_change(true);
  7742. } else if (sc_live_other_select_val === '1') {
  7743. sc_live_data_show_high_energy_num_flag_change(false);
  7744. }
  7745.  
  7746. sc_side_fold_fullscreen_auto_hide_list_flag = $(document).find('#sc_live_other_fullscreen_auto_hide_list_fullscreen').is(':checked');
  7747.  
  7748. sc_live_other_config_store();
  7749.  
  7750. sc_start_time_simple_flag = $(document).find('#sc_live_other_start_time_simple_flag_fullscreen').is(':checked');
  7751.  
  7752. sc_start_time_simple_store();
  7753.  
  7754. if (sc_start_time_simple_flag) {
  7755. $(document).find('.sc_start_time_all_span').hide();
  7756. $(document).find('.sc_start_time_simple_span').show();
  7757. } else {
  7758. $(document).find('.sc_start_time_all_span').show();
  7759. $(document).find('.sc_start_time_simple_span').hide();
  7760. }
  7761.  
  7762. sc_list_search_shortkey_flag = $(document).find('#sc_live_other_search_shortkey_flag_fullscreen').is(':checked');
  7763.  
  7764. sc_search_shortkey_flag_config_store();
  7765.  
  7766. sc_search_shortkey_flag_config_apply();
  7767.  
  7768. sc_live_auto_tianxuan_flag = $(document).find('#sc_live_other_auto_tianxuan_flag_fullscreen').is(':checked');
  7769.  
  7770. sc_live_auto_tianxuan_flag_config_store();
  7771.  
  7772. sc_live_send_dm_combo_flag = $(document).find('#sc_live_other_auto_dm_combo_flag_fullscreen').is(':checked');
  7773.  
  7774. sc_live_send_dm_combo_flag_config_store();
  7775.  
  7776. sc_live_other_config_data_show_apply();
  7777.  
  7778. open_and_close_sc_modal('✓', '#A7C9D3', e);
  7779. });
  7780.  
  7781.  
  7782. let sc_live_search_modal_style = document.createElement('style');
  7783. sc_live_search_modal_style.textContent = `
  7784. .sc_live_search_config_modal {
  7785. display: none;
  7786. position: fixed;
  7787. z-index: 3333;
  7788. top: 18%;
  7789. left: 50%;
  7790. margin-left: -21%;
  7791. width: 42%;
  7792. }
  7793.  
  7794. .sc_live_search_modal_content {
  7795. background-color: rgb(255, 255, 255, 0.9);
  7796. padding: 20px;
  7797. border: 1px solid #888;
  7798. }
  7799.  
  7800. .sc_live_search_modal_content p {
  7801. color: #000;
  7802. }
  7803.  
  7804. .sc_live_search_close {
  7805. color: #aaa;
  7806. float: right;
  7807. font-size: 28px;
  7808. font-weight: bold;
  7809. }
  7810.  
  7811. .sc_live_search_close:hover,
  7812. .sc_live_search_close:focus {
  7813. color: black;
  7814. text-decoration: none;
  7815. cursor: pointer;
  7816. }
  7817.  
  7818. .sc_live_search_div_group {
  7819. display: block;
  7820. color: #000;
  7821. padding-bottom: 10px;
  7822. }
  7823.  
  7824. .sc_live_search_div_group input{
  7825. background-color: rgb(255, 255, 255, 0);
  7826. border: 1px solid;
  7827. padding: 5px
  7828. }
  7829.  
  7830. .sc_live_search_div_group_fullscreen {
  7831. display: block;
  7832. color: #000;
  7833. padding-bottom: 10px;
  7834. }
  7835.  
  7836. .sc_live_search_div_group_fullscreen input{
  7837. background-color: rgb(255, 255, 255, 0);
  7838. border: 1px solid;
  7839. padding: 5px
  7840. }
  7841.  
  7842. .sc_live_search_btn_div {
  7843. margin-top: 30px;
  7844. }
  7845.  
  7846. .sc_live_search_btn_div_fullscreen {
  7847. margin-top: 30px;
  7848. }
  7849.  
  7850. #sc_live_search_form {
  7851. margin-top: 30px;
  7852. text-align: center;
  7853. }
  7854.  
  7855. #sc_live_search_form_fullscreen {
  7856. margin-top: 30px;
  7857. text-align: center;
  7858. }
  7859.  
  7860. #sc_live_search_confirm_btn {
  7861. float: right;
  7862. }
  7863.  
  7864. #sc_live_search_confirm_btn_fullscreen {
  7865. float: right;
  7866. }
  7867.  
  7868. .sc_live_search_modal_btn {
  7869. padding: 5px 20px;
  7870. color: initial;
  7871. }
  7872.  
  7873. .sc_live_search_normal_btn {
  7874. padding: 5px 5px;
  7875. color: initial;
  7876. }
  7877.  
  7878. .change_bg_opacity_range,
  7879. .change_bg_opacity_range_fullscreen {
  7880. -webkit-appearance: none;
  7881. appearance: none;
  7882. width: 80px;
  7883. background: transparent;
  7884. outline: none;
  7885. opacity: 0.2;
  7886. -moz-transition: opacity .2s;
  7887. transition: opacity .2s;
  7888. }
  7889.  
  7890. .change_bg_opacity_range::-moz-range-thumb,
  7891. .change_bg_opacity_range_fullscreen::-moz-range-thumb {
  7892. background: #abb3ac;
  7893. border: none;
  7894. height: 6px;
  7895. width: 12px;
  7896. cursor: pointer;
  7897. margin-top: -2px;
  7898. }
  7899.  
  7900. .change_bg_opacity_range::-webkit-slider-thumb,
  7901. .change_bg_opacity_range_fullscreen::-webkit-slider-thumb {
  7902. -webkit-appearance: none;
  7903. background: #abb3ac;
  7904. border: none;
  7905. height: 6px;
  7906. width: 12px;
  7907. cursor: pointer;
  7908. margin-top: -2px;
  7909. }
  7910.  
  7911. .change_bg_opacity_range::-moz-range-track,
  7912. .change_bg_opacity_range_fullscreen::-moz-range-track {
  7913. background: #ddd;
  7914. border: none;
  7915. height: 2px;
  7916. }
  7917.  
  7918. .change_bg_opacity_range::-webkit-slider-runnable-track,
  7919. .change_bg_opacity_range_fullscreen::-webkit-slider-runnable-track {
  7920. background: #ddd;
  7921. border: none;
  7922. height: 2px;
  7923. }
  7924.  
  7925. .change_bg_opacity_range:hover::-moz-range-thumb,
  7926. .change_bg_opacity_range_fullscreen:hover::-moz-range-thumb {
  7927. background: #000;
  7928. }
  7929.  
  7930. .change_bg_opacity_range:hover::-webkit-slider-thumb,
  7931. .change_bg_opacity_range_fullscreen:hover::-webkit-slider-thumb {
  7932. background: #000;
  7933. }
  7934. `;
  7935.  
  7936. document.head.appendChild(sc_live_search_modal_style);
  7937.  
  7938. let sc_live_search_modal_html = document.createElement('div');
  7939. sc_live_search_modal_html.id = 'sc_live_search_config_div';
  7940. sc_live_search_modal_html.className = 'sc_live_search_config_modal';
  7941. sc_live_search_modal_html.innerHTML = `
  7942. <div class="sc_live_search_modal_content">
  7943. <span class="sc_live_search_close">&times;</span>
  7944. <p>自定义搜索SC:</p>
  7945. <input type="range" min="0" max="100" value="90" class="change_bg_opacity_range">
  7946. <form id="sc_live_search_form">
  7947. <div class="sc_live_search_div_group">
  7948. <label for="sc_live_search_user_name">用户昵称:</label>
  7949. <input type="text" id="sc_live_search_user_name" class="sc_live_search_user_name_input" />
  7950. <button type="button" class="sc_live_search_normal_btn sc_live_search_user_name_clear_btn">清空</button>
  7951. </div>
  7952. <div class="sc_live_search_div_group">
  7953. <label for="sc_live_search_content">留言内容:</label>
  7954. <input type="text" id="sc_live_search_content" class="sc_live_search_content_input" />
  7955. <button type="button" class="sc_live_search_normal_btn sc_live_search_content_clear_btn">清空</button>
  7956. </div>
  7957. <div class="sc_live_search_div_group">
  7958. <label for="sc_live_search_time">时间距离:</label>
  7959. <input type="number" min="0" id="sc_live_search_time" placeholder="分钟前" class="sc_live_search_time_input" />
  7960. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_clear_btn">清空</button>
  7961. </div>
  7962. <div class="sc_live_search_div_group">
  7963. <label>快速填充/分钟:</label>
  7964. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_0">0</button>
  7965. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_5">5</button>
  7966. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_10">10</button>
  7967. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_20">20</button>
  7968. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_30">30</button>
  7969. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_40">40</button>
  7970. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_50">50</button>
  7971. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_60">60</button>
  7972. </div>
  7973. <div class="sc_live_search_div_group" style="margin-top:30px;">
  7974. <button type="button" id="sc_live_search_prev_btn" class="sc_live_search_normal_btn" style="margin-right:60px;">上一个</button>
  7975. <button type="button" id="sc_live_search_next_btn" class="sc_live_search_normal_btn">下一个</button>
  7976. </div>
  7977. <div class="sc_live_search_result_div" style="width: 100%;">
  7978. </div>
  7979. </form>
  7980. <div class="sc_live_search_btn_div">
  7981. <button id="sc_live_search_cancel_btn" class="sc_live_search_modal_btn sc_live_search_modal_close_btn">取消</button>
  7982. <button id="sc_live_search_confirm_btn" class="sc_live_search_modal_btn sc_live_search_modal_close_btn">关闭</button>
  7983. </div>
  7984. </div>
  7985. `;
  7986.  
  7987. document.body.appendChild(sc_live_search_modal_html);
  7988.  
  7989. let sc_live_search_modal_html_fullscreen = document.createElement('div');
  7990. sc_live_search_modal_html_fullscreen.id = 'sc_live_search_config_div_fullscreen';
  7991. sc_live_search_modal_html_fullscreen.className = 'sc_live_search_config_modal';
  7992. sc_live_search_modal_html_fullscreen.innerHTML = `
  7993. <div class="sc_live_search_modal_content">
  7994. <span class="sc_live_search_close">&times;</span>
  7995. <p>自定义搜索SC:</p>
  7996. <input type="range" min="0" max="100" value="90" class="change_bg_opacity_range_fullscreen">
  7997. <form id="sc_live_search_form_fullscreen">
  7998. <div class="sc_live_search_div_group_fullscreen">
  7999. <label for="sc_live_search_user_name_fullscreen">用户昵称:</label>
  8000. <input type="text" id="sc_live_search_user_name_fullscreen" class="sc_live_search_user_name_input" />
  8001. <button type="button" class="sc_live_search_normal_btn sc_live_search_user_name_clear_btn">清空</button>
  8002. </div>
  8003. <div class="sc_live_search_div_group_fullscreen">
  8004. <label for="sc_live_search_content_fullscreen">留言内容:</label>
  8005. <input type="text" id="sc_live_search_content_fullscreen" class="sc_live_search_content_input" />
  8006. <button type="button" class="sc_live_search_normal_btn sc_live_search_content_clear_btn">清空</button>
  8007. </div>
  8008. <div class="sc_live_search_div_group_fullscreen">
  8009. <label for="sc_live_search_time_fullscreen">时间距离:</label>
  8010. <input type="number" min="0" id="sc_live_search_time_fullscreen" placeholder="分钟前" class="sc_live_search_time_input" />
  8011. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_clear_btn">清空</button>
  8012. </div>
  8013. <div class="sc_live_search_div_group_fullscreen">
  8014. <label>快速填充/分钟:</label>
  8015. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_0">0</button>
  8016. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_5">5</button>
  8017. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_10">10</button>
  8018. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_20">20</button>
  8019. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_30">30</button>
  8020. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_40">40</button>
  8021. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_50">50</button>
  8022. <button type="button" class="sc_live_search_normal_btn sc_live_search_time_60">60</button>
  8023. </div>
  8024. <div class="sc_live_search_div_group_fullscreen" style="margin-top:30px;">
  8025. <button type="button" id="sc_live_search_prev_btn_fullscreen" class="sc_live_search_normal_btn" style="margin-right:60px;">上一个</button>
  8026. <button type="button" id="sc_live_search_next_btn_fullscreen" class="sc_live_search_normal_btn">下一个</button>
  8027. </div>
  8028. <div class="sc_live_search_result_div_fullscreen" style="width: 100%;">
  8029. </div>
  8030. </form>
  8031. <div class="sc_live_search_btn_div_fullscreen">
  8032. <button id="sc_live_search_cancel_btn" class="sc_live_search_modal_btn sc_live_search_modal_close_btn">取消</button>
  8033. <button id="sc_live_search_confirm_btn_fullscreen" class="sc_live_search_modal_btn sc_live_search_modal_close_btn">关闭</button>
  8034. </div>
  8035. </div>
  8036. `;
  8037.  
  8038. $(live_player_div).append(sc_live_search_modal_html_fullscreen);
  8039.  
  8040. function sc_close_live_search_modal() {
  8041. $(document).find('.sc_live_search_config_modal').hide();
  8042. }
  8043.  
  8044. $(document).on('click', '.sc_live_search_close, .sc_live_search_modal_close_btn', function() {
  8045. sc_close_live_search_modal();
  8046. });
  8047.  
  8048. $(document).on('click', '.sc_live_search_user_name_clear_btn', function() {
  8049. $(document).find('.sc_live_search_user_name_input').val('');
  8050. if (sc_isFullscreen) {
  8051. $(document).find('#sc_live_search_user_name_fullscreen').focus();
  8052. } else {
  8053. $(document).find('#sc_live_search_user_name').focus();
  8054. }
  8055. });
  8056.  
  8057. $(document).on('click', '.sc_live_search_content_clear_btn', function() {
  8058. $(document).find('.sc_live_search_content_input').val('');
  8059. if (sc_isFullscreen) {
  8060. $(document).find('#sc_live_search_content_fullscreen').focus();
  8061. } else {
  8062. $(document).find('#sc_live_search_content').focus();
  8063. }
  8064. });
  8065.  
  8066. $(document).on('click', '.sc_live_search_time_clear_btn', function() {
  8067. $(document).find('.sc_live_search_time_input').val('');
  8068. if (sc_isFullscreen) {
  8069. $(document).find('#sc_live_search_time_fullscreen').focus();
  8070. } else {
  8071. $(document).find('#sc_live_search_time').focus();
  8072. }
  8073. });
  8074.  
  8075. let sc_change_bg_opacity_timeout;
  8076. let sc_change_bg_opacity_fullscreen_timeout;
  8077.  
  8078. sc_list_search_div_bg_opacity_range = parseInt(sc_list_search_div_bg_opacity_range, 10);
  8079.  
  8080. $(document).find('.sc_live_search_modal_content').css('background-color', 'rgb(255, 255, 255, '+ sc_list_search_div_bg_opacity_range / 100 +')');
  8081. $(document).find('.change_bg_opacity_range').val(sc_list_search_div_bg_opacity_range);
  8082. $(document).find('.change_bg_opacity_range_fullscreen').val(sc_list_search_div_bg_opacity_range);
  8083.  
  8084. $(document).on('input', '.change_bg_opacity_range', function() {
  8085. $(document).find('.sc_live_search_modal_content').css('background-color', 'rgb(255, 255, 255, '+ $(this).val() / 100 +')');
  8086. $(document).find('.change_bg_opacity_range_fullscreen').val($(this).val());
  8087.  
  8088. clearTimeout(sc_change_bg_opacity_timeout);
  8089.  
  8090. sc_change_bg_opacity_timeout = setTimeout(() => {
  8091. sc_list_search_div_bg_opacity_range = $(this).val();
  8092. sc_search_div_bg_opacity_range_config_store();
  8093. }, 1000);
  8094. });
  8095.  
  8096. $(document).on('input', '.change_bg_opacity_range_fullscreen', function() {
  8097. $(document).find('.sc_live_search_modal_content').css('background-color', 'rgb(255, 255, 255, '+ $(this).val() / 100 +')');
  8098. $(document).find('.change_bg_opacity_range').val($(this).val());
  8099.  
  8100. clearTimeout(sc_change_bg_opacity_fullscreen_timeout);
  8101.  
  8102. sc_change_bg_opacity_fullscreen_timeout = setTimeout(() => {
  8103. sc_list_search_div_bg_opacity_range = $(this).val();
  8104. sc_search_div_bg_opacity_range_config_store();
  8105. }, 1000);
  8106. });
  8107.  
  8108. $(document).on('click', '.sc_live_search_time_0', function() {
  8109. $(document).find('.sc_live_search_time_input').val(0);
  8110. });
  8111.  
  8112. $(document).on('click', '.sc_live_search_time_5', function() {
  8113. $(document).find('.sc_live_search_time_input').val(5);
  8114. });
  8115.  
  8116. $(document).on('click', '.sc_live_search_time_10', function() {
  8117. $(document).find('.sc_live_search_time_input').val(10);
  8118. });
  8119.  
  8120. $(document).on('click', '.sc_live_search_time_20', function() {
  8121. $(document).find('.sc_live_search_time_input').val(20);
  8122. });
  8123.  
  8124. $(document).on('click', '.sc_live_search_time_30', function() {
  8125. $(document).find('.sc_live_search_time_input').val(30);
  8126. });
  8127.  
  8128. $(document).on('click', '.sc_live_search_time_40', function() {
  8129. $(document).find('.sc_live_search_time_input').val(40);
  8130. });
  8131.  
  8132. $(document).on('click', '.sc_live_search_time_50', function() {
  8133. $(document).find('.sc_live_search_time_input').val(50);
  8134. });
  8135.  
  8136. $(document).on('click', '.sc_live_search_time_60', function() {
  8137. $(document).find('.sc_live_search_time_input').val(60);
  8138. });
  8139.  
  8140. $(document).on('click', '#sc_live_search_prev_btn', function() {
  8141. sc_live_search_confirm_prev();
  8142. });
  8143.  
  8144. $(document).on('click', '#sc_live_search_next_btn', function() {
  8145. sc_live_search_confirm_next();
  8146. });
  8147.  
  8148. $(document).on('click', '#sc_live_search_prev_btn_fullscreen', function() {
  8149. sc_live_search_confirm_prev();
  8150. });
  8151.  
  8152. $(document).on('click', '#sc_live_search_next_btn_fullscreen', function() {
  8153. sc_live_search_confirm_next();
  8154. });
  8155.  
  8156.  
  8157. // 创建一个自定义右键菜单
  8158. let sc_func_button1 = document.createElement('button');
  8159. sc_func_button1.className = 'sc_func_btn';
  8160. sc_func_button1.id = 'sc_func_no_remember_show_sc_list_btn';
  8161. sc_func_button1.innerHTML = '不记忆地显示醒目留言列表';
  8162. sc_func_button1.style.marginBottom = '2px';
  8163.  
  8164. let sc_func_button2 = document.createElement('button');
  8165. sc_func_button2.className = 'sc_func_btn';
  8166. sc_func_button2.id = 'sc_func_no_remember_hide_sc_list_btn';
  8167. sc_func_button2.innerHTML = '不记忆地隐藏醒目留言列表';
  8168. sc_func_button2.style.marginBottom = '2px';
  8169.  
  8170. let sc_func_button3 = document.createElement('button');
  8171. sc_func_button3.className = 'sc_func_btn';
  8172. sc_func_button3.id = 'sc_func_no_remember_hide_expire_sc_btn';
  8173. sc_func_button3.innerHTML = '不记忆地隐藏过期醒目留言';
  8174. sc_func_button3.style.marginBottom = '2px';
  8175.  
  8176. let sc_func_button4 = document.createElement('button');
  8177. sc_func_button4.className = 'sc_func_btn';
  8178. sc_func_button4.id = 'sc_func_show_btn';
  8179. sc_func_button4.innerHTML = '侧折模式下显示所有的按钮';
  8180. sc_func_button4.style.marginBottom = '2px';
  8181.  
  8182. let sc_func_button5 = document.createElement('button');
  8183. sc_func_button5.className = 'sc_func_btn';
  8184. sc_func_button5.id = 'sc_func_hide_btn';
  8185. sc_func_button5.innerHTML = '侧折模式下隐藏所有的按钮';
  8186. sc_func_button5.style.marginBottom = '2px';
  8187.  
  8188. let sc_func_button6 = document.createElement('button');
  8189. sc_func_button6.className = 'sc_func_btn';
  8190. sc_func_button6.id = 'sc_func_simple_btn';
  8191. sc_func_button6.innerHTML = '侧折模式下按钮的极简模式';
  8192. sc_func_button6.style.marginBottom = '2px';
  8193.  
  8194. let sc_func_button7 = document.createElement('button');
  8195. sc_func_button7.className = 'sc_func_btn';
  8196. sc_func_button7.id = 'sc_func_one_min_btn';
  8197. sc_func_button7.innerHTML = '侧折模式下只显示折叠按钮';
  8198. sc_func_button7.style.marginBottom = '2px';
  8199.  
  8200. let sc_func_button8 = document.createElement('button');
  8201. sc_func_button8.className = 'sc_func_btn';
  8202. sc_func_button8.id = 'sc_func_one_menu_btn';
  8203. sc_func_button8.innerHTML = '侧折模式下只显示菜单按钮';
  8204. sc_func_button8.style.marginBottom = '2px';
  8205.  
  8206. let sc_func_button9 = document.createElement('button');
  8207. sc_func_button9.className = 'sc_func_btn';
  8208. sc_func_button9.id = 'sc_func_first_sc_item_config_btn';
  8209. sc_func_button9.innerHTML = '侧折模式下留言显示自定义';
  8210. sc_func_button9.style.marginBottom = '2px';
  8211.  
  8212. let sc_func_button10 = document.createElement('button');
  8213. sc_func_button10.className = 'sc_func_btn';
  8214. sc_func_button10.id = 'sc_func_panel_sc_item_show_config_btn';
  8215. sc_func_button10.innerHTML = '所有模式下留言显示自定义';
  8216. sc_func_button10.style.marginBottom = '2px';
  8217.  
  8218. let sc_func_button11 = document.createElement('button');
  8219. sc_func_button11.className = 'sc_func_btn';
  8220. sc_func_button11.id = 'sc_func_panel_width_config_btn';
  8221. sc_func_button11.innerHTML = '设置记录板留言宽度自定义';
  8222. sc_func_button11.style.marginBottom = '2px';
  8223.  
  8224. let sc_func_button12 = document.createElement('button');
  8225. sc_func_button12.className = 'sc_func_btn';
  8226. sc_func_button12.id = 'sc_func_panel_height_config_btn';
  8227. sc_func_button12.innerHTML = '设置记录板显示高度自定义';
  8228. sc_func_button12.style.marginBottom = '2px';
  8229.  
  8230. let sc_func_button13 = document.createElement('button');
  8231. sc_func_button13.className = 'sc_func_btn';
  8232. sc_func_button13.id = 'sc_func_item_order_config_btn';
  8233. sc_func_button13.innerHTML = '设置记录板留言的排列顺序';
  8234. sc_func_button13.style.marginBottom = '2px';
  8235.  
  8236. let sc_func_button14 = document.createElement('button');
  8237. sc_func_button14.className = 'sc_func_btn';
  8238. sc_func_button14.id = 'sc_func_item_custom_search_btn';
  8239. sc_func_button14.innerHTML = '搜索定位记录板留言自定义';
  8240. sc_func_button14.style.marginBottom = '2px';
  8241.  
  8242. let sc_func_button15 = document.createElement('button');
  8243. sc_func_button15.className = 'sc_func_btn';
  8244. sc_func_button15.id = 'sc_func_bottom_data_show_btn';
  8245. sc_func_button15.innerHTML = '右侧的弹幕发送框显示数据';
  8246. sc_func_button15.style.marginBottom = '2px';
  8247.  
  8248. let sc_func_button16 = document.createElement('button');
  8249. sc_func_button16.className = 'sc_func_btn';
  8250. sc_func_button16.id = 'sc_func_bottom_data_hide_btn';
  8251. sc_func_button16.innerHTML = '右侧的弹幕发送框隐藏数据';
  8252. sc_func_button16.style.marginBottom = '2px';
  8253.  
  8254. let sc_func_button17 = document.createElement('button');
  8255. sc_func_button17.className = 'sc_func_btn';
  8256. sc_func_button17.id = 'sc_func_panel_allow_drag_close_btn';
  8257. sc_func_button17.innerHTML = '锁定记录板即关闭拖拽功能';
  8258. sc_func_button17.style.marginBottom = '2px';
  8259.  
  8260. let sc_func_button18 = document.createElement('button');
  8261. sc_func_button18.className = 'sc_func_btn';
  8262. sc_func_button18.id = 'sc_func_panel_allow_drag_open_btn';
  8263. sc_func_button18.innerHTML = '解锁记录板即开放拖拽功能';
  8264. sc_func_button18.style.marginBottom = '2px';
  8265.  
  8266. let sc_func_button19 = document.createElement('button');
  8267. sc_func_button19.className = 'sc_func_btn';
  8268. sc_func_button19.id = 'sc_func_panel_switch_open_mode_btn';
  8269. sc_func_button19.innerHTML = '展开记录板即切换展开模式';
  8270. sc_func_button19.style.marginBottom = '2px';
  8271.  
  8272. let sc_func_button20 = document.createElement('button');
  8273. sc_func_button20.className = 'sc_func_btn';
  8274. sc_func_button20.id = 'sc_circle_welt_hide_half_true_btn';
  8275. sc_func_button20.innerHTML = '设置小图标在贴边后半隐藏';
  8276. sc_func_button20.style.marginBottom = '2px';
  8277.  
  8278. let sc_func_button21 = document.createElement('button');
  8279. sc_func_button21.className = 'sc_func_btn';
  8280. sc_func_button21.id = 'sc_circle_welt_hide_half_false_btn';
  8281. sc_func_button21.innerHTML = '取消小图标在贴边后半隐藏';
  8282. sc_func_button21.style.marginBottom = '2px';
  8283.  
  8284. let sc_func_button22 = document.createElement('button');
  8285. sc_func_button22.className = 'sc_func_btn';
  8286. sc_func_button22.id = 'sc_func_item_show_time_btn';
  8287. sc_func_button22.innerHTML = '显示醒目留言发送具体时间';
  8288. sc_func_button22.style.marginBottom = '2px';
  8289.  
  8290. let sc_func_button23 = document.createElement('button');
  8291. sc_func_button23.className = 'sc_func_btn';
  8292. sc_func_button23.id = 'sc_func_item_hide_time_btn';
  8293. sc_func_button23.innerHTML = '隐藏醒目留言发送具体时间';
  8294. sc_func_button23.style.marginBottom = '2px';
  8295.  
  8296. let sc_func_button24 = document.createElement('button');
  8297. sc_func_button24.className = 'sc_func_btn';
  8298. sc_func_button24.id = 'sc_func_live_sidebar_left_btn';
  8299. sc_func_button24.innerHTML = '设置直播间功能按钮在左侧';
  8300. sc_func_button24.style.marginBottom = '2px';
  8301.  
  8302. let sc_func_button25 = document.createElement('button');
  8303. sc_func_button25.className = 'sc_func_btn';
  8304. sc_func_button25.id = 'sc_func_live_sidebar_right_btn';
  8305. sc_func_button25.innerHTML = '恢复直播间功能按钮在右侧';
  8306. sc_func_button25.style.marginBottom = '2px';
  8307.  
  8308. let sc_func_button26 = document.createElement('button');
  8309. sc_func_button26.className = 'sc_func_btn';
  8310. sc_func_button26.id = 'sc_func_live_sc_to_danmu_show_btn';
  8311. sc_func_button26.innerHTML = '设置醒目留言以弹幕来展现';
  8312. sc_func_button26.style.marginBottom = '2px';
  8313.  
  8314. let sc_func_button27 = document.createElement('button');
  8315. sc_func_button27.className = 'sc_func_btn';
  8316. sc_func_button27.id = 'sc_func_fullscreen_separate_memory_btn';
  8317. sc_func_button27.innerHTML = '一些设置在全屏时分开记忆';
  8318. sc_func_button27.style.marginBottom = '2px';
  8319.  
  8320. let sc_func_button28 = document.createElement('button');
  8321. sc_func_button28.className = 'sc_func_btn';
  8322. sc_func_button28.id = 'sc_func_live_special_tip_config_btn';
  8323. sc_func_button28.innerHTML = '对特定用户进入直播间提示';
  8324. sc_func_button28.style.marginBottom = '2px';
  8325.  
  8326. let sc_func_button29 = document.createElement('button');
  8327. sc_func_button29.className = 'sc_func_btn';
  8328. sc_func_button29.id = 'sc_func_live_other_config_btn';
  8329. sc_func_button29.innerHTML = '其他一些功能的自定义设置';
  8330. sc_func_button29.style.marginBottom = '2px';
  8331.  
  8332. let sc_func_br1 = document.createElement('br');
  8333. let sc_func_br2 = document.createElement('br');
  8334. let sc_func_br3 = document.createElement('br');
  8335. let sc_func_br4 = document.createElement('br');
  8336. let sc_func_br5 = document.createElement('br');
  8337. let sc_func_br6 = document.createElement('br');
  8338. let sc_func_br7 = document.createElement('br');
  8339. let sc_func_br8 = document.createElement('br');
  8340. let sc_func_br9 = document.createElement('br');
  8341. let sc_func_br10 = document.createElement('br');
  8342. let sc_func_br11 = document.createElement('br');
  8343. let sc_func_br12 = document.createElement('br');
  8344. let sc_func_br13 = document.createElement('br');
  8345. let sc_func_br14 = document.createElement('br');
  8346. let sc_func_br15 = document.createElement('br');
  8347. let sc_func_br16 = document.createElement('br');
  8348. let sc_func_br17 = document.createElement('br');
  8349. let sc_func_br18 = document.createElement('br');
  8350. let sc_func_br19 = document.createElement('br');
  8351. let sc_func_br20 = document.createElement('br');
  8352. let sc_func_br21 = document.createElement('br');
  8353. let sc_func_br22 = document.createElement('br');
  8354. let sc_func_br23 = document.createElement('br');
  8355. let sc_func_br24 = document.createElement('br');
  8356. let sc_func_br25 = document.createElement('br');
  8357. let sc_func_br26 = document.createElement('br');
  8358. let sc_func_br27 = document.createElement('br');
  8359. let sc_func_br28 = document.createElement('br');
  8360.  
  8361. let sc_func_context_menu = document.createElement('div');
  8362. sc_func_context_menu.id = 'sc_context_menu_func_body';
  8363. sc_func_context_menu.className = 'sc_ctx_func_menu';
  8364. sc_func_context_menu.style.position = 'fixed';
  8365. sc_func_context_menu.style.display = 'none';
  8366. sc_func_context_menu.style.backgroundColor = '#ffffff';
  8367. sc_func_context_menu.style.border = 0;
  8368. sc_func_context_menu.style.padding = '5px';
  8369. sc_func_context_menu.style.zIndex = 3333;
  8370.  
  8371. sc_func_context_menu.appendChild(sc_func_button1);
  8372. sc_func_context_menu.appendChild(sc_func_br1);
  8373. sc_func_context_menu.appendChild(sc_func_button2);
  8374. sc_func_context_menu.appendChild(sc_func_br2);
  8375. sc_func_context_menu.appendChild(sc_func_button3);
  8376. sc_func_context_menu.appendChild(sc_func_br3);
  8377. sc_func_context_menu.appendChild(sc_func_button4);
  8378. sc_func_context_menu.appendChild(sc_func_br4);
  8379. sc_func_context_menu.appendChild(sc_func_button5);
  8380. sc_func_context_menu.appendChild(sc_func_br5);
  8381. sc_func_context_menu.appendChild(sc_func_button6);
  8382. sc_func_context_menu.appendChild(sc_func_br6);
  8383. sc_func_context_menu.appendChild(sc_func_button7);
  8384. sc_func_context_menu.appendChild(sc_func_br7);
  8385. sc_func_context_menu.appendChild(sc_func_button8);
  8386. sc_func_context_menu.appendChild(sc_func_br8);
  8387. sc_func_context_menu.appendChild(sc_func_button9);
  8388. sc_func_context_menu.appendChild(sc_func_br9);
  8389. sc_func_context_menu.appendChild(sc_func_button10);
  8390. sc_func_context_menu.appendChild(sc_func_br10);
  8391. sc_func_context_menu.appendChild(sc_func_button11);
  8392. sc_func_context_menu.appendChild(sc_func_br11);
  8393. sc_func_context_menu.appendChild(sc_func_button12);
  8394. sc_func_context_menu.appendChild(sc_func_br12);
  8395. sc_func_context_menu.appendChild(sc_func_button13);
  8396. sc_func_context_menu.appendChild(sc_func_br13);
  8397. sc_func_context_menu.appendChild(sc_func_button14);
  8398. sc_func_context_menu.appendChild(sc_func_br14);
  8399. sc_func_context_menu.appendChild(sc_func_button15);
  8400. sc_func_context_menu.appendChild(sc_func_br15);
  8401. sc_func_context_menu.appendChild(sc_func_button16);
  8402. sc_func_context_menu.appendChild(sc_func_br16);
  8403. sc_func_context_menu.appendChild(sc_func_button17);
  8404. sc_func_context_menu.appendChild(sc_func_br17);
  8405. sc_func_context_menu.appendChild(sc_func_button18);
  8406. sc_func_context_menu.appendChild(sc_func_br18);
  8407. sc_func_context_menu.appendChild(sc_func_button19);
  8408. sc_func_context_menu.appendChild(sc_func_br19);
  8409. sc_func_context_menu.appendChild(sc_func_button20);
  8410. sc_func_context_menu.appendChild(sc_func_br20);
  8411. sc_func_context_menu.appendChild(sc_func_button21);
  8412. sc_func_context_menu.appendChild(sc_func_br21);
  8413. sc_func_context_menu.appendChild(sc_func_button22);
  8414. sc_func_context_menu.appendChild(sc_func_br22);
  8415. sc_func_context_menu.appendChild(sc_func_button23);
  8416. sc_func_context_menu.appendChild(sc_func_br23);
  8417. sc_func_context_menu.appendChild(sc_func_button24);
  8418. sc_func_context_menu.appendChild(sc_func_br24);
  8419. sc_func_context_menu.appendChild(sc_func_button25);
  8420. sc_func_context_menu.appendChild(sc_func_br25);
  8421. sc_func_context_menu.appendChild(sc_func_button26);
  8422. sc_func_context_menu.appendChild(sc_func_br26);
  8423. sc_func_context_menu.appendChild(sc_func_button27);
  8424. sc_func_context_menu.appendChild(sc_func_br27);
  8425. sc_func_context_menu.appendChild(sc_func_button28);
  8426. sc_func_context_menu.appendChild(sc_func_br28);
  8427. sc_func_context_menu.appendChild(sc_func_button29);
  8428.  
  8429. // 将功能的右键菜单添加到body中
  8430. document.body.appendChild(sc_func_context_menu);
  8431.  
  8432. let sc_func_context_menu_fullscreen = sc_func_context_menu.cloneNode(true);
  8433. sc_func_context_menu_fullscreen.id = 'sc_func_context_menu_fullscreen';
  8434. $(live_player_div).append(sc_func_context_menu_fullscreen);
  8435.  
  8436. $(document).on('click', '#sc_func_show_btn', function(e) {
  8437. e = e || unsafeWindow.event;
  8438. e.preventDefault();
  8439.  
  8440. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  8441. sc_func_btn_mode_fullscreen = 0;
  8442. } else {
  8443. sc_func_btn_mode = 0;
  8444. }
  8445.  
  8446. sc_func_btn_mode_store();
  8447. sc_btn_mode_apply();
  8448. sc_after_click_func_btn_apply(e);
  8449.  
  8450. $(this).parent().fadeOut();
  8451. open_and_close_sc_modal('已设置 侧折模式下显示所有的按钮✓', '#A7C9D3', e, 1);
  8452. });
  8453.  
  8454. $(document).on('click', '#sc_func_hide_btn', function(e) {
  8455. e = e || unsafeWindow.event;
  8456. e.preventDefault();
  8457.  
  8458. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  8459. sc_func_btn_mode_fullscreen = 1;
  8460. } else {
  8461. sc_func_btn_mode = 1;
  8462. }
  8463.  
  8464. sc_func_btn_mode_store();
  8465. sc_btn_mode_apply();
  8466. sc_after_click_func_btn_apply(e);
  8467.  
  8468. $(this).parent().fadeOut();
  8469. open_and_close_sc_modal('已设置 侧折模式下隐藏所有的按钮 ✓', '#A7C9D3', e, 1);
  8470. });
  8471.  
  8472. $(document).on('click', '#sc_func_simple_btn', function(e) {
  8473. e = e || unsafeWindow.event;
  8474. e.preventDefault();
  8475.  
  8476. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  8477. sc_func_btn_mode_fullscreen = 2;
  8478. } else {
  8479. sc_func_btn_mode = 2;
  8480. }
  8481.  
  8482. sc_func_btn_mode_store();
  8483. sc_btn_mode_apply();
  8484. sc_after_click_func_btn_apply(e);
  8485.  
  8486. $(this).parent().fadeOut();
  8487. open_and_close_sc_modal('已设置 侧折模式下按钮的极简模式 ✓', '#A7C9D3', e, 1);
  8488. });
  8489.  
  8490. $(document).on('click', '#sc_func_one_min_btn', function(e) {
  8491. e = e || unsafeWindow.event;
  8492. e.preventDefault();
  8493.  
  8494. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  8495. sc_func_btn_mode_fullscreen = 3;
  8496. } else {
  8497. sc_func_btn_mode = 3;
  8498. }
  8499.  
  8500. sc_func_btn_mode_store();
  8501. sc_btn_mode_apply();
  8502. sc_after_click_func_btn_apply(e);
  8503.  
  8504. $(this).parent().fadeOut();
  8505. open_and_close_sc_modal('已设置 侧折模式下只显示折叠按钮 ✓', '#A7C9D3', e, 1);
  8506. });
  8507.  
  8508. $(document).on('click', '#sc_func_one_menu_btn', function(e) {
  8509. e = e || unsafeWindow.event;
  8510. e.preventDefault();
  8511.  
  8512. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  8513. sc_func_btn_mode_fullscreen = 4;
  8514. } else {
  8515. sc_func_btn_mode = 4;
  8516. }
  8517.  
  8518. sc_func_btn_mode_store();
  8519. sc_btn_mode_apply();
  8520. sc_after_click_func_btn_apply(e);
  8521.  
  8522. $(this).parent().fadeOut();
  8523. open_and_close_sc_modal('已设置 侧折模式下只显示菜单按钮 ✓', '#A7C9D3', e, 1);
  8524. });
  8525.  
  8526. $(document).on('click', '#sc_func_first_sc_item_config_btn', function(e) {
  8527. e = e || unsafeWindow.event;
  8528. e.preventDefault();
  8529.  
  8530. let sc_custom_config_div_id = 'sc_custom_config_div';
  8531. let sc_custom_config_radio_group_class = 'sc_custom_radio_group';
  8532. let sc_custom_config_option_name = 'sc_custom_option';
  8533. let sc_custom_config_checkbox_id = 'sc_custom_each_same_time_input';
  8534. let sc_custom_config_input_id = 'sc_custom_time_input';
  8535.  
  8536. if (sc_isFullscreen) {
  8537. sc_custom_config_div_id = 'sc_custom_config_div_fullscreen';
  8538. sc_custom_config_radio_group_class = 'sc_custom_radio_group_fullscreen';
  8539. sc_custom_config_option_name = 'sc_custom_option_fullscreen';
  8540. sc_custom_config_checkbox_id = 'sc_custom_each_same_time_input_fullscreen';
  8541. sc_custom_config_input_id = 'sc_custom_time_input_fullscreen';
  8542. }
  8543. $(document).find('#' + sc_custom_config_div_id).show();
  8544.  
  8545. $(document).find('.'+ sc_custom_config_radio_group_class +' input[name="'+ sc_custom_config_option_name +'"]').eq(sc_side_fold_custom_config).prop('checked', true);
  8546.  
  8547. if (sc_side_fold_custom_config) {
  8548. $(document).find('.sc_custom_checkbox_div').show();
  8549. if (sc_side_fold_custom_config === 2) {
  8550. $(document).find('.sc_custom_input_div').show();
  8551. }
  8552. }
  8553.  
  8554. $(document).find('#sc_custom_each_same_time_input').prop('checked', false);
  8555. $(document).find('#sc_custom_each_same_time_input_fullscreen').prop('checked', false);
  8556. if (sc_side_fold_custom_each_same_time_flag) {
  8557. $(document).find('.sc_custom_input_div').show();
  8558. $(document).find('#' + sc_custom_config_checkbox_id).prop('checked', true);
  8559.  
  8560. let the_sc_side_fold_custom_time = 10;
  8561. if (sc_side_fold_custom_time !== 0) {
  8562. the_sc_side_fold_custom_time = sc_side_fold_custom_time - 1.5;
  8563. }
  8564.  
  8565. $(document).find('#' + sc_custom_config_input_id).val(the_sc_side_fold_custom_time);
  8566. }
  8567.  
  8568. $(this).parent().fadeOut();
  8569. });
  8570.  
  8571. $(document).on('click', '#sc_func_panel_sc_item_show_config_btn', function(e) {
  8572. e = e || unsafeWindow.event;
  8573. e.preventDefault();
  8574.  
  8575. let sc_panel_show_time_config_div_id = 'sc_live_panel_show_time_config_div';
  8576. let sc_live_panel_show_time_radio_group_class = 'sc_live_panel_show_time_radio_group';
  8577. let sc_live_panel_show_time_option_name = 'sc_live_panel_show_time_option';
  8578. let sc_live_panel_show_time_sc_input_id = 'sc_live_panel_show_time_sc_input';
  8579. let sc_live_panel_show_time_sc_and_most_time_input_id = 'sc_live_panel_show_time_sc_and_most_time_input';
  8580. let sc_live_panel_show_time_click_stop_checkbox_id = 'sc_live_panel_show_time_click_stop';
  8581. if (sc_isFullscreen) {
  8582. sc_panel_show_time_config_div_id = 'sc_live_panel_show_time_config_div_fullscreen';
  8583. sc_live_panel_show_time_radio_group_class = 'sc_live_panel_show_time_radio_group_fullscreen';
  8584. sc_live_panel_show_time_option_name = 'sc_live_panel_show_time_option_fullscreen';
  8585. sc_live_panel_show_time_sc_input_id = 'sc_live_panel_show_time_sc_input_fullscreen';
  8586. sc_live_panel_show_time_sc_and_most_time_input_id = 'sc_live_panel_show_time_sc_and_most_time_input_fullscreen';
  8587. sc_live_panel_show_time_click_stop_checkbox_id = 'sc_live_panel_show_time_click_stop_fullscreen';
  8588. }
  8589. $(document).find('#' + sc_panel_show_time_config_div_id).show();
  8590. $(document).find('.'+ sc_live_panel_show_time_radio_group_class +' input[name="'+ sc_live_panel_show_time_option_name +'"]').eq(sc_panel_show_time_mode).prop('checked', true);
  8591. let the_sc_panel_show_time_each_same = sc_panel_show_time_each_same;
  8592. if (the_sc_panel_show_time_each_same === 0.5) {
  8593. the_sc_panel_show_time_each_same = 2;
  8594. }
  8595. $(document).find('#' + sc_live_panel_show_time_sc_input_id).val(the_sc_panel_show_time_each_same);
  8596. $(document).find('#' + sc_live_panel_show_time_sc_and_most_time_input_id).val(the_sc_panel_show_time_each_same);
  8597.  
  8598. $(document).find('#sc_live_panel_show_time_click_stop').prop('checked', false);
  8599. $(document).find('#sc_live_panel_show_time_click_stop').prop('checked', false);
  8600. if (sc_live_panel_show_time_click_stop_flag) {
  8601. $(document).find('#' + sc_live_panel_show_time_click_stop_checkbox_id).prop('checked', true);
  8602. }
  8603.  
  8604. $(this).parent().fadeOut();
  8605. });
  8606.  
  8607. $(document).on('click', '#sc_func_panel_width_config_btn', function(e) {
  8608. e = e || unsafeWindow.event;
  8609. e.preventDefault();
  8610.  
  8611. let sc_panel_width_config_div_id = 'sc_panel_width_config_div';
  8612. let the_sc_rectangle_width_config_val = sc_rectangle_width;
  8613. let sc_panel_width_config_input_id = 'sc_panel_width_input';
  8614. if (sc_isFullscreen) {
  8615. sc_panel_width_config_div_id = 'sc_panel_width_config_div_fullscreen';
  8616. the_sc_rectangle_width_config_val = sc_rectangle_width_fullscreen;
  8617. sc_panel_width_config_input_id = 'sc_panel_width_input_fullscreen';
  8618. }
  8619. $(document).find('#' + sc_panel_width_config_div_id).show();
  8620.  
  8621. $(document).find('#' + sc_panel_width_config_input_id).val(the_sc_rectangle_width_config_val);
  8622.  
  8623. $(this).parent().fadeOut();
  8624. });
  8625.  
  8626. $(document).on('click', '#sc_func_panel_height_config_btn', function(e) {
  8627. e = e || unsafeWindow.event;
  8628. e.preventDefault();
  8629.  
  8630. let sc_panel_height_config_div_id = 'sc_panel_height_config_div';
  8631. let the_sc_panel_height_config_val = sc_panel_list_height;
  8632. let sc_panel_height_config_input_id = 'sc_panel_height_input';
  8633. if (sc_isFullscreen) {
  8634. sc_panel_height_config_div_id = 'sc_panel_height_config_div_fullscreen';
  8635. the_sc_panel_height_config_val = sc_panel_list_height_fullscreen;
  8636. sc_panel_height_config_input_id = 'sc_panel_height_input_fullscreen';
  8637. }
  8638. $(document).find('#' + sc_panel_height_config_div_id).show();
  8639.  
  8640. $(document).find('#' + sc_panel_height_config_input_id).val(the_sc_panel_height_config_val);
  8641.  
  8642. $(this).parent().fadeOut();
  8643. });
  8644.  
  8645. $(document).on('click', '#sc_func_item_order_config_btn', function(e) {
  8646. e = e || unsafeWindow.event;
  8647. e.preventDefault();
  8648.  
  8649. let sc_item_order_config_div_id = 'sc_item_order_config_div';
  8650. let sc_item_order_config_radio_group_class = 'sc_item_order_radio_group';
  8651. let sc_item_order_config_option_name = 'sc_item_order_option';
  8652. if (sc_isFullscreen) {
  8653. sc_item_order_config_div_id = 'sc_item_order_config_div_fullscreen';
  8654. sc_item_order_config_radio_group_class = 'sc_item_order_radio_group_fullscreen';
  8655. sc_item_order_config_option_name = 'sc_item_order_option_fullscreen';
  8656. }
  8657. $(document).find('#' + sc_item_order_config_div_id).show();
  8658.  
  8659. if (sc_item_order_up_flag) {
  8660. $(document).find('.'+ sc_item_order_config_radio_group_class +' input[name="'+ sc_item_order_config_option_name +'"]').eq(1).prop('checked', true);
  8661. }
  8662.  
  8663. $(this).parent().fadeOut();
  8664. });
  8665.  
  8666. $(document).on('click', '#sc_func_item_custom_search_btn', function(e) {
  8667. e = e || unsafeWindow.event;
  8668. e.preventDefault();
  8669.  
  8670. let sc_live_search_config_div_id = 'sc_live_search_config_div';
  8671. if (sc_isFullscreen) {
  8672. sc_live_search_config_div_id = 'sc_live_search_config_div_fullscreen';
  8673. }
  8674. let the_sc_live_search_modal_div = $(document).find('#' + sc_live_search_config_div_id);
  8675. the_sc_live_search_modal_div.show();
  8676.  
  8677. $(this).parent().fadeOut(function() {
  8678. open_and_close_sc_modal('✓', '#A7C9D3', e);
  8679. });
  8680. });
  8681.  
  8682. $(document).on('click', '#sc_func_bottom_data_show_btn', function(e) {
  8683. e = e || unsafeWindow.event;
  8684. e.preventDefault();
  8685.  
  8686. data_show_bottom_flag = true;
  8687. sc_data_show_bottom_store();
  8688. $(document).find('#sc_data_show_bottom_div').show();
  8689.  
  8690. $(this).parent().fadeOut();
  8691. open_and_close_sc_modal('已设置 右侧的弹幕发送框显示数据 ✓', '#A7C9D3', e, 1);
  8692. });
  8693.  
  8694. $(document).on('click', '#sc_func_bottom_data_hide_btn', function(e) {
  8695. e = e || unsafeWindow.event;
  8696. e.preventDefault();
  8697.  
  8698. data_show_bottom_flag = false;
  8699. sc_data_show_bottom_store();
  8700. $(document).find('#sc_data_show_bottom_div').hide();
  8701.  
  8702. $(this).parent().fadeOut();
  8703. open_and_close_sc_modal('已设置 右侧的弹幕发送框隐藏数据 ✓', '#A7C9D3', e, 1);
  8704. });
  8705.  
  8706. $(document).on('click', '#sc_func_panel_allow_drag_close_btn', function(e) {
  8707. e = e || unsafeWindow.event;
  8708. e.preventDefault();
  8709.  
  8710. sc_panel_allow_drag_flag = false;
  8711. sc_panel_allow_drag_store();
  8712.  
  8713. $(this).parent().fadeOut();
  8714. open_and_close_sc_modal('已设置 锁定记录板即关闭拖拽功能 ✓', '#A7C9D3', e, 1);
  8715. });
  8716.  
  8717. $(document).on('click', '#sc_func_panel_allow_drag_open_btn', function(e) {
  8718. e = e || unsafeWindow.event;
  8719. e.preventDefault();
  8720.  
  8721. sc_panel_allow_drag_flag = true;
  8722. sc_panel_allow_drag_store();
  8723.  
  8724. $(this).parent().fadeOut();
  8725. open_and_close_sc_modal('已设置 解锁记录板即开放拖拽功能 ✓', '#A7C9D3', e, 1);
  8726. });
  8727.  
  8728. $(document).on('click', '#sc_func_panel_switch_open_mode_btn', function(e) {
  8729. e = e || unsafeWindow.event;
  8730. e.preventDefault();
  8731.  
  8732. $(document).find('.sc_long_buttons').show();
  8733. sc_rectangle_is_slide_down = false;
  8734. sc_foldback();
  8735.  
  8736. $(this).parent().fadeOut();
  8737. open_and_close_sc_modal('已切换到展开模式 ✓', '#A7C9D3', e, 1);
  8738. });
  8739.  
  8740. $(document).on('click', '#sc_circle_welt_hide_half_true_btn', function(e) {
  8741. e = e || unsafeWindow.event;
  8742. e.preventDefault();
  8743.  
  8744. sc_welt_hide_circle_half_flag = true;
  8745. sc_welt_hide_circle_half_store();
  8746. sc_circle_welt_hide_half();
  8747.  
  8748. $(this).parent().fadeOut();
  8749. open_and_close_sc_modal('已设置 小图标在贴边后半隐藏 ✓', '#A7C9D3', e, 1);
  8750. });
  8751.  
  8752. $(document).on('click', '#sc_circle_welt_hide_half_false_btn', function(e) {
  8753. e = e || unsafeWindow.event;
  8754. e.preventDefault();
  8755.  
  8756. sc_welt_hide_circle_half_flag = false;
  8757. sc_welt_hide_circle_half_store();
  8758.  
  8759. let sc_circles = $(document).find('.sc_long_circle');
  8760. sc_circles.removeClass('sc_circle_x_left_hide_animate');
  8761. sc_circles.removeClass('sc_circle_x_right_hide_animate');
  8762. sc_circles.removeClass('sc_circle_y_top_hide_animate');
  8763. sc_circles.removeClass('sc_circle_y_bottom_hide_animate');
  8764.  
  8765. $(this).parent().fadeOut();
  8766. open_and_close_sc_modal('已设置 取消小图标在贴边后半隐藏 ✓', '#A7C9D3', e, 1);
  8767. });
  8768.  
  8769. $(document).on('click', '#sc_func_item_show_time_btn', function(e) {
  8770. e = e || unsafeWindow.event;
  8771. e.preventDefault();
  8772.  
  8773. $(document).find('.sc_start_time').show();
  8774. sc_start_time_show_flag = true;
  8775. sc_start_time_show_store();
  8776.  
  8777. $(this).parent().fadeOut();
  8778. open_and_close_sc_modal('已设置 显示醒目留言发送具体时间 ✓', '#A7C9D3', e, 1);
  8779. });
  8780.  
  8781. $(document).on('click', '#sc_func_item_hide_time_btn', function(e) {
  8782. e = e || unsafeWindow.event;
  8783. e.preventDefault();
  8784.  
  8785. $(document).find('.sc_start_time').hide();
  8786. sc_start_time_show_flag = false;
  8787. sc_start_time_show_store();
  8788.  
  8789. $(this).parent().fadeOut();
  8790. open_and_close_sc_modal('已设置 隐藏醒目留言发送具体时间 ✓', '#A7C9D3', e, 1);
  8791. });
  8792.  
  8793. $(document).on('click', '#sc_func_live_sidebar_left_btn', function(e) {
  8794. e = e || unsafeWindow.event;
  8795. e.preventDefault();
  8796.  
  8797. sc_live_sidebar_left_flag = true;
  8798. sc_live_sidebar_position_left_apply();
  8799. sc_live_sidebar_left_flag_store();
  8800.  
  8801. $(this).parent().fadeOut();
  8802. open_and_close_sc_modal('已设置 直播间功能按钮在左侧 ✓', '#A7C9D3', e, 1);
  8803. });
  8804.  
  8805. $(document).on('click', '#sc_func_live_sidebar_right_btn', function(e) {
  8806. e = e || unsafeWindow.event;
  8807. e.preventDefault();
  8808.  
  8809. sc_live_sidebar_left_flag = false;
  8810. sc_live_sidebar_position_right_apply();
  8811. sc_live_sidebar_left_flag_store();
  8812.  
  8813. $(this).parent().fadeOut();
  8814. open_and_close_sc_modal('已恢复直播间功能按钮在右侧 ✓', '#A7C9D3', e, 1);
  8815. });
  8816.  
  8817. $(document).on('click', '#sc_func_no_remember_show_sc_list_btn', function(e) {
  8818. e = e || unsafeWindow.event;
  8819. e.preventDefault();
  8820.  
  8821. sc_panel_list_no_remember_show();
  8822.  
  8823. if (sc_live_panel_show_time_click_stop_flag) {
  8824. // 暂停过期检查
  8825. $(document).find('.sc_long_list').addClass('sc_long_expire_check_stop');
  8826. }
  8827.  
  8828. $(this).parent().fadeOut();
  8829. open_and_close_sc_modal('已显示醒目留言列表,该操作不会记忆 ✓', '#A7C9D3', e, 1);
  8830. });
  8831.  
  8832. $(document).on('click', '#sc_func_no_remember_hide_sc_list_btn', function(e) {
  8833. e = e || unsafeWindow.event;
  8834. e.preventDefault();
  8835.  
  8836. sc_panel_list_no_remember_hide();
  8837.  
  8838. $(this).parent().fadeOut();
  8839. open_and_close_sc_modal('已隐藏醒目留言列表,该操作不会记忆 ✓', '#A7C9D3', e, 1);
  8840. });
  8841.  
  8842. $(document).on('click', '#sc_func_no_remember_hide_expire_sc_btn', function(e) {
  8843. e = e || unsafeWindow.event;
  8844. e.preventDefault();
  8845.  
  8846. // 隐藏已经标记的
  8847. $(document).find('.sc_long_expire_tag_item').fadeOut(500);
  8848.  
  8849. if (sc_live_panel_show_time_click_stop_flag) {
  8850. // 重启过期检查
  8851. $(document).find('.sc_long_list').removeClass('sc_long_expire_check_stop');
  8852. }
  8853.  
  8854. $(this).parent().fadeOut();
  8855. open_and_close_sc_modal('已隐藏过期醒目留言,该操作不会记忆 ✓', '#A7C9D3', e, 1);
  8856. });
  8857.  
  8858. $(document).on('click', '#sc_func_live_sc_to_danmu_show_btn', function(e) {
  8859. e = e || unsafeWindow.event;
  8860. e.preventDefault();
  8861.  
  8862. let sc_live_sc_to_danmu_show_config_div_id = 'sc_live_sc_to_danmu_show_config_div';
  8863. let sc_live_sc_to_danmu_show_config_checkbox_id = 'sc_live_sc_to_danmu_show_checkbox';
  8864. let sc_live_sc_to_danmu_show_radio_group_class = 'sc_live_sc_to_danmu_show_radio_group';
  8865. let sc_live_sc_to_danmu_show_location_option_name = 'sc_live_sc_to_danmu_show_location_option';
  8866. let sc_live_sc_to_danmu_show_mode_option_name = 'sc_live_sc_to_danmu_show_mode_option';
  8867. let sc_live_sc_to_danmu_no_remain_config_checkbox_id = 'sc_live_sc_to_danmu_no_remain_checkbox';
  8868. if (sc_isFullscreen) {
  8869. sc_live_sc_to_danmu_show_config_div_id = 'sc_live_sc_to_danmu_show_config_div_fullscreen';
  8870. sc_live_sc_to_danmu_show_config_checkbox_id = 'sc_live_sc_to_danmu_show_checkbox_fullscreen';
  8871. sc_live_sc_to_danmu_show_radio_group_class = 'sc_live_sc_to_danmu_show_radio_group_fullscreen';
  8872. sc_live_sc_to_danmu_show_location_option_name = 'sc_live_sc_to_danmu_show_location_option_fullscreen';
  8873. sc_live_sc_to_danmu_show_mode_option_name = 'sc_live_sc_to_danmu_show_mode_option_fullscreen';
  8874. sc_live_sc_to_danmu_no_remain_config_checkbox_id = 'sc_live_sc_to_danmu_no_remain_checkbox_fullscreen';
  8875. }
  8876. $(document).find('#' + sc_live_sc_to_danmu_show_config_div_id).show();
  8877.  
  8878. $(document).find('#sc_live_sc_to_danmu_show_checkbox').prop('checked', false);
  8879. $(document).find('#sc_live_sc_to_danmu_show_checkbox_fullscreen').prop('checked', false);
  8880. if (sc_live_sc_to_danmu_show_flag) {
  8881. $(document).find('#' + sc_live_sc_to_danmu_show_config_checkbox_id).prop('checked', true);
  8882. }
  8883.  
  8884. $(document).find('.'+ sc_live_sc_to_danmu_show_radio_group_class +' input[name="'+ sc_live_sc_to_danmu_show_location_option_name +'"]').eq(sc_live_sc_to_danmu_show_location).prop('checked', true);
  8885.  
  8886. $(document).find('.'+ sc_live_sc_to_danmu_show_radio_group_class +' input[name="'+ sc_live_sc_to_danmu_show_mode_option_name +'"]').eq(sc_live_sc_to_danmu_show_mode).prop('checked', true);
  8887.  
  8888. $(document).find('#sc_live_sc_to_danmu_no_remain_checkbox').prop('checked', false);
  8889. $(document).find('#sc_live_sc_to_danmu_no_remain_checkbox_fullscreen').prop('checked', false);
  8890. if (sc_live_sc_to_danmu_no_remain_flag) {
  8891. $(document).find('#' + sc_live_sc_to_danmu_no_remain_config_checkbox_id).prop('checked', true);
  8892. }
  8893.  
  8894. $(this).parent().fadeOut();
  8895. });
  8896.  
  8897.  
  8898.  
  8899. $(document).on('click', '#sc_func_fullscreen_separate_memory_btn', function(e) {
  8900. e = e || unsafeWindow.event;
  8901. e.preventDefault();
  8902.  
  8903. let sc_fullscreen_separate_memory_config_div_id = 'sc_fullscreen_separate_memory_config_div';
  8904. let sc_fullscreen_separate_memory_config_checkbox_id = 'sc_some_fullscreen_separate_memory';
  8905. if (sc_isFullscreen) {
  8906. sc_fullscreen_separate_memory_config_div_id = 'sc_fullscreen_separate_memory_config_div_fullscreen';
  8907. sc_fullscreen_separate_memory_config_checkbox_id = 'sc_some_fullscreen_separate_memory_fullscreen';
  8908. }
  8909. $(document).find('#' + sc_fullscreen_separate_memory_config_div_id).show();
  8910.  
  8911. $(document).find('#sc_some_fullscreen_separate_memory').prop('checked', false);
  8912. $(document).find('#sc_some_fullscreen_separate_memory_fullscreen').prop('checked', false);
  8913. if (sc_live_fullscreen_config_separate_memory_flag) {
  8914. $(document).find('#' + sc_fullscreen_separate_memory_config_checkbox_id).prop('checked', true);
  8915. }
  8916.  
  8917. $(this).parent().fadeOut();
  8918. });
  8919.  
  8920. $(document).on('click', '#sc_func_live_special_tip_config_btn', function(e) {
  8921. e = e || unsafeWindow.event;
  8922. e.preventDefault();
  8923.  
  8924. let sc_live_special_tip_config_div_id = 'sc_live_special_tip_config_div';
  8925. let sc_live_special_tip_location_radio_group_class = 'sc_live_special_tip_radio_group';
  8926. let sc_live_special_tip_location_option_name = 'sc_live_special_tip_option';
  8927. let sc_live_special_danmu_mode_option_name = 'sc_live_special_danmu_mode_option';
  8928. let sc_live_special_tip_textarea_id = 'sc_live_special_tip_textarea_content';
  8929. let sc_live_special_msg_config_checkbox_id = 'sc_live_special_msg_checkbox';
  8930. let sc_live_special_sc_config_checkbox_id = 'sc_live_special_sc_checkbox';
  8931. let sc_live_special_sc_no_remain_flag_config_checkbox_id = 'sc_live_special_sc_no_remain_checkbox';
  8932. if (sc_isFullscreen) {
  8933. sc_live_special_tip_config_div_id = 'sc_live_special_tip_config_div_fullscreen';
  8934. sc_live_special_tip_location_radio_group_class = 'sc_live_special_tip_radio_group_fullscreen';
  8935. sc_live_special_tip_location_option_name = 'sc_live_special_tip_option_fullscreen';
  8936. sc_live_special_danmu_mode_option_name = 'sc_live_special_danmu_mode_option_fullscreen';
  8937. sc_live_special_tip_textarea_id = 'sc_live_special_tip_textarea_content_fullscreen';
  8938. sc_live_special_msg_config_checkbox_id = 'sc_live_special_msg_checkbox_fullscreen';
  8939. sc_live_special_sc_config_checkbox_id = 'sc_live_special_sc_checkbox_fullscreen';
  8940. sc_live_special_sc_no_remain_flag_config_checkbox_id = 'sc_live_special_sc_no_remain_checkbox_fullscreen';
  8941. }
  8942. $(document).find('#' + sc_live_special_tip_config_div_id).show();
  8943.  
  8944. $(document).find('#' + sc_live_special_tip_textarea_id).val(sc_live_special_tip_str);
  8945.  
  8946. $(document).find('.'+ sc_live_special_tip_location_radio_group_class +' input[name="'+ sc_live_special_tip_location_option_name +'"]').eq(sc_live_special_tip_location).prop('checked', true);
  8947.  
  8948. $(document).find('#sc_live_special_msg_checkbox').prop('checked', false);
  8949. $(document).find('#sc_live_special_msg_checkbox_fullscreen').prop('checked', false);
  8950. if (sc_live_special_msg_flag) {
  8951. $(document).find('#' + sc_live_special_msg_config_checkbox_id).prop('checked', true);
  8952. }
  8953.  
  8954. $(document).find('#sc_live_special_sc_checkbox').prop('checked', false);
  8955. $(document).find('#sc_live_special_sc_checkbox_fullscreen').prop('checked', false);
  8956. if (sc_live_special_sc_flag) {
  8957. $(document).find('#' + sc_live_special_sc_config_checkbox_id).prop('checked', true);
  8958. }
  8959.  
  8960. $(document).find('#sc_live_special_sc_no_remain_checkbox').prop('checked', false);
  8961. $(document).find('#sc_live_special_sc_no_remain_checkbox_fullscreen').prop('checked', false);
  8962. if (sc_live_special_sc_no_remain_flag) {
  8963. $(document).find('#' + sc_live_special_sc_no_remain_flag_config_checkbox_id).prop('checked', true);
  8964. }
  8965.  
  8966. $(document).find('.'+ sc_live_special_tip_location_radio_group_class +' input[name="'+ sc_live_special_danmu_mode_option_name +'"]').eq(sc_live_special_danmu_mode).prop('checked', true);
  8967.  
  8968. $(this).parent().fadeOut();
  8969. });
  8970.  
  8971. $(document).on('click', '#sc_func_live_other_config_btn', function(e) {
  8972. e = e || unsafeWindow.event;
  8973. e.preventDefault();
  8974.  
  8975. let sc_live_other_config_div_id = 'sc_live_other_config_div';
  8976. let the_sc_data_show_high_energy_num_flag = sc_data_show_high_energy_num_flag;
  8977. let sc_live_other_config_radio_group_class = 'sc_live_other_radio_group';
  8978. let sc_live_other_config_radio_option_name = 'sc_live_other_option';
  8979. let sc_live_other_auto_hide_config_checkbox_id = 'sc_live_other_fullscreen_auto_hide_list';
  8980. let sc_live_other_start_time_simple_flag_checkbox_id = 'sc_live_other_start_time_simple_flag';
  8981. let sc_live_other_search_shortkey_flag_checkbox_id = 'sc_live_other_search_shortkey_flag';
  8982. let sc_live_other_auto_tianxuan_flag_checkbox_id = 'sc_live_other_auto_tianxuan_flag';
  8983. let sc_live_other_auto_dm_combo_flag_checkbox_id = 'sc_live_other_auto_dm_combo_flag';
  8984. if (sc_isFullscreen) {
  8985. sc_live_other_config_div_id = 'sc_live_other_config_div_fullscreen';
  8986. the_sc_data_show_high_energy_num_flag = sc_data_show_high_energy_num_flag_fullscreen;
  8987. sc_live_other_config_radio_group_class = 'sc_live_other_radio_group_fullscreen';
  8988. sc_live_other_config_radio_option_name = 'sc_live_other_option_fullscreen';
  8989. sc_live_other_auto_hide_config_checkbox_id = 'sc_live_other_fullscreen_auto_hide_list_fullscreen';
  8990. sc_live_other_start_time_simple_flag_checkbox_id = 'sc_live_other_start_time_simple_flag_fullscreen';
  8991. sc_live_other_search_shortkey_flag_checkbox_id = 'sc_live_other_search_shortkey_flag_fullscreen';
  8992. sc_live_other_auto_tianxuan_flag_checkbox_id = 'sc_live_other_auto_tianxuan_flag_fullscreen';
  8993. sc_live_other_auto_dm_combo_flag_checkbox_id = 'sc_live_other_auto_dm_combo_flag_fullscreen';
  8994. }
  8995. $(document).find('#' + sc_live_other_config_div_id).show();
  8996.  
  8997. if (the_sc_data_show_high_energy_num_flag) {
  8998. $(document).find('.'+ sc_live_other_config_radio_group_class +' input[name="'+ sc_live_other_config_radio_option_name +'"]').eq(1).prop('checked', true);
  8999. }
  9000.  
  9001. $(document).find('#sc_live_other_fullscreen_auto_hide_list').prop('checked', false);
  9002. $(document).find('#sc_live_other_fullscreen_auto_hide_list_fullscreen').prop('checked', false);
  9003. if (sc_side_fold_fullscreen_auto_hide_list_flag) {
  9004. $(document).find('#' + sc_live_other_auto_hide_config_checkbox_id).prop('checked', true);
  9005. }
  9006.  
  9007. $(document).find('#sc_live_other_start_time_simple_flag').prop('checked', false);
  9008. $(document).find('#sc_live_other_start_time_simple_flag_fullscreen').prop('checked', false);
  9009. if (sc_start_time_simple_flag) {
  9010. $(document).find('#' + sc_live_other_start_time_simple_flag_checkbox_id).prop('checked', true);
  9011. }
  9012.  
  9013. $(document).find('#sc_live_other_search_shortkey_flag').prop('checked', false);
  9014. $(document).find('#sc_live_other_search_shortkey_flag_fullscreen').prop('checked', false);
  9015. if (sc_list_search_shortkey_flag) {
  9016. $(document).find('#' + sc_live_other_search_shortkey_flag_checkbox_id).prop('checked', true);
  9017. }
  9018.  
  9019. $(document).find('#sc_live_other_auto_tianxuan_flag').prop('checked', false);
  9020. $(document).find('#sc_live_other_auto_tianxuan_flag_fullscreen').prop('checked', false);
  9021. if (sc_live_auto_tianxuan_flag) {
  9022. $(document).find('#' + sc_live_other_auto_tianxuan_flag_checkbox_id).prop('checked', true);
  9023. }
  9024.  
  9025. $(document).find('#sc_live_other_auto_dm_combo_flag').prop('checked', false);
  9026. $(document).find('#sc_live_other_auto_dm_combo_flag_fullscreen').prop('checked', false);
  9027. if (sc_live_send_dm_combo_flag) {
  9028. $(document).find('#' + sc_live_other_auto_dm_combo_flag_checkbox_id).prop('checked', true);
  9029. }
  9030.  
  9031. $(this).parent().fadeOut();
  9032. });
  9033.  
  9034. // 创建一个自定义右键菜单
  9035. let sc_copy_button1 = document.createElement('button');
  9036. sc_copy_button1.className = 'sc_search_btn';
  9037. sc_copy_button1.id = 'sc_copy_content_btn';
  9038. sc_copy_button1.innerHTML = '点击复制内容(快速复制)';
  9039. sc_copy_button1.style.marginBottom = '2px';
  9040.  
  9041. let sc_copy_button2 = document.createElement('button');
  9042. sc_copy_button2.className = 'sc_copy_btn';
  9043. sc_copy_button2.id = 'sc_copy_has_time_btn';
  9044. sc_copy_button2.innerHTML = '点击复制为图片(有时间)';
  9045. sc_copy_button2.style.marginBottom = '2px';
  9046.  
  9047. let sc_copy_button3 = document.createElement('button');
  9048. sc_copy_button3.className = 'sc_copy_btn';
  9049. sc_copy_button3.id = 'sc_copy_no_time_btn';
  9050. sc_copy_button3.innerHTML = '点击复制为图片(没时间)';
  9051. sc_copy_button3.style.marginBottom = '2px';
  9052.  
  9053. let sc_copy_button4 = document.createElement('button');
  9054. sc_copy_button4.className = 'sc_copy_btn';
  9055. sc_copy_button4.id = 'sc_copy_uname_color_btn';
  9056. sc_copy_button4.innerHTML = '点击复制为图片(名颜色)';
  9057. sc_copy_button4.style.marginBottom = '2px';
  9058.  
  9059. let sc_copy_button5 = document.createElement('button');
  9060. sc_copy_button5.className = 'sc_search_btn';
  9061. sc_copy_button5.id = 'sc_pos_to_newest_btn';
  9062. sc_copy_button5.innerHTML = '到达最新留言(快速定位)';
  9063. sc_copy_button5.style.marginBottom = '2px';
  9064.  
  9065. let sc_copy_button6 = document.createElement('button');
  9066. sc_copy_button6.className = 'sc_search_btn';
  9067. sc_copy_button6.id = 'sc_pos_first_unfold_btn';
  9068. sc_copy_button6.innerHTML = '最早未折叠的(快速定位)';
  9069. sc_copy_button6.style.marginBottom = '2px';
  9070.  
  9071. let sc_copy_button7 = document.createElement('button');
  9072. sc_copy_button7.className = 'sc_search_btn';
  9073. sc_copy_button7.id = 'sc_pos_last_fold_btn';
  9074. sc_copy_button7.innerHTML = '最后已折叠的(快速定位)';
  9075. sc_copy_button7.style.marginBottom = '2px';
  9076.  
  9077. let sc_copy_button8 = document.createElement('button');
  9078. sc_copy_button8.className = 'sc_search_btn';
  9079. sc_copy_button8.id = 'sc_pos_half_hour_ago_btn';
  9080. sc_copy_button8.innerHTML = '半个小时前的(快速定位)';
  9081. sc_copy_button8.style.marginBottom = '2px';
  9082.  
  9083. let sc_copy_button9 = document.createElement('button');
  9084. sc_copy_button9.className = 'sc_search_btn';
  9085. sc_copy_button9.id = 'sc_pos_more_search_btn';
  9086. sc_copy_button9.innerHTML = '更多定义搜索(快速定位)';
  9087.  
  9088. let sc_copy_br1 = document.createElement('br');
  9089. let sc_copy_br2 = document.createElement('br');
  9090. let sc_copy_br3 = document.createElement('br');
  9091. let sc_copy_br4 = document.createElement('br');
  9092. let sc_copy_br5 = document.createElement('br');
  9093. let sc_copy_br6 = document.createElement('br');
  9094. let sc_copy_br7 = document.createElement('br');
  9095. let sc_copy_br8 = document.createElement('br');
  9096.  
  9097. let sc_copy_context_menu = document.createElement('div');
  9098. sc_copy_context_menu.id = 'sc_context_menu_copy_body';
  9099. sc_copy_context_menu.className = 'sc_ctx_copy_menu';
  9100. sc_copy_context_menu.style.position = 'fixed';
  9101. sc_copy_context_menu.style.display = 'none';
  9102. sc_copy_context_menu.style.backgroundColor = '#ffffff';
  9103. sc_copy_context_menu.style.border = 0;
  9104. sc_copy_context_menu.style.padding = '5px';
  9105. sc_copy_context_menu.style.zIndex = 3333;
  9106.  
  9107. sc_copy_context_menu.appendChild(sc_copy_button1);
  9108. sc_copy_context_menu.appendChild(sc_copy_br1);
  9109. sc_copy_context_menu.appendChild(sc_copy_button2);
  9110. sc_copy_context_menu.appendChild(sc_copy_br2);
  9111. sc_copy_context_menu.appendChild(sc_copy_button3);
  9112. sc_copy_context_menu.appendChild(sc_copy_br3);
  9113. sc_copy_context_menu.appendChild(sc_copy_button4);
  9114. sc_copy_context_menu.appendChild(sc_copy_br4);
  9115. sc_copy_context_menu.appendChild(sc_copy_button5);
  9116. sc_copy_context_menu.appendChild(sc_copy_br5);
  9117. sc_copy_context_menu.appendChild(sc_copy_button6);
  9118. sc_copy_context_menu.appendChild(sc_copy_br6);
  9119. sc_copy_context_menu.appendChild(sc_copy_button7);
  9120. sc_copy_context_menu.appendChild(sc_copy_br7);
  9121. sc_copy_context_menu.appendChild(sc_copy_button8);
  9122. sc_copy_context_menu.appendChild(sc_copy_br8);
  9123. sc_copy_context_menu.appendChild(sc_copy_button9);
  9124.  
  9125. // 将复制的右键菜单添加到body中
  9126. document.body.appendChild(sc_copy_context_menu);
  9127.  
  9128. let sc_copy_context_menu_fullscreen = sc_copy_context_menu.cloneNode(true);
  9129. sc_copy_context_menu_fullscreen.id = 'sc_copy_context_menu_fullscreen';
  9130. $(live_player_div).append(sc_copy_context_menu_fullscreen);
  9131.  
  9132. $(document).on('mouseover', '.sc_copy_btn, .sc_func_btn, .sc_search_btn', function() {
  9133. $(this).css('transform', 'translateX(-2px)');
  9134. setTimeout(function() {
  9135. $(document).find('.sc_copy_btn, .sc_func_btn, .sc_search_btn').css('transform', 'translateY(0)');
  9136. }, 200);
  9137.  
  9138. })
  9139.  
  9140. $(document).on('click', '#sc_copy_content_btn', function(e) {
  9141. e = e || unsafeWindow.event;
  9142. e.preventDefault();
  9143.  
  9144. let current_sc_div = $(sc_copy_context_menu).data('current_sc_div');
  9145. let the_current_sc_content = $(current_sc_div).find('.sc_msg_body span').text();
  9146.  
  9147. $(this).parent().fadeOut();
  9148.  
  9149. navigator.clipboard.writeText(the_current_sc_content).then(() => {
  9150. open_and_close_sc_modal('✓ 复制成功', '#A7C9D3', e, 1);
  9151. }).catch(err => {
  9152. open_and_close_sc_modal('✗ 复制失败', 'red', e, 1);
  9153. });
  9154. });
  9155.  
  9156. $(document).on('click', '#sc_pos_to_newest_btn', function(e) {
  9157. e = e || unsafeWindow.event;
  9158. e.preventDefault();
  9159.  
  9160. if (sc_isFullscreen) {
  9161. let the_match_item_divs_live = document.querySelectorAll('#live-player .sc_long_item');
  9162. let the_search_item_div_live = the_match_item_divs_live[0];
  9163. if (sc_item_order_up_flag) {
  9164. the_search_item_div_live = the_match_item_divs_live[the_match_item_divs_live.length - 1];
  9165. }
  9166. the_search_item_div_live.scrollIntoView({block: 'center' });
  9167.  
  9168. } else {
  9169. let the_match_item_divs_body = document.querySelectorAll('.sc_long_item');
  9170. let the_search_item_div_body = the_match_item_divs_body[0];
  9171. if (sc_item_order_up_flag) {
  9172. the_search_item_div_body = the_match_item_divs_body[the_match_item_divs_body.length - 1];
  9173. }
  9174. the_search_item_div_body.scrollIntoView({block: 'center' });
  9175. }
  9176.  
  9177. $(this).parent().fadeOut(function() {
  9178. open_and_close_sc_modal('✓', '#A7C9D3', e);
  9179. });
  9180. });
  9181.  
  9182. $(document).on('click', '#sc_pos_first_unfold_btn', function(e) {
  9183. e = e || unsafeWindow.event;
  9184. e.preventDefault();
  9185.  
  9186. if (sc_isFullscreen) {
  9187. let the_match_item_divs_live = document.querySelectorAll('#live-player .sc_long_item[data-fold="0"]');
  9188. let the_search_item_div_live = the_match_item_divs_live[the_match_item_divs_live.length - 1];
  9189. the_search_item_div_live.scrollIntoView({block: 'center' });
  9190.  
  9191. } else {
  9192. let the_match_item_divs_body = document.querySelectorAll('.sc_long_item[data-fold="0"]');
  9193. let the_search_item_div_body = the_match_item_divs_body[the_match_item_divs_body.length - 1];
  9194. the_search_item_div_body.scrollIntoView({block: 'center' });
  9195. }
  9196.  
  9197. $(this).parent().fadeOut(function() {
  9198. open_and_close_sc_modal('✓', '#A7C9D3', e);
  9199. });
  9200. });
  9201.  
  9202. $(document).on('click', '#sc_pos_last_fold_btn', function(e) {
  9203. e = e || unsafeWindow.event;
  9204. e.preventDefault();
  9205.  
  9206. if (sc_isFullscreen) {
  9207. let the_match_item_divs_live = document.querySelectorAll('#live-player .sc_long_item[data-fold="1"]');
  9208. if (the_match_item_divs_live.length) {
  9209. let the_search_item_div_live = the_match_item_divs_live[0];
  9210. the_search_item_div_live.scrollIntoView({block: 'center' });
  9211. }
  9212.  
  9213. } else {
  9214. let the_match_item_divs_body = document.querySelectorAll('.sc_long_item[data-fold="1"]');
  9215. if (the_match_item_divs_body.length) {
  9216. let the_search_item_div_body = the_match_item_divs_body[0];
  9217. the_search_item_div_body.scrollIntoView({block: 'center' });
  9218. }
  9219. }
  9220.  
  9221. $(this).parent().fadeOut(function() {
  9222. open_and_close_sc_modal('✓', '#A7C9D3', e);
  9223. });
  9224. });
  9225.  
  9226. $(document).on('click', '#sc_pos_half_hour_ago_btn', function(e) {
  9227. e = e || unsafeWindow.event;
  9228. e.preventDefault();
  9229.  
  9230. if (sc_isFullscreen) {
  9231. let the_closest_div = find_time_closest_div('#live-player .sc_long_item', 30);
  9232. if (the_closest_div) {
  9233. the_closest_div.scrollIntoView({block: 'center' });
  9234. }
  9235. } else {
  9236. let the_closest_div = find_time_closest_div('.sc_long_item', 30);
  9237. if (the_closest_div) {
  9238. the_closest_div.scrollIntoView({block: 'center' });
  9239. }
  9240. }
  9241.  
  9242. $(this).parent().fadeOut(function() {
  9243. open_and_close_sc_modal('✓', '#A7C9D3', e);
  9244. });
  9245. });
  9246.  
  9247. $(document).on('click', '#sc_pos_more_search_btn', function(e) {
  9248. e = e || unsafeWindow.event;
  9249. e.preventDefault();
  9250.  
  9251. let sc_live_search_config_div_id = 'sc_live_search_config_div';
  9252. if (sc_isFullscreen) {
  9253. sc_live_search_config_div_id = 'sc_live_search_config_div_fullscreen';
  9254. }
  9255. let the_sc_live_search_modal_div = $(document).find('#' + sc_live_search_config_div_id);
  9256. the_sc_live_search_modal_div.show();
  9257.  
  9258. let current_sc_div = $(sc_copy_context_menu).data('current_sc_div');
  9259. let the_current_user_name = $(current_sc_div).find('.sc_font_color').text();
  9260. the_sc_live_search_modal_div.find('.sc_live_search_user_name_input').val(the_current_user_name);
  9261.  
  9262. $(this).parent().fadeOut(function() {
  9263. open_and_close_sc_modal('✓', '#A7C9D3', e);
  9264. });
  9265. });
  9266.  
  9267. $(document).on('click', '.sc_copy_btn', function(e) {
  9268. e = e || unsafeWindow.event;
  9269. e.preventDefault();
  9270.  
  9271. $(document).find('.sc_long_rectangle').css('cursor', 'progress');
  9272.  
  9273. sc_after_click_func_btn_apply(e, true);
  9274.  
  9275. let the_copy_sc_panel_side_fold_flag = sc_panel_side_fold_flag;
  9276. let the_copy_sc_rectangle_width = sc_rectangle_width;
  9277. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  9278. the_copy_sc_panel_side_fold_flag = sc_panel_side_fold_flag_fullscreen;
  9279. the_copy_sc_rectangle_width = sc_rectangle_width_fullscreen;
  9280. }
  9281.  
  9282. function capture_gen_canvas(tmp_sc_item_div, current_sc_div) {
  9283.  
  9284. return new Promise((resolve, reject) => {
  9285. html2canvas(tmp_sc_item_div, {
  9286. useCORS: true,
  9287. allowTaint: true,
  9288. backgroundColor: null,
  9289. logging: false,
  9290. width: current_sc_div.clientWidth,
  9291. height: current_sc_div.clientHeight,
  9292. scale: 8 // 数值越大,分辨率越大,越清晰,至少4倍才比较清晰
  9293. }).then(canvas => {
  9294.  
  9295. resolve(canvas);
  9296. }).catch(error => {
  9297.  
  9298. reject(error);
  9299. });
  9300. });
  9301. }
  9302.  
  9303. let sc_copy_btn_id = $(this).attr('id');
  9304.  
  9305. $(this).parent().fadeOut(function() {
  9306. let current_sc_div = $(sc_copy_context_menu).data('current_sc_div');
  9307.  
  9308. if (the_copy_sc_panel_side_fold_flag) {
  9309. $(current_sc_div).css('width', (the_copy_sc_rectangle_width - 22) + 'px');
  9310. sc_side_fold_out_one($(current_sc_div));
  9311. if ($(current_sc_div).attr('data-fold') === '0') {
  9312. $(current_sc_div).css('height', $(current_sc_div).attr('data-height') + 'px');
  9313. }
  9314. }
  9315.  
  9316. let tmp_sc_item = $(current_sc_div).clone(); // 为了去掉animation的影响
  9317. tmp_sc_item.width(current_sc_div.clientWidth);
  9318. tmp_sc_item.height(current_sc_div.clientHeight);
  9319. tmp_sc_item.css('animation', 'unset');
  9320. tmp_sc_item.find('.sc_font_color').css('color', '#000000');
  9321. tmp_sc_item.find('.sc_start_time').show();
  9322.  
  9323. if (sc_copy_btn_id === 'sc_copy_no_time_btn') {
  9324. tmp_sc_item.find('.sc_start_time').hide();
  9325. } else if (sc_copy_btn_id === 'sc_copy_uname_color_btn') {
  9326. tmp_sc_item.find('.sc_start_time').hide();
  9327. let this_sc_uname_data_color = tmp_sc_item.find('.sc_font_color').attr('data-color');
  9328. tmp_sc_item.find('.sc_font_color').css('color', this_sc_uname_data_color);
  9329. }
  9330.  
  9331. if (tmp_sc_item.find('.fans_medal_item').length) {
  9332. // 粉丝牌存在时,可以兼容名字过长的情况
  9333. tmp_sc_item.find('.sc_msg_head_left').css('width', '170px');
  9334. tmp_sc_item.find('.sc_uname_div').css('width', '225px');
  9335. tmp_sc_item.find('.sc_msg_head_right').css('height', '20px');
  9336. }
  9337.  
  9338. document.body.appendChild(tmp_sc_item[0]);
  9339.  
  9340. capture_gen_canvas(tmp_sc_item[0], current_sc_div).then(canvas => {
  9341. canvas.toBlob(blob => {
  9342. navigator.clipboard.write([
  9343. new ClipboardItem({'image/png': blob})
  9344. ]).then(() => {
  9345. open_and_close_sc_modal('✓', '#A7C9D3', e);
  9346. }).catch(err => {
  9347. open_and_close_sc_modal('✗', 'red', e);
  9348. console.error('复制SC图片失败', err);
  9349. });
  9350. });
  9351. }).catch(error => {
  9352. console.error('处理html2canvas方法错误', error);
  9353. });
  9354.  
  9355. document.body.removeChild(tmp_sc_item[0]);
  9356.  
  9357. if (the_copy_sc_panel_side_fold_flag) {
  9358. $(current_sc_div).css('width', '');
  9359. $(current_sc_div).css('height', '');
  9360. sc_side_fold_in_one($(current_sc_div));
  9361. }
  9362. });
  9363. });
  9364.  
  9365. let sc_context_copy_menu_timeout_id;
  9366. let sc_context_func_menu_timeout_id;
  9367.  
  9368. $(document).on('mouseleave', '.sc_ctx_copy_menu', function(e) {
  9369. sc_context_copy_menu_timeout_id = setTimeout(() => {
  9370. $(this).hide();
  9371. sc_after_click_func_btn_apply(e, true);
  9372. }, 1000);
  9373. });
  9374.  
  9375. $(document).on('mouseover', '.sc_ctx_copy_menu', function() {
  9376. clearTimeout(sc_context_copy_menu_timeout_id);
  9377. });
  9378.  
  9379. $(document).on('mouseleave', '.sc_ctx_func_menu', function(e) {
  9380. sc_context_func_menu_timeout_id = setTimeout(() => {
  9381. $(this).hide();
  9382. sc_after_click_func_btn_apply(e, true);
  9383. }, 1000);
  9384. });
  9385.  
  9386. $(document).on('mouseover', '.sc_ctx_func_menu', function() {
  9387. clearTimeout(sc_context_func_menu_timeout_id);
  9388. });
  9389.  
  9390. $(document).on('contextmenu', '.sc_long_item', function(e) {
  9391. e = e || unsafeWindow.event;
  9392. e.preventDefault();
  9393.  
  9394. // 存储当前右键的div
  9395. $(document).find('.sc_ctx_copy_menu').data('current_sc_div', this);
  9396. let the_sc_ctx_menu_id = 'sc_context_menu_copy_body';
  9397. if (sc_isFullscreen) {
  9398. the_sc_ctx_menu_id = 'sc_copy_context_menu_fullscreen';
  9399. }
  9400.  
  9401. if (unsafeWindow.innerWidth - e.clientX <= 200) {
  9402. e.clientX = unsafeWindow.innerWidth - 200;
  9403. }
  9404. if (unsafeWindow.innerHeight - e.clientY <= 100) {
  9405. e.clientY = unsafeWindow.innerHeight - 100;
  9406. }
  9407. $(document).find('#' + the_sc_ctx_menu_id).css('left', e.clientX + 'px');
  9408. $(document).find('#' + the_sc_ctx_menu_id).css('top', e.clientY + 'px');
  9409. $(document).find('#' + the_sc_ctx_menu_id).show();
  9410.  
  9411. clearTimeout(sc_context_copy_menu_timeout_id);
  9412. });
  9413.  
  9414. $(document).on('contextmenu', '.sc_data_show, .sc_long_buttons', function(e) {
  9415. e = e || unsafeWindow.event;
  9416. e.preventDefault();
  9417.  
  9418. let the_sc_ctx_menu_id = 'sc_context_menu_func_body';
  9419. if (sc_isFullscreen) {
  9420. the_sc_ctx_menu_id = 'sc_func_context_menu_fullscreen';
  9421. }
  9422.  
  9423. if (unsafeWindow.innerWidth - e.clientX <= 200) {
  9424. e.clientX = unsafeWindow.innerWidth - 200;
  9425. }
  9426. if (unsafeWindow.innerHeight - e.clientY <= 770) {
  9427. e.clientY = unsafeWindow.innerHeight - 770;
  9428. }
  9429. $(document).find('#' + the_sc_ctx_menu_id).css('left', e.clientX + 'px');
  9430. $(document).find('#' + the_sc_ctx_menu_id).css('top', e.clientY + 'px');
  9431. $(document).find('#' + the_sc_ctx_menu_id).show();
  9432.  
  9433. clearTimeout(sc_context_func_menu_timeout_id);
  9434. });
  9435.  
  9436. sc_switch_css();
  9437. sc_memory_show();
  9438. check_and_clear_all_sc_store();
  9439. sc_fetch_and_show();
  9440.  
  9441. if (sc_live_auto_tianxuan_flag) {
  9442. setTimeout(() => {
  9443.  
  9444. sc_get_follow_up_flag().then(the_sc_follow_up_flag => {
  9445. let the_anchor_before_obj = $(document).find('#gift-control-vm .anchor-lottery-entry');
  9446.  
  9447. if (the_sc_follow_up_flag && the_anchor_before_obj.length) {
  9448. the_anchor_before_obj.trigger('click'); // 若已关注,并且已经存在天选,则先触发点击,展开天选弹窗
  9449.  
  9450. handle_auto_tianxuan(the_sc_follow_up_flag);
  9451. }
  9452. });
  9453.  
  9454. }, 3000); // 等渲染完成
  9455. }
  9456.  
  9457. // 分辨率变化相关
  9458. if (!sc_screen_resolution_change_flag && (!sc_panel_drag_left_percent || !sc_panel_drag_top_percent || !sc_panel_drag_left_fullscreen_percent || !sc_panel_drag_top_fullscreen_percent)) {
  9459. sc_panel_drag_store(sc_panel_drag_left, sc_panel_drag_top);
  9460. }
  9461.  
  9462. let sc_window_resizeTimeout;
  9463.  
  9464. unsafeWindow.addEventListener('resize', () => {
  9465.  
  9466. clearTimeout(sc_window_resizeTimeout);
  9467.  
  9468. // 设置一个延迟来获取最新的 screen.width 或者 screen.height
  9469. sc_window_resizeTimeout = setTimeout(() => {
  9470.  
  9471. sc_screen_resolution_change_flag = sc_screen_resolution_change_check();
  9472.  
  9473. if (sc_screen_resolution_change_flag) {
  9474.  
  9475. if (sc_panel_drag_left_percent) { sc_panel_drag_left = unsafeWindow.top.document.documentElement.clientWidth * parseFloat(sc_panel_drag_left_percent); }
  9476. if (sc_panel_drag_top_percent) { sc_panel_drag_top = unsafeWindow.top.document.documentElement.clientHeight * parseFloat(sc_panel_drag_top_percent); }
  9477. if (sc_panel_drag_left_fullscreen_percent) { sc_panel_drag_left_fullscreen = unsafeWindow.top.document.documentElement.clientWidth * parseFloat(sc_panel_drag_left_fullscreen_percent); }
  9478. if (sc_panel_drag_top_fullscreen_percent) { sc_panel_drag_top_fullscreen = unsafeWindow.top.document.documentElement.clientHeight * parseFloat(sc_panel_drag_top_fullscreen_percent); }
  9479.  
  9480. let the_resize_sc_panel_left = sc_panel_drag_left;
  9481. let the_resize_sc_panel_top = sc_panel_drag_top;
  9482. if (sc_isFullscreen && sc_live_fullscreen_config_separate_memory_flag) {
  9483. the_resize_sc_panel_left = sc_panel_drag_left_fullscreen;
  9484. the_resize_sc_panel_top = sc_panel_drag_top_fullscreen;
  9485. }
  9486.  
  9487. let sc_circles = $(document).find('.sc_long_circle');
  9488. let sc_rectangles = $(document).find('.sc_long_rectangle');
  9489.  
  9490. sc_circles.each(function() {
  9491. if (the_resize_sc_panel_left >= 0) {
  9492. $(this).css('left', the_resize_sc_panel_left + 'px');
  9493. }
  9494.  
  9495. if (the_resize_sc_panel_top >= 0) {
  9496. $(this).css('top', the_resize_sc_panel_top + 'px');
  9497. }
  9498. });
  9499.  
  9500. sc_rectangles.each(function() {
  9501. if (the_resize_sc_panel_left >= 0) {
  9502. $(this).css('left', the_resize_sc_panel_left + 'px');
  9503. }
  9504.  
  9505. if (the_resize_sc_panel_top >= 0) {
  9506. $(this).css('top', the_resize_sc_panel_top + 'px');
  9507. }
  9508. });
  9509.  
  9510. }
  9511.  
  9512. }, 300);
  9513.  
  9514. });
  9515. }
  9516.  
  9517. sc_process_start();
  9518.  
  9519. if (!sc_room_blacklist_flag) {
  9520. const originalParse = JSON.parse;
  9521. JSON.parse = function (str) {
  9522. try {
  9523. const parsedArr = originalParse(str);
  9524. if (parsedArr && parsedArr.cmd !== undefined) {
  9525. if (parsedArr.cmd === 'ONLINE_RANK_COUNT') {
  9526. let n_count = parsedArr.data.count ?? 0;
  9527. let n_online_count = parsedArr.data.online_count ?? 0;
  9528. update_rank_count(n_count, n_online_count);
  9529. } else if (parsedArr.cmd === 'SUPER_CHAT_MESSAGE') {
  9530. let store_flag = store_sc_item(parsedArr.data);
  9531. if (store_flag) {
  9532. update_sc_item(parsedArr.data);
  9533. }
  9534.  
  9535. if (sc_live_special_sc_flag && sc_live_special_tip_uid_arr.length) {
  9536. handle_special_sc(parsedArr.data, false, true);
  9537. }
  9538.  
  9539. if (sc_live_sc_to_danmu_show_flag) {
  9540. handle_special_sc(parsedArr.data, true, true);
  9541. }
  9542. } else if (parsedArr.cmd === 'USER_TOAST_MSG') {
  9543. let sc_data_guard_count = parsedArr.data.target_guard_count ?? 0;
  9544. if (sc_data_guard_count) {
  9545. update_guard_count(sc_data_guard_count);
  9546. }
  9547. } else if (parsedArr.cmd === 'INTERACT_WORD') {
  9548. if (parsedArr.data.msg_type === 1) {
  9549. if (sc_live_special_tip_uid_arr.length) {
  9550. handle_special_tip(parsedArr.data);
  9551. }
  9552. }
  9553. } else if (parsedArr.cmd === 'DANMU_MSG') {
  9554. if (parsedArr.info) {
  9555. if (sc_live_special_msg_flag && sc_live_special_tip_uid_arr.length) {
  9556. handle_special_msg(parsedArr.info);
  9557. }
  9558.  
  9559. if (sc_live_send_dm_combo_flag && parsedArr.info[0][15]['extra'].includes('"hit_combo\":1') && !sc_combo_dm_recent_send_arr.includes(parsedArr.info[1])) {
  9560. handle_auto_dm_combo(parsedArr.info);
  9561. }
  9562. }
  9563. } else if (parsedArr.cmd === 'ANCHOR_LOT_START') {
  9564. if (sc_live_auto_tianxuan_flag) {
  9565. sc_get_follow_up_flag().then(the_sc_follow_up_flag => {
  9566. handle_auto_tianxuan(the_sc_follow_up_flag);
  9567. });
  9568. }
  9569. }
  9570. }
  9571.  
  9572. return parsedArr;
  9573. } catch (error) {
  9574. throw error;
  9575. }
  9576. };
  9577.  
  9578. setTimeout(() => {
  9579. // setTimeout的时间差内先更新一下再定时
  9580. const _rank_list_ctnr_box_li = $(document).find('#rank-list-ctnr-box > div.tabs > ul > li.item');
  9581. if (_rank_list_ctnr_box_li.length) {
  9582. let _guard_n = _rank_list_ctnr_box_li.last().text().match(/\d+/) ?? 0;
  9583. _guard_n = parseInt(_guard_n, 10);
  9584. if (sc_guard_num > _guard_n) {
  9585. _guard_n = sc_guard_num;
  9586. }
  9587.  
  9588. $(document).find('.sc_captain_num_right').text(_guard_n);
  9589. sc_update_date_guard_once = true;
  9590.  
  9591. if (data_show_bottom_flag) {
  9592. $(document).find('#sc_data_show_bottom_guard_num').text('舰长:' + _guard_n);
  9593. }
  9594. }
  9595.  
  9596. let rank_list_ctnr_box_interval = setInterval(() => {
  9597. const rank_list_ctnr_box_item = $(document).find('#rank-list-ctnr-box > div.tabs > ul > li.item');
  9598. if (rank_list_ctnr_box_item.length) {
  9599. const guard_text_target = rank_list_ctnr_box_item.last();
  9600.  
  9601. const guard_test_observer = new MutationObserver((mutationsList) => {
  9602. for (const mutation of mutationsList) {
  9603. if (mutation.type === 'characterData' || mutation.type === 'childList' || mutation.type === 'subtree') {
  9604. const guard_newNum = mutation.target.textContent.match(/\d+/) ?? 0;
  9605. if (sc_guard_num !== parseInt(guard_newNum, 10)) {
  9606. // SC记录板的
  9607. $(document).find('.sc_captain_num_right').text(guard_newNum);
  9608.  
  9609. // 页面的
  9610. if (data_show_bottom_flag) {
  9611. $(document).find('#sc_data_show_bottom_guard_num').text('舰长:' + guard_newNum);
  9612. }
  9613. }
  9614. }
  9615. }
  9616. });
  9617. const guard_text_watch_config = { characterData: true, childList: true, subtree: true }
  9618. guard_test_observer.observe(guard_text_target[0], guard_text_watch_config);
  9619.  
  9620. clearInterval(rank_list_ctnr_box_interval);
  9621. }
  9622. });
  9623.  
  9624. }, 3000);
  9625.  
  9626. setInterval(() => {
  9627. update_timestamp_diff(); // 每30秒更新时间差,并且检查SC是否过期
  9628. check_all_memory_status(); // 每30秒检查全记状态
  9629. sycn_live_special_tip_config(); // 每30秒同步最新的特定用户提示设置
  9630. sycn_live_sc_to_danmu_show_config(); // 每30秒同步最新的SC以弹幕展现的设置
  9631. }, 30000);
  9632.  
  9633. }
  9634.  
  9635. })();