Exemplo n.º 1
0
 public function get()
 {
     $content = $this->_js->compile();
     if (!$this->_isDebug()) {
         $content = $this->_minify($content);
     }
     return $content;
 }
Exemplo n.º 2
0
 public function testCompileWithScope()
 {
     $container = new CM_Frontend_JavascriptContainer();
     $container->append('foo()');
     $container->append('bar()');
     $this->assertSame("(function () { \n  foo();\n  bar()}).call(my_scope);", $container->compile('my_scope'));
 }
Exemplo n.º 3
0
 /**
  * @return string
  */
 private function _getJs()
 {
     $treeInitJs = new CM_Frontend_JavascriptContainer();
     $treeStoredJs = new CM_Frontend_JavascriptContainer();
     foreach ($this->_getTreeNodes() as $node) {
         $treeInitJs->append($this->_getTreeNodeInitJs($node));
         $treeStoredJs->append($this->_getTreeNodeStoredJs($node));
     }
     $operations = array($this->_onloadHeaderJs->compile(), $treeInitJs->compile(), $this->_onloadPrepareJs->compile(), $treeStoredJs->compile(), $this->_onloadJs->compile(), $this->_onloadReadyJs->compile());
     $operations = array_filter($operations);
     $code = implode(PHP_EOL, $operations);
     return $code;
 }