Ejemplo n.º 1
0
 /**
  * Enqueue dependency libraries. These won't load in the preview window
  */
 public function dependencyEnqueues()
 {
     Cornerstone_Code_Editor::instance()->register();
     Cornerstone_Huebert::instance()->register();
     wp_enqueue_script('cs-huebert');
     wp_enqueue_script('cs-code-editor');
     wp_enqueue_media();
     $this->primeEditor();
 }
 public function register_scripts()
 {
     Cornerstone_Huebert::init();
     $orchestrator = $this->plugin->component('Element_Orchestrator');
     // Register
     wp_register_script('cs-core', $this->plugin->js('admin/core'), array('backbone'), $this->plugin->version(), true);
     $definitions = cs_memoize('_cornerstone_element_definitions', array($orchestrator, 'getModels'), 15);
     $icon_maps = wp_parse_args(array('elements' => add_query_arg(array('v' => $this->plugin->version()), $this->plugin->url('assets/svg/dist/elements.svg')), 'interface' => add_query_arg(array('v' => $this->plugin->version()), $this->plugin->url('assets/svg/dist/interface.svg'))), apply_filters('cornerstone_icon_map', array()));
     wp_localize_script('cs-core', 'csCoreData', cs_booleanize(array('ajaxUrl' => $this->plugin->component('Router')->get_ajax_url(), 'fallbackAjaxUrl' => $this->plugin->component('Router')->get_fallback_ajax_url(), 'useLegacyAjax' => $this->plugin->component('Router')->use_legacy_ajax(), 'debug' => $this->plugin->common()->isDebug(), 'elementDefinitions' => $definitions, 'isRTL' => is_rtl(), 'strings' => array('test' => 'test'), 'unfilteredHTML' => current_user_can('unfiltered_html'), 'iconMaps' => $icon_maps)));
 }
Ejemplo n.º 3
0
 /**
  * Initialize, and add hooks
  */
 public function setup()
 {
     add_action('admin_bar_menu', array($this, 'addToolbarEditLink'), 999);
     if (!is_admin()) {
         return;
     }
     Cornerstone_Huebert::init();
     add_action('admin_menu', array($this, 'optionsPage'));
     add_action('admin_enqueue_scripts', array($this, 'enqueue'));
     add_filter('page_row_actions', array($this, 'addRowActions'), 10, 2);
     add_filter('post_row_actions', array($this, 'addRowActions'), 10, 2);
     add_action('admin_notices', array($this, 'updateNotice'), 20);
     add_action('cornerstone_options_mb_settings', array($this, 'renderSettingsMB'));
     add_action('cornerstone_options_mb_validation', array($this, 'renderValidationMB'));
 }
 public static function init()
 {
     self::$instance = new Cornerstone_Huebert();
 }