jQuery(document).ready(function () { function showTooltip(x, y, contents) { jQuery('
' + contents + '
').css( { position: 'absolute', display: 'none', top: y + 5, left: x + 5 }).appendTo("body").fadeIn(200); } //////////// TABS ///////////////// jQuery( "#tabs" ).tabs(); //////////// ACCORDION ///////////////// jQuery( ".accordion" ).accordion(); }); var portlets = ["feeds", "shopping", "news", "links", "images"]; jQuery(document).ready(function () { jQuery('#menu2').click(function(event) { jQuery('#window_dialog').dialog({ autoOpen: true, draggable: false, modal: true, title: 'Settings', buttons: { "Save": function () { jQuery(portlets).each(function() { set_window_visibility(this); }); jQuery(".column1").width(parseInt($('#c1-width').val())); jQuery(".column2").width(parseInt($('#c2-width').val())); jQuery(".column3").width(parseInt($('#c3-width').val())); jQuery(this).dialog('destroy'); }, "Cancel": function () { jQuery(this).dialog('destroy'); } } }); }); function set_window_visibility(name){ if(jQuery('#'+name+'-visible').is(':checked')) jQuery('#'+name+'-portlet').show(); else jQuery('#'+name+'-portlet').hide(); } function set_visible_check(name){ if(jQuery('#'+name+'-portlet').is(":visible")) jQuery('#'+name+'-visible').each(function(){ this.checked = true; }); else jQuery('#'+name+'-visible').attr("checked", false); } jQuery( "#settings_dialog" ).bind( "dialogopen", function(event, ui) { }); jQuery( "#window_dialog" ).bind( "dialogopen", function(event, ui) { jQuery(portlets).each(function() { set_visible_check(this); }); jQuery('#c1-width').val(jQuery(".column1").width()); jQuery('#c2-width').val(jQuery(".column2").width()); jQuery('#c3-width').val(jQuery(".column3").width()); }); }); jQuery(function() { jQuery( ".dash-column1" ).sortable({ connectWith: ".dash-column1, .dash-column2" }); jQuery( ".dash-column2" ).sortable({ connectWith: ".dash-column1, .dash-column2" }); /*jQuery( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" ) .find( ".portlet-header" ) .addClass( "ui-widget-header ui-corner-all" ) .prepend( "") .end() .find( ".portlet-content" );*/ /** * Widget Box Toggle **/ jQuery('.portlet-header').hover(function(){ jQuery(this).find('.ui-icon').addClass('display'); return false; },function(){ jQuery(this).find('.ui-icon').removeClass('display'); return false; }); jQuery('.portlet-header').toggle(function(){ jQuery(this).next().slideUp('fast'); jQuery(this).css({ MozBorderRadius: '3px', WebkitBorderRadius: '3px', borderRadius: '3px' }); return false; },function(){ jQuery(this).next().slideDown('fast'); jQuery(this).css({ MozBorderRadius: '3px 3px 0 0', WebkitBorderRadius: '3px 3px 0 0', borderRadius: '3px 3px 0 0' }); return false; }); jQuery( ".icon-vis" ).click(function() { jQuery( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" ); jQuery( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle(); }); jQuery( ".icon-close" ).click(function() { //$( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" ); jQuery( this ).parents( ".portlet:first" ).hide(); }); jQuery( ".column" ).disableSelection(); });