Skip to content

Light Implementation

lolamtisch edited this page Jan 17, 2018 · 1 revision
if( window.location.href.indexOf("kisstest.ru") > -1 ){
    //#########Kissanime#########
    var domain = 'http://kisstest.ru';
    var dbSelector = 'Kisstest'; //some unique Selector
    var listType = 'anime'; //anime or manga page

    $.init = function() {//normaly does not have to be changed
        checkdata();
    }

    $.isOverviewPage = function() {//Allways false as we only want to support the video page
        return false;
    };


    $.urlAnimeIdent = function(url) {//Rough filter of the url path that contain the episode and anime title
        return url.split('/').slice(0,5).join('/');
    };
    $.urlAnimeSelector = function(url) {//Part that clearly indentifys the anime
        return url.split("/")[4].split("?")[0];
    };
    $.urlAnimeTitle = function(url) {//Title of the anime for the search
        return $.urlAnimeSelector(url);
    };

    $.urlEpisodePart = function(url) { //Rough filtring of the episode, will be pass to EpisodePartToEpisode for exact episode number
        return url.split("/")[5].split("?")[0];
    };
    $.EpisodePartToEpisode = function(string) { //You have to return the episode number here.
        var temp = [];
        temp = string.match(/[e,E][p,P][i,I]?[s,S]?[o,O]?[d,D]?[e,E]?\D?\d{3}/);
        if(temp !== null){
            string = temp[0];
        }
        temp = string.match(/\d{3}/);
        if(temp === null){
            temp = string.match(/\d{2,}\-/);
            if(temp === null){
                string = 0;
            }else{
                string = temp[0];
            }
        }else{
            string = temp[0];
        }
        return string;
    };

    $.docReady = function(data) {
        return $( document).ready(data);
    };



    $.nextEpLink = function(url) {// Optional: You have to return the url of the next url, so it can be displayed as next episode
        return url+'/'+$('#selectEpisode option:selected').next().val();
    };

    //can be ignored
    $.normalUrl = function(){
        return $.urlAnimeIdent(window.location.href);
    };

    $.fn.uiPos = function() {
        this.insertAfter($(".ignore").first());
    };
    $.fn.uiWrongPos = function() {
        this.insertAfter($(".ignore").first());
    };
    $.fn.uiHeadPos = function() {
        this.appendTo($(".ignore").first());
    };
    //###########################
}
Clone this wiki locally