Skip to content

Instantly share code, notes, and snippets.

View c4y's full-sized avatar

Oliver Lohoff c4y

View GitHub Profile
@c4y
c4y / contao_headline_html
Created April 11, 2012 20:25
Contao Headline with HTML
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['eval']['allowHtml'] = true;
@c4y
c4y / contao_generate_frontendurl
Created April 11, 2012 20:26
Contao Url generieren
global $objPage;
$strUrl = $this->generateFrontendUrl($objPage->row(), 'id=12');
@c4y
c4y / contao_minicalendar_ajax
Last active October 3, 2015 01:27
Contao 3.2 cal_mini.html5 Ajax Script (Mootools)
<table class="minicalendar">
<thead>
<tr>
<th class="head previous"><?php if ($this->prevHref): ?><a href="<?php echo $this->prevHref; ?>" rel="nofollow" title="<?php echo $this->prevTitle; ?>"><?php echo $this->prevLabel; ?></a><?php else: ?>&nbsp;<?php endif; ?></th>
<th colspan="5" class="head current"><?php echo $this->current; ?></th>
<th class="head next"><?php if ($this->nextHref): ?><a href="<?php echo $this->nextHref; ?>" rel="nofollow" title="<?php echo $this->nextTitle; ?>"><?php echo $this->nextLabel; ?></a><?php else: ?>&nbsp;<?php endif; ?></th>
</tr>
<tr>
<?php foreach ($this->days as $i=>$day): ?>
<th class="label<?php echo $day['class']; ?>"><?php echo utf8_substr($day['name'], 0, $this->substr); ?><span class="invisible"><?php echo utf8_substr($day['name'], $this->substr); ?></span></th>
@c4y
c4y / contao_gallery_ajax
Created April 11, 2012 20:31
Contao Gallery Ajax
@c4y
c4y / gist:2768612
Created May 22, 2012 12:02
Eltern DIV entfernen
var children = $('remove-just-this').getChildren();
children.replaces($('remove-just-this');
@c4y
c4y / youtube_channel
Created June 1, 2012 15:34
Youtube Channel einbinden
function youtube_feed_shortcode($atts)
{
// Defaults:
extract(shortcode_atts(array(
'user' => 'flamadiddle86', // youtube user
'limit' => 5, // maximum number of videos
'height' => 385, // video height
'width' => 480 // video width
), $atts));
$data = @json_decode(file_get_contents('http://gdata.youtube.com/feeds/api/users/'.$user.'/uploads?alt=json'), TRUE);
@c4y
c4y / gist:3311337
Created August 10, 2012 05:34
sessionStorage
// Initialize
var sds = new SessionDataStore();
// Store simple string
sds.set('foo', 'bar');
// Store object
sds.set('testobject', { foo: "bar" } );
// Get value back (will be a proper object, not just string)
var val = sds.get('testobject');
// Copy something
sds.copy('foo', 'foo2');
@c4y
c4y / md5.js
Created August 10, 2012 05:37
MD5
/*
* md5.js 1.0b 27/06/96
*
* Javascript implementation of the RSA Data Security, Inc. MD5
* Message-Digest Algorithm.
*
* Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
* and its documentation for any purposes and without
@c4y
c4y / sha1.js
Created August 10, 2012 05:38
SHA1 Javascript
/**
*
* Secure Hash Algorithm (SHA1)
* http://www.webtoolkit.info/
*
**/
function SHA1 (msg) {
function rotate_left(n,s) {
@c4y
c4y / Megamenu Fade jQuery
Last active December 15, 2015 14:09
Megamenu Fade jQuery
<script>
$(document).ready(function(){
jQuery("li.submenu").hover(
function() {
jQuery("div.submenu", this).css("display", "none");
jQuery("div.submenu", this).css("left", "0");
jQuery("div.submenu", this).fadeIn();
},
function() {
jQuery("div.submenu", this).fadeOut(function(){