1jQuery(function ($) { 2 3 $('.wpdm_hide.wpdm_remove_empty').remove(); 4 5 $('.input-group input').on('focus', function () { 6 $(this).parent().find('.input-group-addon').addClass('input-group-addon-active'); 7 }); 8 $('.input-group input').on('blur', function () { 9 $(this).parent().find('.input-group-addon').removeClass('input-group-addon-active'); 10 }); 11 12 $('body').on('click', '.wpdm-download-link.wpdm-download-locked', function (e) { 13 e.preventDefault(); 14 hideLockFrame(); 15 $('body').append("<iframe id='wpdm-lock-frame' style='left:0;top:0;width: 100%;height: 100%;z-index: 99999;position: fixed;background: rgba(255,255,255,0.3) url("+wpdm_home_url+"wp-content/plugins/download-manager/assets/images/loader.svg) center center no-repeat;background-size: 100px 100px;border: 0;' src='"+wpdm_home_url+"?__wpdmlo="+$(this).data('package')+"'></iframe>"); 16 }); 17 18 $('body').on('click', '.inddl', function () { 19 var tis = this; 20 $.post( wpdm_site_url, { 21 wpdmfileid: $(this).data('pid'), 22 wpdmfile: $(this).data('file'), 23 actioninddlpvr: $($(this).data('pass')).val() 24 }, function (res) { 25 res = res.split('|'); 26 var ret = res[1]; 27 if (ret == 'error') $($(tis).data('pass')).addClass('input-error'); 28 if (ret == 'ok') location.href = $(tis).attr('rel') + '&_wpdmkey=' + res[2]; 29 }); 30 }); 31 32 $('body').on('click', '.wpdm-download-locked.pop-over', function () { 33 34 var $dc = $($(this).attr('href')); 35 if ($(this).attr('data-ready') == undefined) { 36 37 $(this).popover({ 38 placement: 'bottom', 39 html: true, 40 content: function () { 41 42 return $dc.html()+'<div style="padding-top: 10px;border-top: 1px solid #eeeeee;text-align: right"><button class="btn btn-danger btn-xs po-close" s><i class="fa fa-times-circle"></i> Close</button></div>'; 43 44 45 } 46 }); 47 $(this).attr('data-ready', 'hide'); 48 } 49 50 if ($(this).attr('data-ready') == 'hide') { 51 $(this).popover('show'); 52 $(this).attr('data-ready', 'show'); 53 } else if ($(this).attr('data-ready') == 'show') { 54 $(this).popover('hide'); 55 $(this).attr('data-ready', 'hide'); 56 } 57 58 59 return false; 60 }); 61 62 $('body').on('click', '.wpdm-indir', function (e) { 63 e.preventDefault(); 64 $('#xfilelist').load(location.href, { 65 action: 'wpdmfilelistcd', 66 pid: $(this).data('pid'), 67 cd: $(this).data('dir') 68 }); 69 }); 70 71 $('body').on('click', '.po-close', function () { 72 73 $('.wpdm-download-link').popover('hide'); 74 $('.wpdm-download-link').attr('data-ready', 'hide'); 75 76 }); 77 78 79 $('body').on('click', '.wpdm-btn-play', function (e) { 80 e.preventDefault(); 81 var player = $('#' + $(this).data('player')); 82 var btn = $('#' + this.id); 83 84 if (btn.data('state') == 'playing') { 85 $(this).data('state', 'paused'); 86 player.trigger('pause'); 87 $(this).html("<i class='fa fa-play'></i>"); 88 return false; 89 } 90 91 if (btn.data('state') == 'paused') { 92 $(this).data('state', 'playing'); 93 player.trigger('play'); 94 $('.wpdm-btn-play').html("<i class='fa fa-play'></i>"); 95 $(this).html("<i class='fa fa-pause'></i>"); 96 return false; 97 } 98 99 100 player.attr('src', $(this).data('song') + "&play=song.mp3"); 101 player.slideDown(); 102 $('.wpdm-btn-play').data("state", "stopped"); 103 $('.wpdm-btn-play').html("<i class='fa fa-play'></i>"); 104 btn.html("<i class='fa fa-spinner fa-spin'></i>"); 105 player.unbind('loadedmetadata'); 106 player.on('loadedmetadata', function () { 107 console.log("Playing " + this.src + ", for: " + this.duration + "seconds."); 108 btn.html("<i class='fa fa-pause'></i>"); 109 btn.data('state', 'playing'); 110 //audio.play(); 111 }); 112 }); 113 114 115 // Uploading files 116 var file_frame, dfield; 117 118 119 jQuery('body').on('click', '.wpdm-media-upload', function (event) { 120 event.preventDefault(); 121 dfield = jQuery(jQuery(this).attr('rel')); 122 123 // If the media frame already exists, reopen it. 124 if (file_frame) { 125 file_frame.open(); 126 return; 127 } 128 129 // Create the media frame. 130 file_frame = wp.media.frames.file_frame = wp.media({ 131 title: jQuery(this).data('uploader_title'), 132 button: { 133 text: jQuery(this).data('uploader_button_text') 134 }, 135 multiple: false // Set to true to allow multiple files to be selected 136 }); 137 138 // When an image is selected, run a callback. 139 file_frame.on('select', function () { 140 // We set multiple to false so only get one image from the uploader 141 attachment = file_frame.state().get('selection').first().toJSON(); 142 dfield.val(attachment.url); 143 144 }); 145 146 // Finally, open the modal 147 file_frame.open(); 148 }); 149 150 try { 151 /* 152 FB.login(function(response) { 153 if (response.session) { 154 155 var user_id = response.session.uid; 156 var page_id = "40796308305"; //coca cola 157 var fql_query = "SELECT uid FROM page_fan WHERE page_id = "+page_id+"and uid="+user_id;
158 var the_query = FB.Data.query(fql_query); 159 160 the_query.wait(function(rows) { 161 162 if (rows.length == 1 && rows[0].uid == user_id) { 163 $("#container_like").show(); 164 165 //here you could also do some ajax and get the content for a "liker" instead of simply showing a hidden div in the page. 166 167 } else { 168 $("#container_notlike").show(); 169 //and here you could get the content for a non liker in ajax... 170 } 171 }); 172 173 174 } else { 175 // user is not logged in 176 } 177 }); 178 */ 179 } catch (err) { 180 } 181 182}); 183 184function hideLockFrame() { 185 jQuery('#wpdm-lock-frame').remove(); 186}
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.