Skip to content

Instantly share code, notes, and snippets.

@iksela
iksela / validate.js
Created June 30, 2011 09:53
Remote validation
$("#form").validate({
rules: {
code: {minlength:3,maxlength:6,remote:'validate.php'}
},
messages: {
code: {
remote: 'This code is already in use.'
}
}
});
// Tabs
$(function(){
$("#tabs0").tabs({
show: function(ui, event) {
ttInstances = TableTools.fnGetMasters();
for (i in ttInstances) {
if (ttInstances[i].that.fnResizeRequired()) ttInstances[i].that.fnResizeButtons();
}
}
});
@iksela
iksela / index.html
Created May 18, 2011 13:29
Polar Clock
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Polar Clock</title>
<link rel="stylesheet" href="demo.css" media="screen">
<script type="text/javascript" src="jquery-1.5.2.js"></script>
<script src="raphael.js"></script>
<script>
window.onload = function () {
@iksela
iksela / DqlConvert.php
Created April 27, 2011 14:57
Custom DQL functions
<?php
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
class DqlConvert extends FunctionNode {
public $field;
public $convertMode;
$("#tabs").tabs({
show: function(ui, event) {
ttInstances = TableTools.fnGetMasters();
for (i in ttInstances) {
if (ttInstances[i].that.fnResizeRequired()) ttInstances[i].that.fnResizeButtons();
}
}
});
@iksela
iksela / a.js
Created January 13, 2011 10:42
Display TableTools buttons as JQueryUI buttons with an icon
function formatTableToolsButton(node, icon) {
$(node).removeClass('DTTT_button');
$(node).button({icons: {primary: icon}});
$('.DTTT_container').buttonset();
/* Add this part if you're using a DataTable inside an hidden JUI tab. */
$( ".ui-tabs" ).bind( "tabsshow", function(event, ui) {
$('.DTTT_container').buttonset();
});
}
@iksela
iksela / datatables_init.js
Created January 12, 2011 10:09
This file will be used to overload some styles and format the print output.
$('#tableID').dataTable({
"bProcessing": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": 'ajax/datatables.php',
"oLanguage": { "sUrl": "../res/js/dataTables.fr.txt" },
"sDom": '<"H"Tfr>t<"F"ip>',
"oTableTools": {
"sSwfPath": "../res/swf/copy_cvs_xls_pdf.swf",
"aButtons": [