$(function() { // show or hide a plugin $(".pluginshow, .pluginhide").click(function(){ // the id of the menusection var plugin_id = $(this).parent().attr("id"); // the id of the icon the user clicked on var icon_id = $(this).attr("id"); // getting the action and the plugin from the id of the icon var actionpluginarray = icon_id.split("_"); var action = actionpluginarray[0]; var plugin = actionpluginarray[1]; // toggle the + and - icon $("#" + plugin_id +" .pluginshow").toggle(); $("#" + plugin_id +" .pluginhide").toggle(); // toggle the content $("#" + plugin_id +" .menusectioncontent").toggle(); // store the user-setting $.get("main/ajaxHandler.php", { action: action, plugin: plugin, user_id: "" }, function(data){ //$("#confidentiallity_"+dissertation_document_id).parent().html(data); }); }); // show or hide a plugin $(".pluginremove").click(function(){ // the id of the icon the user clicked on var icon_id = $(this).attr("id"); // getting the action and the plugin from the id of the icon var actionpluginarray = icon_id.split("_"); var action = actionpluginarray[0]; var plugin = actionpluginarray[1]; // remove the plugin $("#plugin_" + plugin).remove(); // store the user-setting $.get("main/ajaxHandler.php", { action: action, plugin: plugin, user_id: "" }, function(data){ //$("#confidentiallity_"+dissertation_document_id).parent().html(data); }); }); // sortable table: select a row in a sortable table $('.sortabletable_checkbox').click(function(){ $(this).parents('tr').toggleClass('row_selected'); }); // sortable table: indicate a column in the sortable table as sortable $('table.display th:not(.sorting) > a').append(''); // sortable table: give first column the class firstcolumn $('table.display tr').find('td:first').addClass('firstcolumn'); // sortable table: give last column the class lastcolumn $('table.display tr').find('td:last').addClass('lastcolumn'); // sortable table: give the first row a class firstrow $('table.display tr:first-child').addClass('firstrow'); // sortable table: give the first row a class firstrow $('table.display tr:last-child').addClass('lastrow'); // toggle subactions $('.hassubactions').live('click', function(){ var subaction_id = $(this).attr('id'); $('#'+subaction_id+'_subactions').slideToggle('slow'); }); // shortened items $('.short').hover(function(){ $('span.short_more', this).toggle(); $('span.short_rest', this).toggle(); }); // size of form elements should respect the size attribute $('input[size]').filter(':text').each(function(){ if ($(this).attr('size') > 0) { $(this).attr('style','width:'+$(this).attr('size')*8+'px;'); } }); $('input[size]').filter(':password').each(function(){ if ($(this).attr('size') > 0) { $(this).attr('style','width:'+$(this).attr('size')*8+'px;'); } }); }); function unlockmultipleactions(elementname){ if ($("input[name="+elementname+"]:checked").length > 0){ $("#multiple_actions").attr("disabled", ""); $("#multiple_actions_submit").attr("disabled", ""); } else { $("#multiple_actions").attr("disabled", "disabled"); $("#multiple_actions_submit").attr("disabled", "disabled"); } } function select_all_none(master, individual){ var thisvalue = $("input[name="+master+"]").attr("checked"); if (thisvalue == true){ value = true; } else { value = false; } if (value == true){ $('input[name='+individual+']').attr('checked','checked'); // check the upper or lower selectall/selectnone checkbox accordingly // in sortable table the action can come from the top or bottom checkbox if (master == 'select_all_none_actions') { $('input[name=select_all_none_actions_top]').attr('checked','checked'); } else { $('input[name=select_all_none_actions]').attr('checked','checked'); } } else { $('input[name='+individual+']').attr('checked',''); // check the upper or lower selectall/selectnone checkbox accordingly // in sortable table the action can come from the top or bottom checkbox if (master == 'select_all_none_actions') { $('input[name=select_all_none_actions_top]').attr('checked',''); } else { $('input[name=select_all_none_actions]').attr('checked',''); } } unlockmultipleactions(individual); }