This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Make it fullscreen / hide the browser URL bar --> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getColourNice(){ | |
$obj= HTMLText::create(); | |
$obj->setValue('<div style="background-color: '.$this->Colour.'; width: 100px; height: 100px;"> </div>'); | |
return $obj; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function show(SS_HTTPRequest $request) { | |
$page = DataObject::get_by_id('SiteTree', $this->URLParams['ID'] ); | |
if(!$page) { | |
return $this->httpError(404,'That page could not be found'); | |
} | |
$controller = new ObjektPage_Controller($page); | |
$controller->init(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#TermsModal').on('shown.bs.modal', function () { | |
$('#MyModal').css('z-index', 1040); | |
}); | |
$('#TermsModal').on('hidden.bs.modal', function () { | |
$('#MyModal').css('z-index', 1050); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).on('scroll', function() { | |
var header = $("header"); | |
var scrollBottom = $(document).height() - $(this).scrollTop() - $(this).height(); | |
if ($(this).scrollTop() > 350 && scrollBottom > 450 ) { | |
if (!header.data('faded')) header.data('faded', 1).stop(true).fadeTo(400, 0); | |
} else if (header.data('faded')) { | |
header.data('faded', 0).stop(true).fadeTo(400, 1); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://stackoverflow.com/questions/19888110/silverstripe-convert-twitter-json-string-to-dataobject-to-loop-though-in-templa | |
public static function getTwitterFeed(){ | |
$settings = array( | |
'oauth_access_token' => "xxx", | |
'oauth_access_token_secret' => "xxx", | |
'consumer_key' => "xxx", | |
'consumer_secret' => "xxx" | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Name: customi18n | |
Before: 'defaulti18n' | |
--- | |
i18n: | |
module_priority: | |
- mysite | |
- othermodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isTouchDevice() { | |
return 'ontouchstart' in document.documentElement; | |
} | |
// Hack to make dropdown menu work on touch devices | |
var el = $('#main-nav ul.nav > li.dropdown-large a.dropdown-toggle'); | |
/* If mobile browser, prevent click on parent nav item from redirecting to URL */ |