In yourtheme.libraries.yml
global:
js:
dist/js/global.js: { minified: true }
dependencies:
- core/drupal
- core/drupal.debounce| <?php | |
| namespace Drupal\opitools\Commands; | |
| use Drush\Commands\DrushCommands; | |
| use Drupal\Core\Language\LanguageInterface; | |
| /** | |
| * A Drush commandfile. | |
| * |
| #!/bin/bash | |
| function greenecho { | |
| echo "" && echo -e "\e[30;48;5;82m ✔ $1 \e[0m" | |
| } | |
| function orangeecho { | |
| echo "" && echo -e "\e[30;48;5;208m ⚠ $1 \e[0m" | |
| } | |
| # Get document root path |
| <?php | |
| // Import arbitrary config from a variable. | |
| $config = \Drupal::service('config.factory')->getEditable('filter.format.basic_html'); | |
| $config->setData($data)->save(); | |
| // Or, re-import the default config for a module or profile, etc. | |
| \Drupal::service('config.installer')->installDefaultConfig('module', 'my_custom_module'); | |
| // Or, import YAML config an arbitrary directory. |
| <?php | |
| namespace Drupal\ppdx_editor\Plugin\Filter; | |
| use Drupal\Component\Utility\Html; | |
| use Drupal\Core\Entity\EntityRepositoryInterface; | |
| use Drupal\Core\Image\ImageFactory; | |
| use Drupal\Core\Plugin\ContainerFactoryPluginInterface; | |
| use Drupal\file\FileInterface; | |
| use Drupal\filter\FilterProcessResult; |
| <?php | |
| /** | |
| * Implements hook_entity_form_display_alter(). | |
| */ | |
| function MY_MODULE_entity_form_display_alter(&$form_display, array $context) { | |
| if ($context['entity_type'] == 'node' && $context['bundle'] == 'MY_BUNDLE') { | |
| $current_user = \Drupal::currentUser(); | |
| if ($current_user->hasPermission('CUSTOM PERMISSION')) { | |
| $storage = \Drupal::entityManager()->getStorage('entity_form_display'); |
| <!doctype html> | |
| <html> | |
| <head> | |
| <script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> | |
| <script> | |
| $(document).ready(function(){ | |
| var getMax = function(){ |
| #progresswrapper { | |
| position: fixed; | |
| top: 0px; | |
| height: 2px; | |
| width: 100%; | |
| z-index: 1000; | |
| } | |
| #progressbar { | |
| top: 0; | |
| position: fixed; |
| <?php | |
| namespace Drupal\hc_core\Plugin\search_api\processor; | |
| use Drupal\node\Entity\Node; | |
| use Drupal\search_api\Datasource\DatasourceInterface; | |
| use Drupal\search_api\IndexInterface; | |
| use Drupal\search_api\Item\ItemInterface; | |
| use Drupal\search_api\Processor\ProcessorPluginBase; | |
| use Drupal\search_api\Processor\ProcessorProperty; |