Submit Directory

'; return image_attachment_tpl; }; window.w2dc_update_images_attachments_order = function() { $("#w2dc-attached-images-order").val($(".w2dc-attached-item-id").map(function() { return $(this).val(); }).get()); } window.w2dc_check_images_attachments_number = function() { if (images_number > $("#w2dc-images-upload-wrapper .w2dc-attached-item").length) { $(".w2dc-upload-item").show(); return true; } else { $(".w2dc-upload-item").hide(); return false; } } $(function() { $("#w2dc-attached-images-wrapper").sortable({ placeholder: "ui-sortable-placeholder", items: ".w2dc-attached-item", helper: function(e, ui) { ui.children().each(function() { $(this).width($(this).width()); }); return ui; }, start: function(e, ui){ ui.placeholder.width(ui.item.width()); ui.placeholder.height(ui.item.height()); }, update: function( event, ui ) { w2dc_update_images_attachments_order(); } }); w2dc_check_images_attachments_number(); $("#w2dc-attached-images-wrapper").on("click", ".w2dc-attached-item-delete", function() { $(this).parents(".w2dc-attached-item").remove(); $.ajax({ url: w2dc_js_objects.ajaxurl, type: "POST", dataType: "json", data: { action: 'w2dc_remove_image', post_id: 12216, attachment_id: $(this).parent().find(".w2dc-attached-item-id").val(), _wpnonce: 'bc2140b2d1' } }); w2dc_check_images_attachments_number(); w2dc_update_images_attachments_order(); }); $(document).on("click", ".w2dc-upload-item-button", function(e){ e.preventDefault(); $(this).parent().find("input").click(); }); $('.w2dc-upload-item').fileupload({ sequentialUploads: true, dataType: 'json', url: 'https://edoupdates.com/wp-admin/admin-ajax.php?action=w2dc_upload_image&post_id=12216&_wpnonce=5e3002e29e', dropZone: $('.w2dc-drop-attached-item'), add: function (e, data) { if (w2dc_check_images_attachments_number()) { var jqXHR = data.submit(); } else { return false; } }, send: function (e, data) { w2dc_add_iloader_on_element($(this).find(".w2dc-drop-attached-item")); }, done: function(e, data) { var result = data.result; if (result.uploaded_file) { $(this).before(w2dc_image_attachment_tpl(result.attachment_id, result.uploaded_file, data.files[0].name)); w2dc_custom_input_controls(); } else { $(this).find(".w2dc-drop-attached-item").append("

"+result.error_msg+"

"); } $(this).find(".w2dc-drop-zone").show(); w2dc_delete_iloader_from_element($(this).find(".w2dc-drop-attached-item")); w2dc_check_images_attachments_number(); w2dc_update_images_attachments_order(); } }); }); })(jQuery);
' + '
' + ''; return video_attachment_tpl; }; window.w2dc_check_videos_attachments_number = function() { if (videos_number > $("#w2dc-attached-videos-wrapper .w2dc-attached-item").length) { $("#w2dc-attach-videos-functions").show(); } else { $("#w2dc-attach-videos-functions").hide(); } } $(function() { w2dc_check_videos_attachments_number(); $("#w2dc-attached-videos-wrapper").on("click", ".w2dc-attached-item-delete", function() { $(this).parents(".w2dc-attached-item").remove(); w2dc_check_videos_attachments_number(); }); }); })(jQuery);

Attach videos

').dialog({ dialogClass: 'w2dc-content', width: ($(window).width()*0.5), height: ($(window).height()*0.8), modal: true, resizable: false, draggable: false, title: 'Select map marker icon (icon and color may depend on selected categories)', open: function() { w2dc_ajax_loader_show(); $.ajax({ type: "POST", url: w2dc_js_objects.ajaxurl, data: {'action': 'w2dc_select_field_icon'}, dataType: 'html', success: function(response_from_the_action_function){ if (response_from_the_action_function != 0) { $('#select_marker_icon_dialog').html(response_from_the_action_function); if (map_icon_file_input.val()) $("#"+map_icon_file_input.val()).addClass("w2dc-selected-icon"); } }, complete: function() { w2dc_ajax_loader_hide(); } }); $(document).on("click", ".ui-widget-overlay", function() { $('#select_marker_icon_dialog').remove(); }); }, close: function() { $('#select_marker_icon_dialog').remove(); } }); }); $(document).on("click", ".w2dc-fa-icon", function() { $(".w2dc-selected-icon").removeClass("w2dc-selected-icon"); if (map_icon_file_input) { map_icon_file_input.val($(this).attr('id')); map_icon_file_input = false; $(this).addClass("w2dc-selected-icon"); $('#select_marker_icon_dialog').remove(); w2dc_generateMap_backend(); } }); $(document).on("click", "#reset_fa_icon", function() { if (map_icon_file_input) { $(".w2dc-selected-icon").removeClass("w2dc-selected-icon"); map_icon_file_input.val(''); map_icon_file_input = false; $('#select_marker_icon_dialog').remove(); w2dc_generateMap_backend(); } }); $(".add_address").click(function() { w2dc_ajax_loader_show(); $.ajax({ type: "POST", url: w2dc_js_objects.ajaxurl, data: {'action': 'w2dc_add_location_in_metabox', 'post_id': 12216}, success: function(response_from_the_action_function){ if (response_from_the_action_function != 0) { $("#w2dc-locations-wrapper").append(response_from_the_action_function); $(".w2dc-delete-address").show(); if (locations_number == $(".w2dc-location-in-metabox").length) { $(".add_address").hide(); } if (w2dc_maps_objects.address_autocomplete && w2dc_js_objects.is_maps_used) { w2dc_setupAutocomplete(); } } }, complete: function() { w2dc_ajax_loader_hide(); } }); }); $(document).on("click", ".w2dc-delete-address", function() { $(this).parents(".w2dc-location-in-metabox").remove(); if ($(".w2dc-location-in-metabox").length == 1) $(".w2dc-delete-address").hide(); w2dc_generateMap_backend(); if (locations_number > $(".w2dc-location-in-metabox").length) $(".add_address").show(); }); $(document).on("click", ".w2dc-manual-coords", function() { if ($(this).is(":checked")) $(this).parents(".w2dc-manual-coords-wrapper").find(".w2dc-manual-coords-block").slideDown(200); else $(this).parents(".w2dc-manual-coords-wrapper").find(".w2dc-manual-coords-block").slideUp(200); }); if (locations_number > $(".w2dc-location-in-metabox").length) $(".add_address").show(); }); })(jQuery);