1(function($) { 2 3 $(document).ready(function(){ 4 if(!mtfcf7_settings.active_form) { 5 console.log('not set contact form 7 id'); 6 return; 7 } 8 9 // if($('.wpcf7').length >= 1) { 10 // if($('.wpcf7').attr('id').indexOf('wpcf7-f'+mtfcf7_settings.active_form)==-1){ 11 // console.log('this is not active contact form 7 form', mtfcf7_settings.active_form, $('.wpcf7').attr('id')); 12 // return; 13 // } 14 // } 15 16 $('.wpcf7 tip').each(function(index) { 17 $that = $(this); 18 19 $wpcf7 = $that.closest('.wpcf7'); 20 if($wpcf7.length === 0) return; 21 if($wpcf7.attr('id').indexOf('wpcf7-f'+mtfcf7_settings.active_form)==-1){ 22 console.log('this is not active contact form 7 form', mtfcf7_settings.active_form, $('.wpcf7').attr('id')); 23 return; 24 } 25 26 console.log('mtfcf7_settings', mtfcf7_settings); 27 $desc = $that.html(); 28 var extraHTML = ''; 29 if(mtfcf7_settings && mtfcf7_settings.add_icon) { 30 extraHTML = ' <i class="fa fa-question-circle"></i>'; 31 } 32 33 $parentHTML = $that.parent().html().replace('<tip>',extraHTML+'</label-magic>'+'<tip>'); 34 35 $parent = $that.parent(); 36 $parent.html('<label-magic>'+$parentHTML); 37 console.log('desc', $desc); 38 if($desc.length > 0){ 39 $that2 = $parent.find('label-magic'); 40 console.log('label-magic', $that2); 41 if(mtfcf7_settings && (mtfcf7_settings.mouse_over || mtfcf7_settings.hover_input || mtfcf7_settings.focus_input)) { 42 $that2.parent().addClass('mm-tooltip-cf7-li'); 43 } 44 45 46 if(mtfcf7_settings && mtfcf7_settings.mouse_over) { 47 $that2.addClass('mm-tooltip-cf7'); 48 } 49 if(mtfcf7_settings && mtfcf7_settings.add_underline) { 50 $that2.addClass('mm-tooltip-cf7-title-underline'); 51 } 52 } 53 }); 54 55 eval('var tooltip_code = ' + mtfcf7.js_code); 56 if(mtfcf7_settings && mtfcf7_settings.mouse_over) { 57 $('.mm-tooltip-cf7').each(function() { // Notice the .each() loop, discussed below 58 //console.log('.mm-tooltip-cf7', $(this)); 59 60 $(this).qtip($.extend(tooltip_code, { 61 content: { 62 text: $(this).parents('.mm-tooltip-cf7-li').find('tip').text() // Use the "div" element next to this for the content 63 }, 64 show: 'hover', 65 hide: { 66 fixed: true, 67 delay: 300 68 } 69 })); 70 }); 71 } 72 73 if(mtfcf7_settings && mtfcf7_settings.focus_input) { 74 $('.mm-tooltip-cf7-li input, .mm-tooltip-cf7-li textarea').each(function() { // Notice the .each() loop, discussed below 75 $(this).qtip($.extend(tooltip_code, { 76 content: { 77 text: $(this).parents('.mm-tooltip-cf7-li').find('tip').text() // Use the "div" element next to this for the content 78 }, 79 show: 'focus', 80 hide: 'unfocus' 81 })); 82 $(this).on('focus', function(){ 83 $(this).closest('.mm-tooltip-cf7-li').addClass('mm-tooltip-cf7-li-focus'); 84 }).on('blur', function(){ 85 $(this).closest('.mm-tooltip-cf7-li').removeClass('mm-tooltip-cf7-li-focus'); 86 }); 87 }); 88 } 89 90 var $container = $('<style id="mtfcf7-tooltip-css" type="text/css"></style>').appendTo("body"); 91 $container.text(mtfcf7.css_code+mtfcf7_settings.custom_css); 92 }); 93 94})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.