1jQuery(function ($) { 2 rcl_do_action('rcl_init'); 3}); 4 5jQuery(window).on('load', function () { 6 jQuery('body').on('drop', function (e) { 7 return false; 8 }); 9 jQuery(document.body).on("drop", function (e) { 10 e.preventDefault(); 11 }); 12}); 13 14rcl_add_action('rcl_init', 'rcl_init_ajax_tab'); 15 16function rcl_init_ajax_tab() { 17 jQuery('body').on('click', '.rcl-ajax', function () { 18 19 var e = jQuery(this); 20 21 if (e.hasClass('tab-upload')) 22 return false; 23 24 rcl_do_action('rcl_before_upload_tab', e); 25 26 rcl_ajax({ 27 data: { 28 action: 'rcl_ajax_tab', 29 post: e.data('post'), 30 tab_url: e.attr('href') //encodeURIComponent(e.attr('href')) 31 }, 32 success: function (data) { 33 34 e.removeClass('tab-upload'); 35 36 data = rcl_apply_filters('rcl_upload_tab', data); 37 38 if (data.result.error) { 39 rcl_notice(data.result.error, 'error', 10000); 40 return false; 41 } 42 43 var url = data.post.tab_url; 44 var supports = data.post.supports; 45 var subtab_id = data.post.subtab_id; 46 47 if (supports && supports.indexOf('dialog') >= 0) { //еÑли вкладка поддеÑÐ¶Ð¸Ð²Ð°ÐµÑ Ð´Ð¸Ð°Ð»Ð¾Ð³ 48 49 if (!subtab_id) { //еÑли загÑÑжаеÑÑÑ Ð¾ÑÐ½Ð¾Ð²Ð½Ð°Ñ Ð²ÐºÐ»Ð°Ð´ÐºÐ° 50 51 ssi_modal.show({ 52 className: 'rcl-dialog-tab ' + data.post.tab_id, 53 sizeClass: 'small', 54 buttons: [{ 55 label: Rcl.local.close, 56 closeAfter: true 57 }], 58 content: data.result 59 }); 60 61 } else { 62 63 var box_id = '#ssi-modalContent'; 64 65 } 66 67 } else { 68 69 rcl_update_history_url(url); 70 71 if (!subtab_id) { 72 jQuery('.rcl-tab-button .recall-button').removeClass('active').removeClass('rcl-bttn__active'); 73 } 74 75 e.addClass('active').addClass('rcl-bttn__active'); 76 77 var box_id = '#lk-content'; 78 79 } 80 81 if (box_id) { 82 83 jQuery(box_id).html(data.result); 84 85 var options = rcl_get_options_url_params(); 86 87 if (options.scroll == 1) { 88 var offsetTop = jQuery(box_id).offset().top; 89 jQuery('body,html').animate({ 90 scrollTop: offsetTop - options.offset 91 }, 92 1000); 93 } 94 95 if (data.includes) { 96 97 var includes = data.includes; 98 99 includes.forEach(function (src, i, includes) { 100 101 jQuery.getScript(src); 102 103 }); 104 105 } 106 107 } 108 109 if (!data.post.subtab_id) { 110 if (typeof animateCss !== 'undefined') { 111 jQuery('#lk-content').animateCss('fadeIn'); 112 } 113 } else { 114 if (typeof animateCss !== 'undefined') { 115 jQuery('#lk-content .rcl-subtab-content').animateCss('fadeIn'); 116 } 117 } 118 119 rcl_do_action('rcl_upload_tab', { 120 element: e, 121 result: data 122 }); 123 124 } 125 }); 126 127 return false; 128 129 }); 130} 131 132function rcl_get_options_url_params() { 133 134 var options = { 135 scroll: 1, 136 offset: 100 137 }; 138 139 options = rcl_apply_filters('rcl_options_url_params', options); 140 141 return options; 142} 143 144function rcl_add_dropzone(idzone) { 145 146 jQuery(document.body).on("drop", function (e) { 147 var dropZone = jQuery(idzone), 148 node = e.target, 149 found = false; 150 151 if (dropZone[0]) { 152 dropZone.removeClass('in hover'); 153 do { 154 if (node === dropZone[0]) { 155 found = true; 156 break; 157 } 158 node = node.parentNode; 159 } while (node != null); 160 161 if (found) { 162 e.preventDefault(); 163 } else { 164 return false; 165 } 166 } 167 });
168 169 jQuery(idzone).on('dragover', function (e) { 170 var dropZone = jQuery(idzone), 171 timeout = window.dropZoneTimeout; 172 173 if (!timeout) { 174 dropZone.addClass('in'); 175 } else { 176 clearTimeout(timeout); 177 } 178 179 var found = false, 180 node = e.target; 181 182 do { 183 if (node === dropZone[0]) { 184 found = true; 185 break; 186 } 187 node = node.parentNode; 188 } while (node != null); 189 190 if (found) { 191 dropZone.addClass('hover'); 192 } else { 193 dropZone.removeClass('hover'); 194 } 195 196 window.dropZoneTimeout = setTimeout(function () { 197 window.dropZoneTimeout = null; 198 dropZone.removeClass('in hover'); 199 }, 100); 200 }); 201} 202 203function passwordStrength(password) { 204 var desc = []; 205 desc[0] = Rcl.local.pass0; 206 desc[1] = Rcl.local.pass1; 207 desc[2] = Rcl.local.pass2; 208 desc[3] = Rcl.local.pass3; 209 desc[4] = Rcl.local.pass4; 210 desc[5] = Rcl.local.pass5; 211 var score = 0; 212 if (password.length > 6) 213 score++; 214 if ((password.match(/[a-z]/)) && (password.match(/[A-Z]/))) 215 score++; 216 if (password.match(/\d+/)) 217 score++; 218 if (password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/)) 219 score++; 220 if (password.length > 12) 221 score++; 222 document.getElementById("passwordDescription").innerHTML = desc[score]; 223 document.getElementById("passwordStrength").className = "strength" + score; 224} 225 226function rcl_manage_user_black_list(e, user_id, confirmText) { 227 228 var class_i = jQuery(e).children('i').attr('class'); 229 230 if (class_i == 'rcli fa-refresh fa-spin') 231 return false; 232 233 if (!confirm(confirmText)) 234 return false; 235 236 jQuery(e).children('i').attr('class', 'rcli fa-refresh fa-spin'); 237 238 rcl_ajax({ 239 data: { 240 action: 'rcl_manage_user_black_list', 241 user_id: user_id 242 }, 243 success: function (data) { 244 245 jQuery(e).children('i').attr('class', class_i); 246 247 if (data['label']) { 248 jQuery(e).find('span').text(data['label']); 249 } 250 251 } 252 }); 253 254 return false; 255} 256 257function rcl_show_tab(id_block) { 258 jQuery(".rcl-tab-button .recall-button").removeClass("active"); 259 jQuery("#lk-content .recall_content_block").removeClass("active"); 260 jQuery('#tab-button-' + id_block).children('.recall-button').addClass("active"); 261 jQuery('#lk-content .' + id_block + '_block').addClass("active"); 262 return false; 263} 264 265rcl_add_action('rcl_init', 'rcl_init_recallbar_hover'); 266 267function rcl_init_recallbar_hover() { 268 jQuery("#recallbar .menu-item-has-children").on('hover', function () { 269 jQuery(this).children(".sub-menu").css({ 270 'visibility': 'visible' 271 }); 272 }, function () { 273 jQuery(this).children(".sub-menu").css({ 274 'visibility': '' 275 }); 276 }); 277} 278 279rcl_add_action('rcl_before_upload_tab', 'rcl_add_class_upload_tab'); 280 281function rcl_add_class_upload_tab(e) { 282 e.addClass('tab-upload'); 283} 284 285rcl_add_action('rcl_before_upload_tab', 'rcl_add_preloader_tab'); 286 287function rcl_add_preloader_tab(e) { 288 rcl_preloader_show('#lk-content > div'); 289 rcl_preloader_show('#ssi-modalContent > div'); 290} 291 292rcl_add_action('rcl_init', 'rcl_init_get_smilies'); 293 294function rcl_init_get_smilies() { 295 jQuery(document).on({ 296 mouseenter: function () { 297 var sm_box = jQuery(this).next(); 298 var block = sm_box.children(); 299 sm_box.show(); 300 if (block.html()) 301 return false; 302 block.html(Rcl.local.loading + '...'); 303 var dir = jQuery(this).data('dir'); 304 305 rcl_ajax({ 306 data: { 307 action: 'rcl_get_smiles_ajax', 308 area: jQuery(this).parent().data('area'), 309 dir: dir ? dir : 0 310 }, 311 success: function (data) { 312 if (data['content']) { 313 block.html(data['content']); 314 } 315 } 316 }); 317 318 }, 319 mouseleave: function () { 320 jQuery(this).next().hide(); 321 } 322 }, 323 "body .rcl-smiles .fa-smile-o"); 324} 325 326rcl_add_action('rcl_init', 'rcl_init_hover_smilies'); 327 328function rcl_init_hover_smilies() { 329 330 jQuery(document).on({ 331 mouseenter: function () { 332 jQuery(this).show(); 333 }, 334 mouseleave: function () { 335 jQuery(this).hide(); 336 } 337 }, 338 "body .rcl-smiles > .rcl-smiles-list"); 339 340 jQuery('body').on('hover click', '.rcl-smiles > img', function () { 341 var block = jQuery(this).next().children();
342 if (block.html()) 343 return false; 344 block.html(Rcl.local.loading + '...'); 345 var dir = jQuery(this).data('dir'); 346 347 rcl_ajax({ 348 data: { 349 action: 'rcl_get_smiles_ajax', 350 area: jQuery(this).parent().data('area'), 351 dir: dir ? dir : 0 352 }, 353 success: function (data) { 354 if (data['content']) { 355 block.html(data['content']); 356 } 357 } 358 }); 359 360 return false; 361 }); 362} 363 364rcl_add_action('rcl_init', 'rcl_init_click_smilies'); 365 366function rcl_init_click_smilies() { 367 jQuery("body").on("click", '.rcl-smiles-list img', function () { 368 var alt = jQuery(this).attr("alt"); 369 var area = jQuery(this).parents(".rcl-smiles").data("area"); 370 jQuery("#" + area).val(jQuery("#" + area).val() + " " + alt + " "); 371 }); 372} 373 374rcl_add_action('rcl_init', 'rcl_init_close_popup'); 375 376function rcl_init_close_popup() { 377 jQuery('#rcl-popup,.floatform').on('click', '.close-popup', function () { 378 rcl_hide_float_login_form(); 379 jQuery('#rcl-overlay').fadeOut(); 380 jQuery('#rcl-popup').empty(); 381 return false; 382 }); 383} 384 385rcl_add_action('rcl_init', 'rcl_init_click_overlay'); 386 387function rcl_init_click_overlay() { 388 jQuery('#rcl-overlay').on('click', function () { 389 rcl_hide_float_login_form(); 390 jQuery('#rcl-overlay').fadeOut(); 391 jQuery('#rcl-popup').empty(); 392 return false; 393 }); 394} 395 396rcl_add_action('rcl_init', 'rcl_init_click_float_window'); 397 398function rcl_init_click_float_window() { 399 jQuery(".float-window-recall").on('click', '.close', function () { 400 jQuery(".float-window-recall").remove(); 401 return false; 402 }); 403} 404 405rcl_add_action('rcl_init', 'rcl_init_loginform_shift_tabs'); 406 407function rcl_init_loginform_shift_tabs() { 408 jQuery('body').on('click', '.form-tab-rcl .link-tab-rcl', function () { 409 jQuery('.form-tab-rcl').hide(); 410 411 if (jQuery(this).hasClass('link-login-rcl')) 412 rcl_show_login_form_tab('login'); 413 414 if (jQuery(this).hasClass('link-register-rcl')) 415 rcl_show_login_form_tab('register'); 416 417 if (jQuery(this).hasClass('link-remember-rcl')) 418 rcl_show_login_form_tab('remember'); 419 420 return false; 421 }); 422} 423 424rcl_add_action('rcl_init', 'rcl_init_check_url_params'); 425 426function rcl_init_check_url_params() { 427 428 var options = rcl_get_options_url_params(); 429 430 if (rcl_url_params['tab']) { 431 432 if (!jQuery("#lk-content").length) 433 return false; 434 435 if (options.scroll == 1) { 436 var offsetTop = jQuery("#lk-content").offset().top; 437 jQuery('body,html').animate({ 438 scrollTop: offsetTop - options.offset 439 }, 440 1000); 441 } 442 443 var id_block = rcl_url_params['tab']; 444 rcl_show_tab(id_block); 445 } 446 447} 448 449rcl_add_action('rcl_init', 'rcl_init_close_notice'); 450 451function rcl_init_close_notice() { 452 jQuery('#rcl-notice,body').on('click', 'a.close-notice', function () { 453 rcl_close_notice(jQuery(this).parent()); 454 return false; 455 }); 456} 457 458rcl_add_action('rcl_init', 'rcl_init_cookie'); 459 460rcl_add_action('rcl_login_form', 'rcl_init_login_form'); 461 462function rcl_init_login_form(type_form) { 463 464 if (rcl_url_params['action-rcl']) { 465 jQuery('.panel_lk_recall.floatform > div').hide(); 466 } 467 468 if (type_form == 'floatform') { 469 470 jQuery("body").on('click', '.rcl-register', function () { 471 rcl_show_float_login_form(); 472 rcl_show_login_form_tab('register', type_form); 473 return false; 474 }); 475 476 jQuery("body").on('click', '.rcl-login', function () { 477 rcl_show_float_login_form(); 478 rcl_show_login_form_tab('login', type_form); 479 return false; 480 }); 481 482 if (rcl_url_params['action-rcl']) { 483 rcl_show_float_login_form(); 484 } 485 486 } else { 487 488 if (rcl_url_params['action-rcl'] === 'login') { 489 jQuery('.rcl-loginform-full.' + type_form + ' #register-form-rcl').hide(); 490 } 491 492 if (rcl_url_params['action-rcl'] === 'register') { 493 jQuery('.rcl-loginform-full.' + type_form + ' #login-form-rcl').hide(); 494 } 495 496 if (rcl_url_params['action-rcl'] === 'remember') { 497 jQuery('.rcl-loginform.' + type_form + ' #login-form-rcl').hide(); 498 } 499 500 } 501 502 if (rcl_url_params['action-rcl']) { 503 rcl_show_login_form_tab(rcl_url_params['action-rcl'], type_form); 504 } 505 506} 507 508function rcl_show_login_form_tab(tab, type_form) { 509 type_form = (!type_form) ? '' : '.' + type_form; 510 jQuery('.panel_lk_recall' + type_form + ' #' + tab + '-form-rcl').show(); 511} 512 513function rcl_show_float_login_form() { 514 jQuery('.panel_lk_recall.floatform > div').hide(); 515 rcl_setup_position_float_form(); 516 jQuery('.panel_lk_recall.floatform').show(); 517} 518 519function rcl_hide_float_login_form() { 520 jQuery('.panel_lk_recall.floatform').fadeOut().children('.form-tab-rcl').hide(); 521} 522 523function rcl_setup_position_float_form() { 524 jQuery("#rcl-overlay").fadeIn(); 525 var screen_top = jQuery(window).scrollTop(); 526 var popup_h = jQuery('.panel_lk_recall.floatform').height(); 527 var window_h = jQuery(window).height(); 528 screen_top = screen_top + 60; 529 jQuery('.panel_lk_recall.floatform').css('top', screen_top + 'px'); 530} 531 532rcl_add_action('rcl_footer', 'rcl_beat'); 533 534function rcl_beat() { 535 536 var beats = rcl_apply_filters('rcl_beats', rcl_beats); 537 538 var DataBeat = rcl_get_actual_beats_data(beats); 539 540 if (rcl_beats_delay && DataBeat.length) { 541 542 rcl_do_action('rcl_beat'); 543 544 rcl_ajax({ 545 data: { 546 action: 'rcl_beat', 547 databeat: JSON.stringify(DataBeat) 548 }, 549 success: function (data) { 550 551 data.forEach(function (result, i, data) { 552 553 rcl_do_action('rcl_beat_success_' + result['beat_name']); 554 555 new (window[result['success']])(result['result']); 556 557 }); 558 559 } 560 }); 561 562 } 563 564 rcl_beats_delay++; 565 566 setTimeout('rcl_beat()', 1000); 567} 568 569function rcl_get_actual_beats_data(beats) { 570 571 var beats_actual = new Array(); 572 573 if (beats) { 574
575 beats.forEach(function (beat, i, beats) { 576 var rest = rcl_beats_delay % beat.delay; 577 if (rest == 0) { 578 579 var object = new (window[beat.beat_name])(beat.data); 580 581 if (object.data) { 582 583 object = rcl_apply_filters('rcl_beat_' + beat.beat_name, object); 584 585 object.beat_name = beat.beat_name; 586 587 var k = beats_actual.length; 588 beats_actual[k] = object; 589 } 590 } 591 }); 592 593 } 594 595 return beats_actual; 596 597}
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.