Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2499411007 for ; Mon, 21 Jul 2014 19:31:31 +0000 (UTC) Received: (qmail 10820 invoked by uid 500); 21 Jul 2014 19:31:31 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 10786 invoked by uid 500); 21 Jul 2014 19:31:30 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 10777 invoked by uid 99); 21 Jul 2014 19:31:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 19:31:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2014 19:31:30 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0483123889CB; Mon, 21 Jul 2014 19:31:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1612389 - in /accumulo/site/trunk: content/js/dataTables.bootstrap.js templates/skeleton.html Date: Mon, 21 Jul 2014 19:31:04 -0000 To: commits@accumulo.apache.org From: afuchs@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140721193105.0483123889CB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: afuchs Date: Mon Jul 21 19:31:04 2014 New Revision: 1612389 URL: http://svn.apache.org/r1612389 Log: added missing js file for bootstrap+dataTables Added: accumulo/site/trunk/content/js/dataTables.bootstrap.js Modified: accumulo/site/trunk/templates/skeleton.html Added: accumulo/site/trunk/content/js/dataTables.bootstrap.js URL: http://svn.apache.org/viewvc/accumulo/site/trunk/content/js/dataTables.bootstrap.js?rev=1612389&view=auto ============================================================================== --- accumulo/site/trunk/content/js/dataTables.bootstrap.js (added) +++ accumulo/site/trunk/content/js/dataTables.bootstrap.js Mon Jul 21 19:31:04 2014 @@ -0,0 +1,251 @@ +/* Set the defaults for DataTables initialisation */ +$.extend( true, $.fn.dataTable.defaults, { + "sDom": + "<'row'<'col-xs-6'l><'col-xs-6'f>r>"+ + "t"+ + "<'row'<'col-xs-6'i><'col-xs-6'p>>", + "oLanguage": { + "sLengthMenu": "_MENU_ records per page" + } +} ); + + +/* Default class modification */ +$.extend( $.fn.dataTableExt.oStdClasses, { + "sWrapper": "dataTables_wrapper form-inline", + "sFilterInput": "form-control input-sm", + "sLengthSelect": "form-control input-sm" +} ); + +// In 1.10 we use the pagination renderers to draw the Bootstrap paging, +// rather than custom plug-in +if ( $.fn.dataTable.Api ) { + $.fn.dataTable.defaults.renderer = 'bootstrap'; + $.fn.dataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) { + var api = new $.fn.dataTable.Api( settings ); + var classes = settings.oClasses; + var lang = settings.oLanguage.oPaginate; + var btnDisplay, btnClass; + + var attach = function( container, buttons ) { + var i, ien, node, button; + var clickHandler = function ( e ) { + e.preventDefault(); + if ( e.data.action !== 'ellipsis' ) { + api.page( e.data.action ).draw( false ); + } + }; + + for ( i=0, ien=buttons.length ; i 0 ? + '' : ' disabled'); + break; + + case 'previous': + btnDisplay = lang.sPrevious; + btnClass = button + (page > 0 ? + '' : ' disabled'); + break; + + case 'next': + btnDisplay = lang.sNext; + btnClass = button + (page < pages-1 ? + '' : ' disabled'); + break; + + case 'last': + btnDisplay = lang.sLast; + btnClass = button + (page < pages-1 ? + '' : ' disabled'); + break; + + default: + btnDisplay = button + 1; + btnClass = page === button ? + 'active' : ''; + break; + } + + if ( btnDisplay ) { + node = $('
  • ', { + 'class': classes.sPageButton+' '+btnClass, + 'aria-controls': settings.sTableId, + 'tabindex': settings.iTabIndex, + 'id': idx === 0 && typeof button === 'string' ? + settings.sTableId +'_'+ button : + null + } ) + .append( $('', { + 'href': '#' + } ) + .html( btnDisplay ) + ) + .appendTo( container ); + + settings.oApi._fnBindAction( + node, {action: button}, clickHandler + ); + } + } + } + }; + + attach( + $(host).empty().html('