Changeset 1167864
- Timestamp:
- 05/26/2015 05:21:49 PM (11 years ago)
- Location:
- multi-image-widget/trunk/assets
- Files:
-
- 4 edited
-
css/miw_admin.css (modified) (2 diffs)
-
css/miw_frontend.css (modified) (1 diff)
-
js/miw_custom.js (modified) (5 diffs)
-
js/miw_frontend_custom.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
multi-image-widget/trunk/assets/css/miw_admin.css
r1163052 r1167864 10 10 .mycustom_on{display:block; position: relative;margin-bottom:15px;} 11 11 .mycustom_off{display:none;} 12 13 .miw_on{display:block; position: relative;margin-bottom:15px;} 14 .miw_off{display:none;} 15 16 12 17 .delete{cursor:pointer;} 13 18 .upload-file-container{ … … 26 31 text-align: center; 27 32 } 28 .upload-thumb img.uploaded_img{width: 100%;}33 .upload-thumb img.uploaded_img{width:33%;} 29 34 .upload-thumb img.delete{margin-left:90%;} 30 35 .upload-thumb img{ -
multi-image-widget/trunk/assets/css/miw_frontend.css
r1163052 r1167864 17 17 18 18 .miw-loop{ 19 cursor: pointer;19 list-style:none; 20 20 margin-bottom: 7px; 21 21 } -
multi-image-widget/trunk/assets/js/miw_custom.js
r1163052 r1167864 6 6 7 7 var miw_uploader; 8 $('.upload_image_button').live("click", function(e) { 8 var widgetid; 9 var widgetname; 10 var next_upload_btn; 11 12 $('.miw_upload_image').live("click", function(e) { 9 13 e.preventDefault(); 10 14 /* 11 * This variable is used to show the other field option : like :upload lin,uploaded image and it's redirecting option. 15 *Initialize the two variable : widgetid and widgetname 16 *Because it is used to identify the unique field with unique widget. 12 17 */ 13 var formfieldID_current = jQuery(this).attr("name"); 14 /* 15 *Next uploaded button field option: 16 */ 17 var data_nextval = $(this).attr("data-nextval"); 18 /* 19 *uplaod the current and next value to the hidden value so that we can use it once image have been uploaded. 20 */ 21 $(".miw_current_running_value").attr("data-current",formfieldID_current); 22 $(".miw_current_running_value").attr("data-next",data_nextval); 18 widgetid = $(this).data('widgetid'); 19 widgetname = $(this).data('widgetname'); 20 next_upload_btn = $(this).data('next_uploadedbtn'); 21 23 22 //If the uploader object has already been created, reopen the dialog 24 23 if (miw_uploader) { … … 26 25 return; 27 26 } 27 28 28 //Extend the wp.media object 29 29 miw_uploader = wp.media.frames.file_frame = wp.media({ … … 42 42 */ 43 43 var imgurl = attachment.url; 44 var width = attachment.width;44 var width = attachment.width; 45 45 var height = attachment.height; 46 47 /* 48 *Getting the current and next value. 49 */ 50 51 var formfieldID_current =$(".miw_current_running_value").attr("data-current"); 52 var data_nextval =$(".miw_current_running_value").attr("data-next"); 53 54 //image attribute information. 55 jQuery("img." + formfieldID_current).attr("src", imgurl); 56 jQuery("img." + formfieldID_current).attr("width",width); 57 jQuery("img." + formfieldID_current).attr("height",height); 58 59 jQuery("input[type=hidden]." + formfieldID_current).val(imgurl); 60 //enable div also 61 $(".field-options-" +formfieldID_current).removeClass("mycustom_off"); 62 $(".field-options-" +formfieldID_current).addClass("mycustom_on"); 63 /* 64 *Update the nextval value to the :addmore: button 65 */ 66 $(".addmore").attr("data-val",data_nextval);//alert(data_nextval); 67 46 // alert(widgetid+""+widgetname+imgurl); 47 //************* Add values to the : widget : field :************** 48 $("img." + widgetid + "" + widgetname).attr('src', imgurl); 49 $("input." + widgetid + "" + widgetname).val(imgurl); 50 $("div." + widgetid + "" + widgetname).removeClass("miw_off"); 51 $("div." + widgetid + "" + widgetname).removeClass("miw_on"); 52 $(".miw_addmore").attr("data-nextbtn", next_upload_btn); 53 54 //************* Add values to the : widget : field :END ************** 68 55 }); 69 56 … … 73 60 }); 74 61 62 75 63 /* 76 *When click on the "addmore" then we will provide the newbutton.64 *When click on the Add More button. 77 65 */ 78 $(".addmore").live('click', function() { //alert("test"); 79 var click_btn = $(this).attr("data-val");//alert(click_btn); 80 $(".upload-button-" + click_btn).removeClass("mycustom_off"); 81 $(".upload-button-" + click_btn).addClass("mycustom_on"); 66 $('.miw_addmore').live("click", function(e) { 82 67 68 var widgetid = $(this).attr("data-widgetid"); 69 var widgetname = $(this).attr("data-nextbtn"); 70 71 $("div.upload_btn-" + widgetid + "" + widgetname).removeClass("miw_off"); 72 $("div.upload_btn-" + widgetid + "" + widgetname).addClass("miw_on"); 83 73 }); 84 85 74 /* 86 75 *When click on the "Delete" button :complete … … 90 79 91 80 $("img." + delete_field).attr("src", ""); //first blank this image 92 $("img." + delete_field).css("display", "none"); //hide this image93 81 $("input." + delete_field).val(""); //blank this value 94 $(".upload-link-"+delete_field).css("display", "none"); //hide this link and open new window link also. 95 $(".del-"+delete_field).css("display", "none"); //disable delete button :current 82 96 83 }); 97 84 -
multi-image-widget/trunk/assets/js/miw_frontend_custom.js
r1163052 r1167864 11 11 slideSpeed: 300, 12 12 paginationSpeed: 400, 13 singleItem: true 13 singleItem: true, 14 autoPlay: 3000 14 15 15 16 // "singleItem:true" is a shortcut for:
Note: See TracChangeset
for help on using the changeset viewer.