Skip to content

Instantly share code, notes, and snippets.

@oliverdoetsch
oliverdoetsch / AND_OR_NOT
Last active January 22, 2023 17:03
Blogger: Globally conditional data tags for all page types
#AND
<b:if cond='data:blog.pageType == "index"'>
<b:if cond='data:blog.searchQuery'>
<!--search_page AND index_page-->
</b:if>
</b:if>
#OR
@oliverdoetsch
oliverdoetsch / linkify.js
Last active August 29, 2015 14:02
wandelt In Blogger-Kommentare Text-Links in klickbare Links um
<script type='text/javascript'>
//<![CDATA[
(function($){
var url1 = /(^|&lt;|\s)(www\..+?\..+?)(\s|&gt;|$)/g,
url2 = /(^|&lt;|\s)(((https?|ftp):\/\/|mailto:).+?)(\s|&gt;|$)/g,
linkifyThis = function () {
var childNodes = this.childNodes,
i = childNodes.length;
<script type='text/javascript'>
//<![CDATA[
document.addEventListener("DOMContentLoaded",function(){var h=/\/s\B\d{2,4}/,g=document.getElementsByClassName("post-body")[0].offsetWidth,a=document.querySelectorAll(".post-body table");if("undefined"!=typeof a&&null!==a)for(var b=a.length;b--;){var d=a[b],c=document.createElement("div");c.setAttribute("class","separator");var e=document.createElement("div");e.style.textAlign="center";var f=a[b].querySelector("a").cloneNode(!0);c.appendChild(f);d.parentNode.replaceChild(c,d);a[b].querySelector(".tr-caption")&&
(d=a[b].querySelector(".tr-caption").innerText||a[b].querySelector(".tr-caption").textContent,e.innerHTML=d,c.appendChild(e))}a=document.querySelectorAll(".post-body img");for(b=a.length;b--;)c=a[b].height,e=a[b].width,d=Math.round(g/(e/c)),f="",f=e>=c?g:d,c=a[b].getAttribute("src").replace(h,"/s"+f),a[b].removeAttribute("width"),a[b].removeAttribute("height"),a[b].parentNode.removeAttribute("style"),a[b].style.marginLeft="0",a[b].style.padding="0",a[b].style
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
var postWidth = $('.post-body').width();
var sAttribut = /\/s\B\d{2,4}/;
$('.post-body').find('img').each(function(n, image) {
var thisHeight = $(this).height();
var thisWidth = $(this).width();
var thisRatio = thisWidth / thisHeight;
var newWidth = postWidth;
<script type="text/javascript">
//<![CDATA[
document.addEventListener('DOMContentLoaded', function() {
var sAttribut = /\/s\B\d{2,4}/;
var postWidth = document.getElementsByClassName('post-body')[0].offsetWidth;
var table = document.querySelectorAll('.post-body table');
if (typeof(table) != 'undefined' && table !== null) {
var n = table.length;
while (n--) {
var oldNode = table[n];
@oliverdoetsch
oliverdoetsch / image_full.js
Last active April 7, 2021 22:47
Give a Image 100% post-width inside a blogger blog.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
var postWidth = $('.post-body').width();
var sAttribut = /\/s\B\d{2,4}/;
$('.post-body').find('table').each(function() {
$(this).find('a').unwrap().unwrap();
$(this).find('.tr-caption').unwrap();
$(this).replaceWith($('table').html()
<b:if cond='data:top.showEmailButton'>
<div class='social-buttons'>
<!-- G+ button Start -->
<span class='g-plusone' data-align='left' data-annotation='bubble' data-size='medium' data-width='30' expr:data-href='data:post.canonicalUrl'/>
<!-- G+ button Start -->
<!-- Twitter button Start -->
<a class='twitter-share-button' data-lang='de' data-size='medium' data-width='20' expr:data-url='data:post.canonicalUrl' href='https://twitter.com/share'> Twittern</a>
<script>
@oliverdoetsch
oliverdoetsch / resizeImage.css
Last active September 24, 2018 20:09
automatically resize blogger images to fit full blog post area
.post-body img {
width: $(content.width);
height: auto;
margin-left: -1em;
padding: 0;
border: none;
max-width: 100%;
}
.post-body .tr-caption-container {
@oliverdoetsch
oliverdoetsch / resizeImage.js
Last active September 3, 2018 11:57
automatically resize blogger images to fit full blog post area
<script language='javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$.fn.resizeImage = function() {
$('.post-body').table_to_div();
var postWidth = $('.post-body').width();
var sAttribut = /\/s\B\d{2,4}/;
$('.post-body').find('img').each(function(n, image){
@oliverdoetsch
oliverdoetsch / gist:8164086
Created December 28, 2013 20:53
backstretch
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;