Beispiel #1
0
 /**
  * @return CssLoader
  */
 protected function createComponentCssPrint()
 {
     /** @var \WebLoader\Compiler $compiler */
     $compiler = $this->context->getService('webloader.cssPrintCompiler');
     $loader = new CssLoader($compiler, $this->template->basePath . '/webtemp');
     $loader->setMedia('print');
     return $loader;
 }
Beispiel #2
0
 public function __construct(Compiler $compiler, $relativeTempPath)
 {
     parent::__construct($compiler, '');
     $this->relativeTempPath = $relativeTempPath;
 }
Beispiel #3
0
 /**
  * @param array $fileNames
  * @param string|FALSE $media
  * @param string $stylesDir
  */
 private function lessComponentWrapper(array $fileNames, $media = NULL, $stylesDir = NULL)
 {
     if ($media === NULL) {
         $media = 'screen,projection,tv';
     }
     if ($stylesDir === NULL) {
         $stylesDir = __DIR__ . '/../styles';
     }
     $outputDirName = '/tmp/css';
     $fileCollection = new WebLoader\FileCollection($stylesDir);
     $fileCollection->addFiles($fileNames);
     $name = strtolower(substr($this->name, strrpos($this->name, ':') + 1)) . '.css';
     if (file_exists($stylesDir . '/' . $name)) {
         $files->addFile($name);
     }
     $compiler = WebLoader\Compiler::createCssCompiler($fileCollection, $this->context->parameters['wwwDir'] . $outputDirName);
     $filter = new WebLoader\Filter\LessFilter();
     $compiler->addFileFilter($filter);
     $control = new WebLoader\Nette\CssLoader($compiler, $this->template->basePath . $outputDirName);
     if (is_string($media)) {
         $control->setMedia($media);
     }
     return $control;
 }
Beispiel #4
0
 /**
  * @param \WebLoader\Compiler $compiler
  * @param string $relativeTempPath
  * @param \Nette\Http\Request $httpRequest
  */
 public function __construct(Compiler $compiler, $relativeTempPath, Request $httpRequest)
 {
     parent::__construct($compiler, '');
     $this->relativeTempPath = $relativeTempPath;
     $this->httpRequest = $httpRequest;
 }