Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b651d5ef

Von Sven Schöling vor etwa 1 Jahr hinzugefügt

  • ID b651d5efb70e8d3817d21344143894a48db97ae8
  • Vorgänger 82e5a153
  • Nachfolger 9fcb99db

ckeditor5: javascripte in controllern anpassen

In den meisten controllern wird der ckeditor nur in synchronen Seiten
verwendet und braucht dabei dann keine Extrabehandlung mehr, weil der
Presenter das jetzt automatisch macht.

Ausnahmen sind:
- RequirementSpec - hier werden die Blöcke mit den Textfeldern dynamisch
nachgeladen
- Project - hier werden die CVars nachgeladen, und die können Textfelder
haben

Unterschiede anzeigen:

SL/Controller/Admin.pm
614 614
  return $self;
615 615
}
616 616

  
617
sub use_ckeditor_js {
618
  my ($self) = @_;
619

  
620
  $::request->{layout}->use_javascript("${_}.js") for qw(ckeditor/ckeditor ckeditor/adapters/jquery);
621
  return $self;
622
}
623

  
624 617
sub login_form {
625 618
  my ($self, %params) = @_;
626 619
  $::request->layout(SL::Layout::AdminLogin->new);
......
630 623

  
631 624
sub edit_user_form {
632 625
  my ($self, %params) = @_;
633
  $self->use_multiselect_js->use_ckeditor_js->render('admin/edit_user', %params);
626
  $self->use_multiselect_js->render('admin/edit_user', %params);
634 627
}
635 628

  
636 629
sub edit_client_form {
SL/Controller/ClientConfig.pm
271 271
sub edit_form {
272 272
  my ($self) = @_;
273 273

  
274
  $::request->layout->use_javascript("${_}.js") for qw(jquery.selectboxes jquery.multiselect2side kivi.File ckeditor/ckeditor ckeditor/adapters/jquery);
274
  $::request->layout->use_javascript("${_}.js") for qw(jquery.selectboxes jquery.multiselect2side kivi.File);
275 275

  
276 276
  $self->setup_edit_form_action_bar;
277 277
  $self->render('client_config/form', title => t8('Client Configuration'),
SL/Controller/CustomerVendor.pm
1221 1221

  
1222 1222
  $self->{template_args} ||= {};
1223 1223

  
1224
  $::request->{layout}->add_javascripts("$_.js") for qw (kivi.CustomerVendor kivi.File chart kivi.CustomerVendorTurnover ckeditor/ckeditor ckeditor/adapters/jquery follow_up);
1224
  $::request->{layout}->add_javascripts("$_.js") for qw (kivi.CustomerVendor kivi.File chart kivi.CustomerVendorTurnover follow_up);
1225 1225

  
1226 1226
  $self->_setup_form_action_bar;
1227 1227
}
SL/Controller/DeliveryOrder.pm
1898 1898

  
1899 1899
  $self->get_item_cvpartnumber($_) for @{$self->order->items_sorted};
1900 1900

  
1901
  $::request->{layout}->use_javascript("${_}.js") for qw(kivi.SalesPurchase kivi.DeliveryOrder kivi.File ckeditor/ckeditor ckeditor/adapters/jquery
1901
  $::request->{layout}->use_javascript("${_}.js") for qw(kivi.SalesPurchase kivi.DeliveryOrder kivi.File
1902 1902
                                                         calculate_qty kivi.Validator follow_up show_history);
1903 1903
  $self->setup_edit_action_bar;
1904 1904
}
SL/Controller/Letter.pm
316 316
sub _display {
317 317
  my ($self, %params) = @_;
318 318

  
319
  $::request->{layout}->use_javascript("${_}.js") for qw(ckeditor/ckeditor ckeditor/adapters/jquery kivi.Letter kivi.SalesPurchase kivi.File);
319
  $::request->{layout}->use_javascript("${_}.js") for qw(kivi.Letter kivi.SalesPurchase kivi.File);
320 320

  
321 321
  my $letter = $self->letter;
322 322

  
SL/Controller/Order.pm
2388 2388

  
2389 2389
  $self->{template_args}->{num_phone_notes} = scalar @{ $self->order->phone_notes || [] };
2390 2390

  
2391
  $::request->{layout}->use_javascript("${_}.js") for qw(kivi.Validator kivi.SalesPurchase kivi.Order kivi.File ckeditor/ckeditor ckeditor/adapters/jquery
2391
  $::request->{layout}->use_javascript("${_}.js") for qw(kivi.Validator kivi.SalesPurchase kivi.Order kivi.File
2392 2392
                                                         edit_periodic_invoices_config calculate_qty follow_up show_history);
2393 2393
  $self->setup_edit_action_bar;
2394 2394
}
SL/Controller/Part.pm
860 860

  
861 861
sub _set_javascript {
862 862
  my ($self) = @_;
863
  $::request->layout->use_javascript("${_}.js")  for qw(kivi.Part kivi.File kivi.PriceRule ckeditor/ckeditor ckeditor/adapters/jquery kivi.ShopPart kivi.Validator);
863
  $::request->layout->use_javascript("${_}.js")  for qw(kivi.Part kivi.File kivi.PriceRule kivi.ShopPart kivi.Validator);
864 864
  $::request->layout->add_javascripts_inline("\$(function(){kivi.PriceRule.load_price_rules_for_part(@{[ $self->part->id ]})});") if $self->part->id;
865 865
}
866 866

  
SL/Controller/Project.pm
248 248

  
249 249
  CVar->render_inputs(variables => $params{CUSTOM_VARIABLES}) if @{ $params{CUSTOM_VARIABLES} };
250 250

  
251
  $::request->layout->use_javascript("$_.js") for qw(kivi.File ckeditor/ckeditor ckeditor/adapters/jquery);
251
  $::request->layout->use_javascript("$_.js") for qw(kivi.File ckeditor5/ckeditor ckeditor5/translations/de);
252 252
  $self->setup_edit_action_bar(callback => $params{callback});
253 253

  
254 254
  $self->render('project/form', %params);
SL/Controller/Reclamation.pm
1923 1923
  $self->get_item_cvpartnumber($_) for @{$self->reclamation->items_sorted};
1924 1924

  
1925 1925
  $::request->{layout}->use_javascript("${_}.js") for
1926
    qw(kivi.SalesPurchase kivi.Reclamation kivi.File ckeditor/ckeditor
1927
       ckeditor/adapters/jquery calculate_qty kivi.Validator follow_up
1926
    qw(kivi.SalesPurchase kivi.Reclamation kivi.File
1927
       calculate_qty kivi.Validator follow_up
1928 1928
       show_history
1929 1929
      );
1930 1930
  $self->_setup_edit_action_bar;
SL/Controller/RequirementSpec.pm
334 334

  
335 335
  $::auth->assert('requirement_spec_edit');
336 336
  $::request->{layout}->use_stylesheet("${_}.css") for qw(jquery.contextMenu requirement_spec);
337
  $::request->{layout}->use_javascript("${_}.js")  for qw(jquery.jstree jquery/jquery.contextMenu jquery/jquery.hotkeys requirement_spec ckeditor/ckeditor ckeditor/adapters/jquery kivi.Part kivi.CustomerVendor
338
                                                          ckeditor/ckeditor ckeditor/adapters/jquery);
337
  $::request->{layout}->use_javascript("${_}.js")  for qw(jquery.jstree jquery/jquery.contextMenu jquery/jquery.hotkeys requirement_spec kivi.Part kivi.CustomerVendor ckeditor5/ckeditor ckeditor5/translations/de);
339 338
  $self->init_visible_section;
340 339

  
341 340
  return 1;
SL/Controller/SimpleSystemSetting.pm
389 389
}
390 390

  
391 391
sub setup_javascript {
392
  $::request->layout->use_javascript("${_}.js") for qw(ckeditor/ckeditor ckeditor/adapters/jquery);
392
  $::request->layout->use_javascript("${_}.js") for qw();
393 393
}
394 394

  
395 395
sub init_class               { "SL::DB::"          . $_[0]->config->{class}                  }
SL/Controller/TimeRecording.pm
102 102
sub action_edit {
103 103
  my ($self) = @_;
104 104

  
105
  $::request->{layout}->use_javascript("${_}.js") for qw(kivi.TimeRecording ckeditor/ckeditor ckeditor/adapters/jquery kivi.Validator);
105
  $::request->{layout}->use_javascript("${_}.js") for qw(kivi.TimeRecording kivi.Validator);
106 106

  
107 107
  if ($self->use_duration) {
108 108
    flash('warning', t8('This entry is using start and end time. This information will be overwritten on saving.')) if !$self->time_recording->is_duration_used;

Auch abrufbar als: Unified diff