github.com/oinume/lekcije@v0.0.0-20231017100347-5b4c5eb6ab24/backend/infrastructure/dmm_eikaiwa/testdata/49393_files/teacher-index.pc.bundle.js (about)

     1  $(function(){function adjustScrollPosition(){var onedayHeader=$('.schedules-list ul').find("li:first");var onedayHeaderTop=onedayHeader.offset().top;var $w=$(window);$w.scroll(function(){var shouldBeFixed=$w.scrollTop()>onedayHeaderTop;if(shouldBeFixed){onedayHeader.css({position:'fixed',top:0,})}else if(!shouldBeFixed){onedayHeader.css({position:'static'})}})}
     2  function showOnlySelectedTime(sect){$('li[class^=t-]').css('display','none');sect.css('display','block')}
     3  function slideSchedule(toggle){var sect='';if(toggle==1){sect=$('.t-02-00, .t-02-30, .t-03-00, .t-03-30, .t-04-00, .t-04-30, .t-05-00, .t-05-30, .t-06-00, .t-06-30');showOnlySelectedTime(sect)}else if(toggle==2){sect=$('.t-07-00, .t-07-30, .t-08-00, .t-08-30, .t-09-00, .t-09-30, .t-10-00, .t-10-30, .t-11-00, .t-11-30');showOnlySelectedTime(sect)}else if(toggle==3){sect=$('.t-12-00, .t-12-30, .t-13-00, .t-13-30, .t-14-00, .t-14-30, .t-15-00, .t-15-30, .t-16-00, .t-16-30');showOnlySelectedTime(sect)}else if(toggle==4){sect=$('.t-17-00, .t-17-30, .t-18-00, .t-18-30, .t-19-00, .t-19-30, .t-20-00, .t-20-30, .t-21-00, .t-21-30');showOnlySelectedTime(sect)}else if(toggle==5){sect=$('.t-22-00, .t-22-30, .t-23-00, .t-23-30, .t-24-00, .t-24-30, .t-25-00, .t-25-30');showOnlySelectedTime(sect)}else{$('li[class^=t-]').css('display','block')}}
     4  $('.btn-movie').on('click','a',function(e){e.preventDefault();$me=$(this);$class_name=$me.attr('class');if($class_name==undefined||$class_name==''){$me.addClass("show");$me.find('span').text('元の画像に戻す');$('img.profile-pic').hide();$('iframe.profile-youtube').fadeIn()}else if($class_name=='show'){$me.removeClass("show");$me.find('span').text('動画を見る');$('iframe.profile-youtube').hide();$('img.profile-pic').fadeIn()}});$('.search-time li a').click(function(){$('.search-time li').removeClass('on');$(this).parent().addClass('on');var selected=$(".search-time li a").index(this);slideSchedule(selected);return!1});$(document).on('click','.tab-navi ul li',function(){$teacher_id=$('.profile.float-l').attr('id');$tab=$(this).find('a').attr("id");$funName='/teacher/tab_ajax_'+$tab+'/';$(window).off('scroll');$.post($funName,{teacher_id:$teacher_id},function(rs){$('div.area-'+$tab).html(rs);adjustScrollPosition()});$('.tab-navi ul li').removeClass('on');$(this).addClass('on');$('.tab-content').hide();$($(this).find('a').attr('href')).fadeIn();return!1});$(document).on('click','#lesson_pager li a',function(e){e.preventDefault();$teacher_id=$('.profile.float-l').attr('id');$page=$(this).attr('id');$.post('/teacher/tab_ajax_lessonhistory/',{teacher_id:$teacher_id,page:$page},function(rs){$(".area-lessonhistory").html(rs)})});$(document).on('click','.list-boxcaptside.list-boxpagenation.detail.pager li a',function(e){e.preventDefault();$teacher_id=$('.profile.float-l').attr('id');$page=$(this).attr('id');var rating=$('.list-boxcaptside.list-boxpagenation.detail.pager').data('rating');$.post('/teacher/tab_ajax_ratecomment/',{teacher_id:$teacher_id,page:$page,rating:rating},function(rs){$(".area-ratecomment").html(rs)})});$(document).on('click','li .total_star',function(){var rating=$(this).parent().children('.star').text();$teacher_id=$('.profile.float-l').attr('id');$tab='ratecomment';$funName='/teacher/tab_ajax_'+$tab+'/';$(window).off('scroll');$.post($funName,{teacher_id:$teacher_id,rating:rating},function(rs){$('div.area-'+$tab).html(rs);adjustScrollPosition()});return!1});var onedayHeader=$('.schedules-list ul').find("li:first");var onedayHeaderTop=onedayHeader.offset().top;var $w=$(window);var isFixed=!1;$w.scroll(function(){var shouldBeFixed=$w.scrollTop()>onedayHeaderTop;if(shouldBeFixed&&!isFixed){onedayHeader.css({position:'fixed',top:0,});isFixed=!0}else if(!shouldBeFixed&&isFixed){onedayHeader.css({position:'static'});isFixed=!1}});var loadRecentMemo=function(){if($('#lessonhistory').data('conducted_book_count')===0||!$('#recent_memo_container')){return!1}
     5  $.ajax({type:"POST",url:"/teacher/ajax_recent_memo/",dataType:"html",data:{'teacher_id':$('.profile.float-l').attr('id'),},beforeSend:function(){$("#recent_memo_container").html("<div style='width:100%'><br /><img style='display:table-cell;vertical-align:middle;margin:auto;' src='https://image.eikaiwa.dmm.com/assets/p/general/eikaiwa/evalute_teacher/pc_loading.gif' /></div>")},complete:function(response){if(response.status==200&&response.readyState==4){$("#recent_memo_container").html(response.responseText);var target=$('#recent_memo dd span.inner'),count=target.text().length,limit=95;if(count>limit){var getTxt=target.text(),cutTxt=getTxt.substr(0,(limit));target.html(cutTxt+'…')}}else{$("#recent_memo_container").html("")}}})}
     6  $(".time li:nth-child(2n+1)").css("background-color","#ebebeb");$(".oneday li:nth-child(2n+1)").css("background-color","#fff");$('.tab-content:eq(0)').show();$('.tab-navi ul li:eq(0)').addClass('on');$('.tab-navi ul li:eq(0)').trigger('click');loadRecentMemo()});$(function(){$(document).on('click','.favorite-toggle',function(e){e.preventDefault();var teacher_id=$(this).data('teacher-id');var button_type=$(this).data('button-type');toggleFavorite(teacher_id,function(response){if(response.success){toggleFavoriteButtonState(teacher_id,response.message,button_type);if(!!response.popup){setPremiumPlanPopupMessage(response);togglePopup('pop_button',response.popup)}}else{switch(response.message){case 'notPermit':return $(location).attr('href','/trial/');default:break}}})});$(document).on('click','.fav_add',function(e){e.preventDefault();var teacher_id=$(this).data('teacher-id');toggleFavorite(teacher_id,function(response){if(response.success){var favorite_state=$("div").find("[data-teacher-id='"+teacher_id+"']");favorite_state.each(function(){(response.message=='added')?$(this).addClass('on'):$(this).removeClass('on');if(!$(this).is(':empty')){(response.message=='added')?$(this).text('お気に入り解除'):$(this).text('お気に入り登録')}});var fav_count=(response.message=='added')?parseInt($('#fav_count').text())+parseInt(1):parseInt($('#fav_count').text())-parseInt(1);$('#fav_count').html('<img src="https://image.eikaiwa.dmm.com/assets/p/sp/general/eikaiwa/evalute_teacher/sp_heart_noline.png"> '+fav_count+' 件');if(!!response.popup){setPremiumPlanPopupMessage(response);togglePopup('pop_button',response.popup)}}else{switch(response.message){case 'notPermit':return $(location).attr('href','/trial/');default:break}}})})});function setPremiumPlanPopupMessage(response){if(response.popup=='premium_teacher_popup'&&!!response.popup_message){if(response.popup_message=='native_plan_popup'){$('.premium_teacher_popup .description').html("ネイティブ講師または日本人講師の予約はプラスネイティブプラン会員の方のみ可能となります。")}else{$('.premium_teacher_popup .description').html("英語以外の言語を学ぶための講師の予約はプラスネイティブプラン会員の方のみ可能です。")}}}
     7  function toggleFavorite(teacher_id,callback){$.ajax({type:"POST",url:"/favorite/toggleFavorite/",data:{teacher_id:teacher_id},dataType:"json",success:function(response){if(typeof(callback)==='function')callback(response)}})}
     8  function toggleFavoriteButtonState(teacher_id,response,button_type,callback){var favorite_state=$("div").find("[data-teacher-id='"+teacher_id+"']");favorite_state.each(function(){switch(button_type){case 'FAV_BUTTON_TYPE_STAR':var src='https://image.eikaiwa.dmm.com/assets/p/general/eikaiwa/evalute_teacher/';var state=(response=='added')?'pc_heart_color.png':'pc_heart_grey.png';src=src+state;$(this).attr('src',src);break;case 'FAV_BUTTON_TYPE_STAR_WITH_TEXT':var fav_count=(response=='added')?parseInt($('#fav_count').text())+parseInt(1):parseInt($('#fav_count').text())-parseInt(1);$('#fav_count').text(fav_count);if(response=='added'){button='<img src="https://image.eikaiwa.dmm.com/assets/p/general/eikaiwa/evalute_teacher/pc_heart_color.png"> お気に入り登録済'}else{button='<img src="https://image.eikaiwa.dmm.com/assets/p/general/eikaiwa/evalute_teacher/pc_heart_grey.png"> お気に入り登録'}
     9  $(this).html(button);break}});if(typeof(callback)==='function')callback({success:!0})}