Changeset 1775993
- Timestamp:
- 11/27/2017 10:08:41 AM (8 years ago)
- Location:
- widget-pagination/trunk/public
- Files:
-
- 3 edited
-
class-widget-pagination-public.php (modified) (1 diff)
-
css/widget-pagination-public.css (modified) (3 diffs)
-
js/widget-pagination-public.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
widget-pagination/trunk/public/class-widget-pagination-public.php
r1773954 r1775993 200 200 } 201 201 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; "; 234 223 } 235 224 } 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;"; 240 240 } 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 } 258 259 259 260 } -
widget-pagination/trunk/public/css/widget-pagination-public.css
r1772382 r1775993 3 3 */ 4 4 5 . br-pagination {5 .wgpag-pagination { 6 6 padding: 2px 0; 7 7 } 8 8 9 . br-pagination a, .br-pagination span {9 .wgpag-pagination a, .wgpag-pagination span { 10 10 padding: 0.1em 0.5em; 11 11 border: 1px solid #F1F1F1; … … 13 13 } 14 14 15 . br-pagination a, .br-pagination a:hover {15 .wgpag-pagination a, .wgpag-pagination a:hover { 16 16 text-decoration: none; 17 17 } 18 18 19 . br-current {19 .wgpag-current { 20 20 font-weight: bold; 21 21 background-color: #F1F1F1; 22 22 } 23 23 24 . br-current.br-prev, .br-current.br-next {24 .wgpag-current.wgpag-prev, .wgpag-current.wgpag-next { 25 25 color: transparent !important; 26 26 background-color: transparent !important; … … 28 28 } 29 29 30 . br-pagination .br-separator {30 .wgpag-pagination .wgpag-separator { 31 31 background-color: transparent; 32 32 border: 0 none; -
widget-pagination/trunk/public/js/widget-pagination-public.js
r1773881 r1775993 41 41 var prevnext_threshold = wgpag_options.prevnext_threshold || 0; 42 42 43 //console.log(wgpag_options); // for debugging 44 43 45 function navigation(len, cur, showpage, autoadvance) { 44 var div = $('<div class=" br-pagination"></div>');46 var div = $('<div class="wgpag-pagination"></div>'); 45 47 var timeoutId = 0; 46 48 … … 64 66 n = len; 65 67 if (n == cur) { 66 return $('<span class=" br-current">' + title + '</span>');68 return $('<span class="wgpag-current">' + title + '</span>'); 67 69 } 68 70 var el = $('<a href="#">' + title + '</a>;'); … … 86 88 87 89 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')); 89 91 div.append(navelement(1, 1)); 90 92 if (first > 2) 91 div.append('<span class=" br-separator">…</span>');93 div.append('<span class="wgpag-separator">…</span>'); 92 94 for (var i = first; i <= last; i++) 93 95 div.append(navelement(i, i)); 94 96 if (last < len -1) 95 div.append('<span class=" br-separator">…</span>');97 div.append('<span class="wgpag-separator">…</span>'); 96 98 div.append(navelement(len, len)); 97 99 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')); 99 101 100 102 showpage(cur);
Note: See TracChangeset
for help on using the changeset viewer.