Site Notice
hello, world
Difference between revisions of "Generate Image Download Links"
From Project-EPB Commons
m ([InPageEdit] 没有编辑摘要) |
([InPageEdit] 没有编辑摘要) |
||
Line 5: | Line 5: | ||
</label> | </label> | ||
<label for="jsonList"><h4>JSON file</h4></label> | <label for="jsonList"><h4>JSON file</h4></label> | ||
− | < | + | <ol id="jsonList"></ol> |
<button onclick="generate()">Generate</button> | <button onclick="generate()">Generate</button> | ||
<h4>File list</h4> | <h4>File list</h4> | ||
Line 15: | Line 15: | ||
output = ''; | output = ''; | ||
for (var i = 0; i < files.query.allpages.length; i++) { | for (var i = 0; i < files.query.allpages.length; i++) { | ||
− | output = output + html + files.query.allpages[i].title.replace(/\ /g, '_') + ' | + | output = '<li>' + output + html + files.query.allpages[i].title.replace(/\ /g, '_') + '</li>'; |
} | } | ||
− | $('#fileList'). | + | $('#fileList').html(output); |
} | } | ||
</script> | </script> | ||
<style>h4{margin: 4px 0 2px 0 !important}</style> | <style>h4{margin: 4px 0 2px 0 !important}</style> | ||
</html> | </html> |
Revision as of 17:38, 8 April 2020
<html> <label> <h4>URL</h4> <input id="html" value="https://no-game-no-life.fandom.com/wiki/Special:Filepath/"></input> </label> <label for="jsonList"><h4>JSON file</h4></label> <ol id="jsonList"></ol> <button onclick="generate()">Generate</button> <h4>File list</h4> <textarea readonly style="height: 1000px" id="fileList"></textarea> <script> function generate() {
var html = $('#html').val(), files = eval('(' + $('#jsonList').val() + ')'), output = ''; for (var i = 0; i < files.query.allpages.length; i++) { output = '<li>' + output + html + files.query.allpages[i].title.replace(/\ /g, '_') + '</li>'; } $('#fileList').html(output);
} </script> <style>h4{margin: 4px 0 2px 0 !important}</style> </html>