PageSourceSearch

https://support.xumo.com/hc/theming_assets/01K09EGHJX25Y7TM2RJVCYE952

js xumo.com collected 2026-09-24 08:58:49 UTC 7,859 bytes, 1 lines download raw bytes

1(function(){"use strict";var a={RENDER:"navigation:render"};window.Navigation=Util.createExtension({defaults:{collection:{},objects:["categories","sections","articles"],sideloading:SIDELOADING,labels:[],categoryId:null,sectionId:null,topicId:null,properties:["id","title","description","name","html_url","position","promoted","pinned","draft","section_id","sorting","category_id","parent_section_id","topic_id","created_at"],filter:{categories:null,sections:null,articles:function(a){return!0!==a.draft},topics:null,posts:null},sort:{categories:"sortByPosition",sections:"sortByPosition",articles:"sortByPosition",topics:"sortByPosition",posts:"sortByPosition"},sortOrder:"asc",template:null,templateData:{}},optionTypes:{collection:"(string|object)",objects:"(string|array)",sideloading:"(string|boolean)",labels:"(string|array)",categoryId:"(string|number|null)",sectionId:"(string|number|null)",topicId:"(string|number|null)",properties:"(string|array)",sort:"(string|object)",sortOrder:"string",filter:"(string|object|null)",template:"(string|null)",templateData:"(string|object)"},initialize:function(a){var b=a.objects,c=this;for(var d in a)if(a.hasOwnProperty(d)){var e=a[d];if("string"==typeof e&&/object|array/g.test(this.optionTypes[d]))try{this.options[d]=a[d]=JSON.parse(e)}catch(b){this.options[d]=a[d]=this.defaults[d],console.error("Option value ("+d+") is not a valid JSON string.")}}-1!==b.indexOf("articles")&&-1!==b.indexOf("categories")&&-1===b.indexOf("sections")&&a.objects.push("sections"),c.pageIds={activeCategoryId:null,activeSectionId:null,activeArticleId:null,activeTopicId:null,activePostId:null};var f=function(b){return a.objects.forEach(function(d){b.hasOwnProperty(d)&&(b[d]=c._filterObjects(b[d],d),c._sortObjects(b[d],d),"desc"===a.sortOrder&&(b[d]=b[d].reverse()))}),b};f.bind(this);var g=function(a){var b=Util.getPageId(),d=function(b){var d=null;return(a.categories||[]).forEach(function(a){a.isActive=a.id===b,!0===a.isActive&&(d=a)}),d&&(c.pageIds.activeCategoryId=d.id),d},e=function(b){var d=null;return(a.sections||[]).forEach(function(a){a.isActive||(a.isActive=a.id===b,!0===a.isActive&&(d=a,null!==a.parent_section_id&&e(a.parent_section_id)))}),d&&(c.pageIds.activeSectionId=d.id),d},f=function(b){var d=null;return(a.articles||[]).forEach(function(a){a.isActive=a.id===b,!0===a.isActive&&(d=a)}),d&&(c.pageIds.activeArticleId=d.id),d};if(Util.isCategoryPage())d(b);else if(Util.isSectionPage()){var g=e(b);c.pageIds.activeSectionId=b,g&&d(g.category_id)}else if(Util.isArticlePage()){var h=f(b);if(h){var g=e(h.section_id);g&&d(g.category_id)}}return a};if(Object.keys(a.collection).length){var h=g(a.collection);h=f(h),h=c.structureObjects(h),this.render(h)}else c.getObjects(a).then(g).then(f).then(c.structureObjects).then(c.render.bind(c))},getObjects:function(a){var b=a.objects,c=[];return((null!==a.categoryId||null!==a.sectionId||0<a.labels.length)&&0<Util.intersection(["categories","sections","articles"],a.objects).length&&(-1!==a.objects.indexOf("articles")||0<a.labels.length?c.push(this.getArticles(a)):-1===a.objects.indexOf("sections")?c.push(this.getCategories(a)):c.push(this.getSections(a)),b=b.filter(function(a){return-1===["categories","sections","articles"].indexOf(a)})),null!==a.topicId&&0<Util.intersection(["topics","posts"],a.objects).length&&(-1===a.objects.indexOf("posts")?c.push(this.getTopics(a)):c.push(this.getPosts(a)),b=b.filter(function(a){return-1===["topics","posts"].indexOf(a)})),!c.length&&!1===a.sideloading&&3===Util.intersection(["categories","sections","articles"],a.objects).length)?Promise.all([Util.get(["categories","sections"],a.properties),Util.get(["articles"],a.properties)]).then(function(b){var c=Object.assign.apply(Object,b);for(var d in c)c.hasOwnProperty(d)&&-1===a.objects.indexOf(d)&&delete c[d];return c}):(b.length&&(Util.log("Fetching objects ("+b.join(", ")+") using Util.get()"),c.push(Util.get(b,a.properties))),Promise.all(c).then(function(b){if(1===b.length)return b[0];var c=Object.assign.apply(Object,b);for(var d in c)c.hasOwnProperty(d)&&-1===a.objects.indexOf(d)&&delete c[d];return c}))},getCategories:function(a){var b="/api/v2/help_center/"+Util.locale+"categories";return null===a.categoryId?Util.log("Fetching categories"):(Util.log("Fetching category "+a.categoryId),b+="/"+a.c
1ategoryId),b+=".json",Util.request(b,a.properties)},getSections:function(a){var b="/api/v2/help_center/"+Util.locale;return null===a.categoryId?Util.log("Fetching sections"):(Util.log("Fetching sections from category "+a.categoryId),b+="/categories/"+a.categoryId),b+="/sections.json",-1!==a.objects.indexOf("categories")&&(b+="?include=categories"),Util.request(b,a.properties)},getArticles:function(a){var b=Util.intersection(["categories","sections"],a.objects),c=[],d="/api/v2/help_center/"+Util.locale;return null===a.categoryId?null===a.sectionId?Util.log("Fetching articles"):(Util.log("Fetching articles from section "+a.sectionId),d+="/sections/"+a.sectionId):(Util.log("Fetching articles from category "+a.categoryId),d+="/categories/"+a.categoryId),d+="/articles.json",b.length&&c.push("include="+b.join(",")),a.labels&&(Util.log("Fetching articles with labels ("+a.labels.join(",")+")"),c.push("label_names="+a.labels.join(","))),c.length&&(d+="?"+c.join("&")),Util.request(d,a.properties)},getTopics:function(a){var b="/api/v2/community/topics";return null===a.topicId?Util.log("Fetching topics"):(Util.log("Fetching topic "+a.topicId),b+="/"+a.topicId),b+=".json",Util.request(b,a.properties)},getPosts:function(a){var b="/api/v2/community/";return null===a.topicId?(Util.log("Fetching posts"),b+="posts"):(Util.log("Fetching posts from topic "+a.topicId),b+="topics/"+a.topicId+"/posts"),b+=".json",-1!==a.objects.indexOf("topics")&&(b+="?include=topics"),Util.request(b,a.properties)},_filterObjects:function(a,b){var c=this.options;if(c.filter.hasOwnProperty(b)&&null!==c.sort[b]){if("function"==typeof c.filter[b])return a.filter(c.filter[b]);var d=c.filter[b];if("string"==typeof d&&"function"==typeof Util[d])return a.filter(Util[d])}return a},_sortObjects:function(a,b){var c=this.options,d={categories:Util.sortByPosition,sections:Util.sortByPosition,articles:Util.sortByName,topics:Util.sortByDate,posts:Util.sortByDate};if(c.sort.hasOwnProperty(b)&&null!==c.sort[b]){if("function"==typeof c.sort[b])return a.sort(c.sort[b]);var e=c.sort[b];if("string"==typeof e&&"function"==typeof Util[e])return a.sort(Util[e])}return a.sort(d[b]).sort(Util.sortByPromoted)},structureObjects:function(a){var b=a.categories||[],c=a.sections||[],d=a.articles||[],e=a.topics||[],f=a.posts||[],g=function(a){a.articles=d.filter(function(b){return b.section_id===a.id}),a.hasOwnProperty("sorting")&&("manual"===a.sorting&&a.articles.sort(Util.sortByPosition),"title"===a.sorting&&a.articles.sort(Util.sortByName),"creation_asc"===a.sorting&&a.articles.sort(Util.sortByDate),"creation_desc"===a.sorting&&a.articles.sort(Util.sortByDate).reverse()),a.articles.sort(Util.sortByPromoted),a.sections=c.filter(function(b){return b.parent_section_id&&b.parent_section_id===a.id}),a.sections.forEach(g)};return c.forEach(g),b.forEach(function(a){a.sections=c.filter(function(b){return b.category_id===a.id&&null===b.parent_section_id})}),e.forEach(function(a){a.posts=f.filter(function(b){return b.topic_id===a.id})}),{categories:b,sections:c,articles:d,topics:e,posts:f}},render:function(b){var c=this.options,d=Util.extend(b);for(var e in this.pageIds)this.pageIds.hasOwnProperty(e)&&(d.hasOwnProperty(e)?!!this.pageIds[e]&&(d[e]=this.pageIds[e]):d[e]=this.pageIds[e]);c.templateData&&(d=Util.extend(d,c.templateData)),Util.renderTemplate(this.el,c.template,d,{replaceContent:!0}),Util.triggerEvent(this.el,a.RENDER,{relatedTarget:this.el,data:d,options:c})}}),ready(function(){each("[data-element=\"navigation\"]",function(a){new Navigation(a)})})})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.