1$(function() { 2 var cc = $.cookie('list_grid'); 3 if (cc == 'g') { 4 $('#pm-grid').addClass('pm-ul-browse-videos-list'); 5 $('#show-list').addClass('active'); 6 } else { 7 $('#pm-grid').removeClass('pm-ul-browse-videos-list'); 8 $('#show-grid').addClass('active'); 9 } 10}); 11 12 13$(document).ready(function() { 14 $('#pm-addthis').scrollToFixed({ 15 preFixed: function() { 16 $('.addthis_floating_style').css({ 'opacity':'0.7', 'top' : '0px' }); 17 $(this).css({ 'opacity':'0.7', 'top' : '0px' }); 18 }, 19 postFixed: function() { 20 $('.addthis_floating_style').css({ 'opacity':'1.0', 'top' : '-140px' }); 21 $(this).css({ 'opacity':'1.0', 'top' : '-140px' }); 22 } 23 }); 24 25 $('.pm-ads-floating-left, .pm-ads-floating-right').scrollToFixed({ 26 bottom:0, 27 limit: $('.container-footer').offset().top, 28 }); 29 30 31 $('ul.nav li.dropdown').hover(function() { 32 $(this).find('ul.dropdown-menu:first').stop(true, true).delay(100).fadeIn(50); 33 }, function() { 34 $(this).find('ul.dropdown-menu').stop(true, true).delay(100).fadeOut(); 35 }); 36 37 /* iOS touch fix for BootStrap */ 38 $('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); }); 39 40 41 $('#show-list').click(function() { 42 $('#pm-grid').fadeOut(200, function() { 43 $(this).addClass('pm-ul-browse-videos-list').fadeIn(100); 44 $.cookie('list_grid', 'g'); 45 }); 46 $(this).addClass('active'); 47 $('#show-grid').removeClass('active'); 48 return false; 49 }); 50 51 $('#show-grid').click(function() { 52 $('#pm-grid').fadeOut(200, function() { 53 $(this).removeClass('pm-ul-browse-videos-list').fadeIn(100); 54 $.cookie('list_grid', null); 55 }); 56 $(this).addClass('active'); 57 $('#show-list').removeClass('active'); 58 return false; 59 }); 60 61 62 $("#to_modal").live('click', function() { 63 var url = $(this).attr('url'); 64 var modal_id = $(this).attr('data-controls-modal'); 65 $("#" + modal_id).load(url); 66 }); 67 68 $('.ajax-modal').click(function(e) { 69 e.preventDefault(); 70 var href = $(e.target).attr('href'); 71 if (href.indexOf('#') == 0) { 72 $(href).modal('open'); 73 } else { 74 $.get(href, function(data) { 75 $('<div class="modal" id="uploadForm">' + data + '</div>').modal({keyboard: true}); 76 }); 77 } 78 }); 79 80 81 /* 82 $('#tags_suggest, #tags_upload').tagsInput({ 83 'removeWithBackspace' : true, 84 'height':'auto', 85 'width':'auto', 86 'defaultText':'', 87 'minChars' : 3, 88 'maxChars' : 30 89 }); 90 */ 91 92 /*BootStrap Stuff*/ 93 $('[rel=tooltip]').tooltip({container: 'body'}); 94 95 $('#myModal').modal({ 96 keyboard: true, 97 show: false 98 }); 99 100 /*Suggest Video Page*/ 101 $("#pm_sources").change(function () { 102 var str = $("select option:selected").attr('value'); 103 $("#pm_sources_ex").text(str); 104 }).change(); 105 106 var input = document.createElement( 'input' ), 107 comment = $( '#comment' ); 108 109 if ( 'placeholder' in input ) { 110 comment.attr( 'placeholder', $( '.comment-textarea label' ).remove().text() ); 111 } 112 113 $('#c_comment_txt').click(function() { $('#pm-comment-form').slideDown(); }); 114 115 /* Expando Mode: start small, then auto-resize on first click + text length */ 116 $('#comment-form-identity').hide(); 117 $('#commentform .form-submit').hide(); 118 119 comment.css( {'height':'120px'} ).one( 'focus', function() { 120 $('#comment-form-identity').slideDown(); 121 $('#commentform .form-submit').slideDown(); 122 }); 123 124 125 /* language selector */ 126 $(".lang_selected").click(function() { 127 var submenu = $(".lang_submenu"); 128 if( submenu.css("display") == "block" ) 129 { 130 submenu.css( "display", "none" ); 131 $(this).removeClass(); 132 $(this).addClass("lang_selected"); 133 } 134 else 135 { 136 submenu.css( "display", "block" ); 137 $(this).removeClass(); 138 $(this).addClass("lang_selected_onclick"); 139 } 140 }); 141 142 $("a[id^='lang_select_']").each( 143 function() { 144 var id = parseInt( this.name ); 145 var lang = $('#lang_select_' + id); 146 lang.click( 147 function() 148 { 149 $.post( MELODYURL2+"/index.php", { select_language: 1, lang_id: id }, function() { window.location.reload(); }, ''); 150 }); 151 }); 152 153 $("#register-form").validate({ 154 rules: { 155 name: { 156 required: true, 157 minlength: 2 158 }, 159 username: { 160 required: true, 161 minlength: 2 162 }, 163 pass: { 164 required: true, 165 minlength: 5 166 }, 167 confirm_pass: { 168 required: true, 169 minlength: 5, 170 equalTo: "#register-form #pass" 171 }, 172 imagetext: { 173 required: true 174 }, 175 email: { 176 required: true, 177 email: true 178 }, 179 agree: "required" 180 }, 181 messages: { 182 name: { 183 required: pm_lang.validate_name, 184 minlength: pm_lang.validate_name_long 185 }, 186 username: { 187 required: pm_lang.validate_username, 188 minlength: pm_lang.validate_username_long 189 }, 190 pass: { 191 required: pm_lang.validate_pass, 192 minlength: pm_lang.validate_pass_long 193 }, 194 confirm_pass: { 195 required: pm_lang.validate_pass, 196 minlength: pm_lang.validate_pass_long, 197 equalTo: pm_lang.validate_confirm_pass_long 198 }, 199 imagetext: { 200 required: pm_lang.validate_captcha 201 }, 202 email: pm_lang.validate_email, 203 agree: pm_lang.validate_agree 204 }, 205 errorClass: "has-error", 206 }); 207}); 208 209$(function() { 210var input = document.createElement("input"); 211if(('placeholder' in input)==false) { 212 $('[placeholder]').focus(function() { 213 var i = $(this); 214 if(i.val() == i.attr('placeholder')) { 215 i.val('').removeClass('placeholder'); 216 if(i.hasClass('password')) { 217 i.removeClass('password'); 218 this.type='password'; 219 } 220 } 221 }).blur(function() { 222 var i = $(this); 223 if(i.val() == '' || i.val() == i.attr('placeholder')) {
224 if(this.type=='password') { 225 i.addClass('password'); 226 this.type='text'; 227 } 228 i.addClass('placeholder').val(i.attr('placeholder')); 229 } 230 }).blur().parents('form').submit(function() { 231 $(this).find('[placeholder]').each(function() { 232 var i = $(this); 233 if(i.val() == i.attr('placeholder')) 234 i.val(''); 235 }) 236 }); 237} 238}); 239 240function SelectAll(id) 241{ 242 document.getElementById(id).focus(); 243 document.getElementById(id).select(); 244} 245 246$(document).ready(function() { 247 // Scaled to fit thumbnails 248 $('.col-md-12 .pm-video-thumb img, .col-md-8 .pm-video-thumb img').each(function() { 249 var maxWidth = 240; // Max width for the image 250 var maxHeight = 136; // Max height for the image 251 var ratio = 0; // Used for aspect ratio 252 var width = $(this).width(); // Current image width 253 var height = $(this).height(); // Current image height 254 // Check if the current width is larger than the max 255 if(width > height){ 256 height = ( height / width ) * maxHeight; 257 258 } else if(height > width){ 259 maxWidth = (width/height)* maxWidth; 260 } 261 $(this).css("width", maxWidth); // Set new width 262 $(this).css("height", maxHeight); // Scale height based on ratio 263 $(this).css("object-fit", "cover"); 264 $(this).css("object-position", "25% 55%"); 265 }); 266 267 $('.pm-ul-browse-playlists .pm-video-thumb img').each(function() { 268 var maxWidth = 255; // Max width for the image 269 var maxHeight = 137; // Max height for the image 270 var ratio = 0; // Used for aspect ratio 271 var width = $(this).width(); // Current image width 272 var height = $(this).height(); // Current image height 273 // Check if the current width is larger than the max 274 if(width > height){ 275 height = ( height / width ) * maxHeight; 276 277 } else if(height > width){ 278 maxWidth = (width/height)* maxWidth; 279 } 280 $(this).css("width", maxWidth); // Set new width 281 $(this).css("height", maxHeight); // Scale height based on ratio 282 $(this).css("object-fit", "cover"); 283 $(this).css("object-position", "25% 55%"); 284 }); 285});
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.