1
0
mirror of synced 2024-11-22 10:03:51 +00:00
G940LEDControl/MSDN/SimConnect_files/Combined(1).js
Mark van Renswoude 57037928ca Changed: FSX state is now more accurately reflected in the UI
Added: seperate left/right/nose/tail gear functions
Added: flaps handle position based on index and percentage
2015-12-29 11:22:23 +00:00

8 lines
11 KiB
JavaScript

epx=window.epx||{};epx.printExportButton=function(){function init(){initialized||(initialized=!0,epx.utilities&&epx.utilities.supportsHtml5())&&($pabLink=$("#isd_printABook, #isd_printABook2"),$toolbar=$("#exportToolBar"),$pabLink.click(pabLinkClicked),$toolbar.length>0&&$toolbar.is(":visible")&&($pabLink.addClass("exportToolBarShown"),$pabLink.css("cursor","text")),refreshExportCount(),$pabLink.show(),$("#isd_archiveControl").click(function(){var control=$("#isd_archiveControl");control.text()!=""&&($("#tocnav").hasClass("hide-archive")?control.text(control.attr("data-exclude-archive")):control.text(control.attr("data-include-archive")),$("#tocnav, #content.bumper").toggleClass("hide-archive"))}))}function pabLinkClicked(event){if($toolbar.length>0&&$toolbar.is(":visible")){event.preventDefault();return}getTopicCount()>0&&(window.epx.utilities.setCookie("ShowPrintToolBar","true",365,"/"),location.reload(!0),event.preventDefault())}function getTopicCount(){var topicsCount=0,book,c,t;if(typeof localStorage.book!="undefined"){book=JSON.parse(localStorage.book);for(c in book.Chapters)for(t in book.Chapters[c].Topics)if(topicsCount=topicsCount+book.Chapters[c].Topics[t].Count,book.Chapters[c].Topics[t].Count<=0||book.Chapters[c].Topics[t].Type==="node"&&book.Chapters[c].Topics[t].Count===1||book.Chapters[c].Topics[t].Type==="topic"&&book.Chapters[c].Topics[t].Count!==1||book.Chapters[c].Topics[t].Type!=="topic"&&book.Chapters[c].Topics[t].Type!=="node")return 0}return topicsCount}function refreshExportCount(count){localStorage.book&&(count||(count=getTopicCount()),initialized||init(),$pabLink.find(".count").text(count))}function removeExportBorder(){$pabLink.removeClass("exportToolBarShown");$pabLink.css("cursor","pointer")}var $pabLink,$toolbar,initialized=!1;return{init:init,refreshExportCount:refreshExportCount,removeExportBorder:removeExportBorder}}();$(document).ready(function(){epx.printExportButton.init()});;
(function(){var tocFixedModule=function(w,d,$){function init(){var $rtlDirAttribute,$parameters,param;window.epx&&window.epx.topic&&window.epx.topic.isPrintExperience()===!0||($rtlDirAttribute=$('html[dir="rtl"]'),isRtl=$rtlDirAttribute&&$rtlDirAttribute.length>0,$parameters=$("#fixLeftNavParameters"),param=$parameters.length>0?$parameters.val().split(","):null,$leftNav=param!=null&&param[1]!=null?$(param[1]):$("#leftNav"),$toc=param!=null&&param[2]!=null?$(param[2]):$("#tocnav"),$mainContent=param!=null&&param[3]!=null?$(param[3]):$leftNav.next(),$footer=$("#lib-footer"),$footer.length===0&&($footer=$("#ux-footer")),w&&d&&$leftNav.length!==0&&$toc.length!==0&&$footer.length!==0)&&(param!=null&&param[0]!=null&&(fixedTocTop=Number(param[0])),setPosition(),setHorizontalPosition(),$(w).scroll(function(){setPosition();setHorizontalPosition()}),$(w).resize(function(){setPosition();setHorizontalPosition()}))}function setHorizontalPosition(){if(isDesktopView()){var positionToChange=isRtl?"right":"left",documentScrollLeft=$(d).scrollLeft();lastScrollLeft!=documentScrollLeft?(lastScrollLeft=documentScrollLeft,$toc.css(positionToChange,isRtl?documentScrollLeft:-documentScrollLeft)):documentScrollLeft==0&&$toc.css(positionToChange,"")}}function isDesktopView(){return epx.library!=undefined&&epx.library!=null&&epx.library.responsive!=undefined&&epx.library.responsive!=null?epx.library.responsive.getCurrentViewType()==epx.library.responsive.viewTypes.Desktop:!0}function setPosition(){var nonFooterViewable,visibleContentHeight;if(isDesktopView()){var windowHeight=$(w).height(),documentHeight=$(d).height(),tocHeight=$toc.height(),mainContentHeight=$mainContent.height();windowHeight>tocHeight+fixedTocTop&&mainContentHeight>tocHeight+fixedTocTop&&$(w).scrollTop()+fixedTocTop>$leftNav.offset().top?($toc.width($leftNav.width()).css("position","fixed"),$leftNav.css("height",tocHeight),nonFooterViewable=$footer.offset().top-$(w).scrollTop()-60,nonFooterViewable>=tocHeight+fixedTocTop?$toc.css("top",fixedTocTop+"px"):$toc.css("top",(tocHeight-nonFooterViewable)*-1)):windowHeight<tocHeight+fixedTocTop&&mainContentHeight>tocHeight+fixedTocTop&&$(w).scrollTop()+windowHeight>tocHeight+$leftNav.offset().top?($toc.width($leftNav.width()).css("position","fixed"),$leftNav.css("height",tocHeight),visibleContentHeight=$footer.offset().top-$(w).scrollTop()-60,visibleContentHeight>=windowHeight?$toc.css("top",(tocHeight-windowHeight)*-1):$toc.css("top",(tocHeight-visibleContentHeight)*-1)):($toc.css("width","").css("position","").css("top",""),$leftNav.css("height","auto"))}}var $leftNav,$toc,$footer,$mainContent,fixedTocTop=60,lastScrollLeft=0,isRtl=!1;return $(document).ready(function(){init()}),{init:init,setPosition:setPosition}};typeof define=="function"&&window.mtpsAmd?define("tocFixed",["jquery"],function($){return tocFixedModule(window,document,$)}):(window.epx=window.epx||{},window.epx.library=window.epx.library||{},window.epx.library.tocFixed=tocFixedModule(window,document,$))})();;
epx=window.epx||{};epx.codeSnippetModule=function(w,d){function init(){scrollOnLoad();initCopyLinks()}function initCopyLinks(){w.clipboardData&&$("a[name=CodeSnippetCopyLink]").css("display","block")}function copyCode(id){if(w.clipboardData){var obj=d.getElementById(id);w.clipboardData.setData("Text",obj.innerText)}}function scrollOnLoad(){var hash=location.hash,hashY;hash.length>1&&hash.substr(1,1)==="Y"&&(hashY=Number(hash.substr(2)),isNaN(hashY)||w.scrollTo(0,hashY))}return{init:init,initCopyLinks:initCopyLinks,copyCode:copyCode,scrollOnLoad:scrollOnLoad}};epx.codeSnippet=epx.codeSnippetModule(window,document);$(document).ready(function(){epx.codeSnippet.init()});;
function TopicNotInScope_ShowPicker(){var topicNotInScopePicker=document.getElementById("topicNotInScopeCollectionPicker");topicNotInScopePicker&&(topicNotInScopePicker.style.display=topicNotInScopePicker.style.display!="block"?"block":"none")}function TopicNotInScope_HidePicker(e){var topicNotInScopePicker=document.getElementById("topicNotInScopeCollectionPicker"),src,e;topicNotInScopePicker&&(e=e||window.event,e.target?src=e.target:e.srcElement&&(src=e.srcElement),src.tagName=="A"&&src.parentNode.parentNode&&src.parentNode.parentNode.id=="topicNotInScopeCollectionPicker"||src.id=="topicNotInScopeSwitchCollection"||src.id=="topicNotInScopeDropdownImage"||src.id=="topicNotInScopeSwitchCollectionContainer"||topicNotInScopePicker.style.display!="block"||(topicNotInScopePicker.style.display="none"))}document.addEventListener?document.addEventListener("mouseup",TopicNotInScope_HidePicker,!1):document.attachEvent&&document.attachEvent("onmouseup",TopicNotInScope_HidePicker);;
epx=window.epx||{};epx.collapsibleArea=function(){function init(){$expandCollapseAllButton=$("a#expandCollapseAll");$titleAnchor=$("a.LW_CollapsibleArea_TitleAhref");$titleAnchor.length===0&&(isEnhanced=!1);$expandCollapseAllButton.length===0&&(isEnhanced=!1);isEnhanced||$expandCollapseAllButton.hide();expandedCaretClass="cl_CollapsibleArea_expanding LW_CollapsibleArea_Img";collapsedCaretClass="cl_CollapsibleArea_collapsing LW_CollapsibleArea_Img";expandedCaretSelector="span.cl_CollapsibleArea_expanding.LW_CollapsibleArea_Img";collapsedCaretSelector="span.cl_CollapsibleArea_collapsing.LW_CollapsibleArea_Img";var stringsAvailable=typeof window.MTPS!="undefined"&&typeof window.MTPS.LocalizedStrings!="undefined";stringsAvailable&&(isEnhanced?(expandTooltip=window.MTPS.LocalizedStrings.EnhancedExpandTooltip,collapseTooltip=window.MTPS.LocalizedStrings.EnhancedCollapseTooltip):(expandTooltip=window.MTPS.LocalizedStrings.ExpandButtonTooltip,collapseTooltip=window.MTPS.LocalizedStrings.CollapseButtonTooltip),$(".cl_CollapsibleArea_expanding").parent().attr("title",collapseTooltip),$(".cl_CollapsibleArea_collapsing").parent().attr("title",expandTooltip),$(collapsedCaretSelector).length===0&&$expandCollapseAllButton.text(window.MTPS.LocalizedStrings.CollapseAllButtonTooltip));setupEventHandlers()}function titleAnchorClicked(){var $this=$(this),$image=$this.children("span").first(),$content=$this.parent().parent().next();$image&&$content&&($this.removeAttr("title"),$content.attr("class")==="sectionblock"?($image.attr("class",collapsedCaretClass),$content.attr("class","sectionnone"),$this.attr("title",expandTooltip),$image.attr("title",expandTooltip)):($image.attr("class",expandedCaretClass),$content.attr("class","sectionblock"),$this.attr("title",collapseTooltip),$image.attr("title",collapseTooltip)),setECAButtonText())}function expandCollapseAllButtonClicked(){$(this).text()===window.MTPS.LocalizedStrings.ExpandAllButtonTooltip?expandAll():collapseAll()}function collapseAll(){$(expandedCaretSelector).parent().click();$expandCollapseAllButton.text(window.MTPS.LocalizedStrings.ExpandAllButtonTooltip)}function expandAll(){$(collapsedCaretSelector).parent().click();$expandCollapseAllButton.text(window.MTPS.LocalizedStrings.CollapseAllButtonTooltip)}function expandCollapseAll(){if(isEnhanced){var $eca=$(this);$eca.hasClass("LW_CollapsibleArea_Title")&&($eca=$($eca.parent().children().first()));$eca.hasClass("cl_CollapsibleArea_collapsing")?expandAll():$eca.hasClass("cl_CollapsibleArea_expanding")&&collapseAll();$("html, body").scrollTop($eca.offset().top-10)}}function setupEventHandlers(){$titleAnchor.click(titleAnchorClicked);$expandCollapseAllButton.click(expandCollapseAllButtonClicked);$("span.LW_CollapsibleArea_Img").dblclick(expandCollapseAll);$("span.LW_CollapsibleArea_Title").dblclick(expandCollapseAll);$(window).keyup(function(e){return e.keyCode==69&&e.shiftKey&&e.ctrlKey?($expandCollapseAllButton.trigger("click"),!1):!0})}function setECAButtonText(){$(collapsedCaretSelector).length===0?$expandCollapseAllButton.text(window.MTPS.LocalizedStrings.CollapseAllButtonTooltip):$(expandedCaretSelector).length===0&&$expandCollapseAllButton.text(window.MTPS.LocalizedStrings.ExpandAllButtonTooltip)}var isEnhanced=!0,expandTooltip="",collapseTooltip="",expandedCaretClass="",collapsedCaretClass="",expandedCaretSelector="",collapsedCaretSelector="",$expandCollapseAllButton,$titleAnchor;return{init:init}}();$(document).ready(function(){epx.collapsibleArea.init()});;
epx=window.epx||{};epx.versionSelector=function(){function init(){$link<=0||$arrow<=0||$list<=0||$expand<=0||($list.find("li.archived").length>0&&($expand.show(),$expand.click(function(){$expand.hide();$list.find("li.archived").show();open()})),$link.click(function(){epx.versionSelector.open()}),$arrow.click(function(){epx.versionSelector.open()}),$(document).mouseup(function(){epx.versionSelector.close()}))}function open(){$list.show()}function close(){$list.hide()}var $link=$("#vsLink"),$arrow=$("#vsArrow"),$list=$("#vsPanel"),$expand=$("#vsExpand");return{init:init,open:open,close:close}}();$(document).ready(function(){epx.versionSelector.init()});;
var isMetroIE10=navigator.userAgent.indexOf("MSIE 10.0")!=-1&&window.innerWidth==screen.width&&window.innerHeight==screen.height,brokerScript;isMetroIE10||(brokerScript=document.createElement("script"),brokerScript.src=window.location.protocol=="https:"?"https://www.microsoft.com/library/svy/sto/https/broker.js":"//js.microsoft.com/library/svy/sto/broker.js",document.getElementsByTagName("head")[0].appendChild(brokerScript));;