Skip to content

Commit

Permalink
Item15189: fixed preview function
Browse files Browse the repository at this point in the history
broken when a redirectto parameter is in the edit url
  • Loading branch information
MichaelDaum committed Apr 26, 2023
1 parent f3570be commit ce95d9d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
5 changes: 3 additions & 2 deletions NatEditPlugin/data/System/NatEditPlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1673955959" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1682492438" format="1.1" version="1"}%
---+!! Natural Edit Plugin
%FORMFIELD{"Description"}%

Expand Down Expand Up @@ -62,6 +62,7 @@ is sufficient.
---++ Change History

%TABLE{columnwidths="7em" tablewidth="100%"}%
| 26 Apr 2023 | Foswikitask:Item15189: fixed redirectto parameter breaking preview function |
| 17 Jan 2023 | Foswikitask:Item15178: wrong set of permissions selecting "registered users" access in natedit |
| 25 Jul 2022 | Foswikitask:Item15160: use custom rest handler for the permissions editor |
| 18 May 2022 | Foswikitask:Item15131: natedit doesn't validate mandatory formfields properly |
Expand Down Expand Up @@ -201,4 +202,4 @@ is sufficient.
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/distro"}%
%META:FIELD{name="Support" title="Support" value="http://foswiki.org/Support/%25$ROOTMODULE%25"}%
%META:FIELD{name="Version" title="Version" value="%25$VERSION%25"}%
%META:FILEATTACHMENT{name="screenshot1.png" attr="h" comment="" date="1673955959" size="104954" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="screenshot1.png" attr="h" comment="" date="1682492438" size="104954" user="ProjectContributor" version="1"}%
4 changes: 2 additions & 2 deletions NatEditPlugin/lib/Foswiki/Plugins/NatEditPlugin.pm
Expand Up @@ -30,8 +30,8 @@ BEGIN {
}
}

our $VERSION = '9.60';
our $RELEASE = '17 Jan 2023';
our $VERSION = '9.61';
our $RELEASE = '26 Apr 2023';
our $NO_PREFS_IN_TOPIC = 1;
our $SHORTDESCRIPTION = 'A Wikiwyg Editor';
our $baseWeb;
Expand Down
@@ -1,4 +1,4 @@
# Copyright (C) 2007-2022 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2007-2023 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
@@ -1,4 +1,4 @@
# Copyright (C) 2007-2022 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2007-2023 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion NatEditPlugin/lib/Foswiki/Plugins/NatEditPlugin/NATEDIT.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# Copyright (C) 2006-2022 Michael Daum, http://michaeldaumconsulting.com
# Copyright (C) 2006-2023 Michael Daum, http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
@@ -1,4 +1,4 @@
# Copyright (C) 2013-2022 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2013-2023 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
@@ -1,4 +1,4 @@
# Copyright (C) 2013-2022 Michael Daum http://michaeldaumconsulting.com
# Copyright (C) 2013-2023 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand Down
@@ -1,7 +1,7 @@
/*
* jQuery NatEdit plugin
*
* Copyright (c) 2008-2022 Michael Daum http://michaeldaumconsulting.com
* Copyright (c) 2008-2023 Michael Daum http://michaeldaumconsulting.com
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
Expand Down Expand Up @@ -1129,6 +1129,9 @@ $.NatEditor.prototype.preview = function() {
self.beforeSubmit("preview").then(function() {
self.form.ajaxSubmit({
url: foswiki.getScriptUrl("rest", "NatEditPlugin", "save"),
beforeSerialize:function() {
self.form.find("input[name=redirectto]").prop('disabled',true);
},
beforeSubmit: function() {
self.hideMessages();
$.blockUI({
Expand All @@ -1153,6 +1156,9 @@ $.NatEditor.prototype.preview = function() {

data = data.replace(/%width%/g, width).replace(/%height%/g, height);
$("body").append(data);
},
complete: function() {
self.form.find("input[name=redirectto]").prop('disabled',false);
}
});
});
Expand Down

0 comments on commit ce95d9d

Please sign in to comment.