GithubHelp home page GithubHelp logo

stephaneerard / dmjavascriptplugin Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 104 KB

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

License: Other

PHP 100.00%

dmjavascriptplugin's Introduction

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');

dmjavascriptplugin's People

Contributors

stephaneerard avatar

Stargazers

Felix Ospald avatar Anton Stoychev avatar  avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.