Skip to content

Instantly share code, notes, and snippets.

View jenswittmann's full-sized avatar

Jens Wittmann – Gestaltung & Entwicklung jenswittmann

View GitHub Profile
@jenswittmann
jenswittmann / redactorReplace
Last active November 18, 2015 21:32
MODX Redactor replace inline CSS and add SrcSet: http://jens-wittmann.de/codeschnipsel/redactor-editor.html
<?php
$o = $input;
// replace inline css
$o = preg_replace('/(<[^>]+) style=".*"/iU', '$1', $o);
// remove paragraph around img and iframe
$o = preg_replace('/<p>\s*(<img.*>)\s*<\/p>/iU', '$1', $o);
$o = preg_replace('/<p>\s*(<iframe.*>\s*<\/iframe>)\s*<\/p>/iU', '$1', $o);
@jenswittmann
jenswittmann / gist:1104418adf3720b72c10
Created November 21, 2014 13:41
Phongap: iframes under iOS
// CSS
#wrapper-app {
overflow: auto;
width: 100%;
height: 100%;
-webkit-overflow-scrolling: touch;
}
// HTML
...
@jenswittmann
jenswittmann / gist:6346337
Created August 26, 2013 20:36
Um das Datum unter MODx Revolution korrekt auszugeben, musst du die folgende Einstellung unter "Systemeinstellungen" vornehmen, damit Umlaute korrekt dargestellt werden.
Locale locale de_DE.UTF-8
@jenswittmann
jenswittmann / gist:6346133
Last active December 21, 2015 18:19
Looking for responsive embed Videos? Hier is the CSS only trick. You only have to remove width/height in the <iframe> tag. Thanks to www.andmag.se/2011/11/responsive-embeds
.embed {
position: relative;
overflow: hidden;
height: 0;
padding-bottom: 56.25%; /* 16/9 ratio */
padding-top: 30px; /* IE6 workaround*/
iframe {
position: absolute;
top: 0;