PageSourceSearch

https://lingyuzhao.top/js/indexLSF.js

js lingyuzhao.top collected 2026-10-06 13:16:02 UTC 7,132 bytes, 199 lines download raw bytes

1/**
2 * 标题字典
3 * @type {{system_terminal: string, setOption: string, about_button: string, index_home_button_a: string, tools_listTool: string, trends_listTrends: string, index_user_mali: string, index_user_manager: string}}
4 */
5const button_title = {
6    'index_back_page': '返回上级',
7    'index_home_button_a': '系统主页',
8    'index_user_mali': '邮件信箱',
9    'index_user_manager': '用户管理',
10    'index_carousel_manager': '轮播管理',
11    'user_resource_manager': '盘镜空间',
12    'trends_listTrends': '动态中心',
13    'article_listArticle': '文章中心',
14    'tools_listTool': '工具面板',
15    'games_listTool': '休闲游戏',
16    'shopCodeBook': '码本商城',
17    'system_terminal': '系统终端',
18    'setOption': '设置菜单',
19    'siteComment': 'LY留言板',
20    'icon-moon_button': '图标汇总',
21    'about_button': '关于我们'
22}
23
24/**
25 * 图标字典
26 * @type {{system_terminal: string, setOption: string, about_button: string, index_home_button_a: string, tools_listTool: string, trends_listTrends: string, index_user_mali: string, index_user_manager: string}}
27 */
28const button_icon = {
29    'index_back_page': '',
30    'index_home_button_a': '',
31    'index_user_mali': '',
32    'index_user_manager': '',
33    'index_carousel_manager': '',
34    'user_resource_manager': '',
35    'trends_listTrends': '',
36    'article_listArticle': '',
37    'tools_listTool': '',
38    'games_listTool': '🕹️',
39    'shopCodeBook': '',
40    'system_terminal': '',
41    'setOption': '',
42    'siteComment': '',
43    'icon-moon_button': '',
44    'about_button': '',
45}
46
47/**
48 * 初始化按钮鼠标移入事件
49 */
50function initButton() {
51    for (let buttonTitleKey in button_title) {
52        const elementById = document.getElementById(buttonTitleKey);
53        elementById.addEventListener('mouseover', () => {
54            elementById.innerText = button_title[buttonTitleKey]
55        })
56        elementById.addEventListener('mouseout', () => {
57            elementById.innerText = button_icon[buttonTitleKey]
58        })
59    }
60}
61
62/**
63 * 需要登录的页码函数
64 * @param page 页面
65 * @param _
66 */
67const needLoginToPageFun = (page, _) => {
68    if (isNotLogin()) {
69        toPage('Login.html')
70    } else {
71        $(showArea).load(page)
72    }
73}
74
75/**
76 * 页面参数回调函数字典
77 * @type {{default: (function(*, *): *|jQuery)}}
78 */
79const pageFun = {
80    "default": (page, _) => $(showArea).load(page)
81}
82
83/**
84 * 需要登录的页面参数回调函数字典
85 * @type {{"maliWriter.html": needLoginToPageFun, "PersonalHomepage.html": needLoginToPageFun, "trendsWriter.html": needLoginToPageFun, "ArticleWriter.html": needLoginToPageFun, "listFriend.html": needLoginToPageFun}}
86 */
87const needLogin = {
88    "ArticleWriter.html": needLoginToPageFun,
89    "listFriend.html": needLoginToPageFun,
90    "maliWriter.html": needLoginToPageFun,
91    "maliReader.html": needLoginToPageFun,
92    "trendsWriter.html": needLoginToPageFun,
93    "PersonalHomepage.html": needLoginToPageFun,
94    "resetPassword.html": needLoginToPageFun,
95    "listUserManager.html": needLoginToPageFun,
96    "listRChat.html": needLoginToPageFun,
97    "setOption.html": needLoginToPageFun,
98    "diskMirrorUserResource.html": needLoginToPageFun,
99    "DiskMirrorFileManager.html": needLoginToPageFun,
100    "default": (page, _) => {
101    }
102}
103
104/**
105 * 跳转到一个指定的页面
106 * @param page 页面的参数
107 * @param id_list 附带的参数 可选项
108 * @param haveCookie 如果当前不包含登录信息设置为 false 这样只会在不需要登录的列表里面寻找回调,反之则是在 needLogin 中寻找
109 */
110function toPage(page, id_list = [], haveCookie = false) {
111    console.info(page, id_list, haveCookie)
112    // 准备回调字典
113    const d = haveCookie ? needLogin : pageFun
114    // 获取到页面 对应的函数处理器
115    if (page in d) {
116        d[page](page, id_list)
117    } else {
118        d['default'](page, id_list)
119    }
120}
121
122/**
123 * 初始化用户自己设置的壁纸
124 */
125function initWebBackImage() {
126    if (!isNotLogin()) {
127        const webBackImage = USER_CONF['web_BackImage'];
128        if (webBackImage !== undefined) {
129            const string = webBackImage;
130            const string1 = string[1];
131            if (string.length >
131= 2 && string1 !== undefined && string1 !== WEB_CONF['UN_DATA_CHAR']) {
132                const elementsByClassNameElement = document.getElementsByClassName("body_div")[0];
133                elementsByClassNameElement.style.background = `url(${string1})`
134                setStyle(elementsByClassNameElement, backImageCssUniversal)
135            }
136        }
137    }
138}
139
140/**
141 * 隐藏左边的导航栏
142 */
143function hiddenLeftNavigationBar() {
144    const elementById = document.getElementById("leftNavigationBar");
145    elementById.style.animation = 'slideOutLeftNavigationBar 1s forwards'
146    document.getElementById("rightValueShow").style.width = '100%'
147}
148
149/**
150 * 显示左边的导航栏
151 */
152function showLeftNavigationBar() {
153    const elementById = document.getElementById("leftNavigationBar");
154    elementById.style.animation = 'slideInLeftNavigationBar 1s forwards'
155    document.getElementById("rightValueShow").style.width = '90%'
156}
157
158/**
159 * 根据用户的权限,决定要显示的按钮控件元素
160 */
161function initButtonByUserPL() {
162    if (!(my === undefined || my.name === undefined || my.permissionLevel === null || isPL(my, 'PermissionLevel.VISITOR'))) {
163        // 判断个人权限 如果权限为管理者或者其以上则进行相关按钮的展示
164        if (isPL(my, 'PermissionLevel.MANAGER') || isPL(my, 'PermissionLevel.ADMIN')) {
165            const needManager = document.getElementsByClassName("need_manager_per");
166            for (let i = 0; i < needManager.length; i++) {
167                needManager[i].style.display = 'block'
168            }
169        } else {
170            const needManager = document.getElementsByClassName("need_manager_per");
171            for (let i = 0; i < needManager.length; i++) {
172                needManager[i].style.display = 'none'
173            }
174        }
175    }
176}
177
178
179/**
180 * 初始化 盘镜 服务器客户端
181 * @return {DiskMirror}
182 */
183function initDiskMirror() {
184    // 实例化 盘镜 服务器客户端
185    const diskMirror = new DiskMirror(WEB_CONF['ARTICLE_DISk_MIRROR_HTTP']);
186    diskMirror.setSk(getWebConfByKey("USER_DISK_MIRROR_SK"), getWebConfByKey("COOKIE_DOMAIN"))
187    return diskMirror;
188}
189
190/**
191 * 初始化 盘镜 服务器客户端 这个是专用于上传的,我们在后端提供了一个上传 diskMirror 的接口 这个接口上传更快 不过这个接口不提供下载
192 * @return {DiskMirror}
193 */
194function initUploadDiskMirror() {
195    // 实例化 盘镜 服务器客户端
196    const diskMirror = new DiskMirror(backEnd_host_href());
197    diskMirror.setSk(getWebConfByKey("USER_DISK_MIRROR_SK"), getWebConfByKey("COOKIE_DOMAIN"))
198    return diskMirror;
199}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.