Ticket #597 (delayed new feature)

Opened 5 years ago

Last modified 17 months 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: Php version:
Hosting Provider: Blocked By:
Documentation needed: no Blocking:

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

Changed 5 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.

Changed 3 years ago by laurentj

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

Changed 17 months ago by laurentj

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