Created
May 20, 2018 22:13
-
-
Save martinshaw/20be5f8542373a1a866c6225f46458cb to your computer and use it in GitHub Desktop.
Moodle PDF Download JS Code
This file contains hidden or 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
var list = []; | |
$(".activity.resource.modtype_resource ").find("a").each( | |
function(){ | |
if($(this).attr("onclick").split("window.open(\'")[1] != undefined){ | |
if ($(this).find("img").attr("src") == "https://moodle.mmu.ac.uk/theme/image.php/mmu/core/1526789056/f/pdf-24") { | |
list.push($(this).attr("onclick").split("window.open(\'")[1].split("\', ''")[0]); | |
} | |
} | |
} | |
); | |
list = list.join("\n"); | |
console.log(list); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment