gamebaidoithuonglifestyle (2024)

gamebaidoithuonglifestyleFree

Game bài đổi thưởng đang ngày càng thu hút người chơi với cơ hội giải trí hấp dẫn và cơ hội kiếm tiền thật sự. Người chơi có thể đổi điểm thưởng thành cào hoặc tiền mặt, tạo cơ hội thu nhập phụ hấp. Game bài đổi thưởng mang đến cho người chơi sân chơi uy tín với giấy phép hoạt động rõ ràng, đồ họa chuyên nghiệp, tốc độ giao dịch rút nhanh chóng....

Sân chơi uy tín cũng cung cấp đa dạng trò chơi và hỗ trợ nhiều phương thức thanh toán, mang đến trải nghiệm tốt nhất cho người chơi. Theo dõi gamebaidoithuong.lifestyle để tìm hiểu thêm về các tiêu chí lựa chọn và các sân chơi đáng tin cậy trong năm 2024.

Địa chỉ: T23 Đ. Lý Chiêu Hoàng, Phường 10, Quận 6, Hồ Chí Minh, Việt Nam.

Điện thoại: 0988008900.

Email: [emailprotected].

Trang web: https://gamebaidoithuong.lifestyle/

#gamebaidoithuong #nhacaigamebaidoithuong #trangchugamebaidoithuong #dangkygamebaidoithuong #linkgamebaidoithuong

Xã hội:

https://gamebaidoithuonglifestyle.readthedocs.io/en/latest/

https://www.zillow.com/profile/derekwyatt0893

https://derekwyatt0893.systeme.io/

https://www.facebook.com/gamebaidoithuonglifestyle/

https://x.com/Gamebaidoi37536

https://www.youtube.com/@gamebaidoithuonglifestyle

https://vimeo.com/gamebaidoithuonglifestyl

https://www.pinterest.com/gamebaidoithuonglifestyle/

https://gradatar.com/gamebaidoithuonglifestyle

https://talk.plesk.com/members/gamebaidoithuonglifes.355300/#about

https://www.tumblr.com/gamebaidoithuonglifestyle

https://500px.com/p/gamebaidoithuonglifestyle

https://issuu.com/gamebaidoithuonglifestyle

https://www.twitch.tv/gamebaidoithuonglifestyle/about

https://gamebaidoithuonglifestyle.bandcamp.com/album/gamebaidoithuonglifestyle

https://disqus.com/by/gamebaidoithuonglifestyle/about/

https://about.me/gamebaidoithuonglifestyle

https://www.mixcloud.com/gamebaidoithuonglifestyle/

https://vws.vektor-inc.co.jp/forums/users/gamebaidoithuonglifestyle

https://gamebaidoithuonglifestyle.gitbook.io/gamebaidoithuonglifestyle

https://www.notion.so/gamebaidoithuonglifestyle-2d4e001ab3174c8690179b28df1f9bd4

https://gitee.com/gamebaidoithuonglifestyle

https://www.reverbnation.com/gamebaidoithuonglifestyle

https://connect.garmin.com/modern/profile/8bef1be0-da1a-4f0b-ada0-c1b66af268e0

https://public.tableau.com/app/profile/gamebaidoithuong.lifestyle/vizzes

https://www.credly.com/users/gamebaidoithuonglifestyle/

https://heylink.me/gamebaidoithuonglifestyle/

https://www.walkscore.com/people/268975369661/gamebaidoithuong-lifestyle

https://community.articulate.com/users/GamebaidoithuongLối sống

https://hackerone.com/gamebaidoithuonglifestyle?type=user

https://www.diigo.com/profile/gamebaidoi37536

https://telegra.ph/gamebaidoithuonglifestyle-08-06

Share

Info

Galleries

Latest

Sort

Layout

Sort by

Date created Date modified Name Views Type Size Likes

Game bài đổi thưởng đang ngày càng thu hút người chơi với cơ hội giải trí hấp dẫn và cơ hội kiếm tiền thật sự. Người chơi có thể đổi điểm thưởng thành cào hoặc tiền mặt, tạo cơ hội thu nhập phụ hấp. Game bài đổi thưởng mang đến cho người chơi sân chơi uy tín với giấy phép hoạt động rõ ràng, đồ họa chuyên nghiệp, tốc độ giao dịch rút nhanh chóng....

Sân chơi uy tín cũng cung cấp đa dạng trò chơi và hỗ trợ nhiều phương thức thanh toán, mang đến trải nghiệm tốt nhất cho người chơi. Theo dõi gamebaidoithuong.lifestyle để tìm hiểu thêm về các tiêu chí lựa chọn và các sân chơi đáng tin cậy trong năm 2024.

Địa chỉ: T23 Đ. Lý Chiêu Hoàng, Phường 10, Quận 6, Hồ Chí Minh, Việt Nam.

Điện thoại: 0988008900.

Email: [emailprotected].

Trang web: https://gamebaidoithuong.lifestyle/

#gamebaidoithuong #nhacaigamebaidoithuong #trangchugamebaidoithuong #dangkygamebaidoithuong #linkgamebaidoithuong

Xã hội:

https://gamebaidoithuonglifestyle.readthedocs.io/en/latest/

https://www.zillow.com/profile/derekwyatt0893

https://derekwyatt0893.systeme.io/

https://www.facebook.com/gamebaidoithuonglifestyle/

https://x.com/Gamebaidoi37536

https://www.youtube.com/@gamebaidoithuonglifestyle

https://vimeo.com/gamebaidoithuonglifestyl

https://www.pinterest.com/gamebaidoithuonglifestyle/

https://gradatar.com/gamebaidoithuonglifestyle

https://talk.plesk.com/members/gamebaidoithuonglifes.355300/#about

https://www.tumblr.com/gamebaidoithuonglifestyle

https://500px.com/p/gamebaidoithuonglifestyle

https://issuu.com/gamebaidoithuonglifestyle

https://www.twitch.tv/gamebaidoithuonglifestyle/about

https://gamebaidoithuonglifestyle.bandcamp.com/album/gamebaidoithuonglifestyle

https://disqus.com/by/gamebaidoithuonglifestyle/about/

https://about.me/gamebaidoithuonglifestyle

https://www.mixcloud.com/gamebaidoithuonglifestyle/

https://vws.vektor-inc.co.jp/forums/users/gamebaidoithuonglifestyle

https://gamebaidoithuonglifestyle.gitbook.io/gamebaidoithuonglifestyle

https://www.notion.so/gamebaidoithuonglifestyle-2d4e001ab3174c8690179b28df1f9bd4

https://gitee.com/gamebaidoithuonglifestyle

https://www.reverbnation.com/gamebaidoithuonglifestyle

https://connect.garmin.com/modern/profile/8bef1be0-da1a-4f0b-ada0-c1b66af268e0

https://public.tableau.com/app/profile/gamebaidoithuong.lifestyle/vizzes

https://www.credly.com/users/gamebaidoithuonglifestyle/

https://heylink.me/gamebaidoithuonglifestyle/

https://www.walkscore.com/people/268975369661/gamebaidoithuong-lifestyle

https://community.articulate.com/users/GamebaidoithuongLối sống

https://hackerone.com/gamebaidoithuonglifestyle?type=user

https://www.diigo.com/profile/gamebaidoi37536

https://telegra.ph/gamebaidoithuonglifestyle-08-06

Name Likes Downloads Views Size Modified Created

© trang nội dung công khai gamebaidoithuonglifestyle

') window.oncontextmenu = function( event ) { if ( $( event.target ).parents( '.gallery2__item' ).length || $( event.target ).parents( '#gallery2__thumb-strip' ).length ) { // Disabling the context menu for thumbnails event.preventDefault(); event.stopPropagation(); return false; } } $('.edit_wrapper_edit_button').click(function() { $(this).parent().find("textarea").focus(); }); $('#file_description_edit_wrapper textarea').on("keyup change", function(e) { autoGrow( this, '32px' ); if ( bolIsOwner ) { updateFileDescription(); } }); $('#file_name_edit_wrapper textarea').on("keyup change", function(e) { $('#file_name_edit_wrapper textarea').removeClass('pulse'); autoGrow( this, '32px' ); if ( bolIsOwner ) { updateFileName(); } }); $('#file_name_edit_wrapper textarea').on("focus", function(e) { $('#file_name_edit_wrapper textarea').val( $('#file_name_edit_wrapper textarea').val().replace( '.' + arrExtensions[ intCurrentFileIndex ], '' ) ); } ) $('#file_name_edit_wrapper textarea').on("focusout", function(e) { $('#file_name_edit_wrapper textarea').removeClass('pulse'); $('#file_name_edit_wrapper textarea').val( $('#file_name_edit_wrapper textarea').val() + '.' + arrExtensions[ intCurrentFileIndex ] ); } ) $('#file_description_edit_wrapper textarea').on("focus", function(e) { $( "#file_description_edit_wrapper" ).removeClass("no-description"); } ) $('#file_description_edit_wrapper textarea').on("focusout", function(e) { if ( $('#file_description_edit_wrapper textarea').val() == '' ) { $( "#file_description_edit_wrapper" ).addClass("no-description"); } else { $( "#file_description_edit_wrapper" ).removeClass("no-description"); } } ) if ( bolIsOwner ) { $('#gallery2__header__setprice').show(); }if ( ! bolHideShareButtons ){ $('#gallery2__share').show();} if (arrHashes.length == 1){hideThumbs(); $('#gallery2__slideshow_middle, #gallery2__slideshow, #gallery2__header__slideshow').hide();}$('#gallery_file_tags_container .file_tags_input').tagsInput({'autocomplete_url': './ajax/file_tag.php?autocomplete&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925' ,'autocomplete': { selectFirst:false, autoFill:false},'height' : 'auto','width' : '100%', 'interactive' : bolIsOwner || ( window.location.href.indexOf( "filebrowser" ) !== -1 && 0 ),'defaultText' : 'Add tags','onAddTag' : function(strTagName) {$('#gallery_file_tags_container .file_tags_error').hide();$.ajax({type: "POST",dataType: "json",url: "./ajax/file_tag.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925",data: {'add_file_tag': true ,'file_hash' : strCurrentFileHash ,'tag_name': strTagName} ,success: function(data){if (data['status'] == 'ok'){var intItemIndex = getItemIndex(strCurrentFileHash);arrTags[intItemIndex] += ';' + strTagName;// update tags in filebrowser $('#sidebar_file_tags_container .file_tags_input').importTags(typeof arrTags[intItemIndex] === "undefined" ? "" : arrTags[intItemIndex]);}else{$('#gallery_file_tags_container .file_tags_error').show();}} ,error: function(){$('#gallery_file_tags_container .file_tags_error').show();}});} ,'onRemoveTag' : function(strTagName){$('#gallery_file_tags_container .file_tags_error').hide();$.ajax({type: "POST",dataType: "json",url: "./ajax/file_tag.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925",data: {'delete_file_tag': true ,'file_hash' : strCurrentFileHash ,'tag_name': strTagName} ,success: function(data){if (data['status'] == 'ok'){var intItemIndex = getItemIndex(strCurrentFileHash);arrTags[intItemIndex] = arrTags[intItemIndex].replace(strTagName, '');// update tags in filebrowser $('#sidebar_file_tags_container .file_tags_input').importTags(typeof arrTags[intItemIndex] === "undefined" ? "" : arrTags[intItemIndex]);}else{$('#gallery_file_tags_container .file_tags_error').show();}} ,error: function(){$('#gallery_file_tags_container .file_tags_error').show();}});} , 'onSearchTag' : function(strTagName) { if ( typeof strUploadUserNameHref != 'undefined' && strUploadUserNameHref != '' ) { window.open('/' + strUploadUserNameHref + '#search='+ strTagName, '_self'); } else if ( typeof PublicProfile != 'undefined' && typeof PublicProfile.strProfileName != 'undefined' ) { window.open('/' + PublicProfile.strProfileName + '#search='+ strTagName, '_self'); } } ,'delimiter' : [';'] ,'removeWithBackspace' : false ,'minChars' : 1 ,'maxChars' : 245 ,'placeholderColor' : '#666666'}); $('#gallery_file_tags_container .file_tags_input') if (( typeof strUploadUserNameHref != 'undefined' && strUploadUserNameHref != '' ) || ( typeof PublicProfile != 'undefined' && typeof PublicProfile.strProfileName != 'undefined' )) { $('#gallery_file_tags_container .tagsinput').addClass('searchable'); } else { $('#gallery_file_tags_container .tagsinput').removeClass('searchable'); }function getFileShareParams() { if ( objMainShareParams ) { var intItemIndex = getItemIndex( strCurrentFileHash ); var objFileShareParams = {}; for ( idx in objMainShareParams ) { objFileShareParams[ idx ] = objMainShareParams[ idx ]; } if ( typeof( arrFileShareLinks ) != 'undefined' && typeof( arrFileShareLinks[ intItemIndex ] ) != 'undefined' ) { objFileShareParams[ 'view_url' ] = 'https://files.fm' + arrFileShareLinks[ intItemIndex ]; } else { objFileShareParams[ 'view_url' ] += '#/view/' + arrHashes[ intItemIndex ]; } objFileShareParams[ 'can_share' ] = bolIsOwner; objFileShareParams[ 'show_type_select' ] = false; objFileShareParams[ 'type' ] = 'one_file'; var strFileShareParams_PictureUrl = ''; if ( arrFileTypes[ intItemIndex ] == 'image' ) { strFileShareParams_PictureUrl = 'https://files.fm/thumb_show.php?i=' + arrHashes[ intItemIndex ] + '&view&v=1&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925'; } var strFileViewLink = 'https://files.fm/f/' + strCurrentFileHash; var strFileEditLink = ''; if ( bolCanDelete && typeof arrFileDeleteKeys != 'undefined' && arrFileDeleteKeys[ intItemIndex ] != '' ) { strFileEditLink = strFileViewLink + '?fk=' + arrFileDeleteKeys[ intItemIndex ]; } objFileShareParams[ 'one_file' ] = { 'view_url': strFileViewLink, 'edit_url': strFileEditLink, 'facebook': { 'name': strFileViewLink, 'picture_url': strFileShareParams_PictureUrl, 'description': strFileViewLink, 'link': strFileViewLink, 'return_link': objFileShareParams[ 'all_files' ][ 'facebook' ][ 'return_link' ] }, 'twitter': { 'text': DOMAIN_NAME + ': ', 'link': strFileViewLink }, 'share_email': { 'upload_hash': '', 'file_view_hash': strCurrentFileHash }, 'embed_player': { 'file_view_hash': null }, 'item_info': { 'file_view_hash': strCurrentFileHash, 'upload_hash': objFileShareParams[ 'all_files' ][ 'share_email' ][ 'upload_hash' ], 'file_name': arrDisplayNames[ intItemIndex ], 'item_name': arrDisplayNames[ intItemIndex ], 'extension': arrExtensions[ intItemIndex ], 'owner_logged_in': bolIsOwner, 'access_type': ( typeof arrFileAccessTypes != 'undefined' ? arrFileAccessTypes[ intItemIndex ] : '' ), 'parent_access_type': arrAccessType[ intItemIndex ] } }; if ( arrFeeDownloadPrice[ intItemIndex ] == null && ! currentFolderHasFeeDownload( intItemIndex ) && arrAllowDownload[ intItemIndex ] && ( arrAccessType[ intItemIndex ] == 'LINK' || arrAccessType[ intItemIndex ] == 'PUBLIC' ) && arrUploadPassword[ intItemIndex ] == '' && arrAllowPublicDownload[ intItemIndex ] ) { objFileShareParams[ 'one_file' ][ 'embed_player' ] = { 'file_view_hash': strCurrentFileHash, 'file_extension': arrExtensions[ intItemIndex ], 'is_video': arrIsVideo[ intItemIndex ] } } return objFileShareParams; } return null; } window.galleryGetFileShareParams = getFileShareParams; $( document ).on( 'click', '#gallery2__share', function ( e ) { var objFileShareParams = getFileShareParams(); if ( objFileShareParams !== null ) { showSharePopup( e, objFileShareParams ); } } ); $( document ).on( 'click', '#gallery2__sign, #gallery2__sign_main, #gallery2__controls_doc_sign_button, #gallery2__left_info-button_sign', function ( e ) { if ( bolCanEdit ) { objEparakstsFileSigningForm.showForm( [ strCurrentFileHash ] ); } else { fError( 'This link is for viewing the document only. To sign, please ask the file owner to send a link to edit the file - from the e-signature form.', 'Warning!' ); } } ); $( document ).on( 'click', '.gallery2__edit', function ( e ) { if ( canOpenFileInEditor( 'edit', arrExtensions[ intCurrentFileIndex ] ) ) { showCreateAccount(); } else { showImageEditorIframe( strCurrentFileHash, true, ); } } ); $( document ).on( 'click', '.gallery2__button__buy-products', function ( e ) { window.open( '/c/' + arrParentHashes[ getItemIndex ( strCurrentFileHash ) ] + '?h=' + strCurrentFileHash, '_blank' ); } ); $( document ).on( 'click', '.print_or_buy_popup__products', function ( e ) { window.open( '/c/' + arrParentHashes[ getItemIndex ( strCurrentFileHash ) ] + '?h=' + strCurrentFileHash, '_blank' ); } ); $( document ).on( 'contextmenu', 'video', function ( e ) { e.preventDefault(); } ); $( document ).on( 'click', '#gallery2__sidebar__info_embed_button, #gallery2__sidebar__info_embed_button_middle', function ( e ) { var objFileShareParams = getFileShareParams(); if ( objFileShareParams !== null ) { window.FileEmbedPopup.showPopup( e, objFileShareParams ); if ($(window).width() <= 500) { $( '#file_embed_popup' ).css({ 'top': 'unset', 'bottom': '80px', 'left': '0', 'maxHeight': 'calc(100vh - 80px - 36px - 50px)', 'overflow': 'auto' }) } else { $( '#file_embed_popup' ).css( { position: 'fixed', top: -500 + 'px', left: -500 + 'px' } ); var rect = document.getElementById( "file_embed_popup" ).getBoundingClientRect(); var docRect = { width: $( window ).width(), height: $( window ).height() }; var ctxMenuPos = { x: 0, y: 0 }; var intClickYLocation = event.pageY var intClickXLocation = event.pageX; if ( intClickYLocation + 30 + rect.height > docRect.height ) { ctxMenuPos.y = docRect.height >= rect.height ? docRect.height - rect.height : 0; } else { ctxMenuPos.y = intClickYLocation + 30; } if ( intClickXLocation + rect.width - 50 > docRect.width ) { ctxMenuPos.x = docRect.width >= rect.width - 50 ? docRect.width - rect.width - 50 : 0; } else { if(intClickXLocation < 0) { ctxMenuPos.x = 0; } else { ctxMenuPos.x = intClickXLocation; } } $( '#file_embed_popup' ).css( { top: ctxMenuPos.y + 'px', left: ctxMenuPos.x + 'px' } ); } } } ); $( document ).on( 'click', '#copy_button_middle, #copy_button_left', function ( e ) { var el = document.createElement( 'textarea' ); el.value = $(this).prev().find( 'input' ).val(); document.body.appendChild( el ); el.select(); document.execCommand( 'copy' ); document.body.removeChild( el ); $(this).addClass( 'copied' ).delay( 4000 ).queue( function( next ) { $( this ).removeClass( 'copied' ); next(); } ); } ); $(window).resize(function() {if (!bolGalleryIsVisible){bolHaveToRedrawGallery = true;}else{ recalculateGalleryForBanner(true);}}); $(window).mousemove(function() { if($('#gallery2__content-wrapper').hasClass( 'gallery__slideshow' )){ $('#gallery2__content-wrapper').addClass( 'gallery__slideshow_user_active' ); clearTimeout(strSlideshowUserActive); strSlideshowUserActive = setTimeout(removeActiveClass, 1000); } }); // Check video network state, if loading longer than 1+1 intervals, show thumbnail generation messagevar bolHasVideo = false;for ( idx in arrFileTypes){if ( arrFileTypes[idx] == 'video' ){bolHasVideo = true;}}if (bolHasVideo){if ( resVideoCheckInterval != null){clearInterval(resVideoCheckInterval);resVideoCheckInterval = null;}resVideoCheckInterval = setInterval(function () {for ( idx in arrFileTypes){if ( arrFileTypes[idx] == 'video' ){var domVideo = document.getElementById('video_' + arrHashes[idx]); if ( domVideo ){ // iOS safari workaround - "play" gets fired when the play button is clicked => set video as loading if(bolIsiOSDevice) { domVideo.addEventListener('play', function () { objVideoIsLoading[idx] = true; }); } var bolIsLoading = bolIsiOSDevice ? objVideoIsLoading[idx] : false; // iOS safari workaround: video has stopped loading when its duration attribute is > 0 if (domVideo.duration > 0 && bolIsiOSDevice) { bolIsLoading = false; } // If network connection active (2=NETWORK_LOADING) - this is broken in iOS safari else if (domVideo.networkState == 2){bolIsLoading = true;}if ( bolIsLoading ){if (objVideoIsLoading[idx] == true){$('#video_thumb_gen_'+ arrHashes[idx]).css({'visibility':'visible'});}objVideoIsLoading[idx] = true;}else if ( objVideoIsLoading[idx] ){objVideoIsLoading[idx] = false;$('.video_thumb_gen').css({'visibility':'hidden'});}}}}}, 3000);} // Close in item main element click $( '#gallery2' ).on( 'bx_slider_click', '.bx-viewport', function( e, domElement ){ if ( $(domElement).hasClass('gallery2__item') ) { closeGallery(strCurrentFileHash); } });bolGalleryInitalizedState = 1; } $(function (){ if ( bolGalleryInitalizedState === null ) { galleryInitalize();}}); $(document).on( "fullscreenchange", function () { adjustContentWidth( true ); } ); $(document).on("keydown", function(evt) { if (evt.altKey || evt.ctrlKey || evt.metaKey || $(evt.target).is(":input")) { return; } if ( ! bolGalleryIsVisible ) { return;}if( 0) { return; } var key = evt.keyCode; if (key == 37 ) { galleryOpenPrevItem(); } else if (key == 39) { galleryOpenNextItem();} else if (key == 27) { closeGallery(strCurrentFileHash); } }); function autoGrow( element, strMinHeight ) { if( typeof strMinHeight === "undefined" ) { strMinHeight = '32px'; } element.style.height = strMinHeight; element.style.height = element.scrollHeight + "px"; element.style.height = element.scrollHeight + 5 + "px"; } function galleryCalculateOffset(el) { var rect = el.getBoundingClientRect(), scrollLeft = window.pageXOffset || document.documentElement.scrollLeft, scrollTop = window.pageYOffset || document.documentElement.scrollTop; return { top: rect.top + scrollTop, left: rect.left + scrollLeft }} window.getImageCountText = function() { return ( parseInt( intCurrentFileIndex ) + 1 ) + '/' + arrIDs.length; }; function checkThumbStripArrows() { if ( parseInt( $('#gallery2__thumb-strip__inner').width() ) > parseInt( $('#gallery2__thumb-strip').width() ) ) { $('#gallery2__thumb-strip__buttons').show(); } else { $('#gallery2__thumb-strip__buttons').hide(); } } var bolHideShareButtons = false;var bolGalleryIsShowingItem = false; var clickedItemHash = null; function showGalleryItem( strHash ) { if (arrHashes.length == 1){ hideThumbs();} clickedItemHash = strHash;if ( bolGalleryIsShowingItem ){return;}bolGalleryIsShowingItem = true; var bolSimpleDownloadAllowed = false; strCurrentFileHash = strHash; intCurrentFileIndex = getItemIndex ( strHash ); strCurrentFileName = arrDisplayNames[intCurrentFileIndex]; preloadImage( intCurrentFileIndex ); preloadFileInfoData( intCurrentFileIndex );if ( ! bolGalleryIsVisible ){showGallery();}stopActiveContent();checkBeforeContentChange (); jqMainSlider.goToSlide( intCurrentFileIndex ); checkAfterContentChange(); if ($('#share_popup').is(":visible")) { hideSharePopup(); } if ( typeof window.FileEmbedPopup !== 'undefined' ) { window.FileEmbedPopup.hidePopup(); } if ( arrFileTypes[intCurrentFileIndex] == 'image' && arrFeeDownloadPrice[intCurrentFileIndex] == null && ! currentFolderHasFeeDownload( intCurrentFileIndex ) ) { $('#gallery2__header__view-original').show(); } else { $('#gallery2__header__view-original').hide(); } $('.gallery2__header__img-count').text( window.getImageCountText() );if (arrAllowDownload[intCurrentFileIndex] && ( typeof(bolHideDownloadButtons) === 'undefined' || ! bolHideDownloadButtons ) && ( typeof(arrHideDownloadButtons) === 'undefined' || ! arrHideDownloadButtons[intCurrentFileIndex] )){ bolSimpleDownloadAllowed = true;$('.gallery2__save_button').show();$('#gallery2__sidebar__info_embed_button, #gallery2__sidebar__info_embed_button_middle').show();$('#gallery2__share').show();}else{ bolSimpleDownloadAllowed = false;$('.gallery2__save_button').hide();$('#gallery2__sidebar__info_embed_button, #gallery2__sidebar__info_embed_button_middle').hide();$('#gallery2__share').hide();} if ( !arrFileAttributes[ intCurrentFileIndex ][ 'readOnly' ] && bolCanDelete ) { $('#gallery2__item_info_delete, #gallery2__item_info_delete_middle').css('display', 'flex'); } else { $('#gallery2__item_info_delete, #gallery2__item_info_delete_middle').hide(); } if( canSetAsThumb( strHash ) ) { $('#gallery2__item_info_cover, #gallery2__item_info_cover_middle').show(); } else { $('#gallery2__item_info_cover, #gallery2__item_info_cover_middle').hide(); } $( '#gallery2__left_info__signers-list-container' ).hide(); $( '#gallery2__left_info-button_sign' ).hide(); $( '#gallery2__sign' ).hide(); $('#gallery2__sign_main').hide(); $('#gallery2__controls_doc_sign').removeClass('document'); $( '#gallery_edit_image_middle' ).hide(); if ( bolCanEdit ) { if ( canOpenFileInEditor( 'edit', arrExtensions[ intCurrentFileIndex ] ) ) { $( '#gallery2__item_info_edit' ) .removeClass( 'edit_image' ) .text( 'Edit file' );$( '#gallery2__header__mid #gallery2__edit' ) .removeClass( 'edit_image' ) .find( '#gallery2__edit_button span' ) .text( 'Edit' ); $( '.gallery2__edit' ).show(); } else if ( canOpenImageInEditor( arrExtensions[ intCurrentFileIndex ] ) ) { $( '#gallery2__item_info_edit' ) .addClass( 'edit_image' ) .text( 'Edit image' ); $( '#gallery2__header__mid #gallery2__edit' ) .addClass( 'edit_image' ) .find( '#gallery2__edit_button span' ) .text( 'Edit image' ); $( '.gallery2__edit' ).show(); $( '#gallery_edit_image_middle' ).show(); } else { $( '.gallery2__edit' ).hide(); } } else { $( '.gallery2__edit' ).hide(); $( '.gallery2__edit_in_google' ).hide(); } $( '#gallery2__item_info_replace_middle' ).hide(); $( '.gallery2__button__buy-products' ).hide();if ( canOrderProductGeneral( strCurrentFileHash ) || arrFileAttributes[ getItemIndex ( strCurrentFileHash ) ].hasProductSelling ){$( '.gallery2__button__buy-products' ).show(); if(! arrFileAttributes[ getItemIndex ( strCurrentFileHash ) ].hasProductSelling) { $( '#gallery2__buyproducts' ).hide(); }} if( window.location.href.indexOf("filebrowser") === -1 && typeof arrReports != 'undefined' && typeof arrStatuses != 'undefined' && ! [3, 4].includes(arrStatuses[ intCurrentFileIndex ]) && ( typeof arrFileIsLockedByOtherUser == 'undefined' || ! arrFileIsLockedByOtherUser[ intCurrentFileIndex ] ) ) { $( '.gallery2__report_button' ).show(); if (arrReports[ intCurrentFileIndex ] == 0) { $( '.gallery2__report_button' ).click(function() { showFileReportModal(this, strCurrentFileHash); }); } else { $( '.gallery2__report_button' ).click(function() { showCancelFileReportModal(this, strCurrentFileHash); }); } } else { $( '.gallery2__report_button' ).hide(); } if ( arrFileTypes[ intCurrentFileIndex ] === 'document' && ( arrExtensions[ intCurrentFileIndex ] === 'pdf' || arrExtensions[ intCurrentFileIndex ] === 'odt' || arrExtensions[ intCurrentFileIndex ] === 'ods' || arrExtensions[ intCurrentFileIndex ] === 'odp' || isFileConvertable( 'pdf', intCurrentFileIndex ) ) && arrFeeDownloadPrice[ intCurrentFileIndex ] == null && ! currentFolderHasFeeDownload( intCurrentFileIndex ) && arrAllowDownload[ intCurrentFileIndex ] ) { $( "#gallery2__controls_left" ).css( { 'margin-top': '32px', 'height': 'calc(100% - 50px)' } ); $( "#gallery2__controls_right" ).css( { 'right': '15px', 'margin-top': '32px', 'height': 'calc(100% - 50px)' } ); } else { $( "#gallery2__controls_right" ).css( { 'right': '0', 'margin-top': '32px', 'height': 'calc(100% - 50px)' } ); $( "#gallery2__controls_left" ).css( { 'margin-top': '32px', 'height': 'calc(100% - 50px)' } ); } if ( arrFileTypes[ intCurrentFileIndex ] !== 'image' ) { $('#gallery2__controls_middle').removeClass('image'); $('#gallery2__controls_zoom').css('display', 'none'); $('#gallery2__content-wrapper').removeClass( 'gallery__only_image' ); $('#gallery2__content-wrapper').removeClass( 'gallery__is_image' ); } else { $('#gallery2__controls_middle').addClass('image'); $('#gallery2__controls_zoom').css('display', 'block'); $('#gallery2__content-wrapper').addClass( 'gallery__is_image' ); } if ( arrFileTypes[ intCurrentFileIndex ] !== 'audio' ) { $('#gallery2__header__fullscreen').show(); } else { $('#gallery2__header__fullscreen').hide(); } $('.gallery2__video_filename-download .gallery2__save_button').show(); if (bolIsOwner) { $("#gallery2__buyfile").attr("onclick", "showSetPriceFormModal(strCurrentFileHash)"); $("#gallery2__buyall").attr("onclick", "showSetPriceFormModal(arrParentHashes[ getItemIndex ( strCurrentFileHash ) ], 'folder')"); $(".print_or_buy_popup__buyfile").attr("onclick", "showSetPriceFormModal(strCurrentFileHash)"); } else { $("#gallery2__buyfile").attr("onclick", "showBuyFileFormModal(strCurrentFileHash)"); $("#gallery2__buyall").attr("onclick", "showBuyFileFormModal(arrParentHashes[ getItemIndex ( strCurrentFileHash ) ], 'folder')"); $(".print_or_buy_popup__buyfile").attr("onclick", "showBuyFileFormModal(strCurrentFileHash)"); }// spec for public profile -> fee file count can be dynamic, assume it is > 0 if ( arrFeeDownloadPrice[ intCurrentFileIndex ] != null ) { $( '#gallery2__buyfile' ).show(); $( '#gallery2__buyall' ).hide(); $( '.print_or_buy_popup__buyfile' ).show(); $( '.gallery2__save_button' ).hide(); $( '#gallery2__item_info_save' ).hide(); $( '.gallery2__buy_button' ).css( 'display', 'flex' ); $( '#gallery2__header__view-original' ).addClass( 'hidden' ); $( '.gallery2__video_filename' ).css( 'visibility', 'hidden' ); $( '#gallery2__sidebar__info_embed_button, #gallery2__sidebar__info_embed_button_middle' ).addClass( 'hidden' ); $( '#gallery2__buyall span.price' ).html(''); var strName = arrDisplayNames[ intCurrentFileIndex ]; if ( strName == '' ) { strName = arrNames[ intCurrentFileIndex ]; } var intFileLengthLimit = 30; if ( strName.length > intFileLengthLimit ) { strName = strName.substring( 0, intFileLengthLimit ) + '...'; } $( '.gallery2__buy_button' ).html( arrFeeDownloadPrice[ intCurrentFileIndex ] + ' $' ); $( '#gallery2__buyfile span.price' ).html(arrFeeDownloadPrice[ intCurrentFileIndex ] + ' $'); $( '.print_or_buy_popup__buyfile span.price' ).html(arrFeeDownloadPrice[ intCurrentFileIndex ] + ' $'); } else if ( currentFolderHasFeeDownload( intCurrentFileIndex ) || arrFileAttributes[ intCurrentFileIndex ][ 'parentFeeDownloadPrice' ] ) { $( '#gallery2__buyfile' ).hide(); $( '#gallery2__buyall' ).show(); if( PublicProfile.intOpenFolderFeeDownload ) { $( '#gallery2__buyall span.price' ).html(PublicProfile.intOpenFolderFeeDownload + ' $'); } else { $( '#gallery2__buyall span.price' ).html(arrFileAttributes[ intCurrentFileIndex ][ 'parentFeeDownloadPrice' ] + ' $'); } $( '.print_or_buy_popup__buyfile' ).hide(); $( '.gallery2__save_button' ).hide(); $( '#gallery2__item_info_save' ).hide(); $( '.gallery2__buy_button').hide(); $( '#gallery2__header__view-original' ).addClass( 'hidden' ); $( '.gallery2__video_filename' ).css( 'visibility', 'hidden' ); $( '#gallery2__sidebar__info_embed_button, #gallery2__sidebar__info_embed_button_middle' ).addClass( 'hidden' ); $( '#gallery2__buyfile span.price' ).html(''); $( '.print_or_buy_popup__buyfile span.price' ).html(''); } else { $( '#gallery2__buyfile' ).hide(); $( '#gallery2__buyall' ).hide(); $( '.print_or_buy_popup__buyfile' ).hide(); $( '.gallery2__save_button' ).show(); $( '#gallery2__item_info_save' ).show(); $( '.gallery2__buy_button').hide(); $( '#gallery2__header__view-original' ).removeClass( 'hidden' ); $( '.gallery2__video_filename' ).css( 'visibility', 'visible' ); $( '#gallery2__sidebar__info_embed_button, #gallery2__sidebar__info_embed_button_middle' ).removeClass( 'hidden' ); $( '#gallery2__buyfile span.price' ).html(''); $( '#gallery2__buyall span.price' ).html(''); $( '.print_or_buy_popup__buyfile span.price' ).html(''); } if ((arrExtensions[intCurrentFileIndex] == 'png' || arrExtensions[intCurrentFileIndex] == 'jpg' || arrExtensions[intCurrentFileIndex] == 'jpge')&& arrFeeDownloadPrice[intCurrentFileIndex] == null&& ! currentFolderHasFeeDownload( intCurrentFileIndex )&& bolSimpleDownloadAllowed){$('#gallery2__item_info_order').show();$('#gallery2__order').css({display: 'flex'}); if ( arrFileAttributes[ getItemIndex ( strCurrentFileHash ) ].hasProductSelling ) { $('#gallery2__order').hide(); $('#gallery2__item_info_order').hide(); } }else{$('#gallery2__item_info_order').hide();$('#gallery2__order').hide();}if (intCurrentFileIndex == 0){$('#gallery2__controls_left').hide();}else {$('#gallery2__controls_left').show();}if (intCurrentFileIndex == arrIDs.length - 1){$('#gallery2__controls_right').hide();}else {$('#gallery2__controls_right').show();} if( arrFileTypes[intCurrentFileIndex] == 'audio' && $(window).width() <= 600 ) { $('#gallery2__controls_left').hide(); $('#gallery2__controls_right').hide(); } bolHideShareButtons = true; $( '#gallery2__share' ).show() $('#gallery2_item_info_share-wrapper').hide(); $( '#gallery2__sidebar__info_embed_button, #gallery2__sidebar__info_embed_button_middle' ).hide() $( '#gallery_upload-access-switch' ).hide(); checkThumbStripArrows(); galleryUpdateVoteCount(); galleryLoadFileInfo(); $( '#gallery2__comments-list__loadmore' ).remove(); galleryLoadFileComments(); setTimeout('gallerySelectThumb('+ intCurrentFileIndex +')', 100); var bolLogViews = 0; // bolOwnerIsStorageSubscriber - comes from public.php, this overrides bolLogViews if( typeof bolOwnerIsStorageSubscriber !== 'undefined' ) { bolLogViews |= bolOwnerIsStorageSubscriber; } var bolLogFileView = true; if ( bolLogFileView ) $.post('./fileView.php', {'h': strCurrentFileHash, 'p': bolLogViews});// Google Analytics if ( typeof _gaq != 'undefined' ) { _gaq.push( [ '_trackPageview', window.location.href ] ); } var jqGalleryContainer = $('#gallery2'); if ( bolSimpleDownloadAllowed ) { jqGalleryContainer.addClass( 'simple_download_allowed' ); } else { jqGalleryContainer.removeClass( 'simple_download_allowed' ); } bolGalleryIsShowingItem = false; if( bolStartAudioOnOpen ) { $( "#audio_" + strCurrentFileHash ).trigger( 'play' ); bolStartAudioOnOpen = false; } // Build main download button var intItemIndex = getItemIndexByHashOrName( strCurrentFileHash ); var bolSimpleDownloadAllowed = canDownload( strCurrentFileHash ); $( '#gallery-main-download-button' ).remove(); if ( bolSimpleDownloadAllowed ) { var objDownloadButton = new DropdownButton (); if ( bolSimpleDownloadAllowed ) { objDownloadButton.addButton('gallery-download-simple-split-button', 'Download original file', 'Download original', 'gamebaidoithuonglifestyle (1) ', function (){ gaev('split-download-button-engagement', 'header-download-simple-click', 'Split button simple download click'); modalGalleryDownloadFileBtn( strCurrentFileHash ) }) } if ( isFileConvertable( 'pdf', intItemIndex ) ) { objDownloadButton.addButton( 'gallery-download-simple-split-button' , 'Download this file as PDF' , 'Download as PDF' , 'gamebaidoithuonglifestyle (2) ' , function () { gaev( 'split-download-button-engagement', 'header-download-pdf-click', 'Split button pdf download click' ); modalGalleryDownloadFileBtn( strCurrentFileHash, 'pdf' ) } ); } else if ( isFileConvertable( 'mp4', intItemIndex ) ) { objDownloadButton.addButton( 'gallery-download-simple-split-button' , 'Download as MP4' , 'Download as MP4' , 'gamebaidoithuonglifestyle (3) ' , function () { gaev( 'split-download-button-engagement', 'header-download-mp4-click', 'Split button mp4 download click' ); modalGalleryDownloadFileBtn( strCurrentFileHash, 'mp4' ) } ); } else if ( isFileConvertable( 'jpg', intItemIndex ) ) { objDownloadButton.addButton( 'gallery-download-simple-split-button' , 'Download optimized JPG' , 'Download optimized JPG' , 'gamebaidoithuonglifestyle (4) ' , function () { gaev( 'split-download-button-engagement', 'header-download-jpg-click', 'Split button jpg download click' ); modalGalleryDownloadFileBtn( strCurrentFileHash, 'jpg' ) } ); } else if ( arrFileTypes[ intItemIndex ] == 'video' && arrExtensions[ intItemIndex ] == 'mp4' && typeof arrBigThumbPath != 'undefined' && arrBigThumbPath[ intItemIndex ] == 1 ) { objDownloadButton.addButton( 'gallery-download-simple-split-button' , 'Download optimized MP4' , 'Download optimized MP4' , 'gamebaidoithuonglifestyle (5) ' , function () { gaev( 'split-download-button-engagement', 'header-download-mp4-click', 'Split button mp4 download click' ); modalGalleryDownloadFileBtn( strCurrentFileHash, 'mp4' ) } ); } if ( bolSimpleDownloadAllowed && ! bolIsOwner && typeof objUploadCopyForm != 'undefined' && typeof strUploadHash != 'undefined' ) { objDownloadButton.addButton( 'gallery-download-myfiles-split-button', 'Copy to My account', 'Copy to My account', null, function (){ gaev('split-download-button-engagement', 'header-download-myfiles-click', 'Split button myfiles download click'); modalGalleryDownloadFileBtn( strCurrentFileHash, 'my-files' ); }, 'Recommended!' ) } var jqDownloadButton = objDownloadButton.build( 'gallery-download-split-button', 'gallery-main-download-button', 'Download' ); $( '#gallery2__header__mid_content #gallery2__download_space' ).before( jqDownloadButton ); } if ( ! objMainShareParams ) { $('#gallery2__share').hide(); $('#gallery2_item_info_share-wrapper').hide(); $('#gallery2__sidebar__info_embed_button, #gallery2__sidebar__info_embed_button_middle').hide(); } $( '#gallery2_info_head .thumbnail-wrapper' ).html( '' ); $( '#gallery2_info_head .thumbnail-wrapper' ).removeClass("two-actions"); $( '#gallery2_info_head .thumbnail-wrapper' ).removeClass("one-action"); var strThumbnailActions = ''; if( bolIsOwner && arrFileTypes[intCurrentFileIndex] != 'image' ){ if ( arrThumbnails[intItemIndex] ) { var strThumbPath = arrThumbnails[intItemIndex]; strThumbHTML = 'gamebaidoithuonglifestyle (6)'; } else if ( typeof( arrIconSvg ) !== 'undefined' && arrIconSvg[intItemIndex] ) { strThumbHTML = 'gamebaidoithuonglifestyle (7)'; } else { strThumbHTML = 'gamebaidoithuonglifestyle (8)'; } $( '#gallery2_info_head .thumbnail-wrapper' ).html( '' ); $( '#gallery2_info_head .thumbnail-wrapper' ).append(strThumbHTML); $( '#gallery2_info_head .thumbnail-wrapper' ).append('

'); if ( arrFileAttributes[ intItemIndex ][ 'hasCustomThumb' ] ) { strThumbnailActions = '

' + '' + '

' + '

' + '' + '

'; $( '#gallery2_info_head .thumbnail-actions' ).append(strThumbnailActions); $( '#gallery2_info_head .thumbnail-wrapper' ).addClass("two-actions"); } else { strThumbnailActions = '

' + '' + '

'; $( '#gallery2_info_head .thumbnail-actions' ).append(strThumbnailActions); $( '#gallery2_info_head .thumbnail-wrapper' ).addClass("one-action"); }} else { if ( typeof( arrIconSvg ) !== 'undefined' && arrIconSvg[intItemIndex] ) { strThumbHTML = 'gamebaidoithuonglifestyle (9)'; } else { strThumbHTML = 'gamebaidoithuonglifestyle (10)'; } $( '#gallery2_info_head .thumbnail-wrapper' ).html( '' ); $( '#gallery2_info_head .thumbnail-wrapper' ).append(strThumbHTML); } var strName = arrDisplayNames[intItemIndex];if (strName == ''){strName = arrNames[intItemIndex];} $( ".gallery2__header__file_name_value" ).html( strName ); if( bolIsOwner ) { $(".not_owner_show").hide(); $(".not_owner_hide").show(); } else { $(".not_owner_show").show(); $(".not_owner_hide").hide(); } if(bolActivateSlideshowOnOpen && arrHashes.length > 1) { enterSlideshow(); bolActivateSlideshowOnOpen = false; } if(typeof(strSlideshowInterval) !== 'undefined' && strSlideshowInterval !== null) { if(arrFileTypes[intCurrentFileIndex] == 'video' && typeof(objVideoPlayers[intCurrentFileIndex]) !== 'undefined' ) { clearInterval(strSlideshowInterval); strSlideshowInterval = 'reset'; objVideoPlayers[intCurrentFileIndex].objPlayer.loop(false); objVideoPlayers[intCurrentFileIndex].objPlayer.play(); } else if (arrFileTypes[intCurrentFileIndex] == 'audio' && typeof(objAudioPlayer) !== 'undefined') { clearInterval(strSlideshowInterval); strSlideshowInterval = 'reset'; objAudioPlayer._isSlideshowOn = true; objAudioPlayer.play(); } } if ( bolOpenGalleryCommentsBlock ) { setTimeout( function() { if ( ! bolGallerySidebarVisible ) { showGalleryInfo(); } showGalleryMessages(); $( window ).trigger( 'resize' ); }, 300 ); } // check mobile footer visible elements and hide info button if overflow var visibleElemCount = 0; var visibleBtns = $( '#gallery2__header__mid_content span.gallery2__header_middle_button:visible' ); visibleElemCount = visibleBtns.length; var bolSimpleDownloadAllowed = canDownload( strCurrentFileHash ); if ( bolSimpleDownloadAllowed ) { visibleElemCount += 1; } if ( visibleElemCount > 4 ) { $( '#gallery2__info_middle' ).addClass( 'mobile-hide' ); $(' #gallery2__info_more' ).addClass( 'mobile-show' ); }}window.showGalleryItem = showGalleryItem;function stopActiveContent(){// Stop videovar jqAllVideos = $("video");if (jqAllVideos.length>0){jqAllVideos.each(function () {this.pause();});}// Stop audiovar jqAllAudios = $("audio");if (jqAllAudios.length>0){jqAllAudios.each(function () {this.pause();});}} function GalleryDeleteFile(strFileH, strFileName) { fConfirm( 'Do you really want to delete this file?"' + strFileName + '"', 'Delete', 'Yes, delete!', 'Cancel', function(r){ if( r == true ) { $.ajax({ type: "POST", dataType: "json", url: "./ajax/delete_file.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925", data: { 'delete_user_file' : true , 'f' : strFileH , 'source': 'filebrowser' }, success: function( data ){ if( data['status'] == 'ok' ) { if(bolGalleryIsVisible && intNextIndex != null && !isNaN( intNextIndex )) { galleryOpenNextItem(); } else if (intPreviousIndex != null && !isNaN( intPreviousIndex )) { galleryOpenPrevItem(); } fSuccess( "File \""+ strFileName +"\" has been deleted!", "" ); location.reload(); } else { if( typeof data[ 'file_read_only' ] !== 'undefined' && data[ 'file_read_only' ] ) { fError( "The file cannot be deleted because it is shared!", "Info" ); } else if ( typeof data[ 'file_is_locked' ] !== 'undefined' && data[ 'file_is_locked' ] ) { fError( "This file cannot be deleted because it is locked.", "Info" ); } else { fError( "There was an error, the file was not deleted", "Info" ); } } } }); } }); return false; } function GalleryDeleteFileAnon(strKey, strFileH, strFileName) { fConfirm( 'Do you really want to delete this file?"' + strFileName + '"', 'Delete', 'Yes, delete!', 'Cancel', function(r){if( r == true ){$.ajax({type: "POST",dataType: "json",url: "./ajax/delete_file.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925",data: {'delete_file': true,'fk' : strKey,'f' : strFileH ,'source' : 'list'},success: function( data ){ if( data['status'] == 'ok' ) { if(bolGalleryIsVisible && intNextIndex != null && !isNaN( intNextIndex )) { galleryOpenNextItem(); } else if (intPreviousIndex != null && !isNaN( intPreviousIndex )) { galleryOpenPrevItem(); } fSuccess( "File \""+ strFileName +"\" has been deleted!", "" ); location.reload(); }else{ if( typeof data[ 'file_read_only' ] !== 'undefined' && data[ 'file_read_only' ] ) { fError( "The file cannot be deleted because it is shared!", "Info" ); } else if ( typeof data[ 'file_is_locked' ] !== 'undefined' && data[ 'file_is_locked' ] ) { fError( "This file cannot be deleted because it is locked.", "Info" ); } else { fError( "There was an error, the file was not deleted", "Info" ); }}}});}});return false; } function checkGalleryArrows() { if( $( window ).width() < 550 ) { if( arrFileTypes[intCurrentFileIndex] == 'audio' || arrFileTypes[intCurrentFileIndex] == 'video' || arrFileTypes[intCurrentFileIndex] == 'document' ) { $( '#gallery2__controls_left, #gallery2__controls_right' ).show(); $( '#gallery2__controls_left a, #gallery2__controls_right a' ).css({ 'top': 'initial', 'bottom': '0px' }); } else { $( '#gallery2__controls_left, #gallery2__controls_right' ).hide(); } } else { $( '#gallery2__controls_left a, #gallery2__controls_right a' ).removeAttr( 'style' ); $( '#gallery2__controls_left, #gallery2__controls_right' ).show(); } }function galleryLoadFileInfo(bolUpdateInfo){ if ( typeof(bolUpdateInfo) === 'undefined' && $(window).width() > 500 && ! bolGallerySidebarVisible ) { return; }var intItemIndex = getItemIndex ( strCurrentFileHash ); if ( bolUseAsyncFileInfoDataLoad ) { if ( ! arrIsFileInfoDataPreloaded[ intItemIndex ] ) { $( '#gallery2__sidebar__info' ).hide(); setTimeout( function() { galleryLoadFileInfo( bolUpdateInfo ) }, 1000 ); return; } else { $( '#gallery2__sidebar__info' ).show(); } } var strPublicProfileHref = ''; if ( typeof strUploadUserNameHref != 'undefined' && strUploadUserNameHref != '' ) { strPublicProfileHref = '/' + strUploadUserNameHref; } else if ( typeof PublicProfile != 'undefined' && typeof PublicProfile.strProfileName != 'undefined' ) { strPublicProfileHref = '/' + PublicProfile.strProfileName; } if ( typeof strUploadUserNameLink != 'undefined' ){ $( '#gallery2__sidebar__info-owner-user .gallery2__sidebar__info-value' ).html( strUploadUserNameLink );$( '#gallery2__sidebar__info .header-owner_name' ).html( strUploadUserNameLink ); if( typeof strUploadUserID != 'undefined' && strUploadUserID != '' && typeof strUploadUserLastProfileEditTimestamp != 'undefined') { $( '#gallery2__sidebar__info .header-owner .header-owner_image-wrapper' ).html( '' ); } else { $( '#gallery2__sidebar__info .header-owner .header-owner_image-wrapper' ).html( '

gamebaidoithuonglifestyle (11)

' ); }}else if ( typeof PublicProfile != 'undefined' && typeof PublicProfile.strProfileName != 'undefined' ){$( '#gallery2__sidebar__info-owner-user .gallery2__sidebar__info-value' ).html( '' + PublicProfile.strProfileName + '' );$( '#gallery2__sidebar__info .header-owner_name' ).html( '' + PublicProfile.strProfileName + '' ); if( typeof strUploadUserID != 'undefined' && strUploadUserID != '' && typeof strUploadUserLastProfileEditTimestamp != 'undefined') { $( '#gallery2__sidebar__info .header-owner .header-owner_image-wrapper' ).html( '' ); } else if( typeof PublicProfile.strAvatarPath != 'undefined' && PublicProfile.strAvatarPath != '') { $( '#gallery2__sidebar__info .header-owner .header-owner_image-wrapper' ).html( '' ); } else { $( '#gallery2__sidebar__info .header-owner .header-owner_image-wrapper' ).html( '

gamebaidoithuonglifestyle (12)

' ); }}else {$( '#gallery2__sidebar__info-owner-user' ).hide();$( '#gallery2__sidebar__info .header-owner' ).hide();}$('#gallery2__sidebar__info-size .gallery2__sidebar__info-value').html(arrSizes[intItemIndex]); if ( typeof arrDatesCreated != 'undefined' ) { $( '#gallery2__sidebar__info-date .gallery2__sidebar__info-value' ).html( arrDatesCreated[ intItemIndex ] ); } else { $( '#gallery2__sidebar__info-date .gallery2__sidebar__info-value' ).html( arrDates[ intItemIndex ] ); } if ( typeof arrFileDateCreated != 'undefined' && arrFileDateCreated[ intItemIndex ] != '' ) { $( '#gallery2__sidebar__info-date-created .gallery2__sidebar__info-value' ).html( arrFileDateCreated[ intItemIndex ] ); } else if ( typeof arrDatesCreated != 'undefined' ) { $( '#gallery2__sidebar__info-date-created .gallery2__sidebar__info-value' ).html( arrDatesCreated[ intItemIndex ] ); } else { $( '#gallery2__sidebar__info-date-created .gallery2__sidebar__info-value' ).html( arrDates[ intItemIndex ] ); } if ( typeof arrDatesModified != 'undefined' ) { $( '#gallery2__sidebar__info-moddate .gallery2__sidebar__info-value' ).html( arrDatesModified[ intItemIndex ] ); } else { $( '#gallery2__sidebar__info-moddate .gallery2__sidebar__info-value' ).html( arrDates[ intItemIndex ] ); }$('#gallery2__sidebar__info-views .gallery2__sidebar__info-value').html(arrViews[intItemIndex]);$('#gallery2__sidebar__info-downloads .gallery2__sidebar__info-value').html(arrDownloads[intItemIndex]);$('#gallery2__sidebar__info-comments .gallery2__sidebar__info-value').html(arrCommentCounts[intItemIndex]); $( '#gallery2__sidebar__info-dimensions' ).hide(); if ( typeof arrWidths != 'undefined' && typeof arrHeights != 'undefined' && typeof arrWidths[intItemIndex] != 'undefined' && typeof arrHeights[intItemIndex] != 'undefined' && arrWidths[intItemIndex] != '' && arrHeights[intItemIndex] != '' && arrWidths[intItemIndex] != 'undefined' && arrHeights[intItemIndex] != 'undefined' ) { if(arrFileTypes[ intItemIndex ] == 'video') { var strResolutionLabel = getResolutionLabel( arrWidths[ intItemIndex ], arrHeights[ intItemIndex ] ); $('#gallery2__sidebar__info-dimensions .gallery2__sidebar__info-value').html(strResolutionLabel + arrWidths[intItemIndex] + ' x ' + arrHeights[intItemIndex] + ', ' + Math.round((arrWidths[intItemIndex]*arrHeights[intItemIndex]/1000000) * 100) / 100+ 'MP'); } else { $('#gallery2__sidebar__info-dimensions .gallery2__sidebar__info-value').html(arrWidths[intItemIndex] + ' x ' + arrHeights[intItemIndex] + ', ' + Math.round((arrWidths[intItemIndex]*arrHeights[intItemIndex]/1000000) * 100) / 100+ 'MP'); } $( '#gallery2__sidebar__info-dimensions' ).show(); }$( '.gallery2__sidebar__info-metadata' ).hide(); $( '.gallery2__sidebar__info-exif_tags' ).remove(); $( '.gallery2__sidebar__info-one_line_buttons .disabled' ) .removeClass( 'disabled' ); $( '#gallery2__sidebar__info-metadata-tags' ).addClass( 'gallery2__sidebar__exif_tags-top-separator' ); $( '.gallery2__sidebar__info-dropdown_button.easyocr-text_recognition' ) .html( '' + 'Find Text' + '' + '' ); $( '.gallery2__sidebar__info-dropdown_button.google_cloud_vision-ocr' ) .html( '' + 'Find text PRO' + '' + '' ); $( '.gallery2__sidebar__info-dropdown_button.yolo-object_detection' ) .html( '' + 'Find objects' + '' + '' );if ( typeof arrFileTitle != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-title .gallery2__sidebar__info-value' ).html( arrFileTitle[ intItemIndex ] ); if ( arrFileTitle[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-title' ).show();}if ( typeof arrFileSubject != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-subject .gallery2__sidebar__info-value' ).html( arrFileSubject[ intItemIndex ] ); if ( arrFileSubject[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-subject' ).show();}if ( typeof arrFileContentType != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-content_type .gallery2__sidebar__info-value' ).html( arrFileContentType[ intItemIndex ] ); if ( arrFileContentType[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-content_type' ).show();}if ( typeof arrFileCategory != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-category .gallery2__sidebar__info-value' ).html(''); if (strPublicProfileHref != '') { $( '#gallery2__sidebar__info-metadata-category .gallery2__sidebar__info-value' ).append('' + arrFileCategory[ intItemIndex ] + ''); } else { $( '#gallery2__sidebar__info-metadata-category .gallery2__sidebar__info-value' ).html( arrFileCategory[ intItemIndex ] ); } if ( arrFileCategory[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-category' ).show();}if ( typeof arrFileCategories != 'undefined' ){ var arrCategories = arrFileCategories[ intItemIndex ].split(',') $( '#gallery2__sidebar__info-metadata-categories .gallery2__sidebar__info-value' ).html(''); if (strPublicProfileHref != '') { arrCategories.forEach(function(elem, idx, array) { if (idx != array.length - 1) { $( '#gallery2__sidebar__info-metadata-categories .gallery2__sidebar__info-value' ).append('' + elem + ', '); } else { $( '#gallery2__sidebar__info-metadata-categories .gallery2__sidebar__info-value' ).append('' + elem + ''); } }); } else { $( '#gallery2__sidebar__info-metadata-categories .gallery2__sidebar__info-value' ).html( arrFileCategories[ intItemIndex ] ); } if ( arrFileCategories[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-categories' ).show();}if ( typeof arrFileKeywords != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-keywords .gallery2__sidebar__info-value' ).html( arrFileKeywords[ intItemIndex ] ); if ( arrFileKeywords[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-keywords' ).show();}if ( typeof arrFileCreator != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-creator .gallery2__sidebar__info-value' ).html( arrFileCreator[ intItemIndex ] ); if ( arrFileCreator[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-creator' ).show();}if ( typeof arrFilePublisher != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-publisher .gallery2__sidebar__info-value' ).html( arrFilePublisher[ intItemIndex ] ); if ( arrFilePublisher[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-publisher' ).show();}if ( typeof arrFileContributor != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-contributor .gallery2__sidebar__info-value' ).html( arrFileContributor[ intItemIndex ] ); if ( arrFileContributor[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-contributor' ).show();}if ( typeof arrFileCopyrights != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-copyrights .gallery2__sidebar__info-value' ).html( arrFileCopyrights[ intItemIndex ] ); if ( arrFileCopyrights[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-copyrights' ).show();}if ( typeof arrFileLicenseType != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-license_type .gallery2__sidebar__info-value' ).html( arrFileLicenseType[ intItemIndex ] ); if ( arrFileLicenseType[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-license_type' ).show();}if ( typeof arrFileLicenseDetails != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-license_details .gallery2__sidebar__info-value' ).html( arrFileLicenseDetails[ intItemIndex ] ); if ( arrFileLicenseDetails[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-license_details' ).show();}if ( typeof arrFileLanguage != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-language .gallery2__sidebar__info-value' ).html( arrFileLanguage[ intItemIndex ] ); if ( arrFileLanguage[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-language' ).show();}if ( typeof arrFileLocation != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-location .gallery2__sidebar__info-value' ).html( arrFileLocation[ intItemIndex ] ); if ( arrFileLocation[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-location' ).show();} if ( typeof arrFileLocationLat !== 'undefined' && typeof arrFileLocationLong !== 'undefined' ) { let strGpsLat = gpsDecimalToDMS( arrFileLocationLat[ intItemIndex ], true ); let strGpsLong = gpsDecimalToDMS( arrFileLocationLong[ intItemIndex ], false ); $( '#gallery2__sidebar__info-metadata-location_lat .gallery2__sidebar__info-value' ) .html( '' + strGpsLat + '' ); $( '#gallery2__sidebar__info-metadata-location_long .gallery2__sidebar__info-value' ) .html( '' + strGpsLong + '' ); if ( strGpsLat !== '' && strGpsLong !== '' ) { $( '#gallery2__sidebar__info-metadata-location_lat' ).show(); $( '#gallery2__sidebar__info-metadata-location_long' ).show(); } }if ( typeof arrFileReferences != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-references .gallery2__sidebar__info-value' ).html( arrFileReferences[ intItemIndex ] ); if ( arrFileReferences[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-references' ).show();}if ( typeof arrFileRelatesTo != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-relates_to .gallery2__sidebar__info-value' ).html( arrFileRelatesTo[ intItemIndex ] ); if ( arrFileRelatesTo[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-relates_to' ).show();}if ( typeof arrFileFormat != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-format .gallery2__sidebar__info-value' ).html( arrFileFormat[ intItemIndex ] ); if ( arrFileFormat[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-format' ).show();}if ( typeof arrFileDevice != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-device .gallery2__sidebar__info-value' ).html( arrFileDevice[ intItemIndex ] ); if ( arrFileDevice[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-device' ).show();}if ( typeof arrFileSource != 'undefined' ){ $( '#gallery2__sidebar__info-metadata-source .gallery2__sidebar__info-value' ).html( arrFileSource[ intItemIndex ] ); if ( arrFileSource[ intItemIndex ] != '' ) $( '#gallery2__sidebar__info-metadata-source' ).show();} if ( typeof arrFileTypes != 'undefined' ) { if ( arrFileTypes[ intItemIndex ] == 'image' ) { $( '#gallery2__sidebar__info-exif_tags-button' ).show(); if ( typeof arrExtensions != 'undefined' && [ 'jpg', 'jpeg', 'png' ].includes( arrExtensions[ intItemIndex ] ) ) { if ( bolIsOwner || ( typeof( bolIsAnonymousUpload ) == 'boolean' && bolIsAnonymousUpload ) ) { $( '#gallery2__sidebar__info-content_analyze-buttons' ).show(); $( '#gallery2__sidebar__info-metadata-tags' ).removeClass( 'gallery2__sidebar__exif_tags-top-separator' ); } if ( !bolIsOwner ) { $( '.gallery2__sidebar__info-dropdown_button.easyocr-text_recognition' ).hide(); $( '.gallery2__sidebar__info-dropdown_button.yolo-object_detection' ).hide(); } if ( true ) { $( '.gallery2__sidebar__info-dropdown_button.google_cloud_vision-ocr' ).hide(); $( '.gallery2__sidebar__info-dropdown_button.google_cloud-vision' ).hide(); } } } }if ( typeof arrDuration != 'undefined' && typeof arrDuration[ intItemIndex ] != 'undefined' && arrDuration[ intItemIndex ] != '' ){ var strDuration = arrDuration[ intItemIndex ]; if( strDuration < 600 ) { strDuration = new Date(strDuration * 1000).toISOString().slice(15, 19); } else if( strDuration < 3600 ) { strDuration = new Date(strDuration * 1000).toISOString().slice(14, 19); } else { strDuration = new Date(strDuration * 1000).toISOString().slice(11, 19); } $( '#gallery2__sidebar__info-metadata-duration .gallery2__sidebar__info-value' ).html( strDuration ); if ( arrDuration[ intItemIndex ] != ''&& arrDuration[ intItemIndex ] != '0' ) $( '#gallery2__sidebar__info-metadata-duration' ).show();} if ( typeof arrFileGoogleCVText != 'undefined' && typeof arrFileGoogleCVText[ intItemIndex ] != 'undefined' ) { $( '#gallery2__sidebar__info-google_cv_text .gallery2__sidebar__info-value' ).text( arrFileGoogleCVText[ intItemIndex ] ); if ( arrFileGoogleCVText[ intItemIndex ] != '' && bolIsOwner ) { $( '#gallery2__sidebar__info-google_cv_text' ).show(); $( '.gallery2__sidebar__info-dropdown_button.google_cloud_vision-ocr' ) .addClass( 'disabled' ); } } if ( typeof arrFileEasyOCRText != 'undefined' && typeof arrFileEasyOCRText[ intItemIndex ] != 'undefined' ) { $( '#gallery2__sidebar__info-easyocr_text .gallery2__sidebar__info-value' ).text( arrFileEasyOCRText[ intItemIndex ] ); if ( arrFileEasyOCRText[ intItemIndex ] != '' && bolIsOwner ) { $( '#gallery2__sidebar__info-easyocr_text' ).show(); $( '.gallery2__sidebar__info-dropdown_button.easyocr-text_recognition' ) .addClass( 'disabled' ); } } if ( bolIsOwner && arrFileTypes[ intCurrentFileIndex ] == 'audio' ) { $( '#gallery2__sidebar__info-google_cloud-speech_to_text-button .gallery2__sidebar__info-dropdown_button' ) .html( '' + 'Recognize speech' + '' + '' ) .removeClass( 'disabled' );; $( '#gallery2__sidebar__info-google_cloud-speech_to_text-button' ) .show(); $( '#gallery2__sidebar__info-metadata-tags' ).removeClass( 'gallery2__sidebar__exif_tags-top-separator' ); } if ( bolIsOwner && typeof arrFileAudioTranscription != 'undefined' && typeof arrFileAudioTranscription[ intItemIndex ] != 'undefined' ) { $( '#gallery2__sidebar__info-google_cloud-speech_to_text-text .gallery2__sidebar__info-value' ).text( arrFileAudioTranscription[ intItemIndex ] ); if ( arrFileAudioTranscription[ intItemIndex ] != '' ) { $( '#gallery2__sidebar__info-google_cloud-speech_to_text-text' ).show(); $( '#gallery2__sidebar__info-google_cloud-speech_to_text-button .gallery2__sidebar__info-dropdown_button' ) .addClass( 'disabled' ); } } if ( arrFileTypes[ intCurrentFileIndex ] == 'image' && ( bolIsOwner || ( typeof( bolIsAnonymousUpload ) == 'boolean' && bolIsAnonymousUpload ) ) ) { $( '.gallery2__sidebar__info-dropdown_button.google_cloud-vision' ) .html( '' + 'Find objects PRO' + '' + '' ) .removeClass( 'disabled' ); } var jqObjectTagsElem = $( '#gallery2__sidebar__info-object_tags .tags' ); jqObjectTagsElem.empty(); if ( typeof arrObjectTags != 'undefined' && typeof arrObjectTags[ intItemIndex ] != 'undefined' && arrObjectTags[ intItemIndex ] != '' ) { let arrTagsSplitted = arrObjectTags[ intItemIndex ].split( ';' ); $.each( arrTagsSplitted, ( i, tag ) => { jqObjectTagsElem.append( '' + tag + '' ); } ); $( '#gallery2__sidebar__info-object_tags' ).show(); $( '.gallery2__sidebar__info-dropdown_button.google_cloud-vision' ).addClass( 'disabled' ); } if ( typeof arrYoloObjectTags != 'undefined' && typeof arrYoloObjectTags[ intItemIndex ] != 'undefined' && arrYoloObjectTags[ intItemIndex ] != '' ) { let arrExistingTags = jqObjectTagsElem.find( '.tag' ).map( function() { return $( this ).text(); } ).get(); let arrTagsSplitted = arrYoloObjectTags[ intItemIndex ].split( ';' ); let arrTagsToBeAdded = arrTagsSplitted.filter( tag => ! arrExistingTags.includes( tag ) ); $.each( arrTagsToBeAdded, ( i, tag ) => { jqObjectTagsElem.append( '' + tag + '' ); } ); $( '#gallery2__sidebar__info-object_tags' ).show(); $( '.gallery2__sidebar__info-dropdown_button.yolo-object_detection' ).addClass( 'disabled' ); } if ( typeof arrLabelTags != 'undefined' && typeof arrLabelTags[ intItemIndex ] != 'undefined' && arrLabelTags[ intItemIndex ] != '' ) { let jqTagsElem = $( '#gallery2__sidebar__info-label_tags .tags' ); jqTagsElem.empty(); let arrTagsSplitted = arrLabelTags[ intItemIndex ].split( ';' ); $.each( arrTagsSplitted, ( i, tag ) => { jqTagsElem.append( '' + tag + '' ); } ); $( '#gallery2__sidebar__info-label_tags' ).show(); $( '.gallery2__sidebar__info-dropdown_button.google_cloud-vision' ).addClass( 'disabled' ); } $('.gallery2_share-input').val('https://files.fm/f/' + strCurrentFileHash );if ( typeof arrDatesDelete == 'undefined' || arrDatesDelete[intItemIndex] == '' ){$('#gallery2__sidebar__info-date-delete').hide();}else{$('#gallery2__sidebar__info-date-delete .gallery2__sidebar__info-value').html( ( typeof arrDatesDelete != 'undefined' ? arrDatesDelete[intItemIndex] : '' ) );$('#gallery2__sidebar__info-date-delete').show();}var strName = arrDisplayNames[intItemIndex];if (strName == ''){strName = arrNames[intItemIndex];}var $name = $('#gallery2__sidebar__info-name .gallery2__sidebar__info-value'); $name.val( strName ); if( bolIsOwner ) { autoGrow( $name.get( 0 ), '32px' ); $(".not_owner_show").hide(); $(".not_owner_hide").show(); } else { $(".not_owner_show").show(); $(".not_owner_hide").hide(); $( ".gallery2__sidebar__file_name_value" ).html( strName ); $( ".gallery2__header__file_name_value" ).html( strName ); } var $desc = $('#gallery2__sidebar__info-description .gallery2__sidebar__info-value'); var strDescriptionForInput = arrDescriptions[ intItemIndex ].replaceAll('', String.fromCharCode(13, 10)); var strDescriptionForHtml = arrDescriptions[ intItemIndex ].replaceAll('', '
'); $desc.val( strDescriptionForInput ); var strDescription = strDescriptionForInput; if ( strDescription == '' || typeof strDescription == 'undefined' ) { strDescription = ''; $desc.html( strDescription ); } else { $( ".gallery2__sidebar__file_description_value" ).html( strDescription ); } if( bolIsOwner ) { autoGrow( $desc.get( 0 ), '32px' ); $(".not_owner_show").hide(); $(".not_owner_hide").show(); if ( strDescription == '' ) { $( "#file_description_edit_wrapper" ).addClass("no-description"); } else { $( "#file_description_edit_wrapper" ).removeClass("no-description"); } } else { $("#file_description_edit_wrapper").click(function () { if( window.location.href.indexOf("filebrowser") === -1 ) { showSignIn(); } }); $( ".gallery2__sidebar__file_description_value" ).html( strDescriptionForHtml ); if ( strDescription == '' ) { $( "#gallery2__sidebar__info-description" ).hide(); $( ".gallery2__sidebar__file_description_value, label[for='gallery2__sidebar__file_description_value']" ).hide(); $( ".gallery2__sidebar__file_description_value" ).css('padding-bottom', ''); } else { $( "#gallery2__sidebar__info-description" ).show(); $( ".gallery2__sidebar__file_description_value, label[for='gallery2__sidebar__file_description_value']" ).show(); $( ".gallery2__sidebar__file_description_value" ).css('padding-bottom', '5px'); } $(".not_owner_show").show(); $(".not_owner_hide").hide(); } // regenerate tagsInput in filebrowserif(window.location.href.indexOf( "filebrowser" ) !== -1 ) { // user can browse folders without reloading filebrowser, recheck if user owns file has to be done for each file $('#gallery_file_tags_container .file_tags_input').html(''); $('#gallery_file_tags_container .file_tags_input').removeAttr('data-tagsinput-init'); $('#gallery_file_tags_container .file_tags_input').removeAttr('id'); $('#gallery_file_tags_container .tagsinput').remove(); $('#gallery_file_tags_container .file_tags_input').tagsInput( { 'autocomplete_url': './ajax/file_tag.php?autocomplete&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925' , 'autocomplete': { selectFirst:false, autoFill:false}, 'height' : 'auto', 'width' : '100%', 'interactive' : bolIsOwner || ( window.location.href.indexOf( "filebrowser" ) !== -1 && 0 ), 'defaultText' : 'Add tags', 'onAddTag' : function(strTagName) { $('#gallery_file_tags_container .file_tags_error').hide(); $.ajax({ type: "POST", dataType: "json", url: "./ajax/file_tag.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925", data: { 'add_file_tag': true , 'file_hash' : strCurrentFileHash , 'tag_name': strTagName } , success: function(data) { if (data['status'] == 'ok') { var intItemIndex = getItemIndex(strCurrentFileHash); arrTags[intItemIndex] += ';' + strTagName; // update tags in filebrowser $('#sidebar_file_tags_container .file_tags_input').importTags(typeof arrTags[intItemIndex] === "undefined" ? "" : arrTags[intItemIndex]); } else { $('#gallery_file_tags_container .file_tags_error').show(); } } , error: function() { $('#gallery_file_tags_container .file_tags_error').show(); } }); } , 'onRemoveTag' : function(strTagName) { $('#gallery_file_tags_container .file_tags_error').hide(); $.ajax({ type: "POST", dataType: "json", url: "./ajax/file_tag.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925", data: { 'delete_file_tag': true , 'file_hash' : strCurrentFileHash , 'tag_name': strTagName } , success: function(data) { if (data['status'] == 'ok') { var intItemIndex = getItemIndex(strCurrentFileHash); arrTags[intItemIndex] = arrTags[intItemIndex].replace(strTagName, ''); // update tags in filebrowser $('#sidebar_file_tags_container .file_tags_input').importTags(typeof arrTags[intItemIndex] === "undefined" ? "" : arrTags[intItemIndex]); } else { $('#gallery_file_tags_container .file_tags_error').show(); } } , error: function() { $('#gallery_file_tags_container .file_tags_error').show(); } }); } , 'onSearchTag' : function(strTagName) { if (strPublicProfileHref != '') { window.open(strPublicProfileHref + '#search='+ strTagName, '_self'); } } , 'delimiter' : [';'] , 'removeWithBackspace' : false , 'minChars' : 1 , 'maxChars' : 245 , 'placeholderColor' : '#666666' }); } if (strPublicProfileHref != '') { $('#gallery_file_tags_container .tagsinput').addClass('searchable'); } else { $('#gallery_file_tags_container .tagsinput').removeClass('searchable'); }$('#gallery_file_tags_container .file_tags_input').importTags(typeof arrTags[intItemIndex] === "undefined" ? "" : arrTags[intItemIndex]);if ( ( arrTags[ intItemIndex ] == '' || typeof arrTags[intItemIndex] === "undefined" ) && ! bolIsOwner ){$( '#gallery2__sidebar__info-tags' ).hide();$( '#gallery2__sidebar__info-metadata-tags' ).hide(); }else{$( '#gallery2__sidebar__info-tags' ).show();$( '#gallery2__sidebar__info-metadata-tags' ).show();}if( bolIsOwner && arrFileTypes[intCurrentFileIndex] != 'image' ){$( '#gallery2__sidebar__info-set-custom-thumbnail' ).html( '' ); if ( arrFileAttributes[ intItemIndex ][ 'hasCustomThumb' ] ) { $( '#gallery2__sidebar__info-set-custom-thumbnail' ).append( '

Change file image

' ); $( '#gallery2__sidebar__info-set-custom-thumbnail' ).append( '

Delete file image

' ); } else { $( '#gallery2__sidebar__info-set-custom-thumbnail' ).append( '

Set file preview image

' ); }$( '#gallery2__sidebar__info-set-custom-thumbnail' ).show();}else{$( '#gallery2__sidebar__info-set-custom-thumbnail' ).hide();} if( bolIsOwner ) { $( "#gallery2__item_info_delete, #gallery2__item_info_delete_middle" ).on( 'click', function() { GalleryDeleteFile(arrHashes[ intItemIndex ], strName ); }); } else if( bolCanDelete && typeof arrFileDeleteKeys != 'undefined' && arrFileDeleteKeys[ intCurrentFileIndex ] != '' ) { $( "#gallery2__item_info_delete, #gallery2__item_info_delete_middle" ).on( 'click', function() { GalleryDeleteFileAnon( arrFileDeleteKeys[ intCurrentFileIndex ], arrHashes[ intCurrentFileIndex ], strName ); }); } $( '#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle' ).html( '' );$( '#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle' ).hide();$( '#gallery2__item_info_save' ).hide();if ( arrFeeDownloadPrice[ intCurrentFileIndex ] != null ){if ( bolIsOwner ){$("#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle").attr("onclick", "showSetPriceFormModal(strCurrentFileHash)") $("#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle").append("Change price") $( '#gallery2__item_info_save' ).show(); $('#gallery2__buyfile span.text').html('Change price'); $('.print_or_buy_popup__buyfile span.text').html('Change price'); $( '#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle' ).append( ' (' + arrFeeDownloadPrice[ intCurrentFileIndex ] + ' $)' ); }else{$("#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle").attr("onclick", "showBuyFileFormModal(strCurrentFileHash)") $("#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle").append("Buy") $('#gallery2__buyfile span.text').html('Buy'); $('.print_or_buy_popup__buyfile span.text').html('Buy'); $( '#gallery2__item_info_save' ).hide(); $( '#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle' ).append( '' + arrFeeDownloadPrice[ intCurrentFileIndex ] + ' $' );}$( '#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle' ).show();}else{ if ( bolIsOwner ) { $("#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle").attr("onclick", "showSetPriceFormModal(strCurrentFileHash)") $("#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle").append("Sell") $('#gallery2__buyfile span.text').html('Sell'); $('.print_or_buy_popup__buyfile span.text').html('Sell'); $( '#gallery2__sidebar__info-price, #gallery2__sidebar__info-price_middle' ).show(); $( '#gallery2__item_info_save' ).show(); } else { if ( arrFeeDownloadPrice[ intItemIndex ]==null && ! currentFolderHasFeeDownload( intItemIndex ) && arrAllowDownload[ intItemIndex ] && ( typeof(bolHideDownloadButtons) === 'undefined' || ! bolHideDownloadButtons ) && ( typeof(arrHideDownloadButtons) === 'undefined' || ! arrHideDownloadButtons[ intItemIndex ] )) { $( '#gallery2__item_info_save' ).show(); $( '.gallery2__save_button' ).show(); } else { $( '#gallery2__item_info_save' ).hide(); $( '.gallery2__save_button' ).hide(); } }}autosize.update($('#file_description_edit_wrapper textarea'));autosize.update($('#file_name_edit_wrapper textarea')); bolGalleryCommentsVisible = true; galleryLoadFileComments(); if (! bolGallerySidebarVisible ){ bolGalleryCommentsVisible = false;}} function galleryLoadFileComments() { if (!bolGalleryCommentsVisible || strActiveCommentsEntityHash == strCurrentFileHash) { return; } // Check if global variable is available if (typeof window.ChatFM === 'undefined') { setTimeout(function() { galleryLoadFileComments() }, 100) return } strActiveCommentsEntityHash = strCurrentFileHash; ChatFM.resetChat(); ChatFM.setNewEntityChat(strCurrentFileHash, "1"); } function galleryUpdateVoteCount() {var intItemIndex = getItemIndex ( strCurrentFileHash );$('.gallery_vote .vote_count').text( arrVoteCounts[intItemIndex] );var strVoteIcon = null;if ( arrHasVoted[intItemIndex] ){ strVoteIcon = '/images/gallery/heart_red.svg';$('.gallery_vote').addClass('has_voted');}else{ strVoteIcon = '/images/gallery/heart_hollow.svg';$('.gallery_vote').removeClass('has_voted');}if( typeof objAudioPlayer !== "undefined" && objAudioPlayer !== null ) { objAudioPlayer.afterVote(); } var jqImage = $('#main_image_' + strCurrentFileHash);} function galleryUpdateFileSelection() { $('#gallery2__thumb-strip__inner a').removeClass('selected'); $('#gallery_select_middle').removeClass('selected'); objSelectedFiles.forEach((strHash) => { $('#gallery2__thumb-strip__inner a[file_hash="' + strHash + '"]').addClass('selected'); if(strHash == strCurrentFileHash) { $('#gallery_select_middle').addClass('selected') } }); }function galleryChangeLocation ( strLocation, bolAuto ) { var strHashtag = window.location.hash; var strTitle = ''; if ( strLocation.indexOf('/f/') !== -1 ) { var strHash = strLocation.replace( '/f/', '' ); var intFileIndex = getItemIndexByHashOrName( strHash ); strTitle = arrDisplayNames[ intFileIndex ] + ' - gamebaidoithuonglifestyle' ; } //when changing gallery items, don't add new entries in history - change last one if(history.state == 'gallery') { history.replaceState( 'gallery', '', '/' + strScriptURL + strLocation ); } else { history.pushState( 'gallery', '', '/' + strScriptURL + strLocation ); } document.title = strTitle; galleryCheckLocation (); } var bolCheckLocationRunning = false; function galleryCheckLocation () { if ( bolCheckLocationRunning ) return; bolCheckLocationRunning = true; var intFileIndex = null; bolHashtagViewUseSemicolon = false; var strPathname = decodeURIComponent(window.location.pathname); var strViewLink = strPathname.slice(decodeURIComponent('/gamebaidoithuonglifestyle').length, strPathname.length); var strItemHashOrName = strViewLink.slice(3, strViewLink.length); intFileIndex = getItemIndexByHashOrName ( strItemHashOrName );if (window.location.hash.indexOf(';zoom') == -1){ $('#gallery_panzoomdiv').css('display', 'none'); }if ( typeof intFileIndex !== "undefined" && intFileIndex !== null ){$('#gallery2').show();if ( strCurrentFileHash !== arrHashes[ intFileIndex ] ) { setTimeout( "showGalleryItem( '" + arrHashes[ intFileIndex ] + "')", 0 ); }} else { if ( bolGalleryIsVisible && bolCloseGalleryIfHashRemoved ) { closeGallery(strCurrentFileHash); } } bolCheckLocationRunning = false;} var galleryCheckHashtag = galleryCheckLocation; if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { var mql = window.matchMedia("(orientation: portrait)"); // If there are matches, we're in portrait // Add a media query change listener mql.addListener(function(m) { if(m.matches) { // Changed to portrait $('#gallery2__content-wrapper').removeClass( 'gallery__only_image' ); } else { // Changed to landscape $('#gallery2__content-wrapper').addClass( 'gallery__only_image' ); } setTimeout( function() { var evt = document.createEvent('UIEvents'); evt.initUIEvent('resize', true, false,window,0); window.dispatchEvent(evt); }, 300 ); }); } $(window).bind('hashchange', galleryCheckLocation); $(window).bind('popstate', function(e) { if ( window.location.href.indexOf('/u/') !== -1 ) { if( strCurrentFileHash ) closeGallery(strCurrentFileHash); } }); function galleryDestroyMainSlider () { if ( jqMainSlider ) { jqMainSlider.destroySlider(); jqMainSlider = null;}} function galleryReinitalize () { galleryDestroyMainSlider (); $( '#gallery2__swipe-wrapper .gallery2__item' ).remove(); $( '#gallery2__thumb-strip__inner' ).html(''); $('#gallery2__controls_doc_sign').removeClass('document'); $( '#gallery2__info_middle' ).removeClass( 'mobile-hide' ); $(' #gallery2__info_more' ).removeClass( 'mobile-show' ); if ( bolIsOwner ) { $('#gallery2__header__setprice').show(); $('#gallery2__sign').show(); $('#gallery2__sign_main').show(); $('.gallery2__edit').show(); } else { $('#gallery2__header__setprice').hide(); $('#gallery2__sign').hide(); $('#gallery2__sign_main').hide(); $('.gallery2__edit').hide(); } if ( bolUseAsyncFileInfoDataLoad ) { arrFileTitle = []; arrFileSubject = []; arrFileContentType = []; arrFileCategory = []; arrFileCategories = []; arrFileKeywords = []; arrFileCreator = []; arrFilePublisher = []; arrFileContributor = []; arrFileCopyrights = []; arrFileLicenseType = []; arrFileLicenseDetails = []; arrFileLanguage = []; arrFileLocation = []; arrFileLocationLat = []; arrFileLocationLong = []; arrFileReferences = []; arrFileRelatesTo = []; arrFileFormat = []; arrFileDevice = []; arrFileSource = []; arrTags = []; arrObjectTags = []; arrYoloObjectTags = []; arrLabelTags = []; arrFileGoogleCVText = []; arrFileEasyOCRText = []; arrFileAudioTranscription = []; arrIsFileInfoDataPreloaded = []; }} var objVideoPlayers = {}; function initVideoPlayer (intFileIndex) { var logoHref = "https://files.fm"; var logoImgUrL = logoHref; logoImgUrL += "/images/logo/white/filesfm_logo_full.svg"; var player = new FilesFm_VideoJS( "video_" + arrHashes[ intFileIndex ], { autoplay: false, posterHref: 'https://' + arrFileHost[ intFileIndex ] + '/thumb_video_picture.php?i=' + arrHashes[intFileIndex] + '&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925' , } ); objVideoPlayers[intFileIndex] = player; player.objPlayer.on( 'ready', function() { var domVideo = $( '#' + player.strContainerId + ' video' )[ 0 ]; var objQualitySelector = player.objPlayer.controlBar.qualitySelector; var objPlaybackRateMenuButton = player.objPlayer.controlBar.playbackRateMenuButton; // Add title to PlaybackRateMenuButton $( objPlaybackRateMenuButton.menu.el() ) .prepend( '

Speed

' ); // Close QualitySelector and PlaybackRateMenuButton when any of CenterButtons is clicked. // Event 'touchend' is specifically for touchscreens. // Mouse click is implemented in VideoJS by default. player.objPlayer.getChild( 'CenterButtons' ).children().forEach( button => { $( button.el() ).on( 'touchend', () => { objQualitySelector.unpressButton(); objPlaybackRateMenuButton.unpressButton(); } ); } ); // Do not make further changes to QualitySelector // if there is no source of the original video. if ( player.objPlayer.currentSources().length != 2 ) { return; } function onMetadataLoaded() { domVideo.removeEventListener( 'loadedmetadata', onMetadataLoaded ); // If preview and original video resolutions are the same, remove QualitySelector if ( typeof arrWidths != 'undefined' && typeof arrHeights != 'undefined' && arrWidths[ intFileIndex ] == domVideo.videoWidth && arrHeights[ intFileIndex ] == domVideo.videoHeight ) { objQualitySelector.el().remove(); return; } styleQualitySelector( player, intFileIndex ); $( objPlaybackRateMenuButton.el() ).addClass( 'vjs-quality-selector-available' ); $( objQualitySelector.menu.el() ).find( '*' ).addClass( 'bx_allow_events' ); var jqQualitySelectorList = $( objQualitySelector.menu.contentEl() ); var jqOriginalQualityBTN = $( objQualitySelector.items[ 1 ].el() ); jqOriginalQualityBTN.remove(); // Create plain copy of element (to prevent any event listeners and other stuff) jqOriginalQualityBTN = $( jqOriginalQualityBTN[ 0 ].outerHTML ); jqQualitySelectorList.append( jqOriginalQualityBTN ); jqOriginalQualityBTN.on( 'click touchend', function() { player.objPlayer.pause(); showCreateAccount(); } ); } if ( domVideo.readyState == 0 ) { domVideo.addEventListener( 'loadedmetadata', onMetadataLoaded ); } else { onMetadataLoaded(); } } ); player.objPlayer.on( 'qualityRequested', function( event, newSource ) { $( event.target ) .find( '.vjs-control-bar .vjs-quality-selector .vjs-quality-selector-value' ) .text( newSource.resolutionLabel ); } ); player.objPlayer.on("ended", (event) => { if ( bolGalleryIsVisible ) { var intNextSlideIndex = intNextIndex; if(intNextIndex == null || isNaN( intNextIndex ) && arrHashes[0] != null) { intNextSlideIndex = getItemIndex ( arrHashes[0] ); } if ( intNextSlideIndex != null && !isNaN( intNextSlideIndex ) ) { if (strSlideshowInterval === 'reset') { objVideoPlayers[intCurrentFileIndex].objPlayer.loop(true); galleryChangeLocation ( getItemLink ( arrHashes[intNextSlideIndex] ) ); } } } }); fitVideoPlayer( $( "#video_" + arrHashes[ intFileIndex ] ) ); $( "#video_" + arrHashes[ intFileIndex ] ).find( "*" ).addClass( "bx_allow_events" ); $( "#video_" + arrHashes[ intFileIndex ] ).addClass( 'ffm_video_fallback' ); $( "#video_" + arrHashes[ intFileIndex ] + ' .vjs-loading-spinner .vjs-control-text' ).text( 'Wait for the mp4 video preview to be created for playback in the browser. This takes time, depending on the length of the video. If the video does not start, refresh the page or download the original.' ); // let's not resize the player anymore player.setFluid( false ); } function styleQualitySelector( player, intFileIndex ) { var strDefaultQualityLabel = 'HD'; var domVideo = $( '#' + player.strContainerId + ' video' )[ 0 ]; var objQualitySelector = player.objPlayer.controlBar.qualitySelector; $( objQualitySelector.menu.el() ) .prepend( '

Quality

' ); // PREVIEW QUALITY BUTTON var jqPreviewQualityText = $( objQualitySelector.items[ 0 ].el() ).find( '.vjs-menu-item-text' ); jqPreviewQualityText.html( '

Preview

' ); var intPreviewWidth = domVideo.videoWidth; var intPreviewHeight = domVideo.videoHeight; if ( typeof intPreviewWidth == 'number' && typeof intPreviewHeight == 'number' && intPreviewWidth > 0 && intPreviewHeight > 0 ) { var strPreviewResolutionLabel = getResolutionLabel( intPreviewWidth, intPreviewHeight, true ); if ( strPreviewResolutionLabel === '' ) { strPreviewResolutionLabel = 'SD '; } jqPreviewQualityText.append( '

' + strPreviewResolutionLabel + intPreviewWidth + 'x' + intPreviewHeight + '

' ); $( objQualitySelector.el() ).prepend( '

' + strPreviewResolutionLabel + '

' ); player.objPlayer.currentSources()[ 0 ].resolutionLabel = strPreviewResolutionLabel; } else { $( objQualitySelector.el() ).prepend( '

' + strDefaultQualityLabel + '

' ); player.objPlayer.currentSources()[ 0 ].resolutionLabel = strDefaultQualityLabel; } // ORIGINAL QUALITY BUTTON var jqOriginalQualityText = $( objQualitySelector.items[ 1 ].el() ).find( '.vjs-menu-item-text' ); jqOriginalQualityText.html( '

' + 'Original ' + 'PRO' + '

' ); if ( typeof arrWidths != 'undefined' && typeof arrHeights != 'undefined' && arrWidths[ intFileIndex ] != '' && arrHeights[ intFileIndex ] != '' ) { var strOriginalResolutionLabel = getResolutionLabel( arrWidths[ intFileIndex ], arrHeights[ intFileIndex ], true ); if ( strOriginalResolutionLabel === '' ) { strOriginalResolutionLabel = 'SD '; } jqOriginalQualityText.append( '

' + strOriginalResolutionLabel + arrWidths[ intFileIndex ] + 'x' + arrHeights[ intFileIndex ] + '

' ); player.objPlayer.currentSources()[ 1 ].resolutionLabel = strOriginalResolutionLabel; } else { player.objPlayer.currentSources()[ 1 ].resolutionLabel = strDefaultQualityLabel; } } function getVideoSize($video) { $video = $($video); var $viewPort = $video.closest( ".gallery2__video_container" ); var viewportHeight = $viewPort.height() - 100; var viewportWidth = $viewPort.width(); var minHeight = 240; var videoHeight = $video.get( 0 ).offsetHeight; var videoWidth = $video.get( 0 ).offsetWidth; var widthToHeight = $video.attr( 'data-wth' ); if ( typeof widthToHeight === "undefined" || !widthToHeight ) { widthToHeight = Math.floor( videoWidth / videoHeight * 100 ) / 100; $video.attr( 'data-wth', widthToHeight ); } if( widthToHeight == 0 ) { widthToHeight = 1; } var maxHeight = viewportHeight; if ( maxHeight * widthToHeight >= viewportWidth ) { maxHeight = Math.round( viewportWidth / widthToHeight ); } if( maxHeight > viewportHeight ) { maxHeight = viewportHeight; } if ( maxHeight < minHeight ) { maxHeight = minHeight; } var w = Math.floor( widthToHeight * maxHeight ); return { height: maxHeight + 'px', width: !isNaN(w) ? (w + "px") : "0px" }; } function fitVideoPlayer( $video ) { $video = $($video); var size = getVideoSize( $video ); $video.css( { paddingTop: size.height, width: size.width, height: 0 } ); $video.find( "video" ).css( 'width', '100%' ); } function fitEmbedPlayer( $video ) { $video = $( $video ); var size = getVideoSize( $video ); if ( size.width !== "0px" ) { $video.closest( ".gallery2__video_container__embed_palyer" ).css( { 'maxWidth': size.width } ); $video.closest( ".filesfm__embed_player__container" ).css( { height: "100%" } ); } $video.find( "video" ).css( 'width', '100%' ); } var bolGalleryIsOpening = false; var arrThumbWidth = []; function showGallery() { if ( bolGalleryIsOpening ) { return;}bolGalleryIsOpening = true; $( 'html' ).css( 'overflow', 'hidden' ); $( '#gallery2' ).show(); $('#tawkchat-iframe-container').hide(); if( $( '#gallery2__swipe-wrapper .gallery2__item' ).length == 0 ) { if (jqThumbContainer == null) { jqThumbContainer = $('#gallery2__thumb-strip__inner'); var intAllThumbCount = $( 'A', jqThumbContainer ).length; } var intThumbsW = 0; var arrItems = []; var arrThumbs = []; for( idx in arrIDs ) { // Removed jQuery from content composingvar strItemHTML = ''; strAddress = ''; var strThumbHTML = ''; var strClass = null; if ( arrThumbnails[idx] ) { var strThumbPath = arrThumbnails[idx]; strThumbHTML = 'gamebaidoithuonglifestyle (13)'; } else if ( typeof( arrIconSvg ) !== 'undefined' && arrIconSvg[idx] ) { strThumbHTML = 'gamebaidoithuonglifestyle (14)'+ arrExtensions[ idx ].toUpperCase() +''; } else if ( arrIconClass[idx] ) { strThumbHTML = ''+ arrExtensions[ idx ].toUpperCase() +''; strClass = 'doc-icon'; } else { strThumbHTML = ''+ arrExtensions[ idx ].toUpperCase() +''; strClass = 'doc-icon'; } var strThumbItemHTML = '

'+ strThumbHTML +'

'; arrItems.push(strItemHTML); arrThumbs.push(strThumbItemHTML); } $( '#gallery2__swipe-wrapper' )[0].innerHTML = arrItems.join(''); jqThumbContainer[0].innerHTML = arrThumbs.join(''); arrItems = null; arrThumbs = null; } if (jqThumbContainer == null){jqThumbContainer = $('#gallery2__thumb-strip__inner');}if (jqThumbViewport == null){jqThumbViewport = $('#gallery2__thumb-strip');} if( jqMainSlider == null ) { recalculateGalleryForBanner(); var bolTouchEnabled = true; if(arrIDs.length == 1) { bolTouchEnabled = false; } jqMainSlider = $( '#gallery2__swipe-wrapper' ).bxSlider({ slideSelector: 'span.gallery2__item', infiniteLoop: false, hideControlOnEnd: true, preventDefaultSwipeX: true, video: true, pager: false, controls: false, slideWidth: 9999, useCSS: true, speed: 0, animationSpeed: 0, touchEnabled: bolTouchEnabled , onSlideBefore: function( $slide, oldIDx, newIDx ){ galleryChangeLocation ( getItemLink ( arrHashes[newIDx] ) ); if( !$slide.hasClass( 'content_ready' ) ) { loadSlideContent( $slide, newIDx ); } }, onSlideAfter: function( $slide, oldIDx, newIDx ){ var slidePrevIDx = parseInt( newIDx ) - 1; var slideNextIDx = parseInt( newIDx ) + 1; if( slidePrevIDx >= 0 ) { $slidePrev = $( '#gallery2__item-' + slidePrevIDx ); if( $slidePrev.length > 0 && !$slidePrev.hasClass( 'content_ready' ) ) { loadSlideContent( $slidePrev, slidePrevIDx ); } } if( slideNextIDx < jqMainSlider.getSlideCount() ) { $slideNext = $( '#gallery2__item-' + slideNextIDx ); if( $slideNext.length > 0 && !$slideNext.hasClass( 'content_ready' ) ) { loadSlideContent( $slideNext, slideNextIDx ); } } if ( $slide.find( ".gallery2__item__audio-wrapper" ).length ) { objAudioPlayer.appendTo( $slide.find( ".gallery2__item__audio-wrapper" ) ); objAudioPlayer.setCurrentTrackByHash( arrHashes[ newIDx ] ); } } }); var obj = document.getElementById('gallery2__swipe-wrapper'); obj.addEventListener('touchmove', function(event) { if(event.targetTouches.length > 1) { $( '#gallery2__swipe-wrapper' ).attr('data-multi-touch', true) } else { $( '#gallery2__swipe-wrapper' ).attr('data-multi-touch', false) } }, false); } else if (bolHaveToRedrawGallery) { recalculateGalleryForBanner(true); bolHaveToRedrawGallery = false; } // At the beginning we need fixed size for lazyload to work $( 'img.lazyload-image-gallery', jqThumbContainer).css( {'width': 'auto', 'height':'73px'} ).addClass('image-not-loaded'); $(function(){ var intAllThumbCount = $( 'A', jqThumbContainer ).length; // After preload image is loaded - set auto size for original images. $( 'img.lazyload-image-gallery', jqThumbContainer ).on( 'load', function (){ var intW = this.naturalWidth; if ( intW < intThumbWidth ) intW = intThumbWidth; arrThumbWidth.push( intW ); var intLoadedThumbCount = 0; var intLoadedThumbWidthSum = 0; for ( var i = 0; i

.gallery2__header_middle_button:not(#gallery2__sidebar__info_embed_button_middle)' ) .on( 'click', function () { $( '#gallery2__header__right_more' ).removeClass('open'); } ); });$( 'img.lazyload-image-gallery' ).lazyload({container: jqThumbViewport,skip_invisible: true,event: 'scroll touchmove thumb-scroll',threshold: parseInt(intPreloadThumbnailsCount * intThumbWidth)});bolGalleryIsVisible = true; $( function() { if(typeof(bolOpenPopupInGallery) !== 'undefined' && bolOpenPopupInGallery) { if( intPopupType == 2) { objPopupForm.showForm(); bolPopupOnlyGallery = true; } else { setTimeout(function() { objPopupForm.showForm(); bolPopupOnlyGallery = true; }, 2000); } } } );setTimeout("$('#info_tooltip_global').hide();", 100); if ( objMainShareParams ) $('#gallery2__share').show(); bolGalleryIsOpening = false; var bolIsMobile = navigator.userAgent.match( '/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/i' ) if ( !bolIsMobile && $( window ).width() >= 1400 && !bolGallerySidebarVisible ) { showGalleryInfo(); } } function galleryLazyloadRecalc() {// Optimization for lazy load to work faster on large set of images.// Trigger lazy load recalc event for 5 images before loaded images and 5 after.var arrPreElements = [];var arrPostElements = [];var bolPassedLoadedImages = false; $('img.lazyload-image-gallery').each (function (){var jqImage = $(this);if ( jqImage.hasClass('image-loaded') ){bolPassedLoadedImages = true;}if ( bolPassedLoadedImages == false ){arrPreElements.unshift( jqImage );if (arrPreElements.length == intPreloadThumbnailsCount){delete arrPreElements[intPreloadThumbnailsCount-1];}}else{if (arrPostElements.length < intPreloadThumbnailsCount){arrPostElements.push( jqImage );}}}); jqThumbViewport.trigger('scroll');}function openPanZoomImage () { if ( arrFileTypes[intCurrentFileIndex] !== 'image' ) return; var strImageURL = 'https://'+ arrFileHost[ intCurrentFileIndex ] +'/thumb_show.php?i=' + arrHashes[intCurrentFileIndex] + '&view&v=1&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925'; if (arrFeeDownloadPrice[intCurrentFileIndex] > 0 || currentFolderHasFeeDownload( intCurrentFileIndex ) ) { strImageURL += '&wm=103'; } if ( typeof( arrFileVersion ) != 'undefined' && typeof( arrFileVersion[ intCurrentFileIndex ] ) != 'undefined' && arrFileVersion[ intCurrentFileIndex ] > 0 ) { strImageURL += '&version=' + arrFileVersion[ intCurrentFileIndex ]; } var srNewPanZoomLink = getItemLink ( strCurrentFileHash ); if( !window.location.hash.includes(';zoom') ) { if ( window.location.hash.length > 0 ) { srNewPanZoomLink += ';zoom'; } else { srNewPanZoomLink += '#;zoom'; } } galleryChangeLocation ( srNewPanZoomLink ); var strHtml = 'gamebaidoithuonglifestyle (15)'; strHtml += ''; var resCloseTimeout = null; $('#gallery_panzoomdiv') .html( strHtml ) .css('display', 'block') .on('mouseup', function (e){ resCloseTimeout = setTimeout( function (){ $('#gallery_panzoomdiv').css('display', 'none'); }, 50); }) .on('mousemove', function (e){ if ( resCloseTimeout ) { clearTimeout( resCloseTimeout ); resCloseTimeout = null; } }); $('#gallery_panzoomdiv_close').on('click', function () { $('#gallery_panzoomdiv').css('display', 'none'); }); } function initPanZoomImage (dom) { var intBodyHeight = $('body').outerHeight(); var panzoom_instance = panzoom(dom, { transformOrigin: {x: 0.5, y: 0.5}, maxZoom: 8, minZoom: 0.25, onTouch: function(e) { return false; } }); var container_width = $('#gallery_panzoomdiv').width(); var container_height = $('#gallery_panzoomdiv').height(); var width = $('#gallery_panzoomdiv_content').width(); var height = $('#gallery_panzoomdiv_content').height(); panzoom_instance.moveTo((width - container_width)/-2, (height - container_height)/-2); var jqHead = $( 'head' ); jqHead.find( 'meta[name=viewport]' ).remove(); jqHead.prepend( '' ); } var arrIframeTimers = []; var objAudioPlayer = null; function getBackgroundSize(elem) { var objElemComputedStyle = getComputedStyle(elem), objImage = new Image(), strElemSrc = objElemComputedStyle.backgroundImage.replace(/url\((['"])?(.*?)\1\)/gi, '$2'), intElemWidth = parseInt(objElemComputedStyle.width.replace('px', ''), 10), intElemHeight = parseInt(objElemComputedStyle.height.replace('px', ''), 10); objImage.src = strElemSrc; var intBackgroundWidth, intBackgroundHeight; var intRatioWidth = objImage.width / intElemWidth; var intRatioHeight = objImage.height / intElemHeight; if (intRatioWidth > intRatioHeight) { intBackgroundHeight = objImage.height / intRatioWidth; intBackgroundWidth = intElemWidth; } else { intBackgroundWidth = objImage.width / intRatioHeight; intBackgroundHeight = intElemHeight; } return { width: intBackgroundWidth, height: intBackgroundHeight }; } function loadSlideContent( $jqSlideElem, intFileIndex ) {var strHttpCacheKey = '';if ( typeof(arrHttpCacheKeys) != 'undefined' && typeof(arrHttpCacheKeys[intFileIndex]) != 'undefined' ){strHttpCacheKey = '' + arrHttpCacheKeys[intFileIndex];} if ( arrFileAttributes && arrFileAttributes[ intFileIndex ] && arrFileAttributes[ intFileIndex ][ 'readOnly' ] ) { $( '#gallery2__header__mid_content' ).hide(); } else { $( '#gallery2__header__mid_content' ).show(); } var strFileType = arrFileTypes[intFileIndex]; var bolIsFileConvertableToPdf = isFileConvertable( 'pdf', intFileIndex ); if ( bolIsFileConvertableToPdf ) { strFileType = 'pdf_converted'; } switch( strFileType ) { default: var jqThumb; if ( arrFileAttributes[ intFileIndex ][ 'hasCustomThumb' ] ) { jqThumbInner = $( "

" ) .css({ 'background-image': 'url("/thumb.php?i=' + arrHashes[ intFileIndex ] + '&v=1")', 'height': function() { } }) .addClass( 'gallery2__item__custom_thumb gallery2__item__base-width-on-two' ); if ( arrFeeDownloadPrice[intFileIndex] > 0 ) { if (bolIsOwner) { jqThumbInner.attr( 'onclick', 'showSetPriceFormModal(strCurrentFileHash)' ); } else { jqThumbInner.attr( 'onclick', 'showBuyFileFormModal(strCurrentFileHash)' ); } jqThumbInner.addClass( 'bx_allow_events' ); jqThumbInner.addClass( 'has_price' ); } jqThumb = $( '' ) .append( jqThumbInner ); } else { var strIconHtml = ''; if ( typeof( arrIconSvg ) !== 'undefined' && arrIconSvg[ intFileIndex ] ) { strIconHtml = 'gamebaidoithuonglifestyle (16)'; } jqThumb = $( '' + strIconHtml + '' ); } var bolSimpleDownloadAllowed = false; if ( arrAllowDownload[ intFileIndex ] && arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) && ( typeof(bolHideDownloadButtons) === 'undefined' || ! bolHideDownloadButtons ) && ( typeof(arrHideDownloadButtons) === 'undefined' || ! arrHideDownloadButtons[ intFileIndex ] ) ) { bolSimpleDownloadAllowed = true; } $jqSlideElem.append( '' ); $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( jqThumb ); if (!arrFileAttributes[ intFileIndex ][ 'hasCustomThumb' ]) { $('.gallery2__item__doc-wrapper', $jqSlideElem).append('

' + arrDisplayNames[intFileIndex] + '

'); } function updateDefaultDescriptionWidth() { var intDefaultWidth; $('.gallery2__item__base-width-on-two').each(function() { switch(this.tagName) { case 'IMG': intDefaultWidth = $( this ).outerWidth(); break; case 'DIV': var objBackground = getBackgroundSize(this); intDefaultWidth = objBackground.width; break; default: intDefaultWidth = $( this ).outerWidth(); break; } if(intDefaultWidth>=$('#gallery2__image-wrapper').width()) { intDefaultWidth=intDefaultWidth-20; } $(this).parent().parent().find('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width(intDefaultWidth); }); } updateDefaultDescriptionWidth(); $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( '' ); $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append(jqButtonContainer); break; case 'image': var strImageURL = 'https://' + arrFileHost[ intFileIndex ] + '/thumb_show.php?i=' + arrHashes[intFileIndex] + '&view&v=1&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925'; if (arrFeeDownloadPrice[intFileIndex] > 0 || currentFolderHasFeeDownload( intFileIndex ) ) { strImageURL += '&wm=103'; } if ( typeof( arrFileVersion ) != 'undefined' && typeof( arrFileVersion[ intFileIndex ] ) != 'undefined' && arrFileVersion[ intFileIndex ] > 0 ) { strImageURL += '&version=' + arrFileVersion[ intFileIndex ]; }var strHtml = '' +'' +'' + 'gamebaidoithuonglifestyle (17)' + '

' + '

' + '

You can buy this file or print-on-demand products:

' + '' + '' + '' + 'View products' + '' + '' + '

' + '

'; $jqSlideElem.append( strHtml ); var bolImageLoaded = false; var strImageFileHash = arrHashes[intFileIndex]; $( 'img', $jqSlideElem ).attr( 'src', strImageURL ).on( 'load', function(){ bolImageLoaded = true; $( this ).css( 'opacity', '1' ); $('#main_image_load-spinner_'+ strImageFileHash).hide(); $(this).attr( 'data-image-loaded', true ); var intImageWidth = $( 'img', $jqSlideElem ).width(); if(intImageWidth>=$('#gallery2__image-wrapper').width()) { intImageWidth=intImageWidth-20; } $('img', $jqSlideElem).siblings('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width( intImageWidth ); }).on('click', function (){ if($( this ).hasClass( "bx_allow_events" )) { if ( arrFeeDownloadPrice[intFileIndex] > 0 ) { if ( arrFileAttributes[ getItemIndex ( strCurrentFileHash ) ].hasProductSelling ) { $( this ).siblings(".print_or_buy_popup").toggle(); } else { if (bolIsOwner) { showSetPriceFormModal(strCurrentFileHash); } else { showBuyFileFormModal(strCurrentFileHash); } } } else { if ( arrFileAttributes[ getItemIndex ( strCurrentFileHash ) ].hasProductSelling ) { window.open( '/c/' + arrParentHashes[ getItemIndex ( strCurrentFileHash ) ] + '?h=' + strCurrentFileHash, '_blank' ); } } } else { $('#gallery2__content-wrapper').toggleClass( 'gallery__only_image' ); } }); setTimeout("var domImg=document.getElementById('main_image_"+ arrHashes[intFileIndex] +"'); if ( ! domImg.complete ) { $( domImg ).css( 'opacity', '0.6' );}", 300); break; case 'document': case 'code': case 'pdf_converted': var jqThumb; if ( arrFileAttributes[ intFileIndex ][ 'hasCustomThumb' ] ) { jqThumb = $( "

" ).css( 'background-image', 'url("/thumb.php?i=' + arrHashes[ intFileIndex ] + '&v=1")' ).addClass( 'gallery2__item__custom_thumb gallery2__item__base-width-on' ); if ( arrFeeDownloadPrice[intFileIndex] > 0 ) { if (bolIsOwner) { jqThumb.attr( 'onclick', 'showSetPriceFormModal(strCurrentFileHash)' ); } else { jqThumb.attr( 'onclick', 'showBuyFileFormModal(strCurrentFileHash)' ); } jqThumb.addClass( 'bx_allow_events' ); jqThumb.addClass( 'has_price' ); } } else { jqThumb = $( '' ).addClass( 'fa-5x fa ' + arrIconClass[intFileIndex] ); if ( typeof( arrIconSvg ) !== 'undefined' && arrIconSvg[ intFileIndex ] ) { jqThumb = $( 'gamebaidoithuonglifestyle (18)' ).attr('src', '/images/file_types_v2/' + arrIconSvg[ intFileIndex ]).addClass( 'gallery2__item__base-width-on ext-icon' ); } } var bolSimpleDownloadAllowed = false; if ( arrAllowDownload[ intFileIndex ] && arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) && ( typeof(bolHideDownloadButtons) === 'undefined' || ! bolHideDownloadButtons ) && ( typeof(arrHideDownloadButtons) === 'undefined' || ! arrHideDownloadButtons[ intFileIndex ] )) { bolSimpleDownloadAllowed = true; } $jqSlideElem.append( '' ); $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( jqThumb ); if (!arrFileAttributes[ intFileIndex ][ 'hasCustomThumb' ]) { $('.gallery2__item__doc-wrapper', $jqSlideElem).append('

' + arrDisplayNames[intFileIndex] + '

'); } var jqButtonContainer = $('

').css({'white-space': 'normal'}); jqButtonContainer.append('

' + arrDescriptions[intFileIndex] + '

'); if ( arrExtensions[ intFileIndex ] == 'pdf' || bolIsFileConvertableToPdf ) { var bolForbidDirectDownload = false; if ( typeof( arrForbidDirectDownload ) != 'undefined' && arrForbidDirectDownload[ intFileIndex ] == true ) { bolForbidDirectDownload = true; } if ( arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) && arrAllowDownload[ intFileIndex ] && browserSupportsCanvas() && ! bolForbidDirectDownload && arrSizesInBytes[ intFileIndex ] < 104857600 ) { ( function() { $( this ).attr( 'disabled', 'disabled' ); var $jqSlideElem = $( this ).closest( ".gallery2__item" ); var intFileIndex = $jqSlideElem.attr( 'id' ).split( "-" ).slice( -1 )[ 0 ]; $jqSlideElem.prepend( '

' + '

' + '' + '

' + '' + 'Wait while the preview is being created.
This will take longer for large files. Download to view the original.
' + '

' + '

' + '

' + '

' ); var strPdfSrc; if ( bolIsFileConvertableToPdf ) { var strDateModified = ( typeof arrDatesModified != 'undefined' ? arrDatesModified[ intFileIndex ] : ( typeof arrModDate != 'undefined' ? arrModDate[ intFileIndex ] : '' ) ); strPdfSrc = 'https://' + arrFileHost[ intFileIndex ] + '/api/file/get_thumb_pdf.php?i=' + arrHashes[ intFileIndex ] + '&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925&dm=' + strDateModified + '&v=102&n=' + arrDisplayNames[ intFileIndex ] + '.pdf'; } else { strPdfSrc = 'https://' + arrFileHost[ intFileIndex ] + '/down.php?pdf=1&truemimetype=1&i=' + arrHashes[ intFileIndex ] + '&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925&n=' + arrDisplayNames[ intFileIndex ]; } // There is an issue if user on mobile Chrome requests desktop version, User-Agent becomes similar let strChromeDesktopRegex = /^Mozilla\/5\.0\s+\(.*\)\s+AppleWebKit\/\d+\.\d+\s+\(KHTML,\s+like\s+Gecko\)\s+Chrome\/\d+\.\d+\.\d+\.\d+\s+Safari\/\d+\.\d+$/; if ( strChromeDesktopRegex.test( navigator.userAgent ) && arrExtensions[ intFileIndex ] === 'pdf' ) { var strDocumentIframeSource = encodeURI( strPdfSrc ) + '&view'; } else { var strDocumentIframeSource = '/js/pdfjs-v4/web/viewer.html#' + encodeURI( strPdfSrc ); } $.ajax( { type: "GET", url: strPdfSrc, success: function() { $( 'iframe', $jqSlideElem ) .attr( 'src', strDocumentIframeSource ) .addClass( 'gallery2__item__base-width-on' ) .css( { 'height': function() { return '100%'; } } ) .on( 'load', function () { if ( ! bolSimpleDownloadAllowed ) { $( this ).contents().find( '#print' ).hide(); $( this ).contents().find( '#download' ).hide(); } } ); } , error: function(data) { var stErrorText = 'Sorry, we were unable to create file preview. Please try again by refreshing the page or contact support@files.fm. You can download the file to view it.'; if ( data.status == 405 ) { stErrorText = 'There is no preview available for this file. Download the file to view it.'; } $( 'iframe', $jqSlideElem ).replaceWith( '

' + '' + '

' + stErrorText + '

' + '

' ); $( '.gallery2__item__msg_has_no_preview' ) .addClass( 'gallery2__item__base-width-on' ) .css( { 'height': function() { return '100%'; } } ); $( '.gallery2__item__iframe-loading', $jqSlideElem ).hide(); } } ); } ).apply( $jqSlideElem ); } } else if ( [ 'txt', 'csv' ].indexOf( arrExtensions[ intFileIndex ] ) !== -1 && arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) && arrAllowDownload[ intFileIndex ] ) { var fnLoadIframe = function () { $( this ).attr( 'disabled', 'disabled' ); var $jqSlideElem = $( this ).closest( ".gallery2__item" ); var intFileIndex = $jqSlideElem.attr( 'id' ).split( "-" ).slice( -1 )[ 0 ]; $jqSlideElem.prepend( '

' + arrDisplayNames[ intFileIndex ] + '

' + arrDescriptions[intFileIndex] + '

' ); arrIframeTimers[ intFileIndex ] = setTimeout( function () { $( '#gallery2__item__iframe-wrapper__' + intFileIndex ).hide(); }, 30000 ); $( 'iframe', $jqSlideElem ) .attr( 'src', 'https://' + arrFileHost[ intFileIndex ] + '/down.php?i=' + arrHashes[ intFileIndex ] + '&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925&plain_text&view&pv=1' ) .attr( 'onload', 'clearTimeout( arrIframeTimers[ ' + intFileIndex + ' ] );' ) .css({ 'height': function(){ return '100%'; }, "background": "white" }) .addClass( 'gallery2__item__base-width-on' ) }; fnLoadIframe.apply( $jqSlideElem ); } // Highlighting code syntax else if ( [ 'asp','asm','c','h','cc','m','cpp','css','html','java','jsp','js','json','php','pl','py','rb','script','sh','vb','xml','ini' ].indexOf( arrExtensions[ intFileIndex ] ) !== -1 // Excluded extensions that highlight.js is not able to recognize and highlight properly && [ 'asp', 'asm', 'm', 'script' ].indexOf( arrExtensions[ intFileIndex ] ) === -1 && arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) && arrAllowDownload[ intFileIndex ] ) { var fnLoadCode = function () { $( this ).attr( 'disabled', 'disabled' ); var $jqSlideElem = $( this ).closest( ".gallery2__item" ); var intFileIndex = $jqSlideElem.attr( 'id' ).split( "-" ).slice( -1 )[ 0 ]; $jqSlideElem.prepend( '

' + '

' + '' + '' + '

' + '

' + '

' + '

' + arrDisplayNames[ intFileIndex ] + '

' + '

' + '

' + '

' + arrDescriptions[ intFileIndex ] + '

' + '

' + '

' ); $.ajax( { type: 'GET', url: 'https://' + arrFileHost[ intFileIndex ] + '/down.php?i=' + arrHashes[ intFileIndex ] + '&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925&code_highlighter&plain_text&view&pv=1', success: function ( data ) { var jqCodeContainer = $( '.modal_gallery_code_container', $jqSlideElem ); var jqCodeHighlightElem = $( 'pre code', jqCodeContainer ); jqCodeHighlightElem .text( data ) .addClass( 'gallery2__item__base-width-on' ); // Forcing helper classname for highlight.js to properly detect syntax let strHljsCodeClass; switch ( arrExtensions[ intFileIndex ] ) { case 'js': strHljsCodeClass = 'language-javascript'; break; case 'html': strHljsCodeClass = 'language-xml'; break; case 'cc': case 'c': case 'h': strHljsCodeClass = 'language-cpp'; break; case 'jsp': strHljsCodeClass = 'language-java'; break; case 'pl': strHljsCodeClass = 'language-perl'; break; case 'py': strHljsCodeClass = 'language-python'; break; case 'rb': strHljsCodeClass = 'language-ruby'; break; case 'sh': strHljsCodeClass = 'language-bash'; break; case 'vb': strHljsCodeClass = 'language-vbnet'; break; case 'php': case 'cpp': case 'css': case 'java': case 'json': case 'xml': case 'ini': strHljsCodeClass = 'language-' + arrExtensions[ intFileIndex ]; break; } /* If new extension has been added to FILE_TYPE_CODE, highlight.js won't fail, it will try to determine to which file type the syntax looks most likely (out of available types in compiled highlight.min.js script) */ if ( typeof( strHljsCodeClass ) !== 'undefined' ) { jqCodeHighlightElem.addClass( strHljsCodeClass ); } hljs.highlightElement( jqCodeHighlightElem[ 0 ] ); if ( ! false ) { jqCodeHighlightElem.addClass( 'bx_allow_events' ); $( '*', jqCodeHighlightElem ).addClass( 'bx_allow_events' ); } jqCodeContainer.show(); }, error: function () { $( '#gallery2__item__code-wrapper__' + intFileIndex ).hide(); }, } ); }; fnLoadCode.apply( $jqSlideElem ); } else { if ( arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) && arrSizesInBytes[ intFileIndex ] < 50 * 1024 * 1024 && arrUploadPassword[ intFileIndex ] == '' && arrAccessType[ intFileIndex ] == 'LINK' ) { var fnLoadIframe = function () { $( this ).attr( 'disabled', 'disabled' ); var $jqSlideElem = $( this ).closest( ".gallery2__item" ); var intFileIndex = $jqSlideElem.attr( 'id' ).split( "-" ).slice( -1 )[ 0 ]; $jqSlideElem.prepend( '

' + '

' + '' + '' + '

' + '

' + '

' ); arrIframeTimers[ intFileIndex ] = setTimeout( function () { $( '#gallery2__item__iframe-wrapper__' + intFileIndex ).hide(); }, 30000 ); if ( arrExtensions[intFileIndex] == "dwg" || arrExtensions[intFileIndex] == "dxf" ) { $.ajax( { type: "GET", url: "/api/embed_urls.php", data: { 'i': arrHashes[ intFileIndex ] }, success: function ( data ) { data = JSON.parse( data ); $( 'iframe', $jqSlideElem ) .attr( 'src', 'https://sharecad.org/cadframe/load?url='+data[ 'path_access_url' ] ) .attr( 'onload', 'clearTimeout( arrIframeTimers[ ' + intFileIndex + ' ] );' ); } } ); } else if ( arrExtensions[intFileIndex] == "rtf" || arrSizesInBytes[ intFileIndex ] > 10 * 1024 * 1024 ) { $( 'iframe', $jqSlideElem ) .attr( 'src', 'https://docs.google.com/viewerng/viewer?embedded=true&url=https://api.files.fm/down.php?i=' + arrHashes[ intFileIndex ] + '&gpv=1' ) .attr( 'onload', 'clearTimeout( arrIframeTimers[ ' + intFileIndex + ' ] );' ); } else { $( 'iframe', $jqSlideElem ) .attr( 'src', 'https://view.officeapps.live.com/op/embed.aspx?src=https://api.files.fm/down.php?i=' + arrHashes[ intFileIndex ] + '&gpv=1' ) .attr( 'onload', 'clearTimeout( arrIframeTimers[ ' + intFileIndex + ' ] );' ); } $( 'iframe', $jqSlideElem ) .css({ 'height': function(){ return '100%'; } }) .addClass( 'gallery2__item__base-width-on' ) }; var jqPreviewButton = $( '' ).attr( { 'href': 'javascript:void(0);', 'title': 'View', 'class': 'gallery2__item__doc-wrapper__download_button gallery2__save_button gallery2__item__doc-wrapper__download_button gallery2__preview_button' } ).html( 'Preview this file' ) .click( function() { if ( arrExtensions[intFileIndex] == "dwg" || arrExtensions[intFileIndex] == "dxf" ) { showSignIn(); } else { fnLoadIframe.apply( $jqSlideElem ); var jqDownloadButton = $( '' ).attr( { 'href': 'javascript:void(0);', 'onclick': 'modalGalleryDownloadFileBtn( "' + arrHashes[ intFileIndex ] + '" )', 'title': 'Download', 'class': 'gallery2__item__doc-wrapper__download_button gallery2__save_button' } ).html( 'Download original file' ); $( '.gallery2__item__information-wrapper', $jqSlideElem ).append( jqDownloadButton ); } } ) $( '.gallery2__item__information-wrapper', $jqSlideElem ).append( jqPreviewButton ); } } $(".gallery2__item__custom_thumb" ).each(function() { var objBackground = getBackgroundSize(this); if(objBackground.width>=$('#gallery2__image-wrapper').width()) { objBackground.width=objBackground.width-20; } $(this).siblings('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width( objBackground.width ); $(this).parent().siblings('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width( objBackground.width ); }); $("img").each(function() { var intImageWidth = $(this).width(); if(intImageWidth>=$('#gallery2__image-wrapper').width()) { intImageWidth=intImageWidth-20; } $(this).siblings('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width( intImageWidth ); }); $("iframe", ".gallery2__item__iframe-wrapper" ).each(function() { var intIframeWidth = $(this).width(); if(intIframeWidth>=$('#gallery2__image-wrapper').width()) { intIframeWidth=intIframeWidth-20; } $(this).siblings('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width( intIframeWidth ); }); $( '.modal_gallery_code_container', '.gallery2__item__code-wrapper' ).each( function () { let intCodeContainerWidth = $( this ).width(); if( intCodeContainerWidth >= $( '#gallery2__image-wrapper' ).width() ) { intCodeContainerWidth = intCodeContainerWidth - 20; } $( this ).siblings( '.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper' ).width( intCodeContainerWidth ); } ); break; case 'video': var bolThisVideoUseEmbedPlayer = false; var strHtml = ''; strHtml += ''; strHtml += '

'; if ( useEmbedPlayer( intFileIndex ) ) { bolThisVideoUseEmbedPlayer = true; } strHtml += "

"; if ( !arrFileAttributes[ intFileIndex ][ 'canDownload' ] && ( arrFileAttributes[ intFileIndex ][ 'isForSale' ] || currentFolderHasFeeDownload( intFileIndex ) ) && !arrFileAttributes[ intFileIndex ][ 'hasPreviewVideo' ] ) { $jqSlideElem.append( '' ); $jqSlideElem.append( 'gamebaidoithuonglifestyle (19)' ); var objVideoPlayBuyButton = $( '' ); if ( bolIsOwner ) { objVideoPlayBuyButton.attr( 'onclick', 'showSetPriceFormModal( strCurrentFileHash )' ); } else if ( currentFolderHasFeeDownload( intFileIndex ) ) { if ( typeof arrParentHashes != 'undefined' ) { objVideoPlayBuyButton.attr( 'onclick', 'showBuyFileFormModal( arrParentHashes[ getItemIndex ( strCurrentFileHash ) ], "folder" )' ); } else if ( typeof strUploadHash != 'undefined' ) { objVideoPlayBuyButton.attr( 'onclick', 'showBuyFileFormModal( strUploadHash, "folder" )' ); } } else { objVideoPlayBuyButton.attr( 'onclick', 'showBuyFileFormModal( strCurrentFileHash )' ); } $jqSlideElem.append( objVideoPlayBuyButton ); break; } if ( bolThisVideoUseEmbedPlayer ) { var strAutoload = 'off'; if ( arrExtensions[ intFileIndex ] == 'mp4' ) { strAutoload = 'on'; } strHtml += '

'; strHtml += '

'; } else { var strVideoSrc = 'https://' + arrFileHost[ intFileIndex ] + '/thumb_video/' + arrHashes[ intFileIndex ] + '' + strHttpCacheKey + '.mp4?v=1723099830&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925'; if ( ( arrExtensions[ intFileIndex ] == 'mp4' || arrMOVsWithH264Hashes.includes( arrHashes[ intFileIndex ] ) ) // If the video does not have a preview (0) or preview is being generated (2) && [ 0, 2 ].includes( arrFileAttributes[ intFileIndex ][ 'hasVideoThumb' ] ) && arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) ) { // If the video does not have a preview if ( ! arrFileAttributes[ intFileIndex ][ 'hasVideoThumb' ] ) { // Send a request with an empty callback just to trigger generation of preview video $.get( strVideoSrc, function() {} ); } strVideoSrc = 'https://' + arrFileHost[ intFileIndex ] + '/down.php?i=' + arrHashes[ intFileIndex ] + '&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925&pv=1&' + strHttpCacheKey + '.mp4'; } strHtml += ''; strHtml += '

'; strHtml += "

"; strHtml += "

"; $jqSlideElem.append( strHtml ); if ( arrFileTypes[ intFileIndex ] === 'video' ) { if ( !useEmbedPlayer( intFileIndex ) ) { initVideoPlayer( intFileIndex ); } } break; case 'audio': if ( arrAllowDownload[ intFileIndex ] || ( false && arrFileAttributes[ intFileIndex ].hasPreviewVideo ) || arrFileAttributes[ intFileIndex ].readOnly || arrFileAttributes[ intFileIndex ].hasPreviewVideo ) { var strAllHashes = ''; for ( var strHash in arrHashes ) { strAllHashes += ',' + strHash; } if( objAudioPlayer === null || ( objAudioPlayer.getAllUploadFileHashes() !== strAllHashes ) ) { if ( objAudioPlayer !== null ) { objAudioPlayer.destroy(); objAudioPlayer = null; } objAudioPlayer = new AudioPlayer(); objAudioPlayer.loadTracksFromGlobalArrays(); if ( objMainShareParams != null && typeof( objMainShareParams['all_files'] ) !== 'undefined') { if ( typeof PublicProfile != 'undefined' && PublicProfile.openFolderDisplayName != '' ) { objAudioPlayer.setPlayListTitle( PublicProfile.openFolderDisplayName ); } else if ( typeof PublicProfile != 'undefined' && PublicProfile.strProfileName != '' ) { objAudioPlayer.setPlayListTitle( PublicProfile.strProfileName ); } else { objAudioPlayer.setPlayListTitle( strFolderName ); } } objAudioPlayer.setCurrentTrackByHash( arrHashes[ intFileIndex ] ); objAudioPlayer.setAllUploadFileHashes( strAllHashes ); objAudioPlayer.setIsPlayerForOneFile( arrHashes.length == 1 ); objAudioPlayer.getElem().addEventListener( 'audioTrackLoaded', function ( data ) { var hash = data.detail.strHash; if( arrHashes.indexOf( hash ) !== -1 && arrHashes[ intCurrentFileIndex ] !== hash ) { galleryChangeLocation ( getItemLink( hash ) ); } } ); objAudioPlayer.getElem().addEventListener( 'audioTrackLikeChange', function ( data ) { var hash = data.detail.track.strHash; var bolState = data.detail.state; var intFileIdx; if ( strCurrentFileHash === hash ) { intFileIdx = intCurrentFileIndex; } else { for ( var i in arrHashes ) { if ( arrHashes.hasOwnProperty( i ) && arrHashes[ i ] === hash ) { intFileIdx = +i; break; } } } bolState ? arrVoteCounts[ intFileIdx ]++ : arrVoteCounts[ intFileIdx ]--; arrHasVoted[ intFileIdx ] = bolState ? 1 : 0; galleryUpdateVoteCount(); } ); objAudioPlayer.getElem().addEventListener( 'audioTrackEnded', function ( data ) { if ( bolGalleryIsVisible ) { var intNextSlideIndex = intNextIndex; if(intNextIndex == null || isNaN( intNextIndex ) && arrHashes[0] != null) { intNextSlideIndex = getItemIndex ( arrHashes[0] ); } if ( intNextSlideIndex != null && !isNaN( intNextSlideIndex ) ) { if (strSlideshowInterval === 'reset') { objAudioPlayer._isSlideshowOn = false; galleryChangeLocation ( getItemLink ( arrHashes[intNextSlideIndex] ) ); } } } } ); } $jqSlideElem.append( "" ); var jqItemAudioWrapper = $( "" ); jqItemAudioWrapper.appendTo( $jqSlideElem ); objAudioPlayer.appendTo( jqItemAudioWrapper ); } else { var jqThumb = $( '' ).addClass( 'fa-5x fa ' + arrIconClass[intFileIndex] ); if ( typeof( arrIconSvg ) !== 'undefined' && arrIconSvg[ intFileIndex ] ) { jqThumb = $( 'gamebaidoithuonglifestyle (20)' ).attr('src', '/images/file_types_v2/' + arrIconSvg[ intFileIndex ]).addClass('ext-icon'); } $jqSlideElem.append( '' ); $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( jqThumb ); $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( '

' + arrDisplayNames[intFileIndex] + '

' ); if( arrDescriptions[intFileIndex] ) { $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( '

' + arrDescriptions[intFileIndex] + '

'); } } function updateAudioDescriptionWidth() { $('i, .audio_player ').each(function() { var intVideoWidth = $(this).outerWidth(); if(intVideoWidth>=$('#gallery2__image-wrapper').width()) { intVideoWidth=intVideoWidth-20; } $(this).parent().find('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width(intVideoWidth); }); } updateAudioDescriptionWidth(); break; case 'image-raw': // Main container for file info/buttons/etc. var $jqMainContainerHelper = $( '' ); var $jqMainContainer = $( '' ); // Icon container var $jqIconContainer = $( '' ); // File type icon var $jqIcon = $(''); if ( typeof( arrIconSvg ) !== 'undefined' && arrIconSvg[ intFileIndex ] ) { $jqIcon = $( 'gamebaidoithuonglifestyle (21)' ).attr('src', '/images/file_types_v2/' + arrIconSvg[ intFileIndex ]).addClass('ext-icon'); } $jqIconContainer.append($jqIcon); // Loading icon var $jqLoadingIcon = $('').hide(); $jqIconContainer.append($jqLoadingIcon); // Error icon var $jqErrorIcon = $('').hide(); $jqIconContainer.append($jqErrorIcon); // Add the icon container to the main container $jqMainContainer.append( $jqIconContainer ); // Filename var $jqFileName = $( '

' + arrDisplayNames[ intFileIndex ] + '

' ); $jqMainContainer.append( $jqFileName ); // A container for buttons/actions var $jqButtonContainer = $('').css({'white-space': 'normal'}); // Download button var $jqDownloadButton = $( '' ).attr( { 'href': 'javascript:void(0);', 'onclick': 'modalGalleryDownloadFileBtn( "' + arrHashes[ intFileIndex ] + '" )', 'title': 'Download', 'class': 'gallery2__item__doc-wrapper__download_button gallery2__save_button' } ).html( 'Download original file' ); // Add the download button to the button container $jqButtonContainer.append( $jqDownloadButton ); // Holds the load image timeout var intLoadImageTimeout; // Holds the image var $jqImg; var fnLoadImageFailed = function() { clearTimeout(intLoadImageTimeout); $jqImg.remove(); $jqIcon.hide(); $jqErrorIcon.show(); $jqLoadingIcon.hide(); } var fnLoadImageSucceeded = function() { clearTimeout(intLoadImageTimeout); $jqMainContainer.empty().append($jqImg); } var fnLoadImage = function() { $jqPreviewButton.hide(); $jqIcon.hide(); $jqErrorIcon.hide(); $jqLoadingIcon.show(); var strImageURL = 'https://'+ arrFileHost[ intFileIndex ] +'/thumb_show.php?i=' + arrHashes[intFileIndex] + '&view&v=1&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925'; if (arrFeeDownloadPrice[intFileIndex] > 0 || currentFolderHasFeeDownload( intFileIndex ) ) { strImageURL += '&wm=103'; } if ( typeof( arrFileVersion ) != 'undefined' && typeof( arrFileVersion[ intFileIndex ] ) != 'undefined' && arrFileVersion[ intFileIndex ] > 0 ) { strImageURL += '&version=' + arrFileVersion[ intFileIndex ]; } $jqImg = $('gamebaidoithuonglifestyle (22)').attr('src', strImageURL); intLoadImageTimeout = setTimeout(function() { fnLoadImageFailed(); }, 30000); $jqImg.on('load', function() { if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) { fnLoadImageFailed(); } else { fnLoadImageSucceeded(); } }); } var $jqPreviewButton = $( '' ); $jqPreviewButton.attr( { 'href': 'javascript:void(0);', 'title': 'Download', 'class': 'gallery2__item__doc-wrapper__download_button gallery2__save_button gallery2__item__doc-wrapper__download_button gallery2__preview_button' } ); $jqPreviewButton.css( "marginLeft", "0px" ); $jqPreviewButton.html( 'Preview this file' ); $jqPreviewButton.click( function() { fnLoadImage(); } ); $jqButtonContainer.append("
"); // Add the preview button to the button container $jqButtonContainer.append( $jqPreviewButton ); // Add the buttons container to the main item info container $jqMainContainer.append($jqButtonContainer); // Add the helper and the main container to the DOM $jqSlideElem.append( $jqMainContainerHelper ); $jqSlideElem.append( $jqMainContainer ); break; case 'url' : { var jqThumb; if ( arrFileAttributes[ intFileIndex ][ 'hasCustomThumb' ] ) { jqThumb = $( "

" ).css({ 'background-image': 'url("/thumb.php?i=' + arrHashes[ intFileIndex ] + '&v=1")', 'height': function(){ } }) .addClass( 'gallery2__item__custom_thumb gallery2__item__base-width-on' ); } else { jqThumb = $( '' ).addClass( 'fa-5x fa ' + arrIconClass[intFileIndex] ); if ( typeof( arrIconSvg ) !== 'undefined' && arrIconSvg[ intFileIndex ] ) { jqThumb = $( 'gamebaidoithuonglifestyle (23)' ).attr('src', '/images/file_types_v2/' + arrIconSvg[ intFileIndex ]).addClass( 'gallery2__item__base-width-on ext-icon' ); } } if ( arrFeeDownloadPrice[intFileIndex] > 0 ) { if (bolIsOwner) { jqThumb.attr( 'onclick', 'showSetPriceFormModal(strCurrentFileHash)' ); } else { jqThumb.attr( 'onclick', 'showBuyFileFormModal(strCurrentFileHash)' ); } jqThumb.addClass( 'bx_allow_events' ); jqThumb.addClass( 'has_price' ); } $jqSlideElem.append( '' ); $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( jqThumb ); var jqButtonContainer = $('

').css({'white-space': 'normal'}); if ( arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) ) { var $jqSlideElem = $( $jqSlideElem ).closest( ".gallery2__item" ); var intFileIndex = $jqSlideElem.attr( 'id' ).split( "-" ).slice( -1 )[ 0 ]; $jqSlideElem.prepend( '

' + arrDescriptions[intFileIndex] + '

' ); arrIframeTimers[ intFileIndex ] = setTimeout( function () { $( '#gallery2__item__iframe-wrapper__' + intFileIndex ).hide(); }, 30000 ); $.get( 'https://'+ arrFileHost[ intFileIndex ] + '/down.php?i=' + arrHashes[ intFileIndex ] + '&gpv=1&view=1&truemimetype=1&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925', function( strFileContent ) { $( 'iframe', $jqSlideElem ) .attr( 'src', strFileContent ) .attr( 'onload', 'clearTimeout( arrIframeTimers[ ' + intFileIndex + ' ] );' ) .css({ 'height': function() { if ( arrDescriptions[intFileIndex] ) { return 'calc( 100% - 60px )'; } else { return 'calc( 100% - 60px )'; } }, "background": "white", }) } ); } else { $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( '

' + arrDisplayNames[intFileIndex] + '

' ); $( '.gallery2__item__doc-wrapper', $jqSlideElem ).append( '

' + arrDescriptions[intFileIndex] + '

'); } if( !arrDescriptions[intFileIndex] ) { $('.gallery2__item__desc-wrapper', $jqSlideElem).hide(); } function updateURLDescriptionWidth() { $(".gallery2__item__base-width-on" ).each(function() { switch(this.tagName) { case 'IMG': intElementWidth = $( this ).width(); break; case 'DIV': var objBackground = getBackgroundSize(this); intElementWidth = objBackground.width; break; case 'IFRAME': intElementWidth = $( this ).width(); break; default: intElementWidth = $( this ).width(); break; } if(intElementWidth>=$('#gallery2__image-wrapper').width()) { intElementWidth=intElementWidth-20; } $(this).siblings('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width( intElementWidth ); }); } updateURLDescriptionWidth(); break; } } if ( arrFileTypes[ intCurrentFileIndex ] !== 'audio' ) { var jqPreviewButton = $( '' ).attr( { 'href': 'javascript:void(0);', 'title': function() { if (bolIsOwner) { return 'Sell'; } else { return 'Buy'; } }, 'class': 'gallery2__buy_button', 'style': "display:none;" } ).html( function(){ if ( arrFeeDownloadPrice[ intCurrentFileIndex ] ) { return 'Buy (' + arrFeeDownloadPrice[ intCurrentFileIndex ] + ' $)'; } else { return 'Buy'; } } ) .click( function() { if (bolIsOwner) { return showSetPriceFormModal(strCurrentFileHash); } else { return showBuyFileFormModal(strCurrentFileHash); } } ) $( '.gallery2__item__information-wrapper', $jqSlideElem ).append( jqPreviewButton ); } if ($('.gallery2__item__information-wrapper', $jqSlideElem).find('.gallery2__preview_button').length<1) { var jqDownloadButton = $( '' ).attr( { 'href': 'javascript:void(0);', 'onclick': 'modalGalleryDownloadFileBtn( "' + arrHashes[ intFileIndex ] + '" )', 'title': 'Download', 'class': 'gallery2__item__doc-wrapper__download_button gallery2__save_button' } ).html( 'Download original file' ); $( '.gallery2__item__information-wrapper', $jqSlideElem ).append( jqDownloadButton ); } $('a', $jqSlideElem).addClass( 'bx_allow_events' ); $('a', $jqSlideElem).find( "*" ).addClass( 'bx_allow_events' ); $('.gallery2__video_downloadbutton', $jqSlideElem).find( "*" ).addClass( 'bx_allow_events' ); $jqSlideElem.addClass( 'content_ready' ); } function adjustDescriptionWidth() { var intElementWidth; $(".gallery2__item__base-width-on").each(function() { switch(this.tagName) { case 'IMG': case 'IFRAME': intElementWidth = $( this ).width(); break; case 'DIV': var objBackground = getBackgroundSize(this); intElementWidth = objBackground.width; break; default: intElementWidth = $( this ).width(); break; } if(intElementWidth>=$('#gallery2__image-wrapper').width()) { intElementWidth=intElementWidth-20; } $(this).siblings('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width( intElementWidth ); }); $('.gallery2__item__base-width-on-two').each(function() { switch(this.tagName) { case 'IMG': intElementWidth = $( this ).outerWidth(); break; case 'DIV': var objBackground = getBackgroundSize(this); intElementWidth = objBackground.width; break; default: intElementWidth = $( this ).outerWidth(); break; } if(intElementWidth>=$('#gallery2__image-wrapper').width()) { intElementWidth=intElementWidth-20; } $(this).parent().parent().find('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width(intElementWidth); }); $('.vjs-poster, .filesfm__embed_player__container, .audio_player').each(function() { intElementWidth = $( this ).outerWidth(); if(intElementWidth>=$('#gallery2__image-wrapper').width()) { intElementWidth=intElementWidth-20; } $(this).parent().parent().find('.gallery2__item__desc-wrapper, .gallery2__item__information-wrapper').width(intElementWidth); }); } adjustDescriptionWidth(); function resizeend() { adjustDescriptionWidth(); } var intTimer; window.addEventListener('resize', function() { clearTimeout(intTimer); intTimer = setTimeout(resizeend, 300); adjustDescriptionWidth(); checkThumbStripArrows(); }); function registerEmbedPlayerFileEventCallback( strFileHash, fncCallback ) { var intEmbedPlayerFileIndex = getItemIndex ( strFileHash ); if ( intEmbedPlayerFileIndex !== null && typeof fncCallback === 'function' ) { objEmbedPlayerFileEventCallback[ intEmbedPlayerFileIndex ] = fncCallback; } } function callEmbedPlayerFileEventCallback( strEventCode, intFileIndex ) { if ( typeof( objEmbedPlayerFileEventCallback[intFileIndex] ) === 'function' ) { objEmbedPlayerFileEventCallback[intFileIndex]( strEventCode ); } } function galleryOpenPrevItem() { if ( intPreviousIndex != null && !isNaN( intPreviousIndex )){ galleryChangeLocation ( getItemLink ( arrHashes[intPreviousIndex] ) ); adjustDescriptionWidth();}} function galleryOpenNextItem() { if ( bolGalleryIsVisible && intNextIndex != null && !isNaN( intNextIndex )){ galleryChangeLocation ( getItemLink ( arrHashes[intNextIndex] ) ); adjustDescriptionWidth();}}var resThumbLoadTimeout; function gallerySelectThumb( intItemIndex ) {if ( bolGalleryIsVisible && bolGalleryInitalizedState < 1 ){// If dom not loaded yet, wait for it to load.setTimeout('gallerySelectThumb( '+ intItemIndex +' )', 100);return;}if (jqThumbViewport == null){jqThumbViewport = $('#gallery2__thumb-strip');}var intViewportWidthPx = jqThumbViewport.width();if (jqThumbContainer == null){jqThumbContainer = $('#gallery2__thumb-strip__inner');}var jqThumb = $('A.thumb_' + arrHashes[intItemIndex], jqThumbContainer);function onThumbReady() { var intThumbPossitionLeftPx = jqThumb.position().left; // If scrollable on mobile if (jqThumbViewport.css('overflow-x')=='auto') { var intThumbPossitionLeftPx = jqThumb[0].offsetLeft; var intThumbOffsetLeftPx = galleryCalculateOffset(jqThumb[0]).left; var intScrollLeft = jqThumbViewport.scrollLeft(); var jqThImg = $('IMG', jqThumb); var intThisThumbWidth = intThumbWidth; if ( intThisThumbWidth < intThumbWidth ) intThisThumbWidth = intThumbWidth; if ( intThumbOffsetLeftPx + intScrollLeft > intViewportWidthPx + intScrollLeft - intThisThumbWidth ) { jqThumbViewport.scrollLeft( intThumbOffsetLeftPx + intScrollLeft - intViewportWidthPx + intThisThumbWidth ); } else if (intThumbOffsetLeftPx < 0) { jqThumbViewport.scrollLeft( intThumbPossitionLeftPx ); } } else { var intThumbOffsetLeftPx = jqThumb.offset().left; var jqThumbStrip = $('#gallery2__thumb-strip'); var jqThumbStripInner = $('#gallery2__thumb-strip__inner'); var intThumbWidthSum = 0; $('A', jqThumbStripInner).each(function (){ intThumbWidthSum += $(this).width(); }); var bolThumbsAreOutside = false; if ( jqThumbStrip.width() <= intThumbWidthSum ) { bolThumbsAreOutside = true; } if ( $( '#gallery2' ).hasClass( 'gallery__sidebar-visible' ) ) { intThumbOffsetLeftPx = intThumbOffsetLeftPx -360; } if ( ! bolThumbsAreOutside ) { jqThumbContainer.css({'left': '0px'}); } else { // If outside viewport // If outside to the right if ( intThumbOffsetLeftPx < 0 ) { var jqThImg = $('IMG', jqThumb); var intThisThumbWidth = intThumbWidth; if ( intThisThumbWidth < intThumbWidth ) intThisThumbWidth = intThumbWidth; var intSetLeftPx = (-1*intThumbPossitionLeftPx + intThisThumbWidth ); if (intSetLeftPx > 0) { jqThumbContainer.css({'left': 0}); } else { jqThumbContainer.css({'left': intSetLeftPx + 'px'}); }; } // else - outside to left else if ( intThumbOffsetLeftPx > intViewportWidthPx - 360 ) { var jqThImg = $('IMG', jqThumb); var intThisThumbWidth = intThumbWidth; if ( intThisThumbWidth < intThumbWidth ) intThisThumbWidth = intThumbWidth; var intSetLeftPx = -1*intThumbPossitionLeftPx + intViewportWidthPx - intThisThumbWidth - intThumbWidth; if (parseInt($('#gallery2__image-wrapper').width()) - parseInt($('#gallery2__thumb-strip__inner').width()) > intSetLeftPx) { jqThumbContainer.css({'left': parseInt($('#gallery2__image-wrapper').width()) - parseInt($('#gallery2__thumb-strip__inner').width())}) } else { jqThumbContainer.css({'left': intSetLeftPx + 'px'}); }; } } checkThumbStripArrows(); } $('A.active', jqThumbContainer).removeClass('active'); jqThumb.addClass('active'); setTimeout("checkThumbStripArrows()", 500); setTimeout("galleryLazyloadRecalc()", 500); } if ( $('IMG', jqThumb).length===0 || ( $('IMG', jqThumb)[0].complete && $('IMG', jqThumb).attr('src')===$('IMG', jqThumb).attr('data-original') ) ) { onThumbReady(); } else { $('IMG', jqThumb).on('load', function (){ if ($(this).attr('src') === $(this).attr('data-original')) { onThumbReady(); } }); var intElementIndex = jqThumb.index(); if (jqThumbViewport.css('overflow-x') == 'auto') { jqThumbViewport.scrollLeft(intElementIndex * intThumbWidth); } else { jqThumbContainer.css({'left': (-1 * (intElementIndex + 2) * intThumbWidth) + 'px'}); } galleryLazyloadRecalc(); setTimeout( function (){ galleryLazyloadRecalc(); }, 1000); setTimeout( function (){ galleryLazyloadRecalc(); }, 5000); }} function closeGallery(strScrollHash) { if ( ! bolGalleryIsVisible ) return; $( 'html' ).css( 'overflow', 'auto' ); $( '#gallery2' ).fadeOut( 'fast' ); $('#gallery_panzoomdiv').css('display', 'none'); $('#gallery2__content-wrapper').removeClass( 'gallery__only_image' ); $('#gallery2__content-wrapper').removeClass( 'gallery__is_image' ); exitSlideshow(); if(bolPopupOnlyGallery) { hideModal( 'popup_form' ); } if ( strGalleryCloseHashtag ) { window.location.hash = strGalleryCloseHashtag; }else{ if ( window.location.href.indexOf( "filebrowser" ) !== -1 ) { var intIndexOfView = window.location.hash.indexOf(';/view/'); if (intIndexOfView == -1) { intIndexOfView = window.location.hash.indexOf('/view/'); if (intIndexOfView == -1) { intIndexOfView = window.location.hash.length; } } history.replaceState( null, '', ('' + window.location).split('#')[0] + window.location.hash.slice(0, intIndexOfView)) } else { }} bolGalleryIsVisible = false; strCurrentFileHash = null;stopActiveContent();if ($('#share_popup').is(":visible")) { hideSharePopup(); } if ( typeof window.FileEmbedPopup !== 'undefined' ) { window.FileEmbedPopup.hidePopup(); } if ( strActiveCommentsEntityHash != "" ) { ChatFM.resetChat(); strActiveCommentsEntityHash = ""; } if ( window.location.pathname.indexOf('/u/') === -1 ) { history.replaceState(null, '', '/' + strScriptURL + '/u/' + PublicProfile.openFolderHash); document.title = ( PublicProfile.openFolderDisplayName ? PublicProfile.openFolderDisplayName + ' – ' : '' ) + 'gamebaidoithuonglifestyle' ; } if($("#item_"+strScrollHash).length) { if ( window.location.href.indexOf( "filebrowser" ) !== -1 ) { var myElem = document.getElementById("item_"+strScrollHash); let topOffset = myElem.getBoundingClientRect().top; while (myElem != document.documentElement) { myElem = myElem.parentElement; topOffset += myElem.scrollTop; } $(".main_content").animate({scrollTop: topOffset - $(".main_content").height() / 2}); } else { $(document.body).animate({ scrollTop: $("#item_"+strScrollHash).offset().top - window.innerHeight / 2 }, 1000); } $("#item_"+strScrollHash).addClass('active-hover'); } } function nextSlide() { if ( bolGalleryIsVisible ) { var intNextSlideIndex = intNextIndex; if(intNextIndex == null || isNaN( intNextIndex ) && arrHashes[0] != null) { intNextSlideIndex = getItemIndex ( arrHashes[0] ); } if ( intNextSlideIndex != null && !isNaN( intNextSlideIndex ) ) { if(arrFileTypes[intNextSlideIndex] == 'image') { var domImg = document.getElementById('main_image_'+ arrHashes[intNextSlideIndex]); if( domImg !== null ) { if ( domImg.complete ) { galleryChangeLocation ( getItemLink ( arrHashes[intNextSlideIndex] ), true ); } else { clearInterval(strSlideshowInterval); strSlideshowInterval = null; domImg.onload = function () { galleryChangeLocation ( getItemLink ( arrHashes[intNextSlideIndex] ), true ); if (!strSlideshowInterval) { strSlideshowInterval = setInterval(nextSlide, 4000); } } } } else { galleryChangeLocation ( getItemLink ( arrHashes[intNextSlideIndex] ), true ); } } else if ( arrFileTypes[intNextSlideIndex] == 'video' ) { galleryChangeLocation ( getItemLink ( arrHashes[intNextSlideIndex] ), true ); } else if ( arrFileTypes[intNextSlideIndex] == 'audio' ) { galleryChangeLocation ( getItemLink ( arrHashes[intNextSlideIndex] ), true ); } else { galleryChangeLocation ( getItemLink ( arrHashes[intNextSlideIndex] ), true ); } } } } function pauseSlideshow() { $('#gallery2__content-wrapper').addClass( 'gallery__slideshow_paused' ); clearInterval(strSlideshowInterval); strSlideshowInterval = null; } function resumeSlideshow() { $('#gallery2__content-wrapper').removeClass( 'gallery__slideshow_paused' ); if (!strSlideshowInterval) { strSlideshowInterval = setInterval(nextSlide, 4000); } } function exitSlideshow() { pauseSlideshow(); $('#gallery2__content-wrapper').removeClass( 'gallery__slideshow_paused' ); $('#gallery2__content-wrapper').removeClass( 'gallery__slideshow' ); if (!((document.fullScreenElement !== undefined && document.fullScreenElement === null) || (document.msFullscreenElement !== undefined && document.msFullscreenElement === null) || (document.mozFullScreen !== undefined && !document.mozFullScreen) || (document.webkitIsFullScreen !== undefined && !document.webkitIsFullScreen))) { galleryToggleFullScreen(document.body) } } function enterSlideshow() { if($( '#gallery2__content' ).hasClass( 'gallery__sidebar-visible' ) ) { showGalleryInfo(); $(window).trigger('resize'); } $('#gallery2__content-wrapper').addClass( 'gallery__slideshow' ); galleryToggleFullScreen(document.body) resumeSlideshow(); } function removeActiveClass() { $('#gallery2__content-wrapper').removeClass( 'gallery__slideshow_user_active' ); } function showGalleryInfo() { var $gallery_content = $( '#gallery2__content' ); if( $gallery_content.hasClass( 'gallery__sidebar__info-visible' ) && $gallery_content.hasClass( 'gallery__sidebar-visible' ) ) { bolGallerySidebarVisible = false; bolGalleryCommentsVisible = false; $gallery_content.removeClass( 'gallery__sidebar-visible' ); $( '#gallery2' ).removeClass( 'gallery__sidebar-visible' ); } else { $gallery_content.removeClass( 'gallery__sidebar__comments-visible' ).addClass( 'gallery__sidebar__info-visible' ); if( !$gallery_content.hasClass( 'gallery__sidebar-visible' ) ) { $gallery_content.addClass( 'gallery__sidebar-visible' ); $( '#gallery2' ).addClass( 'gallery__sidebar-visible' ); } bolGallerySidebarVisible = true; galleryLoadFileInfo(); } adjustContentWidth(true); loadGalleryInfoAd(); } function showGalleryMessages() { $( '#gallery2__content' ).addClass( 'gallery__sidebar__comments-visible' ).addClass( 'gallery__sidebar__info-visible' ); } function hideGalleryMessages() { $( '#gallery2__content' ).removeClass( 'gallery__sidebar__comments-visible' ).addClass( 'gallery__sidebar__info-visible' ); } var bolGalleryInfoAdLoaded = false; function loadGalleryInfoAd() { if ( bolGalleryInfoAdLoaded ) return; if ( typeof fncDynamicLoadBanner_gallery2__sidebar__banner == 'function' ) { fncDynamicLoadBanner_gallery2__sidebar__banner(); } bolGalleryInfoAdLoaded = true; } function hideSidebar() { $( '#gallery2__content' ).removeClass( 'gallery__sidebar-visible' ); $( '#gallery2' ).removeClass( 'gallery__sidebar-visible' ); bolGallerySidebarVisible = false; bolGalleryCommentsVisible = false; adjustContentWidth(true); } function toggleThumbs() { $( '#gallery2__content' ).toggleClass( 'gallery__thumbs-visible' ); // fire resize event after transition, so audio player knows to resize if( typeof objAudioPlayer !== "undefined" ) { setTimeout( function() { var evt = document.createEvent('UIEvents'); evt.initUIEvent('resize', true, false,window,0); window.dispatchEvent(evt); }, 300 ); } } function hideThumbs() { $( '#gallery2__content' ).removeClass( 'gallery__thumbs-visible' ); $( '#gallery2__thumb-strip__hide_container' ).hide(); } function showThumbs() { $( '#gallery2__content' ).addClass( 'gallery__thumbs-visible' ); $( '#gallery2__thumb-strip__hide_container' ).show(); } function getItemLink ( strHash ) { var intIndex = null; for (idx in arrIDs) { if (arrHashes[idx] == strHash) { intIndex = idx; break;}} return '/f/' + arrHashes[intIndex]; var strHashtag = window.location.hash;var intIndexOfView = strHashtag.indexOf(';/view/');if (intIndexOfView != -1) { strHashtag = strHashtag.slice(0, intIndexOfView);}else{var intIndexOfView = strHashtag.indexOf('/view/');if (intIndexOfView != -1) { strHashtag = strHashtag.slice(0, intIndexOfView);}}var intIndexOfDelimiter = strHashtag.indexOf(';/view/');if (intIndexOfDelimiter != -1) { strHashtag = strHashtag.slice(0, intIndexOfDelimiter);}strHashtag = strHashtag + ( bolHashtagViewUseSemicolon ? ';' : '') + '/view/' + arrHashes[intIndex];return strHashtag;} function getItemIndex ( strHash ) { var intIndex = null; for (idx in arrIDs) { if (arrHashes[idx] == strHash) { intIndex = idx; break;}}return intIndex;} function getItemIndexByHashOrName ( strHashOrName ) { if( typeof arrHashes === "undefined" ) { return null; } // edit: before comparisons, urldecode both strings strHashOrName = decodeURIComponent( strHashOrName.replace( /\+/g, ' ' ) ); var intIndex = null; for (idx in arrHashes) { if ( decodeURIComponent( arrHashes[ idx ].replace( /\+/g, ' ' ) ) === strHashOrName ) { intIndex = idx; break; } } if ( intIndex === null ) { var intIndex = null; for (idx in arrNames) { if ( decodeURIComponent( arrNames[ idx ].replace( /\+/g, ' ' ) ) === strHashOrName ) { intIndex = idx; break; } } }return intIndex;} function getNextIndex ( strHash ) { var intIndex = null; var intNextIndex = null; for (idx in arrIDs) { if ( intIndex !== null ) { intNextIndex = idx; break;} if (arrHashes[idx] == strHash) { intIndex = idx;}}return parseInt(intNextIndex);} function getPreviousIndex ( strHash ) { var intPreviousIndex = null; for (idx in arrIDs) { if (arrHashes[idx] == strHash) { break;}else{intPreviousIndex = idx;}}return parseInt(intPreviousIndex);}function preloadImage ( intIndex ){if (typeof arrIsPreloaded == 'undefined')arrIsPreloaded = {};if (typeof arrIsPreloaded[intIndex] == 'undefined')arrIsPreloaded[intIndex]if ( arrFileTypes[intIndex] == 'image' && arrIsPreloaded[intIndex] != true ){var strHash = arrHashes[intIndex];var strImageURL = 'https://'+ arrFileHost[ intIndex ] +'/thumb_show.php?i=' + strHash + '&view&v=1&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925';if (arrFeeDownloadPrice[intIndex] > 0 || currentFolderHasFeeDownload( intIndex ) ){ strImageURL += '&wm=103';} if ( typeof( arrFileVersion ) != 'undefined' && typeof( arrFileVersion[ intIndex ] ) != 'undefined' && arrFileVersion[ intIndex ] > 0 ) { strImageURL += '&version=' + arrFileVersion[ intIndex ]; }$("gamebaidoithuonglifestyle (24)").attr("src", strImageURL);arrIsPreloaded[intIndex] = true;}} function preloadFileInfoData( intIndex ) { if ( ! bolUseAsyncFileInfoDataLoad ) { return false; } if ( typeof arrIsFileInfoDataPreloaded == 'undefined' ) { arrIsFileInfoDataPreloaded = []; } if ( ! arrIsFileInfoDataPreloaded[ intIndex ] ) { var strHash = arrHashes[ intIndex ]; $.ajax( { type : "POST", dataType : "json", url : "./ajax/modal_gallery/get_file_info_data.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925", data : { 'hash' : strHash } , success : function( arrResponse ) { if ( arrResponse[ 'success' ] ) { var arrFileInfoData = arrResponse[ 'data' ]; if ( typeof arrFileTitle == 'undefined' ) arrFileTitle = []; if ( typeof arrFileSubject == 'undefined' ) arrFileSubject = []; if ( typeof arrFileContentType == 'undefined' ) arrFileContentType = []; if ( typeof arrFileCategory == 'undefined' ) arrFileCategory = []; if ( typeof arrFileCategories == 'undefined' ) arrFileCategories = []; if ( typeof arrFileKeywords == 'undefined' ) arrFileKeywords = []; if ( typeof arrFileCreator == 'undefined' ) arrFileCreator = []; if ( typeof arrFilePublisher == 'undefined' ) arrFilePublisher = []; if ( typeof arrFileContributor == 'undefined' ) arrFileContributor = []; if ( typeof arrFileCopyrights == 'undefined' ) arrFileCopyrights = []; if ( typeof arrFileLicenseType == 'undefined' ) arrFileLicenseType = []; if ( typeof arrFileLicenseDetails == 'undefined' ) arrFileLicenseDetails = []; if ( typeof arrFileLanguage == 'undefined' ) arrFileLanguage = []; if ( typeof arrFileLocation == 'undefined' ) arrFileLocation = []; if ( typeof arrFileLocationLat == 'undefined' ) arrFileLocationLat = []; if ( typeof arrFileLocationLong == 'undefined' ) arrFileLocationLong = []; if ( typeof arrFileReferences == 'undefined' ) arrFileReferences = []; if ( typeof arrFileRelatesTo == 'undefined' ) arrFileRelatesTo = []; if ( typeof arrFileFormat == 'undefined' ) arrFileFormat = []; if ( typeof arrFileDevice == 'undefined' ) arrFileDevice = []; if ( typeof arrFileSource == 'undefined' ) arrFileSource = []; if ( typeof arrTags == 'undefined' ) arrTags = []; if ( typeof arrObjectTags == 'undefined' ) arrObjectTags = []; if ( typeof arrYoloObjectTags == 'undefined' ) arrYoloObjectTags = []; if ( typeof arrLabelTags == 'undefined' ) arrLabelTags = []; if ( typeof arrFileGoogleCVText == 'undefined' ) arrFileGoogleCVText = []; if ( typeof arrFileEasyOCRText == 'undefined' ) arrFileEasyOCRText = []; if ( typeof arrFileAudioTranscription == 'undefined' ) arrFileAudioTranscription = []; arrFileTitle[ intIndex ] = arrFileInfoData[ 'title' ]; arrFileSubject[ intIndex ] = arrFileInfoData[ 'subject' ]; arrFileContentType[ intIndex ] = arrFileInfoData[ 'contentType' ]; arrFileCategory[ intIndex ] = arrFileInfoData[ 'category' ]; arrFileCategories[ intIndex ] = arrFileInfoData[ 'categories' ]; arrFileKeywords[ intIndex ] = arrFileInfoData[ 'keywords' ]; arrFileCreator[ intIndex ] = arrFileInfoData[ 'creator' ]; arrFilePublisher[ intIndex ] = arrFileInfoData[ 'publisher' ]; arrFileContributor[ intIndex ] = arrFileInfoData[ 'contributor' ]; arrFileCopyrights[ intIndex ] = arrFileInfoData[ 'copyrights' ]; arrFileLicenseType[ intIndex ] = arrFileInfoData[ 'licenseType' ]; arrFileLicenseDetails[ intIndex ] = arrFileInfoData[ 'licenseDetails' ]; arrFileLanguage[ intIndex ] = arrFileInfoData[ 'language' ]; arrFileLocation[ intIndex ] = arrFileInfoData[ 'location' ]; arrFileLocationLat[ intIndex ] = arrFileInfoData[ 'locationLat' ]; arrFileLocationLong[ intIndex ] = arrFileInfoData[ 'locationLong' ]; arrFileReferences[ intIndex ] = arrFileInfoData[ 'references' ]; arrFileRelatesTo[ intIndex ] = arrFileInfoData[ 'relatesTo' ]; arrFileFormat[ intIndex ] = arrFileInfoData[ 'format' ]; arrFileDevice[ intIndex ] = arrFileInfoData[ 'device' ]; arrFileSource[ intIndex ] = arrFileInfoData[ 'source' ]; arrTags[ intIndex ] = arrFileInfoData[ 'tags' ]; arrObjectTags[ intIndex ] = arrFileInfoData[ 'objectTags' ]; arrYoloObjectTags[ intIndex ] = arrFileInfoData[ 'yoloObjectTags' ]; arrLabelTags[ intIndex ] = arrFileInfoData[ 'labelTags' ]; arrFileGoogleCVText[ intIndex ] = arrFileInfoData[ 'googleCVText' ]; arrFileEasyOCRText[ intIndex ] = arrFileInfoData[ 'easyOCRText' ]; arrFileAudioTranscription[ intIndex ] = arrFileInfoData[ 'audioTranscription' ]; arrIsFileInfoDataPreloaded[ intIndex ] = true; } } , error : function() { } } ); } }function checkBeforeContentChange (){intNextIndex = getNextIndex ( strCurrentFileHash );intPreviousIndex = getPreviousIndex ( strCurrentFileHash );if ( intNextIndex != null && !isNaN( intNextIndex ) ){$('#gallery2__controls_right').show();}else{$('#gallery2__controls_right').hide();}if ( intPreviousIndex != null && !isNaN( intPreviousIndex ) ){$('#gallery2__controls_left').show();}else{$('#gallery2__controls_left').hide();}}function useEmbedPlayer( intFileIndex ) { var bolUseEmbedPlayerForThisFiles = false; if ( arrFileAttributes[ intFileIndex ][ 'readOnly' ] ) { bolUseEmbedPlayerForThisFiles = true; } else if ( typeof ( bolUseEmbedPlayer ) == 'boolean' && bolUseEmbedPlayer && typeof ( bolIsAnonymousUpload ) == 'boolean' && arrFeeDownloadPrice[ intFileIndex ] == null && ! currentFolderHasFeeDownload( intFileIndex ) && arrAllowDownload[ intFileIndex ] && arrAllowPublicDownload[ intFileIndex ] ) { if ( ( [ 'm4a', 'webm', 'ogg' ] ).indexOf( arrExtensions[ intFileIndex ] ) !== -1 ) { bolUseEmbedPlayerForThisFiles = true; } else if ( arrExtensions[ intFileIndex ] == 'mp4' ) { if ( arrViews[ intFileIndex ] < 1000 ) { bolUseEmbedPlayerForThisFiles = false; } else { bolUseEmbedPlayerForThisFiles = true; } } } return bolUseEmbedPlayerForThisFiles; }function checkAfterContentChange (){if ( ! intNextIndex ){intNextIndex = getNextIndex ( strCurrentFileHash );}if ( ! intPreviousIndex ){intPreviousIndex = getPreviousIndex ( strCurrentFileHash );}if ( intNextIndex != null && !isNaN( intNextIndex ) ){$('#gallery2__controls_right').show();}else{$('#gallery2__controls_right').hide();}if ( intPreviousIndex != null && !isNaN( intPreviousIndex ) ){$('#gallery2__controls_left').show();}else{$('#gallery2__controls_left').hide();}// do preloadingfor (var int=0; int

= 0){if ( arrFileTypes[intPrev] == 'image' ){setTimeout('preloadImage ('+intPrev+')',300);}}var intNext = intNextIndex + int;if (intNext < arrHashes.length){if ( arrFileTypes[intNext] == 'image' ){setTimeout('preloadImage ('+intNext+')',300);}}} for ( var int = 0; int < intPreloadFileInfoDataCount; int++ ) { var intPrev = intPreviousIndex - int; if ( intPrev >= 0 ) { setTimeout( 'preloadFileInfoData(' + intPrev + ')', 300 ); } var intNext = intNextIndex + int; if ( intNext < arrHashes.length ) { setTimeout( 'preloadFileInfoData(' + intNext + ')', 300 ); } }} function galleryToggleFullScreen(elem){ if ((document.fullScreenElement !== undefined && document.fullScreenElement === null) || (document.msFullscreenElement !== undefined && document.msFullscreenElement === null) || (document.mozFullScreen !== undefined && !document.mozFullScreen) || (document.webkitIsFullScreen !== undefined && !document.webkitIsFullScreen)) { if (elem.requestFullScreen) { elem.requestFullScreen(); } else if (elem.mozRequestFullScreen) { elem.mozRequestFullScreen(); } else if (elem.webkitRequestFullScreen) { elem.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT); } else if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); } } else { if (document.cancelFullScreen) { document.cancelFullScreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitCancelFullScreen) { document.webkitCancelFullScreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } }}function updateFileDescription(){$('#file_description_edit_wrapper').removeClass('has_error');$.ajax({type: "POST",dataType: "json",url: "./ajax/file_info.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925",data: {'update_file_description': true ,'file_hash' : strCurrentFileHash ,'file_description' : $('#file_description_edit_wrapper textarea').val()} ,success: function(data){if (data['status'] == 'ok'){var intItemIndex = getItemIndex(strCurrentFileHash);arrDescriptions[intItemIndex] = $('#file_description_edit_wrapper textarea').val();}else{$('#file_description_edit_wrapper').addClass('has_error');}} ,error: function(){$('#file_description_edit_wrapper').addClass('has_error');}});}function updateFileName(){$('#file_name_edit_wrapper').removeClass('has_error');$.ajax({type: "POST",dataType: "json",url: "./ajax/file_info.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925",data: { 'without_extension': 1 ,'update_file_name': true ,'file_hash' : strCurrentFileHash ,'file_name' : $('#file_name_edit_wrapper textarea').val()} ,success: function(data){if (data['status'] == 'ok'){var intItemIndex = getItemIndex(strCurrentFileHash);arrDisplayNames[intItemIndex] = $('#file_name_edit_wrapper textarea').val() + '.' + arrExtensions[ intCurrentFileIndex ];}else{$('#file_name_edit_wrapper').addClass('has_error');}} ,error: function(){$('#file_name_edit_wrapper').addClass('has_error');}});}function showOrginal(strCurrentFileHash) { var intFileIndex = getItemIndexByHashOrName( strCurrentFileHash );window.open('https://'+ arrFileHost[ intFileIndex ] +'/down.php?i='+ strCurrentFileHash +'&view', '_blank');} function adjustContentWidth (bolOnResize) { var intGalleryHeight = $('#gallery2').height(); var intGalleryWidth = $('#gallery2').width(); var intImageWrapperWidth = intGalleryWidth; var intThumbStripWidth = intGalleryWidth; var intGalleryHeaderWidth = intGalleryWidth; var intBannerInnerPaddingTop = 0; var intBannerWidth = 0; var intBannerHeight = 0; var intLeftSideWidth = 0; if ( bolGallerySidebarVisible || bolGalleryCommentsVisible ) { intLeftSideWidth = 360; } if (intGalleryWidth >= 800 && intGalleryHeight >= 600) { if (intGalleryHeight > ( 600 + 196 + 95 ) ) { intBannerInnerPaddingTop = ( (intGalleryHeight - 600 - 196 - 95) / 2 ) + 196; } else { intThumbStripWidth = intImageWrapperWidth; if (intGalleryHeight < (600 + 196) ) { intGalleryHeaderWidth = intImageWrapperWidth; intBannerInnerPaddingTop = 0; } else { intBannerInnerPaddingTop = 196; } } } else { intBannerWidth = 0; } intImageWrapperWidth = intGalleryWidth - intBannerWidth - intLeftSideWidth; $('#gallery2__image-wrapper').width(intImageWrapperWidth + 'px'); $('#gallery2__thumb-strip').width(intThumbStripWidth + 'px'); $('#gallery2__banner__inner').css('padding-top', intBannerInnerPaddingTop +'px'); $('#gallery2__header').width(intGalleryHeaderWidth +'px'); if (bolOnResize) { jqMainSlider.redrawSlider(); } if ( arrFileTypes[ intCurrentFileIndex ] === "video" ) { if ( !useEmbedPlayer( intCurrentFileIndex ) ) { var $video = $( "#video_" + arrHashes[ intCurrentFileIndex ] ); if( $video.length) { fitVideoPlayer( $video ); } } } } function repositionHeartButton () { if ( ! jqMainSlider ) return; if ( strCurrentFileHash !== arrHashes[ jqMainSlider.getCurrentSlide() ] ) return; var jqImage = $('#main_image_' + arrHashes[ jqMainSlider.getCurrentSlide() ]); if ( jqImage.length ) { var objImgPosition = jqImage.offset(); $('#vote_heart_on_image').css({ top: (jqImage[0].y + jqImage.height() -110) + 'px', left: (objImgPosition.left + jqImage.width() -50) + 'px' }); if ( jqImage.attr('data-image-loaded') ) { $('#vote_heart_on_image').show(); } } } function recalculateGalleryForBanner(bolOnResize){ return adjustContentWidth (bolOnResize);} function modalGalleryDownloadFileP2PBtn( intItemIndex ) { if ( typeof(bolHideDownloadButtons) !== 'undefined' && bolHideDownloadButtons ) { return; } if ( ! bolIsListViewForSpecificFile ) { window.location = '/f/' + arrHashes[ intItemIndex ] + '?start_p2p_download'; } else { if ( typeof ( objWebTorrentDownloadForm ) === 'object' && arrFeeDownloadPrice[ intItemIndex ] == null && ! currentFolderHasFeeDownload( intItemIndex ) && arrAllowDownload[ intItemIndex ] && ( arrAccessType[ intItemIndex ] === 'LINK' || arrAccessType[ intItemIndex ] === 'PUBLIC' ) && arrUploadPassword[ intItemIndex ] === '' && arrAllowPublicDownload[ intItemIndex ] ) { var strFileExtension = arrExtensions[ intItemIndex ]; var arrExecutableExtensions = ['exe','com','dll','pif','scr','bat','bin','pl','sh','scf','sct','shs','vb','lnk','jnlp','apk','vbs','js','msi','jse','jar','dmg','bin','wsf']; if ( arrExecutableExtensions.indexOf( strFileExtension ) === -1 ) { objWebTorrentDownloadForm.showForm( 'file', arrHashes[ intItemIndex ] ); } else { fConfirm( 'This file was checked with antivirus on the serverside, but executable files may contain potentially dangerous code that antivirus software is yet unable to detect. Use it only if you trust the sender. If not sure, use Virustotal.com to double-check. Do you want to save this file?', '', 'OK', 'Cancel', function ( r ) { if ( r ) { objWebTorrentDownloadForm.showForm( 'file', arrHashes[ intItemIndex ] ); } } ); } } else { modalGalleryDownloadFileBtn( arrHashes[ intItemIndex ] ); } } } function modalGalleryDownloadFileBtn( strFileHash, strDownloadType="simple" ) { var intItemIndex = getItemIndex( strFileHash ); if ( typeof(bolHideDownloadButtons) !== 'undefined' && bolHideDownloadButtons ) { return; } if ( typeof(arrHideDownloadButtons) !== 'undefined' && arrHideDownloadButtons[intItemIndex] ) { return; } var intItemIndex = getItemIndex( strFileHash ); var bolUserIsAuthenticated = false; if ( typeof(arrForbidDirectDownload) != 'undefined' && typeof(arrForbidDirectDownload_Authenticated) != 'undefined' && arrForbidDirectDownload[ intItemIndex ] && ! arrForbidDirectDownload_Authenticated[ intItemIndex ] && ! bolUserIsAuthenticated ) { if ( ! bolIsListViewForSpecificFile ) closeGallery(strCurrentFileHash); var jqSigninErrorContainer = $('#signin-modal-content-error'); $('.alert_main_text', jqSigninErrorContainer) .html('Direct download limit reached. Please, login or signup to directly download this file'); jqSigninErrorContainer.show(); showSignIn(); } else if ( typeof(arrForbidDirectDownload) != 'undefined' && typeof(arrForbidDirectDownload_Authenticated) != 'undefined' && arrForbidDirectDownload[ intItemIndex ] && arrForbidDirectDownload_Authenticated[ intItemIndex ] ) { modalGalleryDownloadFileP2PBtn(intItemIndex); } else if ( strDownloadType == 'pdf' ) { var strDateModified = ( typeof arrDatesModified != 'undefined' ? arrDatesModified[ intItemIndex ] : ( typeof arrModDate != 'undefined' ? arrModDate[ intItemIndex ] : '' ) ); window.location = '/api/file/get_thumb_pdf.php?i=' + strFileHash + '&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925&dm=' + strDateModified + '&v=102&n=' + arrDisplayNames[ intItemIndex ] + '.pdf'; } else if ( strDownloadType == 'mp4' ) { var strDateModified = ( typeof arrDatesModified != 'undefined' ? arrDatesModified[ intItemIndex ] : ( typeof arrModDate != 'undefined' ? arrModDate[ intItemIndex ] : '' ) ); window.location = '/thumb_video/' + strFileHash + '.mp4?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925&dm=' + strDateModified + '&v=102&n=' + arrDisplayNames[ intItemIndex ] + '.mp4'; } else if ( strDownloadType == 'jpg' ) { var strDateModified = ( typeof arrDatesModified != 'undefined' ? arrDatesModified[ intItemIndex ] : ( typeof arrModDate != 'undefined' ? arrModDate[ intItemIndex ] : '' ) ); window.location = '/thumb_show.php?i=' + strFileHash + '&PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925&dm=' + strDateModified + '&download'; } else if ( strDownloadType == 'my-files' ) { objUploadCopyForm.showForm( strUploadHash , false , [ strFileHash ] , [] , true , '' , function( strTargetUploadHash ) { window.location = '/filebrowser?u=' + strTargetUploadHash; } ); } else { var strFileExtension = arrExtensions[ intItemIndex ]; var arrExecutableExtensions = ['exe','com','dll','pif','scr','bat','bin','pl','sh','scf','sct','shs','vb','lnk','jnlp','apk','vbs','js','msi','jse','jar','dmg','bin','wsf']; if ( arrExecutableExtensions.indexOf( strFileExtension ) == -1 ) { window.location = 'https://'+ arrFileHost[ intItemIndex ] +'/down.php?i=' + strFileHash; } else { fConfirm( 'This file was checked with antivirus on the serverside, but executable files may contain potentially dangerous code that antivirus software is yet unable to detect. Use it only if you trust the sender. If not sure, use Virustotal.com to double-check. Do you want to save this file?', '', 'OK', 'Cancel', function( r ) { if ( r ) { window.location = 'https://'+ arrFileHost[ intItemIndex ] +'/down.php?i=' + strFileHash; } } ); } }}function modalGallery_changeFileThumbnail( strFileHash, intItemIndex ) { var $input; $( "

' ).attr( { 'class' : 'styled-select upload-access-switch-select' , } )var objTypeSelect = $( '' ).attr( { 'class' : 'upload-access-switch_type-select' , 'disabled' : ( this.strUploadAccessSwitchType == 'default' && ! this.bolOwnerLoggedIn ? true : false ) } );objTypeSelect.append($( '

' ).attr( { 'value' : 'private' , 'desc' : 'Only you or users invited by email can access.' , 'selected' : ( this.strAccessType == 'private' ? true : false ) } ) .text( 'Only with private permission' ) );}if ( this.strUploadAccessSwitchType == 'default' ){ objTypeSelect.append($( '

' ).attr( {'value' : 'link' ,'desc' : 'View and download access' ,'selected' : ( this.strAccessType == 'link' ? true : false )} ).text( 'Anyone with a link' ));strHtml = '

';}else if ( this.strUploadAccessSwitchType == 'sharing_form' ){ objTypeSelect.append( $( '

' ).attr( { 'value' : 'link-can-view' , 'desc' : 'View and download.' , 'selected' : ( this.strAccessType == 'link' ? true : false ) , 'class' : 'upload-access-switch_type-select_option_link-can-view' } ) .text( 'via link to access content' ) );if ( !( objUploadAccessSwitchSettings.access_type != 'PRIVATE' && typeof objUploadAccessSwitchSettings.from_eparaksts != 'undefined' && objUploadAccessSwitchSettings.from_eparaksts ) ){strHtml = '

' ).attr( { 'value' : 'link-can-edit' , 'desc' : 'Link to add, edit or delete content.' , 'selected' : ( this.strAccessType == 'link-can-edit' ? true : false ) , } ) .text( 'Get a link to edit content' ) );strHtml = '

';objTypeCopyWrap.append(strHtml); if ( this.strItemType == 'upload' ) { objTypeSelect.append( $( '

' ).attr( { 'value' : 'link-can-upload' , 'desc' : 'Visitors can add files, but can’t delete or edit existing.' , 'selected' : ( this.strAccessType == 'link-can-upload' ? true : false ) , } ) .text( 'Get Link to add content' ) );if ( !( objUploadAccessSwitchSettings.access_type != 'PRIVATE' && typeof objUploadAccessSwitchSettings.from_eparaksts != 'undefined' && objUploadAccessSwitchSettings.from_eparaksts ) ){strHtml = '

' +'Copy add link' +'You can add files, but not delete or edit existing files' +'

';objTypeCopyWrap.append(strHtml);} }}else if ( this.strUploadAccessSwitchType == 'modal_gallery' ){ objTypeSelect.append( $( '

' ).attr( { 'value' : 'link-can-view' , 'desc' : 'View and download.' , 'selected' : ( this.strAccessType == 'link' ? true : false ) , 'class' : 'upload-access-switch_type-select_option_link-can-view' } ) .text( 'via link to access content' ) ); objTypeSelect.append( $( '

' ).attr( { 'value' : 'link-can-edit' , 'desc' : 'Link to add, edit or delete content.' , 'selected' : ( this.strAccessType == 'link-can-edit' ? true : false ) , } ) .text( 'Get a link to edit content' ) ); if ( this.strItemType == 'upload' ) { objTypeSelect.append( $( '

' ).attr( { 'value' : 'link-can-upload' , 'desc' : 'Visitors can add files, but can’t delete or edit existing.' , 'selected' : ( this.strAccessType == 'link-can-upload' ? true : false ) , } ) .text( 'Get Link to add content' ) ); }}if ( this.strItemType == 'upload' && this.bolOwnerLoggedIn ){objTypeSelect.append( $( '

' ).attr( { 'value' : 'password' , 'desc' : 'Visitors must enter a password to access' , 'selected' : ( this.strAccessType == 'password' ? true : false ) } ) .text( 'Set password' ) );objTypeSelect.append( $( '

' ).attr( { 'value' : 'public' , 'desc' : 'Visible to anyone on your profile and via search.' , 'selected' : ( this.strAccessType == 'public' ? true : false ) } ) .text( 'Posted on my profile page' ) );}objTypeSelectWrap.append( objTypeSelect );$('.url_wrapper ').removeClass('switch');if ( this.strUploadAccessSwitchType == 'sharing_form' ){strHtml = '

';if (this.strItemType == 'upload' ){$('.url_wrapper ').addClass('switch');strHtml += '

' ).attr( {'class' : 'upload-access-switch ' + (typeof objUploadAccessSwitchSettings.propagate_settings !== 'undefined' && objUploadAccessSwitchSettings.propagate_settings == 2 ? 'disabled' : '') ,'data-selected-access-type' : this.strAccessType } ).append($( '

' ).attr( {'class' : 'upload-access-switch_type-wrapper' } ).append($( '' ).text( ( this.strUploadAccessSwitchType == 'sharing_form' ? 'Access rights:' : 'Access:' ) )).append($( '' ).attr( {'class' : 'upload-access-switch_type-wrapper-desc' } ).text(( this.strAccessType == 'private' ? 'Only with private permission' : 'Anyone with a link' )))).append( strHtml ));}else{$( this.objParentElement ).html($( '

' ).attr( {'class' : 'upload-access-switch' ,'data-selected-access-type' : this.strAccessType } ).append($( '

' ).attr( {'class' : 'upload-access-switch_type-wrapper' } ).append($( '' ).text( ( this.strUploadAccessSwitchType == 'sharing_form' ? 'Link and Access rights:' : 'Access:' ) )).append( objTypeSelectWrap )).append($( '

' ).attr( {'class' : 'upload-access-switch_password-wrapper'} ).append($( '' ).text( 'Password:' )).append($( '' ).attr( {'class' : 'upload-access-switch_password' ,'type' : 'text' ,'title' : 'Enter a password' ,'value' : this.strUploadPassword} )).append($( '

' ).attr( {'class' : 'upload-access-switch_password-save-btn'} ).text( 'Save' ))).append($( '

' ).attr( {'class' : 'upload-access-switch_loading-mask'} ).append($( '' ).attr( {'class' : 'fal fa-spinner fa-spin'} ))));}checkTooltips();var x, i, j, selElmnt, a, b, c, d, e;/*look for any elements with the class "styled-select":*/x = document.getElementsByClassName("upload-access-switch-select");for (i = 0; i < x.length; i++) {if (x[i].getElementsByClassName("select-selected").length < 1) {selElmnt = x[i].getElementsByTagName("select")[0];/*for each element, create a new DIV that will act as the selected item:*/a = document.createElement("DIV");a.setAttribute("class", "select-selected");a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;x[i].appendChild(a);/*for each element, create a new DIV that will contain the option list:*/b = document.createElement("DIV");b.setAttribute("class", "select-items select-hide");for (j = 1; j < selElmnt.length; j++) {/*for each option in the original select element,create a new DIV that will act as an option item:*/c = document.createElement("DIV");d = document.createElement("DIV");if(selElmnt.options[j].value == selElmnt.value){c.setAttribute("class", "checked");}e = document.createElement("DIV");e.setAttribute("class", "value");d.setAttribute("class", "desc");//c.innerHTML = selElmnt.options[j].innerHTML;e.innerHTML = selElmnt.options[j].innerHTML;d.innerHTML = selElmnt.options[j].getAttribute('desc');c.appendChild(e);c.appendChild(d);if ( !!selElmnt.id && !!selElmnt.options[j].value ){c.setAttribute( 'id', selElmnt.id + '_' + selElmnt.options[j].value );}c.addEventListener("click", function(e) {/*when an item is clicked, update the original select box,and the selected item:*/var y, i, k, s, sjq, h, clicked;clicked = this;s = this.parentNode.parentNode.getElementsByTagName("select")[0];sjq = $(s);$(clicked).parents().children().removeClass('checked');$(clicked).addClass('checked');h = this.parentNode.previousSibling;for (i = 0; i < s.length; i++) {if (s.options[i].innerHTML == this.getElementsByClassName("value")[0].innerHTML) {s.selectedIndex = i;h.innerHTML = this.getElementsByClassName("value")[0].innerHTML;y = this.parentNode.getElementsByClassName("same-as-selected");for (k = 0; k < y.length; k++) {y[k].removeAttribute("class");}this.setAttribute("class", "same-as-selected checked");sjq.trigger("change");break;}}h.click();});b.appendChild(c);}x[i].appendChild(b);a.addEventListener("click", function(e) {/*when the select box is clicked, close any other select boxes,and open/close the current select box:*/e.stopPropagation();closeAllSelect(this);this.nextSibling.classList.toggle("select-hide");this.classList.toggle("select-arrow-active");this.parentElement.classList.toggle("blue-border");if (this.parentElement.previousElementSibling){this.parentElement.previousElementSibling.classList.toggle("blue-span");}});}}function closeAllSelect(elmnt) {/*a function that will close all select boxes in the document,except the current select box:*/var x, y, i, arrNo = [];x = document.getElementsByClassName("select-items");y = document.getElementsByClassName("select-selected");for (i = 0; i < y.length; i++) {if (elmnt == y[i]) {arrNo.push(i)} else {y[i].classList.remove("select-arrow-active");}}for (i = 0; i < x.length; i++) {if (arrNo.indexOf(i)) {x[i].classList.add("select-hide");x[i].parentElement.classList.remove("blue-border");if (x[i].parentElement.previousElementSibling){x[i].parentElement.previousElementSibling.classList.remove("blue-span");}}}}/*if the user clicks anywhere outside the select box,then close all select boxes:*/if ( ! bolUploadAccessSwitch_closeAllSelect_Binded ){document.addEventListener("click", closeAllSelect);bolUploadAccessSwitch_closeAllSelect_Binded = true;}if ( ! this.bolOwnerLoggedIn ){if ( this.strUploadAccessSwitchType == 'sharing_form' ){// do nothing}else{ $( this.objParentElement ).on( 'click', function( event ) { showCreateAccount(); } );}}else{ $( this.objParentElement ).find( '.upload-access-switch_type-select' ).on( 'change', function() { _this.changeAccessType( $( this ).val() ); } ); $( this.objParentElement ).find( '.upload-access-switch_password' ).on( 'blur', function() {if($( this ).val().trim() != '' ) {$(this).parent().delay(500).queue(function(next) {$(this).removeClass('open');$( '.upload-access-switch_password-save-btn' ).html('Save');$( '.upload-access-switch_password-save-btn' ).removeClass("green");next();});}else{$( this ).parent().removeClass('has_password').removeClass('open');$( '.upload-access-switch_password-save-btn' ).html('Save');$( '.upload-access-switch_password-save-btn' ).removeClass("green");}} ); $( this.objParentElement ).find( '.upload-access-switch_password' ).on( 'change', function() {$(this).parent().addClass('has_password'); _this.changeAccessType( 'password' ); } );$( this.objParentElement ).find( '#upload-access-switch_type-toggle' ).on( 'change', function() {if ($(this).is(':checked')){_this.changeAccessType( 'link' );}else{_this.changeAccessType( 'private' );} } );$( this.objParentElement ).find( '.upload-access-switch_hide-download-toggle' ).on( 'change', function() {if ($(this).is(':checked')){_this.changeHideDownloadButtons( 1 );$(this).next().next().html('Yes');}else{_this.changeHideDownloadButtons( 0 );$(this).next().next().html('No');} } );$( this.objParentElement ).find( '.upload-access-switch_password' ).on( 'input', function() {$( '.upload-access-switch_password-save-btn' ).html('Save'); $( '.upload-access-switch_password-save-btn' ).removeClass("green"); } );}}this.init();this.changeHideDownloadButtons = function( intHideDownloadButtons ){this.showLoadingMask();var strAjax_Url = ''; var objAjax_Data = null; if ( this.strItemType == 'upload' ) { strAjax_Url = '/ajax/upload_info.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925'; objAjax_Data = { 'set_upload_hide_download_buttons': true ,'upload_hash' : this.strUploadHash ,'hide_download_buttons' : intHideDownloadButtons }; } $.ajax( { type: "POST", dataType: "json", url: strAjax_Url , data: objAjax_Data , success: function( data ) { if ( data['status'] == 'ok' ) { if ( _this.strItemType == 'upload' && ( _this.strEmbedPlace == 'filebrowser' || _this.strEmbedPlace == 'list' ) ) { location.reload(); } _this.hideLoadingMask(); } else { _this.afterErrorOn_changeAcceccType(); } } , error: function() { _this.afterErrorOn_changeAcceccType(); } } );}this.changeAccessType = function( strNewAccessType ){$( this.objParentElement ).find( '.upload-access-switch' ).attr( 'data-selected-access-type', strNewAccessType );if ( strNewAccessType == 'password' && $( this.objParentElement ).find( '.upload-access-switch_password' ).val().trim() == '' ){if ( this.strUploadAccessSwitchType == 'sharing_form' ){this.changeAccessType( 'link' );$( this.objParentElement ).find( '.upload-access-switch_password' ).parent().removeClass('has_password').removeClass('open');$( '.upload-access-switch_password-save-btn' ).html('Save');$( '.upload-access-switch_password-save-btn' ).removeClass("green");}return;}if (strNewAccessType == 'link-can-view'|| strNewAccessType == 'link-can-edit'|| strNewAccessType == 'link-can-upload'){strNewAccessType = 'link';} this.showLoadingMask();var strAjax_Url = ''; var objAjax_Data = null; if ( this.strItemType == 'upload' ) { strAjax_Url = '/ajax/upload_info.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925'; objAjax_Data = { 'set_upload_access_type' : true ,'upload_hash' : this.strUploadHash ,'upload_access_type' : strNewAccessType ,'upload_password' : $( this.objParentElement ).find( '.upload-access-switch_password' ).val() }; } else if ( this.strItemType == 'file' ) { strAjax_Url = '/ajax/file_info.php?PHPSESSID=1b8a494dc1cbd07e708bddcfbb2c5111ea3ad925'; objAjax_Data = { 'set_file_access_type' : true ,'file_hash' : this.strFileHash ,'file_access_type' : strNewAccessType }; } $.ajax( { type: "POST", dataType: "json", url: strAjax_Url , data: objAjax_Data , success: function( data ) { if ( data['status'] == 'ok' ) { _this.strAccessType = strNewAccessType; _this.bolAccessTypeChanged = true; if ( _this.strItemType == 'upload' ) { if ( strNewAccessType != 'password' ) { $( _this.objParentElement ).find( '.upload-access-switch_password' ).val( '' );$( _this.objParentElement ).find( '.upload-access-switch_password-wrapper' ).find('label').eq(0).html('Set password');$( _this.objParentElement ).find( '.upload-access-switch_password' ).parent().removeClass('has_password').removeClass('open'); }else {$( '.upload-access-switch_password-save-btn' ).html('Saved!'); $( '.upload-access-switch_password-save-btn' ).addClass("green");$( _this.objParentElement ).find( '.upload-access-switch_password-wrapper' ).find('label').eq(0).html('Password:');} if ( strNewAccessType == 'link' ) { $( '#upload_button__publish' ).show(); $( '#upload_button__unpublish' ).hide(); } else if ( strNewAccessType == 'public' ) { $( '#upload_button__publish' ).hide(); $( '#upload_button__unpublish' ).show(); } else { $( '#upload_button__publish' ).hide(); $( '#upload_button__unpublish' ).hide(); } if ( _this.strEmbedPlace == 'filebrowser' ) { gaev( 'filebrowser-folder-info', 'access', strNewAccessType ); } } if ( _this.strEmbedPlace == 'filebrowser' || _this.strEmbedPlace == 'list' ) { location.reload(); } _this.hideLoadingMask(); } else { _this.afterErrorOn_changeAcceccType(); } } , error: function() { _this.afterErrorOn_changeAcceccType(); } } );}this.afterErrorOn_changeAcceccType = function( strErrorMsg ){if ( this.strAccessType == 'link' && this.strUploadAccessSwitchType == 'sharing_form' ){this.strAccessType = 'link-can-view';} $( this.objParentElement ).find( '.upload-access-switch' ).attr( 'data-selected-access-type', this.strAccessType );$( this.objParentElement ).find( '.upload-access-switch_type-select option[value="' + this.strAccessType + '"]' ).attr( 'selected', 'selected' );$( this.objParentElement ).find( '.upload-access-switch_type-select' ).trigger( 'change' );if ( typeof strErrorMsg == 'undefined' ){strErrorMsg = 'An error occurred. Try again!';}fError( strErrorMsg );this.hideLoadingMask();}this.showLoadingMask = function(){$( this.objParentElement ).find( '.upload-access-switch_loading-mask' ).show();}this.hideLoadingMask = function(){$( this.objParentElement ).find( '.upload-access-switch_loading-mask' ).hide();}}

gamebaidoithuonglifestyle (2024)

References

Top Articles
Nasal Spray For Allergies: Types, Side Effects And Effectiveness
What to Consider Before Adopting a Long-Haired Cat
Tabc On The Fly Final Exam Answers
Wizard Build Season 28
라이키 유출
Free Robux Without Downloading Apps
OnTrigger Enter, Exit ...
Everything You Need to Know About Holly by Stephen King
Summoners War Update Notes
Google Feud Unblocked 6969
Teenleaks Discord
Wilmot Science Training Program for Deaf High School Students Expands Across the U.S.
Snow Rider 3D Unblocked Wtf
R Cwbt
The Exorcist: Believer (2023) Showtimes
Metro Pcs.near Me
Craigslist Pet Phoenix
Georgetown 10 Day Weather
18889183540
Jenna Ortega’s Height, Age, Net Worth & Biography
Why do rebates take so long to process?
Happy Life 365, Kelly Weekers | 9789021569444 | Boeken | bol
Craigslistodessa
Mythical Escapee Of Crete
Cars & Trucks - By Owner near Kissimmee, FL - craigslist
Is Poke Healthy? Benefits, Risks, and Tips
Criglist Miami
John Philip Sousa Foundation
Craigslist Auburn Al
Guide to Cost-Benefit Analysis of Investment Projects Economic appraisal tool for Cohesion Policy 2014-2020
Craigs List Tallahassee
Was heißt AMK? » Bedeutung und Herkunft des Ausdrucks
Haunted Mansion Showtimes Near Cinemark Tinseltown Usa And Imax
Half Inning In Which The Home Team Bats Crossword
Greencastle Railcam
Giantess Feet Deviantart
Duff Tuff
Mandy Rose - WWE News, Rumors, & Updates
Ursula Creed Datasheet
Koninklijk Theater Tuschinski
2 Pm Cdt
Bunkr Public Albums
Doublelist Paducah Ky
Ts In Baton Rouge
Hillsborough County Florida Recorder Of Deeds
Unblocked Games 6X Snow Rider
Waco.craigslist
4Chan Zelda Totk
Zits Comic Arcamax
Great Clips Virginia Center Commons
Phumikhmer 2022
Comenity/Banter
Latest Posts
Article information

Author: Edwin Metz

Last Updated:

Views: 6231

Rating: 4.8 / 5 (78 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Edwin Metz

Birthday: 1997-04-16

Address: 51593 Leanne Light, Kuphalmouth, DE 50012-5183

Phone: +639107620957

Job: Corporate Banking Technician

Hobby: Reading, scrapbook, role-playing games, Fishing, Fishing, Scuba diving, Beekeeping

Introduction: My name is Edwin Metz, I am a fair, energetic, helpful, brave, outstanding, nice, helpful person who loves writing and wants to share my knowledge and understanding with you.