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
def get_attribute(self,attribute_name): | |
try: | |
return self.data[attribute_name] | |
except (KeyError,TypeError): | |
print self.data.__class__ | |
exit() |
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
$(document).ready(function() { | |
// initial input addition | |
$(".forum_thumbnail_addThumbnail").live('click',function() { | |
var $this = $(this); | |
$.get('/forum/ajaxGetThumbnailInput',function(data,status) { | |
if( status == 'success' ) { | |
$(data).appendTo($this.parent().parent()); | |
$this.parent().hide(); | |
} | |
}); |
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
<?php | |
$list = array('this','that','theother','andthis'); | |
$evenList = (count($list)%2==0) ? true : false; | |
$listOne = array(); | |
$listTwo = array(); | |
if( $evenList ) { | |
$half = count($list)/2; | |
$listOne = array_slice($list,0,$half); |
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
<script type="text/javascript"> | |
function highlightDates(date) { | |
for ( var i = 0; i < agenda.length; i++) { | |
var start = agenda[i].substring(0,4) + '-' + num_pad(parseInt(agenda[i].substring(5,7)-1),2,'0') + '-' + agenda[i].substr(8,2); | |
//var start = agenda[i].date; | |
var dateString = date.getFullYear() + '-' + num_pad(date.getMonth(),2,'0') + '-' + num_pad(date.getDate(),2,'0'); | |
if (start == dateString) { | |
return [ true, 'ui-state-active' ]; | |
} | |
} |
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
$("a.ajax").live('click',function(e) { | |
e.preventDefault(); | |
var $this = $(this); | |
url = $(this).attr('href'); | |
$.get(url,function(data) { | |
if(data) { | |
if( $this.hasClass('addHtmlToParent') ) { | |
$this.parent().append(data); // append return content to parent | |
} else { | |
eval(data); // execute return js |
NewerOlder