<commit_before>// ==UserScript==
// @name         Kissanime Jdownloader?
// @namespace    http://kissanime.com/
// @version      0.1
// @description  Adds Download Button
// @author       You
// @include      */kissanime.*/Anime/*
// @exclude      */kissanime.*/Anime/*/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_setClipboard
// @grant        unsafeWindow
// @grant        GM_log
// @grant        GM_addStyle
// @noframes
// ==/UserScript==



var setClipboard = " --ERROR-- "



function main() {

    //alert(window.location.href)
    var urlnamelong = window.location.href.search("Anime");
    var urlname = window.location.href.substr(urlnamelong + 6);
    var clipboard = $("a[href*=\"" + urlname + "/Episode-" + "\"]").attr('href');
    var epilist = [];
    $("a[href*=\"" + urlname + "/Episode-" + "\"]").each( function() {

        epilist.push("http://kissanime.com" + $(this).attr('href'));

    });
    epilist.pop();
    epilist = epilist.sort();

    setClipboard = epilist.toString()
    GM_setClipboard(setClipboard);
    
     
}






var appendedHTML = `

    <div id="newbody"><div id="myContainer">           
                      
    <button id="myButton" type="button">
    Download with JDownloader
    </button>    
                                                     
    </div></div>   

`;
$("body").append(appendedHTML);
GM_addStyle(`

	#newbody {
	   position: 				absolute;	
	   top: 					240PX;
	   text-align: 			    center;	
       width:                   100%;

	}
    #myContainer {
		position: 				relative;
        margin-left:            auto;
        margin-right:           auto;
        opacity:                1;
        width: 					970px; 
        text-align:             right;
    }
    #myButton {
        z-index:                222;
        color:                  #72D572;
        cursor:                 pointer;
        position: 				relative;
        margin-right:           15px;
        font-size:              18px;
        background-color:       transparent;
        outline:                none;
        border:                 none;
		display: 				inline-block;
		text-decoration: 		none;
        font:                   normal 27px "Tahoma" , Arial, Helvetica, sans-serif;
		transition-duration: 	0.4s;
		border-radius: 			4px;
    }
	#myButton:hover {
		background-color: 		#72D572; 
		color: 					black;
		
	}
	
`);



//--- Activate the newly added button.
document.getElementById("myButton").addEventListener (
    "click", ButtonClickAction, false
);

function ButtonClickAction (zEvent) {
    main();    
}




// load jQuery and execute the main function

//Anime/Kaze-no-Stigma-Sub/Episode-023?id=88558




//jQ('a[href^="\\/Anime\\/" + name + "\\/Episode\\-*"]')<commit_msg>Universal JS<commit_after>// ==UserScript==
// @name         Kissanime Downloader with Jdownloader
// @namespace    https://github.com/Meisterlala/Kissanime-Downloader
// @version      v1
// @description  Adds Download Button
// @author       Meisterlala
// @include      */kissanime.*/Anime/*
// @exclude      */kissanime.*/Anime/*/*
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_setClipboard
// @grant        unsafeWindow
// @grant        GM_log
// @grant        GM_addStyle
// @noframes
// ==/UserScript==



var setClipboard = " --ERROR-- "



function main() {

    //alert(window.location.href)
    var urlnamelong = window.location.href.search("Anime");
    var urlname = window.location.href.substr(urlnamelong + 6);
    var clipboard = $("a[href*=\"" + urlname + "/Episode-" + "\"]").attr('href');
    var epilist = [];
    $("a[href*=\"" + urlname + "/Episode-" + "\"]").each( function() {

        epilist.push("http://kissanime.com" + $(this).attr('href'));

    });
    epilist.pop();
    epilist = epilist.sort();

    setClipboard = epilist.toString()
    GM_setClipboard(setClipboard);
    
     
}






var appendedHTML = `          
    
    <div id="myButtonContainer">
    <button id="myButton" type="button">
    Download with JDownloader
    </button>           
    </div>
    
`;

$("div.bigBarContainer:nth-child(1) > div:nth-child(2) > div:nth-child(2)").append(appendedHTML);

var maincolor = $("div.bigBarContainer:nth-child(1) > div:nth-child(2) > div:nth-child(2) > p:nth-child(2) > a:nth-child(2)").css("color")
var cssstyle = `


    #myButton {
        z-index:                222;
        cursor:                 pointer;
        position:               relative;
        margin-right:           15px;
        font-size:              18px;
        background-color:       transparent;
        outline:                none;
        border:                 none;
        display:                inline-block;
        text-decoration:        none;
        font:                   normal 27px "Tahoma" , Arial, Helvetica, sans-serif;
        transition-duration:    0.4s;
        border-radius:          4px;
		` + "color:                  " + maincolor +`
    }
    #myButton:hover {
        color:                  black;
        ` + "background-color:       " + maincolor +`       
    }
    #myButtonContainer {
        
        text-align:             center;
        
    }
	`
	
GM_addStyle(cssstyle);




// $("#myButton").css("color", maincolor)
// $("#myButton:hover").css("background-color:", maincolor)


// Activate the added button
document.getElementById("myButton").addEventListener (
    "click", ButtonClickAction, false
);

function ButtonClickAction (zEvent) {
    main();    
}




//jQ('a[href^="\\/Anime\\/" + name + "\\/Episode\\-*"]')
{'fraction_non_alphanumeric': 0.15672676837725383, 'fraction_numerical': 0.012309292649098474, 'mean_word_length': 1.7419201520912548, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 19, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4597756', 'n_tokens_mistral': 1974, 'n_tokens_neox': 1817, 'n_words': 326}