jQuery(function($) { $( "#datepicker" ).datepicker({ showOtherMonths: true, selectOtherMonths: false, //isRTL:true, /* changeMonth: true, changeYear: true, showButtonPanel: true, beforeShow: function() { //change button colors var datepicker = $(this).datepicker( "widget" ); setTimeout(function(){ var buttons = datepicker.find('.ui-datepicker-buttonpane') .find('button'); buttons.eq(0).addClass('btn btn-xs'); buttons.eq(1).addClass('btn btn-xs btn-success'); buttons.wrapInner(''); }, 0); } */ }); //override dialog's title function to allow for HTML titles $.widget("ui.dialog", $.extend({}, $.ui.dialog.prototype, { _title: function(title) { var $title = this.options.title || ' ' if( ("title_html" in this.options) && this.options.title_html == true ) title.html($title); else title.text($title); } })); $( "#id-btn-dialog1" ).on('click', function(e) { e.preventDefault(); var dialog = $( "#dialog-message" ).removeClass('hide').dialog({ modal: true, title: "
", title_html: true, buttons: [ { text: "Cancel", "class" : "btn btn-xs", click: function() { $( this ).dialog( "close" ); } }, { text: "OK", "class" : "btn btn-primary btn-xs", click: function() { $( this ).dialog( "close" ); } } ] }); /** dialog.data( "uiDialog" )._title = function(title) { title.html( this.options.title ); }; **/ }); $( "#id-btn-dialog2" ).on('click', function(e) { e.preventDefault(); $( "#dialog-confirm" ).removeClass('hide').dialog({ resizable: false, modal: true, title: " ", title_html: true, buttons: [ { html: " Delete all items", "class" : "btn btn-danger btn-xs", click: function() { $( this ).dialog( "close" ); } } , { html: " Cancel", "class" : "btn btn-xs", click: function() { $( this ).dialog( "close" ); } } ] }); }); //autocomplete var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; $( "#tags" ).autocomplete({ source: availableTags }); //custom autocomplete (category selection) $.widget( "custom.catcomplete", $.ui.autocomplete, { _create: function() { this._super(); this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); }, _renderMenu: function( ul, items ) { var that = this, currentCategory = ""; $.each( items, function( index, item ) { var li; if ( item.category != currentCategory ) { ul.append( "