Skip to content

Adds some helpers to easily add Javascript Diem configuration (using dm_configuration js object) & code

License

Notifications You must be signed in to change notification settings

stephaneerard/dmJavascriptPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This plugin will allow you to do things such as :

Augment the dm_configuration object of Diem, using

  $js->config(array('do_not_hide_fieldsets' => true));
  
Which will result in something like :

var dm_configuration = {"relative_url_root":"","dm_core_asset_root":"\/dmCorePlugin\/","script_name":"\/admin_dev.php\/","debug":true,"culture":"fr","dateFormat":"dd\/mm\/yy","module":"companyCoreAdmin","action":"edit","authenticated":true,"do_not_hide_fieldsets":true,"record_id":"6"};


Add Javascript code at the very end of your page, using

  $js->code('alert(?);', array('hello'));
  
Which will result in something like :

  /* <![CDATA[ */;(function($){$(document).ready(function(){alert("hello");});})(jQuery);/* ]]> */
  
  
  
The $js object is an instance of dmJavascript, which is available as a service under the name of dm_javascript !

Get it within an action's method scope, a record's method scope :

  $this->getService('dm_javascript');
  
Get it within a template scope :

  $sf_context->get('dm_javascript');

About

Adds some helpers to easily add Javascript Diem configuration (using dm_configuration js object) & code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages