// ==UserScript==
// @name thingiverse download button
// @description fix thingiverse download all function.
// @match *://www.thingiverse.com/thing:*
// @grant GM_addStyle
// @version 1.0
// @namespace www.thingiverse.com_download
// @downloadURL https://update.greasyfork.icu/scripts/439474/thingiverse%20download%20button.user.js
// @updateURL https://update.greasyfork.icu/scripts/439474/thingiverse%20download%20button.meta.js
// ==/UserScript==
/*--- Create a button in a container div. It will be styled and
positioned with CSS.
// @require http://code.jquery.com/jquery-latest.js
*/
var zNode = document.createElement ('div');
zNode.innerHTML = '
';
zNode.setAttribute ('id', 'myContainer');
document.body.appendChild (zNode);
//--- Activate the newly added button.
document.getElementById ("myButton").addEventListener (
"click", ButtonClickAction, false
);
document.getElementById ("myButton2").addEventListener (
"click", ButtonClickAction, false
);
function ButtonClickAction (zEvent) {
/*--- For our dummy action, we'll just add a line of text to the top
of the screen.
*/
if (window.location.href.indexOf("/files")>=0) {
window.location.href=window.location.href.replace("/files","/zip");
}
else {
window.location.href=window.location.href+"/zip";
}
}
//--- Style our newly added elements using CSS.
GM_addStyle ( `
#myContainer {
position: absolute;
top: 0;
left: 0;
opacity: 0.9;
z-index: 1100;
padding: 5px 40px;
background: #bd1407;
}
#myButton {
cursor: pointer;
padding: 5px 40px;
}
` );