Ticket #597 (new new feature)

Opened 3 months ago

Last modified 2 months ago

jelix template :{metajscode} a new html plugin

Reported by: bibo Assigned to:
Priority: normal Milestone:
Component: jelix:plugins Version: trunk
Severity: normal Keywords:
Cc: Php version:
Review: Hosting Provider:
Documentation needed: 0 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

07/02/08 14:42:08 changed 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.

Download in other formats: Comma-delimited Text Tab-delimited Text RSS Feed