Exemplo n.º 1
0
 /**
  * Outputs a JQuery init string into JQuery strings at end of page,
  * and adds if needed JS file inclusions at begin of page.
  * Pro-memo, JQuery runs in CB in noConflict mode.
  *
  * @param  string  $javascriptCode  Javascript code ended by ; which will be put in between jQuery(document).ready(function($){ AND });
  * @param  string  $jQueryPlugin    (optional) name of plugin to auto-load (if core plugin, or call first addJQueryPlugin).
  */
 function outputCbJQuery($javascriptCode, $jQueryPlugin = null)
 {
     if ($jQueryPlugin) {
         $this->addJQueryPlugin($jQueryPlugin, true);
     }
     if ($javascriptCode) {
         $this->_jQueryCodes[] = $javascriptCode;
     }
     if ($this->document->isHeadOutputed()) {
         $this->getAllJsPageCodes();
     }
 }
Exemplo n.º 2
0
 /**
  * Outputs a JQuery init string into JQuery strings at end of page,
  * and adds if needed JS file inclusions at begin of page.
  * Pro-memo, JQuery runs in CB in noConflict mode.
  *
  * @param  string  $javascriptCode  Javascript code ended by ; which will be put in between jQuery(document).ready(function($){ AND });
  * @param  string  $jQueryPlugin    (optional) name of plugin to auto-load (if core plugin, or call first addJQueryPlugin).
  */
 function outputCbJQuery($javascriptCode, $jQueryPlugin = null)
 {
     if (Application::Config()->get('jsJqueryMigrate', 1) || Application::Cms()->getClientId()) {
         $this->addJQueryPlugin('migrate', true);
     }
     if ($jQueryPlugin) {
         $this->addJQueryPlugin($jQueryPlugin, true);
     }
     if ($javascriptCode) {
         $this->_jQueryCodes[] = $javascriptCode;
     }
     if ($this->document->isHeadOutputed()) {
         $this->getAllJsPageCodes();
     }
 }