Skip to content

Commit

Permalink
Item14288: merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Sep 13, 2017
2 parents 173cb34 + 6f63e8c commit 7f54afb
Show file tree
Hide file tree
Showing 32 changed files with 271 additions and 156 deletions.
3 changes: 2 additions & 1 deletion ConfigurePlugin/data/System/ConfigurePlugin.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1491685944" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1505301976" format="1.1" version="1"}%
%META:TOPICPARENT{name="Plugins"}%
---+!! Configure Plugin
%FORMFIELD{"Description"}%
Expand Down Expand Up @@ -42,6 +42,7 @@ The plugin uses the =JsonRpcContrib=, which must be installed.

---++ Change History

| 05 Sep 2017: | (1.09) Foswikitask:Item14472: replaced use of =attr()= with =prop()= where needed; fixed use of =null= value trying to trim values |
| 04 Apr 2017: | (1.08) Foswikitask:Item13883: Updated base template to suggest solutions when configure shows base login page.<br/>\
Foswikitask:Item14366: Reorder initialization to allow local CGI::Carp |
| 23 Jan 2017: | (1.07) Foswikitask:Item14287: Configure needs to encode reported configuration values. |
Expand Down
4 changes: 2 additions & 2 deletions ConfigurePlugin/lib/Foswiki/Plugins/ConfigurePlugin.pm
Expand Up @@ -31,8 +31,8 @@ package Foswiki::Plugins::ConfigurePlugin;
use strict;
use warnings;

our $VERSION = '1.08';
our $RELEASE = '04 Apr 2017';
our $VERSION = '1.09';
our $RELEASE = '05 Sep 2017';
our $SHORTDESCRIPTION = '=configure= interface using json-rpc';
our $NO_PREFS_IN_TOPIC = 1;

Expand Down
Expand Up @@ -650,7 +650,7 @@ function _id_ify(id) {
$butt = $('<input type="checkbox" id="' + id + '">').appendTo($buttons);
$butt.click(function() {
if ( $(this).attr("checked") ) {
$ui.removeAttr("disabled");
$ui.prop("disabled", false);
$node.removeClass("disabled");
} else {
$ui.attr("disabled", "disabled");
Expand All @@ -667,7 +667,7 @@ function _id_ify(id) {
$ui.attr("disabled", "disabled");
$node.addClass("disabled");
} else {
$butt.attr("checked", "checked");
$butt.prop("checked", true);
}
$butt.appendTo($buttons);
$("<label for='"+id+"'> enable</label>")
Expand Down Expand Up @@ -896,7 +896,7 @@ if (0) {
add_dependency(
entry.ENABLE_IF, $node, function($n, tf) {
if (tf) {
$n.find("input,textarea").removeAttr('disabled');
$n.find("input,textarea").prop('disabled', false);
} else {
$n.find("input,textarea")
.attr('disabled', 'disabled');
Expand Down
34 changes: 19 additions & 15 deletions ConfigurePlugin/pub/System/ConfigurePlugin/types.uncompressed.js
Expand Up @@ -45,7 +45,7 @@ var Types = {};
this.useVal(val);
}
if (this.spec.SPELLCHECK) {
this.$ui.attr('spellcheck', 'true');
this.$ui.prop('spellcheck', true);
}
if (typeof(change_handler) !== "undefined") {
this.$ui.change(change_handler);
Expand Down Expand Up @@ -133,7 +133,7 @@ var Types = {};
}

if (this.spec.current_value !== 0) {
this.$ui.attr('checked', true);
this.$ui.prop('checked', true);
}
if (this.spec.extraClass) {
this.$ui.addClass(this.spec.extraClass);
Expand Down Expand Up @@ -165,15 +165,15 @@ var Types = {};
} else if ( val == '1') {
val = true;
}
this.$ui.attr('checked', val );
this.$ui.prop('checked', val );
}
});

Types.PASSWORD = Types.STRING.extend({
createUI: function(change_handler) {
this._super(change_handler);
this.$ui.attr('type', 'password');
this.$ui.attr('autocomplete', 'off');
this.$ui.prop('autocomplete', false);
return this.$ui;
}
});
Expand Down Expand Up @@ -252,8 +252,10 @@ var Types = {};
isDefault: function() {
// To do this comparison requires parsing and rewriting the perl to
// javascript. Not impossible, but tricky.
var a = this.currentValue().trim(),
b = this.spec['default'].trim(), av, bv;
var a = this.currentValue(),
b = this.spec['default'], av, bv;
a = (a == null) ? null : a.trim();
b = (b == null) ? null : b.trim();
try {
// See if they parse as JS - they probably will! If they don't,
// parse, fall back to a string comparison :-(
Expand Down Expand Up @@ -308,7 +310,7 @@ var Types = {};
Types.PATHINFO = Types.STRING.extend({
createUI: function(change_handler) {
this._super(change_handler);
this.$ui.attr('readonly', 'readonly');
this.$ui.prop('readonly', true);
return this.$ui;
}
});
Expand Down Expand Up @@ -340,8 +342,8 @@ var Types = {};
Types.NULL = Types.BaseType.extend({
createUI: function(change_handler) {
this._super(change_handler);
this.$ui.attr('readonly', 'readonly');
this.$ui.attr('disabled', 'disabled');
this.$ui.prop('readonly', true);
this.$ui.prop('disabled', true);
this.$ui.attr('size', '1');
return this.$ui;
}
Expand Down Expand Up @@ -392,7 +394,7 @@ var Types = {};
this.$ui.change(change_handler);
}
if (this.spec.MULTIPLE) {
this.$ui.attr('multiple', 'multiple');
this.$ui.prop('multiple', true);
}

if (typeof(this.spec.select_from) !== "undefined") {
Expand All @@ -401,7 +403,7 @@ var Types = {};
opt = this.spec.select_from[i];
$option = $('<option>' + opt + '</option>');
if (sel[opt]) {
$option.attr('selected', 'selected');
$option.prop('selected', true);
}
this.$ui.append($option);
}
Expand All @@ -420,17 +422,19 @@ var Types = {};
this.$ui.find('option').each(function() {
var opt = sf[i++];
if (sel[opt]) {
$(this).attr('selected', 'selected');
$(this).prop('selected', true);
} else {
$(this).removeAttr('selected');
$(this).prop('selected', false);
}
});
}
},

isDefault: function() {
var a = this.currentValue().trim(),
b = this.spec['default'].trim();
var a = this.currentValue(),
b = this.spec['default'];
a = (a == null) ? null : a.trim();
b = (b == null) ? null : b.trim();
b = b.replace(/^\s*(["'])(.*?)\1\s*/, "$2");
return a === b;
}
Expand Down
15 changes: 8 additions & 7 deletions HistoryPlugin/data/System/HistoryPlugin.txt
@@ -1,8 +1,8 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1441729129" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1505301976" format="1.1" version="1"}%
%META:TOPICPARENT{name="Plugins"}%
---+ History Plugin

%$SHORTDESCRIPTION%.
%FORMFIELD{"Description"}%.

The output can arbitrarily be formatted. An example for a Wikipedia-like history is included.

Expand Down Expand Up @@ -63,10 +63,11 @@ __Note:__ You do not need to install anything on the browser to use this plugin.

---++ Plugin Info
<!--
* Set SHORTDESCRIPTION = Shows a complete history of a document
* Set SHORTDESCRIPTION = %$SHORTDESCRIPTION%
-->

| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 01 Sep 2017: | 1.14 fixed formatting of date tokens |
| 08 Sep 2015: | 1.13 Remove RevCommentPlugin hooks from the templates. |
| 15 Mar 2015: | 1.12 Version released with Foswiki 2.0 Foswikitask:Item12881: Add HISTORYPLUGIN_NREV setting. |
| 28 Nov 2012: | 1.11 Version released with Foswiki 1.1.6. Change to perl version strings |
Expand Down Expand Up @@ -94,12 +95,12 @@ __Note:__ You do not need to install anything on the browser to use this plugin.
__Related Topics:__ %SYSTEMWEB%.%WIKIPREFSTOPIC%, %LOCALSITEPREFS%, [[%SYSTEMWEB%.Plugins][Plugins]]

%META:FORM{name="PackageForm"}%
%META:FIELD{name="Copyright" title="Copyright" value=" 2006, !JChristophFuchs; 2008-2015 Kenneth Lavrsen and Foswiki Contributors"}%
%META:FIELD{name="Home" title="Home" value="http://foswiki.org/Extensions/HistoryPlugin"}%
%META:FIELD{name="Copyright" title="Copyright" value=" 2006, !JChristophFuchs; 2008-2017 Kenneth Lavrsen and Foswiki Contributors"}%
%META:FIELD{name="Home" title="Home" value="https://foswiki.org/Extensions/HistoryPlugin"}%
%META:FIELD{name="Release" title="Release" value="%25$RELEASE%25"}%
%META:FIELD{name="License" title="License" value="GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]])"}%
%META:FIELD{name="Version" title="Version" value="%25$VERSION%25"}%
%META:FIELD{name="Author" title="Author" value="Foswiki:Main.KennethLavrsen"}%
%META:FIELD{name="Support" title="Support" value="http://foswiki.org/Support/HistoryPlugin"}%
%META:FIELD{name="Support" title="Support" value="https://foswiki.org/Support/HistoryPlugin"}%
%META:FIELD{name="Repository" title="Repository" value="https://github.com/foswiki/distro"}%
%META:FILEATTACHMENT{name="screenshot.png" attr="h" comment="" date="1441729129" size="72043" user="ProjectContributor" version="1"}%
%META:FILEATTACHMENT{name="screenshot.png" attr="h" comment="" date="1505301976" size="72043" user="ProjectContributor" version="1"}%
13 changes: 7 additions & 6 deletions HistoryPlugin/lib/Foswiki/Plugins/HistoryPlugin.pm
Expand Up @@ -10,8 +10,8 @@ use Foswiki::AccessControlException ();

# =========================
# Simple decimal version, no leading "v"
our $VERSION = "1.13";
our $RELEASE = '1.13';
our $VERSION = "1.14";
our $RELEASE = '01 Sep 2017';
our $NO_PREFS_IN_TOPIC = 1;
our $SHORTDESCRIPTION = 'Shows a complete history of a topic';

Expand Down Expand Up @@ -156,7 +156,7 @@ sub _handleHistory {
$revinfo =~ s/\$rev/$rev/g;
$revinfo =~ s/\$date/Foswiki::Func::formatTime($date)/ge;
$revinfo =~
s/\$(year|ye|week|web|wday|tz|topic|time|seconds|rev|rcs|month|mo|minutes|longdate|isotz|iso|http|hours|epoch|email|dow|day)/_formatTime("\$$1", $topic, $web)/ge;
s/\$(year|ye|week|web|wday|tz|topic|time|seconds|rev|rcs|month|mo|minutes|longdate|isotz|iso|http|hours|epoch|email|dow|day)/_formatTime("\$$1", $web, $topic, $rev)/ge;
$revinfo =~ s/\$username/$user/g;
$revinfo =~ s/\$wikiname/$wikiName/g;
$revinfo =~ s/\$wikiusername/$wikiUserName/g;
Expand All @@ -177,9 +177,10 @@ s/\$(year|ye|week|web|wday|tz|topic|time|seconds|rev|rcs|month|mo|minutes|longda
}

sub _formatTime {
my ( $format, $topic, $web ) = @_;
my ( $format, $web, $topic, $rev ) = @_;

return Foswiki::Func::expandCommonVariables( '%REVINFO{"' . $format . '"}%',
return Foswiki::Func::expandCommonVariables(
'%REVINFO{"' . $format . '" rev="' . $rev . '"}%',
$topic, $web );
}

Expand Down Expand Up @@ -248,7 +249,7 @@ sub _handleHeadFoot {
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2008-2015 Foswiki Contributors. Foswiki Contributors
Copyright (C) 2008-2017 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
Expand Down
4 changes: 2 additions & 2 deletions PatternSkin/data/System/WebCreateNewTopicComponents.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" date="1449867281" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" date="1505301976" format="1.1" version="1"}%
%META:TOPICPARENT{name="WebHome"}%
---+!! <nop>%TOPIC%
This topic is meant for developers. It contains =INCLUDE= sections to build a "create new topic" form.
Expand Down Expand Up @@ -105,7 +105,7 @@ This is the code used in the [[%SANDBOXWEB%.%HOMETOPIC%]] form:
}%%ADDTOZONE{"head"
tag="WebCreateNewTopicTemplate:META"
text="<noautolink><literal><meta name='foswiki.webTopicCreator.nameFeedback' content='%MAKETEXT{"Topic will be named: "}%' />
<meta name='foswiki.webTopicCreator.errorFeedbackNoWikiName' content='<p class=\"foswikiGrayText\">%MAKETEXT{"Enter the topic name as WikiWord or check the allow non-Wiki Word box."}%</p>' /></literal></noautolink>"
<meta name='foswiki.webTopicCreator.errorFeedbackNoWikiName' content='<p class=\"foswikiGrayText\">%ENCODE{"%MAKETEXT{"Enter the topic name as WikiWord or check the allow non-Wiki Word box."}%" type="entity"}%</p>' /></literal></noautolink>"
requires=""
}%%ENDSECTION{"js"}%

Expand Down
Expand Up @@ -89,6 +89,13 @@ sub CALC {
my $rsltR = Foswiki::Func::expandCommonVariables($calcR);

if ($ne) {
my $i = 1;
while ( $rsltC eq $rsltR ) {
$rsltR = Foswiki::Func::expandCommonVariables($calcR);
print STDERR "RETRY For NE\n";
$i++;
last if ( $i == 5 );
}
$this->assert_str_not_equals( $rsltC, $rsltR );
}
else {
Expand Down
Expand Up @@ -447,7 +447,7 @@ m/^\s+\*\s($Foswiki::regex{webNameRegex}\.)?($Foswiki::regex{wikiWordRegex})\s*(
$entry .= $odate;
}
else {
print STDERR "6: Appending $today to $entry NL $line \n";
#print STDERR "6: Appending $today to $entry NL $line \n";
$entry .= $today . "\n" . $line;
}

Expand Down
17 changes: 17 additions & 0 deletions UnitTestContrib/test/unit/DependencyTests.pm
Expand Up @@ -346,6 +346,23 @@ sub test_check_dep_version_with_underscore {

}

sub test_check_dep_version_oddball_DBI {
my ($this) = @_;

# Check a normal installed dependency with a version number that includes _
# 1, Algorithm::Diff v1.19_01 installed
my $dep = new Foswiki::Configure::Dependency(
type => "perl",
module => "DBI",
version => ">=1"
);
my ( $ok, $message ) = $dep->checkDependency();
$this->assert_equals( 1, $ok );
$this->assert_matches( qr/DBI version \d+\.\d+(?:_\d+)? installed/,
$message );

}

sub test_compare_extension_versions {
my ($this) = @_;

Expand Down
19 changes: 12 additions & 7 deletions WysiwygPlugin/lib/Foswiki/Plugins/WysiwygPlugin/HTML2TML.pm
Expand Up @@ -196,13 +196,18 @@ DEFAULT
$text =~ s/\&\#x22;/\&quot;/goi;
$text =~ s/\&\#160;/\&nbsp;/goi;

# SMELL: Item11912 These are left behind by TMCE as zero width characters
# surrounding italics and bold inserted by Ctrl-i and Ctrl-b
# We really ought to have a better solution. TMCE is supposed
# to handle this it the cleanup routine, but it doesn't happen,
# and cleanup routine has been deprecated.
$text =~ s/&#xFEFF;//g; # TMCE 3.5.x
$text =~ s/&#x200B;//g; # TMCE pre 3.5
# Item11912 Item14420 Zero-width space (x200B) and Non-breaking
# zero-width space (xFEFF) are left behind by TinyMCE with
# italics and bold inserted by Ctrl-i and Ctrl-b. This is probably
# a TinyMCE bug, but in general these characters are useless in TML
# so we strip them in all their forms anyway.
foreach my $d ( 0xFEFF, 0x200B ) {
$text =~ s/&#$d;//g; # decimal entity
my $c = chr($d);
$text =~ s/$c//g;
my $h = sprintf( "%04x", $d );
$text =~ s/&#x$h;//g; # hex entity
}

HTML::Entities::_decode_entities( $text, safeEntities() );

Expand Down

0 comments on commit 7f54afb

Please sign in to comment.