Stack Overflow: StackPrinter

Add Printer-Friendly button to question. This script is forked from http://userscripts-mirror.org/scripts/show/77298 and it add supports for HTTPs

Stan na 10-09-2015. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name           Stack Overflow: StackPrinter
// @namespace      http://userscripts.org/users/gangsta75
// @description    Add Printer-Friendly button to question. This script is forked from http://userscripts-mirror.org/scripts/show/77298 and it add supports for HTTPs
// @include        http*://stackoverflow.com/questions/*
// @include        http*://serverfault.com/questions/*
// @include        http*://superuser.com/questions/*
// @include        http*://stackapps.com/questions/*
// @include        http*://meta.stackoverflow.com/questions/*
// @include        http*://*.stackexchange.com/questions/*
// @include        http*://askubuntu.com/questions/*
// @include        http*://answers.onstartups.com/questions/*
// @include        http*://meta.mathoverflow.net/questions/*
// @include        http*://mathoverflow.net/questions/*
// @version        2.0    
// @grant          none
// ==/UserScript==

function with_jquery(f) {
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.textContent = "(" + f.toString() + ")(jQuery)";
  document.body.appendChild(script);
};

with_jquery(function($) {
       var re = new RegExp("^http[s]*://(.*?)\.(com|net|org)");
       var group = re.exec(window.location.href);
       var service = group[1]; 
       console.log("1WWWWWadasdsadsadasda");
       $('#question .vote:first').append('<div id="PrinterFriendly" style="margin-top:8px"><a alt="Printer-Friendly" title="Printer-Friendly" href="javascript:(function(){f=\'http://www.stackprinter.com/export?format=HTML&service='+service+'&question='+$('.vote').find('input[type=hidden]:first').val()+'\';a=function(){if(!window.open(f))location.href=f};if(/Firefox/.test(navigator.userAgent)){setTimeout(a,0)}else{a()}})()"><img width="33px" height="33px" src="http://www.stackprinter.com/images/printer.gif"</img></a></div>');		
         console.log("QQQWWWWWadasdsadsadasda");
});