This application is not used any more and exists only for history. Post new tickets on the Github account.
Cette application n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #597 (delayed new feature)

Opened 7 years ago

Last modified 3 years ago

jelix template :{metajscode} a new html plugin

Reported by: bibo Owned by:
Priority: normal Milestone:
Component: jelix:plugins:tpl Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

this plugin would allow to put your javascript just beside its html siblings in templates AND still would be generated in the <head> section of the html response.

It would be nice to be able to do as below.

{metajscode}
<!--
  var themePath = '{$j_themepath}';
  {literal}
  jQuery(function (){
    $('#jform1_category').change( function(){
     if ($(this).val() == 'par') $('#jform1').submit();
      });
    $('#jform1_birthday').datepicker({showOn: 'both', buttonImage: themePath+'Images/calendar.gif', buttonImageOnly: true, minDate: '-60y', maxDate: '-10y', yearRange: '-60:0', firstDay: 1, defaultDate:'-10y'});
    $('.datepicker_trigger').css({position:'relative',left:'-21px',top:'-1px'});
  } );
-->
  {/literal}
{/metajscode}

metajscode would call addJSCode of course under the hood.

Change History

comment:1 Changed 6 years ago by bballizlife

I think this could be a nice idea for some times you don't want/need to put your JS code in a separate file.

comment:2 Changed 5 years ago by laurentj

  • Component changed from jelix:plugins to jelix:plugins:tpl

comment:3 Changed 3 years ago by laurentj

  • Status changed from new to delayed
Note: See TracTickets for help on using tickets.