addLoadEvent = function (func) { if (typeof jQuery != "undefined") jQuery(document).ready(func); else if (typeof wpOnload != 'function') { wpOnload = func; } else { var oldonload = wpOnload; wpOnload = function () { oldonload(); func(); } } }; var userSettings = { 'url': '/', 'uid': '1', 'time': '1248607397' }; var ajaxurl = 'https://www.askapache.com/wp-admin/admin-ajax.php', pagenow = 'index', adminpage = 'index-php'; var quicktagsL10n = { quickLinks: "(Quick Links)", wordLookup: "Enter a word to look up:", dictionaryLookup: "Dictionary lookup", lookup: "lookup", closeAllOpenTags: "Close all open tags", closeTags: "close tags", enterURL: "Enter the URL", enterImageURL: "Enter the URL of the image", enterImageDescription: "Enter a description of the image" }; try { convertEntities(quicktagsL10n); } catch(e) {}; function convertEntities(b) { var d, a; d = function (c) { if (/&[^;]+;/.test(c)) { var f = document.createElement("div"); f.innerHTML = c; return ! f.firstChild ? c: f.firstChild.nodeValue } return c }; if (typeof b === "string") { return d(b) } else { if (typeof b === "object") { for (a in b) { if (typeof b[a] === "string") { b[a] = d(b[a]) } } } } return b } var wpCookies = { each: function (d, a, c) { var e, b; if (!d) { return 0 } c = c || d; if (typeof(d.length) != "undefined") { for (e = 0, b = d.length; e < b; e++) { if (a.call(c, d[e], e, d) === false) { return 0 } } } else { for (e in d) { if (d.hasOwnProperty(e)) { if (a.call(c, d[e], e, d) === false) { return 0 } } } } return 1 }, getHash: function (c) { var a = this.get(c), b; if (a) { this.each(a.split("&"), function (d) { d = d.split("="); b = b || {}; b[d[0]] = d[1] }) } return b }, setHash: function (i, a, f, c, h, b) { var g = ""; this.each(a, function (e, d) { g += (!g ? "": "&") + d + "=" + e }); this.set(i, g, f, c, h, b) }, get: function (h) { var g = document.cookie, f, d = h + "=", a; if (!g) { return } a = g.indexOf("; " + d); if (a == -1) { a = g.indexOf(d); if (a != 0) { return null } } else { a += 2 } f = g.indexOf(";", a); if (f == -1) { f = g.length } return decodeURIComponent(g.substring(a + d.length, f)) }, set: function (h, a, f, c, g, b) { document.cookie = h + "=" + encodeURIComponent(a) + ((f) ? "; expires=" + f.toGMTString() : "") + ((c) ? "; path=" + c: "") + ((g) ? "; domain=" + g: "") + ((b) ? "; secure": "") }, remove: function (c, a) { var b = new Date(); b.setTime(b.getTime() - 1000); this.set(c, "", b, a, b) } }; function getUserSetting(a, b) { var c = getAllUserSettings(); if (c.hasOwnProperty(a)) { return c[a] } if (typeof b != "undefined") { return b } return "" } function setUserSetting(a, i, k) { if ("object" !== typeof userSettings) { return false } var h = "wp-settings-" + userSettings.uid, e = wpCookies.getHash(h) || {}, g = new Date(), b, f = a.toString().replace(/[^A-Za-z0-9_]/, ""), j = i.toString().replace(/[^A-Za-z0-9_]/, ""); if (k) { delete e[f] } else { e[f] = j } g.setTime(g.getTime() + 31536000000); b = userSettings.url; wpCookies.setHash(h, e, g, b); wpCookies.set("wp-settings-time-" + userSettings.uid, userSettings.time, g, b); return a } function deleteUserSetting(a) { return setUserSetting(a, "", 1) } function getAllUserSettings() { if ("object" !== typeof userSettings) { return {} } return wpCookies.getHash("wp-settings-" + userSettings.uid) || {} }; var edButtons = new Array(), (function () { var c = document.body.className; c = c.replace(/no-js/, 'js'); document.body.className = c; })(); jQuery(document).ready(function (G) { G(".fad").animate({ backgroundColor: "#cceaff" }, 600).animate({ backgroundColor: "#e0f0ff" }, 300).animate({ backgroundColor: "#cceaff" }, 600).animate({ backgroundColor: "#e0f0ff" }, 300).animate({ backgroundColor: "#cceaff" }, 600).animate({ backgroundColor: "#e0f0ff" }, 300).animate({ backgroundColor: "#cceaff" }, 600).animate({ backgroundColor: "#e0f0ff" }, 300).animate({ backgroundColor: "#cceaff" }, 600).animate({ backgroundColor: "#e0f0ff" }, 300).animate({ backgroundColor: "#cceaff" }, 600).animate({ backgroundColor: "#e0f0ff" }, 300).animate({ backgroundColor: "#cceaff" }, 600).animate({ backgroundColor: "#e0f0ff" }, 2300) }) var commonL10n = { warnDelete: "You are about to permanently delete the selected items.\n \'Cancel\' to stop, \'OK\' to delete." }; try { convertEntities(commonL10n); } catch(e) {}; var wpAjax = { noPerm: "You do not have permission to do that.", broken: "An unidentified error has occurred." }; try { convertEntities(wpAjax); } catch(e) {}; var wpListL10n = { url: "https://www.askapache.com/wp-admin/admin-ajax.php" }; var adminCommentsL10n = { hotkeys_highlight_first: "", hotkeys_highlight_last: "" }; var postboxL10n = { requestFile: "https://www.askapache.com/wp-admin/admin-ajax.php" }; var plugininstallL10n = { plugin_information: "Plugin Information:" }; try { convertEntities(plugininstallL10n); } catch(e) {}; (function (a) { a.fn.hoverIntent = function (l, j) { var m = { sensitivity: 7, interval: 100, timeout: 0 }; m = a.extend(m, j ? { over: l, out: j }: l); var o, n, h, d; var e = function (f) { o = f.pageX; n = f.pageY }; var c = function (g, f) { f.hoverIntent_t = clearTimeout(f.hoverIntent_t); if ((Math.abs(h - o) + Math.abs(d - n)) < m.sensitivity) { a(f).unbind("mousemove", e); f.hoverIntent_s = 1; return m.over.apply(f, [g]) } else { h = o; d = n; f.hoverIntent_t = setTimeout(function () { c(g, f) }, m.interval) } }; var i = function (g, f) { f.hoverIntent_t = clearTimeout(f.hoverIntent_t); f.hoverIntent_s = 0; return m.out.apply(f, [g]) }; var b = function (q) { var f = this; var g = (q.type == "mouseover" ? q.fromElement: q.toElement) || q.relatedTarget; while (g && g != this) { try { g = g.parentNode } catch(q) { g = this } } if (g == this) { if (a.browser.mozilla) { if (q.type == "mouseout") { f.mtout = setTimeout(function () { k(q, f) }, 30) } else { if (f.mtout) { f.mtout = clearTimeout(f.mtout) } } } return } else { if (f.mtout) { f.mtout = clearTimeout(f.mtout) } k(q, f) } }; var k = function (p, f) { var g = jQuery.extend({}, p); if (f.hoverIntent_t) { f.hoverIntent_t = clearTimeout(f.hoverIntent_t) } if (p.type == "mouseover") { h = g.pageX; d = g.pageY; a(f).bind("mousemove", e); if (f.hoverIntent_s != 1) { f.hoverIntent_t = setTimeout(function () { c(g, f) }, m.interval) } } else { a(f).unbind("mousemove", e); if (f.hoverIntent_s == 1) { f.hoverIntent_t = setTimeout(function () { i(g, f) }, m.timeout) } } }; return this.mouseover(b).mouseout(b) } })(jQuery); var showNotice, adminMenu, columns, validateForm; (function (a) { adminMenu = { init: function () { a("#adminmenu div.wp-menu-toggle").each(function () { if (a(this).siblings(".wp-submenu").length) { a(this).click(function () { adminMenu.toggle(a(this).siblings(".wp-submenu")) }) } else { a(this).hide() } }); this.favorites(); a("a.separator").click(function () { if (a("body").hasClass("folded")) { adminMenu.fold(1); deleteUserSetting("mfold") } else { adminMenu.fold(); setUserSetting("mfold", "f") } return false }); if (a("body").hasClass("folded")) { this.fold() } this.restoreMenuState() }, restoreMenuState: function () { a("#adminmenu li.wp-has-submenu").each(function (c, d) { var b = getUserSetting("m" + c); if (a(d).hasClass("wp-has-current-submenu")) { return true } if ("o" == b) { a(d).addClass("wp-menu-open") } else { if ("c" == b) { a(d).removeClass("wp-menu-open") } } }) }, toggle: function (b) { b.slideToggle(150, function () { b.css("display", "") }).parent().toggleClass("wp-menu-open"); a("#adminmenu li.wp-has-submenu").each(function (d, f) { var c = a(f).hasClass("wp-menu-open") ? "o": "c"; setUserSetting("m" + d, c) }); return false }, fold: function (b) { if (b) { a("body").removeClass("folded"); a("#adminmenu li.wp-has-submenu").unbind() } else { a("body").addClass("folded"); a("#adminmenu li.wp-has-submenu").hoverIntent({ over: function (j) { var d, c, g, k, i; d = a(this).find(".wp-submenu"); c = d.parent().offset().top + d.height() + 1; g = a("#wpwrap").height(); k = 60 + c - g; i = a(window).height() + a("body").scrollTop() - 15; if (i < (c - k)) { k = c - i } if (k > 1) { d.css({ marginTop: "-" + k + "px" }) } else { if (d.css("marginTop")) { d.css({ marginTop: "" }) } } d.addClass("sub-open") }, out: function () { a(this).find(".wp-submenu").removeClass("sub-open").css({ marginTop: "" }) }, timeout: 220, sensitivity: 8, interval: 100 }) } }, favorites: function () { a("#favorite-inside").width(a("#favorite-actions").width() - 4); a("#favorite-toggle, #favorite-inside").bind("mouseenter", function () { a("#favorite-inside").removeClass("slideUp").addClass("slideDown"); setTimeout(function () { if (a("#favorite-inside").hasClass("slideDown")) { a("#favorite-inside").slideDown(100); a("#favorite-first").addClass("slide-down") } }, 200) }); a("#favorite-toggle, #favorite-inside").bind("mouseleave", function () { a("#favorite-inside").removeClass("slideDown").addClass("slideUp"); setTimeout(function () { if (a("#favorite-inside").hasClass("slideUp")) { a("#favorite-inside").slideUp(100, function () { a("#favorite-first").removeClass("slide-down") }) } }, 300) }) } }; a(document).ready(function () { adminMenu.init() }); columns = { init: function () { a(".hide-column-tog").click(function () { var c = a(this).val(), b = a(this).attr("checked"); if (b) { a(".column-" + c).show() } else { a(".column-" + c).hide() } columns.save_manage_columns_state() }) }, save_manage_columns_state: function () { var b = a(".manage-column").filter(":hidden").map(function () { return this.id }).get().join(","); a.post(ajaxurl, { action: "hidden-columns", hidden: b, screenoptionnonce: a("#screenoptionnonce").val(), page: pagenow }) } }; a(document).ready(function () { columns.init() }); validateForm = function (b) { return ! a(b).find(".form-required").filter(function () { return a("input:visible", this).val() == "" }).addClass("form-invalid").change(function () { a(this).removeClass("form-invalid") }).size() } })(jQuery); showNotice = { warn: function () { var a = commonL10n.warnDelete || ""; if (confirm(a)) { return true } return false }, note: function (a) { alert(a) } }; jQuery(document).ready(function (d) { var f = false, a, e, c, b; d(".fade").animate({ backgroundColor: "#ffffe0" }, 300).animate({ backgroundColor: "#fffbcc" }, 300).animate({ backgroundColor: "#ffffe0" }, 300).animate({ backgroundColor: "#fffbcc" }, 300); d("div.wrap h2 ~ div.updated, div.wrap h2 ~ div.error").addClass("below-h2"); d("div.updated, div.error").not(".below-h2").insertAfter("div.wrap h2:first"); d("#doaction, #doaction2").click(function () { if (d('select[name="action"]').val() == "destroy" || d('select[name="action2"]').val() == "destroy") { return showNotice.warn() } }); d("#destroy_all, #destroy_all2").click(function () { return showNotice.warn() }); d("#show-settings-link").click(function () { if (!d("#screen-options-wrap").hasClass("screen-options-open")) { d("#contextual-help-link-wrap").css("visibility", "hidden") } d("#screen-options-wrap").slideToggle("fast", function () { if (d(this).hasClass("screen-options-open")) { d("#show-settings-link").css({ backgroundImage: 'url("images/screen-options-right.gif")' }); d("#contextual-help-link-wrap").css("visibility", ""); d(this).removeClass("screen-options-open") } else { d("#show-settings-link").css({ backgroundImage: 'url("images/screen-options-right-up.gif")' }); d(this).addClass("screen-options-open") } }); return false }); d("#contextual-help-link").click(function () { if (!d("#contextual-help-wrap").hasClass("contextual-help-open")) { d("#screen-options-link-wrap").css("visibility", "hidden") } d("#contextual-help-wrap").slideToggle("fast", function () { if (d(this).hasClass("contextual-help-open")) { d("#contextual-help-link").css({ backgroundImage: 'url("images/screen-options-right.gif")' }); d("#screen-options-link-wrap").css("visibility", ""); d(this).removeClass("contextual-help-open") } else { d("#contextual-help-link").css({ backgroundImage: 'url("images/screen-options-right-up.gif")' }); d(this).addClass("contextual-help-open") } }); return false }); d("#contextual-help-link-wrap, #screen-options-link-wrap").show(); d("table:visible tbody .check-column :checkbox").click(function (g) { if ("undefined" == g.shiftKey) { return true } if (g.shiftKey) { if (!f) { return true } a = d(f).parents("form:first").find(":checkbox"); e = a.index(f); c = a.index(this); b = d(this).attr("checked"); if (0 < e && 0 < c && e != c) { a.slice(e, c).attr("checked", function () { if (d(this).parents("tr").is(":visible")) { return b ? "checked": "" } return "" }) } } f = this; return true }); d("thead :checkbox, tfoot :checkbox").click(function (i) { var j = d(this).attr("checked"), h = "undefined" == typeof toggleWithKeyboard ? false: toggleWithKeyboard, g = i.shiftKey || h; d(this).parents("form:first").find("table tbody:visible").find(".check-column :checkbox").attr("checked", function () { if (d(this).parents("tr").is(":hidden")) { return "" } if (g) { return d(this).attr("checked") ? "": "checked" } else { if (j) { return "checked" } } return "" }); d(this).parents("form:first").find("table thead:visible, table tfoot:visible").find(".check-column :checkbox").attr("checked", function () { if (g) { return "" } else { if (j) { return "checked" } } return "" }) }); d("#default-password-nag-no").click(function () { setUserSetting("default_password_nag", "hide"); d("div.default-password-nag").hide(); return false }) }); jQuery(document).ready(function (b) { var a = b(".turbo-nag"); if (!a.length || ("undefined" != typeof(google) && google.gears)) { return } if ("undefined" != typeof GearsFactory) { return } else { try { if (("undefined" != typeof window.ActiveXObject && ActiveXObject("Gears.Factory")) || ("undefined" != typeof navigator.mimeTypes && navigator.mimeTypes["application/x-googlegears"])) { return } } catch(c) {} } a.show() }); (function (d) { d.each(["backgroundColor", "borderBottomColor", "borderLeftColor", "borderRightColor", "borderTopColor", "color", "outlineColor"], function (f, e) { d.fx.step[e] = function (g) { if (g.state == 0) { g.start = c(g.elem, e); g.end = b(g.end) } g.elem.style[e] = "rgb(" + [Math.max(Math.min(parseInt((g.pos * (g.end[0] - g.start[0])) + g.start[0]), 255), 0), Math.max(Math.min(parseInt((g.pos * (g.end[1] - g.start[1])) + g.start[1]), 255), 0), Math.max(Math.min(parseInt((g.pos * (g.end[2] - g.start[2])) + g.start[2]), 255), 0)].join(",") + ")" } }); function b(f) { var e; if (f && f.constructor == Array && f.length == 3) { return f } if (e = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(f)) { return [parseInt(e[1]), parseInt(e[2]), parseInt(e[3])] } if (e = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(f)) { return [parseFloat(e[1]) * 2.55, parseFloat(e[2]) * 2.55, parseFloat(e[3]) * 2.55] } if (e = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(f)) { return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)] } if (e = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(f)) { return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)] } if (e = /rgba\(0, 0, 0, 0\)/.exec(f)) { return a.transparent } return a[d.trim(f).toLowerCase()] } function c(g, e) { var f; do { f = d.curCSS(g, e); if (f != "" && f != "transparent" || d.nodeName(g, "body")) { break } e = "backgroundColor" } while (g = g.parentNode); return b(f) } var a = { aqua: [0, 255, 255], azure: [240, 255, 255], beige: [245, 245, 220], black: [0, 0, 0], blue: [0, 0, 255], brown: [165, 42, 42], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgrey: [169, 169, 169], darkgreen: [0, 100, 0], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkviolet: [148, 0, 211], fuchsia: [255, 0, 255], gold: [255, 215, 0], green: [0, 128, 0], indigo: [75, 0, 130], khaki: [240, 230, 140], lightblue: [173, 216, 230], lightcyan: [224, 255, 255], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightyellow: [255, 255, 224], lime: [0, 255, 0], magenta: [255, 0, 255], maroon: [128, 0, 0], navy: [0, 0, 128], olive: [128, 128, 0], orange: [255, 165, 0], pink: [255, 192, 203], purple: [128, 0, 128], violet: [128, 0, 128], red: [255, 0, 0], silver: [192, 192, 192], white: [255, 255, 255], yellow: [255, 255, 0], transparent: [255, 255, 255] } })(jQuery); var theList, theExtraList, toggleWithKeyboard = false; (function (a) { setCommentsList = function () { var g, i, h, f = 0, c, e, d, b; g = a('#comments-form .tablenav :input[name="_total"]'); i = a('#comments-form .tablenav :input[name="_per_page"]'); h = a('#comments-form .tablenav :input[name="_page"]'); c = function (k, j) { var l = a("#" + j.element); if (l.is(".unapproved")) { l.find("div.comment_status").html("0") } else { l.find("div.comment_status").html("1") } a("span.pending-count").each(function () { var m = a(this), o; o = m.html().replace(/[ ,.]+/g, ""); o = parseInt(o, 10); if (isNaN(o)) { return } o = o + (a("#" + j.element).is("." + j.dimClass) ? 1 : -1); if (o < 0) { o = 0 } m.parents("#awaiting-mod")[0 == o ? "addClass": "removeClass"]("count-0"); o = o.toString(); if (o.length > 3) { o = o.substr(0, o.length - 3) + " " + o.substr( - 3) } m.html(o) }) }; e = function (j) { j.data._total = g.val(); j.data._per_page = i.val(); j.data._page = h.val(); j.data._url = document.location.href; if ("undefined" != showNotice && j.data.action && j.data.action == "delete-comment" && j.data.deleted) { return showNotice.warn() ? j: false } return j }; d = function (j, k, l) { if (k < f) { return } g.val(j.toString()); if (l) { f = k } a("span.total-type-count").each(function () { var m = a(this), o; o = g.val().toString(); if (o.length > 3) { o = o.substr(0, o.length - 3) + " " + o.substr( - 3) } m.html(o) }) }; b = function (l, j) { a("span.pending-count").each(function () { var m = a(this), o; o = m.html().replace(/[ ,.]+/g, ""); o = parseInt(o, 10); if (isNaN(o)) { return } if (a("#" + j.element).is(".unapproved")) { o = o - 1 } else { if (a(j.target).parents("span.unapprove").size()) { o = o + 1 } } if (o < 0) { o = 0 } m.parents("#awaiting-mod")[0 == o ? "addClass": "removeClass"]("count-0"); o = o.toString(); if (o.length > 3) { o = o.substr(0, o.length - 3) + " " + o.substr( - 3) } m.html(o) }); a("span.spam-count").each(function () { var m = a(this), o; o = m.html().replace(/[ ,.]+/g, ""); o = parseInt(o, 10); if (isNaN(o)) { return } if (a(j.target).parents("span.spam").size()) { o = o + 1 } else { if (a("#" + j.element).is(".spam")) { o = o - 1 } } if (o < 0) { o = 0 } o = o.toString(); if (o.length > 3) { o = o.substr(0, o.length - 3) + " " + o.substr( - 3) } m.html(o) }); a("span.deleted-count").each(function () { var m = a(this), o; o = m.html().replace(/[ ,.]+/g, ""); o = parseInt(o, 10); if (isNaN(o)) { return } if (a(j.target).parents("span.delete").size() && a("#" + j.element).is(".deleted,.spam")) { o-- } else { if (a(j.target).parents("span.delete").size()) { o++ } else { if (a("#" + j.element).is(".deleted")) { o-- } } } if (o < 0) { o = 0 } o = o.toString(); if (o.length > 3) { o = o.substr(0, o.length - 3) + " " + o.substr( - 3) } m.html(o) }); if (("object" == typeof l) && f < j.parsed.responses[0].supplemental.time) { d(j.parsed.responses[0].supplemental.total, j.parsed.responses[0].supplemental.time, true); if (a.trim(j.parsed.responses[0].supplemental.pageLinks)) { a(".tablenav-pages").find(".page-numbers").remove().end().append(a(j.parsed.responses[0].supplemental.pageLinks)) } else { if ("undefined" != typeof j.parsed.responses[0].supplemental.pageLinks) { a(".tablenav-pages").find(".page-numbers").remove() } } } else { var k = parseInt(g.val(), 10); if (k--<0) { k = 0 } d(k, l, false) } if (theExtraList.size() == 0 || theExtraList.children().size() == 0) { return } theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone()); a("#get-extra-comments").submit() }; theExtraList = a("#the-extra-comment-list").wpList({ alt: "", delColor: "none", addColor: "none" }); theList = a("#the-comment-list").wpList({ alt: "", delBefore: e, dimAfter: c, delAfter: b, addColor: "none" }) }; commentReply = { init: function () { var b = a("#replyrow"); a("a.cancel", b).click(function () { return commentReply.revert() }); a("a.save", b).click(function () { return commentReply.send() }); a("input#author, input#author-email, input#author-url", b).keypress(function (c) { if (c.which == 13) { commentReply.send(); c.preventDefault(); return false } }); a("#the-comment-list .column-comment > p").dblclick(function () { commentReply.toggle(a(this).parent()) }); a("#doaction, #doaction2, #post-query-submit").click(function (c) { if (a("#the-comment-list #replyrow").length > 0) { commentReply.close() } }); this.comments_listing = a('#comments-form > input[name="comment_status"]').val() || "" }, addEvents: function (b) { b.each(function () { a(this).find(".column-comment > p").dblclick(function () { commentReply.toggle(a(this).parent()) }) }) }, toggle: function (b) { if (a(b).css("display") != "none") { a(b).find("a.vim-q").click() } }, revert: function () { if (a("#the-comment-list #replyrow").length < 1) { return false } a("#replyrow").fadeOut("fast", function () { commentReply.close() }); return false }, close: function () { a(this.o).fadeIn("fast").css("backgroundColor", ""); a("#com-reply").append(a("#replyrow")); a("#replycontent").val(""); a("#edithead input").val(""); a("#replysubmit .error").html("").hide(); a("#replysubmit .waiting").hide(); if (a.browser.msie) { a("#replycontainer, #replycontent").css("height", "120px") } else { a("#replycontainer").resizable("destroy").css("height", "120px") } }, open: function (i, g, c) { var e = this, d, b, f; e.close(); e.o = "#comment-" + i; a("#replyrow td").attr("colspan", a(".widefat thead th:visible").length); d = a("#replyrow"), rowData = a("#inline-" + i); b = e.act = (c == "edit") ? "edit-comment": "replyto-comment"; a("#action", d).val(b); a("#comment_post_ID", d).val(g); a("#comment_ID", d).val(i); if (c == "edit") { a("#author", d).val(a("div.author", rowData).text()); a("#author-email", d).val(a("div.author-email", rowData).text()); a("#author-url", d).val(a("div.author-url", rowData).text()); a("#status", d).val(a("div.comment_status", rowData).text()); a("#replycontent", d).val(a("textarea.comment", rowData).val()); a("#edithead, #savebtn", d).show(); a("#replyhead, #replybtn", d).hide(); f = a(e.o).height(); if (f > 220) { if (a.browser.msie) { a("#replycontainer, #replycontent", d).height(f - 105) } else { a("#replycontainer", d).height(f - 105) } } a(e.o).after(d.hide()).fadeOut("fast", function () { a("#replyrow").fadeIn("fast") }) } else { a("#edithead, #savebtn", d).hide(); a("#replyhead, #replybtn", d).show(); a(e.o).after(d); a("#replyrow").hide().fadeIn("fast") } if (!a.browser.msie) { a("#replycontainer").resizable({ handles: "s", axis: "y", minHeight: 80, stop: function () { a("#replycontainer").width("auto") } }) } setTimeout(function () { var l, j, m, h, k; l = a("#replyrow").offset().top; j = l + a("#replyrow").height(); m = window.pageYOffset || document.documentElement.scrollTop; h = document.documentElement.clientHeight || self.innerHeight || 0; k = m + h; if (k - 20 < j) { window.scroll(0, j - h + 35) } else { if (l - 20 < m) { window.scroll(0, l - 35) } } a("#replycontent").focus().keyup(function (n) { if (n.which == 27) { commentReply.revert() } }) }, 600); return false }, send: function () { var b = {}; a("#replysubmit .waiting").show(); a("#replyrow input").each(function () { b[a(this).attr("name")] = a(this).val() }); b.content = a("#replycontent").val(); b.id = b.comment_post_ID; b.comments_listing = this.comments_listing; a.ajax({ type: "POST", url: wpListL10n.url, data: b, success: function (c) { commentReply.show(c) }, error: function (c) { commentReply.error(c) } }); return false }, show: function (b) { var e, g, f, d; if (typeof(b) == "string") { this.error({ responseText: b }); return false } e = wpAjax.parseAjaxResponse(b); if (e.errors) { this.error({ responseText: wpAjax.broken }); return false } if ("edit-comment" == this.act) { a(this.o).remove() } e = e.responses[0]; g = e.data; a(g).hide(); a("#replyrow").after(g); this.o = f = "#comment-" + e.id; this.revert(); this.addEvents(a(f)); d = a(f).hasClass("unapproved") ? "#ffffe0": "#fff"; a(f).animate({ backgroundColor: "#CCEEBB" }, 600).animate({ backgroundColor: d }, 600); a.fn.wpList.process(a(f)) }, error: function (b) { var c = b.statusText; a("#replysubmit .waiting").hide(); if (b.responseText) { c = b.responseText.replace(/<.[^<>]*?>/g, "") } if (c) { a("#replysubmit .error").html(c).show() } } }; a(document).ready(function () { var e, b, c, d; setCommentsList(); commentReply.init(); a("span.delete a.delete").click(function () { return false }); if (typeof QTags != "undefined") { ed_reply = new QTags("ed_reply", "replycontent", "replycontainer", "more") } if (typeof a.table_hotkeys != "undefined") { e = function (f) { return function () { var h, g; h = "next" == f ? "first": "last"; g = a("." + f + ".page-numbers"); if (g.length) { window.location = g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, "") + "&hotkeys_highlight_" + h + "=1" } } }; b = function (g, f) { window.location = a("span.edit a", f).attr("href") }; c = function () { toggleWithKeyboard = true; a("#comments-form thead #cb input:checkbox").click().attr("checked", ""); toggleWithKeyboard = false }; d = function (f) { return function (h, g) { a("option[value=" + f + "]").attr("selected", "selected"); a("form#comments-form")[0].submit() } }; a.table_hotkeys(a("table.widefat"), ["a", "u", "s", "d", "r", "q", ["e", b], ["shift+a", d("approve")], ["shift+s", d("markspam")], ["shift+d", d("delete")], ["shift+x", c], ["shift+u", d("unapprove")]], { highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last, prev_page_link_cb: e("prev"), next_page_link_cb: e("next") }) } }) })(jQuery); /* * jQuery UI Sortable 1.7.1 * * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * http://docs.jquery.com/UI/Sortables * * Depends: * ui.core.js */ (function (a) { a.widget("ui.sortable", a.extend({}, a.ui.mouse, { _init: function () { var b = this.options; this.containerCache = {}; this.element.addClass("ui-sortable"); this.refresh(); this.floating = this.items.length ? (/left|right/).test(this.items[0].item.css("float")) : false; this.offset = this.element.offset(); this._mouseInit() }, destroy: function () { this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable"); this._mouseDestroy(); for (var b = this.items.length - 1; b >= 0; b--) { this.items[b].item.removeData("sortable-item") } }, _mouseCapture: function (e, f) { if (this.reverting) { return false } if (this.options.disabled || this.options.type == "static") { return false } this._refreshItems(e); var d = null, c = this, b = a(e.target).parents().each(function () { if (a.data(this, "sortable-item") == c) { d = a(this); return false } }); if (a.data(e.target, "sortable-item") == c) { d = a(e.target) } if (!d) { return false } if (this.options.handle && !f) { var g = false; a(this.options.handle, d).find("*").andSelf().each(function () { if (this == e.target) { g = true } }); if (!g) { return false } } this.currentItem = d; this._removeCurrentsFromItems(); return true }, _mouseStart: function (e, f, b) { var g = this.options, c = this; this.currentContainer = this; this.refreshPositions(); this.helper = this._createHelper(e); this._cacheHelperProportions(); this._cacheMargins(); this.scrollParent = this.helper.scrollParent(); this.offset = this.currentItem.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; this.helper.css("position", "absolute"); this.cssPosition = this.helper.css("position"); a.extend(this.offset, { click: { left: e.pageX - this.offset.left, top: e.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }); this.originalPosition = this._generatePosition(e); this.originalPageX = e.pageX; this.originalPageY = e.pageY; if (g.cursorAt) { this._adjustOffsetFromHelper(g.cursorAt) } this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }; if (this.helper[0] != this.currentItem[0]) { this.currentItem.hide() } this._createPlaceholder(); if (g.containment) { this._setContainment() } if (g.cursor) { if (a("body").css("cursor")) { this._storedCursor = a("body").css("cursor") } a("body").css("cursor", g.cursor) } if (g.opacity) { if (this.helper.css("opacity")) { this._storedOpacity = this.helper.css("opacity") } this.helper.css("opacity", g.opacity) } if (g.zIndex) { if (this.helper.css("zIndex")) { this._storedZIndex = this.helper.css("zIndex") } this.helper.css("zIndex", g.zIndex) } if (this.scrollParent[0] != document && this.scrollParent[0].tagName != "HTML") { this.overflowOffset = this.scrollParent.offset() } this._trigger("start", e, this._uiHash()); if (!this._preserveHelperProportions) { this._cacheHelperProportions() } if (!b) { for (var d = this.containers.length - 1; d >= 0; d--) { this.containers[d]._trigger("activate", e, c._uiHash(this)) } } if (a.ui.ddmanager) { a.ui.ddmanager.current = this } if (a.ui.ddmanager && !g.dropBehaviour) { a.ui.ddmanager.prepareOffsets(this, e) } this.dragging = true; this.helper.addClass("ui-sortable-helper"); this._mouseDrag(e); return true }, _mouseDrag: function (f) { this.position = this._generatePosition(f); this.positionAbs = this._convertPositionTo("absolute"); if (!this.lastPositionAbs) { this.lastPositionAbs = this.positionAbs } if (this.options.scroll) { var g = this.options, b = false; if (this.scrollParent[0] != document && this.scrollParent[0].tagName != "HTML") { if ((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - f.pageY < g.scrollSensitivity) { this.scrollParent[0].scrollTop = b = this.scrollParent[0].scrollTop + g.scrollSpeed } else { if (f.pageY - this.overflowOffset.top < g.scrollSensitivity) { this.scrollParent[0].scrollTop = b = this.scrollParent[0].scrollTop - g.scrollSpeed } } if ((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - f.pageX < g.scrollSensitivity) { this.scrollParent[0].scrollLeft = b = this.scrollParent[0].scrollLeft + g.scrollSpeed } else { if (f.pageX - this.overflowOffset.left < g.scrollSensitivity) { this.scrollParent[0].scrollLeft = b = this.scrollParent[0].scrollLeft - g.scrollSpeed } } } else { if (f.pageY - a(document).scrollTop() < g.scrollSensitivity) { b = a(document).scrollTop(a(document).scrollTop() - g.scrollSpeed) } else { if (a(window).height() - (f.pageY - a(document).scrollTop()) < g.scrollSensitivity) { b = a(document).scrollTop(a(document).scrollTop() + g.scrollSpeed) } } if (f.pageX - a(document).scrollLeft() < g.scrollSensitivity) { b = a(document).scrollLeft(a(document).scrollLeft() - g.scrollSpeed) } else { if (a(window).width() - (f.pageX - a(document).scrollLeft()) < g.scrollSensitivity) { b = a(document).scrollLeft(a(document).scrollLeft() + g.scrollSpeed) } } } if (b !== false && a.ui.ddmanager && !g.dropBehaviour) { a.ui.ddmanager.prepareOffsets(this, f) } } this.positionAbs = this._convertPositionTo("absolute"); if (!this.options.axis || this.options.axis != "y") { this.helper[0].style.left = this.position.left + "px" } if (!this.options.axis || this.options.axis != "x") { this.helper[0].style.top = this.position.top + "px" } for (var d = this.items.length - 1; d >= 0; d--) { var e = this.items[d], c = e.item[0], h = this._intersectsWithPointer(e); if (!h) { continue } if (c != this.currentItem[0] && this.placeholder[h == 1 ? "next": "prev"]()[0] != c && !a.ui.contains(this.placeholder[0], c) && (this.options.type == "semi-dynamic" ? !a.ui.contains(this.element[0], c) : true)) { this.direction = h == 1 ? "down": "up"; if (this.options.tolerance == "pointer" || this._intersectsWithSides(e)) { this._rearrange(f, e) } else { break } this._trigger("change", f, this._uiHash()); break } } this._contactContainers(f); if (a.ui.ddmanager) { a.ui.ddmanager.drag(this, f) } this._trigger("sort", f, this._uiHash()); this.lastPositionAbs = this.positionAbs; return false }, _mouseStop: function (c, d) { if (!c) { return } if (a.ui.ddmanager && !this.options.dropBehaviour) { a.ui.ddmanager.drop(this, c) } if (this.options.revert) { var b = this; var e = b.placeholder.offset(); b.reverting = true; a(this.helper).animate({ left: e.left - this.offset.parent.left - b.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft), top: e.top - this.offset.parent.top - b.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop) }, parseInt(this.options.revert, 10) || 500, function () { b._clear(c) }) } else { this._clear(c, d) } return false }, cancel: function () { var b = this; if (this.dragging) { this._mouseUp(); if (this.options.helper == "original") { this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else { this.currentItem.show() } for (var c = this.containers.length - 1; c >= 0; c--) { this.containers[c]._trigger("deactivate", null, b._uiHash(this)); if (this.containers[c].containerCache.over) { this.containers[c]._trigger("out", null, b._uiHash(this)); this.containers[c].containerCache.over = 0 } } } if (this.placeholder[0].parentNode) { this.placeholder[0].parentNode.removeChild(this.placeholder[0]) } if (this.options.helper != "original" && this.helper && this.helper[0].parentNode) { this.helper.remove() } a.extend(this, { helper: null, dragging: false, reverting: false, _noFinalSort: null }); if (this.domPosition.prev) { a(this.domPosition.prev).after(this.currentItem) } else { a(this.domPosition.parent).prepend(this.currentItem) } return true }, serialize: function (d) { var b = this._getItemsAsjQuery(d && d.connected); var c = []; d = d || {}; a(b).each(function () { var e = (a(d.item || this).attr(d.attribute || "id") || "").match(d.expression || (/(.+)[-=_](.+)/)); if (e) { c.push((d.key || e[1] + "[]") + "=" + (d.key && d.expression ? e[1] : e[2])) } }); return c.join("&") }, toArray: function (d) { var b = this._getItemsAsjQuery(d && d.connected); var c = []; d = d || {}; b.each(function () { c.push(a(d.item || this).attr(d.attribute || "id") || "") }); return c }, _intersectsWith: function (m) { var e = this.positionAbs.left, d = e + this.helperProportions.width, k = this.positionAbs.top, j = k + this.helperProportions.height; var f = m.left, c = f + m.width, n = m.top, i = n + m.height; var o = this.offset.click.top, h = this.offset.click.left; var g = (k + o) > n && (k + o) < i && (e + h) > f && (e + h) < c; if (this.options.tolerance == "pointer" || this.options.forcePointerForContainers || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? "width": "height"] > m[this.floating ? "width": "height"])) { return g } else { return (f < e + (this.helperProportions.width / 2) && d - (this.helperProportions.width / 2) < c && n < k + (this.helperProportions.height / 2) && j - (this.helperProportions.height / 2) < i) } }, _intersectsWithPointer: function (d) { var e = a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, d.top, d.height), c = a.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, d.left, d.width), g = e && c, b = this._getDragVerticalDirection(), f = this._getDragHorizontalDirection(); if (!g) { return false } return this.floating ? (((f && f == "right") || b == "down") ? 2 : 1) : (b && (b == "down" ? 2 : 1)) }, _intersectsWithSides: function (e) { var c = a.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, e.top + (e.height / 2), e.height), d = a.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, e.left + (e.width / 2), e.width), b = this._getDragVerticalDirection(), f = this._getDragHorizontalDirection(); if (this.floating && f) { return ((f == "right" && d) || (f == "left" && !d)) } else { return b && ((b == "down" && c) || (b == "up" && !c)) } }, _getDragVerticalDirection: function () { var b = this.positionAbs.top - this.lastPositionAbs.top; return b != 0 && (b > 0 ? "down": "up") }, _getDragHorizontalDirection: function () { var b = this.positionAbs.left - this.lastPositionAbs.left; return b != 0 && (b > 0 ? "right": "left") }, refresh: function (b) { this._refreshItems(b); this.refreshPositions() }, _connectWith: function () { var b = this.options; return b.connectWith.constructor == String ? [b.connectWith] : b.connectWith }, _getItemsAsjQuery: function (b) { var l = this; var g = []; var e = []; var h = this._connectWith(); if (h && b) { for (var d = h.length - 1; d >= 0; d--) { var k = a(h[d]); for (var c = k.length - 1; c >= 0; c--) { var f = a.data(k[c], "sortable"); if (f && f != this && !f.options.disabled) { e.push([a.isFunction(f.options.items) ? f.options.items.call(f.element) : a(f.options.items, f.element).not(".ui-sortable-helper"), f]) } } } } e.push([a.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : a(this.options.items, this.element).not(".ui-sortable-helper"), this]); for (var d = e.length - 1; d >= 0; d--) { e[d][0].each(function () { g.push(this) }) } return a(g) }, _removeCurrentsFromItems: function () { var d = this.currentItem.find(":data(sortable-item)"); for (var c = 0; c < this.items.length; c++) { for (var b = 0; b < d.length; b++) { if (d[b] == this.items[c].item[0]) { this.items.splice(c, 1) } } } }, _refreshItems: function (b) { this.items = []; this.containers = [this]; var h = this.items; var p = this; var f = [[a.isFunction(this.options.items) ? this.options.items.call(this.element[0], b, { item: this.currentItem }) : a(this.options.items, this.element), this]]; var l = this._connectWith(); if (l) { for (var e = l.length - 1; e >= 0; e--) { var m = a(l[e]); for (var d = m.length - 1; d >= 0; d--) { var g = a.data(m[d], "sortable"); if (g && g != this && !g.options.disabled) { f.push([a.isFunction(g.options.items) ? g.options.items.call(g.element[0], b, { item: this.currentItem }) : a(g.options.items, g.element), g]); this.containers.push(g) } } } } for (var e = f.length - 1; e >= 0; e--) { var k = f[e][1]; var c = f[e][0]; for (var d = 0, n = c.length; d < n; d++) { var o = a(c[d]); o.data("sortable-item", k); h.push({ item: o, instance: k, width: 0, height: 0, left: 0, top: 0 }) } } }, refreshPositions: function (b) { if (this.offsetParent && this.helper) { this.offset.parent = this._getParentOffset() } for (var d = this.items.length - 1; d >= 0; d--) { var e = this.items[d]; if (e.instance != this.currentContainer && this.currentContainer && e.item[0] != this.currentItem[0]) { continue } var c = this.options.toleranceElement ? a(this.options.toleranceElement, e.item) : e.item; if (!b) { e.width = c.outerWidth(); e.height = c.outerHeight() } var f = c.offset(); e.left = f.left; e.top = f.top } if (this.options.custom && this.options.custom.refreshContainers) { this.options.custom.refreshContainers.call(this) } else { for (var d = this.containers.length - 1; d >= 0; d--) { var f = this.containers[d].element.offset(); this.containers[d].containerCache.left = f.left; this.containers[d].containerCache.top = f.top; this.containers[d].containerCache.width = this.containers[d].element.outerWidth(); this.containers[d].containerCache.height = this.containers[d].element.outerHeight() } } }, _createPlaceholder: function (d) { var b = d || this, e = b.options; if (!e.placeholder || e.placeholder.constructor == String) { var c = e.placeholder; e.placeholder = { element: function () { var f = a(document.createElement(b.currentItem[0].nodeName)).addClass(c || b.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; if (!c) { f.style.visibility = "hidden" } return f }, update: function (f, g) { if (c && !e.forcePlaceholderSize) { return } if (!g.height()) { g.height(b.currentItem.innerHeight() - parseInt(b.currentItem.css("paddingTop") || 0, 10) - parseInt(b.currentItem.css("paddingBottom") || 0, 10)) } if (!g.width()) { g.width(b.currentItem.innerWidth() - parseInt(b.currentItem.css("paddingLeft") || 0, 10) - parseInt(b.currentItem.css("paddingRight") || 0, 10)) } } } } b.placeholder = a(e.placeholder.element.call(b.element, b.currentItem)); b.currentItem.after(b.placeholder); e.placeholder.update(b, b.placeholder) }, _contactContainers: function (d) { for (var c = this.containers.length - 1; c >= 0; c--) { if (this._intersectsWith(this.containers[c].containerCache)) { if (!this.containers[c].containerCache.over) { if (this.currentContainer != this.containers[c]) { var h = 10000; var g = null; var e = this.positionAbs[this.containers[c].floating ? "left": "top"]; for (var b = this.items.length - 1; b >= 0; b--) { if (!a.ui.contains(this.containers[c].element[0], this.items[b].item[0])) { continue } var f = this.items[b][this.containers[c].floating ? "left": "top"]; if (Math.abs(f - e) < h) { h = Math.abs(f - e); g = this.items[b] } } if (!g && !this.options.dropOnEmpty) { continue } this.currentContainer = this.containers[c]; g ? this._rearrange(d, g, null, true) : this._rearrange(d, null, this.containers[c].element, true); this._trigger("change", d, this._uiHash()); this.containers[c]._trigger("change", d, this._uiHash(this)); this.options.placeholder.update(this.currentContainer, this.placeholder) } this.containers[c]._trigger("over", d, this._uiHash(this)); this.containers[c].containerCache.over = 1 } } else { if (this.containers[c].containerCache.over) { this.containers[c]._trigger("out", d, this._uiHash(this)); this.containers[c].containerCache.over = 0 } } } }, _createHelper: function (c) { var d = this.options; var b = a.isFunction(d.helper) ? a(d.helper.apply(this.element[0], [c, this.currentItem])) : (d.helper == "clone" ? this.currentItem.clone() : this.currentItem); if (!b.parents("body").length) { a(d.appendTo != "parent" ? d.appendTo: this.currentItem[0].parentNode)[0].appendChild(b[0]) } if (b[0] == this.currentItem[0]) { this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") } } if (b[0].style.width == "" || d.forceHelperSize) { b.width(this.currentItem.width()) } if (b[0].style.height == "" || d.forceHelperSize) { b.height(this.currentItem.height()) } return b }, _adjustOffsetFromHelper: function (b) { if (b.left != undefined) { this.offset.click.left = b.left + this.margins.left } if (b.right != undefined) { this.offset.click.left = this.helperProportions.width - b.right + this.margins.left } if (b.top != undefined) { this.offset.click.top = b.top + this.margins.top } if (b.bottom != undefined) { this.offset.click.top = this.helperProportions.height - b.bottom + this.margins.top } }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var b = this.offsetParent.offset(); if (this.cssPosition == "absolute" && this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) { b.left += this.scrollParent.scrollLeft(); b.top += this.scrollParent.scrollTop() } if ((this.offsetParent[0] == document.body) || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == "html" && a.browser.msie)) { b = { top: 0, left: 0 } } return { top: b.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: b.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) } }, _getRelativeOffset: function () { if (this.cssPosition == "relative") { var b = this.currentItem.position(); return { top: b.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: b.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft() } } else { return { top: 0, left: 0 } } }, _cacheMargins: function () { this.margins = { left: (parseInt(this.currentItem.css("marginLeft"), 10) || 0), top: (parseInt(this.currentItem.css("marginTop"), 10) || 0) } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () { var e = this.options; if (e.containment == "parent") { e.containment = this.helper[0].parentNode } if (e.containment == "document" || e.containment == "window") { this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, a(e.containment == "document" ? document: window).width() - this.helperProportions.width - this.margins.left, (a(e.containment == "document" ? document: window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top] } if (! (/^(document|window|parent)$/).test(e.containment)) { var c = a(e.containment)[0]; var d = a(e.containment).offset(); var b = (a(c).css("overflow") != "hidden"); this.containment = [d.left + (parseInt(a(c).css("borderLeftWidth"), 10) || 0) + (parseInt(a(c).css("paddingLeft"), 10) || 0) - this.margins.left, d.top + (parseInt(a(c).css("borderTopWidth"), 10) || 0) + (parseInt(a(c).css("paddingTop"), 10) || 0) - this.margins.top, d.left + (b ? Math.max(c.scrollWidth, c.offsetWidth) : c.offsetWidth) - (parseInt(a(c).css("borderLeftWidth"), 10) || 0) - (parseInt(a(c).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, d.top + (b ? Math.max(c.scrollHeight, c.offsetHeight) : c.offsetHeight) - (parseInt(a(c).css("borderTopWidth"), 10) || 0) - (parseInt(a(c).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top] } }, _convertPositionTo: function (f, h) { if (!h) { h = this.position } var c = f == "absolute" ? 1 : -1; var e = this.options, b = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent: this.scrollParent, g = (/(html|body)/i).test(b[0].tagName); return { top: (h.top + this.offset.relative.top * c + this.offset.parent.top * c - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (g ? 0 : b.scrollTop())) * c)), left: (h.left + this.offset.relative.left * c + this.offset.parent.left * c - (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : g ? 0 : b.scrollLeft()) * c)) } }, _generatePosition: function (e) { var h = this.options, b = this.cssPosition == "absolute" && !(this.scrollParent[0] != document && a.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent: this.scrollParent, i = (/(html|body)/i).test(b[0].tagName); if (this.cssPosition == "relative" && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) { this.offset.relative = this._getRelativeOffset() } var d = e.pageX; var c = e.pageY; if (this.originalPosition) { if (this.containment) { if (e.pageX - this.offset.click.left < this.containment[0]) { d = this.containment[0] + this.offset.click.left } if (e.pageY - this.offset.click.top < this.containment[1]) { c = this.containment[1] + this.offset.click.top } if (e.pageX - this.offset.click.left > this.containment[2]) { d = this.containment[2] + this.offset.click.left } if (e.pageY - this.offset.click.top > this.containment[3]) { c = this.containment[3] + this.offset.click.top } } if (h.grid) { var g = this.originalPageY + Math.round((c - this.originalPageY) / h.grid[1]) * h.grid[1]; c = this.containment ? (!(g - this.offset.click.top < this.containment[1] || g - this.offset.click.top > this.containment[3]) ? g: (!(g - this.offset.click.top < this.containment[1]) ? g - h.grid[1] : g + h.grid[1])) : g; var f = this.originalPageX + Math.round((d - this.originalPageX) / h.grid[0]) * h.grid[0]; d = this.containment ? (!(f - this.offset.click.left < this.containment[0] || f - this.offset.click.left > this.containment[2]) ? f: (!(f - this.offset.click.left < this.containment[0]) ? f - h.grid[0] : f + h.grid[0])) : f } } return { top: (c - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollTop() : (i ? 0 : b.scrollTop())))), left: (d - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (a.browser.safari && this.cssPosition == "fixed" ? 0 : (this.cssPosition == "fixed" ? -this.scrollParent.scrollLeft() : i ? 0 : b.scrollLeft()))) } }, _rearrange: function (g, f, c, e) { c ? c[0].appendChild(this.placeholder[0]) : f.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == "down" ? f.item[0] : f.item[0].nextSibling)); this.counter = this.counter ? ++this.counter: 1; var d = this, b = this.counter; window.setTimeout(function () { if (b == d.counter) { d.refreshPositions(!e) } }, 0) }, _clear: function (d, e) { this.reverting = false; var f = [], b = this; if (!this._noFinalSort && this.currentItem[0].parentNode) { this.placeholder.before(this.currentItem) } this._noFinalSort = null; if (this.helper[0] == this.currentItem[0]) { for (var c in this._storedCSS) { if (this._storedCSS[c] == "auto" || this._storedCSS[c] == "static") { this._storedCSS[c] = "" } } this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else { this.currentItem.show() } if (this.fromOutside && !e) { f.push(function (g) { this._trigger("receive", g, this._uiHash(this.fromOutside)) }) } if ((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !e) { f.push(function (g) { this._trigger("update", g, this._uiHash()) }) } if (!a.ui.contains(this.element[0], this.currentItem[0])) { if (!e) { f.push(function (g) { this._trigger("remove", g, this._uiHash()) }) } for (var c = this.containers.length - 1; c >= 0; c--) { if (a.ui.contains(this.containers[c].element[0], this.currentItem[0]) && !e) { f.push((function (g) { return function (h) { g._trigger("receive", h, this._uiHash(this)) } }).call(this, this.containers[c])); f.push((function (g) { return function (h) { g._trigger("update", h, this._uiHash(this)) } }).call(this, this.containers[c])) } } } for (var c = this.containers.length - 1; c >= 0; c--) { if (!e) { f.push((function (g) { return function (h) { g._trigger("deactivate", h, this._uiHash(this)) } }).call(this, this.containers[c])) } if (this.containers[c].containerCache.over) { f.push((function (g) { return function (h) { g._trigger("out", h, this._uiHash(this)) } }).call(this, this.containers[c])); this.containers[c].containerCache.over = 0 } } if (this._storedCursor) { a("body").css("cursor", this._storedCursor) } if (this._storedOpacity) { this.helper.css("opacity", this._storedOpacity) } if (this._storedZIndex) { this.helper.css("zIndex", this._storedZIndex == "auto" ? "": this._storedZIndex) } this.dragging = false; if (this.cancelHelperRemoval) { if (!e) { this._trigger("beforeStop", d, this._uiHash()); for (var c = 0; c < f.length; c++) { f[c].call(this, d) } this._trigger("stop", d, this._uiHash()) } return false } if (!e) { this._trigger("beforeStop", d, this._uiHash()) } this.placeholder[0].parentNode.removeChild(this.placeholder[0]); if (this.helper[0] != this.currentItem[0]) { this.helper.remove() } this.helper = null; if (!e) { for (var c = 0; c < f.length; c++) { f[c].call(this, d) } this._trigger("stop", d, this._uiHash()) } this.fromOutside = false; return true }, _trigger: function () { if (a.widget.prototype._trigger.apply(this, arguments) === false) { this.cancel() } }, _uiHash: function (c) { var b = c || this; return { helper: b.helper, placeholder: b.placeholder || a([]), position: b.position, absolutePosition: b.positionAbs, offset: b.positionAbs, item: b.currentItem, sender: c ? c.element: null } } })); a.extend(a.ui.sortable, { getter: "serialize toArray", version: "1.7.1", eventPrefix: "sort", defaults: { appendTo: "parent", axis: false, cancel: ":input,option", connectWith: false, containment: false, cursor: "auto", cursorAt: false, delay: 0, distance: 1, dropOnEmpty: true, forcePlaceholderSize: false, forceHelperSize: false, grid: false, handle: false, helper: "original", items: "> *", opacity: false, placeholder: false, revert: false, scroll: true, scrollSensitivity: 20, scrollSpeed: 20, scope: "default", tolerance: "intersect", zIndex: 1000 } }) })(jQuery); var postboxes; (function (a) { postboxes = { add_postbox_toggles: function (c, b) { this.init(c, b); a(".postbox h3, .postbox .handlediv").click(function () { var e = a(this).parent(".postbox"), f = e.attr("id"); e.toggleClass("closed"); postboxes.save_state(c); if (f) { if (!e.hasClass("closed") && a.isFunction(postboxes.pbshow)) { postboxes.pbshow(f) } else { if (e.hasClass("closed") && a.isFunction(postboxes.pbhide)) { postboxes.pbhide(f) } } } }); a(".postbox h3 a").click(function (f) { f.stopPropagation() }); a(".hide-postbox-tog").click(function () { var e = a(this).val(); if (a(this).attr("checked")) { a("#" + e).show(); if (a.isFunction(postboxes.pbshow)) { postboxes.pbshow(e) } } else { a("#" + e).hide(); if (a.isFunction(postboxes.pbhide)) { postboxes.pbhide(e) } } postboxes.save_state(c) }); a('.columns-prefs input[type="radio"]').click(function () { var e = a(this).val(), f, g, h = a("#poststuff"); if (h.length) { if (e == 2) { h.addClass("has-right-sidebar"); a("#side-sortables").addClass("temp-border") } else { if (e == 1) { h.removeClass("has-right-sidebar"); a("#normal-sortables").append(a("#side-sortables").children(".postbox")) } } } else { for (f = 4; (f > e && f > 1); f--) { g = a("#" + d(f) + "-sortables"); a("#" + d(f - 1) + "-sortables").append(g.children(".postbox")); g.parent().hide() } for (f = 1; f <= e; f++) { g = a("#" + d(f) + "-sortables"); if (g.parent().is(":hidden")) { g.addClass("temp-border").parent().show() } } a(".postbox-container:visible").css("width", 98 / e + "%") } postboxes.save_order(c) }); function d(e) { switch (e) { case 1: return "normal"; break; case 2: return "side"; break; case 3: return "column3"; break; case 4: return "column4"; break; default: return "" } } }, init: function (c, b) { a.extend(this, b || {}); a("#wpbody-content").css("overflow", "hidden"); a(".meta-box-sortables").sortable({ placeholder: "sortable-placeholder", connectWith: ".meta-box-sortables", items: ".postbox", handle: ".hndle", cursor: "move", distance: 2, tolerance: "pointer", forcePlaceholderSize: true, helper: "clone", opacity: 0.65, start: function (f, d) { a("body").css({ WebkitUserSelect: "none", KhtmlUserSelect: "none" }) }, stop: function (f, d) { postboxes.save_order(c); d.item.parent().removeClass("temp-border"); a("body").css({ WebkitUserSelect: "", KhtmlUserSelect: "" }) } }) }, save_state: function (d) { var b = a(".postbox").filter(".closed").map(function () { return this.id }).get().join(","), c = a(".postbox").filter(":hidden").map(function () { return this.id }).get().join(","); a.post(postboxL10n.requestFile, { action: "closed-postboxes", closed: b, hidden: c, closedpostboxesnonce: jQuery("#closedpostboxesnonce").val(), page: d }) }, save_order: function (c) { var b, d = a(".columns-prefs input:checked").val() || 0; b = { action: "meta-box-order", _ajax_nonce: a("#meta-box-order-nonce").val(), page_columns: d, page: c }; a(".meta-box-sortables").each(function () { b["order[" + this.id.split("-")[0] + "]"] = a(this).sortable("toArray").join(",") }); a.post(postboxL10n.requestFile, b) }, pbshow: false, pbhide: false } } (jQuery)); var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad; jQuery(document).ready(function (a) { ajaxWidgets = ["dashboard_incoming_links", "dashboard_primary", "dashboard_secondary", "dashboard_plugins"]; ajaxPopulateWidgets = function (b) { show = function (g, c) { var f, d = a("#" + g + " div.inside:visible").find(".widget-loading"); if (d.length) { f = d.parent(); setTimeout(function () { f.load("index-extra.php?jax=" + g, "", function () { f.hide().slideDown("normal", function () { a(this).css("display", ""); if ("dashboard_plugins" == g && a.isFunction(tb_init)) { tb_init("#dashboard_plugins a.thickbox") } }) }) }, c * 500) } }; if (b) { b = b.toString(); if (a.inArray(b, ajaxWidgets) != -1) { show(b, 0) } } else { a.each(ajaxWidgets, function (c) { show(this, c) }) } }; ajaxPopulateWidgets(); postboxes.add_postbox_toggles("dashboard", { pbshow: ajaxPopulateWidgets }); quickPressLoad = function () { var b = a("#quickpost-action"), c; c = a("#quick-press").submit(function () { a("#dashboard_quick_press h3").append(''); a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled", "disabled"); if ("post" == b.val()) { b.val("post-quickpress-publish") } a("#dashboard_quick_press div.inside").load(c.attr("action"), c.serializeArray(), function () { a("#dashboard_quick_press h3 img").remove(); a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled", ""); a("#dashboard_quick_press ul").find("li").each(function () { a("#dashboard_recent_drafts ul").prepend(this) }).end().remove(); tb_init("a.thickbox"); quickPressLoad() }); return false }); a("#publish").click(function () { b.val("post-quickpress-publish") }) }; quickPressLoad() }); jQuery(document).ready(function (b) { var a = function () { var f = b("#TB_window"), e = b(window).width(), d = b(window).height(), c = (720 < e) ? 720 : e; if (f.size()) { f.width(c - 50).height(d - 45); b("#TB_iframeContent").width(c - 50).height(d - 75); f.css({ "margin-left": "-" + parseInt(((c - 50) / 2), 10) + "px" }); if (! (b.browser.msie && b.browser.version.substr(0, 1) < 7)) { f.css({ top: "20px", "margin-top": "0" }) } } return b("#dashboard_plugins a.thickbox, .plugins a.thickbox").each(function () { var g = b(this).attr("href"); if (!g) { return } g = g.replace(/&width=[0-9]+/g, ""); g = g.replace(/&height=[0-9]+/g, ""); b(this).attr("href", g + "&width=" + (c - 80) + "&height=" + (d - 85)) }) }; a().click(function () { b("#TB_title").css({ "background-color": "#222", color: "#cfcfcf" }); b("#TB_ajaxWindowTitle").html("" + plugininstallL10n.plugin_information + " " + b(this).attr("title")); return false }); b("#plugin-information #sidemenu a").click(function () { var c = b(this).attr("name"); b("#plugin-information-header a.current").removeClass("current"); b(this).addClass("current"); b("#section-holder div.section").hide(); b("#section-" + c).show(); return false }) }); /* * Thickbox 3.1 - One Box To Rule Them All. * By Cody Lindley (http://www.codylindley.com) * Copyright (c) 2007 cody lindley * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php */ var tb_pathToImage = "../wp-includes/js/thickbox/loadingAnimation.gif"; var tb_closeImage = "../wp-includes/js/thickbox/tb-close.png"; /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ //on page load call tb_init jQuery(document).ready(function () { tb_init('a.thickbox, area.thickbox, input.thickbox'); //pass where to apply thickbox imgLoader = new Image(); // preload image imgLoader.src = tb_pathToImage; }); //add thickbox to href & area elements that have a class of .thickbox function tb_init(domChunk) { jQuery(domChunk).click(function () { var t = this.title || this.name || null; var a = this.href || this.alt; var g = this.rel || false; tb_show(t, a, g); this.blur(); return false; }); } function tb_show(caption, url, imageGroup) { //function called when the user clicks on a thickbox link try { if (typeof document.body.style.maxHeight === "undefined") { //if IE 6 jQuery("body", "html").css({ height: "100%", width: "100%" }); jQuery("html").css("overflow", "hidden"); if (document.getElementById("TB_HideSelect") === null) { //iframe to hide select elements in ie6 jQuery("body").append("
"); jQuery("#TB_overlay").click(tb_remove); } } else { //all others if (document.getElementById("TB_overlay") === null) { jQuery("body").append(""); jQuery("#TB_overlay").click(tb_remove); } } if (tb_detectMacXFF()) { jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack"); //use png overlay so hide flash } else { jQuery("#TB_overlay").addClass("TB_overlayBG"); //use background and opacity } if (caption === null) { caption = ""; } jQuery("body").append(""); //add loader to the page jQuery('#TB_load').show(); //show loader var baseURL; if (url.indexOf("?") !== -1) { //ff there is a query string involved baseURL = url.substr(0, url.indexOf("?")); } else { baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if (urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp') { //code to show images TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if (imageGroup) { TB_TempArray = jQuery("a[rel=" + imageGroup + "]").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (! (TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = " Next >"; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = " < Prev"; } } else { TB_FoundURL = true; TB_imageCount = "Image " + (TB_Counter + 1) + " of " + (TB_TempArray.length); } } } imgPreloader = new Image(); imgPreloader.onload = function () { imgPreloader.onload = null; // Resizing large images - orginal by Christian Montoya edited by me. var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; jQuery("#TB_window").append("" + ""); jQuery("#TB_closeWindowButton").click(tb_remove); if (! (TB_PrevHTML === "")) { function goPrev() { if (jQuery(document).unbind("click", goPrev)) { jQuery(document).unbind("click", goPrev); } jQuery("#TB_window").remove(); jQuery("body").append(""); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } jQuery("#TB_prev").click(goPrev); } if (! (TB_NextHTML === "")) { function goNext() { jQuery("#TB_window").remove(); jQuery("body").append(""); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } jQuery("#TB_next").click(goNext); } document.onkeydown = function (e) { if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if (keycode == 27) { // close tb_remove(); } else if (keycode == 190) { // display previous image if (! (TB_NextHTML == "")) { document.onkeydown = ""; goNext(); } } else if (keycode == 188) { // display next image if (! (TB_PrevHTML == "")) { document.onkeydown = ""; goPrev(); } } }; tb_position(); jQuery("#TB_load").remove(); jQuery("#TB_ImageOff").click(tb_remove); jQuery("#TB_window").css({ display: "block" }); //for safari using css instead of show }; imgPreloader.src = url; } else { //code to show html var queryString = url.replace(/^[^\?]+\??/, ''); var params = tb_parseQuery(queryString); TB_WIDTH = (params['width'] * 1) + 30 || 630; //defaults to 630 if no paramaters were added to URL TB_HEIGHT = (params['height'] * 1) + 40 || 440; //defaults to 440 if no paramaters were added to URL ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if (url.indexOf('TB_iframe') != -1) { // either iframe or ajax window urlNoQuery = url.split('TB_'); jQuery("#TB_iframeContent").remove(); if (params['modal'] != "true") { //iframe no modal jQuery("#TB_window").append(""); } else { //iframe modal jQuery("#TB_overlay").unbind(); jQuery("#TB_window").append(""); } } else { // not an iframe, ajax if (jQuery("#TB_window").css("display") != "block") { if (params['modal'] != "true") { //ajax no modal jQuery("#TB_window").append(""); } else { //ajax modal jQuery("#TB_overlay").unbind(); jQuery("#TB_window").append(""); } } else { //this means the window is already up, we are just loading new content via ajax jQuery("#TB_ajaxContent")[0].style.width = ajaxContentW + "px"; jQuery("#TB_ajaxContent")[0].style.height = ajaxContentH + "px"; jQuery("#TB_ajaxContent")[0].scrollTop = 0; jQuery("#TB_ajaxWindowTitle").html(caption); } } jQuery("#TB_closeWindowButton").click(tb_remove); if (url.indexOf('TB_inline') != -1) { jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children()); jQuery("#TB_window").unload(function () { jQuery('#' + params['inlineId']).append(jQuery("#TB_ajaxContent").children()); // move elements back when you're finished }); tb_position(); jQuery("#TB_load").remove(); jQuery("#TB_window").css({ display: "block" }); } else if (url.indexOf('TB_iframe') != -1) { tb_position(); if ($.browser.safari) { //safari needs help because it will not fire iframe onload jQuery("#TB_load").remove(); jQuery("#TB_window").css({ display: "block" }); } } else { jQuery("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()), function () { //to do a post change this load method tb_position(); jQuery("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox"); jQuery("#TB_window").css({ display: "block" }); }); } } if (!params['modal']) { document.onkeyup = function (e) { if (e == null) { // ie keycode = event.keyCode; } else { // mozilla keycode = e.which; } if (keycode == 27) { // close tb_remove(); } }; } } catch(e) { //nothing here } } //helper functions below function tb_showIframe() { jQuery("#TB_load").remove(); jQuery("#TB_window").css({ display: "block" }); } function tb_remove() { jQuery("#TB_imageOff").unbind("click"); jQuery("#TB_closeWindowButton").unbind("click"); jQuery("#TB_window").fadeOut("fast", function () { jQuery('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove(); }); jQuery("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") { //if IE 6 jQuery("body", "html").css({ height: "auto", width: "auto" }); jQuery("html").css("overflow", ""); } document.onkeydown = ""; document.onkeyup = ""; return false; } function tb_position() { var isIE6 = typeof document.body.style.maxHeight === "undefined"; jQuery("#TB_window").css({ marginLeft: '-' + parseInt((TB_WIDTH / 2), 10) + 'px', width: TB_WIDTH + 'px' }); if (!isIE6) { // take away IE6 jQuery("#TB_window").css({ marginTop: '-' + parseInt((TB_HEIGHT / 2), 10) + 'px' }); } } function tb_parseQuery(query) { var Params = {}; if (!query) { return Params; } // return empty object var Pairs = query.split(/[;&]/); for (var i = 0; i < Pairs.length; i++) { var KeyVal = Pairs[i].split('='); if (!KeyVal || KeyVal.length != 2) { continue; } var key = unescape(KeyVal[0]); var val = unescape(KeyVal[1]); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize() { var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de && de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de && de.clientHeight) || document.body.clientHeight; arrayPageSize = [w, h]; return arrayPageSize; } function tb_detectMacXFF() { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox') != -1) { return true; } } function send_to_editor(b) { var a; if (typeof tinyMCE != "undefined" && (a = tinyMCE.activeEditor) && !a.isHidden()) { a.focus(); if (tinymce.isIE) { a.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark) } if (b.indexOf("[caption") === 0) { if (a.plugins.wpeditimage) { b = a.plugins.wpeditimage._do_shcode(b) } } else { if (b.indexOf("[gallery") === 0) { if (a.plugins.wpgallery) { b = a.plugins.wpgallery._do_gallery(b) } } } a.execCommand("mceInsertContent", false, b) } else { if (typeof edInsertContent == "function") { edInsertContent(edCanvas, b) } else { jQuery(edCanvas).val(jQuery(edCanvas).val() + b) } } tb_remove() } var tb_position; (function (a) { tb_position = function () { var e = a("#TB_window"), d = a(window).width(), c = a(window).height(), b = (720 < d) ? 720 : d; if (e.size()) { e.width(b - 50).height(c - 45); a("#TB_iframeContent").width(b - 50).height(c - 75); e.css({ "margin-left": "-" + parseInt(((b - 50) / 2), 10) + "px" }); if (typeof document.body.style.maxWidth != "undefined") { e.css({ top: "20px", "margin-top": "0" }) } } return a("a.thickbox").each(function () { var f = a(this).attr("href"); if (!f) { return } f = f.replace(/&width=[0-9]+/g, ""); f = f.replace(/&height=[0-9]+/g, ""); a(this).attr("href", f + "&width=" + (b - 80) + "&height=" + (c - 85)) }) }; a(window).resize(function () { tb_position() }) })(jQuery); jQuery(document).ready(function (a) { a("a.thickbox").click(function () { if (typeof tinyMCE != "undefined" && tinyMCE.activeEditor) { tinyMCE.get("content").focus(); tinyMCE.activeEditor.windowManager.bookmark = tinyMCE.activeEditor.selection.getBookmark("simple") } }) }); if (typeof wpOnload == 'function') wpOnload();