Greasy Fork

Greasy Fork is available in English.

heise.de Easy Reading

Makes reading heise news a little more comfortable

当前为 2014-12-18 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @id             heise.de-8280af0b-4f9b-487e-95b3-45fff377348e
// @name           heise.de Easy Reading
// @name:de        heise.de Easy Reading
// @version        1.2.4
// @namespace      
// @author         SpineEyE
// @description    Makes reading heise news a little more comfortable
// @description:de Macht heise lesen etwas angenehmer
// @include        http://www.heise.de/*
// @run-at         document-idle
// @grant          GM_addStyle
// ==/UserScript==
// heise.de Cleaner user script
// Copyright 2011-2014, SpineEyE
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// -----------------------------------------------------------------------------
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.
// 
// changelog
// v1.2.4 - 18.12.2014: Clicking the article's lead image ("aufmacherbild") will redirect to full size image instead of heise's container page for it (only some pictures are actually inserted downsized).
// v1.2.3 - 18.12.2014: Fix: Links at the top werent clickable
// v1.2.2 - 14.10.2014: Compatibility fix for Greasemonkey
// v1.2.1 - 22.03.2014: Fixed meldung_wrapper text content to have
//						 the new style as well
// v1.2 - 01.03.2014: Now uses GM_addStyle to change article style.
//						Text in <pre> tags is readable in whole width
// v1.1.1 - 16.11.2013: fixed h2-link-construction 
//

(function () { // function wrapper for Opera
//console.log("starting");

// change font

if (document.getElementsByClassName('meldung_wrapper').length > 0) {
	GM_addStyle(
		'.meldung_wrapper, .meldung_wrapper p, .meldung_wrapper h5 {' +
			'font-family: Georgia,"Times New Roman",serif;' +
			'line-height: 155%;' +
			'padding: 0.5em 0;' +
			'font-size: 1em !important;' +
			'letter-spacing: 0.2px;' +
		'}'
	);
}

if (document.getElementsByClassName('artikel_content').length > 0) {
	GM_addStyle(
		'.artikel_content article p {' +
			'font-family: Georgia,"Times New Roman",serif;' +
			'line-height: 155%;' +
			'padding: 0.5em 0;' +
			'font-size: 1em !important;' +
			'letter-spacing: 0.2px;' +
		'}'
	);
}

/* remove top margin */

document.getElementById("container_content").style.top = 0;
document.getElementById("container").removeChild(document.getElementById("bannerzone"));

/* fix to make text in <pre> tags visible over the whole width */

GM_addStyle(
	'pre {' +
		'position: relative;' +
		'z-index: 1;' +
		'background-color: #FFFFFF;' +
	'}' +
	'pre:hover {' +
		'display: table-caption;' +
		'margin-top: 0' +
	'}'
);
/* prevent image popups, rather insert normal hyperlink 
	bild_links, bild_rechts
 **/
var inlineImages = document.evaluate('//span[starts-with(@class,"bild_")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null),
	i, span, img, a, bigImageURL;
for(i = 0; i < inlineImages.snapshotLength; i++) {
console.log("Snapshot item " + i);
	span = inlineImages.snapshotItem(i);
	img = span.children[0];
	
	a = document.createElement('a');
	bigImageURL = img.getAttribute('data-zoom-src');
	if (!bigImageURL) continue;
	a.href = bigImageURL;
	
	// cloning a node removes all event listeners, so the popup as well
	a.appendChild(img.cloneNode(false));
	
	span.insertBefore(a, img);
	span.removeChild(img);
}

/* link to full size picture for aufmacherbild */

var aAufmacher   = document.getElementsByClassName("aufmacherbild")[0].children[0];
var imgAufmacher = aAufmacher.children[0];

console.log(imgAufmacher.src.replace(/\/scale.*?\/imgs\//i, "/imgs/"));

aAufmacher.href = imgAufmacher.src.replace(/\/scale.*?\/imgs\//i, "/imgs/");

	
})(); // function wrapper for Opera