Example #1
0
 public static function add_editor_style($css)
 {
     if (HeadwayOption::get('disable-editor-style', false, false)) {
         return $css;
     }
     if (!current_theme_supports('editor-style')) {
         return $css;
     }
     if (!current_theme_supports('headway-design-editor')) {
         return $css;
     }
     HeadwayCompiler::register_file(array('name' => 'editor-style', 'format' => 'css', 'fragments' => array('headway_content_block_editor_style'), 'dependencies' => array(HEADWAY_LIBRARY_DIR . '/blocks/content/editor-style.php'), 'enqueue' => false));
     return $css . ',' . HeadwayCompiler::get_url('editor-style');
 }
Example #2
0
 public static function enqueue_block_dynamic_js_file()
 {
     //Do not run these if it's the admin page or the visual editor is open
     if (is_admin() || HeadwayRoute::is_visual_editor()) {
         return false;
     }
     $current_layout_in_use = HeadwayLayout::get_current_in_use();
     $script_name = 'block-dynamic-js-layout-' . HeadwayLayout::get_current_in_use();
     $block_actions = self::get_blocks_for_dynamic_asset('js', $current_layout_in_use);
     if (empty($block_actions)) {
         return;
     }
     HeadwayCompiler::register_file(array('name' => $script_name, 'format' => 'js', 'fragments' => array(array('HeadwayBlocks', 'output_block_dynamic_js')), 'enqueue' => false));
     if (strlen((string) self::output_block_dynamic_js($current_layout_in_use)) > 0) {
         wp_enqueue_script($script_name, HeadwayCompiler::get_url($script_name), array('jquery'));
     }
 }
Example #3
0
 public static function enqueue_styles()
 {
     HeadwayCompiler::register_file(array('name' => 've', 'format' => 'less', 'fragments' => apply_filters('headway_visual_editor_css', array(HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-mixins.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-tooltips.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-inputs.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-design.less', HEADWAY_LIBRARY_DIR . '/media/js/codemirror/codemirror.css', HEADWAY_LIBRARY_DIR . '/media/js/codemirror/theme-default.css')), 'require-hard-flush' => true, 'enqueue' => false));
     $styles = array('reset' => headway_url() . '/library/media/css/reset.css', 'headway_visual_editor' => HeadwayCompiler::get_url('ve'));
     wp_enqueue_multiple_styles($styles);
 }