");
}
counter++;
}
});
//console.log(checkboxes.replace('<-TOP->','')+"|"+textboxes.replace('<-TOP->',''));
prettyEditMenuPage();
}
function showHideSection(text) {
switch(text)
{
case 'Admin Bar': jQuery('#section_admin_bar').show(); jQuery('#section_admin_bar .section_title').trigger('focus');
break;
case 'Admin Footer': jQuery('#section_admin_footer').show(); jQuery('#section_admin_footer .section_title').trigger('focus');
break;
case 'Dashboard Page': jQuery('#section_dashboard_page').show(); jQuery('#section_dashboard_page .section_title').trigger('focus');
break;
case 'Login Page': jQuery('#section_login_page').show(); jQuery('#section_login_page .section_title').trigger('focus');
break;
case 'Admin Menu': jQuery('#section_admin_menu').show(); jQuery('#section_admin_menu .section_title').trigger('focus');
break;
case 'Colorizer': jQuery('#section_ag_colorizer_settings').show(); jQuery('#section_ag_colorizer_settings .section_title').trigger('focus');
break;
default: jQuery('#section_admin_bar').show(); jQuery('#section_admin_bar .section_title').trigger('focus');
}
}
function hideAllSections(){
jQuery('#ag_main_menu li').each(function(){
jQuery(this).attr("class","normal");
});
jQuery('.ag_section').each(function(){
jQuery(this).hide();
});
}
function reloadRemoveButtonEvents(){
jQuery('a.button_remove').click(function(){
jQuery(this).parent().parent().remove();
});
jQuery('a.button_edit').click(function(){
if(editingButtonNow == false){
var name = jQuery(this).parent().find('button').text();
var url = jQuery(this).parent().find('button').attr('title');
editingButtonNow = name;
jQuery(this).parent().append('
name:url:
');
reloadRemoveButtonEvents();
}
});/*Save editing changes*/
jQuery('#ag_add_adminmenu_button_edit').click(function(){
//alert(jQuery(this).parent().html());
var name = jQuery('#ag_add_adminmenu_name_edit').val();
var url = jQuery('#ag_add_adminmenu_url_edit').val();
jQuery('#temporary_button_edit').remove();
var element = 0;
jQuery('#ag_add_adminmenu :button').each(function(){
//dont use first button for adding new buttons
if(element > 0){
if(jQuery(this).html() == editingButtonNow){
jQuery(this).attr('title',url);
jQuery(this).html(name);
}
}
element++;
});
editingButtonNow = false;
});
};
jQuery(document).ready(function(){
/*Add click handler on main buttons*/
jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(){
hideAllSections();
var text = jQuery(this).text();
jQuery(this).attr("class","selected");
showHideSection(text);
});
/*Admin Menu Reset all setings button*/
jQuery('#ag_edit_adminmenu_reset_button').click(function(){
afterFormClickCreateJson = false;
jQuery('#agca_form').submit();
});
/*Add new menu item button - creates new HTMl button elements*/
jQuery('#ag_add_adminmenu_button').click(function(){
var name = jQuery('#ag_add_adminmenu_name').val();
var url = jQuery('#ag_add_adminmenu_url').val();
jQuery('#ag_add_adminmenu').append('