WRMCB=function(e){var c=console;if(c&&c.log&&c.error){c.log('Error running batched script.');c.error(e);}} ; try { /* module-key = 'com.atlassian.confluence.plugins.confluence-create-content-plugin:resources', location = 'com/atlassian/confluence/plugins/createcontent/soy/initial-templates.soy' */ // This file was automatically generated from initial-templates.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace Confluence.Templates.Blueprints. */ if (typeof Confluence == 'undefined') { var Confluence = {}; } if (typeof Confluence.Templates == 'undefined') { Confluence.Templates = {}; } if (typeof Confluence.Templates.Blueprints == 'undefined') { Confluence.Templates.Blueprints = {}; } Confluence.Templates.Blueprints.createDialogBody = function(opt_data, opt_ignored) { return Confluence.Templates.Blueprints.waitContainer(null) + '
' + soy.$$escapeHtml('TIME-SAVING TEMPLATES') + '
' + soy.$$filterNoAutoescape('Want some help creating awesome pages quickly? There are some useful templates here, to help get you started.') + '
'; }; if (goog.DEBUG) { Confluence.Quick.Create.discoveryTooltip.soyTemplateName = 'Confluence.Quick.Create.discoveryTooltip'; } }catch(e){WRMCB(e)}; ; try { /* module-key = 'com.atlassian.confluence.plugins.confluence-create-content-plugin:resources', location = 'com/atlassian/confluence/plugins/createcontent/js/create-dialog-base.js' */ Confluence.Dialogs=Confluence.Dialogs||{};(function(c){function b(g,f){try{return require(g)}catch(d){console.error(d);return f}}Confluence.Dialogs.CreateDialogBase=function a(P){var h,ab,s=P.dialogId,y=P.webItemsPath,C=[],i=false,ad=b("confluence/api/event",{bind:function(){}}),v=require("confluence/confluence-storage-manager")("confluence-create-content-plugin"),K=b("confluence/legacy-message-queue-analytics",{send:function(){}}),G,E=true,ac=false,ae,Y,V;function D(af){if(!ab){return}if(ab.find(".button-panel-cancel-link:visible").is(".disabled")){return}if(Confluence.Blueprint.HowToUse){Confluence.Blueprint.HowToUse.notifyCancel(h)}if(af){X()}h.remove();c(".tipsy").remove();h=null;ab=null;c(window).removeProp("disabled");if(V){V.focus()}return false}function Z(){return c(".create-dialog-create-button:visible")}function U(){return c(".create-dialog-body .template:visible").length}function J(af){return af.data("content-blueprint-id")}function L(ah){var aj=J(ah),ag=ah.data("template-id"),ai=aj||ag,af=aj?"contentBlueprintId":"templateId";if(!ai){return aa("itemModuleCompleteKey",ah.data("item-module-complete-key"))}return aa(af,ai)}function n(ag,af){if(!U()){return false}if(c(this).attr("disabled")==="disabled"){return false}c(this).attr("disabled","disabled").before('');c(".create-dialog-button-spinner").spin("small");var aj=H.getSpaceKey();var ai=c(".template.selected");var ah=L(ai);if(!ah){throw new Error("Expected at least one template to be selected")}ah.spaceKey=aj;ah.spaTransitionEnabled=af.spaTransitionEnabled;if(af.parentPageSpaceKey===aj){ah.parentPageId=af.parentPageId;ah.parentPageType=af.parentPageType;ah.parentPageTitle=af.parentPageTitle;ah.parentPageSpaceKey=af.parentPageSpaceKey}Confluence.Blueprint.fireWizard(ag,ah,h)}function A(){if(!U()){Z().attr("disabled","disabled")}else{Z().removeAttr("disabled")}}function aa(af,ag){return _.find(H.loadedWebitems[H.getSpaceKey()],function(ah){return ah[af]==ag})}function R(af){return aa("contentBlueprintId",af)}function N(ah){var ag=R(ah);var af=ag&&ag.wizard;var ai=f(!af);Z().text(ai)}function u(af,ag){af.addClass("selected").find("input[type='radio']").attr("checked","true");af.siblings().removeClass("selected").find("input[type='radio']").removeAttr("checked");if(ag&&ag.shouldFocusRadioButton){af.find("input[type='radio']").focus()}N(J(af));AJS.trigger(Confluence.Dialogs.Events.ITEM_SELECTED,{item:af})}function t(af,ak){var ah=af.find(".template");var aj=ah.filter(".selected");var ag=ah.index(aj)+ak;ag=ag%ah.length;var ai=ah.eq(ag);u(ai,{shouldFocusRadioButton:true});ai.focus();af.simpleScrollTo(ai)}function d(ag){var af=2;switch(ag){case 37:return -1;case 39:return +1;case 38:return -af;case 40:return +af}return 0}function Q(af){af.bind("keydown",function(ag){var ah=d(ag.which);if(ah){t(af,ah);return AJS.stopEvent(ag)}})}function j(af){return af==="com.atlassian.confluence.plugins.confluence-create-content-plugin:create-blank-page"||af==="com.atlassian.confluence.plugins.confluence-create-content-plugin:create-blog-post"}function B(ag,ah,af){AJS.flag({type:ag,title:ah,body:af})}function o(at,ak){var ar=H.getSpaceKey();var av=H.loadedWebitems[ar];av=H.filterWebItems(av);i=av&&av.length>0&&_.some(av,function(ax){return ax.isPromoted});C=q(av);if(!i&&at){av=C}var ag=Confluence.Templates.Blueprints.templates({webItems:av,spaceKey:ar});var ap=c(ag);var an=O(ap);if(window.location.search.includes("createDialogWACErrorMessage")){var ah=window.location.search.split("createDialogWACErrorMessage=")[1].split("&")[0];var aw={"all.purpose":["Something went wrong","We can not present you with the right template. Choose one of the available templates, or go back to www.atlassian.com and try again."],"disable.blueprint":["The template is not available","Your Confluence admin has disabled this template. Contact your admin to make it available."]};B("error",aw[ah][0],aw[ah][1])}if(window.location.search.includes("createDialogWACWarningMessage")){var ao=window.location.search.split("createDialogWACWarningMessage=")[1].split("&")[0];var am={"no.personal.space":["No personal space available","Since you do not have a personal space, select a space before creating the template."],"old.editor.template":["This template will use the old editor","Your Confluence site is not ready to use the version of this template, which was created using the new editor."]};B("warning",am[ao][0],am[ao][1])}if(i&&an===undefined){var ar=H.getSpaceKey();var aj=c.parseJSON(v.getItem("showMore"))||{};var aq=aj[ar];if(!aq||aq<3){var ai=ap.find(".template");_.each(ai,function(ay){var ax=c(ay);var az=L(ax);if(!az.isPromoted&&!j(az.itemModuleCompleteKey)){ax.hide()}});var au=ap.append(Confluence.Templates.Blueprints.Promoted.showMore())[0];c("#promoted-link",au).click(function(){aj[ar]=(aq||0)+1;v.setItemQuietly("showMore",JSON.stringify(aj));c(this).closest(".templates").find(".template").css("display","");c(this).closest("li").remove();A()})}}var af=ab.find(".templates");if(af.length){if(ak){af.fadeOut(150,function(){af.replaceWith(ap.fadeIn(150));x();r();Q(ap)})}else{af.replaceWith(ap)}}else{c(".template-select-container-body").append(ap)}if(S()){var al=!at;F(C.length,al)}else{e()}if(ab.searcher){ab.searcher.refreshItems();ab.searcher.filter()}ab.find(".loading").removeClass("loading");ab.trigger("create-content.loaded");r();Q(ap);if(S()){x()}if(an!==undefined){E=false;ab.find(".templates").simpleScrollTo(an.first().click());E=true}A()}function m(af){AJS.log("Attempted to select a blueprint that could not be found in the create dialog: "+af)}function O(aj){var ag;if(window.location.search.includes("createDialogBlueprintModule")){var al=window.location.search.split("createDialogBlueprintModule=")[1].split("&")[0];ag=aj.find('.template[data-blueprint-module-complete-key="'+al+'"]');if(ag.length){return ag}m(al)}else{if(!h.initContext){return}var ak;var ai=Confluence.Blueprint.Selector.getSelectors();for(var ah=0,af=ai.length;ah"+"The template selected is not available anymore."+"
"});return}Confluence.Blueprint.loadDialog({showDialog:true,updateHeight:false,showStepOne:true,initContext:d}).done(function(t){var u=p.itemModuleCompleteKey;p=$.extend({},p);p.title=k;p.contentId=c;p.spaceKey=""+j;p.parentPageId=""+m;p.onContentUpdated=l;p.onError=h;p.beforeUpdateRequest=f;AJS.trigger(Confluence.Dialogs.Events.ITEM_SELECTED,{config:p});Confluence.Blueprint.fireWizard(q,p,t);t.removeBackButton();var s=p.howToUseTemplate&&!p.skipHowToUse;if(s||Confluence.Blueprint.hasWizard(u,p)){t.show()}n.resolve()})})}else{Confluence.Blueprint.loadDialog({initContext:d}).done(function(){n.resolve()})}return n.promise()}});AJS.getWindowQueryParams=function(){var h={};if(window.location.search.length>1){var c=window.location.search.substr(1).split("&");for(var e=0;e