clipboardjs.module in Clipboard.js 8
Same filename and directory in other branches
Contains clipboardjs.module.
File
clipboardjs.moduleView source
<?php
/**
* @file
* Contains clipboardjs.module.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function clipboardjs_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.clipboardjs':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Clipboard.js') . '</p>';
return $output;
default:
}
}
/**
* Implements hook_theme().
*/
function clipboardjs_theme($existing, $type, $theme, $path) {
return [
'clipboardjs' => [
'variables' => [
'text' => NULL,
'alert_style' => 'tooltip',
'alert_text' => t('Copy was successful!'),
'height' => 13,
'width' => 13,
],
],
];
}
/**
* Implements hook_preprocess_HOOK().
*/
function clipboardjs_preprocess_clipboardjs(&$variables) {
$variables['module_path'] = base_path() . drupal_get_path('module', 'clipboardjs');
$variables['id'] = uniqid('clipboardjs-');
}
Functions
Name | Description |
---|---|
clipboardjs_help | Implements hook_help(). |
clipboardjs_preprocess_clipboardjs | Implements hook_preprocess_HOOK(). |
clipboardjs_theme | Implements hook_theme(). |