WordPress.org

Plugin Directory

Changeset 1123274


Ignore:
Timestamp:
03/30/15 00:12:19 (3 years ago)
Author:
chorton2227
Message:

Upgrade to version 1.2.0

Location:
wp-glossary-hover
Files:
471 added
13 edited

Legend:

Unmodified
Added
Removed
  • wp-glossary-hover/trunk/README.txt

    r936455 r1123274  
    44Tags: glossary, hover, definition 
    55Requires at least: 3.5.1 
    6 Tested up to: 3.9.1 
    7 Stable tag: 1.1.0 
     6Tested up to: 4.1.1 
     7Stable tag: 1.2.0 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    5757== Changelog == 
    5858 
     59= 1.2.0 = 
     60* Enabled comment support for glossary terms. 
     61* Added to enable links to glossary term pages. 
     62* Added setting to limit the tooltip length. 
     63* Escape html sepcial characters in definition. 
     64* Strip tags in tooltip definition, instead of escaping tags. 
     65* Fix description for `Enabled Post Types` setting. 
     66 
    5967= 1.1.0 = 
    6068* Fix fatal error on install. 
    61 * Remove test code in uninstall.php 
     69* Remove test code in uninstall.php. 
    6270 
    6371= 1.0.1 = 
  • wp-glossary-hover/trunk/admin/class-wp-glossary-hover-admin.php

    r928312 r1123274  
    2929     * Slug of the plugin screen. 
    3030     * 
    31      * @since    1.0.0 
    32      * @var      string 
     31     * @since 1.0.0 
     32     * @var string 
    3333     */ 
    3434    protected $plugin_screen_hook_suffix = null; 
     
    4343 
    4444    /** 
    45      * jQuery UI Effects 
    46      * 
    47      * @since    1.0.0 
    48      * @var      array 
    49      */ 
    50     protected $jquery_ui_effects = array( 
    51         'blind', 
    52         'bounce', 
    53         'clip', 
    54         'drop', 
    55         'explode', 
    56         'fade', 
    57         'fold', 
    58         'highlight', 
    59         'pulsate', 
    60         'scale', 
    61         'shake', 
    62         'slide', 
    63         'transfer' 
    64     ); 
    65  
    66     /** 
    67      * jQuery UI Easings 
    68      * 
    69      * @since    1.0.0 
    70      * @var      array 
    71      */ 
    72     protected $jquery_ui_easings = array( 
    73         'linear', 
    74         'swing', 
    75         'easeInQuad', 
    76         'easeOutQuad', 
    77         'easeInOutQuad', 
    78         'easeInCubic', 
    79         'easeOutCubic', 
    80         'easeInOutCubic', 
    81         'easeInQuart', 
    82         'easeOutQuart', 
    83         'easeInOutQuart', 
    84         'easeInQuint', 
    85         'easeOutQuint', 
    86         'easeInOutQuint', 
    87         'easeInExpo', 
    88         'easeOutExpo', 
    89         'easeInOutExpo', 
    90         'easeInSine', 
    91         'easeOutSine', 
    92         'easeInOutSine', 
    93         'easeInCirc', 
    94         'easeOutCirc', 
    95         'easeInOutCirc', 
    96         'easeInElastic', 
    97         'easeOutElastic', 
    98         'easeInOutElastic', 
    99         'easeInBack', 
    100         'easeOutBack', 
    101         'easeInOutBack', 
    102         'easeInBounce', 
    103         'easeOutBounce', 
    104         'easeInOutBounce' 
    105     ); 
    106  
    107     /** 
    108      * jQuery UI Themes 
    109      * 
    110      * @since    1.0.0 
    111      * @var      array 
    112      */ 
    113     protected $jquery_ui_themes = array( 
    114         'ui-lightness', 
    115         'ui-darkness', 
    116         'smoothness', 
    117         'start', 
    118         'redmond', 
    119         'sunny', 
    120         'overcast', 
    121         'le-frog', 
    122         'flick', 
    123         'pepper-grinder', 
    124         'eggplant', 
    125         'dark-hive', 
    126         'cupertino', 
    127         'south-street', 
    128         'blitzer', 
    129         'humanity', 
    130         'hot-sneaks', 
    131         'excite-bike', 
    132         'vader', 
    133         'dot-luv', 
    134         'mint-choc', 
    135         'black-tie', 
    136         'trontastic', 
    137         'swanky-purse' 
    138     ); 
    139  
    140     /** 
    141      * CSS Border Styles 
    142      * 
    143      * @since    1.0.0 
    144      * @var      array 
    145      */ 
    146     protected $css_border_styles = array( 
    147         'dotted', 
    148         'dashed', 
    149         'solid', 
    150         'double', 
    151         'groove', 
    152         'ridge', 
    153         'inset', 
    154         'outset' 
    155     ); 
    156  
    157     /** 
    158      * Html tags that are disabled from being parsed by default. 
    159      * Individual tags can be enabled through the plugin settings. 
    160      * 
    161      * @since    1.0.0 
    162      * @var      array 
    163      */ 
    164     protected $disabled_tags = array( 
    165         'a', 
    166         'h1', 
    167         'h2', 
    168         'h3', 
    169         'h4', 
    170         'h5', 
    171         'h6', 
    172         'pre', 
    173         'object', 
    174         'blockquote' 
    175     ); 
    176  
    177     /** 
    17845     * Initialize the plugin by loading admin scripts & styles and adding a 
    17946     * settings page and menu. 
     
    18350    private function __construct() { 
    18451 
    185         // Call $plugin_slug from public plugin class. 
    186         $plugin = WP_Glossary_Hover::get_instance(); 
    187         $this->plugin_slug = $plugin->get_plugin_slug(); 
    188         $this->glossary_post_type = $plugin->get_glossary_post_type(); 
    189  
    19052        // Register plugin settings 
    191         add_action('init', array($this, 'setup_plugin_settings')); 
     53        add_action('init', array('WPGH_Plugin_Config', 'register_plugin_settings')); 
    19254 
    19355    } 
     
    22082         */ 
    22183        $this->plugin_screen_hook_suffix = add_options_page( 
    222             __('WP Glossary Hover', $this->plugin_slug), 
    223             __('WP Glossary Hover', $this->plugin_slug), 
     84            __('WP Glossary Hover', WP_Glossary_Hover::PLUGIN_SLUG), 
     85            __('WP Glossary Hover', WP_Glossary_Hover::PLUGIN_SLUG), 
    22486            'manage_options', 
    225             $this->plugin_slug, 
    226             array($this, 'display_plugin_admin_page') 
    227         ); 
    228  
    229     } 
    230  
    231     /** 
    232      * Register the plugin settings. 
    233      * 
    234      * @since    1.0.0 
    235      */ 
    236     public function setup_plugin_settings() { 
    237  
    238         $post_types = get_post_types(); 
    239  
    240         // Remove custom post type for this plugin 
    241         if (isset($post_types[$this->glossary_post_type])) { 
    242             unset($post_types[$this->glossary_post_type]); 
    243         } 
    244  
    245         // General Settings 
    246         $general_section_fields = array(); 
    247  
    248         $general_section_fields[] = new WPGH_Checkbox_Field( 
    249             $this->plugin_slug, 
    250             'general_highlight_first_occurrence', 
    251             __('Highlight First Occurrence Only', $this->plugin_slug), 
    252             __('When enabled only highlight first occurrence of term.', $this->plugin_slug), 
    253             false 
    254         ); 
    255  
    256         $general_section_fields[] = new WPGH_Checkbox_Field( 
    257             $this->plugin_slug, 
    258             'general_case_sensitive', 
    259             __('Case Sensitive', $this->plugin_slug), 
    260             __('When enabled highlight terms are case sensitive.', $this->plugin_slug), 
    261             true 
    262         ); 
    263  
    264         $general_section_fields[] = new WPGH_Multi_Checkbox_Field( 
    265             $this->plugin_slug, 
    266             'general_enabled_post_types', 
    267             __('Enabled Post Types', $this->plugin_slug), 
    268             __('Whether the tooltip should track (follow) the mouse.', $this->plugin_slug), 
    269             array('post'), 
    270             $post_types 
    271         ); 
    272  
    273         $general_section_fields[] = new WPGH_Multi_Checkbox_Field( 
    274             $this->plugin_slug, 
    275             'general_disabled_tags', 
    276             __('Disabled Html Tags', $this->plugin_slug), 
    277             __('When checked, tags are not parsed for glossary terms.', $this->plugin_slug), 
    278             $this->disabled_tags, 
    279             $this->disabled_tags 
    280         ); 
    281  
    282         $general_section = new WPGH_Settings_Section( 
    283             'general', 
    284             __('General Settings', $this->plugin_slug), 
    285             __('Basic settings for plugin behavior.', $this->plugin_slug), 
    286             $general_section_fields 
    287         ); 
    288  
    289         // Tooltip General Settings 
    290         $tooltip_general_fields = array(); 
    291  
    292         $tooltip_general_fields[] = new WPGH_Checkbox_Field( 
    293             $this->plugin_slug, 
    294             'tooltip_general_track', 
    295             __('Track', $this->plugin_slug), 
    296             __('Whether the tooltip should track (follow) the mouse.', $this->plugin_slug), 
    297             false 
    298         ); 
    299  
    300         $tooltip_general_section = new WPGH_Settings_Section( 
    301             'tooltip_general', 
    302             __('General Settings', $this->plugin_slug), 
    303             __('', $this->plugin_slug), 
    304             $tooltip_general_fields 
    305         ); 
    306  
    307         // Tooltip Hide Settings 
    308         $tooltip_hide_fields = array(); 
    309  
    310         $tooltip_hide_fields[] = new WPGH_Checkbox_Field( 
    311             $this->plugin_slug, 
    312             'tooltip_hide_enabled', 
    313             __('Enabled', $this->plugin_slug), 
    314             __('When disabled, no animation will be used and the tooltip will be hidden immediately.', $this->plugin_slug), 
    315             true 
    316         ); 
    317  
    318         $tooltip_hide_fields[] = new WPGH_Select_Field( 
    319             $this->plugin_slug, 
    320             'tooltip_hide_effect', 
    321             __('Effect', $this->plugin_slug), 
    322             __('', $this->plugin_slug), 
    323             'fade', 
    324             $this->jquery_ui_effects 
    325         ); 
    326  
    327         $tooltip_hide_fields[] = new WPGH_Integer_Field( 
    328             $this->plugin_slug, 
    329             'tooltip_hide_delay', 
    330             __('Delay', $this->plugin_slug), 
    331             __('milliseconds', $this->plugin_slug), 
    332             0 
    333         ); 
    334  
    335         $tooltip_hide_fields[] = new WPGH_Integer_Field( 
    336             $this->plugin_slug, 
    337             'tooltip_hide_duration', 
    338             __('Duration', $this->plugin_slug), 
    339             __('milliseconds', $this->plugin_slug), 
    340             100 
    341         ); 
    342  
    343         $tooltip_hide_fields[] = new WPGH_Select_Field( 
    344             $this->plugin_slug, 
    345             'tooltip_hide_easing', 
    346             __('Easing', $this->plugin_slug), 
    347             __('', $this->plugin_slug), 
    348             'linear', 
    349             $this->jquery_ui_easings 
    350         ); 
    351  
    352         $tooltip_hide_section = new WPGH_Settings_Section( 
    353             'tooltip_hide', 
    354             __('Hide Settings', $this->plugin_slug), 
    355             __('If and how to animate the hiding of the tooltip.', $this->plugin_slug), 
    356             $tooltip_hide_fields 
    357         ); 
    358  
    359         // Tooltip Show Settings 
    360         $tooltip_show_fields = array(); 
    361  
    362         $tooltip_show_fields[] = new WPGH_Checkbox_Field( 
    363             $this->plugin_slug, 
    364             'tooltip_show_enabled', 
    365             __('Enabled', $this->plugin_slug), 
    366             __('When disabled, no animation will be used and the tooltip will be hidden immediately.', $this->plugin_slug), 
    367             true 
    368         ); 
    369  
    370         $tooltip_show_fields[] = new WPGH_Select_Field( 
    371             $this->plugin_slug, 
    372             'tooltip_show_effect', 
    373             __('Effect', $this->plugin_slug), 
    374             __('', $this->plugin_slug), 
    375             'fade', 
    376             $this->jquery_ui_effects 
    377         ); 
    378  
    379         $tooltip_show_fields[] = new WPGH_Integer_Field( 
    380             $this->plugin_slug, 
    381             'tooltip_show_delay', 
    382             __('Delay', $this->plugin_slug), 
    383             __('milliseconds', $this->plugin_slug), 
    384             0 
    385         ); 
    386  
    387         $tooltip_show_fields[] = new WPGH_Integer_Field( 
    388             $this->plugin_slug, 
    389             'tooltip_show_duration', 
    390             __('Duration', $this->plugin_slug), 
    391             __('milliseconds', $this->plugin_slug), 
    392             100 
    393         ); 
    394  
    395         $tooltip_show_fields[] = new WPGH_Select_Field( 
    396             $this->plugin_slug, 
    397             'tooltip_show_easing', 
    398             __('Easing', $this->plugin_slug), 
    399             __('', $this->plugin_slug), 
    400             'linear', 
    401             $this->jquery_ui_easings 
    402         ); 
    403  
    404         $tooltip_show_section = new WPGH_Settings_Section( 
    405             'tooltip_show', 
    406             __('Show Settings', $this->plugin_slug), 
    407             __('If and how to animate the showing of the tooltip.', $this->plugin_slug), 
    408             $tooltip_show_fields 
    409         ); 
    410  
    411         // Styles Tooltip Settings 
    412         $styles_tooltip_fields = array(); 
    413  
    414         $styles_tooltip_fields[] = new WPGH_Select_Field( 
    415             $this->plugin_slug, 
    416             'styles_tooltip_theme', 
    417             __('Tooltip Theme', $this->plugin_slug), 
    418             __('jQuery UI theme for tooltip.', $this->plugin_slug), 
    419             'ui-lightness', 
    420             $this->jquery_ui_themes 
    421         ); 
    422  
    423         $styles_tooltip_section = new WPGH_Settings_Section( 
    424             'styles_tooltip', 
    425             __('Tooltip Styles', $this->plugin_slug), 
    426             __('How the tooltip looks.', $this->plugin_slug), 
    427             $styles_tooltip_fields 
    428         ); 
    429  
    430         // Styles Link Settings 
    431         $styles_link_fields = array(); 
    432  
    433         $styles_link_fields[] = new WPGH_Color_Picker_Field( 
    434             $this->plugin_slug, 
    435             'styles_link_color', 
    436             __('Link Color', $this->plugin_slug), 
    437             __('', $this->plugin_slug), 
    438             '#ff0000' 
    439         ); 
    440  
    441         $styles_link_fields[] = new WPGH_Select_Field( 
    442             $this->plugin_slug, 
    443             'styles_link_underline', 
    444             __('Link Underline', $this->plugin_slug), 
    445             __('', $this->plugin_slug), 
    446             'dashed', 
    447             $this->css_border_styles 
    448         ); 
    449  
    450         $styles_link_section = new WPGH_Settings_Section( 
    451             'styles_link', 
    452             __('Link Styles', $this->plugin_slug), 
    453             __('How the tooltip link looks on the page.', $this->plugin_slug), 
    454             $styles_link_fields 
    455         ); 
    456  
    457         // Setup Tabs 
    458         $tabs = array(); 
    459  
    460         $tabs[] = new WPGH_Settings_Tab( 
    461             'general', 
    462             __('General', $this->plugin_slug), 
    463             array($general_section) 
    464         ); 
    465  
    466         $tabs[] = new WPGH_Settings_Tab( 
    467             'tooltip', 
    468             __('Tooltip', $this->plugin_slug), 
    469             array($tooltip_general_section, $tooltip_hide_section, $tooltip_show_section) 
    470         ); 
    471  
    472         $tabs[] = new WPGH_Settings_Tab( 
    473             'styles', 
    474             __('Styles', $this->plugin_slug), 
    475             array($styles_tooltip_section, $styles_link_section) 
    476         ); 
    477  
    478         // Register plugin settings 
    479         $this->plugin_settings = new WPGH_Plugin_Settings( 
    480             __('WP Glossary Hover', $this->plugin_slug), 
    481             $this->plugin_slug, 
    482             'manage_options', 
    483             $tabs 
     87            WP_Glossary_Hover::PLUGIN_SLUG 
    48488        ); 
    48589 
  • wp-glossary-hover/trunk/languages/en_US.po

    r928312 r1123274  
    11msgid "" 
    22msgstr "" 
    3 "Project-Id-Version: WP Glossary Hover v1.0.0\n" 
    4 "POT-Creation-Date: 2014-06-01 16:24-0500\n" 
    5 "PO-Revision-Date: 2014-06-01 16:25-0500\n" 
     3"Project-Id-Version: WP Glossary Hover v1.2.0\n" 
     4"POT-Creation-Date: 2015-03-29 19:38-0500\n" 
     5"PO-Revision-Date: 2015-03-29 19:38-0500\n" 
    66"Last-Translator: Chris Horton <chorton2227@gmail.com>\n" 
    77"Language-Team: Chris Horton <chorton2227@gmail.com>\n" 
     
    2222"X-Poedit-SearchPath-1: ..\n" 
    2323 
    24 #: ../admin/class-wp-glossary-hover-admin.php:224 
    25 #: ../admin/class-wp-glossary-hover-admin.php:225 
    26 #: ../admin/class-wp-glossary-hover-admin.php:482 
     24#: ../admin/class-wp-glossary-hover-admin.php:84 
     25#: ../admin/class-wp-glossary-hover-admin.php:85 
     26#: ../includes/class-plugin-config.php:262 
    2727msgid "WP Glossary Hover" 
    2828msgstr "" 
    2929 
    30 #: ../admin/class-wp-glossary-hover-admin.php:253 
     30#: ../includes/class-plugin-config.php:290 
    3131msgid "Highlight First Occurrence Only" 
    3232msgstr "" 
    3333 
    34 #: ../admin/class-wp-glossary-hover-admin.php:254 
     34#: ../includes/class-plugin-config.php:291 
    3535msgid "When enabled only highlight first occurrence of term." 
    3636msgstr "" 
    3737 
    38 #: ../admin/class-wp-glossary-hover-admin.php:261 
     38#: ../includes/class-plugin-config.php:298 
    3939msgid "Case Sensitive" 
    4040msgstr "" 
    4141 
    42 #: ../admin/class-wp-glossary-hover-admin.php:262 
     42#: ../includes/class-plugin-config.php:299 
    4343msgid "When enabled highlight terms are case sensitive." 
    4444msgstr "" 
    4545 
    46 #: ../admin/class-wp-glossary-hover-admin.php:269 
     46#: ../includes/class-plugin-config.php:306 
    4747msgid "Enabled Post Types" 
    4848msgstr "" 
    4949 
    50 #: ../admin/class-wp-glossary-hover-admin.php:270 
    51 #: ../admin/class-wp-glossary-hover-admin.php:298 
     50#: ../includes/class-plugin-config.php:307 
     51msgid "When checked, the post type items will be parsed for glossary terms." 
     52msgstr "" 
     53 
     54#: ../includes/class-plugin-config.php:315 
     55msgid "Disabled Html Tags" 
     56msgstr "" 
     57 
     58#: ../includes/class-plugin-config.php:316 
     59msgid "When checked, tags are not parsed for glossary terms." 
     60msgstr "" 
     61 
     62#: ../includes/class-plugin-config.php:323 
     63#: ../includes/class-plugin-config.php:357 
     64msgid "General Settings" 
     65msgstr "" 
     66 
     67#: ../includes/class-plugin-config.php:324 
     68msgid "Basic settings for plugin behavior." 
     69msgstr "" 
     70 
     71#: ../includes/class-plugin-config.php:334 
     72msgid "Limit number of characters" 
     73msgstr "" 
     74 
     75#: ../includes/class-plugin-config.php:335 
     76msgid "characters <em>(Disabled when set to 0)</em>" 
     77msgstr "" 
     78 
     79#: ../includes/class-plugin-config.php:342 
     80msgid "Link to glossary term page" 
     81msgstr "" 
     82 
     83#: ../includes/class-plugin-config.php:343 
     84msgid "Whether the glossary term should link to the glossary term page." 
     85msgstr "" 
     86 
     87#: ../includes/class-plugin-config.php:350 
     88msgid "Track" 
     89msgstr "" 
     90 
     91#: ../includes/class-plugin-config.php:351 
    5292msgid "Whether the tooltip should track (follow) the mouse." 
    5393msgstr "" 
    5494 
    55 #: ../admin/class-wp-glossary-hover-admin.php:278 
    56 msgid "Disabled Html Tags" 
    57 msgstr "" 
    58  
    59 #: ../admin/class-wp-glossary-hover-admin.php:279 
    60 msgid "When checked, tags are not parsed for glossary terms." 
    61 msgstr "" 
    62  
    63 #: ../admin/class-wp-glossary-hover-admin.php:286 
    64 #: ../admin/class-wp-glossary-hover-admin.php:304 
    65 msgid "General Settings" 
    66 msgstr "" 
    67  
    68 #: ../admin/class-wp-glossary-hover-admin.php:287 
    69 msgid "Basic settings for plugin behavior." 
    70 msgstr "" 
    71  
    72 #: ../admin/class-wp-glossary-hover-admin.php:297 
    73 msgid "Track" 
    74 msgstr "" 
    75  
    76 #: ../admin/class-wp-glossary-hover-admin.php:315 
    77 #: ../admin/class-wp-glossary-hover-admin.php:367 
     95#: ../includes/class-plugin-config.php:368 
     96#: ../includes/class-plugin-config.php:420 
    7897msgid "Enabled" 
    7998msgstr "" 
    8099 
    81 #: ../admin/class-wp-glossary-hover-admin.php:316 
    82 #: ../admin/class-wp-glossary-hover-admin.php:368 
     100#: ../includes/class-plugin-config.php:369 
     101#: ../includes/class-plugin-config.php:421 
    83102msgid "" 
    84103"When disabled, no animation will be used and the tooltip will be hidden " 
     
    86105msgstr "" 
    87106 
    88 #: ../admin/class-wp-glossary-hover-admin.php:323 
    89 #: ../admin/class-wp-glossary-hover-admin.php:375 
     107#: ../includes/class-plugin-config.php:376 
     108#: ../includes/class-plugin-config.php:428 
    90109msgid "Effect" 
    91110msgstr "" 
    92111 
    93 #: ../admin/class-wp-glossary-hover-admin.php:332 
    94 #: ../admin/class-wp-glossary-hover-admin.php:384 
     112#: ../includes/class-plugin-config.php:385 
     113#: ../includes/class-plugin-config.php:437 
    95114msgid "Delay" 
    96115msgstr "" 
    97116 
    98 #: ../admin/class-wp-glossary-hover-admin.php:333 
    99 #: ../admin/class-wp-glossary-hover-admin.php:341 
    100 #: ../admin/class-wp-glossary-hover-admin.php:385 
    101 #: ../admin/class-wp-glossary-hover-admin.php:393 
     117#: ../includes/class-plugin-config.php:386 
     118#: ../includes/class-plugin-config.php:394 
     119#: ../includes/class-plugin-config.php:438 
     120#: ../includes/class-plugin-config.php:446 
    102121msgid "milliseconds" 
    103122msgstr "" 
    104123 
    105 #: ../admin/class-wp-glossary-hover-admin.php:340 
    106 #: ../admin/class-wp-glossary-hover-admin.php:392 
     124#: ../includes/class-plugin-config.php:393 
     125#: ../includes/class-plugin-config.php:445 
    107126msgid "Duration" 
    108127msgstr "" 
    109128 
    110 #: ../admin/class-wp-glossary-hover-admin.php:348 
    111 #: ../admin/class-wp-glossary-hover-admin.php:400 
     129#: ../includes/class-plugin-config.php:401 
     130#: ../includes/class-plugin-config.php:453 
    112131msgid "Easing" 
    113132msgstr "" 
    114133 
    115 #: ../admin/class-wp-glossary-hover-admin.php:356 
     134#: ../includes/class-plugin-config.php:409 
    116135msgid "Hide Settings" 
    117136msgstr "" 
    118137 
    119 #: ../admin/class-wp-glossary-hover-admin.php:357 
     138#: ../includes/class-plugin-config.php:410 
    120139msgid "If and how to animate the hiding of the tooltip." 
    121140msgstr "" 
    122141 
    123 #: ../admin/class-wp-glossary-hover-admin.php:408 
     142#: ../includes/class-plugin-config.php:461 
    124143msgid "Show Settings" 
    125144msgstr "" 
    126145 
    127 #: ../admin/class-wp-glossary-hover-admin.php:409 
     146#: ../includes/class-plugin-config.php:462 
    128147msgid "If and how to animate the showing of the tooltip." 
    129148msgstr "" 
    130149 
    131 #: ../admin/class-wp-glossary-hover-admin.php:419 
     150#: ../includes/class-plugin-config.php:472 
    132151msgid "Tooltip Theme" 
    133152msgstr "" 
    134153 
    135 #: ../admin/class-wp-glossary-hover-admin.php:420 
     154#: ../includes/class-plugin-config.php:473 
    136155msgid "jQuery UI theme for tooltip." 
    137156msgstr "" 
    138157 
    139 #: ../admin/class-wp-glossary-hover-admin.php:427 
     158#: ../includes/class-plugin-config.php:480 
    140159msgid "Tooltip Styles" 
    141160msgstr "" 
    142161 
    143 #: ../admin/class-wp-glossary-hover-admin.php:428 
     162#: ../includes/class-plugin-config.php:481 
    144163msgid "How the tooltip looks." 
    145164msgstr "" 
    146165 
    147 #: ../admin/class-wp-glossary-hover-admin.php:438 
     166#: ../includes/class-plugin-config.php:491 
    148167msgid "Link Color" 
    149168msgstr "" 
    150169 
    151 #: ../admin/class-wp-glossary-hover-admin.php:446 
     170#: ../includes/class-plugin-config.php:499 
    152171msgid "Link Underline" 
    153172msgstr "" 
    154173 
    155 #: ../admin/class-wp-glossary-hover-admin.php:454 
     174#: ../includes/class-plugin-config.php:507 
    156175msgid "Link Styles" 
    157176msgstr "" 
    158177 
    159 #: ../admin/class-wp-glossary-hover-admin.php:455 
     178#: ../includes/class-plugin-config.php:508 
    160179msgid "How the tooltip link looks on the page." 
    161180msgstr "" 
    162181 
    163 #: ../admin/class-wp-glossary-hover-admin.php:464 
     182#: ../includes/class-plugin-config.php:517 
    164183msgid "General" 
    165184msgstr "" 
    166185 
    167 #: ../admin/class-wp-glossary-hover-admin.php:470 
     186#: ../includes/class-plugin-config.php:523 
    168187msgid "Tooltip" 
    169188msgstr "" 
    170189 
    171 #: ../admin/class-wp-glossary-hover-admin.php:476 
     190#: ../includes/class-plugin-config.php:529 
    172191msgid "Styles" 
    173192msgstr "" 
    174193 
    175 #: ../admin/includes/fields/class-color-picker-field.php:77 
     194#: ../includes/fields/class-color-picker-field.php:73 
    176195#, php-format 
    177196msgid "Enter a valid color for %s" 
    178197msgstr "" 
    179198 
    180 #: ../admin/includes/settings/class-plugin-settings.php:168 
     199#: ../includes/settings/class-plugin-settings.php:156 
    181200msgid "Save Settings" 
    182201msgstr "" 
    183202 
    184 #: ../admin/includes/settings/class-plugin-settings.php:169 
     203#: ../includes/settings/class-plugin-settings.php:157 
    185204msgid "Reset Defaults" 
    186205msgstr "" 
    187206 
    188 #: ../public/class-wp-glossary-hover.php:286 
    189 #: ../public/class-wp-glossary-hover.php:288 
     207#: ../public/class-wp-glossary-hover.php:250 
     208#: ../public/class-wp-glossary-hover.php:252 
    190209msgid "Glossary Terms" 
    191210msgstr "" 
    192211 
    193 #: ../public/class-wp-glossary-hover.php:287 
    194 #: ../public/class-wp-glossary-hover.php:289 
     212#: ../public/class-wp-glossary-hover.php:251 
     213#: ../public/class-wp-glossary-hover.php:253 
    195214msgid "Glossary Term" 
    196215msgstr "" 
    197216 
    198 #: ../public/class-wp-glossary-hover.php:290 
     217#: ../public/class-wp-glossary-hover.php:254 
    199218msgid "Add New" 
    200219msgstr "" 
    201220 
    202 #: ../public/class-wp-glossary-hover.php:291 
     221#: ../public/class-wp-glossary-hover.php:255 
    203222msgid "Add New Glossary Term" 
    204223msgstr "" 
    205224 
    206 #: ../public/class-wp-glossary-hover.php:292 
     225#: ../public/class-wp-glossary-hover.php:256 
    207226msgid "New Glossary Term" 
    208227msgstr "" 
    209228 
    210 #: ../public/class-wp-glossary-hover.php:293 
     229#: ../public/class-wp-glossary-hover.php:257 
    211230msgid "Edit Glossary Term" 
    212231msgstr "" 
    213232 
    214 #: ../public/class-wp-glossary-hover.php:294 
     233#: ../public/class-wp-glossary-hover.php:258 
    215234msgid "View Glossary Term" 
    216235msgstr "" 
    217236 
    218 #: ../public/class-wp-glossary-hover.php:295 
     237#: ../public/class-wp-glossary-hover.php:259 
    219238msgid "All Glossary Terms" 
    220239msgstr "" 
    221240 
    222 #: ../public/class-wp-glossary-hover.php:296 
     241#: ../public/class-wp-glossary-hover.php:260 
    223242msgid "Search Glossary Terms" 
    224243msgstr "" 
    225244 
    226 #: ../public/class-wp-glossary-hover.php:297 
     245#: ../public/class-wp-glossary-hover.php:261 
    227246msgid "Parent Glossary Terms:" 
    228247msgstr "" 
    229248 
    230 #: ../public/class-wp-glossary-hover.php:298 
     249#: ../public/class-wp-glossary-hover.php:262 
    231250msgid "No glossary terms found." 
    232251msgstr "" 
    233252 
    234 #: ../public/class-wp-glossary-hover.php:299 
     253#: ../public/class-wp-glossary-hover.php:263 
    235254msgid "No glossary terms found in Trash." 
    236255msgstr "" 
  • wp-glossary-hover/trunk/public/class-wp-glossary-hover.php

    r936455 r1123274  
    2525     * @var     string 
    2626     */ 
    27     const VERSION = '1.1.0'; 
    28  
    29     /** 
    30      * Instance of this class. 
    31      * 
    32      * @since    1.0.0 
    33      * @var      object 
    34      */ 
    35     protected static $instance = null; 
     27    const VERSION = '1.2.0'; 
    3628 
    3729    /** 
     
    4234     * plugin file. 
    4335     * 
    44      * @since    1.0.0 
     36     * @since    1.2.0 
    4537     * @var      string 
    4638     */ 
    47     protected $plugin_slug = 'wp-glossary-hover'; 
     39    const PLUGIN_SLUG = 'wp-glossary-hover'; 
    4840 
    4941    /** 
    5042     * Unique identifier for custom post type. 
    5143     * 
    52      * @since    1.0.0 
     44     * @since    1.2.0 
    5345     * @var      string 
    5446     */ 
    55     protected $glossary_post_type = 'wpgh-glossary'; 
     47    const GLOSSARY_POST_TYPE = 'wpgh-glossary'; 
     48 
     49    /** 
     50     * Instance of this class. 
     51     * 
     52     * @since    1.0.0 
     53     * @var      object 
     54     */ 
     55    protected static $instance = null; 
    5656 
    5757    /** 
     
    7777 
    7878        // Add filter to the content 
    79         $tooltip_parser = new WPGH_Tooltip_Parser($this->glossary_post_type); 
     79        $tooltip_parser = new WPGH_Tooltip_Parser(WP_Glossary_Hover::GLOSSARY_POST_TYPE); 
    8080        add_filter('the_content', array($tooltip_parser, 'parse_content')); 
    8181 
     
    9999 
    100100    /** 
    101      * Returns array containing the settings for the plugin or false if settings not found. 
    102      * 
    103      * @since    1.0.0 
    104      * @return   mixed 
    105      */ 
    106     public function get_settings() { 
    107  
    108         return get_option($this->plugin_slug); 
    109  
    110     } 
    111  
    112     /** 
    113      * Return the plugin slug. 
    114      * 
    115      * @since     1.0.0 
    116      * @return    string 
    117      */ 
    118     public function get_plugin_slug() { 
    119  
    120         return $this->plugin_slug; 
    121          
    122     } 
    123  
    124     /** 
    125      * Return unique identifier for custom post type. 
    126      * 
    127      * @since     1.0.0 
    128      * @return    string 
    129      */ 
    130     public function get_glossary_post_type() { 
    131  
    132         return $this->glossary_post_type; 
    133          
    134     } 
    135  
    136     /** 
    137101     * Fired when the plugin is activated. 
    138102     * 
     
    268232    public function load_plugin_textdomain() { 
    269233 
    270         $domain = $this->plugin_slug; 
     234        $domain = WP_Glossary_Hover::PLUGIN_SLUG; 
    271235        $locale = apply_filters('plugin_locale', get_locale(), $domain); 
    272236 
     
    281245    * @link http://codex.wordpress.org/Function_Reference/register_post_type 
    282246    */ 
    283     function wpgh_glossary_init() { 
     247    public function wpgh_glossary_init() { 
    284248 
    285249        $labels = array( 
    286             'name'               => __('Glossary Terms', $this->plugin_slug), 
    287             'singular_name'      => __('Glossary Term', $this->plugin_slug), 
    288             'menu_name'          => __('Glossary Terms', $this->plugin_slug), 
    289             'name_admin_bar'     => __('Glossary Term', $this->plugin_slug), 
    290             'add_new'            => __('Add New', $this->plugin_slug), 
    291             'add_new_item'       => __('Add New Glossary Term', $this->plugin_slug), 
    292             'new_item'           => __('New Glossary Term', $this->plugin_slug), 
    293             'edit_item'          => __('Edit Glossary Term', $this->plugin_slug), 
    294             'view_item'          => __('View Glossary Term', $this->plugin_slug), 
    295             'all_items'          => __('All Glossary Terms', $this->plugin_slug), 
    296             'search_items'       => __('Search Glossary Terms', $this->plugin_slug), 
    297             'parent_item_colon'  => __('Parent Glossary Terms:', $this->plugin_slug), 
    298             'not_found'          => __('No glossary terms found.', $this->plugin_slug), 
    299             'not_found_in_trash' => __('No glossary terms found in Trash.', $this->plugin_slug), 
     250            'name'               => __('Glossary Terms', WP_Glossary_Hover::PLUGIN_SLUG), 
     251            'singular_name'      => __('Glossary Term', WP_Glossary_Hover::PLUGIN_SLUG), 
     252            'menu_name'          => __('Glossary Terms', WP_Glossary_Hover::PLUGIN_SLUG), 
     253            'name_admin_bar'     => __('Glossary Term', WP_Glossary_Hover::PLUGIN_SLUG), 
     254            'add_new'            => __('Add New', WP_Glossary_Hover::PLUGIN_SLUG), 
     255            'add_new_item'       => __('Add New Glossary Term', WP_Glossary_Hover::PLUGIN_SLUG), 
     256            'new_item'           => __('New Glossary Term', WP_Glossary_Hover::PLUGIN_SLUG), 
     257            'edit_item'          => __('Edit Glossary Term', WP_Glossary_Hover::PLUGIN_SLUG), 
     258            'view_item'          => __('View Glossary Term', WP_Glossary_Hover::PLUGIN_SLUG), 
     259            'all_items'          => __('All Glossary Terms', WP_Glossary_Hover::PLUGIN_SLUG), 
     260            'search_items'       => __('Search Glossary Terms', WP_Glossary_Hover::PLUGIN_SLUG), 
     261            'parent_item_colon'  => __('Parent Glossary Terms:', WP_Glossary_Hover::PLUGIN_SLUG), 
     262            'not_found'          => __('No glossary terms found.', WP_Glossary_Hover::PLUGIN_SLUG), 
     263            'not_found_in_trash' => __('No glossary terms found in Trash.', WP_Glossary_Hover::PLUGIN_SLUG), 
    300264        ); 
    301265 
     
    312276            'hierarchical'       => false, 
    313277            'menu_position'      => null, 
    314             'supports'           => array('title', 'editor', 'author', 'revisions') 
     278            'supports'           => array('title', 'editor', 'author', 'revisions', 'comments') 
    315279        ); 
    316280 
    317         register_post_type($this->glossary_post_type, $args); 
     281        register_post_type(WP_Glossary_Hover::GLOSSARY_POST_TYPE, $args); 
    318282 
    319283    } 
     
    326290    public function enqueue_styles() { 
    327291 
    328         $settings = $this->get_settings(); 
    329  
    330         wp_enqueue_style($this->plugin_slug . '-plugin-styles', plugins_url('assets/css/public.css', __FILE__), array(), self::VERSION); 
    331         wp_enqueue_style($this->plugin_slug . '-jquery-ui-styles', plugins_url('vendor/jquery-ui/css/'.$settings['styles_tooltip_theme'].'/jquery-ui-1.10.4.custom.min.css', __FILE__), array(), self::VERSION); 
     292        $settings = WPGH_Plugin_Config::get_settings(); 
     293 
     294        wp_enqueue_style(WP_Glossary_Hover::PLUGIN_SLUG . '-plugin-styles', plugins_url('assets/css/public.css', __FILE__), array(), self::VERSION); 
     295        wp_enqueue_style(WP_Glossary_Hover::PLUGIN_SLUG . '-jquery-ui-styles', plugins_url('vendor/jquery-ui/css/'.$settings['styles_tooltip_theme'].'/jquery-ui-1.10.4.custom.min.css', __FILE__), array(), self::VERSION); 
    332296 
    333297        $custom_css = " 
    334         .wpgh-tooltip { 
     298        .wpgh-tooltip, 
     299        a.wpgh-tooltip, 
     300        a.wpgh-tooltip:hover, 
     301        a.wpgh-tooltip:focus, 
     302        .entry-content .wpgh-tooltip, 
     303        .entry-content a.wpgh-tooltip, 
     304        .entry-content a.wpgh-tooltip:hover, 
     305        .entry-content a.wpgh-tooltip:focus { 
    335306            color: {$settings['styles_link_color']}; 
    336             border-bottom: 1px {$settings['styles_link_underline']}; 
     307            border-style: {$settings['styles_link_underline']}; 
     308            border-bottom-width: 1px; 
    337309        }"; 
    338         wp_add_inline_style($this->plugin_slug . '-plugin-styles', $custom_css); 
     310        wp_add_inline_style(WP_Glossary_Hover::PLUGIN_SLUG . '-plugin-styles', $custom_css); 
    339311 
    340312    } 
     
    348320    public function enqueue_scripts() { 
    349321 
    350         $settings = $this->get_settings(); 
     322        $settings = WPGH_Plugin_Config::get_settings(); 
    351323 
    352324        // Register jquery ui scripts for tooltip widget 
     
    361333 
    362334        // Register script to create the tooltip for glossary terms 
    363         wp_enqueue_script($this->plugin_slug . '-plugin-script', plugins_url('assets/js/public.js', __FILE__), array('jquery'), self::VERSION); 
     335        wp_enqueue_script(WP_Glossary_Hover::PLUGIN_SLUG . '-plugin-script', plugins_url('assets/js/public.js', __FILE__), array('jquery'), self::VERSION); 
    364336 
    365337        $tooltip_settings = array( 
     
    377349        ); 
    378350 
    379         wp_localize_script($this->plugin_slug . '-plugin-script', 'wp_glossary_hover_tooltip_settings', $tooltip_settings); 
     351        wp_localize_script(WP_Glossary_Hover::PLUGIN_SLUG . '-plugin-script', 'wp_glossary_hover_tooltip_settings', $tooltip_settings); 
    380352 
    381353    } 
  • wp-glossary-hover/trunk/public/includes/class-tooltip-parser.php

    r936455 r1123274  
    6363 
    6464    /** 
    65      * String format for creating tooltip html tag. 
    66      * 
    67      * @since    1.0.0 
    68      * @var      string 
    69      */ 
    70     protected $tooltip_html = '<span class="wpgh-tooltip" title="%s">%s</span>'; 
     65     * String format used when limiting the number of characters. 
     66     * 
     67     * @since    1.2.0 
     68     * @var      string 
     69     */ 
     70    protected $tooltip_more = '%s...'; 
     71 
     72    /** 
     73     * String format for creating tooltip span tag. 
     74     * 
     75     * @since    1.2.0 
     76     * @var      string 
     77     */ 
     78    protected $tooltip_span_html = '<span class="wpgh-tooltip" title="%s">%s</span>'; 
     79 
     80    /** 
     81     * String format for creating tooltip link tag. 
     82     * 
     83     * @since    1.2.0 
     84     * @var      string 
     85     */ 
     86    protected $tooltip_link_html = '<a class="wpgh-tooltip" href="%s" title="%s">%s</a>'; 
    7187 
    7288    /** 
     
    8096 
    8197    } 
    82  
    83     /** 
    84      * Returns array containing the settings for the plugin or false if settings not found. 
    85      * 
    86      * @since    1.0.0 
    87      * @return   mixed 
    88      */ 
    89     public static function get_settings() { 
    90  
    91         $plugin = WP_Glossary_Hover::get_instance(); 
    92         return $plugin->get_settings(); 
    93  
    94     } 
    95  
    9698    /** 
    9799     * Returns WP_Query object with glossary terms. 
     
    129131        } 
    130132 
    131         $settings = $this->get_settings(); 
     133        $settings = WPGH_Plugin_Config::get_settings(); 
    132134 
    133135        // Valid post type required 
     
    202204 
    203205                // Add tooltip 
    204                 $tooltip = $this->get_tooltip_html($term->post_title, $term->post_content); 
     206                $tooltip = $this->get_tooltip_html($term->ID, $term->post_title, $term->post_content); 
    205207                $nodeValue = preg_replace($pattern, $tooltip, $nodeValue, $replace_limit); 
    206208                $updateNode = true; // Node needs to be updated 
     
    240242    private function get_xpath_query() { 
    241243 
    242         $settings = $this->get_settings(); 
     244        $settings = WPGH_Plugin_Config::get_settings(); 
    243245 
    244246        // Html tags to disable in xpath query 
     
    267269    private function get_term_regex_pattern($term) { 
    268270         
    269         $settings = $this->get_settings(); 
     271        $settings = WPGH_Plugin_Config::get_settings(); 
    270272 
    271273        $pattern = $this->term_regex_pattern; 
     
    285287     * 
    286288     * @since    1.0.0 
     289     * @param    string    $id            Term Post ID. 
    287290     * @param    string    $term          Glossary Term. 
    288291     * @param    string    $definition    Definition of glossary term. 
    289292     * @return   string 
    290293     */ 
    291     private function get_tooltip_html($term, $definition) { 
    292  
    293         return sprintf($this->tooltip_html, esc_html($definition), $term); 
     294    private function get_tooltip_html($id, $term, $definition) { 
     295         
     296        $settings = WPGH_Plugin_Config::get_settings(); 
     297        $link = $settings['tooltip_general_link']; 
     298         
     299        $definition = $this->clean_definition($definition); 
     300        $definition = $this->limit_characters_in_definition($definition); 
     301 
     302        if ($link) 
     303        { 
     304            $permalink = get_permalink($id); 
     305            return sprintf($this->tooltip_link_html, $permalink, $definition, $term); 
     306        } 
     307 
     308        return sprintf($this->tooltip_span_html, $definition, $term); 
     309 
     310    } 
     311 
     312    /** 
     313     * Strip tags and escape special characters once. 
     314     * 
     315     * @since    1.2.0 
     316     * @param    string    $definition    Definition of glossary term. 
     317     * @return   string 
     318     */ 
     319    private function clean_definition($definition) { 
     320 
     321        $definition = strip_tags($definition); 
     322        $definition = htmlspecialchars(htmlspecialchars_decode($definition)); 
     323        return $definition; 
     324 
     325    } 
     326 
     327    /** 
     328     * Limit characters in definition, based on setting and length of definition.  
     329     * 
     330     * @since    1.2.0 
     331     * @param    string    $definition    Definition of glossary term. 
     332     * @return   string 
     333     */ 
     334    private function limit_characters_in_definition($definition) { 
     335         
     336        $settings = WPGH_Plugin_Config::get_settings(); 
     337        $limit_characters = $settings['tooltip_general_limit_characters']; 
     338 
     339        // Check if limit characters setting has been set 
     340        // Check if the current definition is longer than the set limit 
     341        if ($limit_characters > 0 && strlen($definition) > $limit_characters) 
     342        { 
     343            // Limit number of characters in defintion 
     344            $definition = substr($definition, 0, $limit_characters); 
     345            $definition = sprintf($this->tooltip_more, $definition); 
     346        } 
     347 
     348        return $definition; 
    294349 
    295350    } 
  • wp-glossary-hover/trunk/wp-glossary-hover.php

    r936455 r1123274  
    1616 * Plugin URI:        https://github.com/chorton2227/WP-Glossary-Hover 
    1717 * Description:       When hovering over a word or phrase show the user created definition. 
    18  * Version:           1.1.0 
     18 * Version:           1.2.0 
    1919 * Author:            Chris Horton <chorton2227@gmail.com> 
    2020 * Author URI:        https://github.com/chorton2227 
     
    3535 *----------------------------------------------------------------------------*/ 
    3636 
    37 /* 
    38  * Load public WP Glossary Hover classes. 
    39  */ 
    40 require_once(plugin_dir_path(__FILE__) . 'public/includes/class-tooltip-parser.php'); 
     37$require_files = array( 
     38    'public/includes/class-tooltip-parser.php', 
     39    'public/class-wp-glossary-hover.php', 
     40    'includes/class-plugin-config.php', 
     41    'includes/enums/class-base-enum.php', 
     42    'includes/enums/class-field-types-enum.php', 
     43    'includes/fields/class-base-field.php', 
     44    'includes/fields/class-checkbox-field.php', 
     45    'includes/fields/class-integer-field.php', 
     46    'includes/fields/class-select-field.php', 
     47    'includes/fields/class-textbox-field.php', 
     48    'includes/fields/class-multi-checkbox-field.php', 
     49    'includes/fields/class-color-picker-field.php', 
     50    'includes/settings/class-settings-section.php', 
     51    'includes/settings/class-settings-tab.php', 
     52    'includes/settings/class-plugin-settings.php' 
     53); 
    4154 
    42 /* 
    43  * WP Glossary Hover class. This class works with the public-facing side of the 
    44  * WordPress site. 
    45  */ 
    46 require_once(plugin_dir_path(__FILE__) . 'public/class-wp-glossary-hover.php'); 
     55foreach ($require_files as $file) 
     56{ 
     57    require_once(plugin_dir_path(__FILE__) . $file); 
     58} 
    4759 
    4860/* 
     
    5769 */ 
    5870add_action('plugins_loaded', array('WP_Glossary_Hover', 'get_instance')); 
     71 
     72/* 
     73 * Load instance of WP Glossary Hover Plugin Config class. 
     74 */ 
     75add_action('plugins_loaded', array('WPGH_Plugin_Config', 'get_instance')); 
    5976 
    6077/*----------------------------------------------------------------------------* 
     
    7491if (is_admin() && ( ! defined('DOING_AJAX') || ! DOING_AJAX)) { 
    7592 
    76     require_once(plugin_dir_path(__FILE__) . 'admin/includes/enums/class-base-enum.php'); 
    77     require_once(plugin_dir_path(__FILE__) . 'admin/includes/enums/class-field-types-enum.php'); 
     93    $require_files = array( 
     94        'admin/class-wp-glossary-hover-admin.php' 
     95    ); 
    7896 
    79     require_once(plugin_dir_path(__FILE__) . 'admin/includes/fields/class-base-field.php'); 
    80     require_once(plugin_dir_path(__FILE__) . 'admin/includes/fields/class-checkbox-field.php'); 
    81     require_once(plugin_dir_path(__FILE__) . 'admin/includes/fields/class-integer-field.php'); 
    82     require_once(plugin_dir_path(__FILE__) . 'admin/includes/fields/class-select-field.php'); 
    83     require_once(plugin_dir_path(__FILE__) . 'admin/includes/fields/class-textbox-field.php'); 
    84     require_once(plugin_dir_path(__FILE__) . 'admin/includes/fields/class-multi-checkbox-field.php'); 
    85     require_once(plugin_dir_path(__FILE__) . 'admin/includes/fields/class-color-picker-field.php'); 
     97    foreach ($require_files as $file) 
     98    { 
     99        require_once(plugin_dir_path(__FILE__) . $file); 
     100    } 
    86101 
    87     require_once(plugin_dir_path(__FILE__) . 'admin/includes/settings/class-settings-section.php'); 
    88     require_once(plugin_dir_path(__FILE__) . 'admin/includes/settings/class-settings-tab.php'); 
    89     require_once(plugin_dir_path(__FILE__) . 'admin/includes/settings/class-plugin-settings.php'); 
    90  
    91     require_once(plugin_dir_path(__FILE__) . 'admin/class-wp-glossary-hover-admin.php'); 
    92102    add_action('plugins_loaded', array('WP_Glossary_Hover_Admin', 'get_instance')); 
    93103 
    94104} 
     105 
     106unset($file); 
     107unset($require_files); 
Note: See TracChangeset for help on using the changeset viewer.