| 1 |
<?php |
| 2 |
namespace Elementor\Modules\ElementsColorPicker; |
| 3 |
|
| 4 |
use Elementor\Core\Experiments\Manager; |
| 5 |
use Elementor\Core\Base\Module as BaseModule; |
| 6 |
use Elementor\Core\Experiments\Manager as Experiments_Manager; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
class Module extends BaseModule { |
| 13 |
|
| 14 |
/** |
| 15 |
* Retrieve the module name. |
| 16 |
* |
| 17 |
* @return string |
| 18 |
*/ |
| 19 |
public function get_name() { |
| 20 |
return 'elements-color-picker'; |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Enqueue the `Color-Thief` library to pick colors from images. |
| 25 |
* |
| 26 |
* @return void |
| 27 |
*/ |
| 28 |
public function enqueue_scripts() { |
| 29 |
wp_enqueue_script( |
| 30 |
'color-thief', |
| 31 |
$this->get_js_assets_url( 'color-thief', 'assets/lib/color-thief/', true ), |
| 32 |
[ 'elementor-editor' ], |
| 33 |
ELEMENTOR_VERSION, |
| 34 |
true |
| 35 |
); |
| 36 |
} |
| 37 |
|
| 38 |
/** |
| 39 |
* Module constructor - Initialize the Eye-Dropper module. |
| 40 |
* |
| 41 |
* @return void |
| 42 |
*/ |
| 43 |
public function __construct() { |
| 44 |
add_action( 'elementor/editor/after_enqueue_scripts', [ $this, 'enqueue_scripts' ] ); |
| 45 |
} |
| 46 |
} |
| 47 |
|