-
Notifications
You must be signed in to change notification settings - Fork 870
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
(function ($) { | ||
console.log("this is userTorrents.js"); | ||
class App extends window.NexusPHPCommon { | ||
init() { | ||
this.initButtons(); | ||
this.initFreeSpaceButton(); | ||
// 设置当前页面 | ||
PTService.pageApp = this; | ||
} | ||
|
||
/** | ||
* 初始化按钮列表 | ||
*/ | ||
initButtons() { | ||
this.initListButtons(); | ||
} | ||
|
||
/** | ||
* 获取下载链接 | ||
*/ | ||
getDownloadURLs() { | ||
let links = $("a[title='Download torrent']").toArray(); | ||
console.log(links); | ||
|
||
if (links.length == 0) { | ||
return this.t("getDownloadURLsFailed"); //"获取下载链接失败,未能正确定位到链接"; | ||
} | ||
|
||
let urls = $.map(links, item => { | ||
let link = $(item).attr("href"); | ||
return this.getFullURL(link); | ||
}); | ||
console.log(urls); | ||
|
||
return urls; | ||
} | ||
} | ||
new App().init(); | ||
})(jQuery); |