Greasy Fork is available in English.

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