';
};
if (goog.DEBUG) {
GH.tpl.rapid.notification.renderGHtvMessage.soyTemplateName = 'GH.tpl.rapid.notification.renderGHtvMessage';
}
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-notification', location = 'includes/js/rapid/ui/notification/Notification.js' */
define("jira-agile/rapid/ui/notification", ["require"], function (e) {
"use strict";
function a(e, a, r) {
return s(i({
body: e,
title: r.showTitle ? a : void 0,
close: r.autoHide ? "auto" : r.closeable ? "manual" : "never",
type: r.type
}))
}
function s(e) {
var a = r(e).find(".title");
return "" === r.trim(a.text()) && a.remove(), e
}
var r = e("jquery"), t = e("underscore"), i = e("aui/flag"), n = e("jira/util/logger"), o = e("jira/analytics"),
d = {
showErrors: function (e) {
var a = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], s = arguments[2],
r = "Error", t = GH.tpl.rapid.notification.renderErrorMessages(e);
d.showError(r, t, a, s)
}, showError: function (e, s) {
var r = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2], i = arguments[3],
n = {autoHide: !1, closeable: r, showTitle: !0, type: "error"};
i = t.extend({}, n, i), a(s, e, i)
}, showWarnings: function (e, s) {
var r = {preRendered: !1, autoHide: !0, closeable: !0, showTitle: !1, type: "warning"};
s = t.extend({}, r, s);
var i = void 0;
i = s.preRendered ? e : GH.tpl.rapid.notification.renderErrorMessages({errors: e}), a(i, "Warning", s)
}, showWarning: function (e) {
d.showWarnings(e, {preRendered: !0})
}, showSuccess: function (e, s) {
var r = {closeable: !0, autoHide: !0, showTitle: !1, type: "success"};
s = t.extend({}, r, s), a(e, null, s)
}, clear: function () {
r("#aui-flag-container").empty()
}, handleDateFormatMismatchError: function (e) {
var a = '';
a += "Advanced Settings", a += "";
var s = AJS.format("It appears your Jira date format settings are misconfigured. Please check the {0} and ensure that \'\'jira.date.time.picker.java.format\'\' and \'\'jira.date.time.picker.javascript.format\'\' have matching output.", a);
d.showWarnings(s, {autoHide: !1, preRendered: !0})
}, auiMessage: function () {
n.warn("[deprecated] GH.Notification.auiMessage has no effect")
}, showIssueMessage: function (e) {
var a = JIRA.SessionStorage, s = null, r = null;
e || (e = a.getItem("selectedIssueId")), e && (r = a.getItem("selectedIssueKey"), s = a.getItem("selectedIssueMsg"), d.showIssueMessageImpl(e, s, r)), a.removeItem("selectedIssueId"), a.removeItem("selectedIssueKey"), a.removeItem("selectedIssueMsg")
}, showIssueMessageImpl: function (e, a, s) {
a || (a = "thanks_issue_updated");
var r = AJS.params[a];
r && s && (r = AJS.format(r, s), d.showSuccess(r))
}, addPageLoadMessage: function (e, a) {
var s = GH.storage.get("gh.pageloadmessages", !0) || [];
s.push({message: e, type: a || "success"}), GH.storage.put("gh.pageloadmessages", s, !0)
}, _displayPageLoadMessages: function () {
var e = GH.storage.get("gh.pageloadmessages", !0);
if (e) {
var a = e[0].type, s = "";
switch (t.each(e, function (e) {
s.length > 0 && (s += " "), s += e.message
}), a) {
case"warning":
d.showWarning(s);
break;
case"success":
default:
d.showSuccess(s)
}
GH.storage.put("gh.pageloadmessages", null, !0)
}
}, showBoardUpdatedMessage: function () {
d.triggerShowMessageAnalytics(), d.clearBoardUpdatedMessage();
var e = r.Deferred(), a = r(GH.tpl.rapid.notification.renderGHtvMessage()).appendTo("#gh");
return a.data("deferred", e), a.find(".js-refresh-now").click(function (s) {
s.preventDefault(), a.removeData("deferred"), d.clearBoardUpdatedMessage(), e.resolve()
}), a.find(".js-ignore-refresh").click(function (e) {
e.preventDefault(), d.clearBoardUpdatedMessage()
}), e.promise()
}, clearBoardUpdatedMessage: function () {
var e = r("#ghx-update-message");
if (e.length) {
var a = e.data("deferred");
a && a.reject && a.reject(), e.remove()
}
}, isBoardUpdatedMessageVisible: function () {
var e = r("#ghx-update-message");
return e.length > 0
}, triggerShowMessageAnalytics: function () {
o.send({
name: "gh.rapidboard.updated.message.show",
properties: {initial: !d.isBoardUpdatedMessageVisible()}
})
}
};
return d
}), AJS.namespace("GH.Notification", null, require("jira-agile/rapid/ui/notification")), AJS.$(document).ready(function () {
GH.Notification.showIssueMessage(), GH.storage && GH.Notification._displayPageLoadMessages()
});
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-underscore', location = 'includes/js/lib/underscore-overrides.js' */
define("_", ["underscore"], function (e) {
return e
});
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-logger', location = 'includes/js/rapid/Logger.js' */
define("jira-agile/rapid/logger", ["underscore", "jira/util/logger"], function (e, t) {
var a = {ajax: "ajax", event: "event", state: "state", ui: "ui", callback: "callback", refresh: "refresh"};
return {
Contexts: a,
enabledContexts: [a.ajax, a.event, a.state, a.ui, a.callback, a.refresh],
log: function (a, i) {
if (!i || e.contains(this.enabledContexts, i)) {
var n = i ? this.pad(i, 6) + ": " + a : a;
t.log(n)
}
},
pad: function (e, t) {
return e.length < t ? e + " ".substr(0, t - e.length) : e
},
timeMap: {},
timeStart: function (e) {
if (!e) throw"start: If starting a timer manually a name must be set";
this.timeMap[e] = (new Date).getTime()
},
timeStop: function (e) {
if (!(e in this.timeMap)) throw"stop:" + e + " not found";
var t = (new Date).getTime() - this.timeMap[e];
delete this.timeMap[e], this.log(t + "ms on " + e, this.Contexts.ui)
}
}
}), AJS.namespace("GH.Logger", null, require("jira-agile/rapid/logger")), AJS.namespace("GH.log", null, require("jira-agile/rapid/logger").log);
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-namespace', location = 'includes/js/gh-namespace.js' */
AJS.namespace("GH.namespace", null, AJS.namespace);
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:events', location = 'includes/js/rapid/Events.js' */
define("jira-agile/rapid/events", ["require"], function (t) {
function n(t) {
return t ? e.extend(t, n.prototype) : t = this, t._bindings = [], t
}
var e = t("underscore");
return n.prototype = {
on: function (t, n, e) {
return e && this._off({type: t, context: e}), this._bindings.push({
type: t,
handler: n,
context: e
}), this
}, off: function (t) {
return e.isString(t) ? this._off({type: t}) : e.isFunction(t) ? this._off({handler: t}) : e.isObject(t) && this._off({context: t}), this
}, _off: function (t) {
this._bindings = e.reject(this._bindings, function (n) {
var e = !t.type || t.type === n.type, i = !t.context || t.context === n.context,
r = !t.handler || t.handler === n.handler;
return e && i && r
})
}, trigger: function (t) {
var n = Array.prototype.slice.call(arguments, 1);
return e.each(this._bindings, function (e) {
e.type === t && e.handler.apply(e.context, n)
}), this
}
}, n
}), AJS.namespace("GH.Events", null, require("jira-agile/rapid/events"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:global-events', location = 'includes/js/rapid/GlobalEvents.js' */
define("jira-agile/rapid/global-events", ["require"], function (e) {
"use strict";
var i = e("jira-agile/rapid/events");
return new i
});
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-config', location = 'includes/js/gh-config.js' */
define("jira-agile/config", [], function () {
"use strict";
var i = {};
return i.isSampleDataAvailable = !1, i
}), AJS.namespace("GH.Config", null, require("jira-agile/config"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:ajax', location = 'includes/js/rapid/Ajax.js' */
define("jira-agile/rapid/ajax", ["jira/util/formatter", "jira/ajs/ajax/smart-ajax", "jira/util/data/meta", "underscore", "wrm/context-path", "jquery", "jira/jquery/deferred"], function (e, r, t, n, o, a, s) {
var u = {};
return u.CONTEXT_PATH = o(), u.REST_URL_BASE = "/rest/greenhopper/1.0", u.PUBLIC_REST_URL_BASE = "/rest/agile/1.0", u.xhrRegistery = {}, u.stallTimeout = 300, u.get = function (e, r) {
a.extend(e, {type: "GET", headers: {"X-Atlassian-GreenHopper-Gadget": !n.isUndefined(GH.gadget)}});
var t = u._executeGet(e, r);
return t.pipe(function (e, r, t) {
return s().resolveWith(this, [e.success, r, t])
})
}, u.post = function (e) {
return e = u._getSettings(e, !0), a.extend(e, {
type: "POST",
contentType: "application/json"
}), u._executeStore(e)
}, u.put = function (e) {
return e = u._getSettings(e, !0), e.type = "PUT", u._executeStore(e)
}, u.del = function (e) {
return e = u._getSettings(e, !0), e.type = "DELETE", u._executeStore(e)
}, u._getSettings = function (e, r) {
return !e.bareUrl && e.url && (e.bareUrl = u.buildRestUrl(e.url)), e.bareUrl && (e.url = e.bareUrl), e.dataType || (e.dataType = "json"), e.data && r && (e.data = JSON.stringify(e.data)), e.contentType = "application/json", e
}, u._getXhrData = function (e) {
var r = {timestamp: 0};
return e && (r = u.xhrRegistery[e] ? u.xhrRegistery[e] : u.xhrRegistery[e] = r), r
}, u._executeGet = function (e, r) {
e = u._getSettings(e);
var t = u._getXhrData(r);
t.xhr && (GH.log("aborting request for " + r, GH.Logger.Contexts.ajax), t.xhr.abort(), delete t.xhr, delete t.xhrAbort, delete t.timeoutId);
var n = t.timestamp;
if (t.timestamp = (new Date).getTime(), t.timestamp - n < u.stallTimeout) {
GH.log("stalling request for " + r + ", time since last request: " + (t.timestamp - n), GH.Logger.Contexts.ajax);
var o, a = s(), i = function () {
o = u._executeGet(e, r), o.done(a.resolve).fail(a.reject)
};
t.timeoutId = window.setTimeout(i, u.stallTimeout), t.xhr = a.promise(), t.xhr.abort = function () {
o ? o.abort.apply(o, arguments) : clearTimeout(t.timeoutId)
}
} else GH.log("executing request for " + r, GH.Logger.Contexts.ajax), t.xhr = u.makeRequest(e);
return t.xhrAbort = t.xhr.abort, t.xhr.abort = function () {
var e = t.xhr, r = t.xhrAbort;
if (e && r) return r.apply(e, arguments)
}, t.xhr.done(function () {
t.xhr && delete t.xhr
}).fail(function () {
t.xhr && delete t.xhr
}), t.xhr
}, u._executeStore = function (e) {
if (e = e || {}, e.data && "string" == typeof e.data && /\?\?/.test(e.data)) {
var r = "\\u003F\\u003F";
e.data = e.data.replace(/\?\?/g, r)
}
return e.dataType = "json", u.makeRequest(e)
}, u.makeRequest = function (e) {
var t = s();
e = n.extend(e, {
success: function () {
t.resolveWith(this, arguments)
}, error: function () {
t.rejectWith(this, arguments)
}
});
var o = t.promise(r.makeRequest(e)), a = o.abort;
o.abort = function (e) {
return o.abortMarker = "timeout" != e, a.apply(o, arguments)
};
var i = o.pipe(u._generateDoneInterceptor(), u._generateFailInterceptor(e.errorsNoAutoEscape));
return e.deferErrorHandling || i.fail(u._generateErrorHandler(e.onGlobalError, e.errorContextMap, e.contextualErrorRenderer, e.globalErrorDismissable)), i
}, u._generateDoneInterceptor = function () {
return function (e, r, t) {
return e = e || {}, e = u._createExtendedResult(e), u.matchesCurrentUser(t) ? e.isSuccess() ? s().resolveWith(this, [e, r, t]) : s().rejectWith(this, [e, t, r, null]) : u._handleCurrentUserChanged(t)
}
}, u._generateFailInterceptor = function (e) {
return function (r, t, n) {
if (r.abortMarker) return s();
if (!u.matchesCurrentUser(r)) return u._handleCurrentUserChanged(r);
var o = {}, a = null;
if (r.responseText) try {
o = JSON.parse(r.responseText)
} catch (e) {
}
return o.errors || o.errorMessages ? a = u._convertJiraErrors(o, e) : o.message && (a = u._convertFrameworkErrors(o)), a || (a = u._convertGenericErrors(r, n)), s().rejectWith(this, [a, r, t, n])
}
}, u.handleContextualErrors = function (e, r, t) {
return r = r || {}, !!e.hasContextualErrors() && (a(e.getContextualErrors()).each(function (n, o) {
var s = r[o.contextId];
if (s) if (a.isFunction(s)) s(o, e); else {
s = a(s), s.siblings(".ghx-error").remove();
var u;
u = t ? t(o) : GH.tpl.rapid.notification.renderContextualErrors({errors: o.errors}), s.after(u)
} else a(o.errors).each(function (r, t) {
e.addGlobalError(t)
})
}), !0)
}, u.handleGlobalErrors = function (e, r, t) {
return !!e.hasGlobalErrors() && (GH.Notification.showErrors({errors: e.getGlobalErrors()}, t), r && r instanceof Function && r(e), !0)
}, u.buildRestUrl = function (e) {
return 0 !== e.indexOf("/") && (e = "/" + e), u.buildBareRestUrl(u.REST_URL_BASE + e)
}, u.buildPublicRestUrl = function (e) {
return 0 !== e.indexOf("/") && (e = "/" + e), u.buildBareRestUrl(u.PUBLIC_REST_URL_BASE + e)
}, u.buildBareRestUrl = function (e) {
return 0 !== e.indexOf("/") && (e = "/" + e), u.CONTEXT_PATH + e
}, u._createExtendedResult = function (e) {
return e ? u._extendResult({success: e}) : u._extendResult({success: !0})
}, u._extendResult = function (e) {
return a.extend(e, {
getGlobalErrors: function () {
return e.error ? e.error.errors : null
}, getContextualErrors: function () {
return e.error ? e.error.contextualErrors : null
}, hasGlobalErrors: function () {
return e.error && e.error.errors && e.error.errors.length > 0
}, hasContextualErrors: function () {
return e.error && e.error.contextualErrors
}, addGlobalError: function (r) {
e.error || (e.error = {}), e.error.errors || (e.error.errors = []), e.error.errors[e.error.errors.length] = r
}, getSuccessObject: function () {
return e.success
}, isSuccess: function () {
return !e.error
}
})
}, u._generateErrorHandler = function (e, r, t, n) {
return function (o) {
u.handleContextualErrors(o, r, t), u.handleGlobalErrors(o, e, n)
}
}, u._convertJiraErrors = function (e, r) {
var t = e.errorMessages ? e.errorMessages : [];
t = n.map(t, function (e) {
return {message: e, noAutoescape: r}
});
var o = e.errors ? e.errors : {};
o = n.map(o, function (e, t) {
return {contextId: t, errors: [{message: e, noAutoescape: r}]}
});
var a = {error: {errors: t, contextualErrors: o}};
return u._extendResult(a)
}, u._convertFrameworkErrors = function (e) {
var r = {error: {errors: [{message: e.message}], contextualErrors: []}};
return u._extendResult(r)
}, u._convertGenericErrors = function (r, t) {
var n = u._extendResult({});
return r.responseText && GH.log("Got an error response with text that we don't know how to parse: " + r.responseText), 504 === r.status || 0 === r.status && a.contains(["abort", "timeout"], t) ? n.addGlobalError({
status: 504,
message: e.I18n.getText("gh.ajax.error.timeout")
}) : t ? n.addGlobalError({
status: r.status,
message: t
}) : GH.log("Got an Ajax request error response with empty 'errorThrown' value. Silently logging"), n
}, u._hasUsernameResponseHeader = function (e) {
return !!e.getResponseHeader("X-AUSERNAME")
}, u._getUserForResponse = function (e) {
return e.getResponseHeader("X-AUSERNAME") ? decodeURIComponent(e.getResponseHeader("X-AUSERNAME")) : "anonymous"
}, u.getUserFromAJS = function () {
var e = t.get("remote-user");
return e ? e : "anonymous"
}, u.matchesCurrentUser = function (e) {
return !e.getResponseHeader || !e.getAllResponseHeaders || !u._hasUsernameResponseHeader(e) || u.getUserFromAJS() === u._getUserForResponse(e) || 204 === e.status && !e.getAllResponseHeaders() && a.browser.msie
}, u._handleCurrentUserChanged = function (e) {
var r = u.getUserFromAJS(), t = u._getUserForResponse(e);
return "anonymous" !== r && "anonymous" === t ? (GH.log("User changed. original: " + r + " new: " + t + ". Redirecting to the login page"), location.href = GH.Navigation.getLoginUrl()) : (GH.log("User changed. original: " + r + " new: " + t + ". Reloading the page"), location.reload()), s()
}, u
}), AJS.namespace("GH.Ajax", null, require("jira-agile/rapid/ajax"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:storage', location = 'includes/js/rapid/state/storage.js' */
define("jira-agile/rapid/state/storage", [], function () {
"use strict";
var e = {};
return e.get = function (e, t) {
var r = void 0;
if (r = t ? sessionStorage.getItem(e) : localStorage.getItem(e), "string" != typeof r) return r;
try {
return JSON.parse(r)
} catch (e) {
return GH.log("GH.storage: Caught error: " + e), void GH.log("GH.storage: Cannot parse json string retrieved from " + (t ? "session" : "local") + " storage. Ignoring value " + r)
}
}, e.put = function (e, t, r) {
if (null === t || void 0 === t) r ? sessionStorage.removeItem(e) : localStorage.removeItem(e); else try {
r ? sessionStorage.setItem(e, JSON.stringify(t)) : localStorage.setItem(e, JSON.stringify(t))
} catch (e) {
return !1
}
return !0
}, window.localStorage && window.sessionStorage || (e.get = function () {
return null
}, e.put = function () {
return !1
}), e
}), AJS.namespace("GH.storage", null, require("jira-agile/rapid/state/storage"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:validation', location = 'includes/js/rapid/Validation.js' */
define("jira-agile/rapid/validation", ["jira/util/formatter", "jquery"], function (r, t) {
var n = {};
return n.notBlank = function (r, e, a) {
var i = n.applyRules(r, e, a, function () {
return t.trim(t(r).val()).length > 0
});
return i
}, n.maxLength = function (r, e, a, i) {
var o = n.applyRules(r, a, i, function () {
return t.trim(t(r).val()).length <= e
});
return o
}, n.isPositiveInteger = function (r, e, a) {
var i = n.applyRules(r, e, a, function () {
return /^\d*$/.test(t.trim(t(r).val()))
});
return i
}, n.applyRules = function (r, e, a, i) {
r = t(r);
var o = a ? t(a) : r, l = i.call(this);
return !!l || (n.showContextualErrors(o, e), !1)
}, n.showContextualErrors = function (t, e, a, i, o) {
n.clearContextualErrors(t), t.after(GH.tpl.rapid.notification.renderContextualErrors({errors: [{message: r.I18n.getText(e, a, i, o)}]}))
}, n.clearContextualErrors = function (r) {
r = t(r), r.find(".ghx-error").remove(), r.siblings(".ghx-error").remove()
}, n
}), AJS.namespace("GH.Validation", null, require("jira-agile/rapid/validation"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:help-paths', location = 'includes/js/gh-helppaths.js' */
AJS.namespace("GH.HelpPaths"), GH.HelpPaths.getHelpPath = function (e) {
return null
};
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:message', location = 'includes/js/gh-message.js' */
define("jira-agile/message", ["jira/util/logger"], function (e) {
"use strict";
var a = {};
return a.showIssueMessage = function () {
e.warn("[deprecated] GH.Message.showIssueMessage has no effect, @see module:jira-agile/rapid/ui/notification")
}, a.showSuccess = function () {
e.warn("[deprecated] GH.Message.showSuccess has no effect, @see module:jira-agile/rapid/ui/notification")
}, a.showWarning = function () {
e.warn("[deprecated] GH.Message.showWarning has no effect, @see module:jira-agile/rapid/ui/notification")
}, a.showPersistentWarning = function () {
e.warn("[deprecated] GH.Message.showPersistentWarning has no effect, @see module:jira-agile/rapid/ui/notification")
}, a
}), AJS.namespace("GH.Message", null, require("jira-agile/message"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:util', location = 'includes/js/rapid/Util.js' */
define("jira-agile/rapid/util", ["underscore", "jquery"], function (e, r) {
var n = {};
return n.getPluginKey = function () {
return r('meta[name="ghx-plugin-key"]').attr("content")
}, n.wrapPreventDefault = function (e, r) {
return function (n) {
return n.preventDefault(), e.apply(r || this, arguments)
}
}, n.andThenSplice = function () {
return {_needsSplice: Array.prototype.slice.call(arguments)}
}, n.andThen = function (n) {
var t = [{trigger: "resolveWith", on: "done", filter: arguments[1]}, {
trigger: "rejectWith",
on: "fail",
filter: arguments[2]
}, {trigger: "notifyWith", on: "progress", filter: arguments[3]}];
return r.Deferred(function (r) {
e.each(t, function (t) {
var i = t.on, a = t.trigger, o = e.isFunction(t.filter) && t.filter;
n[i](function () {
var n = o && o.apply(this, arguments);
if (n && e.isFunction(n.promise)) n.promise().done(r.resolve).fail(r.reject).progress(r.notify); else {
var t;
t = n && e.isArray(n._needsSplice) ? n._needsSplice : o ? [n] : arguments, r[a](e.isFunction(this.promise) ? r.promise() : this, t)
}
})
})
}).promise()
}, r._OriginalDeferred = r.Deferred, r.Deferred = function (e) {
return r._OriginalDeferred(function (r) {
r.andThen = function () {
var e = Array.prototype.slice.call(arguments);
return e.unshift(r), n.andThen.apply(this, e)
};
var t = r.promise;
r.promise = function () {
var e = t.apply(this, arguments);
return e.andThen = function () {
var r = Array.prototype.slice.call(arguments);
return r.unshift(e), n.andThen.apply(this, r)
}, e
}, e && e.call(r, r)
})
}, n.indexOf = function (r, n, t) {
var i = -1;
return t && (r = r.slice().reverse()), e.some(r, function (e, a) {
return !!n(e, a) && (i = t ? r.length - 1 - a : a, !0)
}), i
}, n.swapArrayItems = function (e, r, n) {
var t;
return !!(e && r !== n && Math.min(r, n) >= 0 && Math.max(r, n) < e.length) && (t = e[n], e[n] = e[r], e[r] = t, !0)
}, n.roundToDecimalPlaces = function (e, r) {
if ("number" != typeof e || e === Math.round(e)) return e;
if (0 === r) return Math.round(e);
var n = e.toString();
if (n.indexOf("e") >= 0) return e;
var t = e < 0, i = n.split("."), a = +i[1].charAt(r);
if (i[1] = i[1].substr(0, r), a > 5 || !t && 5 === a) {
var o = /^0*/.exec(i[1])[0];
i[1] = o + (+i[1] + 1), i[1].length > r && (o ? i[1] = i[1].substr(i[1].length - r) : (i[0] = +i[0] + 1, i[1] = 0))
}
return parseFloat(i.join("."))
}, n
}), AJS.namespace("GH.Util", null, require("jira-agile/rapid/util"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:user-data', location = 'includes/js/rapid/UserData.js' */
define("jira-agile/rapid/user-data", ["jira/util/data/meta"], function (e) {
var r = {};
return r.remoteUser = e.get("remote-user"), r.loggedIn = !!r.remoteUser, r.hasUser = function () {
return r.loggedIn
}, r.getUserName = function () {
return r.remoteUser
}, r.canCreateProject = function () {
return r.userConfig.canCreateProject
}, r.setGlobalConfig = function (e) {
r.quickCreateDefaultIssueTypeId = e.quickCreateDefaultIssueTypeId, r.userConfig = e.userConfig, r.userConfig && r.userConfig.canCreateProject && (r.userConfig.canCreateProject = !GH.Features.DISABLE_CREATE_PROJECT.isEnabled())
}, r
}), AJS.namespace("GH.UserData", null, require("jira-agile/rapid/user-data"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:features', location = 'includes/js/gh-features.js' */
define("jira-agile/gh-features", ["jira/ajs/dark-features"], function (e) {
"use strict";
function a(e) {
this.featureKey = e, this.featureEmergencyDisabledKey = e + ".emergencyDisabled"
}
return a.prototype.isEnabled = function () {
return e.isEnabled(this.featureKey) && !e.isEnabled(this.featureEmergencyDisabledKey)
}, Object.freeze({
DISABLE_CREATE_PROJECT: new a("jag.DISABLE_CREATE_PROJECT"),
EDITABLE_DETAIL_VIEW_ENABLED: new a("com.atlassian.jira.agile.darkfeature.editable.detailsview"),
SPLIT_ISSUE: new a("com.atlassian.jira.agile.darkfeature.splitissue")
})
}), AJS.namespace("GH.Features", null, require("jira-agile/gh-features"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:navigation', location = 'includes/js/gh/navigation/Navigation.js' */
define("jira-agile/rapid/navigation", ["wrm/context-path"], function (a) {
"use strict";
var n = {};
return n.gotoDefaultRapidBoardPage = function (a, i) {
window.location.href = n.getDefaultRapidBoardPageUrl(a, i)
}, n.getDefaultRapidBoardPageUrl = function (a, i) {
var e = _.isUndefined(i) ? "" : "&view=" + i;
return n.getCanonicRapidBoardPageUrl(a) + e
}, n.getCanonicRapidBoardPageUrl = function (n) {
return a() + "/secure/RapidBoard.jspa?rapidView=" + n
}, n.getLoginUrl = function () {
return a() + "/login.jsp?os_destination=" + encodeURIComponent(window.location.href)
}, n.updateWindowLocation = function (a) {
return window.location.assign(a)
}, n
}), AJS.namespace("GH.Navigation", null, require("jira-agile/rapid/navigation"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-dialog', location = 'includes/js/dialog/dialog.js' */
AJS.namespace("GH.Dialog"), GH.Dialog.baseExtension = {
_getDefaultOptions: function () {
return AJS.$.extend(this._super(), {
onDialogFinished: function () {
this.handleSuccess()
}
})
}, _performRedirect: function () {
this.redirected = !0, this.handleSuccess()
}, hide: function (e, n) {
return JIRA.Dialog.current === this && (this._super(e), void (n === !0 || !n || n.reason !== JIRA.Dialog.HIDE_REASON.escape && n.reason !== JIRA.Dialog.HIDE_REASON.cancel || this.doCancelCleanup()))
}, doCancelCleanup: function () {
}, handleSuccess: function () {
}
};
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-dialog', location = 'includes/js/rapid/ops/DialogExtension.js' */
AJS.namespace("GH.Dialog.XBoardExtension"), GH.Dialog.XBoardExtension.getActionInfo = function (e) {
var t = "workflow-transition-", a = e.options.id;
return a.substring(0, t.length) === t ? {
formId: a,
isTransition: !0,
transitionId: a.substring(t.length)
} : {formId: a, isTransition: !1}
}, GH.Dialog.XBoardExtension.handleSuccess = function () {
GH.IssueOperationShortcuts.clearOverrideSelectedIssue(), this.hide(!0, !0), this._hideloadingIndicator();
var e = GH.Dialog.XBoardExtension.getActionInfo(this), t = GH.IssueOperationShortcuts.getSelectedIssueId(),
a = GH.IssueOperationShortcuts.getSelectedIssueKey();
GH.WorkController.isActive() ? GH.Dialog.handleWorkModeUpdate(t, a, e) : GH.PlanController.isActive() && GH.Dialog.handlePlanModeUpdate(t, a, e), AJS.$(GH).trigger("issueTransitioned", {issueId: t}), GH.Notification.showIssueMessage(t), GH.WorkDragAndDrop.transitionTargetStatus = void 0
}, GH.Dialog.handlePlanModeUpdate = function (e, t, a) {
if (!GH.IssueOperationShortcuts.isOverrideSelectedIssueActive()) {
var o = 0, r = null, s = GH.BacklogModel.findModelWithIssue(t);
s && (GH.SprintModel.isSprintModel(s) && (r = s.getSprintId()), o = s.getIssueList().getIssueIndex(t)), GH.PlanController.reload(function () {
var e = GH.BacklogSelectionController.getSelectedIssueKey();
if (!e) {
var t = null;
r && (t = GH.BacklogModel.getSprintModel(r)), t || (t = GH.BacklogModel.getBacklogModel2()), GH.BacklogSelectionController.selectIssue(t.getIssueList().getIssueKeyAtIndex(o))
}
})
}
}, GH.Dialog.handleWorkModeUpdate = function (e, t, a) {
var o = GH.Dialog.createParentCompletedCheckCallback(t),
r = GH.Dialog.createSelectMostAppropriateIssueCallback(t);
if (a.isTransition) if (GH.WorkDragAndDrop.transitionTargetStatus) {
var s = GH.WorkDragAndDrop.transitionTargetStatus, n = GH.GridDataController.getModel(),
i = n.getIssueDataByKey(t), l = n.getIssuePositionByKey(t), d = n.getColumns(), u = l.columnId,
c = GH.GridColumnsData.getColumnIdForStatus(d, s);
n.moveIssueToColumn(t, u, c), i.status = s, n.updateIssueData(i), GH.SwimlaneView.rerenderCell(l.swimlaneId, u), GH.SwimlaneView.rerenderCell(l.swimlaneId, c), o()
} else GH.CallbackManager.registerCallback(GH.WorkController.CALLBACK_POOL_LOADED, "ParentWithAllSubsCompletedCheck", o);
GH.CallbackManager.registerCallback(GH.WorkController.CALLBACK_POOL_LOADED, "SelectMostAppropriateIssueCallback", r), GH.WorkController.reload()
}, GH.Dialog.createParentCompletedCheckCallback = function (e) {
return function () {
var t = GH.GridDataController.getModel();
if (!_.isUndefined(t.data.issues[e]) && !_.isUndefined(t.data.issues[e].parentKey)) {
var a = t.data.issues[e].parentKey;
if (_.contains(t.data.columnIssueMapping[_.last(t.data.columns).id], e)) {
var o = t.data.columnIssueMapping[_.last(t.data.columns).id],
r = _.toArray(t.data.issues).reduce(function (e, t) {
return o.indexOf(t.key) > -1 ? e : e.concat(t.key)
}, []), s = _.find(r, function (e) {
return t.data.issues[e].parentKey === a
});
s || GH.WorkController.resolveParentTask(t.data.issues[a])
}
}
}
}, GH.Dialog.createSelectMostAppropriateIssueCallback = function (e) {
var t = GH.GridDataController.getModel().getIssuePositionByKey(e);
return function () {
var a = GH.GridDataController.getModel().getIssueDataByKey(e);
if (!a) {
var o = GH.GridDataController.getModel().getIssueKeyAtPosition(t);
o ? (GH.WorkSelectionController.selectIssue(o, {
pushState: !1,
dontUpdateUI: !0
}), GH.RapidBoard.State.replaceState()) : (GH.WorkSelectionController.selectIssue(void 0, {
pushState: !1,
dontUpdateUI: !0
}), GH.RapidBoard.State.replaceState())
}
}
}, GH.Dialog.XBoardExtension.doCancelCleanup = function () {
GH.IssueOperationShortcuts.clearOverrideSelectedIssue(), GH.WorkDragAndDrop.transitionTargetStatus = void 0
};
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-dialog', location = 'includes/js/dialog/form-dialog.js' */
AJS.namespace("GH.FormDialog"), GH.FormDialog = JIRA.FormDialog.extend(GH.Dialog.baseExtension), GH.FormDialog = GH.FormDialog.extend(GH.Dialog.XBoardExtension);
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-dialog', location = 'includes/js/dialog/labels-dialog.js' */
define("jira-agile/dialog/labels-dialog", ["jira/dialog/labels-dialog"], function (i) {
var n = i.extend(GH.Dialog.baseExtension);
return n = n.extend(GH.Dialog.XBoardExtension), n = n.extend({
_handleSubmitResponse: function (i, n, t) {
this.serverIsDone && (this.options.onSuccessfulSubmit && this.options.onSuccessfulSubmit.call(this, i, n, t), this.options.autoClose && this.hide(), this.options.onDialogFinished && this.options.onDialogFinished.call(this, i, n, t))
}, decorateContent: function () {
this._super();
var i = this.get$popupContent(), n = i.find("input[name=customFieldId]");
if (1 === n.length) {
var t = i.find("#hint");
t.hide()
}
}
})
});
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-dialog', location = 'includes/js/rapid/ui/dialog/DialogUtil.js' */
!function () {
AJS.namespace("GH.Dialog");
var n = require("aui/dialog");
GH.Dialog.create = function (e) {
AJS.$("#" + e.id).remove(), e = _.defaults(e, {bindEscape: !0});
var i = new n(e), a = i.show, o = function () {
GH.Dialog.preShow(), a.call(i);
var n = AJS.$("#" + e.id).find(".dialog-button-panel .aui-button");
n.is(":enabled") && n.focus(), AJS.$("#" + e.id).addClass("ghx-dialog")
};
return _.extend(i, {
dispose: GH.Dialog.generateCloseHandler(i),
cancel: GH.Dialog.generateCloseHandler(i, e.onCancelFn),
submit: GH.Dialog.generateCloseHandler(i, e.onConfirmFn),
show: o,
disableControls: GH.Dialog.generateDisableControlsFn(i),
enableControls: GH.Dialog.generateEnableControlsFn(i),
showSpinner: GH.Dialog.generateShowSpinnerFn(i),
hideSpinner: GH.Dialog.generateHideSpinnerFn(i)
}), GH.Dialog.bindEscapeHandler(i, !e.bindEscape), i
}, GH.Dialog.addCancelButton = function (n) {
n.addCancel("Cancel", function (e) {
n.cancel(n)
})
}, GH.Dialog.bindEscapeHandler = function (n, e) {
e ? JIRA.bind("Dialog.beforeHide", function (e, i, a, o) {
o === n.id && a === JIRA.Dialog.HIDE_REASON.escape && e.preventDefault()
}) : AJS.$(document).bind("keyup." + n.id, function (e) {
27 == e.keyCode && n.cancel(n)
})
}, GH.Dialog.generateCloseHandler = function (n, e) {
return function () {
return n.remove(), GH.Dialog.undim(), AJS.$(document).unbind("keyup." + n.id), AJS.unbind("remove.dialog"), e && e(n), !1
}
}, GH.Dialog.generateDisableControlsFn = function (n) {
return function () {
AJS.$("#" + n.id + " button").attr("disabled", "disabled")
}
}, GH.Dialog.generateEnableControlsFn = function (n) {
return function () {
AJS.$("#" + n.id + " button").removeAttr("disabled")
}
}, GH.Dialog.generateShowSpinnerFn = function (n) {
return function () {
AJS.$("#" + n.id).find(".button-panel-cancel-link").css("visibility", "hidden").before('')
}
}, GH.Dialog.generateHideSpinnerFn = function (n) {
return function () {
AJS.$("#" + n.id).find(".ghx-spinner").remove().end().find(".button-panel-cancel-link").css("visibility", "visible")
}
}, GH.Dialog.sanitizeAJSDim = function () {
var n = AJS.dim;
AJS.dim = function () {
try {
n.apply(this, arguments)
} catch (n) {
}
}
}, GH.Dialog.registerDialog = function (n, e, i) {
AJS.$(document).undelegate(n, "click").delegate(n, "click", function (n) {
var a = AJS.$(this);
a.hasClass("disabled") || (n.preventDefault(), e(n, i))
})
}, GH.Dialog.dim = function () {
AJS.dim(), AJS.$(".aui-blanket").html('
')
}, GH.Dialog.undim = function () {
AJS.undim(), AJS.$(".aui-blanket").empty()
}, GH.Dialog.preShow = function () {
AJS.$(".aui-blanket").empty()
}
}();
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-persistent-messages', location = 'includes/js/rapid/ui/persistent-messages/CreateViewMessage.js' */
AJS.namespace("GH.PersistentMessages.CreateViewMessage"), GH.PersistentMessages.CreateViewMessage = {}, GH.PersistentMessages.CreateViewMessage.setView = function (e, s, a, t) {
var r = {id: e, name: s, type: a, subType: t};
GH.storage.put("gh.createViewMessage", r, !0)
}, GH.PersistentMessages.CreateViewMessage.clear = function () {
GH.storage.put("gh.createViewMessage", null, !0)
}, GH.PersistentMessages.CreateViewMessage.renderMessage = function (e) {
e && GH.log(e.type + " handled", "GH.PersistentMessages.CreateViewMessage.renderMessage");
var s = GH.storage.get("gh.createViewMessage", !0);
if (s) {
var a = null;
s.name = AJS.escapeHTML(String(s.name));
var t;
"advanced" == s.type ? t = GH.tpl.board.x.renderCreateViewMessage : "kanban" == s.subType ? t = GH.tpl.board.x.renderWelcomeViewMessageKanban : "scrum" == s.subType && (t = GH.tpl.board.x.renderWelcomeViewMessageScrum), a = t({
rapidView: s,
url: AJS.parseUri(window.location.href)
}), GH.Notification.showSuccess(a, {
title: "Success",
timeout: 1e4
}), GH.PersistentMessages.CreateViewMessage.clear()
}
};
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-persistent-messages', location = 'includes/js/rapid/ui/persistent-messages/WelcomeMessage.js' */
AJS.namespace("GH.PersistentMessages.WelcomeMessage"), GH.PersistentMessages.WelcomeMessage = {}, GH.PersistentMessages.WelcomeMessage.show = function (e) {
GH.storage.put("gh.welcomeMessage", e, !0)
}, GH.PersistentMessages.WelcomeMessage.renderMessage = function () {
var e = GH.storage.get("gh.welcomeMessage", !0);
if (e) {
var s = null;
e.rapidView.name = AJS.escapeHTML(String(e.rapidView.name)), e.project.name = AJS.escapeHTML(String(e.project.name));
var a = null;
/kanban/.test(e.preset) ? a = e.sample ? GH.tpl.board.x.renderWelcomeProjectSampleMessageKanban : GH.tpl.board.x.renderWelcomeProjectMessageKanban : /scrum/.test(e.preset) && (a = e.sample ? GH.tpl.board.x.renderWelcomeProjectSampleMessageScrum : GH.tpl.board.x.renderWelcomeProjectMessageScrum), s = a({
project: e.project,
rapidView: e.rapidView,
url: AJS.parseUri(window.location.href)
}), GH.Notification.showSuccess(s, {
title: "Success",
timeout: 1e4
}), GH.storage.put("gh.welcomeMessage", null, !0)
}
};
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-project-picker', location = 'includes/js/projects/project-picker.js' */
define("jira-agile/projects/project-picker", [], function () {
"use strict";
var t = function (t) {
if (!t || !t.selector) throw new Error("Project picker requires a selector");
this.$select = AJS.$(t.selector), t.currentProjectId && (this.currentProjectId = t.currentProjectId, this.currentProject = null), this.multiselect = new AJS.MultiSelect({
element: this.$select,
width: 300,
itemAttrDisplayed: "label",
ajaxOptions: {url: GH.Ajax.buildRestUrl("/project.json"), formatResponse: this._processAjax.bind(this)}
}), "function" == typeof t.change && (this.$select.bind("unselect", t.change), this.$select.bind("change", t.change)), this.currentProjectId && this.multiselect.requestSuggestions(!0).done(function () {
this.currentProject && this.multiselect.addItem(this._getProjectDescriptor(this.currentProject))
}.bind(this))
};
return t.prototype.show = function () {
AJS.warn("ProjectPicker.show is deprecated. It is no longer needed as all initialisation occurs in the constructor")
}, t.prototype.hasValue = function () {
return !!this.$select.val()
}, t.prototype.hasErrors = function () {
return this.multiselect.$container.parent().find(".error").length > 0
}, t.prototype.getValue = function () {
return this.$select.val()
}, t.prototype.getElement = function () {
return this.$select
}, t.prototype._findProject = function (t, e) {
return (t || []).filter(function (t) {
return e && t.id === e
}.bind(this))[0]
}, t.prototype._findUnmatchingProjects = function (t, e) {
return (t || []).filter(function (t) {
return !e || t.id !== e
}.bind(this))
}, t.prototype._processAjax = function (t) {
if (!t || !t.projects || !t.projects.length) return [];
this.currentProject = this._findProject(t.projects, this.currentProjectId);
var e = this._findUnmatchingProjects(t.projects, this.currentProjectId).map(this._getProjectDescriptor.bind(this));
return this.currentProject ? [this._getProjectDescriptor(this.currentProject)].concat(e) : e
}, t.prototype._getProjectDescriptor = function (t) {
if (!t) throw new Error("ProjectPicker.prototype._getProjectDescriptor requires a project");
return new AJS.ItemDescriptor({
value: t.id + "",
label: t.displayName,
html: AJS.escapeHTML(String(t.displayName))
})
}, t
}), AJS.namespace("GH.ProjectPicker", null, require("jira-agile/projects/project-picker"));
} catch (e) {
WRMCB(e)
}
;
;
try {
/* module-key = 'com.pyxis.greenhopper.jira:gh-create-board', location = 'includes/js/rapid/ui/startwizard/WizardView.soy' */
// This file was automatically generated from WizardView.soy.
// Please don't edit this file by hand.
/**
* @fileoverview Templates in namespace GH.tpl.startwizard.
*/
if (typeof GH == 'undefined') {
var GH = {};
}
if (typeof GH.tpl == 'undefined') {
GH.tpl = {};
}
if (typeof GH.tpl.startwizard == 'undefined') {
GH.tpl.startwizard = {};
}
GH.tpl.startwizard.renderMethodologySelectionStep = function (opt_data, opt_ignored) {
return '';
};
if (goog.DEBUG) {
GH.tpl.startwizard.renderMethodologySelectionStep.soyTemplateName = 'GH.tpl.startwizard.renderMethodologySelectionStep';
}
GH.tpl.startwizard.renderMethodSelectionStep = function (opt_data, opt_ignored) {
return '
';
};
if (goog.DEBUG) {
GH.tpl.startwizard.renderMethodSelectionStep.soyTemplateName = 'GH.tpl.startwizard.renderMethodSelectionStep';
}
GH.tpl.startwizard.renderProjectSelectionStep = function (opt_data, opt_ignored) {
return '
';
};
if (goog.DEBUG) {
GH.tpl.startwizard.renderProjectSelectionStep.soyTemplateName = 'GH.tpl.startwizard.renderProjectSelectionStep';
}
GH.tpl.startwizard.renderFilterSelectionStep = function (opt_data, opt_ignored) {
return '
' + soy.$$escapeHtml('Saved Filters') + '
' + soy.$$escapeHtml('Choose from a list of existing filters as a base for your new board. To create a new Saved Filter, save a search in the Issue Navigator.') + '
';
};
if (goog.DEBUG) {
GH.tpl.startwizard.renderFilterSelectionStep.soyTemplateName = 'GH.tpl.startwizard.renderFilterSelectionStep';
}
GH.tpl.startwizard.renderProjectCreationStep = function (opt_data, opt_ignored) {
return '
' + soy.$$escapeHtml('Creating a project') + '
' + soy.$$escapeHtml('A board will be created with your project, and will be named after your project. You can rename your board in the board configuration screen.') + '
';
};
if (goog.DEBUG) {
GH.tpl.startwizard.renderProjectCreationStep.soyTemplateName = 'GH.tpl.startwizard.renderProjectCreationStep';
}
GH.tpl.startwizard.renderPermissionInfo = function (opt_data, opt_ignored) {
return '