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'); }
public static function register_visual_editor_css() { if (!HeadwayRoute::is_visual_editor_iframe()) { return; } HeadwayCompiler::register_file(array('name' => 've-iframe', 'format' => 'less', 'fragments' => array(HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-loading.css', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-mixins.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-iframe.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-tooltips.less'), 'require-hard-flush' => true, 'iframe-cache' => true)); }
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')); } }
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); }
public static function enqueue_canvas_assets() { HeadwayCompiler::register_file(array('name' => 've-iframe-grid', 'format' => 'less', 'fragments' => array(HEADWAY_LIBRARY_DIR . '/media/css/reset.css', HEADWAY_LIBRARY_DIR . '/media/css/grid.css', HEADWAY_LIBRARY_DIR . '/media/css/block-basics.css', HEADWAY_LIBRARY_DIR . '/media/css/content-styling.css', HEADWAY_LIBRARY_DIR . '/media/css/alerts.css', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-loading.css', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-mixins.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-iframe.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-tooltips.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-iframe-grid.less', HEADWAY_LIBRARY_DIR . '/visual-editor/css/editor-iframe-grid-block-content.less'), 'require-hard-flush' => true, 'iframe-cache' => true)); HeadwayCompiler::register_file(array('name' => 've-iframe-grid-dynamic', 'format' => 'css', 'fragments' => array(array('HeadwayDynamicStyle', 'wrapper')), 'dependencies' => array(HEADWAY_LIBRARY_DIR . '/media/dynamic/style.php'))); }