//! Modifications by Arian K and Lane B var splatoon = true; if(innerWidth <= 480 || navigator.userAgent.indexOf('Nintendo') > 0) { splatoon = false; } //var loading_animate = false; var loading_animate = true; var pjax_container = '#container'; // Edge lies about being WebKit but it works anyway // Edit: This used to match 'WebKit' but it's now Gecko because WebKit will have that in here anyway var webkit = navigator.userAgent.indexOf('WebKit') > 0 || navigator.userAgent.indexOf('Firefox') > 0; var fixe = false; function openDrawboardModal() { if(innerWidth <= 800) { fixe = true; } var g = new Olv.ModalWindow($('#memo-drawboard-page'));g.open(); //fixe = false; return true; } function setupPostForm2() { var letters = ["a", "b", "c", "d", "e"]; // lazy as fuck but who cares lol $("label.textarea-menu-memo > input").on("click", function(e) { if (openDrawboardModal()) { var menu = $("div.textarea-with-menu"); var memo = $("div.textarea-memo"); var text = $("div.textarea-container"); var poll = $("div.textarea-poll"); if (menu.hasClass("active-text") || menu.hasClass("active-poll")) { menu.removeClass("active-text"); menu.removeClass("active-poll"); menu.addClass("active-memo"); memo.removeClass("none"); text.addClass("none"); poll.addClass("none"); } Olv.Form.toggleDisabled($("input.post-button"), false); setupDrawboard(); } }); $("label.textarea-menu-text").on("click", switchtext); //$("label.textarea-menu-poll").on("click", switchpoll); //$('button.add-option').on('click', addOption); //$('button.delete').on('click', deleteOption); $(".post-button").on("click", switchtext); function switchtext() { var menu = $("div.textarea-with-menu"); menu.removeClass("active-memo"); menu.removeClass("active-poll"); menu.addClass("active-text"); $("div.textarea-container").removeClass("none"); $("div.textarea-memo").addClass("none"); $("div.textarea-poll").addClass("none"); $("textarea[name=body]").attr("data-required", ""); //Olv.EntryForm.setupFormStatus($("#post-form"), d); } /* 'Commented because it\'s broken' function switchpoll() { var menu = $("div.textarea-with-menu"); menu.removeClass("active-text"); menu.removeClass("active-memo"); menu.addClass("active-poll"); $("div.textarea-poll").removeClass("none"); $("div.textarea-container").removeClass("none"); $("div.textarea-memo").addClass("none"); $("textarea[name=body]").removeAttr("data-required"); Olv.EntryForm.setupFormStatus($("#post-form"), d); } function addOption() { var options = $(".option").length; // lol it's Nintendo Switch switch(options) { case 2: $(this).before(''); $(".delete").removeClass("none"); break; case 3: $(this).before(''); break; case 4: $(this).before(''); $(this).attr("disabled", "true"); break; default: $('.textarea-poll').html(''); $("button.add-option").on("click", addOption); break; } $("button.delete").off("click"); $("button.delete").on("click", deleteOption); Olv.EntryForm.setupFormStatus($("#post-form"), d); } function deleteOption() { var options = $(".option").length; if(options == 5 || options == 4) { $(".add-option").removeAttr("disabled"); $(".option[name=" + $(this).attr("option") + "]").remove(); $(this).remove(); for(var i = 0; i < options - 1; i++) { $(".option").eq(i).attr("name", "option-" + letters[i]); $(".option").eq(i).attr("placeholder", "Option " + letters[i].toUpperCase()); $(".delete").eq(i).attr("option", "option-" + letters[i]); } } else if(options == 3) { $(".option[name=" + $(this).attr("option") + "]").remove(); $(this).remove(); for(var i = 0; i < options - 1; i++) { $(".option").eq(i).attr("name", "option-" + letters[i]); $(".option").eq(i).attr("placeholder", "Option " + letters[i].toUpperCase()); $(".delete").not(this).eq(i).attr("option", "option-" + letters[i]); } $(".delete").addClass("none"); } else { $('.textarea-poll').html(''); $("button.add-option").on("click", addOption); $("button.delete").on("click", deleteOption); } Olv.EntryForm.setupFormStatus($("#post-form"), d); } */ } //!© Nintendo/Hatena 2012-2017 copyright@hatena.com var Olv = Olv || {}; (function(a, b) { b.init || (b.init = a.Deferred(function() { a(this.resolve) }).promise(), b.Router = function() { this.routes = [], this.guard = a.Deferred() } , a.extend(b.Router.prototype, { connect: function(a, b) { a instanceof RegExp || (a = new RegExp(a)), this.routes.push([a, b]) }, dispatch: function(b) { a("#global-menu-list > ul > li.selected").removeClass("selected"); this.guard.resolve(b), this.guard = a.Deferred(); for (var c, d = b.pathname, e = 0; c = this.routes[e]; e++) { var f = d.match(c[0]); f && c[1].call(this, f, b, this.guard.promise()) } } }), b.router = new b.Router, a(document).on("pjax:end", function(c, d) { a(document).trigger("olv:pagechange", [d]), b.router.dispatch(location) }), b.init.done(function() { b.init.done(function() { b.router.dispatch(location) }) }), b.Locale = { Data: {}, text: function(a) { var c = Array.prototype.slice.call(arguments); return c.splice(1, 0, -1), b.Locale.textN.apply(this, c) }, textN: function(a, c) { //if (b.Cookie.get("plain_msgid")) // return a; c = +c || 0; var d = b.Locale.Data[a]; if (!d) return a; var e, f, g = d.quanttype || "o", h = "1_o" === g && 1 === c || "01_o" === g && (0 === c || 1 === c); if (h ? (e = d.text_value_1 || d.value_1, f = d.text_args_1 || d.args_1) : (e = d.text_value || d.value, f = d.text_args || d.args), !f) return e; var i = Array.prototype.slice.call(arguments, 2) , j = 0; return e.replace(/%s/g, function() { return i[f[j++] - 1] }) } }, b.loc = b.Locale.text, b.loc_n = b.Locale.textN, b.print = function(a) { "undefined" != typeof console && console.log(a) } , b.deferredAlert = function(b) { var c = a.Deferred(); return setTimeout(function() { alert(b), c.resolve() }, 0), c.promise() } , b.deferredConfirm = function(b) { var c = a.Deferred(); return setTimeout(function() { var a = confirm(b); c.resolve(a) }, 0), c.promise() } , b.Closed = { blank: /^[\s\u00A0\u3000]*$/, open_spinner: '', lights: function() { $('#darkness').prop('disabled',function(a,b){return !b}) Olv.Form.get('/lights') }, prlinkConf: function() { if(ass.includes(location.origin)) { $('#container').prepend('
Are you sure you want to go to '+ass+' on this site?
You are now exiting the '+brand_name+' website.
Are you sure you want to visit '+ass+'?
You are about to download a file.
Are you sure you want to download '+ass+'?
" + b.SimpleDialog.htmlLineBreak(a.responseText) + "\n";
/*if(innerWidth <= 480) {
errmsg += a.responseText.substr(0, 400);
} else {
errmsg += a.responseText.substr(0, 1000);
}*/
}
return {
error_code: "Internal server error",
message: errmsg
}
break;
case 503:
return {
error_code: "Service temporarily unavailable",
message: "Unfortunately, it's down now. Come back later, or try reloading for now.\n"
}
break;
case 420:
return {
error_code: "Service is probably down",
message: "You've just recieved an error code that's usually recieved after a shutdown or some kind of service downage. So, don't refresh!\n"
}
break;
case 502:
return {
error_code: "Bad gateway",
message: "There's an issue with the application server right now. Wait for it to come back later, and inform an admin about this (because they probably don't do and therefore cannot fix it).\n"
}
break;
case 521:
return {
error_code: "Web server is down",
message: "Oops, something has probably gone terminally wrong. Come back later?\n"
}
break;
default:
return e ? 500 > e ? {
error_code: e,
message: b.loc("olv.portal.error.failed_to_connect.for_offdevice")
} : {
error_code: 1219999,
message: b.loc("olv.portal.error.500.for_offdevice")
} : {
error_code: "Connection error",
message: "Couldn't connect to the server, try again later."
}
break;
}
},
_isLeavingPage: !1,
willLeavePage: function() {
b.Net._isLeavingPage = !0,
setTimeout(function() {
b.Net._isLeavingPage = !1
}, 100)
},
errorFeedbackHandler: function(a, c, d, e) {
if ("abort" !== c && e && (d.status || !b.Net._isLeavingPage)) {
var f = this
, g = arguments;
setTimeout(function() {
b.Net._errorFeedbackHandler.apply(f, g)
}, d.status ? 0 : 1507)
}
},
_errorFeedbackHandler: function(c, d, e, f) {
var g = b.Net.getErrorFromXHR(e);
this.silent || b.ErrorViewer.open(g),
a(document).trigger("olv:ajax:error", [g, d, e])
},
get: function(a, c, d, e) {
return b.Net.ajax({
method: "GET",
url: a,
data: c,
success: d,
dataType: e,
beforeSend:function(){NProgress.start()},complete:function(){NProgress.done()}
})
},
post: function(a, c, d, e) {
return b.Net.ajax({
method: "POST",
url: a,
data: c,
success: d,
dataType: e,
beforeSend:function(){NProgress.start()},complete:function(){NProgress.done()}
})
},
go: function(a) {
$.pjax({url: a, container: pjax_container});
},
lo: function(cation) {
location.href = cation;
},
reload: function() {
$.pjax.reload(pjax_container);
}
},
b.Browsing = {
setup: function() {
a(document).on("click", "[data-href]", this.onDataHrefClick),
a(window).on("click submit", this.onMayLeavePage)
},
onDataHrefClick: function(c) {
// if is video then don't navigate
// bc most of the time you click on a video it plays in the background while navigating to the next post
// this may make it more inconvenient to click on the post but it's a win to me
//if (a(c.target).is('video')) {
if (a(c.target).attr('controls')) {
// ignore
return;
}
if (a(c.target).attr("data-href")) {
b.Net.go($(this).attr("data-href"));
return;
}
if (!c.isDefaultPrevented() && !a(c.target).closest("a,button").length) {
var d = a(this);
if (!d.hasClass("disabled")) {
var e = d.attr("data-href");
b.Net.go(e);
}
}
},
onMayLeavePage: function(c) {
c.isDefaultPrevented() || "click" === c.type && !a(c.target).closest("[href]").length || b.Net.willLeavePage()
}
},
b.init.done(function() {
b.Browsing.setup()
}),
b.Utils = {},
b.Utils.toJSONString = "undefined" != typeof JSON ? JSON.stringify : function() {
function a(a) {
return "\\u" + (65536 + a.charCodeAt(0)).toString(16).substring(1)
}
function b(c) {
switch (typeof c) {
case "string":
return '"' + c.replace(/[\u0000-\u001f\"\\\u2028\u2029]/g, a) + '"';
case "number":
case "boolean":
return "" + c;
case "object":
if (!c)
return "null";
var d = Object.prototype.toString.call(c).slice(8, -1);
switch (d) {
case "String":
case "Number":
case "Boolean":
return b(c.valueOf());
case "Array":
for (var e = [], f = 0; f < c.length; f++)
e.push(b(c[f]));
return "[" + e.join(",") + "]";
case "Object":
var e = [];
for (var f in c)
c.hasOwnProperty(f) && e.push(b(f) + ":" + b(c[f]));
return "{" + e.join(",") + "}"
}
return "null"
}
return "null"
}
return b
}(),
b.Utils._staticRoot = null,
b.Utils.staticURL = function(c) {
if (/^https?:/.test(c))
return c;
var d = b.Utils._staticRoot;
return null === d && document.getElementById("main-body") && (d = b.Utils._staticRoot = (a("#main-body").attr("data-static-root") || "").replace(/\/$/, "")),
(d || "") + c.replace(/^(?!\/)/, "/")
}
,
b.Utils.isIE8AndEarlierStyle = !!document.createStyleSheet && "undefined" == typeof document.documentElement.style.opacity,
b.Utils.isIEStyle = !!window.TextRange,
b.Utils.addPlatformClass = function() {
var c = a(document.documentElement)
, d = navigator.userAgent
, e = /\bWin/.test(d) ? "win" : /\bMac/.test(d) ? "mac" : "other";
c.addClass("os-" + e),
b.Utils.isIE8AndEarlierStyle && c.addClass("ie8-earlier"),
b.Utils.isIEStyle && c.addClass("ie")
}
,
b.Utils.addPlatformClass(),
b.Utils.fixWebFontLoadTiming = function() {
var a = document.createStyleSheet();
a.cssText = ":before, :after { content: none !important; }",
setTimeout(function() {
var b = a.owningElement;
b.parentNode.removeChild(b)
}, 20)
}
,
b.Utils.isIE8AndEarlierStyle && b.init.done(b.Utils.fixWebFontLoadTiming),
b.Utils.triggerHandlers = {
keypress: function(b) {
13 !== b.which || b.isDefaultPrevented() || (b.preventDefault(),
a(this).click())
},
mouseup: function(a) {
this.blur()
}
},
b.init.done(function(a) {
a(document).on(b.Utils.triggerHandlers, ".trigger")
}),
b.Content = {},
b.Content.autopagerize = function(c, d) {
function e() {
if (!(k._disabledCount || h.scrollTop() + h.height() + 200 < f.offset().top + f.outerHeight())) {
var d = a("").attr("class", "post-list-loading").append(a(b.Closed.open_spinner)).appendTo(f);
i = a.ajax({
url: g,
headers: {
"X-AUTOPAGERIZE": !0
}
}).done(function(b) {
var h = a("" + b + "").find(c);
g = h.attr("data-next-page-url") || "",
g || j.resolve(),
f.trigger("olv:autopagerize", [h, g, d]),
h.children().each(function() {
this.id && a("#" + this.id).length && a(this).detach()
}),
f.attr("data-next-page-url", g),
f.append(h.children()),
g && setTimeout(e, 0)
}).always(function() {
d.remove(),
i = null
}),
k.disable(i)
}
}
var f = a(c)
, g = f.attr("data-next-page-url");
if (g) {
a("#main-body").addClass("is-autopagerized");
var h = a(window)
, i = null
, j = a.Deferred()
, k = b.Content.autopagerize;
h.on("scroll", e),
j.done(function() {
h.off("scroll", e),
i && i.abort(),
a("#main-body").removeClass("is-autopagerized")
}),
setTimeout(e, 0),
d.done(j.resolve)
}
}
,
b.Content.autopagerize._disabledCount = 0,
b.Content.autopagerize.disable = function(a) {
var c = b.Content.autopagerize;
c._disabledCount++,
a.always(function() {
c._disabledCount--
})
}
,
b.Content.preloadImages = function() {
for (var a = arguments.length, b = a; b--; ) {
var c = document.createElement("img");
c.src = arguments[b]
}
}
,
b.Form = {
toggleDisabled: function(c, d) {
var e = void 0 === d;
return c.each(function() {
var c = a(this)
, f = e ? !b.Form.isDisabled(c) : d;
if (c.toggleClass("disabled", f),
"undefined" != typeof this.form)
c.prop("disabled", f);
else {
var g = f ? "href" : "data-disabled-href"
, h = f ? "data-disabled-href" : "href"
, i = c.attr(g);
void 0 !== i && (c.removeAttr(g),
c.attr(h, i))
}
}),
c
},
isDisabled: function(a) {
return a.length && "undefined" != typeof a[0].form ? a.prop("disabled") : a.hasClass("disabled")
},
disable: function(a, c) {
return b.Form.toggleDisabled(a, !0),
c.always(function() {
b.Form.toggleDisabled(a, !1)
}),
a
},
disableSoon: function(a, c) {
return setTimeout(function() {
"pending" === c.state() && b.Form.toggleDisabled(a, !0)
}, 0),
c.always(function() {
b.Form.toggleDisabled(a, !1)
}),
a
},
emulateInputEvent: function(b, c) {
if (b.length && "undefined" == typeof b[0].oninput) {
var d = a.map(b, function(a) {
return a.value
})
, e = setInterval(function() {
for (var c = 0, e = b.length; e > c; c++) {
var f = b[c].value;
f !== d[c] && (d[c] = f,
a(b[c]).trigger("input"))
}
}, 100);
c.always(function() {
clearInterval(e)
})
}
},
submit: function(b, c) {
b.trigger("olv:form:submit", [c || a()]);
var d = new FormData(b[0]);
/*if(a('input[type=file]').length) {
var d = new FormData(b[0])
d.append('screen', $('input[type=file]')[0].files[0])
sucky = true
} else {
var d = b.serializeArray()
sucky = false
}*/
var e = c && c.is("input, button") && c.prop("name");
e && d.push({
name: e,
value: c.val()
});
var f = {
method: b.prop("method"),
url: b.attr("action"),
data: d
};
//if(sucky) {
f.processData = false;
f.contentType = false;
//}
return this.send(f, c)
},
get: function(a, b, c) {
var d = {
method: "GET",
url: a,
data: b
};
return this.send(d, c)
},
_csrfmiddlewaretoken: null,
csrfmiddlewaretoken: function() {
return null === b.Form._csrfmiddlewaretoken && (b.Form._csrfmiddlewaretoken = a("#main-body").attr("csrf-token")),
b.Form._csrfmiddlewaretoken
},
csrftoken: function(a) {
a.csrfmiddlewaretoken = b.Form.csrfmiddlewaretoken()
return a
},
post: function(c, d, e) {
d || (d = {}),
a.isArray(d) ? d.push({
name: "csrfmiddlewaretoken",
value: b.Form.csrfmiddlewaretoken()
}) : d.csrfmiddlewaretoken = b.Form.csrfmiddlewaretoken();
var f = {
method: "POST",
url: c,
data: d
};
return this.send(f, e)
},
send: function(c, d) {
var e = b.Net.ajax(c);
return a(document).trigger("olv:form:send", [e, c, d || a()]),
d && (b.Form.disableSoon(d, e),
d.addClass("loading"),
e.always(function() {
d.removeClass("loading")
})),
e
},
updateParentClass: function(c) {
switch (c.type) {
case "radio":
var d = a(c.form ? c.form.elements[c.name] : 'input[name="' + c.name + '"]');
d.each(function() {
a(this).parent().toggleClass("checked", this.checked)
}),
b.Utils.isIE8AndEarlierStyle && d.parent().addClass("changing").removeClass("changing");
break;
case "checkbox":
a(c).parent().toggleClass("checked", c.checked)
}
},
setup: function() {
a(document).on("click", "input", function(a) {
a.isDefaultPrevented() || b.Form.updateParentClass(this)
})
},
setupForPage: function() {
a("input:checked").each(function() {
b.Form.updateParentClass(this)
})
},
reset: function(c) {
c.each(function() {
this.reset(),
a(this).find("input").each(function() {
b.Form.updateParentClass(this)
})
})
},
validateValueLength: function(b) {
var c = a(this);
c.find("[minlength], [maxlength]").each(function() {
var c = a(this)
, d = +c.attr("minlength");
isNaN(d) && (d = -(1 / 0));
var e = +c.attr("maxlength");
isNaN(e) && (e = 1 / 0);
var f = c.val();
return f.length >= d && f.length <= e ? void 0 : void b.preventDefault()
})
}
},
b.init.done(b.Form.setup),
b.router.connect("", b.Form.setupForPage),
b.Guest = {
isGuest: function() {
return a("#main-body").hasClass("guest")
}
},
b.DecreasingTimer = function(a, b, c) {
this.callback_ = a,
this.initialInterval_ = b || 1e4,
this.maxInterval_ = c || 1 / 0,
this.interval_ = this.initialInterval_,
this.timeouts_ = []
}
,
b.DecreasingTimer.prototype.resetInterval = function() {
this.interval_ = this.initialInterval_,
this.clearAllTimeouts(),
this.invoke()
}
,
b.DecreasingTimer.prototype.clearAllTimeouts = function() {
a(this.timeouts_).each(a.proxy(function(a, b) {
this.clearTimeout(b)
}, this))
}
,
b.DecreasingTimer.prototype.clearTimeout = function(a) {
for (var b = 0, c = this.timeouts_.length; c > b; ++b)
if (this.timeouts_[b] == a) {
clearTimeout(this.timeouts_[b]),
this.timeouts_.splice(b, 1);
break
}
}
,
b.DecreasingTimer.prototype.invoke = function() {
this.callback_();
var b;
b = setTimeout(a.proxy(function() {
this.invoke(),
this.clearTimeout(b)
}, this), this.interval_),
this.timeouts_.push(b),
this.interval_ = Math.min(Math.floor(1.5 * this.interval_), this.maxInterval_)
}
,
b.UpdateChecker = function(a, c) {
this._settings = {},
b.DecreasingTimer.call(this, this.callback_, a, c)
}
,
b.UpdateChecker.prototype = new b.DecreasingTimer,
b.UpdateChecker.getInstance = function() {
return void 0 == b.UpdateChecker.instance && (b.UpdateChecker.instance = new b.UpdateChecker(2e4,18e5)),
b.UpdateChecker.instance
}
,
b.UpdateChecker.prototype.callback_ = function() {
var c = {};
a.each(this._settings, a.proxy(function(d) {
void 0 != this._settings[d].pathname && this._settings[d].pathname != location.pathname ? delete this._settings[d] : a.each(this._settings[d].params, a.proxy(function(a, d) {
c[a] = b.Utils.toJSONString(d)
}, this))
}, this)),
b.Net.ajax({
url: "/alive",
silent: !0,
cache: !1
}).done(a.proxy(function(b) {
a(this).triggerHandler("update", [b])
}, this))
}
,
b.UpdateChecker.prototype.onUpdate = function(a, b, c, d) {
this._settings[a] = {
params: b,
update: c
},
d && (this._settings[a].pathname = location.pathname)
}
,
b.OpenTruncatedTextButton = {},
b.OpenTruncatedTextButton.setup = function(b) {
var c = a(b);
c.on("click", ".js-open-truncated-text-button", function(a) {
a.preventDefault(),
c.find(".js-truncated-text, .js-open-truncated-text-button").addClass("none"),
c.find(".js-full-text").removeClass("none")
})
}
,
b.ModalWindowManager = {},
b.ModalWindowManager._windows = [],
b.ModalWindowManager.currentWindow = null,
b.ModalWindowManager.closeAll = function() {
//b.ModalWindowManager._windows = [];
for (; this.currentWindow; )
this.currentWindow.close()
}
,
b.ModalWindowManager.closeUntil = function(a) {
if (a.guard)
for (var b; (b = this.currentWindow) && (b.close(),
b !== a); )
;
}
,
b.ModalWindowManager.register = function(a) {
var b = this._windows;
b.length ? b[b.length - 1].element.removeClass("active-dialog") : this.toggleMask(!0),
a.element.addClass("active-dialog"),
b.push(a),
this.currentWindow = a
}
,
b.ModalWindowManager.unregister = function(a) {
if (this.currentWindow !== a)
throw new Error("Failed to unregister modal window");
var b = this._windows;
b.pop().element.removeClass("active-dialog");
var c = b.length ? b[b.length - 1] : null;
c ? c.element.addClass("active-dialog") : this.toggleMask(!1),
this.currentWindow = c
}
,
b.ModalWindowManager._mask = null,
b.ModalWindowManager.toggleMask = function(b) {
if(a(".mask").length) {
a('body').css('position', '');
a(".mask").remove();
} else {
if(fixe) {
a('body').css('position', 'fixed');
}
a("#main-body").append("");
}
}
,
b.ModalWindowManager.setup = function() {
a(document).on("click", "[data-modal-open]", function(c) {
var d = a(this);
if (!b.Form.isDisabled(d) && !c.isDefaultPrevented()) {
c.preventDefault();
var e = a.Event("olv:modalopen");
if (d.trigger(e),
!e.isDefaultPrevented()) {
var f = a(d.attr("data-modal-open"));
f.attr("data-is-template") && (f = f.clone().removeAttr("id"));
var g = new b.ModalWindow(f,this);
g.open()
}
}
}),
a(document).on("click", ".olv-modal-close-button", function(a) {
if (!a.isDefaultPrevented()) {
a.preventDefault();
var c = b.ModalWindowManager.currentWindow;
c && c.close()
}
}),
a(document).on("olv:modal", function(a, c, d) {
b.Content.autopagerize.disable(d)
})
}
,
b.init.done(function() {
b.ModalWindowManager.setup()
}),
a(document).on("olv:pagechange", function() {
// hackily re-add modals that were open on page forward/backwards, restoring their functionality
b.ModalWindowManager._windows = [];
a('.modal-window-open').each(function(i, v) {
var modal = new b.ModalWindow(v);
modal.triggerOpenHandlers(a.Deferred());
b.ModalWindowManager._windows.push(modal);
b.ModalWindowManager.currentWindow = modal;
});
//b.ModalWindowManager.closeAll()
}),
b.ModalWindow = function(b, c) {
this.element = a(b),
this.triggerElement = a(c),
this.temporary = !this.element.parent().length;
var d = a.trim(this.element.attr("data-modal-types"));
this.types = d ? d.split(/\s+/) : [],
this.guard = null
}
,
b.ModalWindow.prototype.open = function() {
return this.guard ? void 0 : (document.activeElement && document.activeElement.blur(),
b.ModalWindowManager.register(this),
b.Form.toggleDisabled(this.triggerElement, !0),
this.element.addClass("modal-window-open").removeClass("none"),
this.temporary && this.element.appendTo(document.getElementById("main-body")),
this.triggerOpenHandlers(a.Deferred()),
this)
}
,
b.ModalWindow.prototype.triggerOpenHandlers = function(a) {
this.guard = a;
for (var b, c = [this, a.promise()], d = 0; b = this.types[d]; d++)
this.element.trigger("olv:modal:" + b, c);
this.element.trigger("olv:modal", c)
}
,
b.ModalWindow.prototype.close = function() {
return this.guard ? (this.guard.resolve(),
this.guard = null,
b.ModalWindowManager.unregister(this),
this.temporary && this.element.remove(),
this.element.addClass("none").removeClass("modal-window-open"),
b.Form.toggleDisabled(this.triggerElement, !1),
this) : void 0
}
,
b.SimpleDialog = {
_element: null,
element: function() {
var b = this._element || (this._element = a("", {
"class": "dialog"
}).append(a("", {
"class": "dialog-inner"
}).append(a("", {
"class": "window"
}).append(a("", {
"class": "window-title"
}), a("", {
"class": "window-body"
}).append(a("", {
"class": "window-body-content"
}), a("
", {
"class": "form-buttons"
}).append(a("