Plugin Directory

Changeset 1775993


Ignore:
Timestamp:
11/27/2017 10:08:41 AM (8 years ago)
Author:
jasie
Message:

renamed 'br-' in 'wgpag-' (unclear, what br stands for...) (public)

Location:
widget-pagination/trunk/public
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • widget-pagination/trunk/public/class-widget-pagination-public.php

    r1773954 r1775993  
    200200    }
    201201
    202         /**
    203          * TODO descr
    204          *
    205          * @return string   CSS
    206          * @author Lars Uebernickel
    207          * @since 0.4
    208          */
    209         private function item_css () {
    210             $selectors = array(
    211                 'item_style'       => 'a',
    212                 'hover_item_style' => 'a:hover',
    213                 'cur_item_style'   => '.br-current'
    214             );
    215             $css = '';
    216             $options = get_option( $this->plugin_short );
    217             foreach($selectors as $name => $selector) {
    218                 $css .= ".br-pagination $selector { ";
    219                 foreach ($this->styles as $s => $title) {
    220                     $optval = $options["${name}_$s"];
    221                     if (!empty($optval)) {
    222                         $css .= "$s: $optval; ";
    223                     }
    224                 }
    225                 $css .= "}";
    226             }
    227 
    228             $pagcss = '';
    229             $borders = array ('top', 'bottom', 'left', 'right');
    230             foreach ($borders as $border) {
    231                 $borderstyle = $options['pagination_style_border_color_' . $border];
    232                 if ($borderstyle) {
    233                     $pagcss .= "border-$border: 1px solid $borderstyle;";
     202    /**
     203     * TODO descr
     204     *
     205     * @return string   CSS
     206     * @author Lars Uebernickel
     207     * @since 0.4
     208     */
     209    private function item_css () {
     210        $selectors = array(
     211            'item_style'       => 'a',
     212            'hover_item_style' => 'a:hover',
     213            'cur_item_style'   => '.wgpag-current'
     214        );
     215        $css = '';
     216        $options = get_option( $this->plugin_short );
     217        foreach($selectors as $name => $selector) {
     218            $css .= ".wgpag-pagination $selector { ";
     219            foreach ($this->styles as $s => $title) {
     220                $optval = $options["${name}_$s"];
     221                if (!empty($optval)) {
     222                    $css .= "$s: $optval; ";
    234223                }
    235224            }
    236 
    237             $pagbg = $options['pagination_style_background_color'];
    238             if ($pagbg) {
    239                 $pagcss .= "background-color: $pagbg;";
     225            $css .= "}";
     226        }
     227
     228        $pagcss = '';
     229
     230        $pagbg = $options['pag_style_background-color'];
     231        if ($pagbg) {
     232            $pagcss .= "background-color: $pagbg;";
     233        }
     234
     235        $borders = array ('top', 'bottom', 'left', 'right');
     236        foreach ($borders as $border) {
     237            $borderstyle = $options['pag_style_border-' . $border . '-color'];
     238            if ($borderstyle) {
     239                $pagcss .= "border-$border: 1px solid $borderstyle;";
    240240            }
    241 
    242             $horalign = $options['pag_option_hor_align'];
    243             $pagcss .= "text-align: $horalign;";
    244 
    245             $margintop = $options['pag_option_margin_top'];
    246             $pagcss .= "margin-top: $margintop;";
    247 
    248             $marginbottom = $options['pag_option_margin_bottom'];
    249             $pagcss .= "margin-bottom: $marginbottom;";
    250 
    251             $css .= ".br-pagination { $pagcss; }";
    252 
    253             $liststyle = $options['list_item_style'];
    254             $css .= ".widget-container li { list-style-type: $liststyle; }";
    255 
    256             return $css;
    257         }
     241        }
     242
     243        $horalign = $options['pag_option_hor_align'];
     244        $pagcss .= "text-align: $horalign;";
     245
     246        $margintop = $options['pag_option_margin_top'];
     247        $pagcss .= "margin-top: $margintop;";
     248
     249        $marginbottom = $options['pag_option_margin_bottom'];
     250        $pagcss .= "margin-bottom: $marginbottom;";
     251
     252        $css .= ".wgpag-pagination { $pagcss; }";
     253
     254        $liststyle = $options['list_item_style'];
     255        $css .= ".widget-container li { list-style-type: $liststyle; }";
     256
     257        return $css;
     258    }
    258259
    259260}
  • widget-pagination/trunk/public/css/widget-pagination-public.css

    r1772382 r1775993  
    33 */
    44
    5 .br-pagination {
     5.wgpag-pagination {
    66    padding: 2px 0;
    77}
    88
    9 .br-pagination a, .br-pagination span {
     9.wgpag-pagination a, .wgpag-pagination span {
    1010    padding: 0.1em 0.5em;
    1111    border: 1px solid #F1F1F1;
     
    1313}
    1414
    15 .br-pagination a, .br-pagination a:hover {
     15.wgpag-pagination a, .wgpag-pagination a:hover {
    1616    text-decoration: none;
    1717}
    1818
    19 .br-current {
     19.wgpag-current {
    2020    font-weight: bold;
    2121    background-color: #F1F1F1;
    2222}
    2323
    24 .br-current.br-prev, .br-current.br-next {
     24.wgpag-current.wgpag-prev, .wgpag-current.wgpag-next {
    2525    color: transparent !important;
    2626    background-color: transparent !important;
     
    2828}
    2929
    30 .br-pagination .br-separator {
     30.wgpag-pagination .wgpag-separator {
    3131    background-color: transparent;
    3232    border: 0 none;
  • widget-pagination/trunk/public/js/widget-pagination-public.js

    r1773881 r1775993  
    4141        var prevnext_threshold = wgpag_options.prevnext_threshold || 0;
    4242
     43        //console.log(wgpag_options); // for debugging
     44
    4345        function navigation(len, cur, showpage, autoadvance) {
    44                 var div = $('<div class="br-pagination"></div>');
     46                var div = $('<div class="wgpag-pagination"></div>');
    4547                var timeoutId = 0;
    4648
     
    6466                                n = len;
    6567                        if (n == cur) {
    66                                 return $('<span class="br-current">' + title + '</span>');
     68                                return $('<span class="wgpag-current">' + title + '</span>');
    6769                        }
    6870                        var el = $('<a href="#">' + title + '</a>;');
     
    8688
    8789                if (len >= prevnext_threshold)
    88                         div.append(navelement(cur -1, prev_label).addClass('br-prev'));
     90                        div.append(navelement(cur -1, prev_label).addClass('wgpag-prev'));
    8991                div.append(navelement(1, 1));
    9092                if (first > 2)
    91                         div.append('<span class="br-separator">&hellip;</span>');
     93                        div.append('<span class="wgpag-separator">&hellip;</span>');
    9294                for (var i = first; i <= last; i++)
    9395                        div.append(navelement(i, i));
    9496                if (last < len -1)
    95                         div.append('<span class="br-separator">&hellip;</span>');
     97                        div.append('<span class="wgpag-separator">&hellip;</span>');
    9698                div.append(navelement(len, len));
    9799                if (len >= prevnext_threshold)
    98                         div.append(navelement(cur +1, next_label).addClass('br-next'));
     100                        div.append(navelement(cur +1, next_label).addClass('wgpag-next'));
    99101
    100102                showpage(cur);
Note: See TracChangeset for help on using the changeset viewer.