var hdhe_cid = $('#hdhe_page_meta_id').attr('data-id'); $('html').addClass('html_c' + hdhe_cid); if (window.location.host.indexOf('www') == -1) { // url fix $("a[href*='/_s2/']").each(function() { if ($(this).attr('href').indexOf('/_t550/') == -1 && $(this).attr('href').toLowerCase().indexOf('http://') == -1 && $(this).attr('href').toLowerCase().indexOf('https://') == -1) { $(this).attr('href', ($(this).attr('href').replace('/_s2/', '/_s2/_t550/'))); } }) // cat name fix $('#nav ul li .sub .box a').each(function() { if ($(this).text().indexOf('【') > -1) { $(this).text($(this).text().replace('【v2022】', '')) }; }) $('#nav ul li .sub .box a').each(function() { if ($(this).text().indexOf('2') > -1) { $(this).text($(this).text().replace('2', '')) }; }) $('#nav ul li a h3').each(function() { if ($(this).text().indexOf('【') > -1) { $(this).text($(this).text().replace('【v2022】', '')) }; }) $('#nav ul li a h3').each(function() { if ($(this).text().indexOf('2') > -1) { $(this).text($(this).text().replace('2', '')) }; }) } // top menu current $('#nav > ul > li > a[data-cid="' + hdhe_cid + '"]').parent().addClass('on'); $('#nav .sub .box a[data-cid="' + hdhe_cid + '"]').parent().parent().parent().addClass('on'); if( $('#nav .on').length == 0 ) { $('#nav > ul > li:eq(0)').addClass('on'); } // current selected $('.hdhe_selected_item_class.selected').each(function(i) { $(this).addClass($(this).attr('data-selected')) }); // path if ( $('.adress a').length > 0 && $('.adress .possplit').length > 0 ) { var ahtml = ''; var l = $('.adress a').length; $('.adress a').each(function(i) { var ah = $(this).attr('href'); var at = $(this).text(); var as = '>'; if (i > 0) { ahtml = ahtml + as; } if (i + 100 != l) { ahtml = ahtml + '' + at + ''; } else { ahtml = ahtml + at; } }) $('.adress').html(ahtml) } // banner var bannerDOM = $('.banner[portletmode="simpleColumnAttri"] img'); if (bannerDOM.length > 0 && bannerDOM.attr('data-cimg').length > 0) { $('.banner img').attr('src', bannerDOM.attr('data-cimg')) } if( $('.html_index').length ) { // -------------- $('.cluture_subcat_info span').each(function(i) { var t = $(this).attr('data-title'); var h = $(this).attr('data-url'); if (i == 0) { $('.hdhe_sub_cat_a a').attr('href', h); $('.hdhe_sub_cat_a h5').html(t); } else { $('.hdhe_sub_cat_b a').attr('href', h); $('.hdhe_sub_cat_b h5').html(t); } }) //--------------- } if ($('.html_list_thumb').length) { // default thumb var defaultImg = $('.header_bottom .logo img').attr('src'); $('.news-r. .scale img').each(function() { if ($(this).attr('src').length < 1) { $(this).attr('src', defaultImg).parent().css({ 'background': '#a31a2f' }); } }) } // total visit count if($('#site_count_source').length) { var cDetect = setInterval(function() { if ($('#site_count_source .siteCounter5 span').length > 2) { clearInterval(cDetect); var cNum = $('#site_count_source .siteCounter5').html(); var cHtml = '
上海中医药大学第' + cNum + '位访客
'; $('footer .fl02 .center').append(cHtml); } }, 500); } if( $('.html_list_people_text').length || $('.html_displayinfo-not-used').length ) { $('.list_box14 li.miso-slide h5.FZSSJW span.aline_r, .html_displayinfo .jsdh .inn_com .content h2.tit, .html_list_people_text .jsdh .inn_com li a').each(function(){ var th = $(this).html(); var tinfo = 'data-modified-by-js' if( th.indexOf('朱南孙')> -1) { var tnh = th.replace('朱南孙', '朱南孙'); $(this).html(tnh) } if( th.indexOf('桑国卫')> -1) { var tnh = th.replace('桑国卫', '桑国卫'); $(this).html(tnh) } if( th.indexOf('裘沛然')> -1) { var tnh = th.replace('裘沛然', '裘沛然'); $(this).html(tnh) } if( th.indexOf('石印玉')> -1) { var tnh = th.replace('石印玉', '石印玉'); $(this).html(tnh) } }) }