Skip to content

Commit

Permalink
Item13897: NatEditPlugin conversion & tests fixes.
Browse files Browse the repository at this point in the history
Fixed a number of tests failing because of non-English localization.
Disabling locales whenever necessary.

Some tests are failing due to Request::Cache not being compatible with
uploads attribute (expecting hash, now array).

NatEditPlugin doesn't save, needs investigation.

- Added leaks detection to foswiki_debug.psgi
  • Loading branch information
vrurg committed Jul 7, 2016
1 parent 4ac91aa commit ab60364
Show file tree
Hide file tree
Showing 34 changed files with 268 additions and 280 deletions.
31 changes: 11 additions & 20 deletions JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/UI/ACCORDION.pm
Expand Up @@ -3,8 +3,8 @@ package Foswiki::Plugins::JQueryPlugin::UI::ACCORDION;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
use Moo;
extends qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
Expand All @@ -22,24 +22,15 @@ Constructor
=cut

sub new {
my $class = shift;

my $this = bless(
$class->SUPER::new(
name => 'UI::Accordion',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/accordion/',
javascript => ['jquery.ui.accordion.init.js'],
dependencies => [ 'ui', ],
),
$class
);

return $this;
}
our %pluginParams = (
name => 'UI::Accordion',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/accordion/',
javascript => ['jquery.ui.accordion.init.js'],
dependencies => [ 'ui', ],
);

1;

Expand Down
31 changes: 11 additions & 20 deletions JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/UI/AUTOCOMPLETE.pm
Expand Up @@ -3,8 +3,8 @@ package Foswiki::Plugins::JQueryPlugin::UI::AUTOCOMPLETE;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
use Moo;
extends qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
Expand All @@ -22,24 +22,15 @@ Constructor
=cut

sub new {
my $class = shift;

my $this = bless(
$class->SUPER::new(
name => 'UI::Autocomplete',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/autocomplete/',
javascript => ['jquery.ui.autocomplete.init.js'],
dependencies => [ 'ui', ],
),
$class
);

return $this;
}
our %pluginParams = (
name => 'UI::Autocomplete',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/autocomplete/',
javascript => ['jquery.ui.autocomplete.init.js'],
dependencies => [ 'ui', ],
);

1;

Expand Down
31 changes: 11 additions & 20 deletions JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/UI/BUTTON.pm
Expand Up @@ -4,8 +4,8 @@ package Foswiki::Plugins::JQueryPlugin::UI::BUTTON;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
use Moo;
extends qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
Expand All @@ -23,24 +23,15 @@ Constructor
=cut

sub new {
my $class = shift;

my $this = bless(
$class->SUPER::new(
name => 'UI::Button',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/button/',
javascript => ['jquery.ui.button.init.js'],
dependencies => [ 'ui', ],
),
$class
);

return $this;
}
our %pluginParams = (
name => 'UI::Button',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/button/',
javascript => ['jquery.ui.button.init.js'],
dependencies => [ 'ui', ],
);

1;

Expand Down
41 changes: 17 additions & 24 deletions JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/UI/DATEPICKER.pm
Expand Up @@ -22,24 +22,15 @@ Constructor
=cut

sub new {
my $class = shift;

my $this = bless(
$class->SUPER::new(
name => 'UI::Datepicker',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/datepicker/',
javascript => ['jquery.ui.datepicker.init.js'],
dependencies => [ 'ui', 'livequery' ],
),
$class
);

return $this;
}
our %pluginParams = (
name => 'UI::Datepicker',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/datepicker/',
javascript => ['jquery.ui.datepicker.init.js'],
dependencies => [ 'ui', 'livequery' ],
);

=begin TML
Expand All @@ -49,28 +40,30 @@ Initialize this plugin by adding the required static files to the page
=cut

sub init {
around init => sub {
my $orig = shift;
my $this = shift;

return unless $this->SUPER::init();
return unless $orig->( $this, @_ );

# open matching localization file if it exists
my $app = $this->app;
my $cfgData = $app->cfg->data;
my $langTag = $app->i18n->language();
my $messagePath =
$Foswiki::cfg{SystemWebName}
$cfgData->{SystemWebName}
. '/JQueryPlugin/i18n/jquery.ui.datepicker-'
. $langTag . '.js';

my $messageFile = $Foswiki::cfg{PubDir} . '/' . $messagePath;
my $messageFile = $cfgData->{PubDir} . '/' . $messagePath;
if ( -f $messageFile ) {
Foswiki::Func::addToZone(
'script', "JQUERYPLUGIN::UI::LANG",
<<"HERE", 'JQUERYPLUGIN::UI' );
<script type='text/javascript' src='$Foswiki::cfg{PubUrlPath}/$messagePath'></script>
<script type='text/javascript' src='$cfgData->{PubUrlPath}/$messagePath'></script>
HERE
}
}
};

1;

Expand Down
31 changes: 11 additions & 20 deletions JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/UI/DRAGGABLE.pm
Expand Up @@ -3,8 +3,8 @@ package Foswiki::Plugins::JQueryPlugin::UI::DRAGGABLE;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
use Moo;
extends qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
Expand All @@ -22,24 +22,15 @@ Constructor
=cut

sub new {
my $class = shift;

my $this = bless(
$class->SUPER::new(
name => 'UI::Draggable',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/draggable/',
javascript => ['jquery.ui.draggable.init.js'],
dependencies => [ 'ui', ],
),
$class
);

return $this;
}
our %pluginParams = (
name => 'UI::Draggable',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/draggable/',
javascript => ['jquery.ui.draggable.init.js'],
dependencies => [ 'ui', ],
);

1;

Expand Down
31 changes: 11 additions & 20 deletions JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/UI/PROGRESSBAR.pm
Expand Up @@ -3,8 +3,8 @@ package Foswiki::Plugins::JQueryPlugin::UI::PROGRESSBAR;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
use Moo;
extends qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
Expand All @@ -22,24 +22,15 @@ Constructor
=cut

sub new {
my $class = shift;

my $this = bless(
$class->SUPER::new(
name => 'UI::Progressbar',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/progressbar/',
javascript => ['jquery.ui.progressbar.init.js'],
dependencies => [ 'ui', ],
),
$class
);

return $this;
}
our %pluginParams = (
name => 'UI::Progressbar',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/progressbar/',
javascript => ['jquery.ui.progressbar.init.js'],
dependencies => [ 'ui', ],
);

1;

Expand Down
31 changes: 11 additions & 20 deletions JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/UI/RESIZABLE.pm
Expand Up @@ -3,8 +3,8 @@ package Foswiki::Plugins::JQueryPlugin::UI::RESIZABLE;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
use Moo;
extends qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
Expand All @@ -22,24 +22,15 @@ Constructor
=cut

sub new {
my $class = shift;

my $this = bless(
$class->SUPER::new(
name => 'UI::Resizable',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/resizable/',
javascript => ['jquery.ui.resizable.init.js'],
dependencies => [ 'ui', ],
),
$class
);

return $this;
}
our %pluginParams = (
name => 'UI::Resizable',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/resizable/',
javascript => ['jquery.ui.resizable.init.js'],
dependencies => [ 'ui', ],
);

1;

Expand Down
31 changes: 11 additions & 20 deletions JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/UI/SLIDER.pm
Expand Up @@ -3,8 +3,8 @@ package Foswiki::Plugins::JQueryPlugin::UI::SLIDER;
use strict;
use warnings;

use Foswiki::Plugins::JQueryPlugin::Plugin;
our @ISA = qw( Foswiki::Plugins::JQueryPlugin::Plugin );
use Moo;
extends qw( Foswiki::Plugins::JQueryPlugin::Plugin );

=begin TML
Expand All @@ -22,24 +22,15 @@ Constructor
=cut

sub new {
my $class = shift;

my $this = bless(
$class->SUPER::new(
name => 'UI::Slider',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/slider/',
javascript => ['jquery.ui.slider.init.js'],
dependencies => [ 'ui', ],
),
$class
);

return $this;
}
our %pluginParams = (
name => 'UI::Slider',
version => '1.10.4',
puburl => '%PUBURLPATH%/%SYSTEMWEB%/JQueryPlugin/ui',
author => 'see http://jqueryui.com/about',
homepage => 'http://api.jqueryui.com/slider/',
javascript => ['jquery.ui.slider.init.js'],
dependencies => [ 'ui', ],
);

1;

Expand Down

0 comments on commit ab60364

Please sign in to comment.