You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Docs/html/js/awsdocs.min.js

1 line
12 KiB
JavaScript

function searchFormSubmit(a){var b=$("#search-select").val();if(0===b.indexOf("documentation")){var c=$("#this_doc_product").val(),d=$("#this_doc_guide").val(),e="",f="";("documentation-product"===b||"documentation-guide"===b)&&(e+="?doc_product="+encodeURIComponent(c),f+="#facet_doc_product="+encodeURIComponent(c),"documentation-guide"===b&&(e+="&doc_guide="+encodeURIComponent(d),f+="&facet_doc_guide="+encodeURIComponent(d)));var g=window.navigator.userAgent,h=g.indexOf("MSIE "),i=g.indexOf("Trident/"),j=g.indexOf("Edge/");if(h>0||i>0||j>0){var k=$("#search-query").val();return e+="&searchPath="+encodeURIComponent(b),e+="&searchQuery="+encodeURIComponent(k),window.location.href="/search/doc-search.html"+e+f,!1}a.action="/search/doc-search.html"+f}else a.action="http://aws.amazon.com/search";return!0}function SetCookie(a,b,c){var d=14,e=new Date;e.setTime(e.getTime()+24*d*60*60*1e3),1==c?document.cookie=a+"="+b+";path=/":document.cookie=a+"="+b+";expires="+e.toUTCString()+";path=/"}function CheckRegistrationCookie(){var a="regStatus",b=getCookie(a);"pre-register"==b?($("#span-conosole-signin").css("display","none"),$("#span-conosole-signup").css("display","inline")):($("#span-conosole-signin").css("display","inline"),$("#span-conosole-signup").css("display","none"))}function CheckLanguageCookie(){try{var a="aws-doc-lang",b=getCookie(a),c=$("#languageSelection").val(),d=c.substring(1,6),e=c.substring(6),f="/"+b+e,g=location.href,h=g.indexOf(e);if(h>=6){var i=h-5,j=g.substring(i,h),k=g.substring(i-1,i);"/"==k&&"_"==j.substring(2,3)||""!=b&&b!=d&&(location.href=f)}if(5==b.length){var l=$('select[id="languageSelection"]').find('option[value="'+f+'"]');SetCookie(a,b,0),l.html(l.text()+"&nbsp;&#10003;")}}catch(m){}}function getCookie(a){for(var b=a+"=",c=document.cookie.split(";"),d=0;d<c.length;d++){for(var e=c[d];" "==e.charAt(0);)e=e.substring(1);if(-1!=e.indexOf(b))return e.substring(b.length,e.length)}return""}var AWSDocs=AWSDocs||{};AWSDocs.adjustFragmentUrl=function(){var a=window.location.hash.replace("#",""),b=AWSDocs.sanitizeHash(a);if(window.location.hash){var c=$("body").find("#"+b+":first");if(c.length){var d=$("#"+b).offset().top-70;$("html, body").animate({scrollTop:d},"fast")}}},AWSDocs.sanitizeHash=function(a){return encodeURIComponent(a).replace(/(:|\.|\[|\]|,)/g,"\\$1")},$(document).ready(function(){var a=getCookie("aws-doc-footer-short");"1"===a&&($("#footer_short_fb").length?$("#footer").addClass("shortFooter_ht"):$("#footer").addClass("shortFooter"),$("#footer_toggle_img").toggleClass("hide"),$("#footer_toggle_img_collapse").toggleClass("hide"),$("#footer_short_fb").toggleClass("hide")),$("a[href]").click(function(a){var b="shortFooter=true";if($("#footer_toggle_img.hide").length&&-1!==this.href.indexOf(window.location.hostname.toString())){if(this.href.indexOf(b)<0){var c=-1!==this.href.indexOf("?")?"&":"?",d=this.hash,e=this.href;e=e.replace(d,""),this.href=e+c+b+d}}else if(this.href.indexOf(b)>0&&this.href.indexOf("?")>0){var e=this.href,d=this.hash;e=e.replace(d,"");var f=e.split("?")[0],g=e.split("?")[1];paramList=g.split("&");for(var h=paramList.length-1;h>=0;h--)paramList[h]===b&&paramList.splice(h,1);paramList.length>0?this.href=f+"?"+paramList.join("&")+d:this.href=f+d}}),$("#toggle-contents").click(function(){$("#toc").toggleClass("open")}),$("#footer_toggle").click(function(){$("#footer_toggle_img").toggleClass("hide"),$("#footer_toggle_img_collapse").toggleClass("hide"),$("#footer_short_fb").toggleClass("hide"),$("#footer_toggle_img.hide").length&&($("#footer_short_fb").length?$("#footer").addClass("shortFooter_ht"):$("#footer").addClass("shortFooter"),SetCookie("aws-doc-footer-short","1",1)),$("#footer_toggle_img_collapse.hide").length&&($("#footer_short_fb").length?$("#footer").removeClass("shortFooter_ht"):$("#footer").removeClass("shortFooter"),SetCookie("aws-doc-footer-short","0",1))})});var AWSDocs=AWSDocs||{};$(document).ready(function(){$("li.awstoc.closed ul").hide(),$("li.awstoc").bind("click",function(a){a.stopPropagation(),"LI"==a.target.nodeName&&($(a.target).hasClass("closed")||$(a.target).hasClass("opened"))&&($(a.target).toggleClass("closed opened"),$(a.target).hasClass("closed")&&$(a.target).children("ul").hide(),$(a.target).hasClass("opened")&&$(a.target).children("ul").show())}),AWSDocs.setTocScroll(),$("#search-icon").click(AWSDocs.resizeSearchQueryBox);var a=navigator.userAgent.toLowerCase(),b=-1!=a.indexOf("mobile");b||(b=-1!=a.indexOf("silk")),b||$("#left-column").resizable({handles:"e"}),AWSDocs.resizePanes(),window.onresize=AWSDocs.resizePanes,-1!=a.indexOf("silk")&&($("#aws-nav").css("position","relative"),$("#content-container").css("margin-top","0px"))}),$(window).unload(function(){AWSDocs.setTocCookies()}),AWSDocs.setTocCookies=function(){var a=window.location.href;a=a.split("#").pop().split("?").pop();var b=a.substring(a.lastIndexOf("/")+1),c=a.indexOf(b),d=a.substring(0,c);SetCookie("aws-doc-toc-pos",$("#left-column").scrollTop(),0),SetCookie("aws-doc-toc-url",d,0)},AWSDocs.setTocScroll=function(){try{var a="aws-doc-toc-pos",b=getCookie(a),c="aws-doc-toc-url",d=getCookie(c),e=window.location.href;e=e.split("#").pop().split("?").pop();var f=e.substring(e.lastIndexOf("/")+1),g=e.indexOf(f),h=e.substring(0,g);null!==b.length&&null!==d.length&&h===d&&$("#left-column").scrollTop(b)}catch(i){}},AWSDocs.resizePanes=function(){var a=($("#left-column"),$("#left-column").width()),b=$("#main-column"),c=($("#main"),$("#left-column").position());(null!==a||"fixed"==c)&&(leftWidthInPx=a+"px",b.css("margin-left",leftWidthInPx));var d=$("div#main-col-body").width();$("div.table table").each(function(){var a=$(this).width(),b=$(this).parent(),c=$(this)[0].getAttribute("id"),e=b[0].getAttribute("class");if(a>d){0==b.siblings("i.table-expand-icon").length&&(b.after("<i class='fa fa-expand table-expand-icon' href='#"+c+"'></i>"),b.siblings("i.table-expand-icon").colorbox({maxWidth:"95%",maxHeight:"95%",inline:!0,className:e}));var f=b.siblings("i.table-expand-icon"),g=b.position();f.css({top:g.top})}else{$(this).removeClass("cboxElement");var h=$(this).parent();h.siblings("i.table-expand-icon").length>0&&h.siblings("i.table-expand-icon").remove()}}),$("div.informaltable table").each(function(){var a=$(this).width(),b=$(this).parent(),c=$(this)[0].getAttribute("id"),e=b.parent()[0].getAttribute("class");if(a>d){0==b.siblings("i.table-expand-icon").length&&(b.after("<i class='fa fa-expand table-expand-icon' href='#"+c+"'></i>"),b.siblings("i.table-expand-icon").colorbox({maxWidth:"95%",maxHeight:"95%",inline:!0,className:e}));var f=b.siblings("i.table-expand-icon"),g=b.position();f.css({top:g.top})}else{$(this).removeClass("cboxElement");var h=$(this).parent();h.siblings("i.table-expand-icon").length>0&&h.siblings("i.table-expand-icon").remove()}})},AWSDocs.resizeSearchQueryBox=function(){$("#finegrainedSearch").toggle()};var AWSDocs=AWSDocs||{};AWSDocs.rightNavLinks,AWSDocs.sections,$(document).ready(function(){$("a.pagetoc").click(function(){$("a.pagetoc.selected").removeClass("selected"),$(this).addClass("selected");var a=$(this).attr("href"),b=window.location.hash.replace("#","");a=="#"+b&&AWSDocs.adjustFragmentUrl()}),AWSDocs.rightNavLinks=$("a.pagetoc"),AWSDocs.sections=$("h2")}),AWSDocs.isElementInViewport=function(a){var b=a.getBoundingClientRect();return b.top>=0&&b.bottom<=$(window).height()},$(window).on("DOMContentLoaded load resize scroll",function(){if(AWSDocs.sections)for(var a=AWSDocs.sections.length,b=0;a>b;b++){var c=AWSDocs.sections[b],d=$(document).height()-$(window).height()-$(window).scrollTop();if(0==d)$("a.pagetoc.selected").removeClass("selected"),$(AWSDocs.rightNavLinks[a-1]).addClass("selected");else if(AWSDocs.isElementInViewport(c))for(var e=$(c).attr("id"),f=0;f<AWSDocs.rightNavLinks.length;f++){var g=$(AWSDocs.rightNavLinks[f]).attr("href").substr(1);if(g==e)return $(AWSDocs.rightNavLinks).removeClass("selected"),void $(AWSDocs.rightNavLinks[f]).addClass("selected")}}});var AWSDocs=AWSDocs||{};AWSDocs.Flyout=function(){var a=function(a,b){a.addClass("active"),b.show("slide",300)},b=function(a,b){a.addClass("active"),b.show()},c=function(a,b){a.removeClass("active"),b.hide()};return{slideOpen:a,keepOpen:b,close:c}}(),AWSDocs.TemplateCompiler=function(){var a=function(a,b,c){if("undefined"!=typeof Handlebars){var d=a.html(),e=Handlebars.compile(d),f=c,g=e(f);a.replaceWith(g),b&&b.menu();var h=$("#ui-id-1");h&&h.click(function(){window.location=c.flyoutList[0].topTarget})}},b=function(b,c){var d=$("meta[name=guide-locale]").attr("content"),e="/flyout.json";"undefined"!=typeof d&&(e=5==d.length?"/menu/"+d+e:"/menu"+e),$.getJSON(e,function(d){a(b,c,d)})},c=function(a,c){a&&b(a,c)};return{createFlyout:c}}(),AWSDocs.Cookies=function(){var a=function(a,b){var c=14,d=new Date;d.setTime(d.getTime()+24*c*60*60*1e3),document.cookie=a+"="+b+";expires="+d.toUTCString()+";path=/"};return{setCookie:a}}(),$(document).ready(function(){var a=$("#aws-nav-flyout-trigger"),b=$("#topnav-flyout-menu-container"),c=$("#topnav-flyout-menu"),d=$("#languageSelection"),e=$("#flyout-item-template");AWSDocs.TemplateCompiler.createFlyout(e,c),d&&(d.selectmenu({select:function(a,b){var c="aws-doc-lang",d=b.item.value,e=d.substring(1,6),f=new Date;f.setTime(f.getTime()+12096e5),AWSDocs.Cookies.setCookie(c,e),location.href.indexOf(d)<0&&(location.href=d)}}),$(window).resize(function(){d.selectmenu("close")})),a&&(a.mouseenter(function(c){null===c.relatedTarget||"ui-id-1"!=c.relatedTarget.id&&"awsdocs-flyout-first-a"!=c.relatedTarget.id&&"topnav-flyout-menu"!=c.relatedTarget.id?AWSDocs.Flyout.slideOpen(a,b):AWSDocs.Flyout.keepOpen(a,b)}),a.mouseleave(function(){AWSDocs.Flyout.close(a,b)})),b&&b.hover(function(){AWSDocs.Flyout.keepOpen(a,b)},function(){AWSDocs.Flyout.close(a,b),c.menu("collapseAll")})});var AWSDocs=AWSDocs||{};AWSDocs.hasSectionMatch=function(a){for(var b=$(".langfilter"),c=0;c<b.length;c++){var d=b[c],e=$(d).attr("name");if(e==a)return!0}return!1},AWSDocs.filterContent=function(a){var b=$(".langfilter"),c=$("li.pagetoc"),d=function(){for(var c=0;c<b.length;c++){var d=b[c],e=$(d).attr("name");if(e==a)return!0}return!1}();if("All"==a)b.show(),c.show();else if("All"!==a&&d===!1)b.show(),c.show();else for(var e=0;e<b.length;e++){var f=b[e],g=$(f).attr("name");if(g==a){if($(f).show(),c.length>0)for(var h=0;h<c.length;h++)$(c[h]).attr("name")==g&&$(c[h]).show()}else if($(f).hide(),c.length>0)for(var h=0;h<c.length;h++)$(c[h]).attr("name")==g&&$(c[h]).hide()}},AWSDocs.setFilterCookie=function(a){document.cookie="awsdocs_content_filter="+encodeURIComponent(a)},AWSDocs.getFilterCookie=function(){for(var a="awsdocs_content_filter=",b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a)){var e=decodeURIComponent(d.substring(a.length,d.length));return e}}return null},AWSDocs.setupFilter=function(){var a=AWSDocs.getFilterCookie();a?(AWSDocs.hasSectionMatch(a)?$("#filter-select").val(a):$("#filter-select").val("All"),AWSDocs.filterContent(a)):$("#filter-select").val("All"),$("#filter-select").change(function(){var a=$(this).val();AWSDocs.setFilterCookie(a),AWSDocs.filterContent(a)})},$(document).ready(function(){var a=$(".langfilter");a.length>0&&($("#language-filter").show(),AWSDocs.setupFilter())}),$(document).ready(function(){CheckLanguageCookie(),CheckRegistrationCookie()});var AWSDocs=AWSDocs||{};AWSDocs.feedbackOnload=function(){var a=top.document.location.search.substr(1);if(a.length>0){var b=a.match(/topic_url=([^=\;\"#\?\s]+)/);if(2==b.length){var c=document.getElementById("fblink");c.href=c.href+"&topic_url="+b[1]}}},$(document).ready(function(){"undefined"!=typeof hljs&&hljs.initHighlighting(),$("em.replaceable code, em.replaceable code span, a.xref code").removeClass(),$("code.nohighlight code, code.nohighlight span").removeClass()});