Exemplo n.º 1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $static_files = app_path('Http/staticfiles.php');
     if (file_exists($static_files)) {
         require_once $static_files;
     }
     $header = ['Package', 'Exclude', 'Include', 'Required'];
     $rows = [];
     foreach (\Larakit\StaticFiles\Manager::packages() as $package_name => $p) {
         $rows[] = [$package_name, implode(', ', $p->getExclude()), implode(', ', $p->getInclude()), implode(', ', $p->getRequired())];
     }
     $this->table($header, $rows);
 }
Exemplo n.º 2
0
 function __toString()
 {
     try {
         \Larakit\StaticFiles\Manager::package('makeup-blocks')->usePackage('common');
         foreach ($this->css() as $css) {
             \Larakit\StaticFiles\Manager::package('makeup-blocks')->css($css);
         }
         $js = $this->js();
         if ($js) {
             \Larakit\StaticFiles\Manager::package('app')->js($js);
         }
         return (string) \View::make('larakit-makeup::blocks.' . $this->name . '.block', $this->params);
     } catch (\Exception $e) {
         return $e->getMessage();
     }
 }
Exemplo n.º 3
0
 function makeupThemes()
 {
     $themes_path = Manager::getPath('themes');
     if (file_exists($themes_path)) {
         $themes = [];
         $theme = \Request::input('theme');
         \Larakit\StaticFiles\Manager::package('makeup-themes')->usePackage('makeup-blocks');
         foreach (\File::allFiles($themes_path) as $f) {
             $name = str_replace('.css', '', $f->getFilename());
             if ($theme == $name) {
                 \Larakit\StaticFiles\Manager::package('makeup-themes')->css(Manager::getUrl('themes/' . $name . '.css'));
             }
             $themes[$name] = $name;
         }
         if (count($themes)) {
             \Larakit\Page\PageTheme::setThemes($themes);
         }
     }
 }
Exemplo n.º 4
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-angular-ckeditor')->ngModule('ngCkeditor')->usePackage('larakit/sf-ckeditor')->usePackage('larakit/ng-larakit')->setSourceDir('public')->jsPackage('ng-ckeditor.min.js')->cssPackage('ng-ckeditor.css');
Exemplo n.º 5
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-bootstrap-switch')->usePackage('larakit/sf-bootstrap')->js('//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/js/bootstrap-switch.min.js')->css('//cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.2/css/bootstrap3/bootstrap-switch.min.css')->jsPackage('sf-bootstrap-switch.js')->cssPackage('sf-bootstrap-switch.css')->setSourceDir('public');
if (class_exists('\\Larakit\\Page\\PageDnsPrefetch')) {
    \Larakit\Page\PageDnsPrefetch::register('//cdnjs.cloudflare.com');
}
Exemplo n.º 6
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-fancybox')->setSourceDir('public')->cssPackage('jquery.fancybox.css')->jsPackage('jquery.fancybox.pack.js');
Exemplo n.º 7
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-animate.min')->css('//cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.1/animate.min.css', null, null, true);
Exemplo n.º 8
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-toastrjs')->setSourceDir('public')->jsPackage('toastr.min.js')->jsPackage('toastr-init.js')->cssPackage('toastr.css');
Exemplo n.º 9
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-font-awesome')->setSourceDir('public')->cssPackage('css/font-awesome.css');
Exemplo n.º 10
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-font-roboto')->setSourceDir('public')->cssPackage('css/sf-font-roboto.css');
Exemplo n.º 11
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-angular-checklist-model')->usePackage('larakit/sf-angular')->setSourceDir('public')->ngModule('checklist-model')->jsPackage('checklist-model.min.js');
Exemplo n.º 12
0
 /**
  * Формирование обоих списков (внешние и инлайн стили)
  * @return string
  */
 function __toString()
 {
     try {
         Manager::init();
         $_css = [];
         $css = $this->getExternal();
         if ($css) {
             $_css[] = str_replace(PHP_EOL, "        " . PHP_EOL, $css);
         }
         $css_inline = $this->getInline(true);
         if ($css_inline) {
             $css_inline = str_replace(PHP_EOL, PHP_EOL . "    ", $css_inline);
             $_css[] = "        " . str_replace(PHP_EOL, PHP_EOL . "    ", $css_inline);
         }
         return implode("", $_css);
     } catch (\Exception $e) {
         return $e->getMessage();
     }
 }
Exemplo n.º 13
0
<?php

Larakit\Boot::register_provider(\Larakit\Makeup\LarakitServiceProvider::class);
Larakit\Boot::register_middleware(\Larakit\Makeup\MakeupMiddleware::class);
\Larakit\StaticFiles\Manager::package('larakit/lk-makeup')->usePackage('larakit/sf-bootstrap')->jsPackage('js/makeup.js')->cssPackage('css/makeup.css')->setSourceDir('public')->addExclude('*')->addExclude('makeup/frame*')->addInclude('makeup*');
\Larakit\Twig::register_global('MAKEUP_URL', env('MAKEUPDIR', '!/makeup'));
Exemplo n.º 14
0
<?php

//регистрируем рендер
\HTML_QuickForm2_Renderer::register('larakit_form', Larakit\QuickForm\LaraFormRenderer::class, realpath(__DIR__ . '/QuickForm/LaraFormRenderer.php'));
//регистрируем команду
Larakit\Boot::register_command(\Larakit\QuickForm\CommandQuickformIde::class);
Larakit\Boot::register_command(\Larakit\QuickForm\CommandQuickformMakeForm::class);
Larakit\Boot::register_provider(\Larakit\QuickForm\LarakitServiceProvider::class);
\Larakit\QuickForm\Register::container(Larakit\QuickForm\LaraForm::class);
\Larakit\StaticFiles\Manager::package('pear/html_quickform2')->cssPackage('quickform.css')->jsPackage('js/quickform.js')->scopeInit('hierselect', ['/packages/pear/html_quickform2/js/quickform-hierselect.js'])->scopeInit('repeat', ['/packages/pear/html_quickform2/js/quickform-repeat.js'])->setSourceDir('data');
\Larakit\QuickForm\Register::register('button_link_twbs', 'qf_button_link_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('button_twbs', 'qf_button_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('checkbox_twbs', 'qf_checkbox_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('group_checkbox_twbs', 'qf_checkbox_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('group_checkbox_button_twbs', 'qf_checkbox_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('daterangepicker_twbs', 'qf_daterangepicker_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('datetime_twbs', 'qf_datetime_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('date_twbs', 'qf_date_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('time_twbs', 'qf_time_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('email_twbs', 'qf_email_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('group_twbs', 'qf_group_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('number_twbs', 'qf_number_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('password_twbs', 'qf_password_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('radio_twbs', 'qf_radio_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('group_radio_twbs', 'qf_group_radio_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('group_radio_button_twbs', 'qf_group_radio_button_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('select2_twbs', 'qf_select2_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('select_twbs', 'qf_select_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('static_twbs', 'qf_static_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('submit_twbs', 'qf_submit_twbs', __DIR__ . '/views');
\Larakit\QuickForm\Register::register('switch_twbs', 'qf_switch_twbs', __DIR__ . '/views');
Exemplo n.º 15
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-angular-satellizer')->usePackage('larakit/sf-angular')->ngModule('satellizer')->setSourceDir('public')->jsPackage('satellizer.min.js');
Exemplo n.º 16
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-angular-toaster')->usePackage('larakit/sf-angular')->setSourceDir('public')->ngModule('toaster')->jsPackage('toaster.min.js')->cssPackage('toaster.min.css');
\Larakit\Page\Page::bodyAppend('<toaster-container></toaster-container>');
Exemplo n.º 17
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-lodash.js')->setSourceDir('public')->jsPackage('lodash.min.js');
Exemplo n.º 18
0
 /**
  * Использовать во View для вставки вызова всех скриптов
  * @return string
  */
 function __toString()
 {
     try {
         Manager::init();
         return trim($this->getExternal() . PHP_EOL . $this->getInline() . PHP_EOL . $this->getOnload() . $this->getNoscript());
     } catch (\Exception $e) {
         dd($e);
     }
 }
Exemplo n.º 19
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-larakit-js')->setSourceDir('public')->usePackage('larakit/sf-jquery')->jsPackage('js/larakit.js');
Exemplo n.º 20
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-bootstrap-select2')->setSourceDir('public')->usePackage('larakit/sf-bootstrap')->cssPackage('css/select2.css')->cssPackage('css/select2-bootstrap.min.css')->cssPackage('css/select2-extend.css')->jsPackage('js/select2.js')->jsPackage('js/select2-init.js');
Exemplo n.º 21
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-ckeditor')->setSourceDir('public')->usePackage('larakit/sf-jquery')->js('//cdn.ckeditor.com/4.5.10/standard/ckeditor.js')->jsPackage('ckeditor.js');
//\Larakit\StaticFiles\Manager::package('larakit/sf-ckeditor')
//    ->setSourceDir('public')
//    ->jsPackage('ckeditor.js')
//    ->jsPackage('config.js')
//    ->jsPackage('laraform-wysiwyg.js');
Exemplo n.º 22
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-jquery-file-upload')->setSourceDir('public')->usePackage('larakit/sf-larakit-js')->jsPackage('js/jquery.ui.widget.js')->jsPackage('js/jquery.iframe-transport.js')->jsPackage('js/jquery.fileupload.js')->jsPackage('js/init.js')->cssPackage('css/jquery.fileupload.css');
Exemplo n.º 23
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-owl.carousel')->setSourceDir('public')->cssPackage('assets/owl.carousel.min.css')->jsPackage('owl.carousel.min.js');
Exemplo n.º 24
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-bootstrap')->setSourceDir('public')->usePackage('larakit/sf-jquery')->jsPackage('js/bootstrap.min.js')->cssPackage('css/bootstrap.min.css');
Exemplo n.º 25
0
 /**
  * Включение пакета с учетом правил использования include/exclude
  * @return bool
  */
 function on()
 {
     if ($this->is_used) {
         return true;
     }
     $route = \Route::currentRouteName();
     $exclude = self::maxIs($this->exclude, $route);
     $include = self::maxIs($this->include, $route);
     if ($exclude > $include || true === $exclude) {
         // исключаем
     } else {
         // подключаем
         //сперва подключим на страницу зависимости
         foreach ((array) $this->require as $require => $scopes) {
             Manager::package($require)->on();
         }
         foreach ($this->deferred_scopes as $scope) {
             $this->scope($scope);
         }
         //затем подключим CSS
         foreach ($this->css as $url => $item) {
             $condition = Arr::get($item, 'condition', null);
             $media = Arr::get($item, 'media', null);
             $no_build = (bool) Arr::get($item, 'no_build', false);
             Css::instance()->add($url, $media, $condition, $no_build);
         }
         //затем подключим JS
         foreach ($this->js as $url => $item) {
             $condition = Arr::get($item, 'condition', null);
             $no_build = (bool) Arr::get($item, 'no_build', false);
             Js::instance()->add($url, $condition, $no_build);
         }
     }
     $this->is_used = true;
     return true;
 }
Exemplo n.º 26
0
<?php

/**
 * Created by Larakit.
 * Link: http://github.com/larakit
 * User: Alexey Berdnikov
 * Date: 23.05.16
 * Time: 10:02
 */
\Larakit\StaticFiles\Manager::package('larakit/sf-bootstrap-datetimepicker')->setSourceDir('public')->usePackage('larakit/sf-bootstrap')->usePackage('larakit/sf-jquery-attrs')->js('//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment-with-locales.min.js')->js('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.15.35/js/bootstrap-datetimepicker.min.js')->css('//cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.15.35/css/bootstrap-datetimepicker.min.css')->cssPackage('sf-bootstrap-datetimepicker-init.css')->jsPackage('sf-bootstrap-datetimepicker-init.js');
Exemplo n.º 27
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-bootstrap-dialog')->usePackage('larakit/sf-bootstrap')->usePackage('larakit/sf-larakit-js')->cssPackage('bootstrap-dialog.min.css')->jsPackage('bootstrap-dialog.min.js')->jsPackage('init.js')->setSourceDir('public');
Exemplo n.º 28
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-angular-filter')->usePackage('larakit/sf-angular')->setSourceDir('public')->jsPackage('angular-filter.min.js');
Exemplo n.º 29
0
<?php

/**
 * Created by Larakit.
 * Link: http://github.com/larakit
 * User: Alexey Berdnikov
 * Date: 23.05.16
 * Time: 10:02
 */
\Larakit\StaticFiles\Manager::package('larakit/sf-jquery-attrs')->setSourceDir('public')->usePackage('larakit/sf-jquery')->jsPackage('jquery.attrs.js');
Exemplo n.º 30
0
<?php

\Larakit\StaticFiles\Manager::package('larakit/sf-dropzone')->setSourceDir('public')->cssPackage('dropzone.css')->jsPackage('dropzone.js')->jsPackage('init.js');