'; } item_content += ''; item_content += '
'; item_content += ''; item_content += '
'; } if (itemType == 'file') { if (dataValue.uploadextension == "pdf") { var fileSourceUrl = 'https://media.mercedes-benz.jp/download/' + dataValue.uploadid + '/' + dataValue.uploadfilename; if (dataValue.thumbs != 0) { var backgroundImage = '//content.presspage.com/pdfthumbs/' + dataValue.hashedID + '-page1_350.jpg'; } else { var backgroundImage = '//manager.presspage.com/images/icons/icon_filetype_' + dataValue.uploadextension + '.png'; } } else { var fileSourceUrl = '//manager.presspage.com/services/downloadfile.php?f=' + dataValue.uploadfilename + '&uid=' + dataValue.uploadid + '&hash='+dataValue.hash; var backgroundImage = '//manager.presspage.com/images/icons/icon_filetype_' + dataValue.uploadextension + '.png'; } item_content += '
'; item_content += '
'; item_content += '
'; item_content += '
'; } if (itemType == 'audio') { var backgroundImage = '//manager.presspage.com/images/icons/icon_filetype_' + dataValue.uploadextension + '.png'; item_content += '
'; item_content += '
'; item_content += '
'; item_content += '
'; item_content += '
'; } if (itemType == 'video') { if (dataValue.datasource != 's3') { item_content += '
'; } } if ((itemType != 'video') || (itemType == 'video' && dataValue.datasource == 's3')) { item_content += '
' + dataValue.title + '
'; item_content += ''; item_content += '
'; item_content += '
'; } itemCounter++; }); pp_jquery(item_content).appendTo(".medialib_block_" + itemType); pp_jquery(".medialib_block").hide().attr('aria-hidden', 'true'); pp_jquery(".medialib_block_" + type).show().attr('aria-hidden', 'false'); item_content = ''; // Check if show more button should show if ((itemCounter == limit) && (!tags)) { pp_jquery('#medialib-content-form').addClass(itemType + '--has-more-items'); } focusMediaItem(offset); }); offset = 4; /* Call to determine action to take depending on the data coming in and if the page is first loading */ toActiveTab(type, Object.keys(data)[0]); pp_jquery(".preloader").fadeOut(); colorbox_image('1'); colorbox_video('1', 'https://media.mercedes-benz.jp/media-library/'); var isMobile = ""; if (!isMobile) { colorbox_file('1'); } mobileResults(); // Reset the silenced click ppMediaLib.click_silencer = 0; }); } /** * Function to determine if media library * tab needs to be switched from original * to other tab; * Called on pageload and on fetching * additional media from DB; * @param type * @param dataType * @returns {boolean} */ function toActiveTab(type, dataType) { /* First if() determines if tab was set in URL and is the same as the active tab. In this case, it does nothing; Second if() determines if active tab is set and if data fetched from DB is for the active tab and switches to that tab; Third if() determines if it's the page's first load and if a tab was specified in the URL. If it has, it switches to the URL specified tab Fourth else sets the previous active tab to null */ if (type !== undefined && ppMediaLib.prevActiveTab === type) { return true; } else if (ppMediaLib.prevActiveTab && dataType === ppMediaLib.prevActiveTab) { switch_types(ppMediaLib.prevActiveTab); } else if (ppMediaLib.quickTab && ppMediaLib.initialLoad) { switch_types(ppMediaLib.quickTab); ppMediaLib.initialLoad = false; } else { ppMediaLib.prevActiveTab = ''; } } function showMore(){ //check which tab is active var type = pp_jquery(".pp-medialib-tabs__list-item.active").data("type"); // Update limit and offset of type ppMediaLibOffsets[type] = ppMediaLibOffsets[type] + ppMediaLib.paginationNumber; show_items(ppMediaLib.currentLimit, ppMediaLibOffsets[type], type); } function showMore_onkeypress(event) { if(event.keyCode === 13 || event.keyCode === 32) { showMore(); } } function accessibilityClick(event){ if(event.type === 'click'){ return true; } else if(event.type === 'keypress'){ var code = event.charCode || event.keyCode; if((code === 32)|| (code === 13)){ return true; } } else{ return false; } } function focusMediaItem (offset) { var focussedMediaItem = pp_jquery('.pp-media-items-' + offset); if (offset != 0) { focussedMediaItem.next().find(pp_jquery('.medialib_item_container')).attr('tabindex', '-1').focus(); } } function filter_onkeypress(filterID, singletag, event) { if(event.keyCode === 13 || event.keyCode === 32) { event.preventDefault(); filter(filterID, singletag); } } function filter(filterID, singletag) { //reset for showMore after filter ppMediaLibOffsets.image = ppMediaLib.currentOffset; ppMediaLibOffsets.video = ppMediaLib.currentOffset; ppMediaLibOffsets.file = ppMediaLib.currentOffset; ppMediaLibOffsets.audio = ppMediaLib.currentOffset; deselectAllItems(); checkMedialibItemsChecked(); removeHasMoreItemsClasses(); pp_jquery('.pp-medialib-no-results').hide(); pp_jquery('.medialib_all .pp-medialib-skip-to-filter-results').attr({ 'aria-hidden': 'true', 'tabindex': -1 }); // Show load icon pp_jquery(".preloader").show(); // To prevent fast clicking if (ppMediaLib.click_silencer == 0) { ppMediaLib.click_silencer = 1; var tags = ''; if (singletag) { var parent_checkboxState = pp_jquery(filterID).find('.parent_checkbox').prop('checked'); if (parent_checkboxState == true) { pp_jquery(filterID).find('.parent_checkbox').prop('checked', false); pp_jquery(filterID).closest('.medialib_list').removeClass('active'); pp_jquery(filterID).find('.medialib_item__toggle').removeClass("pp_icon_checkmark"); pp_jquery(filterID).closest('.medialib_list').find('.pp-medialib-skip-to-filter-results').attr({ 'aria-hidden': 'true', 'tabindex': -1 }); } else { pp_jquery(filterID).find('.parent_checkbox').prop('checked', true); pp_jquery(filterID).closest('.medialib_list').addClass('active'); pp_jquery(filterID).find('.medialib_item__toggle').addClass("pp_icon_checkmark"); pp_jquery(filterID).closest('.medialib_list').find('.pp-medialib-skip-to-filter-results').attr({ 'aria-hidden': 'false', 'tabindex': 0 }); } } var mainHash = pp_jquery(filterID).find('.category_hash').val(); if (typeof(mainHash) !== 'undefined') { ppMediaLib.categoryHash = mainHash; } var checkboxState = pp_jquery(filterID).find('.hidden_formbutton').prop('checked'); // get the hash for the subcategory that was clicked var subHash = pp_jquery(filterID).find('.subcategory_hash').val(); if (checkboxState == true) { if (typeof(subHash !== 'undefined')) { ppMediaLib.categoryHash = ''; // reset the category hash var indexOfHash = ppMediaLib.subCategoryHashList.indexOf(subHash); if (indexOfHash >= 0) { ppMediaLib.subCategoryHashList.splice(indexOfHash, 1); } } pp_jquery(filterID).find('.hidden_formbutton').prop('checked', false); pp_jquery(filterID).find('.pp_checkbox').addClass('pp_icon_checkbox-unchecked').removeClass('pp_icon_checkbox-checked'); } else { if (typeof(subHash) !== 'undefined') { ppMediaLib.categoryHash = ''; // reset the category hash ppMediaLib.subCategoryHashList.push(subHash); } pp_jquery(filterID).find('.hidden_formbutton').prop('checked', true); pp_jquery(filterID).find('.pp_checkbox').addClass('pp_icon_checkbox-checked').removeClass('pp_icon_checkbox-unchecked'); } // check if any subcategory checkboxes of the same list are checked if (!singletag) { var parentList = pp_jquery(filterID).closest('.medialib_list').find('.medialib_subitem'); if (pp_jquery("input:checkbox:checked", parentList).length > 0) { pp_jquery(filterID).closest('.medialib_list').find('.pp-medialib-skip-to-filter-results').attr({ 'aria-hidden': 'false', 'tabindex': 0 }); } else { pp_jquery(filterID).closest('.medialib_list').find('.pp-medialib-skip-to-filter-results').attr({ 'aria-hidden': 'true', 'tabindex': -1 }); } } //CHECK WHICH CHECKBOXES ARE SELECTED AND LOOP THROUGH THEM var checkedValues = pp_jquery('#medialib_filter input:checkbox:checked').map(function () { return this.value; }).get(); // if only one checkbox is selected after the second one is deselected, we need to get the hash of the // checkbox that is still selected. if (checkedValues.length === 1) { var checkedInput = pp_jquery('#medialib_filter input[value="' + checkedValues[0] + '"]'); ppMediaLib.categoryHash = checkedInput.prev('input.category_hash').val(); } pp_jquery.each(checkedValues, function (index, item) { tags += "&tags[]=" + encodeURIComponent(item); }); resetMediaContainer(); // IF ALL FILTERS ARE DESELECTED, TOGGLE SHOWALL BUTTON TO ACTIVE if (!tags) { pp_jquery('.medialib_all').addClass("active"); } var categoryHashParameter = getCategoryHashParameter(); show_items(ppMediaLib.currentLimit, ppMediaLib.currentOffset, '', tags, '', categoryHashParameter); } } function resetFilterMenu() { pp_jquery('#medialib_filter').find('input[type=checkbox]:checked').prop('checked',false); pp_jquery('.medialib_menu li').removeClass("active"); pp_jquery('.medialib_menu').find('.pp-medialib-skip-to-filter-results').attr({ 'aria-hidden': 'true', 'tabindex': -1 }); pp_jquery("body").find('.pp_checkbox').removeClass("pp_icon_checkbox-checked"); pp_jquery("body").find('.pp_checkbox').addClass("pp_icon_checkbox-unchecked"); pp_jquery('.medialib_hasItems .medialib_item__toggle').removeClass("pp_icon_arrow-down"); pp_jquery('.medialib_hasItems .medialib_item__toggle').addClass("pp_icon_caret-right"); pp_jquery('.medialib_subitem').hide(); pp_jquery('.medialib_subitem').removeClass("open"); pp_jquery('.medialib_subitem').addClass("closed"); pp_jquery('.medialib_item__toggle').removeClass("pp_icon_checkmark"); } function show_all() { resetFilterMenu(); filter(); pp_jquery('.medialib_all').addClass("active").find('.pp-medialib-skip-to-filter-results').attr({ 'aria-hidden': 'false', 'tabindex': 0 }); } function show_all_keypress(event) { if(event.keyCode === 13 || event.keyCode === 32) { show_all(); } } function switch_types(type) { pp_jquery('.medialib_block').removeClass('medialib_block--checked'); pp_jquery('.pp-medialib-no-results').hide(); pp_jquery(".js-medialib_tabitem").removeClass('active'); pp_jquery('.pp-medialib-tabs__link').attr('aria-selected', 'false'); pp_jquery(".pp-medialib-tabs_" + type).addClass('active').find('.pp-medialib-tabs__link').attr('aria-selected', 'true'); // Update active tab class in form-wrapper so the pp-moreItems button can be shown or hidden. pp_jquery('#medialib-content-form').removeClass('image--active-tab video--active-tab audio--active-tab file--active-tab'); pp_jquery('#medialib-content-form').addClass(type + '--active-tab'); // Toggle download buttons if ((type == 'file') || (type == 'audio') || (type == 'video')) { pp_jquery(".js-medialibFileDownloadLabel").css('display', 'table'); pp_jquery("#image_download").hide(); } else { pp_jquery("#image_download").show(); pp_jquery(".js-medialibFileDownloadLabel").css('display', 'none'); } pp_jquery(".medialib_block").hide().attr('aria-hidden', 'true'); pp_jquery(".medialib_block_" + type).show().attr('aria-hidden', 'false'); ppMediaLib.prevActiveTab = type; pp_jquery('.pp-skip-medialib-filter').focus(); } function no_results() { pp_jquery('.pp-medialib-no-results').fadeIn(); ppMediaLib.click_silencer = 0; pp_jquery('.preloader').hide(); pp_jquery('.js-medialib_tabitem').hide(); removeHasMoreItemsClasses(); if (pp_jquery('.pp-medialib-filter-header').is(':visible')) { pp_jquery('.pp-medialib-filter-header__title').html('0 item(s)'); pp_jquery('.pp-medialib-filter-header__close').removeClass('pp_icon_check pp-zoom-in pp-animated'); } } function deselectAllItems() { pp_jquery('.medialib_item_checkbox').prop('checked',false); pp_jquery('.medialib_all').removeClass("active"); } // show all checkboxes if one checkbox is checked function checkMedialibItemsChecked() { if (pp_jquery('.medialib_item_checkbox:checked').length > 0) { var selectedItems = pp_jquery('.medialib_item_checkbox:checked').length; pp_jquery('.pp-medialib-select__item-number').text('(' + selectedItems + ')'); pp_jquery('.pp_medialib_item__label').animate({opacity: 1}, 200); pp_jquery('.pp-medialib-tabs, .pp-medialib-searchbox').addClass('pp-visibility-hidden'); pp_jquery('.pp-medialib-select').show(); pp_jquery('.medialib_block').addClass('medialib_block--checked'); pp_jquery('.js-medialibItemOverlay').stop().animate({opacity: 1}, 200); } else { pp_jquery('.pp_medialib_item__label').animate({opacity: 0}, 200); pp_jquery('.medialib_block').removeClass('medialib_block--checked'); pp_jquery('.pp-medialib-select').fadeOut(200); pp_jquery('.pp-medialib-tabs, .pp-medialib-searchbox').removeClass('pp-visibility-hidden'); pp_jquery('.js-medialibItemOverlay').stop().animate({opacity: 0}, 200); pp_jquery('.pp-medialib-select__item-number').text(""); } } function search() { deselectAllItems(); checkMedialibItemsChecked(); removeHasMoreItemsClasses(); resetFilterMenu(); var keyword = pp_jquery("#searchlibrary").val(); if (keyword.length > 0) { // Show load icon pp_jquery(".pp-medialib-no-results").hide(); pp_jquery(".preloader").show(); resetMediaContainer(); show_items(ppMediaLib.currentLimit, ppMediaLib.currentOffset, '', '', keyword); } else { filter(); } } function resetSearch() { pp_jquery('#searchlibrary').val(''); show_all(); } function removeExtension(str) { str = str.split('.').slice(0, -1).join('.'); return str; } function temp_disableMe() { pp_jquery(".js-medialibFileDownloadLabel").css('opacity', 0.2); setTimeout(function () { pp_jquery(".js-medialibFileDownloadLabel").css('opacity', 1); }, 1500); }
ダウンロード  
preloader
検索結果なし
Show more items
Back to Top