Skip to content

Instantly share code, notes, and snippets.

@loulou2u
loulou2u / private.application.mytab.php
Last active August 29, 2015 14:19
Adding a LiveWhale Tab
public function onTabs($tabs) { // configures tabs
global $_LW;
if (@$_SESSION['livewhale']['manage']['grouptitle']!='Public'){
$tabs['mytab']=array('MyTab','https://link-to-your-application.edu',0,0,0); // add tab
}
return $tabs;
}
@loulou2u
loulou2u / private.application.custom_events.php
Last active August 29, 2015 14:18
private.application.custom_events.php
<?php
$_LW->REGISTERED_APPS['custom_events']=array(
'title'=>'Custom Events',
'handlers'=>array('onOutput')
);
class LiveWhaleApplicationCustomEvents{
public function onOutput($buffer){
<style type="text/css">
/* Use the height attribute on the targetting class or id,
to determine where to shorten the content */
.events_summary{height: 100px;}
</style>
@loulou2u
loulou2u / gist:edb290bd1280fd6bee31
Last active August 29, 2015 14:16
shorten summary with dotdotdot
<script type="text/javascript" language="javascript">
$(document).ready(function() {
//indicate the class or id to apply the dotdotdot function
$(".events_summary").dotdotdot({
//configuration goes here
ellipsis: '... ',
wrap: 'word'
});
});
</script>
@loulou2u
loulou2u / private.application.custom_fields.php
Last active August 29, 2015 14:08
This Alex-made™ code demonstrates how to use five handlers to get and set a custom field on an existing LiveWhale datatype.
<?php
/*
This is a sample application designed to demonstrate how to add an additional custom field to a backend editor.
The example provided adds a "Dress Code" field to the existing event editor in LiveWhale. To add a custom field to the news editor, for example, follow the same example but change all references from events to news below.
*/