lighter pepecine

Enable viewing on remote backend instead of the slow embeded viewing + minor tweaks(WIP)

14.12.2016 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        lighter pepecine
// @namespace   nil
// @description Enable viewing on remote backend instead of the slow embeded viewing + minor tweaks(WIP)
// @include     http://pepecine.net/episodio-online/*
// @version     0.1
// @grant       none
// ==/UserScript==

function delete_social() {
  // delete social divs
  var ids = ["fblikebg", "fblikepop", "social"];
  ids.forEach(function delnodebyid(id) {
    node = document.getElementById(id);
    if (!node) return;
    node.parentNode.removeChild(node);
  });
}

function disable_embededviewing() {
  var links2embeded_vid = Array.filter(document.getElementsByTagName('a'), function is_link2embededvid(elt) {
    //if (location.href.indexOf(elt.href) !== 0) return false;
    if (elt.rel !== "nofollow") return false;
    if (elt.dataset.bind.indexOf("click: renderTab.bind(") !== 0) return false;
    return true;
  });
  //console.log("nb: " + links2embeded_vid.length);
  links2embeded_vid.forEach(function makeDirectLink(a, i){
    var bind = a.dataset.bind;
    var dest_url = bind.substr(bind.indexOf("'") + 1);
    dest_url = dest_url.substr(0, dest_url.indexOf("'"));
    a.href = dest_url;
    delete a.dataset.bind;
    a.target = "_blank";
    a.addEventListener('click', function click(e) {
      e.preventDefault();
      location.href = this.href;
    }, false);
  });
  
      
  var imgs = Array.filter(document.getElementsByTagName("img"), function has_datasetbind() {
    if (img.dataset.bind.length > 0) return true;
    return false;
  });
  console.log("nb img:" + imgs.length);
  imgs.forEach(function delnode(node) {
    node.parentNode.removeChild(node);
  });
}

function init_lighter_pepe() {
  delete_social();
  disable_embededviewing();
}
 
document.addEventListener('DOMContentLoaded', init_lighter_pepe);