芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/themes/lorem-ipsum-books-media-store/fw/js/core.admin.js
/** * Lorem Ipsum Books & Media Store Framework: Admin scripts * * @package lorem_ipsum_books_media_store * @since lorem_ipsum_books_media_store 1.0 */ jQuery(document).ready(function() { "use strict"; // Refresh categories when post type is changed jQuery('.widgets_param_post_type_selector').on('change', function() { "use strict"; var cat_fld = jQuery(this).parent().next().find('select'); var cat_lbl = jQuery(this).parent().next().find('label'); lorem_ipsum_books_media_store_admin_fill_categories(this, cat_fld, cat_lbl); return false; }); // Set parent course jQuery('.lorem_ipsum_books_media_store_course_selector').on('click', function(e) { "use strict"; var id = jQuery(this).data('parent_id'); if (id > 0) { jQuery('select#parent_course').val(id).siblings('input[type="submit"]').trigger('click'); e.preventDefault(); return false; } }); }); // Fill categories in specified field function lorem_ipsum_books_media_store_admin_fill_categories(fld, cat_fld, cat_lbl) { "use strict"; var cat_value = lorem_ipsum_books_media_store_get_listbox_selected_value(cat_fld.get(0)); cat_lbl.append('
'); var pt = jQuery(fld).val(); // Prepare data var data = { action: 'lorem_ipsum_books_media_store_admin_change_post_type', nonce: LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE['ajax_nonce'], post_type: pt }; jQuery.post(LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE['ajax_url'], data, function(response) { "use strict"; var rez = {}; try { rez = JSON.parse(response); } catch (e) { rez = { error: LOREM_IPSUM_BOOKS_MEDIA_STORE_STORAGE['ajax_error'] }; console.log(response); } if (rez.error === '') { var opt_list = ''; for (var i in rez.data.ids) { opt_list += '
'+rez.data.titles[i]+'
'; } cat_fld.html(opt_list); cat_lbl.find('span').remove(); } }); return false; }