Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function afterUiLoaded(SupsysticTables_Ui_Module $ui)
 {
     parent::afterUiLoaded($ui);
     if (!$this->getEnvironment()->isModule('overview')) {
         return;
     }
     $hook = 'admin_enqueue_scripts';
     $ui->add($ui->createStyle('supsystic-tables-overview-css')->setHookName($hook)->setModuleSource($this, 'css/overview.css'));
     $ui->add($ui->createScript('supsystic-tables-overview-js')->setHookName($hook)->setModuleSource($this, 'js/overview.settings.js'));
     $ui->add($ui->createScript('supsystic-tables-overview-scroll-js')->setHookName($hook)->setModuleSource($this, 'js/jquery.slimscroll.js'));
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function afterUiLoaded(SupsysticTables_Ui_Module $ui)
 {
     parent::afterUiLoaded($ui);
     $environment = $this->getEnvironment();
     $hookName = 'admin_enqueue_scripts';
     $dynamicHookName = is_admin() ? $hookName : 'wp_enqueue_scripts';
     $version = $environment->getConfig()->get('plugin_version');
     $cachingAllowed = $environment->isProd();
     $ui->add($ui->createScript('jquery')->setHookName($dynamicHookName));
     $ui->add($ui->createStyle('supsystic-tables-datatables-css')->setHookName($dynamicHookName)->setExternalSource('//cdn.datatables.net/1.10.6/css/jquery.dataTables.min.css')->setVersion('1.10.6')->setCachingAllowed(true));
     $ui->add($ui->createScript('supsystic-tables-datatables-js')->setHookName($dynamicHookName)->setExternalSource('//cdn.datatables.net/1.10.6/js/jquery.dataTables.min.js')->setVersion('1.10.6')->setCachingAllowed(true)->addDependency('jquery'));
     $ui->add($ui->createStyle('supsystic-tables-shortcode-css')->setHookName($dynamicHookName)->setModuleSource($this, 'css/tables.shortcode.css')->setVersion($version)->setCachingAllowed($cachingAllowed));
     /* RuleJS */
     $this->loadRuleJS($ui);
     /* Backend scripts */
     if ($environment->isModule('tables')) {
         $ui->add($ui->createScript('jquery-ui-dialog'));
         $ui->add($ui->createScript('jquery-ui-autocomplete'));
         $ui->add($ui->createScript('supsystic-tables-tables-model')->setHookName($hookName)->setModuleSource($this, 'js/tables.model.js')->setCachingAllowed($cachingAllowed)->setVersion($version));
         if ($environment->isAction('index')) {
             $ui->add($ui->createScript('supsystic-tables-tables-index')->setHookName($hookName)->setModuleSource($this, 'js/tables.index.js')->setCachingAllowed($cachingAllowed)->setVersion($version)->addDependency('jquery-ui-dialog'));
         }
         if ($environment->isAction('view')) {
             $ui->add($ui->createStyle('supsystic-tables-tables-editor-css')->setHookName($hookName)->setModuleSource($this, 'css/tables.editor.css')->setCachingAllowed($cachingAllowed)->setVersion($version));
             /* Color Picker */
             $ui->add($ui->createStyle('supsystic-tables-colorpicker-css')->setHookName($hookName)->setModuleSource($this, 'libraries/colorpicker/colorpicker.css')->setCachingAllowed(true));
             $ui->add($ui->createScript('supsystic-tables-colorpicker-js')->setHookName($hookName)->setModuleSource($this, 'libraries/colorpicker/colorpicker.js')->setCachingAllowed(true));
             /* Toolbar */
             $ui->add($ui->createStyle('supsystic-tables-toolbar-css')->setHookName($hookName)->setModuleSource($this, 'libraries/toolbar/jquery.toolbars.css')->setCachingAllowed(true));
             $ui->add($ui->createScript('supsystic-tables-toolbar-js')->setHookName($hookName)->setModuleSource($this, 'libraries/toolbar/jquery.toolbar.js')->setCachingAllowed(true));
             /* Handsontable */
             $ui->add($ui->createStyle('supsystic-tables-handsontable-css')->setHookName($hookName)->setExternalSource('https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.16.0/handsontable.full.min.css')->setCachingAllowed(true)->setVersion('0.16.0'));
             $ui->add($ui->createScript('supsystic-tables-handsontable-js')->setHookName($hookName)->setExternalSource('https://cdnjs.cloudflare.com/ajax/libs/handsontable/0.16.0/handsontable.full.min.js')->setCachingAllowed(true)->setVersion('0.16.0'));
             $ui->add($ui->createScript('supsystic-tables-editor-toolbar-js')->setHookName($hookName)->setModuleSource($this, 'js/editor/tables.editor.toolbar.js')->setCachingAllowed($cachingAllowed)->setVersion($version));
             $ui->add($ui->createScript('supsystic-tables-editor-formula-js')->setHookName($hookName)->setModuleSource($this, 'js/editor/tables.editor.formula.js')->setCachingAllowed($cachingAllowed)->setVersion($version)->addDependency('jquery-ui-autocomplete'));
             $ui->add($ui->createStyle('supsystic-tables-tables-view')->setHookName($hookName)->setModuleSource($this, 'css/tables.view.css')->setCachingAllowed($cachingAllowed)->setVersion($version));
             $ui->add($ui->createScript('supsystic-tables-tables-view')->setHookName($hookName)->setModuleSource($this, 'js/tables.view.js')->setCachingAllowed($cachingAllowed)->setVersion($version));
             $ui->add($ui->createScript('supsystic-tables-ace-editor-js')->setHookName($hookName)->setExternalSource('https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.9/ace.js'));
         }
     }
     $ui->add($ui->createScript('supsystic-tables-shortcode')->setHookName($dynamicHookName)->setModuleSource($this, 'js/tables.shortcode.js')->setVersion($version)->setCachingAllowed($cachingAllowed)->addDependency('jquery')->addDependency('supsystic-tables-datatables-js')->addDependency('supsystic-tables-rulejs-js'));
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function afterUiLoaded(SupsysticTables_Ui_Module $ui)
 {
     parent::afterUiLoaded($ui);
     $environment = $this->getEnvironment();
     $cachingAllowed = $environment->isProd();
     $pluginVersion = $environment->getConfig()->get('plugin_version');
     $hookName = 'admin_enqueue_scripts';
     $jquery = $ui->createScript('jquery')->setHookName($hookName);
     /* jQuery */
     $ui->add($jquery);
     /* Core script with common functions in supsystic.Tables namespace */
     $ui->add($ui->createScript('tables-core')->setHookName(is_admin() ? $hookName : 'wp_enqueue_scripts')->setModuleSource($this, 'js/core.js')->addDependency($jquery)->setCachingAllowed($cachingAllowed)->setVersion($pluginVersion));
     /* Bootstrap */
     $ui->add($ui->createScript('tables-bootstrap')->setHookName($hookName)->setLocalSource('js/libraries/bootstrap/bootstrap.min.js')->addDependency($jquery)->setCachingAllowed(true)->setVersion('3.3.1'));
     /* Chosen */
     $ui->add($ui->createScript('tables-chosen')->setHookName($hookName)->setLocalSource('js/plugins/chosen.jquery.min.js')->addDependency($jquery)->setCachingAllowed(true)->setVersion('1.4.2'));
     /* Main UI script */
     $ui->add($ui->createScript('tables-ui')->setHookName($hookName)->setLocalSource('js/supsystic.ui.js')->addDependency($jquery)->setCachingAllowed($cachingAllowed)->setVersion($pluginVersion));
     /* Main UI styles */
     $ui->add($ui->createStyle('tables-ui-styles')->setHookName($hookName)->setLocalSource('css/supsystic-ui.css')->setCachingAllowed($cachingAllowed)->setVersion($pluginVersion));
 }
Beispiel #4
0
 /**
  * {@inheritdoc}
  */
 public function onInit()
 {
     parent::onInit();
     $this->renderDiagramsSection();
 }
Beispiel #5
0
 /**
  * {@inheritdoc}
  */
 public function afterModulesLoaded()
 {
     parent::afterModulesLoaded();
     $this->loadAssets();
 }