|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 蓝奏云网盘增强 |
3 | | -// @version 1.3.7 |
| 3 | +// @version 1.3.8 |
4 | 4 | // @author X.I.U |
5 | | -// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、点击直接下载文件、自动显示更多文件、自定义分享链接域名、自动打开/复制分享链接、带密码的分享链接自动输密码、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 |
| 5 | +// @description 刷新不回根目录、后退返回上一级、右键文件显示菜单、点击直接下载文件、点击空白打开目录、自动显示更多文件、自定义分享链接域名、自动打开/复制分享链接、带密码的分享链接自动输密码、拖入文件自动显示上传框、输入密码后回车确认、调整描述(话说)编辑框初始大小 |
6 | 6 | // @include /^https:\/\/.+\.lanzou[a-z]\.com\/.*$/ |
7 | 7 | // @match *://pan.lanzou.com/* |
8 | 8 | // @match *://lanzou.com/u |
|
127 | 127 | setTimeout(hideSha, 500); // 隐藏分享链接窗口(这样自动打开/复制分享链接时,不会一闪而过) |
128 | 128 | fobiddenBack(); // 禁止浏览器返回(并绑定新的返回事件) |
129 | 129 | EventXMLHttpRequest(); // 监听 XMLHttpRequest 事件并执行 [自动显示更多文件] |
| 130 | + setTimeout(clickOpenDirectory, 500); // 点击打开目录 |
130 | 131 |
|
131 | 132 | dragEnter(); // 拖入文件自动显示上传框 |
132 | 133 | setTimeout(viewTop,1000); // 监听并修改右键菜单 [外链分享地址] 为 [复制并打开分享链接] / [复制分享链接] / [打开分享链接] 之一 |
|
189 | 190 | } |
190 | 191 |
|
191 | 192 |
|
| 193 | + // 点击空白打开目录 |
| 194 | + function clickOpenDirectory() { |
| 195 | + mainframe.document.getElementById('sub_folder_list').onclick = function(e){ |
| 196 | + //console.log(e.target); |
| 197 | + if (e.target.className && e.target.className == 'f_tb') { |
| 198 | + e.target.querySelector('span.follink').click() |
| 199 | + } |
| 200 | + } |
| 201 | + } |
| 202 | + |
| 203 | + |
192 | 204 | // 右键文件显示菜单 |
193 | 205 | function rightClickMenu() { |
194 | 206 | if (!menu_value('menu_rightClickMenu')) return |
|
197 | 209 | } |
198 | 210 |
|
199 | 211 |
|
200 | | - // 右键文件显示菜单,参数:文件/文件夹列表 ID、菜单 ID 前缀 |
| 212 | + // 右键文件显示菜单,参数:文件/文件夹列表 ID、菜单 ID、菜单 ID前缀 |
201 | 213 | function rightClickMenu_(list_id_name, menu_id_name_prefix, list_id_name_prefix) { |
202 | 214 | let list_ = mainframe.document.getElementById(list_id_name); |
203 | | - if (list_) { // 文件/文件夹列表 |
204 | | - list_.oncontextmenu = function(e){ |
205 | | - e.preventDefault(); // 屏蔽浏览器自身右键菜单 |
206 | | - let left = e.pageX - 30; // 右键菜单弹出位置 |
207 | | - let list_ID = e.target.id; |
208 | | - if (e.target.nodeName === 'FONT') { |
209 | | - list_ID = e.target.parentNode.parentNode.id |
210 | | - } else if(e.target.id === '') { |
211 | | - list_ID = e.target.parentNode.id |
212 | | - } |
213 | | - list_ID = /\d+/.exec(list_ID) |
214 | | - if(list_ID.length > 0){ |
215 | | - mainframe.document.getElementById(menu_id_name_prefix + list_ID[0]).style.cssText='position: absolute !important; left: ' + left + 'px;' // 修改右键菜单弹出位置(X) |
216 | | - mainframe.document.getElementById(list_id_name_prefix + list_ID[0]).focus(); |
217 | | - mainframe.document.getElementById(list_id_name_prefix + list_ID[0]).click(); |
218 | | - } |
| 215 | + if (!list_) return // 文件/文件夹列表 |
| 216 | + list_.oncontextmenu = function(e){ |
| 217 | + e.preventDefault(); // 屏蔽浏览器自身右键菜单 |
| 218 | + let left = e.pageX - 30; // 右键菜单弹出位置 |
| 219 | + let list_ID = e.target.id; |
| 220 | + if (e.target.nodeName === 'FONT') { |
| 221 | + list_ID = e.target.parentNode.parentNode.id |
| 222 | + } else if(e.target.id === '') { |
| 223 | + list_ID = e.target.parentNode.id |
| 224 | + } |
| 225 | + list_ID = /\d+/.exec(list_ID) |
| 226 | + if(list_ID.length > 0){ |
| 227 | + mainframe.document.getElementById(menu_id_name_prefix + list_ID[0]).style.cssText='position: absolute !important; left: ' + left + 'px;' // 修改右键菜单弹出位置(X) |
| 228 | + mainframe.document.getElementById(list_id_name_prefix + list_ID[0]).focus(); |
| 229 | + mainframe.document.getElementById(list_id_name_prefix + list_ID[0]).click(); |
219 | 230 | } |
220 | 231 | } |
221 | 232 | } |
|
0 commit comments