Created
November 25, 2017 18:16
-
-
Save xfl03/45177592777e92557ec466c892f1574f to your computer and use it in GitHub Desktop.
MosoTechResDown
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
// ==UserScript== | |
// @name 蓝墨云班课(Moso Tech)资源下载 | |
// @namespace https://github.com/xfl03/ | |
// @version 0.1 | |
// @description 增加下载按钮,以便于直接在线下载蓝墨云班课(Moso Tech)中的资源 | |
// @author xfl03 | |
// @match https://www.mosoteach.cn/web/index.php* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
$(".res-row-open-enable").each(function(){ | |
/* | |
$(this).removeClass("preview-file"); | |
$(this).addClass("edit-res"); | |
*/ | |
$(this).find("ul").html('<li class="download-ress download-res-button">下载</li>' + $(this).find("ul").html()); | |
}); | |
$(document).on('click', '.download-ress', function(){ | |
var resHref = $(this).parents(".res-row-open-enable").attr('data-href'); | |
window.open(resHref); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment