Skip to content

Instantly share code, notes, and snippets.

@xfl03
Created November 25, 2017 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xfl03/45177592777e92557ec466c892f1574f to your computer and use it in GitHub Desktop.
Save xfl03/45177592777e92557ec466c892f1574f to your computer and use it in GitHub Desktop.
MosoTechResDown
// ==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