Skip to content

Commit

Permalink
sync releases
Browse files Browse the repository at this point in the history
  • Loading branch information
oetiker committed Mar 30, 2023
1 parent 3daade5 commit d68b845
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
17 changes: 17 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
0.45.0 2023-03-30 09:13:03 +0200 Tobias Oetiker <[email protected]>

- new widget attribute spellcheck which allows to enable
spellcheckers like languagetool in textareas or normal text widets

0.44.3 2023-03-03 16:29:29 +0100 Tobias Oetiker <[email protected]>

- add timing for validators as well

0.44.2 2023-03-03 16:18:45 +0100 Tobias Oetiker <[email protected]>

- syntax regression fixed

0.44.1 2023-03-03 16:11:50 +0100 Tobias Oetiker <[email protected]>

- log time spent running getters

0.44.0 2023-03-02 13:41:21 +0100 Tobias Oetiker <[email protected]>

- use the controller supplied securityHeaders method if one exists,
Expand Down
2 changes: 1 addition & 1 deletion lib/CallBackery.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use CallBackery::Database;
use CallBackery::User;


our $VERSION = '0.44.0';
our $VERSION = '0.45.0';


=head2 config
Expand Down
16 changes: 13 additions & 3 deletions lib/CallBackery/GuiPlugin/AbstractForm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use CallBackery::Exception qw(mkerror);
use Mojo::Promise;
use Mojo::JSON qw(encode_json);
use Mojo::Util qw(dumper);
use Time::HiRes;

=head1 NAME
Expand Down Expand Up @@ -90,8 +91,14 @@ sub validateData {
if (not ref $entry){
die mkerror(4095,trm("sorry, don't know the field you are talking about"));
}
return undef if not $entry->{set}{required} and (not defined $formData->{$fieldName} or length($formData->{$fieldName}) == 0);
return ($entry->{validator} ? $entry->{validator}->($formData->{$fieldName},$fieldName,$formData) : undef);
return if not $entry->{set}{required} and (not defined $formData->{$fieldName} or length($formData->{$fieldName}) == 0);
if ($entry->{validator}){
my $start = time;
my $data = $entry->{validator}->($formData->{$fieldName},$fieldName,$formData);
$self->log->debug(sprintf("validator %s: %0.2fs",$fieldName,time-$start));
return $data;
}
return;
}

=head2 processData($args)
Expand Down Expand Up @@ -162,7 +169,10 @@ sub getFieldValue {
return undef unless ref $entry eq 'HASH';
if ($entry->{getter}){
if (ref $entry->{getter} eq 'CODE'){
return $entry->{getter}->($self);
my $start = time;
my $data = $entry->{getter}->($self);
$self->log->debug(sprintf("getter %s: %0.2fs",$field,time-$start));
return $data;
}
else {
$self->log->warn('Plugin instance'.$self->name." field $field has a broken getter\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ qx.Class.define("callbackery.ui.form.Auto", {

var cfg = s.cfg || {};
var control;

var textWidget = false;
switch(s.widget)
{
case 'date':
Expand All @@ -121,6 +121,7 @@ qx.Class.define("callbackery.ui.form.Auto", {
break;

case 'text':
textWidget = true;
case 'time':
control = new qx.ui.form.TextField();
tm[s.key] = 'text';
Expand All @@ -130,6 +131,7 @@ qx.Class.define("callbackery.ui.form.Auto", {
tm[s.key] = 'text';
break;
case 'textArea':
textWidget = true;
control = new qx.ui.form.TextArea();
tm[s.key] = 'text';
break;
Expand Down Expand Up @@ -176,6 +178,9 @@ qx.Class.define("callbackery.ui.form.Auto", {
throw new Error("unknown widget type " + s.widget);
break;
}
if (textWidget && s.spellcheck){
control.getContentElement().setAttribute('spellcheck','true');
}
if (s.key) {
form.addOwnedQxObject(control, s.key);
}
Expand Down

0 comments on commit d68b845

Please sign in to comment.