Plugin Directory

Changeset 2050076


Ignore:
Timestamp:
03/13/2019 11:18:41 PM (7 years ago)
Author:
haystacksearch
Message:

Adding new feature to allow user to override Haystack theme color

Location:
haystack/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • haystack/trunk/Haystack_OptionsManager.php

    r2050006 r2050076  
    187187        }
    188188
     189        // Add the color picker css file       
     190        wp_enqueue_style('wp-color-picker');
     191       
    189192        //Adding scripts, styles
    190193        wp_enqueue_style('haystack_admin',plugin_dir_url(__FILE__).'assets/dist/css/hay-admin.min.css');
    191         wp_register_script('haystack_admin_js',plugin_dir_url(__FILE__).'assets/dist/js/hay-admin.min.js');
     194        wp_register_script('haystack_admin_js',plugin_dir_url(__FILE__).'assets/dist/js/hay-admin.min.js',array('wp-color-picker'));
    192195        $ajax_data = array(
    193196            'status_url' => HAYSTACK_AJAX_ADMIN,
  • haystack/trunk/Haystack_Plugin.php

    r2050006 r2050076  
    4545                'title' => __('Analytics','analytics'),
    4646                'hide' => true,
     47            );
     48            $meta['branding_color'] = array(
     49                'title' => __('Branding colors','branding_color'),
    4750            );
    4851            $meta['post_types'] = array(
     
    163166        $quick_links_title = $quick_links_title ? '<div>'.$quick_links_title.'</div>' : '';
    164167        $types             =  $this->getOption('post_types',false);
     168        $color             =  $this->getOption('branding_color',false);
    165169
    166170        $data = array(
     
    193197            var Hay = new Haystack('.json_encode($data,true).');
    194198        </script>';
     199
     200        if ($color) {
     201            //Overriding theme
     202            echo '
     203            <style type="text/css">
     204                .h__results .h__landing-tabs__nav li.js-active, .h__results .h__landing-tabs__nav li:hover, .h__results .h__landing-tabs__nav li:focus {
     205                    border-bottom-color: '.$color.';
     206                }
     207                .h__branding svg polygon,
     208                .h__button-heart:hover .fill, .h__button-heart:focus .fill, .h__button-heart.js-active .fill,
     209                .h__button-heart svg .outline,
     210                .h__finder svg path,
     211                .h__landing-tabs__fav-tab>li a path,
     212                .h__types__cont path {
     213                    fill: '.$color.';
     214                }
     215            </style>';
     216        }
    195217    }
    196218
     
    510532        $this->api_call($package,'index','get_meta');
    511533
     534        //Reindex menus
     535        $this->reindex_menus();
     536
    512537        //Remove old queues
    513538        $this->process_queue->empty_queue();
Note: See TracChangeset for help on using the changeset viewer.