/** * 定义布局对象CCBUI */ var PLayout = { bfree: '' + '
' + '
' + ' ' + ' ' + '
' + '
' + '
' + '
' + ' ' + ' ' + '
' + '

大字幕

' + '
' } /** * 加载页面部件 */ $(function () { document.cookie = 'whiteFreeSty=1; path=/CCBIS'; document.cookie = 'forceFreeSty=1; path=/CCBIS'; var _wza = $('#wza'); if (_wza.length > 0) { _wza.html(PLayout.bfree); // 无障碍点击 $(".wza_btn").on("click", function () { $('#ccbPage').css('marginTop', $('#bfree').height() + 'px'); bfree_fn('on'); }) $("a.backClassical").on("click", function(){ document.cookie = 'whiteFreeSty=0; path=/CCBIS'; document.cookie = 'forceFreeSty=0; path=/CCBIS'; location.href = "/CCBIS/V6/STY1/CN/login.jsp"; }); setTimeout(function(){ $('#ccbPage').css('marginTop', $('#bfree').height() + 'px'); bfree_fn('on'); }, 1000); $("#bfree_bar_exit").on('click', function(){ document.cookie = 'whiteFreeSty=0; path=/CCBIS'; document.cookie = 'forceFreeSty=0; path=/CCBIS'; location.href = "/CCBIS/V6/STY1/CN/login.jsp"; }) }; }); var iframeOffset = {top: 0, left: 0}, crossCurveCtr = 0, textMode = {}; $(function () { if (undefined !== top.bfree_fn) { // 语音指读、大字幕、十字线 $('body').on('mouseenter','*', function (event) { if (crossCurveCtr === 0) { confrimIframeOffset('window'); crossCurveCtr = 1; } var event = event || window.event; throttle(handleMouseEnterEvent(event), 150); }).on('mousemove', function (event) { var event = event || window.event; throttle(handleEvent(event), 150) }).on('mouseleave', function (event) { iframeOffset = {top: 0, left: 0}; crossCurveCtr = 0 }); // 鼠标样式 $('body').css({'cursor': top.$('body').css('cursor'), 'zoom': top.$('body #ccbPage').css('zoom'), transform: top.$('body #ccbPage').css('transform')}); // 放大、缩小字体 $('body *:not("body #wza *")').each(function () { if ($(this)[0].tagName !== 'SCRIPT') { $(this).css('font-size', $(this).css('font-size')) } }) if (top.changeFont.fontZoom != 1) { if (top.changeFont.fontZoom > 1) { top.changeFont.change('bigger'); } else { top.changeFont.change('smaller'); } } // 颜色配比 // var iframeBody = $('body') if (self !== top) { $('head').append(''); top.Observer && top.Observer.regist('changeTheme', changeTheme); } // top.Observer && top.Observer.regist('changeTextMode', changeTextMode); top.Observer && top.Observer.regist('changeZoom', changeZoom); top.Observer && top.Observer.regist('changeArrow', changeArrow); } }) var throttle = function (func, delay) { var timer = null; return function () { var context = this; var args = arguments; if (!timer) { timer = setTimeout(function () { func.apply(context, args); timer = null; }, delay); } }; }; function changeTextMode () { if (top.textMode.status == 'off') { textMode.cloneHeadNode = $('head').eq(0).clone(true); textMode.cloneBodyNode = $('body').eq(0).clone(true); var bfree_tool_iframe = $('body *:not("#wza *")'); //$(bfree_tool_iframe).find("style:not(#d-outer,#d-outer *)").remove(); $(bfree_tool_iframe).find('*:not(#bfree *)').each(function () { if (this.tagName == 'rect' || this.tagName === 'svg') {return} if (this.tagName == 'IMG') { var imgAlt = ''; if (this.alt != null && this.alt != '' && this.alt != '无意义图片') { imgAlt = this.alt; } else { top.textMode.imgAlt(imgAlt); } $(this).replaceWith('' + imgAlt + ''); } else if (this.tagName == 'A' && this.innerHTML == '') { var aText = ''; if (this.title != '' && this.title != null) { aText = this.title; } else if (this.alt != '' && this.alt != null) { aText = this.alt; } this.innerHTML = aText; } else { if ($(this).css('display') === 'none') { $(this).removeAttr('style').removeAttr('background').removeAttr('valign').removeAttr('align').removeAttr('height').removeAttr('width'); $(this).css('display', 'none'); } else { $(this).removeAttr('style').removeAttr('background').removeAttr('valign').removeAttr('align').removeAttr('height').removeAttr('width'); } if (this.tagName != 'A') { $(this).css('text-decoration', 'none'); } } }); $(document.getElementsByTagName('head')).find('link').remove(); $(document.getElementsByTagName('head')).find('style').remove(); $(bfree_tool_iframe).find('style').remove(); $(bfree_tool_iframe).find('link:not(#bfree_css)').remove(); var bfreeCss = ''; $('head').eq(0).append(bfreeCss); $(bfree_tool_iframe).find('div.sidebar').remove(); } else if (top.textMode.status == 'on') { $('html').empty(); $('html').append(textMode.cloneHeadNode).append(textMode.cloneBodyNode); } } function changeTheme (modeStyle) { if (null === top) return var bfree_tool_iframe = $('body'); var thmeMode = modeStyle.args; try { if (thmeMode != 'highContrast_5') { $(bfree_tool_iframe).removeClass(top.highContrast.pageColor); $(bfree_tool_iframe).addClass(thmeMode); $(bfree_tool_iframe).find('*:not("script")').each(function () { $(this).removeClass(top.highContrast.pageColor); $(this).addClass(thmeMode); }); } else { $(bfree_tool_iframe).removeClass(top.highContrast.pageColor); $(bfree_tool_iframe).find('*:not("script")').each(function () { $(this).removeClass(top.highContrast.pageColor); }); } $('.logo img').css({ 'background-color': '#fff' }); } catch (e) {} }; function changeZoom (arg) { if (top === self || null === top) return; var nowZoom = arg.args; if (BROWSER.isCurrIE9() || BROWSER.isCurrIE10() || BROWSER.isCurrIE8() || (navigator.userAgent.indexOf('Mozilla') > -1 && navigator.userAgent.indexOf('Firefox') > 0)){ nowZoom = 1+((nowZoom-1)/10); } var bfree_tool_iframe = $('body'); if (top.mozilla || top.opera) { bfree_tool_iframe.css({ transform: 'scale(' + nowZoom + ')', 'transform-origin': 'top' }); } else { bfree_tool_iframe.css({ zoom: nowZoom.toFixed(2), overflow: 'scroll', 'overflow-x': 'hidden' }); } } function changeArrow (arg) { if (top === self ) return; var ico = arg.args; if (ico === '') { $('body').css('cursor', 'auto'); $('body').find('a').css('cursor', 'pointer'); } else { $('body').css('cursor', 'url(' + ico + '), auto').find('a').css('cursor', 'url(' + ico + '), auto'); } } function handleMouseEnterEvent (event) { var target = event.srcElement || event.target; if (target.childNodes.length > 1 || $(target).find('*').length > 1 || $(target).is('SCRIPT')) { return false; } // 大字幕 if (!top.bigtext.onoff) { top.bigtext.veiw($(target).text()); } // 语音指读 if (top.speak.thisdomOnOff) { var id = $(target).attr('id') !== '' && undefined !== $(target).attr('id') ? $(target).attr('id') + (top.notNameNum++) : undefined !== $(target).attr('class') && $(target).attr('class') !== '' ? $(target).attr('class') + (top.notNameNum++) : 'notName' + (top.notNameNum++); if (BROWSER.isCurrIE9() || BROWSER.isCurrIE8()) { if (top.pointerC == 0) { top.pointerC = 1; // alert("语音指读暂不支持 IE8、IE9"); } return; } if ($(target).text() !== '') { top.getTTSURL($(target).text()).then(function (url) { console.log(id, $(target).text(), url) top.speak.on(id, url); }); } } } function handleEvent (event) { // 十字线 start var childHeight = top.document.documentElement.scrollHeight || top.document.body.scrollHeight; if (top.guides.statusguides == 'off') { var pointer = top.getCoordInDocument(event); if (undefined !== iframeOffset && iframeOffset !== '') { top.$('#slideLateral').css('top', (iframeOffset.top + pointer.y) + 10); top.$('#slideLongitudinal').css({'left': (pointer.x + iframeOffset.left) + 10, 'height': childHeight + 100}); } else { top.$('#slideLateral').css('top', pointer.y + 10); top.$('#slideLongitudinal').css({'left': pointer.x + 10, 'height': childHeight + 100}); } } } function confrimIframeOffset (doc) { var targetWin = eval(doc) if (targetWin.frameElement === null) {return;} iframeOffset = { top: iframeOffset.top + top.getElementTop(targetWin.frameElement), left: iframeOffset.left + top.getElementLeft(targetWin.frameElement) } if (parent !== top) { confrimIframeOffset('parent.'+doc) } }