1WRMCB=function(e){var c=console;if(c&&c.log&&c.error){c.log('Error running batched script.');c.error(e);}} 2; 3try { 4/* module-key = 'com.atlassian.analytics.analytics-client:js-events', location = 'js/store-wrapper.js' */ 5var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(f){return f.raw=f};$jscomp.createTemplateTagFirstArgWithRaw=function(f,h){f.raw=h;return f}; 6(function(){function f(){return e&&"object"===typeof e?Object.values(e).map(function(a){return a.length}).reduce(function(a,b){return a+b},0):0}function h(a){var b="kB";a/=1E3;1E3<a&&(a/=1E3,b="MB");return""+a.toFixed(2)+b}function g(a,b){console.error("atlassian-analytics -",a,b)}function l(a,b,c){var d=h(f());void 0!==c&&"string"===typeof c?(c=h(c.length),a=a+" size: "+c+" (used space: "+d+")"):a=a+" (used space: "+d+")";g(a,b)}try{var e=window.localStorage;e.setItem("__test__","__test__");e.removeItem("__test__")}catch(a){g("localStorage is not available", 7a)}var m={remove:function(a){try{e.removeItem(a)}catch(b){g("store.remove("+a+")",b)}},set:function(a,b,c){if(void 0===b)return m.remove(a);try{a:{try{var d=JSON.stringify(b);break a}catch(k){g("serialize",k)}d=void 0}e.setItem(a,d)}catch(k){l("store.set("+a+")",k,d),c&&"function"===typeof c&&c()}},get:function(a){try{a:{var b=e.getItem(a);try{var c=JSON.parse(b);break a}catch(d){g("deserialize",d)}c=void 0}return c}catch(d){l("store.get("+a+")",d)}},clear:function(){try{e.clear()}catch(a){g("store.clear()", 8a)}}};this.store=m})(); 9}catch(e){WRMCB(e)}; 10; 11try { 12/* module-key = 'com.atlassian.analytics.analytics-client:js-events', location = 'js/page-visibility.js' */ 13define("atlassian/analytics/page-visibility",function(){var hasBrowserSupport=document.hidden!==undefined;var wrapper={supported:hasBrowserSupport,isHidden:function(){return hasBrowserSupport?document.hidden:false}};return wrapper}); 14}catch(e){WRMCB(e)}; 15; 16try { 17/* module-key = 'com.atlassian.analytics.analytics-client:js-events', location = 'js/user-activity-xhr-header.js' */ 18define("atlassian/analytics/user-activity-xhr-header",["atlassian/analytics/page-visibility"],function(b){var e=XMLHttpRequest.prototype.send,c=window.fetch,d=!1;return{install:function(){!d&&b.supported&&(XMLHttpRequest.prototype.send=function(){b.isHidden()&&this.setRequestHeader("x-atlassian-mau-ignore",b.isHidden());e.apply(this,arguments)},c&&(window.fetch=function(g,a){a=a||{};var f=a.headers;b.isHidden()&&(a.headers=f?new Headers(f):new Headers,a.headers.set("x-atlassian-mau-ignore",b.isHidden())); 19return c.call(this,g,a)}),d=!0)},uninstall:function(){d&&(XMLHttpRequest.prototype.send=e,c&&(window.fetch=c));d=!1}}});require("atlassian/analytics/user-activity-xhr-header").install(); 20}catch(e){WRMCB(e)}; 21; 22try { 23/* module-key = 'com.atlassian.analytics.analytics-client:js-events', location = 'js/atlassian-analytics.js' */ 24(function(r){var t="function"===typeof AJS.contextPath?AJS.contextPath():"",g=null,h=null,p="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*
24Math.random()|0;return("x"===a?b:b&3|8).toString(16)}),u=function(){return store.remove(g)},l=function(){var a=[],b;if(0!==AJS.EventQueue.length){a=store.get(g)||a;var c=0;for(b=AJS.EventQueue.length;c<b;++c){var d=AJS.EventQueue[c];d.name&&(d={name:d.name,properties:d.properties,time:d.time||0},a.push(d))}AJS.EventQueue.length=0;store.set(g, 25a,u)}},q=0,v=function(a){for(var b=a.length-1;0<=b;b--){var c="",d=a[b],e=d.properties;if("undefined"===typeof d.name)c="you must provide a name for the event.";else if("undefined"!==typeof e&&null!==e)if(e.constructor!==Object)c="properties must be an object with key value pairs.";else{var k=void 0;for(k in e)if(e.hasOwnProperty(k)){var f=e[k];"undefined"!==typeof f&&null!==f&&("number"===typeof f||"string"===typeof f||"boolean"===typeof f)||("undefined"!==typeof f&&null!==f&&f.toString?e[k]=f.toString(): 26e[k]="")}}""!==c&&(AJS.log("WARN: Invalid analytics event detected and ignored, "+c+"\nEvent: "+JSON.stringify(d)),a.splice(b,1))}return a.length},m=0,n=function(){function a(){setTimeout(n,Math.min(5E3*Math.pow(2,q=0),3E5))}if(store.get(h))var b=!1;else store.set(h,p),b=store.get(h)===p;if(b)m=0;else if(++m,20>m)return a();try{l();var c=store.get(g);if(!c||!c.length)return a();store.remove(g);if(!v(c))return a();var d=(new Date).getTime();for(b=0;b<c.length;b++)c[b].timeDelta=0<c[b].time?c[b].time- 27d:b-c.length,delete c[b].time;fetch(t+"/rest/analytics/1.0/publish/bulk",{method:"POST",body:JSON.stringify(c),headers:{"Content-Type":"application/json"},cache:"no-cache",credentials:"same-origin"}).then(function(e){if(!e.ok)throw Error("A response outside OK range (200-299)");a()}).catch(function(){AJS.EventQueue=AJS.EventQueue.concat(c);l();setTimeout(n,Math.min(5E3*Math.pow(2,++q),3E5))}).catch(function(e){console.error(e)})}finally{store.set(h,null)}};AJS.EventQueue=AJS.EventQueue||[];var w= 28Array.prototype.push;AJS.EventQueue.push=function(a){a.time=(new Date).getTime();w.call(AJS.EventQueue,a)};AJS.toInit(function(){var a="unknown";"jira"===document.body.id?a="jira":"com-atlassian-confluence"===document.body.id&&(a="confluence");g="atlassian-analytics."+a;h=g+".lock";setTimeout(n,500);-1<window.location.pathname.indexOf("/secure/admin/ViewApplicationProperties")?AJS.$("[data-property-id\x3d'analytics-enabled']").remove():-1<window.location.pathname.indexOf("/secure/admin/EditApplicationProperties")&& 29(a=AJS.$(":contains(Enable Atlassian analytics)"),0<a.size()&&(a=a[a.size()-2])&&a.remove())});r(window).on("beforeunload",function(){l()});AJS.Analytics={triggerPrivacyPolicySafeEvent:function(a,b){AJS.log("WARN: 'triggerPrivacyPolicySafeEvent' has been deprecated");AJS.EventQueue.push({name:a,properties:b})}};AJS.bind("analytics",function(a,b){AJS.EventQueue.push({name:b.name,properties:b.data})});AJS.bind("analyticsEvent",function(a,b){AJS.EventQueue.push({name:b.name,properties:b.data})})})(AJS.$); 30}catch(e){WRMCB(e)}; 31; 32try { 33/* module-key = 'com.atlassian.analytics.analytics-client:policy-update-init', location = 'js/policy-update-init.js' */ 34AJS.toInit(function(){WRM.data.claim("com.atlassian.analytics.analytics-client:policy-update-init.policy-update-data-provider")&&WRM.require("wrc!com.atlassian.analytics.analytics-client:policy-update")}); 35}catch(e){WRMCB(e)}; 36; 37try { 38/* module-key = 'com.atlassian.analytics.analytics-client:programmatic-analytics-init', location = 'js/programmatic-analytics-init.js' */ 39(function(){WRM.data.claim("com.atlassian.analytics.analytics-client:programmatic-analytics-init.programmatic-analytics-data-provider")&&WRM.require("wrc!com.atlassian.analytics.analytics-client:programmatic-analytics")})(); 40}catch(e){WRMCB(e)}; 41; 42try { 43/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:application-header-administration-cog-resource', location = 'header/cog.js' */ 44var NavLinks=function(b){b.ApplicationHeader=function(c){c.Cog=function(){return{getDropdown:function(){var a=AJS.$("#system-admin-menu-content");if(0<a.length)return a;a=AJS.$("#admin-menu-link-content");return 0<a.length?a:AJS.$("#bamboo\\.global\\.header-admin\\.menu")}}}();return c}(b.ApplicationHeader||{});return b}(NavLinks||{}); 45}catch(e){WRMCB(e)}; 46; 47try { 48/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:administration-shortcuts-resources', location = 'adminshortcuts/adminshortcuts.soy' */ 49// This file was automatically generated from adminshortcuts.soy. 50// Please don't edit this file by hand. 51 52/** 53 * @fileoverview Templates in namespace navlinks.templates.adminshortcuts. 54 */ 55 56if (typeof navlinks == 'undefined') { var navlinks = {}; } 57if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; } 58if (typeof navlinks.templates.adminshortcuts == 'undefined') { navlinks.templates.adminshortcuts = {}; } 59 60 61navlinks.templates.adminshortcuts.section = function(opt_data, opt_ignored) { 62 var param5 = '<ul class="aui-list-truncate">'; 63 var linkList7 = opt_data.links; 64 var linkListLen7 = linkList7.length; 65 for (var linkIndex7 = 0; linkIndex7 < linkListLen7; linkIndex7++) { 66 var linkData7 = linkList7[linkIndex7]; 67 param5 += '<li><a href="' + soy.$$escapeHtml(linkData7.link) + '">' + soy.$$escapeHtml(linkData7.label) + '</a></li>'; 68 } 69 param5 += '</ul>'; 70 var output = '' + aui.dropdown2.section({id: 'nl-remote-admin-section', label: 'Other applications', content: param5}); 71 return output; 72}; 73if (goog.DEBUG) { 74 navlinks.templates.adminshortcuts.section.soyTemplateName = 'navlinks.templates.adminshortcuts.section'; 75} 76 77}catch(e){WRMCB(e)}; 78; 79try { 80/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:administration-shortcuts-resources', location = 'adminshortcuts/adminnavlinks.js' */ 81var NavLinks=function(b){b.AdminShortcuts=function(){var c=function(){AJS.$("#nl-remote-admin-section").on("click","a",function(){NL.trackEvent("remoteAdminItemSelected",NL.getCurrentApplication(),$(this).attr("href"))})};return{render:function(){AJS.$.ajax({url:AJS.contextPath()+"/rest/menu/latest/admin",cache:!1,dataType:"json"}).done(function(a){a=a.filter(function(d){return!d.local});a.length&&(a=navlinks.templates.adminshortcuts.section({links:a}),b.ApplicationHeader.Cog.getDropdown().append(a), 82c())})}}}();return b}(NavLinks||{}); 83}catch(e){WRMCB(e)}; 84; 85try { 86/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:administration-shortcuts', location = 'adminshortcuts/adminshortcuts-cdn.js' */ 87AJS.toInit(function(){AJS.DarkFeatures&&AJS.DarkFeatures.isEnabled("rotp.admin.shortcuts")&&NavLinks.AdminShortcuts.render()}); 88}catch(e){WRMCB(e)}; 89; 90try { 91/* module-key = 'com.atlassian.auiplugin:split_aui.splitchunk.vendors--02a4084a95', location = 'aui.chunk.9835e22e1b78c86dc53f--2123f72bb06ff40ad0fe.js' */ 92(window.__auiJsonp=window.__auiJsonp||[]).push([["aui.splitchunk.vendors--02a4084a95"],{M4tZ:function(E,n,o){var i,u,A; 93/*!
94 * jQuery UI Keycode 1.12.1 95 * http://jqueryui.com 96 * 97 * Copyright jQuery Foundation and other contributors 98 * Released under the MIT license. 99 * http://jquery.org/license 100 */u=[o("oDIA"),o("O+lX")],void 0===(A="function"==typeof(i=function(E){return E.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}})?i.apply(n,u):i)||(E.exports=A)}}]); 101}catch(e){WRMCB(e)}; 102; 103try { 104/* module-key = 'com.atlassian.auiplugin:split_jquery.ui.keycode', location = 'aui.chunk.09b64181270e2539dc95--ac939fece05e0209a225.js' */ 105(window.__auiJsonp=window.__auiJsonp||[]).push([["jquery.ui.keycode"],{wrJm:function(u,i,n){"use strict";n.r(i);n("M4tZ");i.default="jquery"}},[["wrJm","runtime","aui.splitchunk.vendors--20a97d6a33","aui.splitchunk.vendors--02a4084a95","aui.splitchunk.0d131bcbf1"]]]); 106}catch(e){WRMCB(e)}; 107; 108try { 109/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-projectshortcuts', location = 'projectshortcuts/projectshortcuts.soy' */ 110// This file was automatically generated from projectshortcuts.soy. 111// Please don't edit this file by hand. 112 113/** 114 * @fileoverview Templates in namespace navlinks.templates.projectshortcuts. 115 */ 116 117if (typeof navlinks == 'undefined') { var navlinks = {}; } 118if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; } 119if (typeof navlinks.templates.projectshortcuts == 'undefined') { navlinks.templates.projectshortcuts = {}; } 120 121 122navlinks.templates.projectshortcuts.dialogContent = function(opt_data, opt_ignored) { 123 return '' + ((opt_data.localShortcuts && opt_data.localShortcuts.length > 0) ? navlinks.templates.projectshortcuts.dialogContentShortcuts({shortcuts: opt_data.localShortcuts, listClass: 'projectshortcut-links'}) : '') + ((opt_data.remoteShortcuts != null) ? (opt_data.remoteShortcuts.length > 0) ? '<h2 class="projectshortcuts-heading">Related Links</h2>' + navlinks.templates.projectshortcuts.dialogContentShortcuts(soy.$$augmentMap(opt_data.remoteShortcuts, {shortcuts: opt_data.remoteShortcuts, listClass: 'projectshortcut-links'})) : '' : navlinks.templates.projectshortcuts.dialogLoading(null)); 124}; 125if (goog.DEBUG) { 126 navlinks.templates.projectshortcuts.dialogContent.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContent'; 127} 128 129 130navlinks.templates.projectshortcuts.headingWrapper = function(opt_data, opt_ignored) { 131 return '<div class="project-dialog-header-wrapper"><div class="project-header"><img class="project-img" src="' + soy.$$escapeHtml(opt_data.logoUrl) + '"><h2 class="dialog-title">' + soy.$$escapeHtml(opt_data.title) + '</h2></div><div class="project-content-wrapper">' + soy.$$filterNoAutoescape(opt_data.contentHtml) + '</div></div>'; 132}; 133if (goog.DEBUG) { 134 navlinks.templates.projectshortcuts.headingWrapper.soyTemplateName = 'navlinks.templates.projectshortcuts.headingWrapper'; 135} 136 137 138navlinks.templates.projectshortcuts.dialogContentShortcuts = function(opt_data, opt_ignored) { 139 opt_data = opt_data || {}; 140 var output = '<ul' + ((opt_data.listClass) ? ' class="' + soy.$$escapeHtml(opt_data.listClass) + '"' : '') + '>'; 141 var shortcutList35 = opt_data.shortcuts; 142 var shortcutListLen35 = shortcutList35.length; 143 for (var shortcutIndex35 = 0; shortcutIndex35 < shortcutListLen35; shortcutIndex35++) { 144 var shortcutData35 = shortcutList35[shortcutIndex35]; 145 output += '<li' + ((shortcutIndex35 == shortcutListLen35 - 1) ? ' class="last"' : '') + '>' + navlinks.templates.projectshortcuts.dialogContentShortcut(shortcutData35) + '</li>'; 146 } 147 output += '</ul>'; 148 return output; 149}; 150if (goog.DEBUG) { 151 navlinks.templates.projectshortcuts.dialogContentShortcuts.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContentShortcuts'; 152} 153 154 155navlinks.templates.projectshortcuts.dialogContentShortcut = function(opt_data, opt_ignored) { 156 return '<a href="' + soy.$$escapeHtml(opt_data.link) + '"' + ((opt_data.tooltip) ? ' title="' + soy.$$escapeHtml(opt_data.tooltip) + '"' : '') + '>' + soy.$$escapeHtml(opt_data.label) + '</a>'; 157}; 158if (goog.DEBUG) { 159 navlinks.templates.projectshortcuts.dialogContentShortcut.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogContentShortcut'; 160} 161 162 163navlinks.templates.projectshortcuts.dialogLoading = function(opt_data, opt_ignored) { 164 opt_data = opt_data || {}; 165 return '<div class="projectshortcuts-loading">' + ((opt_data.text) ? soy.$$escapeHtml(opt_data.text) : '') + '</div>'; 166}; 167if (goog.DEBUG) { 168 navlinks.templates.projectshortcuts.dialogLoading.soyTemplateName = 'navlinks.templates.projectshortcuts.dialogLoading'; 169} 170 171}catch(e){WRMCB(e)}; 172; 173try { 174/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-projectshortcuts', location = 'projectshortcuts/projectshortcuts.js' */ 175(function(g,r){function n(){return g(".project-shortcut-dialog-trigger img").attr("src")}function k(a){a.localShortcuts&&(c.getCurrentPanel().html(navlinks.templates.projectshortcuts.headingWrapper({title:a.entity.title,logoUrl:n(),contentHtml:navlinks.templates.projectshortcuts.dialogContent(a)}
175)),l(c))}function l(a){a=a.popup.element;var h=a.find(".dialog-panel-body"),m=a.find(".dialog-components");h.height("auto");a.height(m.outerHeight()-1);g(".aui-shadow").remove()}function p(a,h){return g.ajax({url:a, 176cache:!1,data:h,dataType:"json"})}var c,e={};g(document).on("click",".project-shortcut-dialog-trigger",function(a){function h(d){e[b].localShortcuts=d.shortcuts;k(e[b])}function m(d){e[b].remoteShortcuts=d.shortcuts;k(e[b])}var f=g(this),b=f.data("key"),q=f.data("name");f=f.data("entity-type");"undefined"!==typeof b&&(a.preventDefault(),c=(new AJS.Dialog({width:600,keypressListener:function(d){d.which==jQuery.ui.keyCode.ESCAPE&&c.remove()},id:"project-shortcuts-dialog"})).addCancel("Close",function(){c.remove()}).addPanel("", 177navlinks.templates.projectshortcuts.headingWrapper({title:q,logoUrl:n(),contentHtml:navlinks.templates.projectshortcuts.dialogLoading({text:"Retrieving linksâ¦"})})).show(),l(c),e[b]?k(e[b]):(e[b]={entity:{title:q},localShortcuts:null,remoteShortcuts:null},p(AJS.contextPath()+"/rest/project-shortcuts/1.0/local/"+b,{entityType:f}).done(h),p(AJS.contextPath()+"/rest/project-shortcuts/1.0/remote/"+b,{entityType:f}).done(m).fail(function(){var d=c.getCurrentPanel().body.find(".project-content-wrapper"); 178d.find(".projectshortcuts-loading").remove();AJS.messages.error(d,{body:"Could not retrieve remote project shortcuts",closeable:!1});l(c)})))})})(jQuery,window.NL=window.NL||{}); 179}catch(e){WRMCB(e)}; 180; 181try { 182/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:atlassian-ui-popup-display-controller', location = 'popups/DisplayController.js' */ 183AJS.Popups=AJS.Popups||{};AJS.Popups.DisplayController=function(){var a=[],c=!1,d=!1;AJS.toInit(function(){setTimeout(function(){AJS.Popups.DisplayController.render()},0)});return{request:function(b){a.push(b);c&&!1===d&&this.render()},render:function(){a.sort(function(b,e){return b.weight-e.weight});c=!0;0!==a.length&&(d=!0,a[0].show())}}}(); 184}catch(e){WRMCB(e)}; 185; 186try { 187/* module-key = 'com.atlassian.auiplugin:split_aui.page.iconography', location = 'aui.chunk.0e489f4b2b9c5e735d98--50e9ccfcf1ce3886e7d4.js' */ 188(window.__auiJsonp=window.__auiJsonp||[]).push([["aui.page.iconography"],[],[["rSV2","runtime","aui.splitchunk.fbbef27525","aui.splitchunk.d7c46c2734","aui.splitchunk.56dfb54d0c","aui.splitchunk.908fe798b4"]]]); 189}catch(e){WRMCB(e)}; 190; 191try { 192/* module-key = 'confluence.extra.jira:jira-issues-view-mode-resources', location = 'jira/jira-issues-view-mode/main.js' */ 193require(["ajs","jquery"],function(a,d){var c=function(){var b=d(".wiki-content [data-jira-key][data-client-id]");if(0==b.length)return!1;WRM.require("wr!confluence.extra.jira:jira-issues-view-mode-async-resource",function(){require(["confluence/jim/jira/jira-issues-view-mode/lazy-loading","confluence/jim/jira/jira-issues-view-mode/fix-ui"],function(e,f){e.init(b).done(function(){f.fixBreakIconInOldConf()})})})};a.toInit(c);a.bind("ic-jim-async-supported",c)}); 194}catch(e){WRMCB(e)}; 195; 196try { 197/* module-key = 'confluence.extra.jira:amd-support', location = 'amd/confluence-shim.js' */ 198define("confluence/jim/confluence-shim",function(){return window.Confluence}); 199}catch(e){WRMCB(e)}; 200; 201try { 202/* module-key = 'confluence.extra.jira:amd-support', location = 'amd/amd-exporter.js' */ 203define("confluence/jim/amd/module-exporter",[],function(){var f={namespace:function(d,e,a){var b=d.split(".");a=a||window;var c,h=b.length-1;for(c=0;c<h;c++){var g=a[b[c]];a=null!=g?g:a[b[c]]={}}a[b[c]]&&window.console&&window.console.warn&&window.console.warn('Value of "'+d+'" was overridden');a[b[c]]=e||a[b[c]]||{};return a[b[c]]},safeRequire:function(d,e){define&&void 0===define.amd&&(d=require(d),e&&e(d))},exportModuleAsGlobal:function(d,e,a){f.safeRequire(d,function(b){f.namespace(e,b);a&&a(b)})}}; 204return f}); 205}catch(e){WRMCB(e)}; 206; 207try { 208/* module-key = 'confluence.web.resources:querystring', location = '/includes/js/api/querystring.js' */ 209define("confluence/api/querystring",[],function(){return{stringify:function(a){var b="",c;for(c in a)for(var d=0;d<a[c].length;d++)b+="&"+c,a[c][d]&&(b+="="+a[c][d]);return b.substring(1)}
209,stringifyMap:function(a){for(var b="",a=Array.from(a),c=0;c<a.length;c++)for(var d=a[c][0],f=a[c][1],e=0;e<f.length;e++)b+="&"+d,f[e]&&(b+="="+f[e]);return b.substring(1)},parse:function(a){var b={};if(a){"?"===a.substr(0,1)&&(a=a.substr(1));for(var a=a.split("&"),c=0;c<a.length;c++){var d=a[c].split("=");b[d[0]]|| 210(b[d[0]]=[]);b[d[0]].push(a[c].substring(d[0].length+1))}}return b},parseMap:function(a){var b=new Map;if(a){"?"===a.substr(0,1)&&(a=a.substr(1));for(var a=a.split("&"),c=0;c<a.length;c++){var d=a[c].split("=");b.has(d[0])||b.set(d[0],[]);b.get(d[0]).push(a[c].substring(d[0].length+1))}}return b}}}); 211}catch(e){WRMCB(e)}; 212; 213try { 214/* module-key = 'confluence.web.resources:url', location = '/includes/js/api/url.js' */ 215define("confluence/api/url",["confluence/api/querystring","jquery"],function(d,f){var g=/([^?|#]+)[?]?([^#]*)[#]?(.*)/,e=["source","urlPath","queryParams","anchor"];return{parse:function(a){var b={};if(a=g.exec(a)){for(var c=0;c<e.length;c++)b[e[c]]=a[c];b.queryParams=d.parse(b.queryParams)}return b},parseUrl:function(a){var b=new Map;if(a=g.exec(a)){for(var c=0;c<e.length;c++)b.set(e[c],a[c]);b.set("queryParams",d.parseMap(b.get("queryParams")))}return b},format:function(a){return f.isEmptyObject(a)? 216"":(!a.urlPath?"":a.urlPath)+(f.isEmptyObject(a.queryParams)?"":"?"+d.stringify(a.queryParams))+(!a.anchor?"":"#"+a.anchor)},formatUrl:function(a){return 0===a.size?"":(!a.get("urlPath")?"":a.get("urlPath"))+(0===a.get("queryParams").size?"":"?"+d.stringifyMap(a.get("queryParams")))+(!a.get("anchor")?"":"#"+a.get("anchor"))}}}); 217}catch(e){WRMCB(e)}; 218; 219try { 220/* module-key = 'confluence.web.resources:analytics-support', location = '/includes/js/analytics-support.js' */ 221define("confluence/analytics-support","jquery ajs confluence/meta window document confluence/api/url".split(" "),function(j,o,l,k,m,h){var b=Object.create(null),n;b.setAnalyticsSource=function(a,d){if(typeof n==="undefined"){var c=j._data(k,"events");n=c&&c.analytics&&c.analytics.length>0}n&&a.attr("href",function(a,c){var b=encodeURIComponent(d),g=h.parseUrl(c);g.size!==0&&g.get("queryParams").set("src",[b]);return h.formatUrl(g)})};b.srcRemovedUrl=function(a){a=h.parseUrl(a);a.get("queryParams").delete("src"); 222for(var d=Array.from(a.get("queryParams").keys()),c=0;c<d.length;c++){var b=d[c],f=b.split(".");f.length===3&&f[0]==="src"&&a.get("queryParams").delete(b);b==="jwt"&&a.get("queryParams").delete(b)}return h.formatUrl(a)};b.srcParamValues=function(a){return(a=h.parseUrl(a).get("queryParams"))&&a.get("src")?a.get("src"):[]};b.srcAttrParamValues=function(a){for(var a=h.parseUrl(a).get("queryParams"),b=Object.create(null),c=Array.from(a.keys()),e=0;e<c.length;e++){var f=c[e],i=f.split(".");if(i.length=== 2233&&i[0]==="src"){var g=i[1],i=i[2];b[g]=b[g]||Object.create(null);b[g][i]=decodeURIComponent(a.get(f)[0])}}return b};b.extractAnalyticsData=function(a){for(var d=[],c=b.srcParamValues(a),a=b.srcAttrParamValues(a),e=0;e<c.length;e++){var f=c[e];d.push({src:f,attr:a[f]||{}})}return d};b.publish=function(a,b){o.trigger("analytics",{name:a,data:b||{}})};b.init=function(){var a=b.extractAnalyticsData(m.URL),d={userKey:l.get("remote-user-key"),pageID:l.get("page-id"),draftID:l.get("draft-id")};if(a.length> 2240){for(var c=0;c<a.length;c++){var e=a[c],f=j.extend({},d,e.attr);b.publish("confluence.viewpage.src."+e.src,f)}if(k.history&&k.history.replaceState){a=b.srcRemovedUrl(m.URL);m.URL!==a&&k.history.replaceState(null,"",a)}}else b.publish("confluence.viewpage.src.empty",d)};return b});require("confluence/module-exporter").exportModuleAsGlobal("confluence/analytics-support","AJS.Confluence.Analytics",function(j){require("ajs").toInit(j.init)}); 225}catch(e){WRMCB(e)}; 226; 227try { 228/* module-key = 'com.atlassian.applinks.applinks-plugin:lodash-amd', location = 'applinks/internal/lib/lodash-amd-global.js' */ 229define('applinks/lib/lodash', function() { 230 if (!window._) { 231 throw "lodash not found"; 232 } 233 return window._; 234 }); 235}catch(e){WRMCB(e)}; 236; 237try { 238/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/lib-version.js' */ 239// NOTE: this is in "lib" because it's required by aui-amd.js. This module _cannot_ have any dependencies on non-lib 240// modules (like "common") 241define('applinks/lib/version', [ 242 'applinks/lib/lodash'
243], function( 244 _ 245) { 246 247 function checkIntValue(value, desc) { 248 if (_.isUndefined(value)) { 249 return 0; 250 } else if (typeof value !== 'number' || isNaN(value)) { 251 throw new Error(desc + ': expected a number, was: <' + value + '>'); 252 } else { 253 return Math.floor(value); 254 } 255 } 256 257 function checkVersionObject(object, desc) { 258 if (!object || !(object instanceof Version)) { 259 throw new Error(desc + ': expected a Version object, was: <' + object + '>'); 260 } 261 return object; 262 } 263 264 function compareInt(intOne, intTwo) { 265 return intOne > intTwo ? 1 : intOne == intTwo ? 0 : -1; 266 } 267 268 /** 269 * Constructs a version object that contains version information and can be compared with other version objects. 270 * 271 * @param major major version component 272 * @param minor minor version component 273 * @param bugfix bugfix version component 274 * @constructor 275 */ 276 function Version(major, minor, bugfix) { 277 this.major = checkIntValue(major, 'major'); 278 this.minor = checkIntValue(minor, 'minor'); 279 this.bugfix = checkIntValue(bugfix, 'bugfix'); 280 } 281 282 /** 283 * Constructs a Version by parsing a version string. 284 * 285 * @param versionString version string to parse, expected to be in the form of <major>.<minor>.<bugfix> 286 * @param versionDesc what version does the `versionString` represent 287 */ 288 Version.parse = function(versionString, versionDesc) { 289 versionDesc = versionDesc || 'versionString'; 290 if (!versionString) { 291 throw new Error(versionDesc + ': expected a non-empty string'); 292 } 293 var versionSplit = versionString.split('.'); 294 if (versionSplit.length !== 3) { 295 throw new Error(versionDesc + ': expected <major>.<minor>.<bugfix> string, was: <' + versionString + '>'); 296 } 297 return new Version(parseInt(versionSplit[0]), parseInt(versionSplit[1]), parseInt(versionSplit[2])); 298 }; 299 300 /** 301 * Comparator function to sort Version objects. 302 * 303 * @param versionOne first version object 304 * @param versionTwo second version object 305 * @returns {Number} comparison result 306 * @see Version.compareTo(that) 307 */ 308 Version.comparator = function(versionOne, versionTwo) { 309 return checkVersionObject(versionOne, 'versionOne').compareTo(checkVersionObject(versionTwo, 'versionTwo')); 310 }; 311 312 /** 313 * Return -1, 0 or 1 as this Version object represents a version less than, equal to, or greater than `that`. 314 * 315 * @param that the other version to compare to 316 * @returns {Number} comparison result 317 */ 318 Version.prototype.compareTo = function(that) { 319 checkVersionObject(that, 'that'); 320 var majorResult = compareInt(this.major, that.major); 321 if (majorResult != 0) { 322 return majorResult; 323 } 324 var minorResult = compareInt(this.minor, that.minor); 325 if (minorResult != 0) { 326 return minorResult; 327 } 328 return compareInt(this.bugfix, that.bugfix); 329 }; 330 331 Version.prototype.greaterThan = function(that) { 332 return this.compareTo(that) > 0; 333 }; 334 335 Version.prototype.greaterThanOrEqual = function(that) { 336 return this.compareTo(that) >= 0; 337 }; 338 339 Version.prototype.lessThan = function(that) { 340 return this.compareTo(that) < 0; 341 }; 342 343 Version.prototype.lessThanOrEqual = function(that) { 344 return this.compareTo(that) <= 0; 345 }; 346 347 Version.prototype.equals = function(that) { 348 return this.compareTo(that) == 0; 349 }; 350 351 Version.prototype.toMinor = function() { 352 return new Version(this.major, this.minor); 353 }; 354 355 Version.prototype.toMajor = function() { 356 return new Version(this.major); 357 }; 358 359 Version.prototype.toString = function() { 360 return this.major + '.' + this.minor + '.' + this.bugfix; 361 }; 362 363 return Version; 364}); 365}catch(e){WRMCB(e)}; 366; 367try { 368/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/aui-version-detail
368s.js' */ 369define('applinks/lib/aui-version-details', [ 370 'applinks/lib/version' 371], function( 372 Version 373) { 374 // minimum 5.9.x AUI versions - lower versions ship with bugs that break some of the Applinks functionality. 375 var MINIMUM_59_VERSION = new Version(5, 9, 13); 376 var VERSION_58 = new Version(5, 8); 377 var VERSION_59 = new Version(5, 9); 378 379 function checkVersion(version) { 380 // if 5.9, must be >= the minimum required 5.9.x version 381 if (version.lessThan(MINIMUM_59_VERSION) || version.lessThan(VERSION_59)) { 382 throw new Error('AUI version ' + version + ' is too low, you need to upgrade AUI to ' + MINIMUM_59_VERSION 383 + ' for Applinks to work'); 384 } 385 } 386 387 function addVersionDetails(AJS) { 388 var ajsVersion = Version.parse(AJS.version, 'AUI version'); 389 checkVersion(ajsVersion); 390 391 AJS.versionDetails = ajsVersion; 392 AJS.versionDetails.is58 = ajsVersion.toMinor().equals(VERSION_58); 393 AJS.versionDetails.is59 = ajsVersion.toMinor().equals(VERSION_59); 394 395 return AJS; 396 } 397 398 return { 399 /** 400 * Check AUI version for compatibility with Applinks and add `versionDetails` field. 401 */ 402 addVersionDetails: addVersionDetails 403 }; 404}); 405 406}catch(e){WRMCB(e)}; 407; 408try { 409/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/console-amd.js' */ 410define('applinks/lib/console', function() { 411 return window.console; 412}); 413}catch(e){WRMCB(e)}; 414; 415try { 416/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/jquery-amd.js' */ 417define('applinks/lib/jquery', function() { 418 return window.jQuery; 419}); 420}catch(e){WRMCB(e)}; 421; 422try { 423/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/aui-amd.js' */ 424define('applinks/lib/aui', [ 425 'applinks/lib/window', 426 'applinks/lib/aui-version-details' 427], function( 428 window, 429 VersionDetails 430) { 431 var AJS = window.AJS; 432 if (!AJS) { 433 throw new Error('window.AJS not defined, cannot load AUI'); 434 } 435 436 return VersionDetails.addVersionDetails(AJS); 437}); 438}catch(e){WRMCB(e)}; 439; 440try { 441/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/wrm-amd.js' */ 442/** 443 * Define Web resource manager as an AMD dependency. This should also be present in apps using Atlassian Plugins Web 444 * Resources framework. 445 */ 446define('applinks/lib/wrm', function() { 447 return window.WRM; 448}); 449}catch(e){WRMCB(e)}; 450; 451try { 452/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/skate-amd.js' */ 453define('applinks/lib/skate', function() { 454 // window.skate is not exposed as a global from AUI 5.9, this will return undefined with that version or later 455 return window.skate; 456}); 457 458}catch(e){WRMCB(e)}; 459; 460try { 461/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/window-amd.js' */ 462/** 463 * Define window as AMD module to facilitate unit testing of some modules 464 */ 465define('applinks/lib/window', function() { 466 return window; 467}); 468}catch(e){WRMCB(e)}; 469; 470try { 471/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/spi-amd.js' */ 472/** 473 * Define the Applinks SPI functions as AMD module to facilitate unit testing of some modules 474 */ 475define('applinks/lib/spi', function() { 476 return {get: 477 function (){ 478 //required since code that depends on this global is run before the global is defined, 479 // can be eliminated once this module is made properly AMD 480 return AppLinks.SPI; 481 }} 482}); 483}catch(e){WRMCB(e)}; 484; 485try { 486/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-lib', location = 'applinks/internal/lib/applinks-creation-amd.js' */ 487/** 488 * Define the Applinks creation resources as AMD module to facilitate unit testing of some modules 489 */ 490define('applinks/lib/creation', function() { 491 return { 492 get: function () { 493 //required since code that depends on this global is run before the global is defined, 494 // can be eliminated once this module is made properly AMD 495 return AppLinks.Creation; 496 } 497 } 498}); 499}catch(e){WRMCB(e)}; 500; 501try { 502/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/docs.js' */ 503define('applinks/common/docs', [ 504 'applinks/lib/jquery', 505 'applinks/lib/aui', 506 'applinks/common/help-paths' 507], function( 508 $, 509 AJS, 510 ApplinksHelpPaths 511) { 512 // NOTE: should be moved to applinks/feature/help-link, see APLDEV-593 513 514 return { 515 /**
516 * NOTE: this is a dynamically generated version of the link build in _help_link.vm, any update here should be 517 * applied there. 518 * @method createDocLink 519 * @param pageKey a key that maps to a page in ual-help-paths.properties 520 * @param sectionKey (Optional) a key that maps to an anchor section id in ual-help-paths.properties 521 * @param classNames (Optional) Whitespace separated list of additional class names 522 * @return an html <a> element targeting the specified page & section 523 */ 524 createDocLink: function(pageKey, sectionKey, classNames) { 525 return this._createDocLink(pageKey, sectionKey, classNames, "Help"); 526 }, 527 createDocLinkIcon: function(pageKey, sectionKey, classNames) { 528 return this._createDocLink(pageKey, sectionKey, classNames, '') 529 .append($('<span/>', { 530 "class": 'aui-icon aui-icon-small aui-iconfont-help', 531 "text": "Help" 532 })); 533 }, 534 535 _createDocLink: function(pageKey, sectionKey, classNames, text) { 536 if (!classNames) { 537 classNames = ''; 538 } else { 539 classNames = ' ' + classNames; 540 } 541 return $('<a/>', { 542 'class': 'ual-help-link help-link' + classNames, 543 href: this.getDocHref(pageKey, sectionKey), 544 target: '_blank', 545 'data-help-link-key': pageKey, 546 text: text, 547 title: "Help" 548 }); 549 }, 550 551 /** 552 * @method getDocHref 553 * @param pageKey a key that maps to a page in ual-help-paths.properties 554 * @param sectionKey (Optional) a key that maps to an anchor section id in ual-help-paths.properties 555 * @return the url of the given page and section (if specified) 556 */ 557 getDocHref: function(pageKey, sectionKey) { 558 var link = ApplinksHelpPaths.getFullPath(pageKey); 559 if (sectionKey) { 560 link += '#' + ApplinksHelpPaths.getPath(sectionKey); 561 } 562 return link; 563 } 564 }; 565 566}); 567 568}catch(e){WRMCB(e)}; 569; 570try { 571/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/help-paths.js' */ 572define('applinks/common/help-paths', [ 573 'applinks/lib/console', 574 'applinks/lib/wrm', 575 'applinks/lib/lodash', 576 'applinks/common/modules', 577 'applinks/common/preconditions' 578], function( 579 console, 580 WRM, 581 _, 582 ApplinksModules, 583 Preconditions 584) { 585 // NOTE: should be moved to applinks/feature/help-link, see APLDEV-593 586 587 // lazy-load help paths, facilitates unit-testing 588 var allHelpPaths = _.memoize(function() { 589 var helpPaths = WRM.data.claim(ApplinksModules.dataFqn(ApplinksModules.COMMON_EXPORTED, 'applinks-help-paths')); 590 if (!helpPaths.entries) { 591 console.warn('Help paths not found, all help links are likely to be broken.'); 592 } 593 return helpPaths.entries || {}; 594 }); 595 596 var getPath = function(key, sectionKey) { 597 Preconditions.nonEmptyString(key, 'key'); 598 var path = allHelpPaths()[key] || key; 599 if (sectionKey) { 600 Preconditions.nonEmptyString(sectionKey, 'sectionKey'); 601 var prefix = path.replace(/\+/g, ''); // "g" flag to remove _all_ '+' signs 602 path += '#' +prefix + '-' + sectionKey; 603 } 604 return path; 605 }; 606 607 function endsWith(string, suffix) { 608 return string.indexOf(suffix, string.length - suffix.length) !== -1; 609 } 610 611 function addSuffixIfRequired(string, suffix) { 612 return endsWith(string, suffix) ? string : string + suffix; 613 } 614 615 return { 616 /** 617 * @param key {string} key to get the path for 618 * @returns {string} relative help path that can be appended to any relevant docs base URL 619 */ 620 getPath: getPath, 621 622 /** 623 * @param key {string} key to get the path for 624 * @param sectionKey {string}
624 optional key of the anchor on the target page 625 * @returns {string} full help path including the base URL 626 */ 627 getFullPath: function(key, sectionKey) { 628 var baseUrl = this.baseUrl(); 629 return addSuffixIfRequired(baseUrl, '/') + this.getPath(key, sectionKey); 630 }, 631 632 /** 633 * @returns {string} configured base URL for the help paths 634 */ 635 baseUrl: _.partial(getPath, 'applinks.docs.root') 636 } 637}); 638}catch(e){WRMCB(e)}; 639; 640try { 641/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/events.js' */ 642define('applinks/common/events', [ 643 'applinks/lib/jquery', 644 'applinks/lib/lodash', 645 'applinks/lib/window', 646 'applinks/common/preconditions' 647], function( 648 $, 649 _, 650 window, 651 Preconditions 652) { 653 var PREFIX = 'applinks.event.'; 654 655 function applinksEvent(eventId) { 656 return PREFIX + Preconditions.nonEmptyString(eventId, 'eventId'); 657 } 658 659 /** 660 * Provides common Applinks event IDs and a simple event system facade API. This is a preferred way to subscribe to 661 * and raise Applinks-specific events as it does not depend on a specific event bus or event target (such as 662 * `document`), as well as facilitates unit testing. 663 */ 664 return { 665 PREREADY: applinksEvent('preready'), 666 READY: applinksEvent('ready'), 667 668 /** 669 * Raised when applinks list is first loaded 670 */ 671 APPLINKS_LOADED: applinksEvent('loaded'), 672 /** 673 * Raised when applinks list is updated 674 */ 675 APPLINKS_UPDATED: applinksEvent('updated'), 676 677 /** 678 * This event is only raised when linking to Atlassian applications 679 * Can be consumed by other plugins 680 */ 681 NEW_APPLINK_CREATED: applinksEvent('created'), 682 683 /** 684 * Raised when orphaned upgrade operation succeeds in creating a new Applink from the orphaned relationship 685 */ 686 ORPHANED_UPGRADE: applinksEvent('orphaned.upgrade'), 687 688 /** 689 * Raised when v3 onboarding has finished or, or has never run on the current page (and won't). 690 */ 691 V3_ONBOARDING_FINISHED: applinksEvent('v3-onboarding-finished'), 692 693 // legacy events 694 Legacy: { 695 MESSAGE_BOX_DISPLAYED: applinksEvent('message-box-displayed') 696 }, 697 698 applinksEvent: applinksEvent, 699 700 on: function(events, handler, context) { 701 var handlerWithContext = context ? _.bind(handler, context) : handler; 702 $(window.document).on(events, handlerWithContext); 703 }, 704 705 off: function(events, handler) { 706 $(window.document).off(events, handler); 707 }, 708 709 trigger: function(event, data) { 710 $(window.document).trigger(event, data); 711 } 712 } 713}); 714}catch(e){WRMCB(e)}; 715; 716try { 717/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/i18n.js' */ 718define('applinks/common/i18n', [ 719 'applinks/lib/lodash', 720 'applinks/lib/jquery', 721 'applinks/lib/wrm', 722 'applinks/common/modules', 723 'applinks/common/preconditions', 724 'applinks/common/products' 725], function( 726 _, 727 $, 728 WRM, 729 ApplinksModules, 730 Preconditions, 731 ApplinksProducts 732) { 733 var getAllEntityTypes = _.memoize(function() { 734 var val = WRM.data.claim(ApplinksModules.dataFqn(ApplinksModules.COMMON_EXPORTED, 'entity-types')); 735 return Preconditions.hasValue(val, 'entity-types', 'Entity Types data not found'); 736 }); 737 738 var getAllAuthTypes = _.memoize(function() { 739 var val = WRM.data.claim(ApplinksModules.dataFqn(ApplinksModules.COMMON_EXPORTED, 'authentication-types')); 740 return Preconditions.hasValue(val, 'authentication-types', 'Authentication Types data not found'); 741 }); 742 743 return { 744 745 /** 746 * @param typeId ID of the application type to resolve 747 * @returns {string} resolved i18n-ed type name, or the original `typeId` if there is no mapping 748 */ 749 getApplicationTypeName: function(typeId) { 750 return ApplinksProducts.getTypeName(typeId); 751 }, 752 753 /** 754 * @param typeId ID of the entity type to resolve 755 * @returns {string}
755 resolved i18n-ed singular entity type name, or the original `typeId` if there is no mapping 756 */ 757 getEntityTypeName: function(typeId) { 758 return getAllEntityTypes().singular[typeId] || typeId; 759 }, 760 761 /** 762 * @param typeId ID of the entity type to resolve 763 * @returns {string} resolved i18n-ed plural entity type name, or the original `typeId` if there is no mapping 764 */ 765 getPluralizedEntityTypeName: function(typeId) { 766 return getAllEntityTypes().plural[typeId] || typeId; 767 }, 768 769 /** 770 * @param type ID of the authentication type to resolve (usually in a form of full class name) 771 * @returns {string} resolved i18n-ed authentication type name, or the original `type` if there is no mapping 772 */ 773 getAuthenticationTypeName: function(type) { 774 return getAllAuthTypes()[type] || type; 775 } 776 }; 777}); 778 779}catch(e){WRMCB(e)}; 780; 781try { 782/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/modules.js' */ 783/** 784 * Applinks plugin modules core constants and definitions. 785 */ 786define('applinks/common/modules', function() { 787 return { 788 /** 789 * Applinks plugin key 790 */ 791 PLUGIN_KEY: 'com.atlassian.applinks.applinks-plugin', 792 793 // key web resource keys 794 COMMON_EXPORTED: 'applinks-common-exported', 795 COMMON: 'applinks-common', 796 797 /** 798 * Fully qualifies a module name using the plugin key. 799 * 800 * @param {string} moduleName module name to qualify 801 * @returns {string} fully qualified name 802 */ 803 fqn: function(moduleName) { 804 return this.PLUGIN_KEY + ':' + moduleName; 805 }, 806 807 /** 808 * Fully qualifies web-resource data using module name and data key. 809 * 810 * @param {string} moduleName module name 811 * @param {string} dataKey key of the data element 812 * @returns {string} fully qualified name 813 */ 814 dataFqn: function(moduleName, dataKey) { 815 return this.fqn(moduleName) + '.' + dataKey; 816 } 817 }; 818}); 819}catch(e){WRMCB(e)}; 820; 821try { 822/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/preconditions.js' */ 823define('applinks/common/preconditions', [ 824 'applinks/lib/lodash' 825], function( 826 _ 827) { 828 function nonEmptyString(value, varName, customMessage) { 829 return _checkArgument( 830 _.isString(value) && !_.isEmpty(value),
831 customMessage, 832 _withVarName(varName, ': expected a non-empty string, was: <' + value + '>'), 833 value 834 ); 835 } 836 837 function isFunction(value, varName, customMessage) { 838 return _checkArgument( 839 _.isFunction(value), 840 customMessage, 841 _withVarName(varName, ': expected a function, was: ' + value), 842 value 843 ); 844 } 845 846 function isArray(value, varName, customMessage) { 847 return _checkArgument( 848 _.isArray(value), 849 customMessage, 850 _withVarName(varName, ': expected an array, was: ' + value), 851 value 852 ); 853 } 854 855 function hasValue(value, varName, customMessage) { 856 return _checkArgument( 857 value, 858 customMessage, 859 _withVarName(varName, ': expected a value'), 860 value 861 ); 862 } 863 864 function _checkArgument(test, message, defaultMessage, actualValue) { 865 var actualMessage = message ? message : defaultMessage; 866 if (!test) { 867 throw new Error(actualMessage) 868 } 869 return actualValue || test; 870 } 871 872 function _withVarName(varName, msg) { 873 return (varName || '[unspecified]') + msg; 874 } 875 876 return { 877 // applinks support 1.5.2+ underscore and its lodash counterparts 878 // _.partial works differently in [email protected] vs its newer and underscore versions 879 // thus replacing _.partial with vanilla JS for full compatibility 880 checkArgument: function(test, message, actualValue) { 881 return _checkArgument(test, message, '', actualValue); 882 }, 883 nonEmptyString: nonEmptyString, 884 isArray: isArray, 885 isFunction: isFunction, 886 hasValue: hasValue 887 }; 888}); 889}catch(e){WRMCB(e)}; 890; 891try { 892/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-common-exported', location = 'applinks/internal/common/products.js' */ 893define('applinks/common/products', [ 894 'applinks/lib/lodash', 895 'applinks/lib/wrm', 896 'applinks/common/modules', 897 'applinks/common/preconditions' 898], function( 899 _, 900 WRM, 901 ApplinksModules, 902 Preconditions 903) { 904 var getAllTypes = _.memoize(function() { 905 var val = WRM.data.claim(ApplinksModules.dataFqn(ApplinksModules.COMMON_EXPORTED, 'applinks-types')); 906 return Preconditions.hasValue(val, 'types', 'Application Types data not found'); 907 }); 908 909 /** 910 * @param typeId ID of the application type to resolve 911 * @returns {string} resolved i18n-ed type name, or the original `typeId` if there is no mapping 912 */ 913 function getTypeName(typeId) { 914 return getAllTypes()[typeId] || typeId; 915 } 916 917 /** 918 * Map of Atlassian product keys to application type IDs 919 */ 920 return { 921 BAMBOO: 'bamboo', 922 BITBUCKET: 'stash', // special case, see java class com.atlassian.applinks.application.bitbucket.BitbucketApplicationTypeImpl.TYPE_ID 923 CONFLUENCE: 'confluence', 924 FECRU: 'fecru', 925 JIRA: 'jira', 926 REFAPP: 'refapp', 927 STASH: 'stash', 928 getTypeName: getTypeName 929 }; 930}); 931}catch(e){WRMCB(e)}; 932; 933try { 934/* module-key = 'com.atlassian.auiplugin:split_aui.core', location = 'aui.chunk.81859c77a35803f186d6--a965583ff2f1059e0380.js' */ 935(window.__auiJsonp=window.__auiJsonp||[]).push([["aui.core"],[],[["7KGX","runtime","aui.splitchunk.0d131bcbf1","aui.splitchunk.444efc83be","aui.splitchunk.739b9ec8cc","aui.splitchunk.994e478d48","aui.splitchunk.479fe6ee76","aui.splitchunk.2e16019fb9","aui.splitchunk.8771ceac91","aui.splitchunk.7873ba9060","aui.splitchunk.0fc208f3fe","aui.splitchunk.2a34183e72"]]]); 936}catch(e){WRMCB(e)}; 937; 938try { 939/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-util-js', location = 'applinks/internal/non-amd/rest-service.js' */ 940// NOTE: this is used outside of Applinks. See atlassian-plugin.xml for more details about the associated restrictions 941 942(function(AppLinksI18n, ApplinksDocs, ApplinksEvents) { 943 var $ = AJS.$; 944 945 /** 946 * The triggering of AppLinks initialisation can be customised by setting a function on 947 * AJS.AppLinksInitialisationBinder. The binder function should take a single argument which is a zero-arg function to 948 * run and should execute this function when appropriate. 949 */ 950 AppLinks = $.extend(window.AppLinks || {}, { 951 Event: { 952 NAMESPACE: 'applinks' 953 }, 954 I18n: AppLinksI18n, 955 Docs: ApplinksDocs 956 }); 957 AppLinks.Event = $.extend(window.AppLinks.Event, ApplinksEvents); 958 959 // Is there an overridden initialisation binder? 960 if (AJS.AppLinksInitialisationBinder) { 961 AppLinks.initialisationBinder = AJS.AppLinksInitialisationBinder; 962 } else { 963 // The default bind if no specific binder is specified 964 AppLinks.initialisationBinder = function(f) { 965 AJS.toInit(f); 966 } 967 } 968 969 function parseJsonResponse(xhr) { 970 var respJSON = xhr.responseText; 971 var respObj; 972 try { 973 respObj = JSON.parse(respJSON); 974 } catch (e) { 975 console && console.error && console.error('invalid JSON response', respJSON, xhr); 976 } 977 return respObj || {}; 978 } 979 980 var restUrlVersionMatch = new RegExp('rest/applinks(?:.*?)/(\\d\\.\\d|\\d)/'); 981 /** 982 * Determine the REST endpoint version of a given URL. 983 * @param url 984 */ 985 function versionOf(url) { 986 var results = restUrlVersionMatch.exec(url); 987 return results && results.length === 2 ? results[1] : false;
988 } 989 990 AppLinks.initialisationBinder(function() { 991 AppLinks = $.extend(window.AppLinks || {}, { 992 failure: function(data) { 993 if (data.status == 401) { 994 window.location.reload(); 995 } else { 996 var message = AppLinks.parseError(data); 997 var errorDivs = $('.page-error'); 998 999 if (errorDivs.length > 0) { 1000 errorDivs.html(message).fadeIn('slow'); 1001 } else { 1002 alert('REST request failed: ' + message); 1003 } 1004 } 1005 }, 1006 jsonRequest: function(url, type, data, success, error, beforeSend) { 1007 if (data) { 1008 data = JSON.stringify(data); 1009 } 1010 $(".page-error").fadeOut('fast'); 1011 if (!error) error = AppLinks.failure; 1012 return jQuery.ajax({ 1013 url: url, 1014 type: type, 1015 data: data, 1016 dataType: 'json', 1017 contentType: "application/json; charset=utf-8", 1018 beforeSend: beforeSend, 1019 cache: false, 1020 success: success, 1021 error: error, 1022 jsonp: false 1023 }); 1024 }, 1025 xmlRequest: function(url, type, data, success, error, beforeSend) { 1026 if (data) { 1027 data = JSON.stringify(data); 1028 } 1029 $(".page-error").fadeOut('fast'); 1030 if (!error) error = AppLinks.failure; 1031 return jQuery.ajax({ 1032 url: url, 1033 type: type, 1034 data: data, 1035 dataType: 'xml', 1036 contentType: "application/xml; charset=utf-8", 1037 beforeSend: beforeSend, 1038 cache: false, 1039 success: success, 1040 error: error 1041 }); 1042 }, 1043 parseError: function(errorData) { 1044 var error = parseJsonResponse(errorData); 1045 var message = error && error.message; 1046 if (message) { 1047 return $.isArray(message) ? message.join(' ') : message; 1048 } 1049 if (errorData) { 1050 return errorData.statusText ? errorData.statusText : errorData; 1051 } 1052 return 'An unknown error occurred. Check the console logs for details.'; 1053 }, 1054 put: function(url, data, success, error, beforeSend) { 1055 return AppLinks.jsonRequest(url, 'PUT', data, success, error, beforeSend); 1056 }, 1057 post: function(url, data, success, error, beforeSend) { 1058 return AppLinks.jsonRequest(url, 'POST', data, success, error, beforeSend); 1059 }, 1060 update: function(data, success, error, beforeSend) { 1061 var selfLink = AppLinks.self_link(data); 1062 /** 1063 * Adapt to the version of the endpoint and the HTTP verb it uses. 1064 * yes, this is not "REST-ful". The verb is wrong. It has been wrong since 2014. 1065 * It is simpler to adapt than it is to release a new endpoint. 1066 */ 1067 var restMethod = versionOf(selfLink) === '1.0' ? AppLinks.put : AppLinks.post; 1068 restMethod(selfLink, data, success, error, beforeSend); 1069 }, 1070 get: function(url, success, error, beforeSend) { 1071 return AppLinks.jsonRequest(url, 'GET', null, success, error, beforeSend); 1072 }, 1073 getXml: function(url, success, error, beforeSend) { 1074 return AppLinks.xmlRequest(url, 'GET', null, success, error, beforeSend); 1075 }, 1076 self_link: function(item) { 1077 for (var i = 0, _i = item.link.length; i < _i; i++) { 1078 var link = item.link[i]; 1079 if (link.rel == "self") return link.href; 1080 } 1081 1082 throw "No self-link found"; 1083 }, 1084 del: function(urlOrObject, success, error, beforeSend) { 1085 var url; 1086 if (typeof(urlOrObject) == 'string') url = urlOrObject; 1087 else url = AppLinks.self_link(urlOrObject);
1088 return AppLinks.jsonRequest(url, 'DELETE', null, success, error, beforeSend); 1089 }, 1090 SPI: $.extend({}, { 1091 API_VERSION: "1.0", 1092 REST_RESOURCE_URL: AJS.contextPath() + "/rest/applinks/", 1093 BASE_URL: AJS.contextPath() + "/rest/applinks/1.0", 1094 OAUTH_REST_RESOURCE_URL: AJS.contextPath() + "/rest/applinks-oauth/", 1095 OAUTH_BASE_URL: AJS.contextPath() + "/rest/applinks-oauth/1.0", 1096 1097 /** 1098 * Update the API version and associated urls. 1099 * @param version 1100 */ 1101 setApiVersion: function(version){ 1102 AppLinks.SPI.API_VERSION = version; 1103 AppLinks.SPI.setBaseUrl(AppLinks.SPI.REST_RESOURCE_URL + AppLinks.SPI.API_VERSION); 1104 }, 1105 setBaseUrl: function(url){ 1106 AppLinks.SPI.BASE_URL = url; 1107 }, 1108 setOAuthBaseUrl: function(url){ 1109 AppLinks.SPI.OAUTH_BASE_URL = url; 1110 }, 1111 /** 1112 * Build a base URL for rest calls using the specified baseUrl. 1113 * @param baseUrl 1114 * @returns {string} 1115 */ 1116 getRemoteRestBaseUrl: function(baseUrl) { 1117 return baseUrl + "/rest/applinks/" + AppLinks.SPI.API_VERSION; 1118 }, 1119 /** 1120 * Build a base URL for plugin servlet calls using the specified baseUrl. 1121 * @param baseUrl 1122 * @returns {string} 1123 */ 1124 getRemotePluginServletBaseUrl: function(baseUrl) { 1125 return baseUrl + "/plugins/servlet"; 1126 }, 1127 getAllLinks: function(success, failure) { 1128 var url = AppLinks.SPI.BASE_URL + "/applicationlink"; 1129 return AppLinks.get(url, success, failure); 1130 }, 1131 getAllLinksWithAuthInfo: function(success, failure) { 1132 var url = AppLinks.SPI.BASE_URL + "/listApplicationlinks"; 1133 return AppLinks.get(url, success, failure); 1134 }, 1135 getApplicationLinkState: function(id, success, failure) { 1136 var url = AppLinks.SPI.BASE_URL + "/listApplicationlinkstates/id/" + id; 1137 return AppLinks.get(url, success, failure); 1138 }, 1139 getLinksOfType: function(typeId, success, failure) { 1140 var url = AppLinks.SPI.BASE_URL + "/applicationlink/type/" + typeId; 1141 return AppLinks.get(url, success, failure); 1142 }, 1143 tryToFetchManifest: function(url, success, failure) { 1144 var restUrl = AppLinks.SPI.BASE_URL + '/applicationlinkForm/manifest.json?url=' + encodeURIComponent(url); 1145 return AppLinks.get(restUrl, success, failure, function(jqxhr) { 1146 jqxhr.setRequestHeader("X-Atlassian-Token", "no-check"); 1147 }); 1148 }, 1149 getManifestFor: function(id, success, failure) { 1150 var url = AppLinks.SPI.BASE_URL + '/manifest/' + id + ".json"; 1151 return AppLinks.get(url, success, failure); 1152 }, 1153 getLocalManifest: function(success, failure){ 1154 var url = AppLinks.SPI.BASE_URL + '/manifest.json'; 1155 return AppLinks.get(url, success, failure); 1156 }, 1157 /** 1158 * Attempt to get the Manifest of the remote application, via a direct REST call. 1159 * Requires CORS enabled on the REST resource. 1160 * @param url 1161 * @param success 1162 * @param failure 1163 * @returns {*} 1164 */ 1165 getRemoteManifest: function(remoteBaseUrl, success, failure){ 1166 var remoteManifestUrl = AppLinks.SPI.getRemoteRestBaseUrl(remoteBaseUrl) + '/manifest.json'; 1167 return AppLinks.get(remoteManifestUrl, success, failure); 1168 }, 1169 /** 1170 * Attempt to get the OAuth Consumer Info of the remote application, via a direct call. 1171 * Requires CORS enabled on the REST resource. 1172 * @param url 1173 * @param success 1174 * @param failure 1175 * @returns {*} 1176 */ 1177 getRemoteOAuthConsumerInfo: function(remoteBaseUrl, success, failure){ 1178 var remoteManifestUrl = AppLinks.SPI.getRemotePluginServletBaseUrl(remoteBaseUrl) + '/oauth/consumer-info'; 1179 return AppLinks.getXml(remoteManifestUrl, success, failure); 1180 }, 1181 getApplinkStatus: function (applinkId, success, failure) { 1182 var url = AppLinks.SPI.BASE_URL + '/status/' + applinkId; 1183 return AppLinks.get(url, success, failure); 1184 }, 1185 createStaticUrlAppLink: function(applicationType, success, failure) { 1186 var restUrl = AppLinks.SPI.BASE_URL + '/applicationlinkForm/createStaticUrlAppLink?typeId=' + applicationType; 1187 return AppLinks.post(restUrl, null, success, failure); 1188 }, 1189 createLink: function(applicationLink, username, password, createTwoWayLink, customRpcUrl, rpcUrl, configFormV
1189alues, success, failure) { 1190 var url = AppLinks.SPI.BASE_URL + '/applicationlinkForm/createAppLink'; 1191 var data = { 1192 applicationLink: applicationLink, 1193 username: username, 1194 password: password, 1195 createTwoWayLink: createTwoWayLink, 1196 customRpcURL: customRpcUrl, 1197 rpcUrl: rpcUrl, 1198 configFormValues: configFormValues 1199 }; 1200 return AppLinks.post(url, data, success, failure); 1201 }, 1202 createLinkWithOrphanedTrust : function(applicationLink, username, password, createTwoWayLink, customRpcUrl, rpcUrl, configFormValues, orphanedTrust, success, failure) { 1203 var url = AppLinks.SPI.BASE_URL + '/applicationlinkForm/createAppLink'; 1204 var data = { 1205 applicationLink: applicationLink, 1206 username: username, 1207 password: password, 1208 createTwoWayLink: createTwoWayLink, 1209 customRpcURL: customRpcUrl, 1210 rpcUrl: rpcUrl, 1211 configFormValues: configFormValues, 1212 orphanedTrust: orphanedTrust 1213 }; 1214 return AppLinks.post(url, data, success, failure); 1215 },
1216 verifyTwoWayLinkDetails : function (remoteUrl, rpcUrl, username, password, success, failure) { 1217 var url = AppLinks.SPI.BASE_URL + '/applicationlinkForm/details'; 1218 var data = { 1219 username: username, 1220 password: password, 1221 remoteUrl: remoteUrl, 1222 rpcUrl: rpcUrl 1223 }; 1224 return AppLinks.post(url, data, success, failure); 1225 }, 1226 getApplicationLinkInfo: function (appId, success, error) { 1227 var url = AppLinks.SPI.BASE_URL + "/applicationlinkInfo/id/" + appId; 1228 return AppLinks.get(url, success, error); 1229 }, 1230 deleteLink: function(applicationLink, reciprocate, success, error) { 1231 var url = AppLinks.SPI.BASE_URL + "/applicationlink/" + applicationLink.id; 1232 if (reciprocate) url += "?reciprocate=true"; 1233 return AppLinks.del(url, success, error); 1234 }, 1235 makePrimary: function(applicationLink, success) { 1236 var url = AppLinks.SPI.BASE_URL + "/applicationlink/primary/" + applicationLink.id; 1237 return AppLinks.post(url, null, success); 1238 }, 1239 relocate: function(applicationLink, newUrl, suppressWarnings, success, error) { 1240 var url = AppLinks.SPI.BASE_URL + "/relocateApplicationlink/" + applicationLink.id + "?newUrl=" + encodeURIComponent(newUrl) + 1241 "&nowarning=" + (suppressWarnings ? "true" : "false"); 1242 return AppLinks.post(url, null, success, error); 1243 }, 1244 legacyUpgrade: function(applicationLink, success, error) { 1245 var url = AppLinks.SPI.BASE_URL + "/upgrade/legacy/" + applicationLink.id; 1246 return AppLinks.post(url, null, success, error); 1247 }, 1248 ualUpgrade: function(applicationLink, body, success, error) { 1249 var url = AppLinks.SPI.BASE_URL + "/upgrade/ual/" + applicationLink.id; 1250 return AppLinks.post(url, body, success, error); 1251 }, 1252 getEntityTypesForApplicationType: function(applicationType, success, error) { 1253 var url = AppLinks.SPI.BASE_URL + "/type/entity/" + applicationType; 1254 return AppLinks.get(url, success, error); 1255 }, 1256 getLocalEntitiesWithLinksToApplication: function(applicationLinkId, success, error) { 1257 var url = AppLinks.SPI.BASE_URL + "/entitylink/localEntitiesWithLinksTo/" + applicationLinkId + ".json"; 1258 return AppLinks.get(url, success, error); 1259 }, 1260 getEntityLinksForApplication: function(applicationLinkId, success, error) { 1261 var url = AppLinks.SPI.BASE_URL + "/entities/" + applicationLinkId + ".json"; 1262 AppLinks.get(url, success, error); 1263 }, 1264 getEntityLinksForApplicationUsingAnonymousAccess: function(applicationLinkId, success, error) { 1265 var url = AppLinks.SPI.BASE_URL + "/entities/anonymous/" + applicationLinkId + ".json"; 1266 return AppLinks.get(url, success, error); 1267 }, 1268 createNonUalEntityLink: function(localType, localKey, applicationId, remoteTypeId, remoteKey, name, success, error) { 1269 var url = AppLinks.SPI.BASE_URL + "/entitylink/" + localType + "/" + localKey + "?reciprocate=false"; 1270 var data = { 1271 applicationId: applicationId, 1272 typeId: remoteTypeId, 1273 key: remoteKey, 1274 name: name, 1275 isPrimary: false 1276 }; 1277 return AppLinks.put(url, data, success, error); 1278 }, 1279 createEntityLink: function(localType, localKey, entity, reciprocate, success, failure) { 1280 var url = AppLinks.SPI.BASE_URL + "/entitylink/" + localType + "/"
1280+ localKey + "?reciprocate="; 1281 url += (reciprocate ? "true" : "false"); 1282 return AppLinks.put(url, entity, success, failure); 1283 }, 1284 getConfiguredEntityLinks: function(localType, localKey, success, error) { 1285 var url = AppLinks.SPI.BASE_URL + "/entitylink/primaryLinks/" + localType + "/" + localKey + ".json"; 1286 return AppLinks.get(url, success, error); 1287 }, 1288 deleteEntityLink: function(localTypeId, localKey, entity, reciprocate, success, error) { 1289 var url = AppLinks.SPI.BASE_URL + "/entitylink/" + localTypeId + "/" + localKey + "?typeId=" + entity.typeId + "&key=" + entity.key + "&applicationId=" + entity.applicationId + "&reciprocate=" + reciprocate; 1290 return AppLinks.del(url, success, error); 1291 }, 1292 makePrimaryEntityLink: function(localTypeID, localKey, entity, success, error) { 1293 var url = AppLinks.SPI.BASE_URL + "/entitylink/primary/" + localTypeID + "/" + localKey + "?typeId=" + entity.typeId + "&key=" + entity.key + "&applicationId=" + entity.applicationId; 1294 return AppLinks.post(url, null, success, error); 1295 }, 1296 canDeleteAppLink: function(applicationId, success, error) { 1297 var url = AppLinks.SPI.BASE_URL + "/permission/reciprocate-application-delete/" + applicationId; 1298 return AppLinks.get(url, success, error); 1299 }, 1300 canDeleteEntityLink: function(localTypeId, localKey, entity, success, error) { 1301 var url = AppLinks.SPI.BASE_URL + "/permission/reciprocate-entity-delete/" + entity.applicationId + "/" + localTypeId + "/" + localKey + "/" + entity.typeId + "/" + entity.key; 1302 return AppLinks.get(url, success, error); 1303 }, 1304 canCreateReciprocateEntityLink: function(applicationId, success, error) { 1305 var url = AppLinks.SPI.BASE_URL + "/permission/reciprocate-entity-create/" + applicationId; 1306 return AppLinks.get(url, success, error); 1307 }, 1308 processPermissionCode: function(settings) { 1309 var config = { 1310 noPermission: function() {}, 1311 missing: function() {}, 1312 credentialsRequired: function(authUrl) {}, 1313 authenticationFailed: function(authUrl) {}, 1314 noAuthentication: function(authUrl) {}, 1315 noAuthenticationConfigured: function() {}, 1316 noConnection: function() {}, 1317 allowed: function() {}, 1318 unrecognisedCode: function(code) {}, 1319 updateView: function(message, icon, button) {} 1320 }; 1321 1322 if (!settings) settings = {}; 1323 1324 settings = $.extend(config, settings); 1325 1326 return function(data) { 1327 var code = data.code; 1328 if (code == "NO_PERMISSION") { 1329 settings.noPermission(); 1330 } else if (code == "MISSING") { 1331 settings.missing(); 1332 } else if (code == "CREDENTIALS_REQUIRED") { 1333 settings.credentialsRequired(data.url); 1334 } else if (code == "AUTHENTICATION_FAILED") { 1335 settings.authenticationFailed(data.url); 1336 } else if (code == "NO_AUTHENTICATION") { 1337 settings.noAuthentication(data.url); 1338 } else if (code == "NO_AUTHENTICATION_CONFIGURED") { 1339 settings.noAuthenticationConfigured(); 1340 } else if (code == "NO_CONNECTION") { 1341 settings.noConnection(); 1342 } else if (code == "ALLOWED") { 1343 settings.allowed(); 1344 } else { 1345 settings.unrecognisedCode(data.code); 1346 } 1347 }; 1348 }, 1349 addAuthenticationTrigger: function(target, authUrl, callbacks) { 1350 if (!callbacks) { 1351 callbacks = {}; 1352 } 1353 1354 if (typeof callbacks.onSuccess == "undefined") { 1355 callbacks.onSuccess = function() { 1356 location.reload(); 1357 } 1358 } 1359 1360 if (typeof callbacks.onFailure == "undefined") { 1361 callbacks.onFailure = function() { 1362 return true; 1363 } 1364 } 1365 //Unbind previous click listener, otherwise we might end up opening multiple windows.
1366 $(target).off('click.applinks'); 1367 $(target).on('click.applinks', function() { 1368 if (callbacks.before) { 1369 callbacks.before(); 1370 } 1371 AppLinks.authenticateRemoteCredentials(authUrl, callbacks.onSuccess, callbacks.onFailure); 1372 }); 1373 }, 1374 deleteOrphanedTrust: function(id, type, success, error) { 1375 var url = AppLinks.SPI.BASE_URL + "/orphaned-trust/" + type + "/" + id; 1376 return AppLinks.del(url, success, error); 1377 }, 1378 getOrphanedTrust: function(success, error) { 1379 var url = AppLinks.SPI.BASE_URL + "/orphaned-trust/"; 1380 return AppLinks.get(url, success, error); 1381 }, 1382 showCreateEntityLinkSuggestion: function() { 1383 return true; 1384 }, 1385 getApplicationLink: function(id, success, failure) { 1386 var url = AppLinks.SPI.BASE_URL + '/applicationlink/' + id; 1387 return AppLinks.get(url, success, failure); 1388 }, 1389 createApplicationLink: function(id, name, rpcUrl, displayUrl, typeId, success, failure) { 1390 var url = AppLinks.SPI.BASE_URL + '/applicationlink'; 1391 var data = { 1392 id: id, 1393 name: name, 1394 rpcUrl: rpcUrl, 1395 displayUrl: displayUrl, 1396 typeId: typeId 1397 }; 1398 return AppLinks.put(url, data, success, failure); 1399 }, 1400// TODO APLDEV-3 extract OAuth creation code into OAuth specific js files in the Oauth plugin. 1401 createConsumer: function(id, key, name, description, sharedSecret, publicKey, twoLOAllowed, executingTwoLOUser, twoLOImpersonationAllowed, outgoing, success, failure) { 1402 var url = AppLinks.SPI.OAUTH_BASE_URL + '/applicationlink/' + id + '/authentication/consumer'; 1403 var data = { 1404 key: key, 1405 name: name, 1406 description: description, 1407 sharedSecret: sharedSecret, 1408 publicKey: publicKey, 1409 outgoing: outgoing, 1410 twoLOAllowed: twoLOAllowed, 1411 executingTwoLOUser: executingTwoLOUser, 1412 twoLOImpersonationAllowed: twoLOImpersonationAllowed 1413 }; 1414 return AppLinks.put(url, data, success, failure); 1415 }, 1416 createConsumerAutoConfigure: function(id, twoLOAllowed, executingTwoLOUser, twoLOImpersonationAllowed, success, failure) { 1417 var url = AppLinks.SPI.OAUTH_BASE_URL + '/applicationlink/' + id + '/authentication/consumer?autoConfigure=true'; 1418 var data = { 1419 twoLOAllowed: twoLOAllowed, 1420 executingTwoLOUser: executingTwoLOUser, 1421 twoLOImpersonationAllowed: twoLOImpersonationAllowed 1422 }; 1423 return AppLinks.put(url, data, success, failure); 1424 }, 1425 registerProvider: function(id, provider, config, success, failure) { 1426 var url = AppLinks.SPI.BASE_URL + '/applicationlink/' + id + '/authentication/provider'; 1427 var data = { 1428 config : config, 1429 provider : provider 1430 }; 1431 return AppLinks.put(url, data, success, failure); 1432 }, 1433 enableFeature: function(featureName, success, failure) { 1434 var url = AppLinks.SPI.BASE_URL + '/features/' + featureName; 1435 return AppLinks.put(url, {}, success, failure); 1436 }, 1437 disableFeature: function(featureName, success, failure) { 1438 var url = AppLinks.SPI.BASE_URL + '/features/' + featureName; 1439 return AppLinks.del(url, success, failure); 1440 } 1441 }, (window.AppLinks && window.AppLinks.SPI) || {}) 1442 }); 1443 1444 AppLinks.UI = { 1445 showInfoBox: function(message) { 1446 $('.aui-message.aui-message-success').remove(); 1447 AppLinks.UI.createMessage('success', message, 'page-info'); 1448 }, 1449 hideInfoBox: function() { 1450 $('.aui-message.aui-message-success').remove(); 1451 }, 1452 showErrorBox: function(message) { 1453 AppLinks.UI.createMessage('error', message, 'page-error'); 1454 }, 1455 hideErrorBox: function() { 1456 $('.aui-message.aui-message-error').remove(); 1457 }, 1458 showWarningBox: function(messages) { 1459 if ($.isArray(messages) && messages.length > 0) { 1460 var ulEl = $("<ul></ul>"); 1461 $(messages).each(function(index) { 1462 ulEl.append($("<li/>", { 1463 text: messages[index] 1464 })); 1465 });
1466 var messageEl = $('<div class="page-warning"></div>').append(ulEl); 1467 AppLinks.UI.createMessage('warning', messageEl.html(), 'page-warning'); 1468 } else { 1469 AppLinks.UI.createMessage('warning', messages, 'page-warning'); 1470 } 1471 }, 1472 hideWarningBox: function() { 1473 $('.aui-message.aui-message-warning').remove(); 1474 }, 1475 shortenString: function(message, maxLength) { 1476 if (message.length > maxLength) { 1477 message = message.substring(0, maxLength) + "..."; 1478 } 1479 return message; 1480 }, 1481 createMessage: function(type, message, cssClass) { 1482 var messageEl = $('<div class="' + cssClass + '">'); 1483 messageEl.html(message); 1484 AJS.messages[type](".applinks-message-bar", { 1485 title: "", 1486 body: messageEl.wrap('<div></div>').parent().html(), 1487 closeable: true 1488 }); 1489 $(document).trigger(AppLinks.Event.Legacy.MESSAGE_BOX_DISPLAYED); 1490 }, 1491 displayValidationErrorMessages: function (errorClass, rootEl, messages) { 1492 if ($.isArray(messages)) { 1493 $(messages).each(function(i,v) { 1494 var d = $('<div class="error applinks-error">'); 1495 d.text(v); 1496 $(rootEl).find("." + errorClass).append(d); 1497 }); 1498 } else if(typeof messages != 'undefined'){ 1499 var d = $('<div class="error applinks-error">'); 1500 d.text(messages.toString()); 1501 $(rootEl).find("." + errorClass).append(d); 1502 } 1503 }, 1504 displayValidationError: function(errorClass, rootEl, errorFn) { 1505 return function(xhr) { 1506 if (xhr.status == 401) { 1507 window.location.reload(); 1508 return; 1509 } 1510 $('.applinks-error').remove(); 1511 $('aui-spinner').remove(); 1512 1513 var respObj = parseJsonResponse(xhr); 1514 var messages = respObj.message; 1515 1516 if (typeof respObj.fields == "undefined") { 1517 AppLinks.UI.displayValidationErrorMessages(errorClass, rootEl, messages); 1518 } else { 1519 var fields = respObj.fields; 1520 $(fields).each(function(index) { 1521 var d = $('<div class="error applinks-error" id="' + fields[index] + '-error">'); 1522 d.text(messages[index]); 1523 if ($(rootEl).find('.' + fields[index]).length > 0) { 1524 d.insertAfter($(rootEl).find('.' + fields[index])); 1525 } else { 1526 d.insertAfter($(rootEl).find('.' + errorClass).append(d)); 1527 } 1528 }); 1529 } 1530 $(rootEl).find('.' + errorClass).addClass("fully-populated-errors"); 1531 if (errorFn) { 1532 errorFn(); 1533 } 1534 } 1535 }, 1536 addProtocolToURL : function(url) { 1537 var newUrl = $.trim(url); 1538 var tempURL = newUrl.toLowerCase(); 1539 var hasProtocol = false;
1540 if (tempURL.length >= 7) { 1541 if (tempURL.substring(0,7).indexOf('http') != -1) { 1542 hasProtocol = true; 1543 } 1544 } 1545 //default protocol is http 1546 if (!hasProtocol) { 1547 newUrl = 'http://' + newUrl; 1548 } 1549 return newUrl; 1550 }, 1551 /** 1552 * Similar to the standard Javascript join() method, but nicer in that 1553 * it uses a different delimiter for the last node (by default "and"), 1554 * so that: 1555 * {code} 1556 * "1, 2 and 3" == prettyJoin(['1', '2', '3'], function(value) {return value;}); 1557 * {code} 1558 * 1559 * @param inputArray 1560 * @param resolveFn 1561 * @param finalDelimiter 1562 */ 1563 prettyJoin : function(inputArray, resolveFn, finalDelimiter) { 1564 if (!finalDelimiter) { 1565 finalDelimiter = "and"; 1566 } 1567 var maxLength = inputArray.length; 1568 var message = ""; 1569 $.each(inputArray, function(index, value) { 1570 if (index == (maxLength - 1) && maxLength > 1) { 1571 message += " " + finalDelimiter + " " + resolveFn(value); 1572 } else { 1573 message += resolveFn(value); 1574 if (index + 2 < maxLength) { 1575 message += ", "; 1576 } 1577 } 1578 }); 1579 return message; 1580 }, 1581 showLoadingIcon: function(element) { 1582 $('<aui-spinner size="small" class="applinks-loading"></aui-spinner>').insertBefore(element); 1583 }, 1584 hideLoadingIcon: function(element) { 1585 $(element).prev('aui-spinner').remove(); 1586 }, 1587 findUrl: function(text) { 1588 var url = undefined; 1589 var lcText = text.toLowerCase(); 1590 var startOfUrl = lcText.indexOf('http:'); 1591 if (startOfUrl == -1) { 1592 startOfUrl = lcText.indexOf('https:'); 1593 } 1594 if (startOfUrl > -1) { 1595 var endOfUrl = lcText.indexOf(' ', startOfUrl); 1596 if (endOfUrl == -1) { 1597 endOfUrl = lcText.length; 1598 } 1599 url = text.substring(startOfUrl, endOfUrl); // use _case-sensitive_ version to retrieve the actual URL 1600 } 1601 return url; 1602 }, 1603 findApplicationType : function(id) { 1604 id = id.toLowerCase(); 1605 if (id.indexOf("jira") != -1) { 1606 return "jira"; 1607 } else if (id.indexOf("fisheye") != -1) { 1608 return "fecru"; 1609 } else if (id.indexOf("confluence") != -1) { 1610 return "confluence"; 1611 } else if (id.indexOf("refapp") != -1) { 1612 return "refapp"; 1613 } else { 1614 return undefined; 1615 } 1616 }, 1617 escapeSelector: function(selector) { 1618 // based on http://samuelsjoberg.com/archive/2009/09/escape-jquery-selectors 1619 return selector.replace(/([#;&,\.\+\*\~':"\!\^$\[\]\(\)=>\|])/g, "\\$1"); 1620 }, 1621 sanitiseHTML: function(input) { 1622 var replacements = { 1623 "<": "<", 1624 '"': """, 1625 "&": "&" 1626 }; 1627 return input.replace(/[<"&]/g, function(match) { 1628 return replacements[match]; 1629 }); 1630 }, 1631 refreshOrphanedTrust: function() { 1632 // post dialog -- check whether we need to remove any orphaned-trust entries 1633 var updateOrphanedTrust = function(data) { 1634 $("tr.orphaned-trust-row").each(function() { 1635 var $this = $(this); 1636 var id = $this.attr("data-id"); 1637 var type = $this.attr("data-type"); 1638 var stillExists = false;
1639 for (var i = 0; i < data.orphanedTrust.length; i++) { 1640 var ot = data.orphanedTrust[i]; 1641 if (id == ot.id && type == ot.type) { 1642 stillExists = true; 1643 break; 1644 } 1645 } 1646 if (!stillExists) { 1647 $this.remove(); 1648 if (data.orphanedTrust.length == 0) { 1649 // we just removed the last orphaned trust cert, hide warning! 1650 $(".orphaned-trust-warning").hide(); 1651 } 1652 } 1653 }); 1654 }; 1655 1656 AppLinks.SPI.getOrphanedTrust(updateOrphanedTrust); 1657 }, 1658 removeCssClass: function(element, prefix) { 1659 $(element).removeClass( function(index, className) { 1660 var classes = className.split(' '); 1661 var classToRemove = ""; 1662 $.each(classes, function(index, value) { 1663 if (value.indexOf(prefix) != -1) { 1664 classToRemove = value; 1665 } 1666 }); 1667 return classToRemove; 1668 } ); 1669 } 1670 }; 1671 1672 /** 1673 * Add jQuery event system to AppLinks.UI namespace. 1674 */ 1675 (function(){ 1676 var eventBus = $({}); 1677 $.each(['bind', 'unbind', 'trigger'], function(i, current){ 1678 AppLinks.UI[current] = function(){ 1679 return eventBus[current].apply(eventBus, arguments); 1680 } 1681 }); 1682 })(); 1683 1684 $(document).trigger(AppLinks.Event.PREREADY); 1685 $(document).trigger(AppLinks.Event.READY); 1686 }); 1687})(require('applinks/common/i18n'), require('applinks/common/docs'), require('applinks/common/events')); 1688 1689}catch(e){WRMCB(e)}; 1690; 1691try { 1692/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-util-js', location = 'applinks/internal/non-amd/autocomplete.js' */ 1693// NOTE: this is used outside of Applinks. See atlassian-plugin.xml for more details about the associated restrictions 1694 1695AJS.$(document).bind(AppLinks.Event.READY, function() { 1696/** 1697 * TODO: THIS CODE IS COPIED FROM CONFLUENCE and should be part of AUI/AJS. 1698 * IF AUI comes with the InputDrivenDropDown when can remove this file. 1699 * https://studio.atlassian.com/browse/AJS-471 1700 * 1701 * A simple cache manager that supports a 1702 * FIFO cache invalidation strategy. 1703 * 1704 * @class cacheManager 1705 * @namespace AJS.Confluence 1706 * @constructor 1707 * @param cacheSize the size of the cache before keys are invalidated 1708 */ 1709AppLinks.autoComplete = { 1710 cacheManager : function (cacheSize) { 1711 var cache = {}, 1712 cacheStack = [], 1713 cacheSize = cacheSize || 30; 1714 1715 return { 1716 /** 1717 * Return the value stored in the cache for the given key 1718 * @method get 1719 * @param key {String} 1720 */ 1721 get: function(key) { 1722 return cache[key]; 1723 }, 1724 /** 1725 * Put the given key, value in the cache 1726 * @method put 1727 * @param key {String} 1728 * @param value {Object} 1729 */ 1730 put: function(key, value) { 1731 cache[key] = value; 1732 cacheStack.push(key); 1733 if (cacheStack.length > cacheSize) { 1734 delete cache[cacheStack.shift()]; 1735 } 1736 }, 1737 /** 1738 * Clear the cache. 1739 */ 1740 clear : function() { 1741 cache = {}; 1742 cacheStack = []; 1743 } 1744 }; 1745}}; 1746 1747 1748(function($){ 1749 /** 1750 * Check that all items in the drop down can be displayed - show ellipses at the end of any that 1751 * are too long. Also remove any unused properties that the dropDown may have stored for each 1752 * item in the list. 1753 * 1754 * @method truncateText 1755 * @private 1756 */ 1757 var truncateText = function (dd) { 1758 AJS.log("InputDrivenDropDown: truncating text"); 1759 var width = dd.$.closest(".aui-dropdown").width(), 1760 rightPadding = 20; // add some padding so the ellipsis doesn't run over the edge of the box 1761 1762 $("a span:not(.icon)", dd.$).each(function () { 1763 var $a = $(this), 1764 elpss = $("<var></var>").html("…"), 1765 elwidth = elpss.width(), 1766 isLong = false;
1767 1768 $a.wrapInner($("<em>")); 1769 $("em", $a).each(function () { 1770 var $label = $(this); 1771 1772 $label.show(); 1773 if (this.offsetLeft + this.offsetWidth > width) { 1774 var childNodes = this.childNodes, 1775 success = false; 1776 1777 for (var j = childNodes.length - 1; j >= 0; j--) { 1778 var childNode = childNodes[j], 1779 truncatedChars = 1, 1780 valueAttr = (childNode.nodeType == 3) ? "nodeValue" : "innerHTML", 1781 nodeText = childNode[valueAttr]; 1782 1783 do { 1784 if (truncatedChars <= nodeText.length) { 1785 childNode[valueAttr] = nodeText.substr(0, nodeText.length - truncatedChars++); 1786 } else { // if we cannot fit even one character of the next word, then try truncating the node just previous to this 1787 break; 1788 } 1789 } while (this.offsetLeft + this.offsetWidth + elwidth > width - rightPadding); 1790 1791 if (truncatedChars <= nodeText.length) { 1792 // we've managed truncate part of the word and fit it in 1793 success = true; 1794 break; 1795 } 1796 } 1797 1798 if (success) { 1799 isLong = true; 1800 } else { 1801 $label.hide(); 1802 } 1803 } 1804 }); 1805 if (isLong) { 1806 $a.append(elpss); 1807 this.elpss = elpss; 1808 } 1809 }); 1810 }; 1811 1812 var highlightTokens = function(dd, tokens) { 1813 if (!tokens.length || !tokens[0]) return; 1814 1815 AJS.log("InputDrivenDropDown: highlighting tokens"); 1816 1817 // escape regex chars .*+?|()[]{}\ first 1818 for (var i = 0, ii = tokens.length; i < ii; i++) { 1819 var token = tokens[i]; 1820 tokens[i] = token ? token.replace(/[\.\*\+\?\|\(\)\[\]{}\\]/g, "\\$") : ""; 1821 } 1822 1823 var regex = new RegExp("(" + tokens.join("|") + ")", "gi"); 1824 1825 $("li a:not(.dropdown-prevent-highlight) span", dd.$).each(function() { 1826 var span = $(this), 1827 html = span.html().replace(regex, "<strong>$1</strong>"); 1828 span.html(html); 1829 }); 1830 }; 1831 1832 /** 1833 * Builds and shows the dropdown. 1834 * 1835 * @param idd the InputDrivenDropdown 1836 * @param dropdownData in the form { matrix, query, queryTokens } 1837 * @private 1838 */ 1839 var makeDropdown = function (idd, dropdownData) { 1840 var options = idd.options, 1841 old_dd = idd.dd; 1842 1843 if (old_dd) { 1844 old_dd.hide(); 1845 old_dd.$.remove(); 1846 } 1847 1848 options.ajsDropDownOptions = options.ajsDropDownOptions || {}; 1849 if (options.ajsDropDownOptions && !options.ajsDropDownOptions.alignment) { // default to left alignment 1850 options.ajsDropDownOptions.alignment = "left"; 1851 } 1852 //this needs to be moved into aui 1853 options.ajsDropDownOptions.selectionHandler = options.ajsDropDownOptions.selectionHandler || function(e, element) { 1854 if(e.type != "click") { 1855 e.preventDefault(); 1856 $("a",element).click(); 1857 document.location = $("a",element).attr("href"); 1858 } 1859 }; 1860 1861 /* Fixing an AUI bug in here: AJS.dropdown puts the raw 'matrix[i].name' as html, without escaping it ! 1862 The solution is to override their displayHandler 1863 */ 1864 /** 1865 * Escape obj.name and return it 1866 */ 1867 options.ajsDropDownOptions.displayHandler = function (obj) { 1868 return AJS.escapeHtml(obj.name); 1869 } 1870 1871 var dd = idd.dd = new AJS.dropDown(dropdownData.matrix, options.ajsDropDownOptions)[0]; 1872 1873 // could move into dropdown.js in AUI 1874 if (options.ajsDropDownOptions && options.ajsDropDownOptions.className) { 1875 dd.$.addClass(options.ajsDropDownOptions.className); 1876 } 1877 1878 // place the created drop down using the configured dropdownPlacement function 1879 // if there is none then use a default behaviour 1880 if (options.dropdownPlacement) { 1881 options.dropdownPlacement(dd.$); 1882 } else { 1883 AJS.log("No dropdownPlacement function specified. Appending dropdown to the body."); 1884 $("body").append(dd.$); 1885 } 1886 1887 highlightTokens(dd, dropdownData.queryTokens || [dropdownData.query]); 1888 truncateText(dd); 1889 1890 if (options.dropdownPostprocess) { 1891 options.dropdownPostprocess(dd.$); 1892 } 1893 dd.show(idd._effect); 1894 1895 if (typeof options.onShow == "function") {
1896 options.onShow.call(dd, dd.$); 1897 } 1898 1899 return dd; 1900 }; 1901 1902 /** 1903 * Provides a controller-agnostic object that listens for controller changes and populates a dropdown 1904 * via a callback. Most aspects can be customized via the options object parameter. 1905 * <br> 1906 * Options are: 1907 * <li> 1908 * getDataAndRunCallback - (required) callback method used to provide data for the dropdown. It must take 1909 * two parameters, user input value and the callback function to execute. 1910 * </li> 1911 * <li> 1912 * onShow - function to call when the drop-down is displayed 1913 * </li> 1914 * <li> 1915 * dropdownPlacement - a function that will be called with the drop down and which should place it in the 1916 * correct place on the page. The supplied arguments are 1) the input that issued the 1917 * search, 2) the dropDown to be placed. 1918 * </li> 1919 * <li> 1920 * ajsDropDownOptions - any options the underlying dropDown component can handle expects 1921 * </li> 1922 * <li> 1923 * onDeath - callback to run when dropdown dies 1924 * </li> 1925 * @class InputDrivenDropDown 1926 * @namespace AJS 1927 */ 1928 function InputDrivenDropDown(id, options) { 1929 this._effect = "appear"; 1930 this._timer = null; 1931 1932 this.id = id; 1933 this.options = options; 1934 this.inactive = false; 1935 this.busy = false; 1936 this.cacheManager = AppLinks.autoComplete.cacheManager(); 1937 } 1938 1939 /** 1940 * Clears the cache. 1941 */ 1942 InputDrivenDropDown.prototype.clearCache = function () { 1943 this.cacheManager.clear(); 1944 }; 1945 1946 /** 1947 * This method should be called when the user input for this dropdown has changed. 1948 * It will check the cache before fetching data (via options.getDataAndRunCallback) 1949 * and displaying the dropdown. 1950 *
1951 * @param value {String} the new value of the user input 1952 * @param force {Boolean} force a change to occur regardless of user input 1953 */ 1954 InputDrivenDropDown.prototype.change = function (value, force) { 1955 var t = this; 1956 if (value != t._value || force) { 1957 t._value = value; 1958 t.busy = false; 1959 1960 clearTimeout(t._timer); 1961 1962 if (force || (/\S{0,}/).test(value)) { 1963 var cachedVal = t.cacheManager.get(value); 1964 if (cachedVal) { 1965 makeDropdown(t, cachedVal); 1966 } else { 1967 t.busy = true; 1968 t._timer = setTimeout(function () { // delay sending a request to give the user a chance to finish typing their search term(s) 1969 t.options.getDataAndRunCallback.call(t, value, t.show); 1970 }, 200); 1971 } 1972 } else { 1973 t.dd && t.dd.hide(); 1974 } 1975 } 1976 }; 1977 1978 /** 1979 * Gets the number of visible options in the dropdown. 1980 */ 1981 InputDrivenDropDown.prototype.dropDownLength = function () { 1982 return this.dd.links ? this.dd.links.length : 0; 1983 }; 1984 1985 /** 1986 * Gets the specified menu item from the dropdown list. 1987 * 1988 * @param index {Integer} the 0-based index of the dropdown option list 1989 */ 1990 InputDrivenDropDown.prototype.dropDownItem = function (index) { 1991 return this.dropDownLength() > index ? this.dd.links[index] : null; 1992 }; 1993 1994 /** 1995 * Hides the drop down 1996 */ 1997 InputDrivenDropDown.prototype.hide = function () { 1998 this.dd && this.dd.hide(); 1999 }; 2000 2001 /** 2002 * Hides and removes the drop down from the DOM. 2003 */ 2004 InputDrivenDropDown.prototype.remove = function () { 2005 var dd = this.dd; 2006 if (dd) { 2007 this.hide(); 2008 dd.$.remove(); 2009 } 2010 this.inactive = true; 2011 this.options.onDeath && this.options.onDeath(); 2012 }; 2013 2014 /** 2015 * Shows the drop down with the given matrix data and query. 2016 * <br> 2017 * Matrix property should be an array of arrays, where the sub-arrays represent the different 2018 * search categories. 2019 * 2020 * Expected properties of category sub-array objects are: 2021 * - href 2022 * - name 2023 * - className 2024 * - html (optional, replaces href and name) 2025 * - icon (optional) 2026 * 2027 * 2028 * @param matrix {Array} matrix to populate the drop down from 2029 * @param query {String} the user input string that triggered this show 2030 * @param queryTokens {Array} an array of strings of the query tokens. Use for highlighting search terms. 2031 */ 2032 InputDrivenDropDown.prototype.show = function (matrix, query, queryTokens) { 2033 if (this.inactive) { 2034 AJS.log("Quick search abandoned before server response received, ignoring. " + this); 2035 return; 2036 } 2037 2038 var dropdownData = { 2039 matrix: matrix, 2040 query: query, 2041 queryTokens: queryTokens 2042 }; 2043 this.cacheManager.put(query, dropdownData); 2044 2045 makeDropdown(this, dropdownData); 2046 this.busy = false; 2047 }; 2048 2049 /** 2050 * Returns an InputDrivenDropDown. See InputDrivenDropDown for more documentation. 2051 * @param options {Object} options for the InputDrivenDropDown 2052 * @constructor 2053 */ 2054 AppLinks.inputDrivenDropdown = function (options) { 2055 return new InputDrivenDropDown("inputdriven-dropdown", options); 2056 }; 2057 2058})(jQuery); 2059}); 2060 2061}catch(e){WRMCB(e)}; 2062; 2063try { 2064/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-util-js', location = 'js/fecru-compatibility.js' */ 2065if (jQuery != undefined && AJS != undefined) jQuery = AJS.$; // make sure we're extending the correct jQuery 2066}catch(e){WRMCB(e)}; 2067; 2068try { 2069/* module-key = 'com.atlassian.applinks.applinks-plugin:feature-oauth-dance', location = 'applinks/internal/feature/oauth/oauth-callback.js' */ 2070define('applinks/feature/oauth-callback', [ 2071 'applinks/lib/window', 2072 'applinks/lib/lodash', 2073 'applinks/common/preconditions' 2074], function( 2075 window, 2076 _, 2077 Preconditions 2078) { 2079 function OAuthCallback(url) { 2080 Preconditions.nonEmptyString(url, 'url'); 2081 this._url = url; 2082 } 2083 2084 OAuthCallback.prototype.source = function(source) { 2085 Preconditions.hasValue(source, 'source'); 2086 this._source = source; 2087 return this; 2088 }; 2089 2090 OAuthCallback.prototype.onSuccess = function(callback) { 2091 Preconditions.isFunction(callback, 'onSuccess'); 2092 this._onSuccess = callback; 2093 return this; 2094 }; 2095 2096 OAuthCallback.prototype.onFailure = function(callback) { 2097 Preconditions.isFunction(callback, 'onFailure'); 2098 this._onFailure = callback; 2099 return this; 2100 }; 2101 2102 // API for OAuth to invoke callbacks 2103 OAuthCallback.prototype.success = function() { 2104 this.oauthWindow.close(); 2105 if (this._onSuccess) { 2106 this._onSuccess(this._source); 2107 } 2108 // free up the oauthCallback object 2109 delete window.oauthCallback; 2110 }; 2111 2112 OAuthCallback.prototype.failure = function() { 2113 this.oauthWindow.close(); 2114 if (this._onFailure) { 2115 this._onFailure(this._source); 2116 } 2117 // free up the oauthCallback object 2118 delete window.oauthCallback; 2119 }; 2120 2121 // start the dance 2122 OAuthCallback.prototype.open = function() { 2123 // required for OAuth callbacks to fire 2124 window.oauthCallback = this; 2125 this.oauthWindow = window.open(this._url, 'com_atlassian_applinks_authentication'); 2126 }; 2127 2128 return OAuthCallback; 2129}); 2130}catch(e){WRMCB(e)}; 2131; 2132try { 2133/* module-key = 'com.atlassian.applinks.applinks-plugin:feature-oauth-dance', location = 'applinks/internal/feature/oauth/oauth-dance.js' */ 2134define('applinks/feature/oauth-dance', [ 2135 'applinks/lib/console', 2136 'applinks/lib/jquery', 2137 'applinks/lib/lodash', 2138 'applinks/lib/window', 2139 'applinks/common/events', 2140 'applinks/common/preconditions', 2141 'applinks/feature/oauth-callback' 2142], function( 2143 console, 2144 $, 2145 _, 2146 window, 2147 ApplinksEvents, 2148 Preconditions, 2149 OAuthCallback 2150) { 2151 /** 2152 * Creates a new OAuth Dance. This initializes elements found by `selector` within `scope` to initiate the OAuth 2153 * dance on click. The elements need to have a `data-authorisation-uri` attribute that points to the authorisation 2154 * page to open. 2155 * 2156 * @param scope {string} optional selector for scope, if not defined then global `document` will be used 2157 * @param selector {string} selector for the DOM elements to initialize OAuth dance for. If not defined then scope will be used 2158 * @constructor 2159 */ 2160 function OAuthDance(scope, selector) { 2161 this._scope = scope || window.document; 2162 this._selector = selector; 2163 } 2164 2165 OAuthDance.prototype.onSuccess = function(callback) { 2166 Preconditions.isFunction(callback, 'onSuccess'); 2167 this._onSuccess = callback; 2168 return this; 2169 }; 2170 2171 OAuthDance.prototype.onFailure = function(callback) { 2172 Preconditions.isFunction(callback, 'onFailure'); 2173 this._onFailure = callback; 2174 return this; 2175 }; 2176 2177 OAuthDance.prototype.defaultSuccess = function() { 2178 return this.onSuccess(function() { 2179 window.location.reload() 2180 }); 2181 }; 2182 2183 OAuthDance.prototype.defaultFailure = function() { 2184 return this.onFailure(function() { return true }); 2185 }; 2186 2187 /** 2188 * Wire up click events for the selected elements to initiate OAuth dance. 2189 */ 2190 OAuthDance.prototype.initialize = function() { 2191 var that = this; 2192 if (this._selector) { 2193 $(this._scope).on('click', this._selector, function(e) { 2194 e.preventDefault(); 2195 that._open($(this)); 2196 }); 2197 } else { 2198 $(this._scope).on('click', function(e) { 2199 e.preventDefault(); 2200 that._open($(this)); 2201 }); 2202 } 2203 }; 2204 2205 /** 2206 * Start the OAuth dance for the given selector/scope. 2207 */ 2208 OAuthDance.prototype.start = function() { 2209 var $scope = $(this._scope); 2210 var $element = this._selector ? $scope.find(this._selector) : $scope; 2211 this._open($element); 2212 }; 2213 2214 OAuthDance.prototype._open = function(element) { 2215 if (element.length !== 1) { 2216 console.warn('Could not trigger OAuth dance, the source is not a single HTML element: ' + element); 2217 return; 2218 } 2219 2220 var authorisationUri = element.attr('data-authorisation-uri'); 2221 2222 if (authorisationUri) { 2223 this._onSuccess || this.defaultSuccess(); 2224 this._onFailure || this.defaultFailure(); 2225 new OAuthCallback(authorisationUri) 2226 .source(element) 2227 .onSuccess(this._onSuccess) 2228 .onFailure(this._onFailure) 2229 .open(); 2230 } else { 2231 console.warn('Could not trigger OAuth dance, data-authorisation-uri missing for: ' + element); 2232 } 2233 }; 2234 2235 return OAuthDance; 2236}); 2237}catch(e){WRMCB(e)}; 2238; 2239try { 2240/* module-key = 'com.atlassian.applinks.applinks-plugin:applinks-oauth-ui', location = '
2240js/oauth-dialog.js' */ 2241// NOTE: this is used outside of Applinks. See atlassian-plugin.xml for more details about the associated restrictions 2242 2243/** 2244 * @deprecated use applinks/feature/oauth-callback and applinks/feature/oauth-dance AMD module 2245 */ 2246(function($, ApplinksEvents, OAuthCallback) { 2247 // rest-service.js will load the AppLinks name space 2248 AppLinks.authenticateRemoteCredentials = function (url, onSuccess, onFailure) { 2249 $('.applinks-error').remove(); 2250 new OAuthCallback(url).onSuccess(onSuccess).onFailure(onFailure).open(); 2251 }; 2252})(require('applinks/lib/jquery'), require('applinks/common/events'), require('applinks/feature/oauth-callback')); 2253 2254}catch(e){WRMCB(e)}; 2255; 2256try { 2257/* module-key = 'confluence.extra.jira:common', location = 'util/retry-caller.js' */ 2258define("confluence/jim/util/retry-caller",["ajs","jquery","underscore"],function(r,d,h){return function(k,a){a=a||{};var l=a.args,m="function"===typeof a.tester?a.tester:function(){return!0},e=a.delays||[.1,.3,.5,.7,1],n=e.length,c=d.Deferred(),p=c.promise(),b=a.context||c,f=0,g=function(){if(f===n)return c.rejectWith(b,[b,"exceed-maximum-called-times",""]);var q=e[f++];h.delay(function(){d.when(k.apply(b,l)).then(function(){c.notify.apply(b,arguments);m.apply(b,arguments)?g():c.resolveWith(b,arguments)}, 2259function(){c.rejectWith(b,arguments)})},q)};g();return p}}); 2260}catch(e){WRMCB(e)}; 2261; 2262try { 2263/* module-key = 'confluence.extra.jira:common', location = 'util/common.js' */ 2264AJS.JiraIssues={Remote:{}};var appLinksI18n={entries:{}}; 2265jQuery(document).ready(function(){AJS.JiraIssues=jQuery.extend(AJS.JiraIssues||{},{bindOAuthLink:function(a,b){var d=function(){b()},e=function(){},k=a.attr("href");a.click(function(l){AppLinks.authenticateRemoteCredentials(k,d,e);l.preventDefault()})},getOAuthRealm:function(a){a=a.getResponseHeader("WWW-Authenticate")||"";return(a=/OAuth realm="([^"]+)"/.exec(a))?a[1]:null}});jQuery("a.static-oauth-init").each(function(){AJS.JiraIssues.bindOAuthLink(jQuery(this),function(){window.location.reload()})}); 2266jQuery("a.anonymous-init").each(function(a,b){a=encodeURIComponent(window.location.pathname.replace(Confluence.getContextPath(),""));a=Confluence.getContextPath()+"/login.action?os_destination\x3d"+a;AJS.$(b).attr("href",a)});var w=function(a){for(var b=AJS.JiraIssues.Remote[a],d="",e=0;e<b.length;e++)d+=b[e].key+(e<b.length-1?",":"");var k=function(c){c="/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery\x3d"+encodeURIComponent("issuekey in ("+c+")")+"\x26returnMax\x3dtrue";return contextPath+ 2267"/plugins/servlet/issue-retriever?appId\x3d"+a+"\x26url\x3d"+encodeURIComponent(c)+"\x26columns\x3dsummary\x26columns\x3dtype\x26columns\x3dresolution\x26columns\x3dstatus"},l=function(c){AJS.$("item",c).each(function(){for(var m=AJS.$("link",this).text(),h=AJS.$("key",this).text(),f=AJS.$("summary",this).text(),p=AJS.$("type",this),g="-1"!=AJS.$("resolution",this).attr("id"),v=AJS.$("status",this),r=AJS.$(".unknown-jira-issue."+h),q=0;q<r.length;q++){var t=AJS.$("\x3ca style\x3d\"background-image: url('"+ 2268p.attr("iconUrl")+'\')" href\x3d"'+m+'"\x3e\x3c/a\x3e');t.text(h);var u=AJS.$('\x3cspan class\x3d"jira-status"\x3e\x3c/span\x3e');u.text(v.text().toUpperCase());var n=AJS.$('\x3cspan class\x3d"jira-issue'+(g?" resolved":"")+'" \x3e\x3c/span\x3e');n.append(t);n.append(document.createTextNode(" - "+f+" - "));n.append(u);AJS.$(r[q]).replaceWith(n)}})};d=k(d);AJS.$.ajax({url:d,success:l,error:function(c){if(401==c.status){var m=AJS.JiraIssues.getOAuthRealm(c);if(m){var h={};AJS.$(b).each(function(){if(!h[this.key]){h[this.key]= 2269!0;var f=AJS.$('\x3cspan class\x3d"oauth-msg"\x3e - \x3ca class\x3d"oauth-init" href\x3d"'+m+'"\x3e'+"Authenticate"+"\x3c/a\x3e "+"to see issue details"+"\x3c/span\x3e");AJS.$(".unknown-jira-issue."+this.key).addClass("single-issue-oauth").append(f)}});AJS.JiraIssues.bindOAuthLink(AJS.$(".single-issue-oauth a.oauth-init"),function(){window.location.reload()})}}else 400==c.status&&1<b.length&&AJS.$(b).each(function(){var f=this.key,p=k(f); 2270AJS.$.ajax({url:p,success:l,error:function(g){g=AJS.$(".unknown-jira-issue."+f);g.removeClass("single-issue-oauth");AJS.$(".oauth-msg",g).remove();g.addClass("jira-error")}})})}})};AJS.$(".unknown-jira-issue").each(function(a,b){b=AJS.$(b);a=b.attr("data-app-link");b=b.attr("data-key");AJS.JiraIssues.Remote[a]=AJS.JiraIssues.Remote[a]||[];AJS.JiraIssues.Remote[a].push({key:b})});for(var x in AJS.JiraIssues.Remote)w(x)}); 2271}catch(e){WRMCB(e)}; 2272; 2273try { 2274/* module-key = 'confluence.extra.jira:web-resources', location = 'templates/extra/jira/jiraIssues.js' */ 2275jQuery(document).ready(function(){var k=jQuery.extend(window.JiraIssues||{},{ADG_ENABLED:4E3<=AJS.Meta.getNumber("build-number"),ADG_FONT_SIZE_OVER_FLEXIGRID_FONT_SIZE_RATIO:14/11,onSuccessFunction:function(b){if(!jQuery("fieldset input[name\x3d'height']",b).length){var a=jQuery(".bDiv table[id^\x3d'jiraissues_table']",b)[0],c=a.grid;a=a.clientHeight+jQuery(".hDiv",b)[0].clientHeight;jQuery(".bDiv",b).css("height",a+"px");c.options.height=a;c.fixHeight(a)}},onErrorFunction:function(b,a,c,e,d){c=jQuery("#"+ 2276a);d=e.getResponseHeader("WWW-Authenticate")||"";if("401"==e.status&&-1!=d.indexOf("OAuth")){if(e=/OAuth realm="([^"]+)"/.exec(d)){c.empty();k.bigMessageFunction(a,'\x3ca class\x3d"oauth-init" href\x3d"'+e[1]+'"\x3e'+"Authenticate"+"\x3c/a\x3e "+"to retrieve your issues"+"\x3c/span\x3e");jQuery(".bmDiv",b).css({"z-index":2});var l=function(){window.location.reload()},h=function(){};a=jQuery(".oauth-init",c.parent());var m=a.attr("href");a.click(function(g){AppLinks.authenticateRemoteCredentials(m, 2277l,h);g.preventDefault()});AJS.$(".gBlock").remove()}}else if("400"==e.status)k.bigMessageFunction(a,"The Jira server was not able to process the search. This may indicate a problem with the syntax of this macro. Alternatively, if this table is requesting specific issue keys, you may
2277not have permission to view one of these issues.");else{var f=jQuery("iframe.jiraissues_errorMsgSandbox",b);f.load(function(){var g=this.contentWindow||this.contentDocument;g=jQuery((g.document?g.document:g).body);jQuery("a",g).each(function(){this.target="_top"});jQuery(".pPageStat",b).empty().text(g.text());g=jQuery("div.bmDiv",b)[0];f.removeClass("hidden");f.css({height:g.clientHeight+"px", 2278width:g.clientWidth+"px"})});f[0].src=jQuery("fieldset input[name\x3d'retrieverUrlHtml']",b).val();k.bigMessageFunction(a,f)}jQuery(b).find(".pReload").removeClass("loading");c[0].grid.loading=!1;jQuery(b).find(".pButton").each(function(){jQuery(this).removeClass("pBtnOver");jQuery(this).css({cursor:"default",opacity:"0.3"})});jQuery(b).find("span.pcontrol input").attr("readonly","true")},onReloadFunction:function(b,a,c){jQuery(".bmDiv",a).remove();jQuery(".bmDistance",a).remove();c.onSubmit=function(){k.reloadOnSubmitFunction(b, 2279c);return!0}},reloadOnSubmitFunction:function(b,a){a.params=[{name:"useCache",value:!1}];a.onSubmit=function(){k.onSubmitFunction(b,a);return!0}},onSubmitFunction:function(b,a){a.params=[{name:"useCache",value:b}]},showTrustWarningsFunction:function(b,a){b=jQuery(b).children(".trusted_warnings");a.trustedMessage?(b.find("td:last").html(a.trustedMessage),b.css("display","block")):b.css("display","none")},preProcessFunction:function(b,a,c,e,d){c&&k.showTrustWarningsFunction(b,e);0==e.total&&(jQuery(".pPageStat", 2280b).html(d),k.bigMessageFunction(a,d),jQuery(".pReload",b).removeClass("loading"))},bigMessageFunction:function(b,a){var c=jQuery("\x3cdiv\x3e\x3c/div\x3e"),e=jQuery("\x3cdiv\x3e\x3c/div\x3e");c.addClass("bmDistance");e.addClass("bmDiv");"string"==typeof a?e.html("\x3cp\x3e\x3cstrong\x3e"+a+"\x3c/strong\x3e\x3c/p\x3e"):a.appendTo(e);jQuery("#"+b).after(e).after(c)},getParamsFrom:function(b){var a={};b.children("input").each(function(){a[jQuery(this).attr("name")]=jQuery(this).attr("value")});return a}, 2281initializeColumnWidth:function(b,a){var c={},e=function(p){return k.ADG_ENABLED?Math.round(p*k.ADG_FONT_SIZE_OVER_FLEXIGRID_FONT_SIZE_RATIO):p};if(!a||!a.length)return c;b=b.width()-(37+11*a.length);for(var d=!1,l=!1,h=0,m=e(140),f=0,g=a.length;f<g;f++){var n=a[f].name;switch(n){case "summary":d=!0;h++;break;case "description":l=!0;h++;break;case "type":h++;c[n]=30;b-=30;break;case "priority":h++;c[n]=50;b-=50;break;case "status":h++;c[n]=e(100);b-=e(100);break;case "key":h++;c[n]=e(90);b-=e(90); 2282break;case "comments":case "attachments":case "version":case "component":case "resolution":h++;c[n]=e(80);b-=e(80);break;default:c[n]=m}}if(d||l)b-=m*(a.length-h),d&&l?(c.summary=Math.max(b/2,250),c.description=Math.max(b/2,250)):d?c.summary=Math.max(b,250):c.description=Math.max(b,250);else if(!d&&!l&&a.length>h)for(m=b/(a.length-h),f=0;f<g;f++)({resolution:!0,key:!0,type:!0,priority:!0,status:!0})[a[f]]||(c[a[f]]=m);return c}});jQuery(".jiraissues_table").each(function(b,a){var c=jQuery(a),e=c.children("fieldset"), 2283d=k.getParamsFrom(e),l="jiraissues_table_"+b;c.append('\x3ctable id\x3d"'+l+'" style\x3d"display:none"\x3e\x3c/table\x3e');c.css("width",d.width);var h=[];e.children(".columns").each(function(f){var g=jQuery(this).hasClass("nowrap");h[f]={display:this.name,name:this.value,nowrap:g,sortable:!0,align:"left"}});var m=k.initializeColumnWidth(c,h);jQuery.each(h,function(f,g){g.width=m[g.name]});b=jQuery("\x3cdiv\x3e\x3c/div\x3e");jQuery("\x3ca\x3e\x3c/a\x3e").attr({rel:"nofollow",href:d.clickableUrl}).text(d.title).appendTo(b); 2284jQuery("#"+l).flexigrid({url:d.retrieverUrlHtml,method:"GET",dataType:"json",colModel:h,sortname:d.sortField,sortorder:d.sortOrder,usepager:!0,title:b.html(),page:parseInt(d.requestedPage,10),useRp:!1,rp:parseInt(d.resultsPerPage,10),showTableToggleBtn:!0,height:d.height?parseInt(d.height,10):480,onSuccess:function(){k.onSuccessFunction(a)},onSubmit:function(){k.onSubmitFunction(d.useCache,this);return!0},preProcess:function(f){k.preProcessFunction(a,l,d.showTrustWarnings,f,d.nomsg);return f},onError:function(f, 2285g,n){k.onErrorFunction(a,l,d.jiraissuesError,f,g,n)},onReload:function(){k.onReloadFunction(d.useCache,a,this);return!0}
2285,errormsg:d.errormsg,pagestat:d.pagestat,procmsg:d.procmsg,nomsg:d.nomsg})});jQuery(".jiraissues_count").each(function(b,a){var c=jQuery(a);jQuery.ajax({cache:!1,type:"GET",url:c.find(".url").text(),data:{useCache:c.find(".use-cache").text(),rp:c.find(".rp").text(),showCount:"true"},success:function(e){var d=c.find(".result");1==e?d.text(AJS.format("{0} issue", 2286e)):d.text(AJS.format("{0} issues",e));d.removeClass("hidden");jQuery(".calculating, .error, .data",c).remove()},error:function(e){var d=jQuery(".error",c).removeClass("hidden"),l=e.getResponseHeader("WWW-Authenticate")||"",h=!1;if(401===e.status&&-1!=l.indexOf("OAuth")){var m=/OAuth realm="([^"]+)"/.exec(l);m&&(d.empty().append(AJS.$("\x3ca/\x3e",{href:m[1],"class":"oauth-init"}).text("Authenticate").click(function(){AppLinks.authenticateRemoteCredentials(m[1], 2287function(){window.location.reload()},function(){});return!1})).append(AJS.$("\x3cspan/\x3e",{text:" "+"to retrieve your issues"})),h=!0)}h||d.text(AJS.format(d.text(),e.status));jQuery(".calculating, .result, .data",c).remove()}})})}); 2288}catch(e){WRMCB(e)}; 2289; 2290try { 2291/* module-key = 'com.atlassian.auiplugin:split_aui.component.banner', location = 'aui.chunk.9cd5a86a207fd4143307--9af9854fb9fe4a83ebd9.js' */ 2292(window.__auiJsonp=window.__auiJsonp||[]).push([["aui.component.banner"],{vjN3:function(e,n,t){"use strict";t.r(n),t.d(n,"banner",(function(){return d}));t("iRqc"),t("FStl"),t("Q0fs"),t("nqD9");var u=t("+x/D"),i=t("Ioyv"),a=t("TmQU"),c=t("KloK");function r(e){var n=function(e){let{body:n,type:t="error"}=e;return Object(u.default)('<div class="aui-banner" role="banner"></div>').append(u.default.parseHTML(n||"")).addClass("aui-banner-".concat(t))}(e);return o().find(".aui-banner").get().forEach((function(e){e.hasAttribute("hidden")&&Object(u.default)(e).remove()})),function(e){var n=o();if(!n.length)throw new Error("You must implement the application header");e.prependTo(n),Object(i.recomputeStyle)(e),e[0].removeAttribute("hidden")}(n),n[0]}function o(){return Object(u.default)("#header")}Object(a.default)("aui/banner",r),Object(c.default)("banner",r);var d=r}},[["vjN3","runtime","aui.splitchunk.0d131bcbf1","aui.splitchunk.fbbef27525","aui.splitchunk.444efc83be","aui.splitchunk.739b9ec8cc","aui.splitchunk.056561461c","aui.splitchunk.949297951c","aui.splitchunk.56dfb54d0c","aui.splitchunk.f673ef53ac","aui.splitchunk.8659b532c1","aui.splitchunk.462ee5f9ef"]]]); 2293}catch(e){WRMCB(e)}; 2294; 2295try { 2296/* module-key = 'com.atlassian.confluence.plugins.synchrony-interop:synchrony-status-banner-loader', location = '/js/synchrony-down-banner-loader.js' */ 2297require(["ajs","wrm","aui/banner","wrm/context-path","confluence/api/event"],function(a,b,c,d,e){a.toInit(function(){!0===b.data.claim("com.atlassian.confluence.plugins.synchrony-interop:synchrony-status-banner-loader.synchrony-status")&&(c({body:"There\u0027s a problem with collaborative editing. People may be unable to save or publish."+'\x26nbsp;\x3ca href\x3d"'+d()+'/admin/confluence-collaborative-editor-plugin/configure.action"\x3e'+"Troubleshoot this problem"+"\x3c/a\x3e"}),e.trigger("confluence.header-resized"))})}); 2298}catch(e){WRMCB(e)}; 2299; 2300try { 2301/* module-key = 'com.atlassian.confluence.plugins.recently-viewed-plugin:app-resources', location = 'templates/recently.soy' */ 2302// This file was automatically generated from recently.soy. 2303// Please don't edit this file by hand. 2304 2305/** 2306 * @fileoverview Templates in namespace RY.Templates. 2307 */ 2308 2309if (typeof RY == 'undefined') { var RY = {}; } 2310if (typeof RY.Templates == 'undefined') { RY.Templates = {}; } 2311 2312 2313RY.Templates.body = function(opt_data, opt_ignored) { 2314 return '<div id="recently-viewed" class="aui-group"><div class="aui-item"><div class="top"><div class="filter"><form class="aui"><input class="filter-input text" type="text" placeholder="' + soy.$$escapeHtmlAttribute('Filter') + '"></form></div></div><div class="pages"></div></div></div>'; 2315}; 2316if (goog.DEBUG) { 2317 RY.Templates.body.soyTemplateName = 'RY.Templates.body'; 2318} 2319 2320 2321RY.Templates.pageCollection = function(opt_data, opt_ignored) { 2322 return '<div class="groups"></div><div class="empty"></div>'; 2323}; 2324if (goog.DEBUG) { 2325 RY.Templates.pageCollection.soyTemplateName = 'RY.Templates.pageCollection'; 2326} 2327 2328 2329RY.Templates.pageGroup = function(opt_data, opt_ignored) { 2330 return '<h3>' + soy.$$escapeHtml(opt_data.title) + '</h3><ul></ul>'; 2331}; 2332if (goog.DEBUG) { 2333 RY.Templates.pageGroup.soyTemplateName = 'RY.Templates.pageGroup'; 2334} 2335 2336 2337RY.Templates.pageItem = function(opt_data, opt_ignored) {
2338 return '<a href=' + soy.$$escapeHtmlAttributeNospace(soy.$$filterNormalizeUri(opt_data.href)) + '><div class="page-icon"><span class="aui-icon content-type-' + soy.$$escapeHtmlAttribute(opt_data.type) + '">' + soy.$$escapeHtml(opt_data.type) + '</span></div><div class="page-title"><span class="ellipsis" href=' + soy.$$escapeHtmlAttributeNospace(soy.$$filterNormalizeUri(opt_data.href)) + '>' + soy.$$escapeHtml(opt_data.title) + ' - ' + soy.$$escapeHtml(opt_data.space) + '</span></div></a>'; 2339}; 2340if (goog.DEBUG) { 2341 RY.Templates.pageItem.soyTemplateName = 'RY.Templates.pageItem'; 2342} 2343 2344}catch(e){WRMCB(e)}; 2345; 2346try { 2347/* module-key = 'com.atlassian.confluence.plugins.recently-viewed-plugin:app-resources', location = 'js/util.js' */ 2348var RY=RY||{}; 2349(function(){var b=new Date,h=(new Date(b)).getTime(),k=(new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime(),l=(new Date(b.getFullYear(),b.getMonth(),b.getDate()-1)).getTime();RY.util=RY.Util={analytics:{trackDialogOpen:function(){AJS.trigger("analytics",{name:"recently-viewed-dialog-open"})},trackPageOpen:function(){AJS.trigger("analytics",{name:"recently-viewed-page-open"})}},quote:function(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},diffInDays:function(a,c){return Math.floor((a-c)/ 2350864E5)},daysSince:function(a){return a>=k?0:a>=l?1:RY.util.diffInDays(h,a)},wait:function(a,c,m){var d,e,f,n=function(){e=setTimeout(function(){a.apply(m,f)},c)};return function(){f=arguments;var g=new Date;d&&g-d<c&&clearTimeout(e);n();d=g}}}})(); 2351}catch(e){WRMCB(e)}; 2352; 2353try { 2354/* module-key = 'com.atlassian.confluence.plugins.recently-viewed-plugin:app-resources', location = 'js/page-storage.js' */ 2355var RY=RY||{}; 2356RY.RecentPageStorage=function(f){var c={},g=function(){var b=function(a,d){return"lastSeen"===a&&_.isString(d)?(new Date(d)).getTime():d};try{c=JSON.parse(f.getItem("com.atlassian.confluence.plugins.recently.viewed.pages.v1"),b)||{}}catch(a){c={}}return c},h=function(){var b=_.values(c),a=b.length-100;if(0<a){var d=_.sortBy(b,function(e){return e.lastSeen});_.times(a,function(){var e=d.shift();delete c[e.id]})}};this.addCurrentPage=function(b){if(b.id&&b.title){g();var a=c[b.id];a||(c[b.id]=a={}); 2357a=_.extend(a,b);a.lastSeen=(new Date).getTime();a.count=a.count+1||1;h();try{f.setItem("com.atlassian.confluence.plugins.recently.viewed.pages.v1",JSON.stringify(c))}catch(d){}}};this.getPages=function(){return _.values(g())}}; 2358}catch(e){WRMCB(e)}; 2359; 2360try { 2361/* module-key = 'com.atlassian.confluence.plugins.recently-viewed-plugin:app-resources', location = 'js/filter.js' */ 2362var RY=RY||{}; 2363RY.FilterView=Backbone.View.extend({className:"filter",events:{"input .filter-input":"onInput","keyup .filter-input":"onInput","keydown .filter-input":"onKeydown"},initialize:function(){_.bindAll(this,"render","onInput","onKeydown","search");this.navigationEvents=this.options.navigationEvents;this.onInput=RY.util.wait(this.onInput,100,this)},render:function(){this.$input=this.$(".filter-input");return this},onInput:function(a){a&&_.contains([37,38,39,40],a.which)||this.search()},onKeydown:function(a){switch(a.which){case 13:this.navigationEvents.trigger("select");a.preventDefault(); 2364a.stopPropagation();break;case 38:this.navigationEvents.trigger("previous");a.preventDefault();break;case 40:this.navigationEvents.trigger("next"),a.preventDefault()}},search:function(){var a=this.$input.val();this.collection.search(a)}}); 2365}catch(e){WRMCB(e)}; 2366; 2367try { 2368/* module-key = 'com.atlassian.confluence.plugins.recently-viewed-plugin:app-resources', location = 'js/page-model.js' */ 2369var RY=RY||{}; 2370(function(){var d="undefined"!=typeof ConfluenceMobile?ConfluenceMobile.AppData.get("confluence-context-path"):AJS.contextPath();RY.Page=Backbone.Model.extend({href:function(){return d+this.get("url")},daysSinceLastSeen:function(){return RY.util.daysSince(this.get("lastSeen"))}});RY.PageCollection=Backbone.Collection.extend({model:RY.Page,url:d+"/rest/recentlyviewed/1.0/recent?includeTrashedContent\x3dtrue",search:function(a){if(0===this._queryLength(a))var c=this.models;else{var e=a.match(/[^\s-]+/g); 2371c=this.filter(function(b){var f=b.get("title");b=b.get("space");var g=(f+b).toLowerCase();return _.all(e,function(h){return-1!==g.indexOf(h.toLowerCase())})})}this.trigger("filter",c,a);return c},_queryLength:function(a){return String.prototype.trim?a.trim().length:AJS.$.trim(a).length},comparator:function(a){return-a.get("lastSeen")}})})(); 2372}catch(e){WRMCB(e)}; 2373; 2374try { 2375/* module-key = 'com.atlassian.confluence.plugins.recently-viewed-plugin:app-resources', location = '
2375js/page.js' */ 2376var RY=RY||{};RY.PageView=Backbone.View.extend({tagName:"li",className:"ry-page",template:RY.Templates.pageItem,initialize:function(){_.bindAll(this,"hide","show","render")},hide:function(){this.$el.hide().removeClass("shown")},show:function(){this.$el.show().addClass("shown")},render:function(){var a=this.model.toJSON();a.href=this.model.href();this.$el.html(this.template(a));return this}}); 2377RY.PageGroupView=Backbone.View.extend({className:"group",template:RY.Templates.pageGroup,initialize:function(){_.bindAll(this,"hide","hideAll","show","showBorder","showPages","add","render");this.title=this.options.title;this.modelViews={}},hide:function(){this.$el.hide()},hideAll:function(){this.$el.removeClass("border").hide();_.invoke(_.values(this.modelViews),"hide")},show:function(){this.$el.show()},showBorder:function(){this.$el.addClass("border")},showPages:function(a){var b=this,c=!1;_.each(a, 2378function(f){if(f=b.modelViews[f.cid])c=!0,f.show()});c&&this.show();return c},add:function(a){var b=new RY.PageView({model:a});this.modelViews[a.cid]=b;this.$list.append(b.render().el)},render:function(){this.$el.html(this.template({title:this.title}));this.$list=this.$("ul");return this}}); 2379RY.PageNavigator=function(a,b,c){function f(e){pageItems=a.find("li.shown");var g=pageItems.index(pageItems.filter(".highlight"));d&&d.removeClass("highlight");e+=g;0>e&&(e=pageItems.length-1);e>=pageItems.length&&(e=0);d=pageItems.eq(e);d.addClass("highlight")}function h(){if(d.length){var e=b.children(),g=b.height(),l=d.outerHeight(!0),k=d.position().top;0>k?0===a.find("li.shown").index(d)?b.scrollTop(0):b.scrollTop(d.offset().top-e.offset().top):k>g&&b.scrollTop(d.offset().top-e.offset().top-g+ 2380l)}}var d=null;c.on("select",function(){if(d&&d.is(":visible")){RY.util.analytics.trackPageOpen();var e=d.find(".page-title span").attr("href");window.location=e}},this);c.on("previous",function(){f(-1);h()},this);c.on("next",function(){f(1);h()},this)}; 2381RY.PageCollectionView=Backbone.View.extend({template:RY.Templates.pageCollection,events:{"click .page-title a":RY.util.analytics.trackPageOpen},initialize:function(){_.bindAll(this,"checkEmpty","filter","_groupForPage","addOne","showEmptyMessage","clearEmptyMessage","addAll","render");this.modelViews={};this.collection.on("reset",this.addAll,this);this.collection.on("add",this.addOne,this);this.collection.on("filter",this.filter,this)},checkEmpty:function(a,b){var c=this.collection.isEmpty();a=0=== 2382a.length;c||a?(c?b="Sorry mate, looks like you haven\u0027t visited any pages yet.":(b=AJS.contextPath()+"/dosearchsite.action?queryString\x3d"+encodeURIComponent(b),b="We didn\u0027t find any matching pages in your history."+" "+AJS.format("\u003ca href=\u0022{0}\u0022\u003eClick here\u003c/a\u003e to search for this term instead.",b)),this.showEmptyMessage(b)):this.clearEmptyMessage()},filter:function(a,b){this.checkEmpty(a,b||"");b=[this.$today,this.$yesterday,this.$older];_.invoke(b, 2383"hideAll");var c=[];_.each(b,function(f){f.showPages(a)&&c.push(f)});1<c.length&&(c.pop(),_.invoke(c,"showBorder"))},_groupForPage:function(a){a=a.daysSinceLastSeen();return 0===a?this.$today:1===a?this.$yesterday:this.$older},addOne:function(a){this._groupForPage(a).add(a)},showEmptyMessage:function(a){this.$(".empty").html(AJS.$("\x3cp\x3e").html(a))},clearEmptyMessage:function(){this.$(".empty").html("")},addAll:function(){this.collection.each(this.addOne)},render:function(){this.$el.html(this.template()); 2384this.$today=new RY.PageGroupView({title:"Today"});this.$yesterday=new RY.PageGroupView({title:"Yesterday"});this.$older=new RY.PageGroupView({title:"Older"});var a=this.$(".groups");a.append(this.$today.render().el);a.append(this.$yesterday.render().el);a.append(this.$older.render().el); 2385_.invoke([this.$today,this.$yesterday,this.$older],"hideAll");return this}}); 2386}catch(e){WRMCB(e)}; 2387; 2388try { 2389/* module-key = 'com.atlassian.confluence.plugins.recently-viewed-plugin:main-resources', location = 'js/main.js' */ 2390var RY=RY||{}; 2391AJS.toInit(function(b){b("#view-user-history-link").unbind("click");b("#view-user-history-link").click(function(a){a.preventDefault();a=new AJS.Dialog({width:600,height:500,id:"recently-viewed-dialog",closeOnOutsideClick:!0});var c=b(RY.Templates.body());a.addHeader("Recently viewed pages");
2391a.addPanel("SinglePanel",c);a.addLink("Close",function(d){d.hide()});var g=b("\x3cdiv\x3e",{"class":"dialog-tip"}).text("Hint: type \u0022g\u0022 and then \u0022r\u0022 anywhere to quickly open this menu"); 2392a.popup.element.find(".dialog-button-panel").append(g);var e=new RY.PageCollection,f=new RY.PageCollectionView({collection:e});c.find(".pages").html(f.render().el);a.gotoPanel(0);a.show();var h=b("#recently-viewed-dialog").spin("large");e.fetch({success:function(){h.spinStop();var d=_.extend({},Backbone.Events);new RY.PageNavigator(f.$el,c.parent(),d);(new RY.FilterView({collection:e,el:c.find(".filter"),navigationEvents:d})).render().search()}});RY.util.analytics.trackDialogOpen()})}); 2393}catch(e){WRMCB(e)}; 2394; 2395try { 2396/* module-key = 'com.atlassian.confluence.plugins.confluence-space-ia:spacemenu-resources', location = 'js/space-menu.js' */ 2397AJS.toInit(function(a){var c=a(Confluence.Templates.BrowseSpaces.spacesLink());a("#space-directory-link").replaceWith(a(c));var e=function(d){var b=a("#space-menu-link-content");b.html(d.template);AJS&&AJS.Confluence&&AJS.Confluence.Analytics&&AJS.Confluence.Analytics.setAnalyticsSource&&AJS.Confluence.Analytics.setAnalyticsSource(b.find("a"),"spacemenu");a("#create-space-header").click(function(){AJS.trigger("analytics",{name:"create-space-from-header"});Confluence.SpaceBlueprint.Dialog.launch(); 2398return!1})};a("#space-menu-link-content").on("aui-dropdown2-show",function(){AJS.trigger("analytics",{name:"open-space-menu"});a("#space-menu-link-content .aui-dropdown2-section")&&a("#space-menu-link-content .aui-dropdown2-section").length||a.ajax({url:Confluence.getContextPath()+"/rest/ia/1.0/spacesmenu",type:"GET",dataType:"json",cache:!1,success:e});return!1})}); 2399}catch(e){WRMCB(e)}; 2400; 2401try { 2402/* module-key = 'com.atlassian.confluence.plugins.confluence-space-ia:spacemenu-resources', location = 'soy/space-menu.soy' */ 2403// This file was automatically generated from space-menu.soy. 2404// Please don't edit this file by hand. 2405 2406/** 2407 * @fileoverview Templates in namespace Confluence.Templates.BrowseSpaces. 2408 */ 2409 2410if (typeof Confluence == 'undefined') { var Confluence = {}; } 2411if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; } 2412if (typeof Confluence.Templates.BrowseSpaces == 'undefined') { Confluence.Templates.BrowseSpaces = {}; } 2413 2414
2415Confluence.Templates.BrowseSpaces.spacesLink = function(opt_data, opt_ignored) { 2416 return '' + aui.dropdown2.trigger({menu: {id: 'space-menu-link-content'}, id: 'space-menu-link', tagName: 'a', extraClasses: 'aui-nav-link', title: 'Spaces', showIcon: false, text: 'Spaces'}) + aui.dropdown2.contents({id: 'space-menu-link-content', extraClasses: 'aui-style-default aui-dropdown2-in-header'}); 2417}; 2418if (goog.DEBUG) { 2419 Confluence.Templates.BrowseSpaces.spacesLink.soyTemplateName = 'Confluence.Templates.BrowseSpaces.spacesLink'; 2420} 2421 2422}catch(e){WRMCB(e)}; 2423; 2424try { 2425/* module-key = 'com.atlassian.confluence.plugins.confluence-space-ia:space-ia-analytics', location = 'js/space-ia-analytics.js' */ 2426(function(f){function d(){var b=f(".acs-side-bar"),a=b.find("a:not(.external_link a, #acs-configure-link)");c(a,"sidebar");a=b.find("[data-collapsed-tooltip\x3d'"+AJS.I18n.getText("Pages")+"']");c(a,"sidebar-pages");a=b.find("[data-collapsed-tooltip\x3d'"+AJS.I18n.getText("Blog")+"']");c(a,"sidebar-blogs");a=b.find(".quick-links-section li:not(.external_link) a");c(a,"spaceshortcut");a=b.find(".ia-secondary-container a:not(.more-children-link)");"pages"==b.find(".ia-secondary-container").data("tree-type")? 2427c(a,"contextnavchildmode"):"page-tree"==b.find(".ia-secondary-container").data("tree-type")?c(a,"contextnavpagetreemode"):c(a,"contextnav")}function e(b){return function(){AJS.trigger("analytics",{name:"space-ia-nav",data:{linkType:b}})}}var c=AJS.Confluence.Analytics.setAnalyticsSource;AJS.toInit(function(b){b(".acs-side-bar").find(".ia-secondary-container .more-children-link").click(e("context-nav.more-children"));AJS.bind("sidebar.exit-configure-mode",d);AJS.bind("sidebar.flyout-triggered",function(a, 2428g){e("flyout-triggered."+g.flyout)()});AJS.bind("pagetree-children-loaded",d);d()})})(AJS.$); 2429}catch(e){WRMCB(e)}; 2430; 2431try { 2432/* module-key = 'com.atlassian.confluence.plugins.confluence-feature-discovery-plugin:confluence-feature-discovery-plugin-resources', location = '/js/confluence-feature-discovery-plugin.js' */ 2433(function(q){function k(b){void 0===g&&(g=JSON.parse(AJS.Meta.get("discovered-plugin-features")||"{}"));return b?g[b]||[]:g}function m(b,e){b=k(b);for(var d=0,f=b.length;d<f;d++)if(b[d]===e)return!0;return!1}Confluence.FeatureDiscovery={};var g,n=!1,r=WRM.data.claim("com.atlassian.confluence.plugins.confluence-feature-discovery-plugin:confluence-feature-discovery-plugin-resources.test-mode");Confluence.FeatureDiscovery.forPlugin=function(b,e){function d(a){a=parseInt(f.getItem(a),10);return isNaN(a)? 24340:a}var f=Confluence.storageManager("feature-discovery."+b);e=e||3;return{addDiscoveryView:function(a){var c=d(a)+1;f.setItem(a,c)},shouldShow:function(a,c){if(c=!0===c&&r){a:{c="com.atlassian.webdriver.discovery\x3d"+b+":"+a;for(var p=document.cookie.split(";"),l=0;l<p.length;l++){for(var h=p[l];" "===h.charAt(0);)h=h.substring(1);if(-1!==h.indexOf(c)){c=!0;break a}}c=!1}c=!c}return c||n||m(b,a)?!1:d(a)>=e?(this.markDiscovered(a),!1):n=!0},markDiscovered:function(a,c){m(b,a)||AJS.safeAjax({url:AJS.contextPath()+ 2435"/rest/feature-discovery/1.0/discovered/"+b+"/"+a,type:"POST",data:{},success:function(){k(b).unshift(a);f.removeItem(a);AJS.trigger("feature-discovered",{pluginKey:b,featureKey:a});c&&q.isFunction(c)&&c()}})},listDiscovered:function(){return k(b).slice(0)}}}})(AJS.$); 2436}catch(e){WRMCB(e)}; 2437; 2438try { 2439/* module-key = 'com.atlassian.confluence.plugins.confluence-quicknav:quicknav-resources', location = 'js/quick-nav.js' */ 2440define("confluence-quicknav/quick-nav",["jquery","confluence/api/logger"],function(d,n){var g=[],f,h=function(a){return function(b){a.closest("form").find(".quick-nav-drop-down").append(b)}},k=function(a){"undefined"!==typeof a?g.push(a):n.log("WARN: Attempted to add a dropdown post-process function that was undefined.")},p=function(a){d("a",a).each(function(){var b=d(this),c=b.find("span").data("properties");(c=c?c.spaceName:null)&&!b.is(".content-type-spacedesc")&&(b.after(b.clone().attr("class", 2441"space-name").html(c)),b.parent().addClass("with-space-name"))})};
2441return{addDropDownPostProcess:k,setMakeParams:function(a){f=a},init:function(){var a=d("#quick-search-query"),b=h(a),c=d("#space-blog-quick-search-query"),l=d("#confluence-space-key");a.quicksearch("/rest/quicknav/1/search",null,{dropdownPlacement:b,dropdownPostprocess:function(e){d.each(g,function(q,m){m&&m(e)})},makeParams:function(e){return f?f(e):{query:e}},ajsDropDownOptions:{className:"quick-search-dropdown"}});k(p);c.length&& 2442l.length&&c.quicksearch("/rest/quicknav/1/search?type\x3dblogpost\x26spaceKey\x3d"+d("\x3ci\x3e\x3c/i\x3e").html(l.attr("content")).text(),null,{dropdownPlacement:h(c)})}}});require("confluence/module-exporter").exportModuleAsGlobal("confluence-quicknav/quick-nav","Confluence.QuickNav"); 2443}catch(e){WRMCB(e)}; 2444; 2445try { 2446/* module-key = 'com.atlassian.confluence.plugins.confluence-license-banner:confluence-license-banner-resources', location = '/js/confluence-license-banner.js' */ 2447require(["ajs","jquery"],function(c,b){c.toInit(function(){var g=WRM.data.claim("com.atlassian.confluence.plugins.confluence-license-banner:confluence-license-banner-resources.license-details");if(g){var d={destroyBanner:function(){b("#license-banner").slideUp(function(){b("#license-banner").remove()})},remindMeLater:function(){b.ajax({type:"POST",dataType:"json",contentType:"application/json; charset\x3dutf-8",data:JSON.stringify({atl_token:c.Meta.get("atl-token")}),url:c.contextPath()+"/rest/licensebanner/1.0/reminder/later"}); 2448d.destroyBanner()},remindMeNever:function(){b.ajax({type:"POST",dataType:"json",contentType:"application/json; charset\x3dutf-8",data:JSON.stringify({atl_token:c.Meta.get("atl-token")}),url:c.contextPath()+"/rest/licensebanner/1.0/reminder/never"});d.destroyBanner()},createBanner:function(a){var f;a.showLicenseExpiryBanner?f=Confluence.Templates.LicenseBanner.expiryBanner({days:a.daysBeforeLicenseExpiry,mac:a.renewUrl,sales:a.salesUrl}):a.showMaintenanceExpiryBanner&&(f=Confluence.Templates.LicenseBanner.maintenanceBanner({days:a.daysBeforeMaintenanceExpiry, 2449mac:a.renewUrl,sales:a.salesUrl}));f&&(a=b(f),b("#full-height-container").prepend(a),b("#license-banner-later").click(function(e){e.preventDefault();d.remindMeLater()}),b("#license-banner-never").click(function(e){e.preventDefault();d.remindMeNever()}),a.find(".aui-message .aui-close-button").click(function(e){e.preventDefault();d.remindMeLater()}))}};d.createBanner(g)}else c.warn("Unable to claim my required data")})}); 2450}catch(e){WRMCB(e)}; 2451; 2452try { 2453/* module-key = 'com.atlassian.confluence.plugins.confluence-license-banner:confluence-license-banner-resources', location = 'soy/confluence-license-banner.soy' */ 2454// This file was automatically generated from confluence-license-banner.soy. 2455// Please don't edit this file by hand. 2456 2457/** 2458 * @fileoverview Templates in namespace Confluence.Templates.LicenseBanner. 2459 */ 2460 2461if (typeof Confluence == 'undefined') { var Confluence = {}; } 2462if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; } 2463if (typeof Confluence.Templates.LicenseBanner == 'undefined') { Confluence.Templates.LicenseBanner = {}; } 2464 2465 2466Confluence.Templates.LicenseBanner.wrapper = function(opt_data, opt_ignored) { 2467 return '<div>' + soy.$$filterNoAutoescape(opt_data.contentHTML) + '</div>'; 2468}; 2469if (goog.DEBUG) { 2470 Confluence.Templates.LicenseBanner.wrapper.soyTemplateName = 'Confluence.Templates.LicenseBanner.wrapper'; 2471} 2472 2473 2474Confluence.Templates.LicenseBanner.expiryBanner = function(opt_data, opt_ignored) { 2475 var output = ''; 2476 var renewTag__soy8 = '<a id="license-banner-my-link" target="_blank" href="' + soy.$$escapeHtml(opt_data.mac) + '">'; 2477 var end__soy12 = '</a>'; 2478 var mailTag__soy14 = '<a id="license-banner-sales-link" target="_blank" href="' + soy.$$escapeHtml(opt_data.sales) + '">'; 2479 output += Confluence.Templates.LicenseBanner.wrapper({contentHTML: '<div id="license-banner" class="aui-message aui-message-warning closeable"><div id="license-banner-content" data-days="' + soy.$$escapeHtml(opt_data.days) + '" data-subscription="true">' + ((opt_data.days < 0) ? soy.$$filterNoAutoescape(AJS.format('Your subscription has expired. This site is now read-only. To keep using Confluence, {0}renew online{1} or {2}contact us{3}.',renewTag__soy8,end__soy12,mailTag__soy14,end__soy12)) : (opt_data.days == 0) ? soy.$$filterNoAutoescape(AJS.format('Your subscription will expire today and your site will become read-only. To keep using Confluence, {0}renew online{1} or {2}contact us{3}.',renewTag__soy8,end__soy12,mailTag__soy14,end__soy12)) : soy.$$filterNoAutoescape(AJS.format('Your subscription will expire in {0,choice,1#{0} day|1\x3c{0} days}. Your site will become read-only after the expiry. To keep using Confluence, {1}renew online{2} or {3}contact us{4}.',opt_data.days,renewTag__soy8,end__soy12,mailTag__soy14,end__soy12))) + '</div>' + ((opt_data.days > 7) ? '<button type="button" class="aui-close-button" aria-label="Close"></button>' : '') + '</div>'}); 2480 return output; 2481}; 2482if (goog.DEBUG) { 2483 Confluence.Templates.LicenseBanner.expiryBanner.soyTemplateName = 'Confluence.Templates.LicenseBanner.expiryBanner'; 2484} 2485 2486 2487Confluence.Templates.LicenseBanner.maintenanceBanner = function(opt_data, opt_ignored) { 2488 var output = ''; 2489 var renewTag__soy39 = '<a id="license-banner-my-link" target="_blank" href="' + soy.$$escapeHtml(opt_data.mac) + '">'; 2490 var end__soy43 = '</a>'; 2491 var later__soy45 = '<a href="#" id="license-banner-later">'; 2492 var never__soy47 = '<a href="#" id="license-banner-never">'; 2493 output += Confluence.Templates.LicenseBanner.wrapper({contentHTML: '' + aui.message.warning({content: '<div id="license-banner-content" data-days="' + soy.$$escapeHtml(opt_data.days) + '" data-subscription="false">' + ((opt_data.days < 0) ? soy.$$filterNoAutoescape(AJS.format('You no longer have access Support and Upd
2493ates. {0}Renew online{1}, {2}remind me later{3} or {4}never remind me again{5}.',renewTag__soy39,end__soy43,later__soy45,end__soy43,never__soy47,end__soy43)) : (opt_data.days == 0) ? soy.$$filterNoAutoescape(AJS.format('You will lose access to Support and Updates today. {0}Renew online{1}, {2}remind me later{3} or {4}never remind me again{5}.',renewTag__soy39,end__soy43,later__soy45,end__soy43,never__soy47,end__soy43)) : soy.$$filterNoAutoescape(AJS.format('You will lose access to Support and Updates in {0,choice,1#{0} day|1\x3c{0} days}. {1}Renew online{2}, {3}remind me later{4} or {5}never remind me again{6}.',opt_data.days,renewTag__soy39,end__soy43,later__soy45,end__soy43,never__soy47,end__soy43))) + '</div>', id: 'license-banner'})}); 2494 return output; 2495}; 2496if (goog.DEBUG) { 2497 Confluence.Templates.LicenseBanner.maintenanceBanner.soyTemplateName = 'Confluence.Templates.LicenseBanner.maintenanceBanner'; 2498} 2499 2500}catch(e){WRMCB(e)}; 2501; 2502try { 2503/* module-key = 'com.atlassian.confluence.plugins.confluence-browser-metrics:legacy-browser-metrics', location = '/js/legacy/browser-metrics.js' */ 2504(function(){var a=window.BrowserMetrics||{};a.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};a.isEnabled=function(){void 0===a.enabled&&(a.enabled=!0);return a.enabled};window.BrowserMetrics=a})(); 2505(function(){(window.BrowserMetrics||{}).isEnabled()&&(window.ATL_PERF||(window.ATL_PERF={}),window.ATL_PERF.initPageLoad=function(a){function k(){var a=l();a&&m(function(c,b){c="browser.metrics."+c;b={version:5,page:a,value:12E3<b?"x":Math.ceil(b/100),rawValue:Math.round(b)};AJS.Analytics?AJS.Analytics.triggerPrivacyPolicySafeEvent(c,b):AJS.trigger("analyticsEvent",{name:c,data:b})})}function d(){if(a.performance.timing.loadEventEnd)try{k()}catch(e){window.console&&window.console.log("Error reporting browser metrics: "+ 2506e)}else setTimeout(d,1E3)}var n=function(){var a=/^(\w+):\/\/([^\/]*)(.*)$/;return function(c){var b=c.match(a);return b?{scheme:b[1],host:b[2],path:b[3]}:{path:c}}}(),m=function(){var e="secureConnectionStart requestStart responseStart responseEnd domContentLoadedEventStart domContentLoadedEventEnd loadEventEnd".split(" ");return function(c){if(a.performance){var b=a.performance.timing,g=b.navigationStart;if(g)for(var f=0;f<e.length;++f){var d=e[f],h=b[d];h&&c(d,h-g)}}}}(),l=function(){var e=[{key:"LOGIN", 2507pattern:/^\/login.*/i},{key:"J-DASH",pattern:/^\/secure\/dashboard\.jspa.*/i},{key:"J-ISSUE",pattern:/^\/browse\/\w+\-\w+.*/i},{key:"J-NAV",pattern:/^\/issues.*/i},{key:"J-RAPID",pattern:/secure\/rapidboard\.jspa/i},{key:"SD-AGENT",pattern:/^(\/\w+)?\/servicedesk\/agent\/.*/i},{key:"SD-CUSTOMER",pattern:/^(\/\w+)?\/servicedesk\/customer\/.*/i},{key:"C-DASH",pattern:/^\/wiki(\/)?(\?.*|#.*)?$/i},{key:"C-DASH",pattern:/^\/wiki\/dashboard\.action.*$/i},{key:"C-SPACE",pattern:/^\/wiki\/display\/\w+(\?.*|#.*)?$/i}, 2508{key:"C-PAGE",pattern:/^\/wiki\/display\/\w+\/.*/i},{key:"C-PAGE",pattern:/^\/wiki\/pages\/viewpage\.action.*/i},{key:"C-BLOG",pattern:/^\/wiki\/display\/~\w+\/\d+\/\d+\/\d+\/.*/i},{key:"C-EDITOR",pattern:/^\/wiki\/pages\/editpage\.action.*/i},{key:"C-CREATE",pattern:/^\/wiki\/pages\/createpage\.action.*/i}];return function(){for(var c=n(a.location.href).path,b=0;b<e.length;++b){var d=e[b];if(c.match(d.pattern))return d.key}return null}}();a.performance&&a.performance.timing&&d()})})(); 2509}catch(e){WRMCB(e)}; 2510; 2511try { 2512/* module-key = 'com.atlassian.confluence.plugins.confluence-browser-metrics:legacy-browser-metrics', location = '/js/legacy/browser-metrics-events.js' */ 2513(function(){(window.BrowserMetrics||{}).isEnabled()&&(window.ATL_PERF||(window.ATL_PERF={}),window.ATL_PERF.initEvents=function(b){function g(){return b.performance&&b.performance.now?b.performance.now():(new Date).getTime()}var f={};return{start:function(a){f[a===Object(a)?a.eventName+"."+a.eventType:a]=g()},end:function(a,e){var c=a===Object(a)?a.eventName+"."+a.eventType:a;if(!f[c])throw"Error logging browser metrics event end: no start event for key '"+c+"'";var d=g()-f[c];f[c]=null;c=a===Object(a)? 2514a.eventName:a;a=a===Object(a)?a.eventType:"";e="browser.metrics.e."+c+(e?"."+e:"");d={version:5,value:12E3<d?"x":Math.ceil(d/100),rawValue:Math.round(100*d)/100,eventType:a};b.AJS.Analytics?b.AJS.Analytics.triggerPrivacyPolicySafeEvent(e,d):b.AJS.trigger("analyticsEvent",{name:e,data:d})}}})})(); 2515}catch(e){WRMCB(e)}; 2516; 2517try { 2518/* module-key = 'com.atlassian.confluence.plugins.confluence-browser-metrics:legacy-browser-metrics', location = '/js/legacy/browser-metrics-init.js' */ 2519(function(){(window.BrowserMetrics||{}).isEnabled()&&(.1>Math.random()&&window.ATL_PERF&&window.ATL_PERF.initPageLoad&&window.ATL_PERF.initPageLoad(window),window.ATL_PERF&&window.ATL_PERF.initEvents&&(window.BrowserMetrics=window.ATL_PERF.initEvents(window)))})(); 2520}catch(e){WRMCB(e)}; 2521; 2522try { 2523/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher.soy' */ 2524// This file was automatically generated from appswitcher.soy. 2525// Please don't edit this file by hand. 2526 2527/** 2528 * @fileoverview Templates in namespace navlinks.templates.appswitcher. 2529 */ 2530 2531if (typeof navlinks == 'undefined') { var navlinks = {}; } 2532if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; } 2533if (typeof navlinks.templates.appswitcher == 'undefined') { navlinks.templates.appswitcher = {}; } 2534 2535 2536navlinks.templates.appswitcher.switcher = function(opt_data, opt_ignored) { 2537 return '' + ((true) ? navlinks.templates.appswitcher_old.switcher(opt_data) : ''); 2538}; 2539if (goog.DEBUG) { 2540 navlinks.templates.appswitcher.switcher.soyTemplateName = 'navlinks.templates.appswitcher.switcher'; 2541} 2542 2543}catch(e){WRMCB(e)}; 2544; 2545try { 2546/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher_old.js' */ 2547var APPSWITCHER_TRIGGER_CLICK="appswitcher.trigger.click",APPSWITCHER_DROPDOWN_SHOW="appswitcher.dropdown.show",APPSWITCHER_DROPDOWN_DISPLAY_ERROR="appswitcher.dropdown.display.error",APPSWITCHER_APP_LINK_CLICK="appswitcher.app.link.click",APPSWITCHER_CONFIGURE_LINK_CLICK="appswitcher.configure.link.click"; 2548(function(a,g){g.AppSwitcher=function(e){var h=AJS.contextPath()+"/plugins/servlet/customize-application-navigator",c=this;this.$dropdown=null;e=a.extend({dropdownContents:null},e);this.getLinks=function(){return a.ajax({url:AJS.contextPath()+"/rest/menu/latest/appswitcher",cac
2548he:!1,dataType:"json"}).done(this.updateDropdown).fail(this.showError)};this.getDropdown=function(){this.$dropdown||(this.$dropdown=a(e.dropdownContents),this.isUserAdmin=this.$dropdown.data("is-user-admin"));return this.$dropdown}; 2549this.updateDropdown=function(b){a(function(){c.getDropdown().html(navlinks.templates.appswitcher_old.applications({apps:b,showAdminLink:c.isUserAdmin,adminLink:h}));c.bindAnalyticsHandlers()})};this.bindAnalyticsHandlers=function(){a(".app-switcher-trigger").on("click",function(){AJS.trigger("analyticsEvent",{name:APPSWITCHER_TRIGGER_CLICK})});a("#app-switcher").on("aui-dropdown2-show",function(){AJS.trigger("analyticsEvent",{name:APPSWITCHER_DROPDOWN_SHOW})});a("#app-switcher .nav-link").on("click", 2550function(){var b="custom",d=a(this).find("a").attr("href"),f=window.location.hostname;d&&-1<d.indexOf("bitbucket.org")?b="bitbucket-cloud":-1<d.indexOf(f+"/wiki")?b="confluence":-1<d.indexOf(f+"/build")?b="bamboo":-1<d.indexOf(f)&&(b="jira");AJS.trigger("analyticsEvent",{name:APPSWITCHER_APP_LINK_CLICK,data:{product:b}})});a(".nav-link-edit-wrapper").on("click",function(){AJS.trigger("analyticsEvent",{name:APPSWITCHER_CONFIGURE_LINK_CLICK})})};this.showError=function(){a(function(){AJS.trigger("analyticsEvent", 2551{name:APPSWITCHER_DROPDOWN_DISPLAY_ERROR});c.getDropdown().html(navlinks.templates.appswitcher_old.error()).off(".appswitcher").on("click.appswitcher",".app-switcher-retry",a.proxy(c.retryLoading,c))})};this.retryLoading=function(b){this.getDropdown().html(navlinks.templates.appswitcher_old.loading());this.getLinks();b&&b.stopPropagation()};this.getLinks()};a(function(){!0===a("#app-switcher").data("is-switcher")&&new g.AppSwitcher({dropdownContents:"#app-switcher"})})})(jQuery,window.NL=window.NL|| 2552{}); 2553}catch(e){WRMCB(e)}; 2554; 2555try { 2556/* module-key = 'com.atlassian.plugins.atlassian-nav-links-plugin:rotp-menu', location = 'appswitcher/appswitcher_old.soy' */ 2557// This file was automatically generated from appswitcher_old.soy. 2558// Please don't edit this file by hand. 2559 2560/** 2561 * @fileoverview Templates in namespace navlinks.templates.appswitcher_old. 2562 */ 2563 2564if (typeof navlinks == 'undefined') { var navlinks = {}; } 2565if (typeof navlinks.templates == 'undefined') { navlinks.templates = {}; } 2566if (typeof navlinks.templates.appswitcher_old == 'undefined') { navlinks.templates.appswitcher_old = {}; } 2567 2568 2569navlinks.templates.appswitcher_old.applications = function(opt_data, opt_ignored) { 2570 return '' + navlinks.templates.appswitcher_old.applicationsSection({list: opt_data.apps, listClass: 'nav-links', showDescription: opt_data.showDescription}) + ((opt_data.custom) ? navlinks.templates.appswitcher_old.applicationsSection({list: opt_data.custom, showDescription: opt_data.showDescription}) : '') + ((opt_data.showAdminLink) ? navlinks.templates.appswitcher_old.adminSection(opt_data) : ''); 2571}; 2572if (goog.DEBUG) { 2573 navlinks.templates.appswitcher_old.applications.soyTemplateName = 'navlinks.templates.appswitcher_old.applications'; 2574} 2575 2576 2577navlinks.templates.appswitcher_old.applicationsSection = function(opt_data, opt_ignored) { 2578 var output = ''; 2579 if (opt_data.list.length > 0) { 2580 var param19 = '<ul' + ((opt_data.listClass) ? ' class="' + soy.$$escapeHtml(opt_data.listClass) + '"' : '') + '>'; 2581 var linkList27 = opt_data.list; 2582 var linkListLen27 = linkList27.length; 2583 for (var linkIndex27 = 0; linkIndex27 < linkListLen27; linkIndex27++) { 2584 var linkData27 = linkList27[linkIndex27]; 2585 param19 += navlinks.templates.appswitcher_old.applicationsItem(soy.$$augmentMap(linkData27, {showDescription: opt_data.showDescription})); 2586 } 2587 param19 += '</ul>'; 2588 output += aui.dropdown2.section({content: param19}); 2589 } 2590 return output; 2591}; 2592if (goog.DEBUG) { 2593 navlinks.templates.appswitcher_old.applicationsSection.soyTemplateName = 'navlinks.templates.appswitcher_old.applicationsSection'; 2594} 2595 2596 2597navlinks.templates.appswitcher_old.applicationsItem = function(opt_data, opt_ignored) { 2598 return '<li class="nav-link' + ((opt_data.self) ? ' nav-link-local' : '') + '"><a href="' + soy.$$escapeHtml(opt_data.link) + '" class="aui-dropdown2-radio ' + ((opt_data.self) ? 'aui-dropdown2-checked' : '') + '" title="' + soy.$$escapeHtml(opt_data.link) + '"><span class="nav-link-label">' + soy.$$escapeHtml(opt_data.label) + '</span>' + ((opt_data.showDescription && opt_data.description) ? '<span class="nav-link-description">' + soy.$$escapeHtml(opt_data.description) + '</span>' : '') + '</a></li>'; 2599}; 2600if (goog.DEBUG) { 2601 navlinks.templates.appswitcher_old.applicationsItem.soyTemplateName = 'navlinks.templates.appswitcher_old.applicationsItem'; 2602} 2603 2604 2605navlinks.templates.appswitcher_old.adminSection = function(opt_data, opt_ignored) { 2606 return '' + aui.dropdown2.section({content: '<ul class="nav-links"><li><a class="nav-link-edit-wrapper" href="' + soy.$$escapeHtml(opt_data.adminLink) + '"><span class="nav-link-edit">' + soy.$$filterNoAutoescape('Configure...') + '</span></a></li></ul>'}); 2607}; 2608if (goog.DEBUG) { 2609 navlinks.templates.appswitcher_old.adminSection.soyTemplateName = 'navlinks.templates.appswitcher_old.adminSection'; 2610} 2611 2612 2613navlinks.templates.appswitcher_old.error = function(opt_data, opt_ignored) { 2614 return '<div class="app-switcher-error">' + soy.$$filterNoAutoescape('Something went wrong, please \x3cspan class\x3d\x22app-switcher-retry\x22\x3etry again\x3c/span\x3e.') + '</div>'; 2615}; 2616if (goog.DEBUG) { 2617 navlinks.templates.appswitcher_old.error.soyTemplateName = 'navlinks.templates.appswitcher_old.error'; 2618} 2619 2620 2621navlinks.templates.appswitcher_old.loading = function(opt_data, opt_ignored) { 2622 return '<div class="app-switcher-loading">' + soy.$$filterNoAutoescape('Loading...') + '</div>'; 2623}; 2624if (goog.DEBUG) { 2625 navlinks.templates.appswitcher_old.loading.soyTemplateName = 'navlinks.templates.appswitcher_old.loading'; 2626} 2627 2628 2629navlinks.templates.appswitcher_old.trigger = function(opt_data, opt_ignored) { 2630 return '<span class="aui-icon aui-icon-small aui-iconfont-appswitcher">' + soy.$$escapeHtml('Linked Applications') + '</span>'; 2631}; 2632if (goog.DEBUG) { 2633 navlinks.templates.appswitcher_old.trigger.soyTemplateName = 'navlinks.templates.appswitcher_old.trigger'; 2634} 2635 2636 2637navlinks.templates.appswitcher_old.switcher = function(opt_data, opt_ignored) { 2638 var output = ''; 2639 var loadingContent__soy79 = '' + navlinks.templates.appswitcher_old.loading(null); 2640 var triggerContent__soy81 = '' + navlinks.templates.appswitcher_old.trigger(null); 2641 output += aui.dropdown2.dropdown2({menu: {id: 'app-switcher', content: loadingContent__soy79, extraClasse
2641s: 'aui-style-default', extraAttributes: {'data-is-user-admin': false, 'data-is-switcher': 'true'}}, trigger: {tagName: 'button', showIcon: false, content: triggerContent__soy81, extraClasses: 'app-switcher-trigger aui-dropdown2-trigger-arrowless', extraAttributes: {href: '#app-switcher'}}}); 2642 return output; 2643}; 2644if (goog.DEBUG) { 2645 navlinks.templates.appswitcher_old.switcher.soyTemplateName = 'navlinks.templates.appswitcher_old.switcher'; 2646} 2647 2648}catch(e){WRMCB(e)}; 2649; 2650try { 2651/* module-key = 'confluence.web.resources:common-header-resources', location = '/includes/js/header-user-menu.js' */ 2652define("confluence/header-user-menu",["jquery","confluence/meta","underscore"],function(a,c,b){function d(){var b=c.get("current-user-avatar-uri-reference");a("#user-menu-link").find(".aui-avatar-inner img").attr("src",b)}return function(){b.defer(d)}});require("confluence/module-exporter").safeRequire("confluence/header-user-menu",function(a){require("ajs").toInit(a)}); 2653}catch(e){WRMCB(e)}; 2654; 2655try { 2656/* module-key = 'confluence.web.resources:general-analytics-bindings', location = '/includes/js/analytics-bindings.js' */ 2657define("confluence/analytics-bindings",["jquery","confluence/analytics-support"],function(b,d){return function(){function e(a,c){b(a).on("click",".view-historical-version-trigger",function(){d.publish("confluence.page.view-historical.from-"+(c||"unknown"))})}function f(a,c){b(a).on("click",".restore-historical-version-trigger",function(){d.publish("confluence.page.restore-historical.from-"+(c||"unknown"))})}function g(a,c){b("#header .aui-header-secondary "+a).on("click",function(){var a=b(this).hasClass("aui-dropdown2-active")? 2658"expanded":"collapsed";d.publish("confluence.header.dropdown."+c,{state:a})})}e("#page-history-warning","navigation");e("#page-history-container","history");e(".diff-menu","diff");f("#page-history-warning","navigation");f("#page-history-container","history");g("#admin-menu-link","administration");g("#user-menu-link","profile")}});require("confluence/module-exporter").safeRequire("confluence/analytics-bindings",function(b){require("ajs").toInit(b)}); 2659}catch(e){WRMCB(e)}; 2660; 2661try { 2662/* module-key = 'com.atlassian.confluence.plugins.quickreload:quick-reload-core', location = 'utils/quick-reload-timer.js' */ 2663define("confluence-quick-reload/utils/quick-reload-timer",["jquery","underscore"],function(d,f){function b(a,c){this.options=d.extend({min:3E4,max:36E5,inactivity:12E4},c);f.bindAll(this,"start","stop","_now","_timeSinceLastSeen","_setActive","_setActivityTrigger","_clamp","_intervalMultiplier");this.callback=a;this._timer=null;this._setActivityTrigger(this._setActive)}b.prototype.start=function(a){this.lastSeenTimestamp=this._now();this.stop();a&&this.callback();var c=function(){this.callback(); 2664e.call(this)},e=function(){this.stop();this._timer=setTimeout(f.bind(c,this),this.options.min*this._intervalMultiplier())};e.call(this)};b.prototype.stop=function(){null!==this._timer&&(clearTimeout(this._timer),this._timer=null)};b.prototype._setActive=function(){if(null!==this._timer){var a=this._timeSinceLastSeen()>this.options.inactivity;this.lastSeenTimestamp=this._now();a&&this.start(!0)}};b.prototype._setActivityTrigger=function(a){document.addEventListener("visibilitychange",function(){document.hidden|| 2665a()},!1);d(window).focus(a);d("body").click(a);d(window).scroll(a)};b.prototype._now=function(){return(new Date).getTime()};b.prototype._timeSinceLastSeen=function(){return this._now()+1-this.lastSeenTimestamp};b.prototype._clamp=function(a,c,e){c=Math.max(Math.min(c,e),a);return isNaN(c)?a:c};b.prototype._intervalMultiplier=function(){var a=(document.hidden?3:1)*Math.ceil(this._timeSinceLastSeen()/this.options.inactivity);return this._clamp(1,this.options.max/this.options.min,a)};return b}); 2666}catch(e){WRMCB(e)}; 2667; 2668try { 2669/* module-key = 'com.atlassian.confluence.plugins.quickreload:quick-reload-core', location = 'main/quick-reload-manager.js' */ 2670define("confluence-quick-reload/main/quick-reload-manager","underscore jquery ajs confluence/api/constants confluence-quick-reload/utils/quick-reload-timer confluence/meta confluence/api/logger".split(" "),function(h,g,p,l,m,k,n){function b(){this.enabled=!1;this.handlers=[];this.lastFetchTime=g('meta[name\x3d"confluence-request-time"]').attr("content")||(new Date).getTime();this.timer=null;h.bindAll(this,"addHandler","removeHandler","update","enable","disable","onUpdateSuccess","onUpdateError")} 2671b.prototype.addHandler=function(a){var c=!1,e;for(e=0;e<this.handlers.length;e++)this.handlers[e]===a&&(c=!0);!0!==c&&this.handlers.push(a)};b.prototype.removeHandler=function(a){var c;if(a)for(c=0;c<this.handlers.length;c++)if(this.handlers[c]===a){this.handlers.splice(c,1);break}};b.prototype.update=function(){var a=void 0!==k.get("page-id")?k.get("page-id"):"0";g("body").hasClass("contenteditor")?this.disable():g.ajax({type:"GET",url:l.CONTEXT_PATH+"/rest/quickreload/latest/"+a+"?since\x3d"+encodeURIComponent(this.lastFetchTime), 2672dataType:"json"}).done(this.onUpdateSuccess).fail(this.onUpdateError)};b.prototype.enable=function(){this.enabled||(null===this.timer&&(this.timer=new m(this.update)),this.timer.start(),this.enabled=!0)};b.prototype.disable=function(){null!==this.timer&&this.timer.stop();this.enabled=!1};b.prototype.isEnabled=function(){return this.enabled};b.prototype.onUpdateSuccess=function(a,c,e){204!==e.status&&(this.lastFetchTime=a.time,h.map(this.handlers,function(f){var d=a[f.property];
vendor: 7,191 bytes, lines 2672-2699
2672Array.isArray(d)||(d= 2673[d]);d=f.filterNewResults(f.results,d);0<d.length&&(f.results=f.results.concat(d),f.render(d))},this))};b.prototype.onUpdateError=function(a){if(a={404:"not found - the plugin has been probably been removed or disabled from Confluence",500:"generic server error",503:"service unavailable",504:"gateway timeout"}[(a||{}).status])this.disable(),n.error('Quick comment reload plugin has been disabled in this page due to a server error: "'+a+'". Please refresh the page to get it back.')};return new b}); 2674}catch(e){WRMCB(e)}; 2675; 2676try { 2677/* module-key = 'com.atlassian.confluence.plugins.quickreload:quick-reload-read-only-mode-handler', location = 'handlers/quick-reload-read-only-mode.js' */ 2678define("confluence-quick-reload/handlers/quick-reload-read-only-mode",["ajs","jquery","confluence/message-controller","confluence/meta","confluence/api/event"],function(f,k,a,e,g){return{results:[],property:"readOnlyMode",filterNewResults:function(b,c){return 0<c.length&&"string"!==typeof c[0]?c:[]},render:function(b){b=b[0];var c=e.get("access-mode"),d=b.isEnabled?"READ_ONLY":"READ_WRITE",h="READ_ONLY"===e.get("render-mode")?"We\u0027re back! \u003ca onclick=\u0022location.reload()\u0022\u003eRefresh\u003c/a\u003e the page to edit and make changes.":"We\u0027re back! You can now edit and make changes."; 2679if(!a.hasSuccess(a.Location.BANNER)||b.isEnabled)e.set("access-mode",d),d!==c&&g.trigger("qr:access-mode",{accessMode:d}),this.shouldDisplayError(b)?a.hasErrors(a.Location.BANNER)||this.showError(b.bannerMessage):"READ_ONLY"===c&&"READ_WRITE"===d?this.showSuccess(h):this.clearAll()},clearAll:function(){a.clearErrors(a.Location.ALL);a.clearSuccess(a.Location.ALL)},showError:function(b){a.clearSuccess(a.Location.ALL);a.showError(b,a.Location.BANNER)},showSuccess:function(b){a.clearErrors(a.Location.ALL); 2680a.showSuccess(b,a.Location.BANNER,{closeable:!0})},shouldDisplayError:function(b){return b.isBannerMessageOn||b.isEnabled}}}); 2681}catch(e){WRMCB(e)}; 2682; 2683try { 2684/* module-key = 'com.atlassian.confluence.plugins.quickreload:quick-reload-read-only-mode-bootstrap', location = 'main/quick-reload-read-only-mode-bootstrap.js' */ 2685require(["ajs","confluence/dark-features","confluence-quick-reload/main/quick-reload-manager","confluence-quick-reload/handlers/quick-reload-read-only-mode"],function(b,c,a,d){b.toInit(function(){c.isEnabled("quickreload.disabled")||(a.addHandler(d),a.enable())})}); 2686}catch(e){WRMCB(e)}; 2687; 2688try { 2689/* module-key = 'com.atlassian.confluence.plugins.confluence-frontend:split_vendors~date-time~react~react-dom~react-dom-client~react-dom-server~skip-links~table-styles-editor', location = 'vendors~date-time~react~react-dom~react-dom-client~react-dom-server~skip-links~table-styles-editor.js' */ 2690(window.atlassianWebpackJsonpe19a4f58490c3d96a3072d1e47cd0e73=window.atlassianWebpackJsonpe19a4f58490c3d96a3072d1e47cd0e73||[]).push([[4],{541:function(e,t,r){"use strict"; 2691/** 2692 * @license React 2693 * react.production.min.js 2694 * 2695 * Copyright (c) Facebook, Inc. and its affiliates. 2696 * 2697 * This source code is licensed under the MIT license found in the 2698 * LICENSE file in the root directory of this source tree. 2699 */var n=Symbol.for("react.element"),o=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),f=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.iterator;var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,b={};function m(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||_}function v(){}function S(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||_}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=m.prototype;var w=S.prototype=new v;w.constructor=S,h(w,m.prototype),w.isPureReactComponent=!0;var E=Array.isArray,k=Object.prototype.hasOwnProperty,$={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,r){var o,u={},a=null,c=null;if(null!=t)for(o in void 0!==t.ref&&(c=t.ref),void 0!==t.key&&(a=""+t.key),t)k.call(t,o)&&!R.hasOwnProperty(o)&&(u[o]=t[o]);var i=arguments.length-2;if(1===i)u.children=r;else if(1<i){for(var f=Array(i),s=0;s<i;s++)f[s]=arguments[s+2];u.children=f}if(e&&e.defaultProps)for(o in i=e.defaultProps)void 0===u[o]&&(u[o]=i[o]);return{$$typeof:n,type:e,key:a,ref:c,props:u,_owner:$.current}}function g(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var j=/\/+/g;function O(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function x(e,t,r,u,a){var c=typeof e;"undefined"!==c&&"boolean"!==c||(e=null);var i=!1;if(null===e)i=!0;else switch(c){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case n:case o:i=!0}}if(i)return a=a(i=e),e=""===u?"."+O(i,0):u,E(a)?(r="",null!=e&&(r=e.replace(j,"$&/")+"/"),x(a,t,r,"",(function(e){return e}))):null!=a&&(g(a)&&(a=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,r+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(j,"$&/")+"/")+e)),t.push(a)),1;if(i=0,u=""===u?".":u+":",E(e))for(var f=0;f<e.length;f++){var s=u+O(c=e[f],f);i+=x(c,t,r,s,a)}else if("function"==typeof(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e)))for(e=s.call(e),f=0;!(c=e.next()).done;)i+=x(c=c.value,t,r,s=u+O(c,f++),a);else if("object"===c)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function P(e,t,r){if(null==e)return e;var n=[],o=0;return x(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function I(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var T={current:null},V={transition:null},A={ReactCurrentDispatcher:T,ReactCurrentBatchConfig:V,ReactCurrentOwner:$};t.Children={map:P,forEach:function(e,t,r){P(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!g(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=u,t.Profiler=c,t.PureComponent=S,t.StrictMode=a,t.Suspense=l,t.__SECRET_INT
2699ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=h({},e.props),u=e.key,a=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,c=$.current),void 0!==t.key&&(u=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(f in t)k.call(t,f)&&!R.hasOwnProperty(f)&&(o[f]=void 0===t[f]&&void 0!==i?i[f]:t[f])}var f=arguments.length-2;if(1===f)o.children=r;else if(1<f){i=Array(f);for(var s=0;s<f;s++)i[s]=arguments[s+2];o.children=i}return{$$typeof:n,type:e.type,key:u,ref:a,props:o,_owner:c}},t.createContext=function(e){return(e={$$typeof:f,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},t.createElement=C,t.createFactory=function(e){var t=C.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:s,render:e}},t.isValidElement=g,t.lazy=function(e){return{$$typeof:y,_payload:{_status:-1,_result:e},_init:I}},t.memo=function(e,t){return{$$typeof:p,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=V.transition;V.transition={};try{e()}finally{V.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return T.current.useCallback(e,t)},t.useContext=function(e){return T.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return T.current.useDeferredValue(e)},t.useEffect=function(e,t){return T.current.useEffect(e,t)},t.useId=function(){return T.current.useId()},t.useImperativeHandle=function(e,t,r){return T.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return T.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return T.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return T.current.useMemo(e,t)},t.useReducer=function(e,t,r){return T.current.useReducer(e,t,r)},t.useRef=function(e){return T.current.useRef(e)},t.useState=function(e){return T.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return T.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return T.current.useTransition()},t.version="18.1.0"},68:function(e,t,r){"use strict";e.exports=r(541)}}]); 2700}catch(e){WRMCB(e)}; 2701; 2702try { 2703/* module-key = 'com.atlassian.confluence.plugins.confluence-frontend:split_vendors~date-time~skip-links~table-styles-editor', location = 'vendors~date-time~skip-links~table-styles-editor.js' */ 2704(window.atlassianWebpackJsonpe19a4f58490c3d96a3072d1e47cd0e73=window.atlassianWebpackJsonpe19a4f58490c3d96a3072d1e47cd0e73||[]).push([[8],{3:function(t,e,n){!function(t,e,n){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e;var r="default"in n?n.default:n;function a(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(t){for(var o=arguments.length,i=new Array(o>1?o-1:0),c=1;c<o;c++)i[c-1]=arguments[c];var l=0,u={};i=i.map((function(t){if(n.isValidElement(t)){var e="!PLACEHOLDER_".concat(++l,"!");return u[e]=t,e}return t}));var f=e.apply(void 0,[t].concat(a(i))).split(/(!PLACEHOLDER_\d+!)/g);if(1===f.length)return f.join("");var d=f.map((function(t,e){return r.createElement(n.Fragment,{key:e},e%2?u[t]:t)}));return r.createElement(n.Fragment,null,d)}var i={getText:function(){return console.warn('Call to "getText" function was not replaced with either raw translation or call to "format" function. Have you included the "jsI18n" transformation in Web Resource Manager?'),o.apply(void 0,arguments)}};t.I18n=i,t.format=o,Object.defineProperty(t,"__esModule",{value:!0})}(e,n(540),n(68))}}]); 2705}catch(e){WRMCB(e)}; 2706; 2707try { 2708/* module-key = 'com.atlassian.confluence.plugins.confluence-frontend:split_date-time~skip-links~table-styles-editor', location = 'date-time~skip-links~table-styles-editor.js' */ 2709(window.atlassianWebpackJsonpe19a4f58490c3d96a3072d1e47cd0e73=window.atlassianWebpackJsonpe19a4f58490c3d96a3072d1e47cd0e73||[]).push([[6],{540:function(a,e){a.exports=WRM.format}}]); 2710}catch(e){WRMCB(e)}; 2711; 2712try { 2713/* module-key = 'com.atlassian.confluence.plugins.confluence-frontend:split_skip-links', location = 'skip-links.js' */ 2714(window.atlassianWebpackJsonpe19a4f58490c3d96a3072d1e47cd0e73=window.atlassianWebpackJsonpe19a4f58490c3d96a3072d1e47cd0e73||[]).push([[30],{573:function(e,i,n){"use strict";n.r(i);var s=n(3),t=n(13),o=n(15);Object(o.a)("confluence/skip-links-loader",["confluence/api/logger"],e=>{const i={rerenderSkipLinks(){i._removeExistingSkipLinks(),i._reloadAutoMappedElements();const e=t.document.getElementById("header");e.dispatchEvent(new CustomEvent("confluence.skip-links-loader.rerender-skip-links",{bubbles:!0}));const n=[],s=i._documentContainsCustomTabIndexes();
2714[...i._skipLinks,...i._skipLinksAutoMapped].reverse().forEach(t=>{const o=i._renderSkipLink(t,s);o&&(e.insertBefore(o,e.firstChild),n.push(o))})},addSkipLink:n=>(n.href?1:0)+(n.skipToCssPath?1:0)+(n.onclick?1:0)>1?(e.error("skip-links-loader: use one of the properties: href/skipToCssPath/onclick. value:",n),!1):(t.document.dispatchEvent(new CustomEvent("confluence.skip-links-loader.add-skip-link",{detail:n})),i._skipLinks.push(n),!0),removeSkipLink(e){t.document.dispatchEvent(new CustomEvent("confluence.skip-links-loader.remove-skip-link",{detail:e})),i._skipLinks=i._skipLinks.filter(i=>i!==e)},_skipLinks:[],_skipLinksAutoMapped:[],_isVisible:e=>e.offsetWidth>0&&e.offsetHeight>0,_verifyOnlyIfExists(n){if(void 0===n.onlyIfExists)return!0;if("string"!=typeof n.onlyIfExists)return e.error('skip-links-loader: "onlyIfExists" only supports undefined and a string css path. value:',n.onlyIfExists,n),!1;const s=t.document.querySelector(n.onlyIfExists);return!!s&&(!!n.ignoreVisibility||i._isVisible(s))},_renderSkipLink(n,s){const o=t.document.createElement("a");if(o.className="aui-skip-link",o.setAttribute("aui-skip-link-auto-generated",""),s&&o.setAttribute("tabindex","1"),o.textContent=n.content,i._verifyOnlyIfExists(n))return n.href&&(o.href=n.href),(n.skipToCssPath||n.el)&&(o.href="",o.onclick=i=>{i.preventDefault();const s=n.el||t.document.querySelector(n.skipToCssPath);s?(s.focus(),t.document.activeElement===s||s.hasAttribute("tabindex")||(s.setAttribute("tabindex","0"),s.focus(),t.document.activeElement!==s&&e.error(`skip-links-loader: can\`t focus element based on css "${n.skipToCssPath}"`),s.removeAttribute("tabindex"))):e.error(`skip-links-loader: no element found based on css "${n.skipToCssPath}"`)}),n.onclick&&(o.href="",o.onclick=e=>{e.preventDefault(),n.onclick()}),o},_removeExistingSkipLinks(){[...t.document.querySelectorAll("#header .aui-skip-link[aui-skip-link-auto-generated]")].forEach(e=>e.parentNode.removeChild(e))},_reloadAutoMappedElements(){i._skipLinksAutoMapped=[...t.document.querySelectorAll("[aui-skip-link-target]")].filter(e=>e.hasAttribute("aui-skip-link-ignore-visibility")||i._isVisible(e)).map(e=>({content:s.format("Skip to {0}",e.getAttribute("aui-skip-link-target")),el:e}))},_documentContainsCustomTabIndexes:()=>[...t.document.querySelectorAll("[tabindex]")].some(e=>parseInt(e.getAttribute("tabindex"),10)>0)};return i});t.document.addEventListener("DOMContentLoaded",()=>{Object(o.b)(["confluence/skip-links-loader","ajs"],(e,i)=>{(e=>{const i={sidebar:"sidebar",mainContent:"main content",breadcrumbs:"breadcrumbs",search:"search"};s.format("Skip to {0}",i.sidebar),e.addSkipLink({onlyIfExists:"#nav-sidebar",skipToCssPath:"#nav-sidebar",ignoreVisibility:!0,content:s.format("Skip to {0}",i.sidebar)}),e.addSkipLink({onlyIfExists:".ia-splitter .ia-splitter-left .acs-side-bar .acs-side-bar-space-info",skipToCssPath:".ia-splitter .ia-splitter-left .acs-side-bar .acs-side-bar-space-info a",ignoreVisibility:!0,content:s.format("Skip to {0}",i.sidebar)}),e.addSkipLink({onlyIfExists:"#main",skipToCssPath:"#main",ignoreVisibility:!0,content:s.format("Skip to {0}",i.mainContent)}),e.addSkipLink({onlyIfExists:"#breadcrumbs > li",skipToCssPath:"#breadcrumbs",ignoreVisibility:!0,content:s.format("Skip to {0}",i.breadcrumbs)}),e.addSkipLink({onlyIfExists:"#quick-search-query",skipToCssPath:"#quick-search-query",ignoreVisibility:!0,content:s.format("Skip to {0}",i.search)})})(e),e.rerenderSkipLinks(),i.bind("rte-ready rte-quick-edit-ready",()=>e.rerenderSkipLinks())})})}},[[573,0,3,2,4,5,8,1,6]]]); 2715}catch(e){WRMCB(e)}; 2716; 2717try { 2718/* module-key = 'com.atlassian.mywork.mywork-confluence-host-plugin:mw-header-anchor', location = 'templates/anchor.soy' */ 2719// This file was automatically generated from anchor.soy. 2720// Please don't edit this file by hand. 2721 2722/** 2723 * @fileoverview Templates in namespace MyWork.Templates.Anchor. 2724 */ 2725 2726if (typeof MyWork == 'undefined') { var MyWork = {}; } 2727if (typeof MyWork.Templates == 'undefined') { MyWork.Templates = {}; } 2728if (typeof MyWork.Templates.Anchor == 'undefined') { MyWork.Templates.Anchor = {}; } 2729 2730 2731MyWork.Templates.Anchor.tasksFeatureDiscovery = function(opt_data, opt_ignored) { 2732 return '<p>' + soy.$$escapeHtml('See the tasks assigned to you, or created by you, in the Tasks tab of your profile.') + '</p><ul class="mw-tasks-discovery-controls"><li>
2732<a id="mw-tasks-discovery-view" href="' + soy.$$escapeHtml(opt_data.tasksUrl) + '" class="aui-button aui-style"><p>' + soy.$$escapeHtml('View Tasks') + '</p></a></li><li><a id="mw-tasks-discovery-dismiss" href="#">' + soy.$$escapeHtml('Dismiss') + '</a></li></ul>'; 2733}; 2734if (goog.DEBUG) { 2735 MyWork.Templates.Anchor.tasksFeatureDiscovery.soyTemplateName = 'MyWork.Templates.Anchor.tasksFeatureDiscovery'; 2736} 2737 2738}catch(e){WRMCB(e)}; 2739; 2740try { 2741/* module-key = 'com.atlassian.mywork.mywork-confluence-host-plugin:mw-header-anchor', location = 'js/miniview-anchor.js' */ 2742var MW=MW||{$:jQuery};MW.MV={}; 2743AJS.toInit(function(){if(!AJS.Meta||AJS.Meta.get("remote-user")){MW.MV.AnchorManager=function(){function y(){MW.$(document).keydown(function(a){AJS.InlineDialog.current&&27==a.which&&!MW.$(a.target).is(":input")&&AJS.InlineDialog.current.hide()})}function z(){MW.$("#header-menu-bar").find(".ajs-drop-down").each(function(){this.hide()})}function t(a){return MW.$("body",a.document).find("a[href]:visible, button:not([disabled]), input, textarea, select, details,[tabindex]:not([tabindex\x3d'-1']):visible")}function A(a, 2744e){(new IntersectionObserver(function(f){f.forEach(function(n){0<n.intersectionRatio&&e()})})).observe(a)}function B(a,e){function f(b){if("escKey"===b.data)l();else if("getParentConfig"===b.data&&b.origin===location.protocol+"//"+location.host){b=JSON.stringify({parentConfig:{parentUrl:location.href,preload:MW.Dialog.preload,unread:p}});var c=MW.$("#"+a+"-miniview-iframe")[0].contentWindow;c.postMessage(b,"*");c.document.addEventListener("keydown",n(c));MW.Dialog.preload&&(MW.Dialog.preload=!1)}} 2745function n(b){return function(c){if("Tab"==c.key){var d=t(b),g=d[0],q=d[d.length-1];d.length?c.shiftKey&&b.document.activeElement===g?l():b.document.activeElement===q&&l():l()}}}function l(){MW.$("#notifications-anchor").focus();u.hide()}var u;window.addEventListener?window.addEventListener("message",f,!1):window.attachEvent("onmessage",f);MW.Dialog=AJS.InlineDialog(MW.$("#"+a+"-anchor"),a+"-miniview",function(b,c,d){0===MW.$(b).children().length?MW.$(b).append(MW.$('\x3ciframe id\x3d"'+a+'-miniview-iframe" src\x3d"'+ 2746e+'" frameborder\x3d"0"\x3e\x3c/iframe\x3e')):(b=JSON.stringify({unread:p}),MW.$("#"+a+"-miniview-iframe")[0].contentWindow.postMessage(b,"*"));z();d()},{width:500,height:520,hideDelay:null,initCallback:function(){u=this;MW.$("#notifications-anchor").attr("aria-expanded","true");var b=MW.$("#"+a+"-miniview-iframe")[0].contentWindow;A(MW.$("#inline-dialog-notifications-miniview")[0],function(){var c=t(b)[0];c?c.focus():b.focus()})},hideCallback:function(){if(!0!==this.preload){var b=JSON.stringify({markAllRead:!0}); 2747MW.$("#"+a+"-miniview-iframe")[0].contentWindow.postMessage(b,"*");MW.$("#notifications-anchor").attr("aria-expanded","false")}},noBind:!0});MW.Tasks=function(){var b,c=$("#user-menu-link"),d=$("#user-menu-link-content"),g=d.find("#view-mytasks-link"),q=function(h,k,r){k=MyWork.Templates.Anchor.tasksFeatureDiscovery({tasksUrl:AJS.contextPath()+"/plugins/inlinetasks/mytasks.action"});h.html(k);h.find("#mw-tasks-discovery-dismiss").click(function(){b.hide()});r()};return{closeAndDiscoverMyTasks:function(){MW.Dialog.hide(); 2748d.is(":visible")||c.trigger("aui-button-invoke");var h=function(){b.hide()};d.one("aui-dropdown2-hide",h);b=AJS.InlineDialog(g,"my-tasks-discovery",q,{hideCallback:function(){b.unbind("click focusin mousedown",k);d.unbind("aui-dropdown2-hide",h);d.is(":visible")&&c.trigger("aui-button-invoke");MW.$("#inline-dialog-my-tasks-discovery").remove()},gravity:"w",useLiveEvents:!0,width:300,noBind:!0});d.find(".user-item.active").removeClass("active");g.addClass("active");g.focus();var k=function(r){r.stopPropagation()}; 2749b.on("click focusin mousedown",k);b.show()}}}();MW.$("#"+a+"-anchor").click(function(b){b.preventDefault();MW.$("#"+a+"-miniview-iframe").is(":visible")?MW.Dialog.hide():MW.Dialog.show()});v&&MW.$("#"+a+"-anchor").click()}var w=contextPath+"/plugins/servlet/notifications-miniview",p=0,v=/[?&]show-miniview/.test(window.location.search),x=function(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a=(new RegExp("[\\?\\#\x26]"+a+"\x3d([^\x26#]*)")).exec(window.location.search);if(null!==a)return decodeURIComponent(a[1].replace(/\+/g, 2750" "))}("show-miniview");x&&(w+="#notification/"+x);var C=function(a){var e=!1,f;return function(){if(e)return f;e=!0;return f=a.apply(this,arguments)}}(function(){MW.Dialog.getOptions().closeOthers=!1;MW.Dialog.preload=!0;MW.Dialog.show();MW.Dialog.hide();MW.Dialog.getOptions().closeOthers=!0});return{setupAnchors:function(){MW.$("#notifications-anchor").html('\x3cdiv class\x3d"badge-i aui-icon aui-icon-small aui-iconfont-notification"\x3e\x3c/div\x3e\x3cspan class\x3d"badge-w"\x3e\x3cspan class\x3d"badge" aria-hidden\x3d"true"\x3e\x3c/span\x3e\x3c/span\x3e').attr({title:"Open Notifications", 2751role:"button","aria-label":"Notifications","aria-expanded":"false"});B("notifications",w);y()},updateNotificationCount:function(a){var e=MW.$("#notifications-anchor"),f=e.find(".badge");e.find(".aui-icon");f.html(9>=a?a:"9+");p=a;0<a?(e.addClass("unread").removeClass("read").attr("aria-label",AJS.format("Notifications: {0} new",a)),e.is(":visible")&&!v&&C()):e.addClass("read").removeClass("unread").attr("aria-label","Notifications")}}}(); 2752MW.MV.AnchorManager.setupAnchors();var m=new MW.AnchorUtil(MW.$,contextPath,MW.MV.AnchorManager.updateNotificationCount);m.setupAnchors();
2752MW.$("#notifications-anchor").click(function(){AJS.trigger("analytics",{name:"mywork.host.button.clicked.notifications",data:{}});MW.MV.AnchorManager.updateNotificationCount(0)});document.addEventListener("visibilitychange",function(){document.hidden?m.stopRequests(!0):m.startRequests()},!1);MW.$("body").click(function(){m.startRequests()})}}); 2753}catch(e){WRMCB(e)}; 2754; 2755try { 2756/* module-key = 'com.atlassian.mywork.mywork-confluence-host-plugin:mw-header-anchor', location = 'js/util/anchor-util.js' */ 2757MW.AnchorUtil=function(t,n,p){function e(){3E5>(new Date).getTime()-f&&a||l();f=(new Date).getTime()}function l(){a&&clearTimeout(a);a=setTimeout(function(){c()},m=q(m))}function q(b){return Math.min(3E5>(new Date).getTime()-f?d:1.25*b,g)}function c(b){MW.$.getJSON(r+(b?"?pageid\x3d"+b:""),function(h){var k=1E3*h.timeout;g=1E3*h.maxTimeout||g;k&&k!=d&&(d=k,e());p(h.count)});l()}var d=3E4,a,r=n+"/rest/mywork/latest/status/notification/count",f=(new Date).getTime(),g=3E5,m=0;return{setupAnchors:function(){AJS&& 2758AJS.Meta&&AJS.Meta.get&&("page"===AJS.Meta.get("content-type")||"blogpost"===AJS.Meta.get("content-type"))?c(AJS.Meta.get("page-id")):c();e()},startRequests:e,stopRequests:function(b){window.clearInterval(a);a=void 0;!0===b&&(d=3E4)},updateAnchors:c}}; 2759}catch(e){WRMCB(e)}; 2760; 2761try { 2762/* module-key = 'com.atlassian.confluence.plugins.confluence-search-ui-plugin:search-ui-client-templates', location = 'soy/search-ui-client-templates.soy' */ 2763// This file was automatically generated from search-ui-client-templates.soy. 2764// Please don't edit this file by hand. 2765 2766/** 2767 * @fileoverview Templates in namespace Confluence.Templates.SearchUI. 2768 */ 2769 2770if (typeof Confluence == 'undefined') { var Confluence = {}; } 2771if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; } 2772if (typeof Confluence.Templates.SearchUI == 'undefined') { Confluence.Templates.SearchUI = {}; } 2773 2774 2775Confluence.Templates.SearchUI.helpUrl = function(opt_data, opt_ignored) { 2776 return '' + soy.$$escapeHtml("https:\/\/docs.atlassian.com\/confluence\/docs-85\/Search"); 2777}; 2778if (goog.DEBUG) { 2779 Confluence.Templates.SearchUI.helpUrl.soyTemplateName = 'Confluence.Templates.SearchUI.helpUrl'; 2780} 2781 2782}catch(e){WRMCB(e)}; 2783; 2784try { 2785/* module-key = 'com.atlassian.confluence.plugins.confluence-search-ui-plugin:confluence-search-ui-plugin-resources', location = '/js/confluence-search-ui-analytics-support.js' */ 2786'use strict'; 2787 2788/** 2789 * Utility functions for publishing new search ui analytics 2790 * @module confluence/searchui/analytics-support 2791 */ 2792define('confluence/search-ui/analytics-support', ['window', 'document', 'confluence/api/event', 'confluence/api/url'], function (window, document, eventApi, url) { 2793 "use strict"; 2794 2795 var SEARCH_UI_LEAVE_CONTENT_FROM_SEARCH_RESULT = 'confluence-search-ui-leave-content-from-new-search'; 2796 var SEARCH_UI_EDIT_CONTENT_FROM_SEARCH_RESULT = 'confluence-search-ui-edit-content-from-new-search'; 2797 /** 2798 * trigger analytic 2799 * @since 6.13.0 2800 * @public 2801 * @param name the analytic name 2802 * @param data the analytic data 2803 */ 2804 function triggerAnalytic(name, data) { 2805 data = data || {}; 2806 eventApi.trigger('analytics', { name: name, data: data }); 2807 } 2808 2809 /** 2810 * @param urlString 2811 * @returns {*} return array of searchId 2812 */ 2813 function extractAnalyticsData(urlString) { 2814 var params = url.parse(urlString).queryParams; 2815 return params && params.searchId ? params.searchId : []; 2816 } 2817 2818 /** 2819 * trigger period analytic event when beforeunload event happen 2820 * @param searchId searchId 2821 * @param period the period in millisecond 2822 */ 2823 function triggerPeriodEventViewContentFromSearch(searchId, period) { 2824 triggerAnalytic(SEARCH_UI_LEAVE_CONTENT_FROM_SEARCH_RESULT, { searchId: searchId, period: period }); 2825 } 2826 2827 /** 2828 * trigger period analytic event when enter editor init.rte 2829 * @param searchId searchId 2830 * @param period the period in millisecond 2831 */ 2832 function triggerPeriodEvenEditContentFromSearch(searchId, period) { 2833 triggerAnalytic(SEARCH_UI_EDIT_CONTENT_FROM_SEARCH_RESULT, { searchId: searchId, period: period }); 2834 } 2835 2836 /** 2837 * Remove 2838 * @param urlString 2839 * @returns {*} 2840 */
2841 function removeSearchIdUrl(urlString) { 2842 var parsedUrl = url.parse(urlString); 2843 delete parsedUrl.queryParams.searchId; 2844 return url.format(parsedUrl); 2845 } 2846 2847 /** 2848 * Clean analytic parameter 2849 */ 2850 function replaceStateAfterCleaningUpAnalyticsParameters() { 2851 var cleanUrl = removeSearchIdUrl(document.URL); 2852 if (document.URL !== cleanUrl) { 2853 window.history.replaceState(null, '', cleanUrl); 2854 } 2855 } 2856 2857 /** 2858 * Init analytic for period 2859 * @since 6.13 2860 * @public 2861 */ 2862 function initAnalytic() { 2863 var analyticsData = extractAnalyticsData(document.URL); 2864 var searchId = analyticsData[0]; 2865 if (!searchId) { 2866 return; 2867 } 2868 2869 var currentDate = new Date(); 2870 window.addEventListener('beforeunload', function () { 2871 var currentTriggerTime = new Date(); 2872 var period = currentTriggerTime.getTime() - currentDate.getTime(); 2873 triggerPeriodEventViewContentFromSearch(searchId, period); 2874 }); 2875 eventApi.bind('init.rte', function () { 2876 var currentTriggerTime = new Date(); 2877 var period = currentTriggerTime.getTime() - currentDate.getTime(); 2878 triggerPeriodEvenEditContentFromSearch(searchId, period); 2879 }); 2880 // Check if browser supports HTML5 replaceState() 2881 if (window.history && window.history.replaceState) { 2882 replaceStateAfterCleaningUpAnalyticsParameters(); 2883 } 2884 } 2885 2886 return { 2887 init: initAnalytic 2888 }; 2889}); 2890 2891}catch(e){WRMCB(e)}; 2892; 2893try { 2894/* module-key = 'com.atlassian.confluence.plugins.confluence-search-ui-plugin:confluence-search-ui-plugin-resources', location = '/js/confluence-search-ui-plugin.js' */ 2895require(['ajs', 'wrm', 'document', 'confluence/api/logger', 'confluence/meta', 'confluence/api/constants', 'confluence/search-ui/analytics-support'], 2896 function (ajs, wrm, document, logger, meta, constants, analyticsSupport) { 2897 const eventsTriggeringPluginLazyLoad = ['keydown', 'input', 'click']; 2898 const eventsTriggeringForQuickSearchEnabled = ['click', 'focusout', 'focus']; 2899 var searchUI; 2900 var searchInput; 2901 var searchInputButton; 2902 var spinner; 2903 var tooltip; 2904 var isTooltipShown = false; 2905 var isLoading = false; 2906 2907 function toggleIcon() { 2908 searchUI.classList.toggle("hide-icon"); 2909 } 2910 2911 function startLoading() { 2912 isLoading = true; 2913 toggleIcon(); 2914 spinner.style.display = 'block'; 2915 } 2916 2917 function stopLoading() { 2918 isLoading = false; 2919 toggleIcon(); 2920 spinner.style.display = 'none'; 2921 } 2922 2923 function unregisterHandlers() { 2924 eventsTriggeringPluginLazyLoad.forEach(function (event) { 2925 searchInput.removeEventListener(event, lazyLoadManager); 2926 }); 2927 searchInputButton.removeEventListener('click', lazyLoadManagerForIcon); 2928 searchInputButton.removeEventListener('keydown', lazyLoadManagerForIcon); 2929 } 2930 2931 // TODO: would be great remove those events too 2932 function unregisterHandlersForQuickEnabledScope() { 2933 eventsTriggeringForQuickSearchEnabled.forEach(function (event) { 2934 searchInput.removeEventListener(event, handleClickAndFocusEvent); 2935 searchInputButton.removeEventListener(event, handleClickAndFocusEvent); 2936 }); 2937 } 2938 2939 function showTooltip() { 2940 if (!isTooltipShown) { 2941 tooltip.style.display = 'block'; 2942 isTooltipShown = true; 2943 } 2944 } 2945 2946 function hideTooltip() { 2947 if (isTooltipShown) { 2948 tooltip.style.display = 'none'; 2949 isTooltipShown = false; 2950 } 2951 } 2952 2953 function handleClickAndFocusEvent(event) { 2954 if (event && event.type ==='focusout') { 2955 hideTooltip() 2956 return; 2957 } 2958 2959 showTooltip(); 2960 event.stopPropagation(); 2961 } 2962 2963 function handleInputEvent(event) { 2964 if (event.target.value) { 2965 showTooltip(); 2966 } else { 2967 hideTooltip(); 2968 } 2969 } 2970 2971 function handleKeyDownEvent(event) {
2972 const ENTER_KEY_CODE = 13; 2973 if (event.keyCode === ENTER_KEY_CODE) { 2974 const searchTerm = event.target.value; 2975 const cql = searchTerm ? '?cql=&queryString=' + encodeURIComponent(searchTerm) : ''; 2976 window.location.href = constants.CONTEXT_PATH + '/dosearchsite.action' + cql; 2977 } 2978 } 2979 2980 function handleDocumentClick(event) { 2981 if (searchUI.contains(event.target)) { 2982 showTooltip(); 2983 } else { 2984 hideTooltip(); 2985 } 2986 } 2987 2988 function lazyLoadManager(event) { 2989 if (!event) return; 2990 if(event.type === 'keydown' && event.keyCode !== 13) return; 2991 lazyLoad(); 2992 } 2993 2994 function lazyLoadManagerForIcon(event) { 2995 if (!event) return; 2996 if (event.type === 'keydown' 2997 && event.keyCode !== 13 2998 && event.keyCode !== 32) return; 2999 lazyLoad(); 3000 } 3001 3002 function lazyLoad() { 3003 if (isLoading) return; 3004 3005 startLoading(); 3006 wrm 3007 .require(['wrc!confluence-search-ui-plugin-main']) 3008 .done(function () { 3009 require(['confluence-search-ui-plugin-main'], function (SearchUI) { 3010 SearchUI.default.init(); 3011 unregisterHandlers(); 3012 stopLoading(); 3013 }); 3014 }) 3015 .fail(function () { 3016 stopLoading(); 3017 logger.error('fail to load confluence-search-ui-plugin-main'); 3018 }); 3019 } 3020 3021 ajs.toInit(function () { 3022 searchUI = document.getElementById('search-ui'); 3023 // login screen doesn't have navigation search 3024 if (!searchUI) { 3025 logger.log('no search-ui element found'); 3026 return; 3027 } 3028 3029 analyticsSupport.init(); 3030 searchInput = searchUI.querySelector('#quick-search-query'); 3031 searchInputButton = searchUI.querySelector('#quick-search-query-button'); 3032 spinner = searchUI.querySelector('aui-spinner'); 3033 tooltip = searchUI.querySelector('[role=alert]'); 3034 3035 if (!meta.get('global-settings-quick-search-enabled')) { 3036 searchInputButton.addEventListener('keydown', handleKeyDownEvent); 3037 searchInput.addEventListener('keydown', handleKeyDownEvent); 3038 searchInput.addEventListener('input', handleInputEvent); 3039 3040 eventsTriggeringForQuickSearchEnabled.forEach(function (event) { 3041 searchInputButton.addEventListener(event, handleClickAndFocusEvent); 3042 searchInput.addEventListener(event, handleClickAndFocusEvent); 3043 }); 3044 3045 document.addEventListener('click', handleDocumentClick); 3046 } else { 3047 eventsTriggeringPluginLazyLoad.forEach(function (event) { 3048 searchInput.addEventListener(event, lazyLoadManager); 3049 }); 3050 searchInputButton.addEventListener('click', lazyLoadManagerForIcon); 3051 searchInputButton.addEventListener('keydown', lazyLoadManagerForIcon); 3052 } 3053 }); 3054 }); 3055 3056}catch(e){WRMCB(e)}; 3057; 3058try { 3059/* module-key = 'com.atlassian.confluence.plugins.dialog-wizard:dialog-wizard-resources', location = '/soy/dialog-wizard.soy' */ 3060// This file was automatically generated from dialog-wizard.soy. 3061// Please don't edit this file by hand. 3062 3063/** 3064 * @fileoverview Templates in namespace Confluence.Templates.DialogWizard. 3065 */ 3066 3067if (typeof Confluence == 'undefined') { var Confluence = {}; } 3068if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; } 3069if (typeof Confluence.Templates.DialogWizard == 'undefined') { Confluence.Templates.DialogWizard = {}; } 3070 3071 3072Confluence.Templates.DialogWizard.pageContainer = function(opt_data, opt_ignored) { 3073 return '<div class="dialog-wizard-page-wrapper"><div class="dialog-wizard-page-main"></div><div class="dialog-wizard-page-description">' + ((opt_data.descriptionHeaderLink && opt_data.descriptionHeader) ? '<h3><a href=\'' + soy.$$escapeHtml(opt_data.descriptionHeaderLink) + '\' target=\'_blank\'>' + soy.$$escapeHtml(opt_data.descriptionHeader) + '</a></h3>' : (opt_data.descriptionHeader) ? '<h3>' + soy.$$escapeHtml(opt_data.descriptionHeader) + '</h3>' : '') + '<p>' + soy.$$escapeHtml(opt_data.descriptionContent) + '</p></div></div>'; 3074}; 3075if (goog.DEBUG) { 3076 Confluence.Templates.DialogWizard.pageContainer.soyTemplateName = 'Confluence.Templates.DialogWizard.pageContainer'; 3077} 3078 3079 3080Confluence.Templates.DialogWizard.waitIcon = function(opt_data, opt_ignored) { 3081 return '<img class="wait-icon" src="' + soy.$$escapeHtml("/confluence") + '/images/icons/wait.gif">'; 3082}; 3083if (goog.DEBUG) { 3084 Confluence.Templates.DialogWizard.waitIcon.soyTemplateName = 'Confluence.Templates.DialogWizard.waitIcon'; 3085} 3086 3087}catch(e){WRMCB(e)}; 3088; 3089try { 3090/* module-key = 'com.atlassian.confluence.plugins.dialog-wizard:dialog-wizard-resources', location = '/js/dialog-wizard.js' */ 3091(function(q){function z(g,r){var m=-1;_.each(r,function(t,d){t.id==g&&(m=d)});return r[m+1].id}var A=require("confluence/form-state-control");Confluence.DialogWizard=function(g,r){function m(d,b,f,e,h){var a=_.find(d.wizard.pages,function(u){return u.id==b});h.trigger("pre-render."+b,{soyRenderContext:f,wizardData:e});try{var n=eval(a.templateKey),c=q(n(f))}catch(u){throw Error("wizard points to a non-existent Soy template '"+a.templateKey+"'. Check your web-resources or server logs.");}c.find("a, area, button, input, object, select, textarea").attr("tabindex", 3092"10");a.descriptionContent?(n=q(Confluence.Templates.DialogWizard.pageContainer({descriptionHeaderLink:a.descriptionHeaderLink,descriptionHeader:a.descriptionHeader,descriptionContent:a.descriptionContent})),n.addClass("with-description").find(".dialog-wizard-page-main").append(c)):n=c;var k=b;"create-dialog"==g.id&&(k="create-dialog-"+b);k=g.addPage(k).page[g.curpage];
3092k.addHeader(a.title).addPanel("SinglePanel",n,"singlePanel");k.element.find("form").submit(function(){return!1});a.descriptionContent&& 3093k.element.find(".dialog-panel-body").css({padding:0});Confluence.Binder.autocompleteMultiUser(c);Confluence.Binder.placeholder(c);var y=g.addFullButtonPanel(k,function(u){c.find(".placeholded").val("");var x={},v=c.parent().find("form").serializeArray();_.each(v,function(w){x[w.name]=w.value});v=q.Event("submit."+b);var l={$container:c,wizardData:e,pageData:x},p=q.Deferred();p.done(function(){e.pages[b]=x;var w=l.nextPageId?l.nextPageId:!a.last&&z(b,d.wizard.pages);!l.nextPageId&&a.last?(t(u,l,e, 3094r,h),A.disableElement(g.popup.element.find(":input,a").filter(":visible")),y.prepend(Confluence.Templates.DialogWizard.waitIcon())):m(d,w,f,e,h)});p.fail(function(){AJS.log("dialog aborted by on-submit callback on page: "+b)});l.validationDeferred=p;h.trigger(v,l);l.async||(v.isDefaultPrevented()?p.reject():p.resolve())},null,a.last);y.find(".button-panel-back").click(function(){delete e.pages[b]});y.find(".aui-button-primary").attr("tabindex","10");c.find("input, select, textarea").eq(0).focus(); 3095h.trigger("post-render."+b,{$container:c,wizardData:e})}function t(d,b,f,e,h){b.finalUrl?"click"===d.type&&2===d.which?window.open(b.finalUrl).opener=null:window.location=b.finalUrl:(_.each(f.pages,function(a){_.extend(f,a)}),delete f.pages,e(d,f,null,h));return{success:function(a){a()}}}return{newPage:m,doFinalAction:t}}})(AJS.$); 3096}catch(e){WRMCB(e)}; 3097; 3098try { 3099/* module-key = 'com.atlassian.confluence.plugins.confluence-business-blueprints:common-template-resources', location = 'com/atlassian/confluence/plugins/blueprint/common/soy/common-templates.soy' */ 3100// This file was automatically generated from common-templates.soy. 3101// Please don't edit this file by hand. 3102 3103/** 3104 * @fileoverview Templates in namespace Confluence.Blueprints.Common.Index. 3105 */ 3106 3107if (typeof Confluence == 'undefined') { var Confluence = {}; } 3108if (typeof Confluence.Blueprints == 'undefined') { Confluence.Blueprints = {}; } 3109if (typeof Confluence.Blueprints.Common == 'undefined') { Confluence.Blueprints.Common = {}; } 3110if (typeof Confluence.Blueprints.Common.Index == 'undefined') { Confluence.Blueprints.Common.Index = {}; } 3111 3112 3113Confluence.Blueprints.Common.Index.detailsSummaryMacro = function(opt_data, opt_ignored) { 3114 return '<ac:macro ac:name="detailssummary"><ac:parameter ac:name="label">' + soy.$$escapeHtml(opt_data.label) + '</ac:parameter><ac:parameter ac:name="spaces">' + soy.$$escapeHtml(opt_data.spaces) + '</ac:parameter><ac:parameter ac:name="firstcolumn">' + soy.$$escapeHtml(opt_data.firstcolumn) + '</ac:parameter><ac:parameter ac:name="headings">' + soy.$$escapeHtml(opt_data.headings) + '</ac:parameter><ac:parameter ac:name="blankTitle">' + soy.$$escapeHtml(opt_data.blankTitle) + '</ac:parameter><ac:parameter ac:name="blankDescription">' + soy.$$escapeHtml(opt_data.blankDescription) + '</ac:parameter><ac:parameter ac:name="contentBlueprintId">' + soy.$$escapeHtml(opt_data.contentBlueprintId) + '</ac:parameter><ac:parameter ac:name="blueprintModuleCompleteKey">' + soy.$$escapeHtml(opt_data.blueprintModuleCompleteKey) + '</ac:parameter><ac:parameter ac:name="createButtonLabel">' + soy.$$escapeHtml(opt_data.createButtonLabel) + '</ac:parameter></ac:macro>'; 3115}; 3116if (goog.DEBUG) { 3117 Confluence.Blueprints.Common.Index.detailsSummaryMacro.soyTemplateName = 'Confluence.Blueprints.Common.Index.detailsSummaryMacro'; 3118} 3119 3120 3121Confluence.Blueprints.Common.Index.createFromTemplateMacro = function(opt_data, opt_ignored) { 3122 return '<ac:macro ac:name="create-from-template"><ac:parameter ac:name="blueprintModuleCompleteKey">' + soy.$$escapeHtml(opt_data.moduleKey) + '</ac:parameter><ac:parameter ac:name="buttonLabel">' + soy.$$escapeHtml(opt_data.buttonLabel) + '</ac:parameter><ac:parameter ac:name="spaceKey">' + soy.$$escapeHtml(opt_data.spaceKey) + '</ac:parameter><ac:parameter ac:name="templateName">' + soy.$$escapeHtml(opt_data.templateName) + '</ac:parameter></ac:macro>'; 3123}; 3124if (goog.DEBUG) { 3125 Confluence.Blueprints.Common.Index.createFromTemplateMacro.soyTemplateName = 'Confluence.Blueprints.Common.Index.createFromTemplateMacro'; 3126} 3127 3128}catch(e){WRMCB(e)}; 3129; 3130try { 3131/* module-key = 'com.atlassian.confluence.plugins.confluence-business-blueprints:meeting-notes-resources', location = 'com/atlassian/confluence/plugins/meetingnotes/soy/how-to.soy' */ 3132// This file was automatically generated from how-to.soy. 3133// Please don't edit this file by hand. 3134 3135/** 3136 * @fileoverview Templates in namespace Confluence.Blueprints.Meeting.Notes. 3137 */ 3138 3139if (typeof Confluence == 'undefined') { var Confluence = {}; } 3140if (typeof Confluence.Blueprints == 'undefined') { Confluence.Blueprints = {}; } 3141if (typeof Confluence.Blueprints.Meeting == 'undefined') { Confluence.Blueprints.Meeting = {}; } 3142if (typeof Confluence.Blueprints.Meeting.Notes == 'undefined') { Confluence.Blueprints.Meeting.Notes = {}; } 3143 3144 3145Confluence.Blueprints.Meeting.Notes.howTo = function(opt_data, opt_ignored) { 3146 return '<h1>' + soy.$$escapeHtml('With meeting notes you can...') + '</h1><ol class="howto-steps"><li class="howto-step"><div><h3>' + soy.$$escapeHtml('Crowd-source your agenda') + '</h3><p>' + soy.$$escapeHtml('Distribute an agenda and keep meetings focused.') + '</p></div></li><li class="howto-step"><div><h3>' + soy.$$escapeHtml('Capture meeting minutes') + '</h3><p>' + soy.$$escapeHtml('Take notes and make them available to everyone.') + '</p></div></li><li class="howto-step"><div><h3>' + soy.$$escapeHtml('Create and assign tasks') + '</h3><p>' + soy.$$escapeHtml('Assign action items for attendees to work on afterward.') + '</p></div></li></ol>'; 3147}; 3148if (goog.DEBUG) { 3149 Confluence.Blueprints.Meeting.Notes.howTo.soyTemplateName = 'Confluence.Blueprints.Meeting.Notes.howTo'; 3150} 3151 3152}catch(e){WRMCB(e)}; 3153; 3154try { 3155/* module-key = 'com.atlassian.confluence.plugins.confluence-business-blueprints:meeting-notes-resources', location = 'com/atlassian/confluence/plugins/meetingnotes/soy/user-mention.soy' */ 3156// This file was automatically generated from user-mention.soy. 3157// Please don't edit this file by hand. 3158 3159/** 3160 * @fileoverview Templates in namespace Confluence.Templates.Meeting.Notes. 3161 */ 3162 3163if (typeof Confluence == 'undefined') { var Confluence = {}; } 3164if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; } 3165if (typeof Confluence.Templates.Meeting == 'undefined') { Confluence.Templates.Meeting = {}; } 3166if (typeof Confluence.Templates.Meeting.Notes == 'undefined') { Confluence.Templates.Meeting.Notes = {}; } 3167 3168 3169Confluence.Templates.Meeting.Notes.userMention = function(opt_data, opt_ignored) { 3170 opt_data = opt_data || {}; 3171 return '' + ((opt_data.userkey) ? '<li><p><ac:link><ri:user ri:userkey="' + soy.$$escapeHtml(opt_data.userkey) + '" /></ac:link></p></li><li><p><ac:placeholder ac:type="mention">' + soy.$$escapeHtml('@mention a person to add them as an attendee and they will be notified.') + '</ac:placeholder></p></li>' : '<li><p><ac:placeholder ac:type="mention">' + soy.$$escapeHtml('@mention a person to add them as an attendee and they will be notified.') + '</ac:placeholder></p></li>'); 3172}; 3173if (goog.DEBUG) { 3174 Confluence.Templates.Meeting.Notes.userMention.soyTemplateName = 'Confluence.Templates.Meeting.Notes.userMention'; 3175} 3176 3177}catch(e){WRMCB(e)}; 3178; 3179try { 3180/* module-key = 'com.atlassian.troubleshooting.plugin-confluence:atst-common', location = '
3180js/ajs-amd.js' */ 3181define('troubleshooting/ajs', [], function () { 3182 'use strict'; 3183 3184 return AJS; 3185}); 3186}catch(e){WRMCB(e)}; 3187; 3188try { 3189/* module-key = 'com.atlassian.troubleshooting.plugin-confluence:atst-healthcheck-sensors', location = 'js/sensors/page-protocols.js' */ 3190define('troubleshooting/sensors/page-protocols', ['troubleshooting/ajs'], function(AJS) { 3191 var baseUrl = AJS.contextPath(); 3192 var hasPerfData = window.performance && typeof window.performance.getEntriesByType === 'function'; 3193 3194 // WARNING: This is a rough assumption based on how the WRM works. 3195 // Consuming this from the WRM would be a better option, but meh. 3196 // See: https://bitbucket.org/atlassian/atlassian-plugins-webresource/src/master/atlassian-plugins-webresource/src/main/java/com/atlassian/plugin/webresource/WebResourceUrlProviderImpl.java 3197 // See also: https://stash.atlassian.com/projects/CP/repos/static-assets-url/browse/src/main/resources/ui/health-checks/health-checks.js 3198 var WRM_STATIC_ASSET_REGEX = new RegExp(baseUrl + '/s/.+?/_/'); 3199 3200 function isStaticResource(resource) { 3201 return WRM_STATIC_ASSET_REGEX.test(resource.name); 3202 } 3203 3204 function getNextHopData(resource) { 3205 return (resource && resource.nextHopProtocol) || 'unknown'; 3206 } 3207 3208 function unique(elem, pos, arr) { 3209 return arr.indexOf(elem) === pos; 3210 } 3211 3212 return { 3213 isWorking: function() { 3214 return hasPerfData; 3215 }, 3216 getName: function() { 3217 return 'page-protocols'; 3218 }, 3219 getData: function() { 3220 var resources = window.performance.getEntriesByType('resource'); 3221 var navigation = window.performance.getEntriesByType('navigation'); 3222 var resourceProtocols = resources 3223 .filter(isStaticResource) 3224 .map(getNextHopData) 3225 .filter(unique) 3226 .sort(); 3227 if (!resourceProtocols.length) { 3228 resourceProtocols.push('unknown'); 3229 } 3230 return { 3231 resourceProtocols: resourceProtocols, 3232 navigationProtocol: getNextHopData(navigation[0]), 3233 userAgent: navigator.getUserAgent && "use-js-client-hints" || navigator.userAgent 3234 }; 3235 } 3236 } 3237}); 3238 3239}catch(e){WRMCB(e)}; 3240; 3241try { 3242/* module-key = 'com.atlassian.troubleshooting.plugin-confluence:atst-healthcheck-sensors', location = 'js/sensors.js' */ 3243require([ 3244 'troubleshooting/sensors/page-protocols', 3245 'troubleshooting/ajs' 3246], function( 3247 protocolSensor, 3248 AJS 3249) { 3250 var sensors = [protocolSensor]; 3251 3252 AJS.toInit(function() { 3253 3254 function hash(str) { 3255 var hash = 0; 3256 for (var i = 0; i < str.length; ++i) { 3257 hash = 31 * hash + str.charCodeAt(i); 3258 hash |= 0; // this reduces the number to 32bits and prevents Infinity 3259 } 3260 return hash; 3261 } 3262 3263 //this handles cases when the user disabled access to local storage 3264 var localStorageWrapper = { 3265 getWithDefaultOnError: function(sensorName, defaultValue) { 3266 try { 3267 return window.localStorage.getItem(sensorName) || "0"; 3268 } catch (e) { 3269 return defaultValue; 3270 } 3271 }, 3272 setItemQuietly: function (key, value) { 3273 try { 3274 window.localStorage.setItem(key, value); 3275 } catch (ignored) { 3276 } 3277 } 3278 }; 3279 3280 // Iterate through each sensor and ingest any data it has for us... 3281 // but only if it's actually working properly in this client. 3282 sensors.forEach(function(sensor) { 3283 if (!sensor.isWorking()) { 3284 return 3285 } 3286 3287 var sensorData = {}; 3288 var newData = sensor.getData(); 3289 for (var key in newData) { 3290 if (newData.hasOwnProperty(key)) { 3291 sensorData[key] = newData[key]; 3292 } 3293 } 3294 3295 var sensorName = 'atst.healthcheck.sensors.' + sensor.getName(); 3296 var currentHash = hash(JSON.stringify(sensorData)).toString(36); 3297 var previousHash = localStorageWrapper.getWithDefaultOnError(sensorName, currentHash); 3298 if (previousHash===currentHash && Math.random()>0.01) { 3299 return; 3300 } 3301 // What's one more analytics event to the world? A drop in the data ocean. 3302 AJS.trigger('analytics', { 3303 name: sensorName, 3304 data: sensorData 3305 }); 3306 localStorageWrapper.setItemQuietly(sensorName, currentHash); 3307 }); 3308 3309 }); 3310}); 3311 3312}catch(e){WRMCB(e)};
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.