mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-22 03:37:25 +08:00
Handle UnsafeUrl and RemoveUrl clicks now and always for any future elements.
This commit is contained in:
@@ -223,7 +223,7 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
var magicToken = $("input[name=__RequestVerificationToken]").first();
|
var magicToken = $("input[name=__RequestVerificationToken]").first();
|
||||||
if (!magicToken) { return; } // no sense in continuing if form POSTS will fail
|
if (!magicToken) { return; } // no sense in continuing if form POSTS will fail
|
||||||
$("a[itemprop~=UnsafeUrl]").on("click", function() {
|
$("body").on("click", "a[itemprop~=UnsafeUrl]", function() {
|
||||||
var _this = $(this);
|
var _this = $(this);
|
||||||
var hrefParts = _this.attr("href").split("?");
|
var hrefParts = _this.attr("href").split("?");
|
||||||
var form = $("<form action=\"" + hrefParts[0] + "\" method=\"POST\" />");
|
var form = $("<form action=\"" + hrefParts[0] + "\" method=\"POST\" />");
|
||||||
|
@@ -62,7 +62,7 @@
|
|||||||
$(this).closest("form").find(".apply-bulk-actions-auto:first").click();
|
$(this).closest("form").find(".apply-bulk-actions-auto:first").click();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("[itemprop~='RemoveUrl']").click(function () {
|
$("body").on("click", "[itemprop~='RemoveUrl']", function () {
|
||||||
// don't show the confirm dialog if the link is also UnsafeUrl, as it will already be handled in base.js
|
// don't show the confirm dialog if the link is also UnsafeUrl, as it will already be handled in base.js
|
||||||
if ($(this).filter("[itemprop~='UnsafeUrl']").length == 1) {
|
if ($(this).filter("[itemprop~='UnsafeUrl']").length == 1) {
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user