Plugin Directory

Changeset 2180916


Ignore:
Timestamp:
10/27/2019 09:46:03 AM (6 years ago)
Author:
Butuzov
Message:

Version 0.6.3

Location:
debug-bar-rewrite-rules
Files:
20 added
2 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • debug-bar-rewrite-rules/trunk/CHANGELOG.md

    r2179097 r2180916  
    22
    33### 0.6
     4* [general] - way assets appear on a page changed.
     5* [bug] - Fixed: warning on private static var
    46* [bug] - Fixed: admin page    https://github.com/butuzov/Debug-Bar-Rewrite-Rules/issues/2
    57* [bug] - Fixed: domain field  https://github.com/butuzov/Debug-Bar-Rewrite-Rules/issues/3
  • debug-bar-rewrite-rules/trunk/assets/debug-bar-rewrite-rules.css

    r2179097 r2180916  
    1 #querylist :after,#querylist :before {
    2     -webkit-box-sizing: content-box;
    3     -moz-box-sizing: content-box;
    4     box-sizing: content-box
    5 }
    6 
    7 .debug-bar-rewrites-urls .stats a,.debug-bar-rewrites-urls .stats h2 {
    8     float: left;
    9     min-width: 150px;
    10     font-weight: 400;
    11     font-family: georgia,times,serif;
    12     clear: none;
    13     text-align: center;
    14     font-size: 28px!important;
    15     margin: 15px 10px 15px 0!important
    16 }
    17 
    18 .debug-bar-rewrites-urls .stats h2 {
    19     border: 1px solid transparent;
    20     padding: 5px 10px 15px
    21 }
    22 
    23 .debug-bar-rewrites-urls .stats h2 span {
    24     font-size: 12px;
    25     color: #888;
    26     text-transform: uppercase;
    27     white-space: nowrap;
    28     display: block;
    29     margin-bottom: 5px
    30 }
    31 
    32 .debug-bar-rewrites-urls .stats h2>i {
    33     font-style: normal
    34 }
    35 
    36 .debug-bar-rewrites-urls .stats a,.debug-bar-rewrites-urls .stats a:active,.debug-bar-rewrites-urls .stats a:focus {
    37     padding-top: 28px;
    38     text-decoration: underline!important;
    39     outline: 0!important;
    40     -webkit-tap-highlight-color: transparent!important;
    41     box-shadow: none
    42 }
    43 
    44 #querylist .debug-bar-rewrites-urls .stats a,#querylist .debug-bar-rewrites-urls .stats a:active,#querylist .debug-bar-rewrites-urls .stats a:focus,.debug-bar-rewrites-urls .stats a,.debug-bar-rewrites-urls .stats a:active,.debug-bar-rewrites-urls .stats a:focus {
    45     color: #000!important
    46 }
    47 
    48 .debug-bar-rewrites-urls .stats a .spinner {
    49     visibility: hidden;
    50     display: block;
    51     float: none;
    52     margin: 14px auto 0
    53 }
    54 
    55 .debug-bar-rewrites-urls h3 {
    56     font: 21px georgia,times,serif;
    57     margin: 15px 10px 15px 0!important;
    58     clear: both
    59 }
    60 
    61 .debug-bar-rewrites-urls .filterui {
    62     margin: -6px -20px 0;
    63     padding: 6px 20px;
    64     display: flex
    65 }
    66 
    67 .wrap.debug-bar-rewrites-urls .filterui {
    68     margin: 0;
    69     padding: 6px 0
    70 }
    71 
    72 .debug-bar-rewrites-urls .filterui .mono {
    73     margin: 0!important;
    74     padding: 2px 3px!important;
    75     box-shadow: none!important;
    76     outline: 0;
    77     border-radius: 3px;
    78     box-sizing: border-box;
    79     font-family: courier!important;
    80     font-size: 12px!important;
    81     line-height: 18px
    82 }
    83 
    84 .debug-bar-rewrites-urls .filterui .mono:focus {
    85     outline: 0
    86 }
    87 
    88 .debug-bar-rewrites-urls .filterui .mono::-webkit-input-placeholder {
    89     font-family: courier!important;
    90     font-size: 12px!important;
    91     line-height: 18px
    92 }
    93 
    94 .debug-bar-rewrites-urls .filterui .mono::-moz-placeholder {
    95     font-family: courier!important;
    96     font-size: 12px!important;
    97     line-height: 18px
    98 }
    99 
    100 .debug-bar-rewrites-urls .filterui .url {
    101     width: 75%;
    102     font-size: 0;
    103     letter-spacing: 0;
    104     line-height: 0;
    105     border: 1px solid #dfdfdf;
    106     border-radius: 3px;
    107     display: flex;
    108     background-color: #fff
    109 }
    110 
    111 .debug-bar-rewrites-urls .filterui .url.active {
    112     border-color: #999
    113 }
    114 
    115 .debug-bar-rewrites-urls .filterui .url .mono {
    116     display: table-cell
    117 }
    118 
    119 .debug-bar-rewrites-urls .filterui .url .mono,.debug-bar-rewrites-urls .filterui .url .mono:focus {
    120     border: 0!important
    121 }
    122 
    123 .debug-bar-rewrites-urls .filterui .url .search {
    124     border-top-left-radius: 0!important;
    125     border-bottom-left-radius: 0!important;
    126     border-left-width: 0;
    127     margin-left: 0!important;
    128     padding-left: 0!important;
    129     text-align: left;
    130     background: #fff!important;
    131     color: #32373c;
    132     flex-grow: 1;
    133     min-width: 25%
    134 }
    135 
    136 .debug-bar-rewrites-urls .filterui .url .domain {
    137     border-top-right-radius: 0!important;
    138     border-bottom-right-radius: 0!important;
    139     border-right-width: 0;
    140     margin-right: 2px!important;
    141     padding-right: 0!important;
    142     text-align: right;
    143     background: #fff!important;
    144     color: #999;
    145     order: -1
    146 }
    147 
    148 .debug-bar-rewrites-urls .filterui .url span.domain {
    149     display: inline-block
    150 }
    151 
    152 .debug-bar-rewrites-urls .filterui .rule {
    153     width: 25%;
    154     padding-left: 12px
    155 }
    156 
    157 .debug-bar-rewrites-urls .filterui .rule input {
    158     width: 100%;
    159     text-align: center;
    160     color: #32373c!important;
    161     border: 1px solid #dfdfdf!important
    162 }
    163 
    164 .debug-bar-rewrites-urls .filterui .rule input:focus {
    165     border-color: #999!important
    166 }
    167 
    168 .debug-bar-rewrites-urls .dbrr {
    169     margin: 0 -20px
    170 }
    171 
    172 .wrap.debug-bar-rewrites-urls .dbrr {
    173     margin: 0
    174 }
    175 
    176 .debug-bar-rewrites-urls .dbrr table {
    177     width: 100%;
    178     min-width: 860px;
    179     background-color: #f9f9f9;
    180     border-width: 1px
    181 }
    182 
    183 .wrap.debug-bar-rewrites-urls .dbrr table {
    184     border: 1px solid #dfdfdf
    185 }
    186 
    187 .debug-bar-rewrites-urls .dbrr table tfoot tr th,.debug-bar-rewrites-urls .dbrr table thead tr th {
    188     border-width: 1px 0;
    189     border-style: solid;
    190     overflow: hidden;
    191     border-top-color: #dfdfdf;
    192     border-bottom-color: #dfdfdf;
    193     background: #f1f1f1;
    194     background-image: linear-gradient(to top,#ececec,#f9f9f9);
    195     font-family: georgia,times,serif;
    196     font-size: 15px!important;
    197     font-weight: 400!important;
    198     padding: 7px 0;
    199     text-align: left;
    200     line-height: 1.3em;
    201     color: #333
    202 }
    203 
    204 .debug-bar-rewrites-urls .dbrr table tfoot tr th:first-of-type,.debug-bar-rewrites-urls .dbrr table thead tr th:first-of-type,.debug-bar-rewrites-urls .dbrr.rules table tbody tr td:first-of-type {
    205     padding-left: 20px
    206 }
    207 
    208 .debug-bar-rewrites-urls .dbrr table tbody tr.alt td {
    209     background-color: #fff!important
    210 }
    211 
    212 .debug-bar-rewrites-urls .dbrr table tbody tr.hidden {
    213     display: none
    214 }
    215 
    216 .debug-bar-rewrites-urls .dbrr table tbody tr td {
    217     padding: 4px 7px;
    218     vertical-align: top
    219 }
    220 
    221 .debug-bar-rewrites-urls .dbrr table tbody tr td span {
    222     background: rgba(237,224,0,.5);
    223     padding: 2px;
    224     margin: -2px;
    225     display: inline-block;
    226     border-radius: 3px
    227 }
    228 
    229 .debug-bar-rewrites-urls .dbrr table tbody tr td:last-of-type {
    230     padding-right: 20px
    231 }
    232 
    233 .debug-bar-rewrites-urls .dbrr.filters table tr.deactivated td {
    234     background-color: #eff0f1;
    235     color: #999;
    236     text-align: center
    237 }
    238 
    239 .debug-bar-rewrites-urls .dbrr.filters table tr.deactivated td.filter-hook {
    240     text-align: left
    241 }
    242 
    243 .debug-bar-rewrites-urls .dbrr.filters table tr:nth-child(odd) {
    244     background-color: #f9f9f9
    245 }
    246 
    247 .debug-bar-rewrites-urls .dbrr.filters table tr:nth-child(even) {
    248     background-color: #fff
    249 }
    250 
    251 .debug-bar-rewrites-urls .dbrr.filters table tr td {
    252     padding: 4px 7px;
    253     font-size: 12px;
    254     line-height: 16px;
    255     border-top: 1px solid #fcfcfc;
    256     border-bottom: 1px solid #dfdfdf
    257 }
    258 
    259 .debug-bar-rewrites-urls .dbrr.filters table tr td.filter-hook {
    260     padding-left: 20px
    261 }
     1#querylist :after,#querylist :before{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.debug-bar-rewrites-urls .stats a,.debug-bar-rewrites-urls .stats h2{float:left;min-width:150px;font-weight:400;font-family:georgia,times,serif;clear:none;text-align:center;font-size:28px!important;margin:15px 10px 15px 0!important}.debug-bar-rewrites-urls .stats h2{border:1px solid transparent;padding:5px 10px 15px}.debug-bar-rewrites-urls .stats h2 span{font-size:12px;color:#888;text-transform:uppercase;white-space:nowrap;display:block;margin-bottom:5px}.debug-bar-rewrites-urls .stats h2>i{font-style:normal}.debug-bar-rewrites-urls .stats a,.debug-bar-rewrites-urls .stats a:active,.debug-bar-rewrites-urls .stats a:focus{padding-top:28px;text-decoration:underline!important;outline:0!important;-webkit-tap-highlight-color:transparent!important;box-shadow:none}#querylist .debug-bar-rewrites-urls .stats a,#querylist .debug-bar-rewrites-urls .stats a:active,#querylist .debug-bar-rewrites-urls .stats a:focus,.debug-bar-rewrites-urls .stats a,.debug-bar-rewrites-urls .stats a:active,.debug-bar-rewrites-urls .stats a:focus{color:#000!important}.debug-bar-rewrites-urls .stats a .spinner{visibility:hidden;display:block;float:none;margin:14px auto 0}.debug-bar-rewrites-urls h3{font:21px georgia,times,serif;margin:15px 10px 15px 0!important;clear:both}.debug-bar-rewrites-urls .filterui{margin:-6px -20px 0;padding:6px 20px;display:flex}.wrap.debug-bar-rewrites-urls .filterui{margin:0;padding:6px 0}.debug-bar-rewrites-urls .filterui .mono{margin:0!important;padding:2px 3px!important;box-shadow:none!important;outline:0;border-radius:3px;box-sizing:border-box;font-family:courier!important;font-size:12px!important;line-height:18px}.debug-bar-rewrites-urls .filterui .mono:focus{outline:0}.debug-bar-rewrites-urls .filterui .mono::-webkit-input-placeholder{font-family:courier!important;font-size:12px!important;line-height:18px}.debug-bar-rewrites-urls .filterui .mono::-moz-placeholder{font-family:courier!important;font-size:12px!important;line-height:18px}.debug-bar-rewrites-urls .filterui .url{width:75%;font-size:0;letter-spacing:0;line-height:0;border:1px solid #dfdfdf;border-radius:3px;display:flex;background-color:#fff}.debug-bar-rewrites-urls .filterui .url.active{border-color:#999}.debug-bar-rewrites-urls .filterui .url .mono{display:table-cell}.debug-bar-rewrites-urls .filterui .url .mono,.debug-bar-rewrites-urls .filterui .url .mono:focus{border:0!important}.debug-bar-rewrites-urls .filterui .url .search{border-top-left-radius:0!important;border-bottom-left-radius:0!important;border-left-width:0;margin-left:0!important;padding-left:0!important;text-align:left;background:#fff!important;color:#32373c;flex-grow:1;min-width:25%}.debug-bar-rewrites-urls .filterui .url .domain{border-top-right-radius:0!important;border-bottom-right-radius:0!important;border-right-width:0;margin-right:2px!important;padding-right:0!important;text-align:right;background:#fff!important;color:#999;order:-1}.debug-bar-rewrites-urls .filterui .url span.domain{display:inline-block}.debug-bar-rewrites-urls .filterui .rule{width:25%;padding-left:12px}.debug-bar-rewrites-urls .filterui .rule input{width:100%;text-align:center;color:#32373c!important;border:1px solid #dfdfdf!important}.debug-bar-rewrites-urls .filterui .rule input:focus{border-color:#999!important}.debug-bar-rewrites-urls .dbrr{margin:0 -20px}.wrap.debug-bar-rewrites-urls .dbrr{margin:0}.debug-bar-rewrites-urls .dbrr table{width:100%;min-width:860px;background-color:#f9f9f9;border-width:1px}.wrap.debug-bar-rewrites-urls .dbrr table{border:1px solid #dfdfdf}.debug-bar-rewrites-urls .dbrr table tfoot tr th,.debug-bar-rewrites-urls .dbrr table thead tr th{border-width:1px 0;border-style:solid;overflow:hidden;border-top-color:#dfdfdf;border-bottom-color:#dfdfdf;background:#f1f1f1;background-image:linear-gradient(to top,#ececec,#f9f9f9);font-family:georgia,times,serif;font-size:15px!important;font-weight:400!important;padding:7px 0;text-align:left;line-height:1.3em;color:#333}.debug-bar-rewrites-urls .dbrr table tfoot tr th:first-of-type,.debug-bar-rewrites-urls .dbrr table thead tr th:first-of-type,.debug-bar-rewrites-urls .dbrr.rules table tbody tr td:first-of-type{padding-left:20px}.debug-bar-rewrites-urls .dbrr table tbody tr.alt td{background-color:#fff!important}.debug-bar-rewrites-urls .dbrr table tbody tr.hidden{display:none}.debug-bar-rewrites-urls .dbrr table tbody tr td{padding:4px 7px;vertical-align:top}.debug-bar-rewrites-urls .dbrr table tbody tr td span{background:rgba(237,224,0,.5);padding:2px;margin:-2px;display:inline-block;border-radius:3px}.debug-bar-rewrites-urls .dbrr table tbody tr td:last-of-type{padding-right:20px}.debug-bar-rewrites-urls .dbrr.filters table tr.deactivated td{background-color:#eff0f1;color:#999;text-align:center}.debug-bar-rewrites-urls .dbrr.filters table tr.deactivated td.filter-hook{text-align:left}.debug-bar-rewrites-urls .dbrr.filters table tr:nth-child(odd){background-color:#f9f9f9}.debug-bar-rewrites-urls .dbrr.filters table tr:nth-child(even){background-color:#fff}.debug-bar-rewrites-urls .dbrr.filters table tr td{padding:4px 7px;font-size:12px;line-height:16px;border-top:1px solid #fcfcfc;border-bottom:1px solid #dfdfdf}.debug-bar-rewrites-urls .dbrr.filters table tr td.filter-hook{padding-left:20px}
  • debug-bar-rewrite-rules/trunk/assets/debug-bar-rewrite-rules.js

    r2179097 r2180916  
    1 /* Debug Rewrite Rules Panel / WordPress Admin Page functionality. */
    2 var DebugBarRewriteRules_App = (function($) {
    3     $(function() {
    4 
    5         /**
    6          * Debug Bar Rewrite Urls namespace.
    7          */
    8         var $this = {
    9 
    10             /**
    11              * Search for matches in rewrites
    12              *
    13              * This function do  check for a input into "Filter Rewrite Rules
    14              * List" field, and if any it filter table to only then rouns that
    15              * actually fits to our search pattern, and hilight that pattern.
    16              */
    17             search: function() {
    18 
    19                 $('.mono.matches')
    20                     .bind('focus', function() {
    21                         $('div.filterui .url.active').removeClass('active');
    22                         $('.dbrr.rules table tr .col-match').remove();
    23                         $('.dbrr.rules table thead tr th.col-data').css({
    24                             width: '50%'
    25                         });
    26                     })
    27                     .bind('keyup', $this._search_for_match);
    28 
    29             },
    30 
    31 
    32             /**
    33              * Search for match.
    34              *
    35              * Searching for a pattern ( a value from .mono.matches input )
    36              * in table of rewrite rules, and shows only found rows with
    37              * heighligted value.
    38              */
    39             _search_for_match: function(e) {
    40 
    41                 // Getting Pattern
    42                 $this.pattern = $.trim($(this).val());
    43 
    44                 if (!$this._active(e)) {
    45                     return;
    46                 }
    47 
    48                 // table reset
    49                 $this._table_reset($('.dbrr.rules table'));
    50 
    51                 // reset if field empty.
    52                 if ('' == $this.pattern) {
    53                     return;
    54                 }
    55 
    56                 $('.dbrr.rules table tbody tr').each(function() {
    57 
    58                     if ($(this).text().indexOf($this.pattern) == -1) {
    59                         $(this).addClass('hidden');
    60                     } else {
    61                         // actual replace.
    62                         $('td', $(this)).each(function() {
    63                             var value = $(this).text()
    64                                 .replace($this.pattern, '<span>' + $this.pattern + '</span>');
    65 
    66                             $(this).html(value);
    67                         });
    68                     }
    69                 });
    70 
    71                 $this._table_zebra($('.dbrr.rules table'));
    72 
    73             },
    74 
    75 
    76             /**
    77              * Check whatever we need to care about this keyup event or not.
    78              *
    79              * return true if we need to care, and false otherwise.
    80              *
    81              * @param  event e  KeyUp event.
    82              * @return bool
    83              */
    84             _active: function(e) {
    85                 // get keycode of current keypress event
    86                 var code = (e.keyCode || e.which);
    87 
    88                 // do nothing if it's an arrow key
    89                 // Ignoting all arrow keys.
    90                 if ([32, 37, 38, 39, 40, 91, 17].indexOf(code) > -1) {
    91                     return false;
    92                 }
    93 
    94                 if (13 == code) {
    95                     e.preventDefault();
    96                 }
    97 
    98                 return true;
    99             },
    100 
    101 
    102             /**
    103              *  Search for url match in patterns.
    104              *
    105              * Test Url we type in url box against our rewrite rules.
    106              * use internaly _filter_match  and _filter_searched
    107              */
    108             test: function() {
    109 
    110                 // Clickcing wp url and making webpath active.
    111                 $('.mono.domain')
    112                     .bind('click', function() {
    113                         $('.mono.search').focus();
    114                     }).trigger('click');
    115 
    116                 // Click to mono.search input will activate search UI.
    117                 $('.mono.search')
    118                     .bind('focus', function() {
    119 
    120                         $(this).parent().addClass('active');
    121 
    122                         if (!$('.dbrr.rules table thead tr th.col-match').length) {
    123 
    124                             $('<th/>')
    125                                 .addClass('col-match')
    126                                 .css('width', '30%')
    127                                 .text($this.settings.matches)
    128                                 .appendTo($('.dbrr.rules table thead tr'))
    129                                 .parent()
    130                                 .find('th.col-data')
    131                                 .css('width', '35%');
    132 
    133                             $('<td/>')
    134                                 .addClass('col-match')
    135                                 .html(' ')
    136                                 .appendTo($('.dbrr.rules table tbody tr'));
    137                         }
    138                     })
    139                     .bind('blur', function() {
    140 
    141                         if ($.trim($(this).val()) == '' && $('.col-match').length > 0) {
    142                             $(this).parent().removeClass('active');
    143                             $('.col-match').remove();
    144                         }
    145 
    146                     })
    147                     .bind('keyup', _.debounce($this._filter_match, 300))
    148                     .bind('keyup', _.debounce($this._filter_sarched, 300))
    149                     .bind('focus', _.debounce($this._filter_match, 300))
    150                     .bind('focus', _.debounce($this._filter_sarched, 300));
    151             },
    152 
    153 
    154             /**
    155              * Filter actual input and repalce it by one that actually
    156              * doesn't contain site domain and path.
    157              *
    158              * @param  event  e KeyUp Event
    159              */
    160             _filter_match: function(e) {
    161 
    162                 if (!$this._active(e)) {
    163                     return;
    164                 }
    165 
    166                 $el = $(this);
    167 
    168                 if (typeof $this.base == 'undefined') {
    169                     $this.base = $this.parse_url($this.settings.home);
    170                 }
    171 
    172                 var current = $this.parse_url($(this).val());
    173 
    174                 jQuery.each(['scheme', '://', 'host', 'port', 'path'], function(index, value) {
    175 
    176                     val = o = $el.val().split('?')[0].split('#')[0];
    177 
    178                     if (typeof current[value] == 'string' &&
    179                         current[value] === $this.base[value] &&
    180                         val.indexOf(current[value]) != -1) {
    181 
    182                         val = val.substring(
    183                             val.indexOf(current[value]) + current[value].length
    184                         );
    185 
    186                     } else if (value == '://' && val.indexOf(value) != -1) {
    187 
    188                         val = val.substring(
    189                             val.indexOf(value) + value.length
    190                         );
    191 
    192                     } else if (value == 'path' && val.indexOf($this.base[value]) == 0) {
    193                         val = val.substring(
    194                             val.indexOf($this.base[value]) + $this.base[value].length
    195                         );
    196                     }
    197 
    198                     // Additional Starting Trail
    199                     if (value == 'path' && val.substring(0, 1) == '/') {
    200                         val = val.substring(1, val.length);
    201                     }
    202 
    203                     $el.val(o != jQuery.trim(val) ? jQuery.trim(val) : o);
    204                 });
    205 
    206             },
    207 
    208 
    209             /**
    210              * Filtering table by urls that match to our pattern.
    211              *
    212              * @param  {[type]} e [description]
    213              * @return {[type]}   [description]
    214              */
    215             _filter_sarched: function(e) {
    216 
    217                 if (!$this._active(e)) {
    218                     return;
    219                 }
    220 
    221                 // Current Element (input)
    222                 $el = $(this);
    223                 $this._table_reset($('.dbrr.rules table'));
    224 
    225                 // Reset table - removing `span` and cleaning matches table.
    226                 $('.dbrr.rules table tbody tr').each(function() {
    227                     $('td:eq(0), td:eq(1)', $(this)).each(function() {
    228                         $(this).html($(this).text());
    229                     });
    230                     $('td:eq(2)', $(this)).html('');
    231                 });
    232 
    233                 if ($.trim($el.val()) === "") {
    234                     return;
    235                 }
    236 
    237                 // Creating Rules.
    238                 // @todo -> provide extra source of rewrite rules later.
    239                 if (typeof $this.rules == 'undefined') {
    240                     $this.rules = {};
    241                     $('.dbrr.rules table tbody tr').each(function() {
    242                         $this.rules[$(this).attr('id')] = {
    243                             rule: $('td:eq(0)', $(this)).text(),
    244                             match: $('td:eq(1)', $(this)).text()
    245                         };
    246                     });
    247                 }
    248 
    249                 // Checking do we really have matched rules?
    250                 // and checking it with server side support.
    251                 //
    252                 jQuery.ajax({
    253                     url: $this.settings.validator,
    254                     crossDomain: true,
    255                     dataType: 'json',
    256                     type: 'POST',
    257                     data: {
    258                         rules: $this.rules,
    259                         search: $el.val()
    260                     }
    261                 }).done(function(data) {
    262 
    263                     $this._table_reset($('.dbrr.rules table'));
    264 
    265                     // Special Case if TWO interfaces open.
    266                     //  Check this JUMP css rendering if nothing changed.
    267                     //  @todo - fix "repeated parsers."
    268 
    269                     $('.dbrr.rules').each(function() {
    270                         $('table tbody tr', this).each(function(i) {
    271                             if (data.rules[(i + 1)].result == false) {
    272                                 $(this).addClass('hidden');
    273                             } else {
    274                                 $this.currentRow = this;
    275                                 if (typeof data.rules[(i + 1)].vars != "undefined") {
    276                                     $.each(data.rules[(i + 1)].vars, function(index, value) {
    277                                         $('td:eq(2)', $this.currentRow)
    278                                             .append('<div><strong>' + index + '</strong> : ' + value + '</div>');
    279                                     });
    280                                 }
    281                             }
    282                         });
    283                     });
    284 
    285                     $this._table_zebra($('.dbrr.rules table'));
    286                 });
    287 
    288             },
    289 
    290 
    291             /**
    292              * Helper Function that reset table structure and view.
    293              *
    294              * Removes .hidden from table ,  colorize it as zebra and
    295              * removed html grom cells.
    296              *
    297              * @param  jQuery   jQueryTableElement Table jQuery element.
    298              */
    299             _table_reset: function(jQueryTableElement) {
    300 
    301                 $('tbody tr', jQueryTableElement)
    302                     .removeClass('alt hidden')
    303                     .each(function() {
    304                         $('td', $(this))
    305                             .each(function() {
    306                                 $(this).html($(this).text());
    307                             });
    308                     });
    309 
    310                 $this._table_zebra(jQueryTableElement);
    311             },
    312 
    313 
    314             /**
    315              * Zebra Stripes colors for tables.
    316              *
    317              * @param  jQuery   jQueryTableElement Table jQuery element.
    318              */
    319             _table_zebra: function(jQueryTableElement) {
    320 
    321                 $('tbody tr', jQueryTableElement)
    322                     .filter(':visible')
    323                     .each(
    324                         function(i) {
    325                             $(this).addClass(((i + 2) % 2 == 0) ? 'alt' : '_');
    326                         }
    327                     );
    328 
    329                 return $this;
    330             },
    331 
    332 
    333             /**
    334              * parse_url php function clone.
    335              *
    336              * @param  string url [description]
    337              * @return {[type]}     [description]
    338              */
    339             parse_url: function(url) {
    340 
    341                 /*  Dom parsing of A    */
    342                 var parser = document.createElement('a');
    343 
    344                 if (url.substring(0, 1) != '/' && url.substring(0, 4) != 'http') {
    345                     url = '/' + url;
    346                 }
    347 
    348                 parser.href = url;
    349 
    350                 /*  Exception for user:password */
    351                 var re = /(\/\/)(.+?)((:(.+?))?)@/i;
    352                 if (re.exec(url)) {
    353                     var result = re.exec(url)
    354                     if (typeof result[2] == 'string' && result[2].length > 0) {
    355                         parser.user = result[2];
    356                     }
    357 
    358                     if (typeof result[5] == 'string' && result[5].length > 0) {
    359                         parser.pass = result[5];
    360                     }
    361                 }
    362 
    363                 var urls = new Object();
    364                 var urls_php = [
    365                     'scheme', 'host', 'port', 'user', 'pass', 'path', 'query', 'fragment'
    366                 ];
    367                 var urls_js = [
    368                     'protocol', 'hostname', 'port', 'user', 'pass', 'pathname', 'search', 'hash'
    369                 ];
    370 
    371                 urls_js.forEach(function(value, index) {
    372                     if (typeof parser[value] == "string" && parser[value].length > 0) {
    373                         switch (value) {
    374                             case "protocol":
    375                                 urls[urls_php[index]] = parser[value].replace(":", "");
    376                                 break;
    377                             case "hash":
    378                                 urls[urls_php[index]] = parser[value].replace("#", "");
    379                                 break;
    380                             case "pathname":
    381                                 if (parser[value] != "/")
    382                                     urls[urls_php[index]] = parser[value];
    383                                 break;
    384                             default:
    385                                 urls[urls_php[index]] = parser[value];
    386                                 break;
    387                         }
    388                     }
    389                 });
    390                 return urls;
    391             },
    392 
    393 
    394             /**
    395              *  Reset Rewrite Rules within DebugBar.
    396              */
    397             reset_rewrite_rules: function() {
    398 
    399                 $('.debug-bar-rewrites-urls a._tracking')
    400                     .bind('click', function(e) {
    401 
    402                         e.preventDefault();
    403 
    404                         $(this).find('.spinner').css({
    405                             visibility: 'visible'
    406                         });
    407 
    408                         var $_el = this;
    409 
    410                         $.post($this.settings.ajaxurl, {
    411                             action: 'debug_bar_rewrite_rules',
    412                             nonce: $this.settings.nonce
    413                         }, function(data) {
    414 
    415                             $($_el).find('.spinner').css({
    416                                 visibility: 'hidden'
    417                             });
    418 
    419                             // Deleting
    420                             delete $this.rules;
    421 
    422                             // Replacing Tables
    423                             $.each(['rules', 'filters'], function(index, value) {
    424                                 if (typeof data[value] != "underfined" &&
    425                                     $('.dbrr.' + value).length > 0) {
    426 
    427                                     $('.dbrr.' + value).html(
    428                                         $('table',
    429                                             $(data[value])
    430                                         ).parent().html()
    431                                     );
    432                                 }
    433                             });
    434 
    435                             // Replacing Counts.
    436                             $.each(['rules', 'filters_hooked', 'filters'], function(index, value) {
    437                                 if (typeof data['count_' + value] != "underfined" && $('h2.dbrr_count_' + value + ' i').length > 0) {
    438                                     $('h2.dbrr_count_' + value + ' i').text(data['count_' + value]);
    439                                 }
    440                             });
    441 
    442                         }, 'json');
    443                     });
    444             },
    445             /**
    446              * Setup Settings.
    447              */
    448             setup: function(settings) {
    449                 $this.settings = $.extend($this.settings, settings);
    450             },
    451 
    452 
    453             /**
    454              * Initialzier.
    455              * @param  object settings object of array
    456              */
    457             intialize: function(settings) {
    458 
    459                 return $this.setup(settings),
    460                     $this.search(),
    461                     $this.test(),
    462                     $this.reset_rewrite_rules();
    463             }
    464 
    465         };
    466 
    467         return $this.intialize(debugBarRewriteRules);
    468     });
    469 })(jQuery);
     1var DebugBarRewriteRules_App=function(s){s(function(){var a={search:function(){s(".mono.matches").bind("focus",function(){s("div.filterui .url.active").removeClass("active"),s(".dbrr.rules table tr .col-match").remove(),s(".dbrr.rules table thead tr th.col-data").css({width:"50%"})}).bind("keyup",a._search_for_match)},_search_for_match:function(t){a.pattern=s.trim(s(this).val()),a._active(t)&&(a._table_reset(s(".dbrr.rules table")),""!=a.pattern&&(s(".dbrr.rules table tbody tr").each(function(){-1==s(this).text().indexOf(a.pattern)?s(this).addClass("hidden"):s("td",s(this)).each(function(){var t=s(this).text().replace(a.pattern,"<span>"+a.pattern+"</span>");s(this).html(t)})}),a._table_zebra(s(".dbrr.rules table"))))},_active:function(t){var e=t.keyCode||t.which;return!(-1<[32,37,38,39,40,91,17].indexOf(e))&&(13==e&&t.preventDefault(),!0)},test:function(){s(".mono.domain").bind("click",function(){s(".mono.search").focus()}).trigger("click"),s(".mono.search").bind("focus",function(){s(this).parent().addClass("active"),s(".dbrr.rules table thead tr th.col-match").length||(s("<th/>").addClass("col-match").css("width","30%").text(a.settings.matches).appendTo(s(".dbrr.rules table thead tr")).parent().find("th.col-data").css("width","35%"),s("<td/>").addClass("col-match").html(" ").appendTo(s(".dbrr.rules table tbody tr")))}).bind("blur",function(){""==s.trim(s(this).val())&&0<s(".col-match").length&&(s(this).parent().removeClass("active"),s(".col-match").remove())}).bind("keyup",_.debounce(a._filter_match,300)).bind("keyup",_.debounce(a._filter_sarched,300)).bind("focus",_.debounce(a._filter_match,300)).bind("focus",_.debounce(a._filter_sarched,300))},_filter_match:function(t){if(a._active(t)){$el=s(this),void 0===a.base&&(a.base=a.parse_url(a.settings.home));var r=a.parse_url(s(this).val());jQuery.each(["scheme","://","host","port","path"],function(t,e){val=o=$el.val().split("?")[0].split("#")[0],"string"==typeof r[e]&&r[e]===a.base[e]&&-1!=val.indexOf(r[e])?val=val.substring(val.indexOf(r[e])+r[e].length):"://"==e&&-1!=val.indexOf(e)?val=val.substring(val.indexOf(e)+e.length):"path"==e&&0==val.indexOf(a.base[e])&&(val=val.substring(val.indexOf(a.base[e])+a.base[e].length)),"path"==e&&"/"==val.substring(0,1)&&(val=val.substring(1,val.length)),$el.val(o!=jQuery.trim(val)?jQuery.trim(val):o)})}},_filter_sarched:function(t){a._active(t)&&($el=s(this),a._table_reset(s(".dbrr.rules table")),s(".dbrr.rules table tbody tr").each(function(){s("td:eq(0), td:eq(1)",s(this)).each(function(){s(this).html(s(this).text())}),s("td:eq(2)",s(this)).html("")}),""!==s.trim($el.val())&&(void 0===a.rules&&(a.rules={},s(".dbrr.rules table tbody tr").each(function(){a.rules[s(this).attr("id")]={rule:s("td:eq(0)",s(this)).text(),match:s("td:eq(1)",s(this)).text()}})),jQuery.ajax({url:a.settings.validator,crossDomain:!0,dataType:"json",type:"POST",data:{rules:a.rules,search:$el.val()}}).done(function(e){a._table_reset(s(".dbrr.rules table")),s(".dbrr.rules").each(function(){s("table tbody tr",this).each(function(t){0==e.rules[t+1].result?s(this).addClass("hidden"):(a.currentRow=this,void 0!==e.rules[t+1].vars&&s.each(e.rules[t+1].vars,function(t,e){s("td:eq(2)",a.currentRow).append("<div><strong>"+t+"</strong> : "+e+"</div>")}))})}),a._table_zebra(s(".dbrr.rules table"))})))},_table_reset:function(t){s("tbody tr",t).removeClass("alt hidden").each(function(){s("td",s(this)).each(function(){s(this).html(s(this).text())})}),a._table_zebra(t)},_table_zebra:function(t){return s("tbody tr",t).filter(":visible").each(function(t){s(this).addClass((t+2)%2==0?"alt":"_")}),a},parse_url:function(t){var r=document.createElement("a");"/"!=t.substring(0,1)&&"http"!=t.substring(0,4)&&(t="/"+t),r.href=t;var e=/(\/\/)(.+?)((:(.+?))?)@/i;if(e.exec(t)){var a=e.exec(t);"string"==typeof a[2]&&0<a[2].length&&(r.user=a[2]),"string"==typeof a[5]&&0<a[5].length&&(r.pass=a[5])}var s=new Object,n=["scheme","host","port","user","pass","path","query","fragment"];return["protocol","hostname","port","user","pass","pathname","search","hash"].forEach(function(t,e){if("string"==typeof r[t]&&0<r[t].length)switch(t){case"protocol":s[n[e]]=r[t].replace(":","");break;case"hash":s[n[e]]=r[t].replace("#","");break;case"pathname":"/"!=r[t]&&(s[n[e]]=r[t]);break;default:s[n[e]]=r[t]}}),s},reset_rewrite_rules:function(){s(".debug-bar-rewrites-urls a._tracking").bind("click",function(t){t.preventDefault(),s(this).find(".spinner").css({visibility:"visible"});var e=this;s.post(a.settings.ajaxurl,{action:"debug_bar_rewrite_rules",nonce:a.settings.nonce},function(r){s(e).find(".spinner").css({visibility:"hidden"}),delete a.rules,s.each(["rules","filters"],function(t,e){"underfined"!=typeof r[e]&&0<s(".dbrr."+e).length&&s(".dbrr."+e).html(s("table",s(r[e])).parent().html())}),s.each(["rules","filters_hooked","filters"],function(t,e){"underfined"!=typeof r["count_"+e]&&0<s("h2.dbrr_count_"+e+" i").length&&s("h2.dbrr_count_"+e+" i").text(r["count_"+e])})},"json")})},setup:function(t){a.settings=s.extend(a.settings,t)},intialize:function(t){return a.setup(t),a.search(),a.test(),a.reset_rewrite_rules()}};return a.intialize(debugBarRewriteRules)})}(jQuery);
  • debug-bar-rewrite-rules/trunk/debug-bar.php

    r2179097 r2180916  
    66 * @author      Oleg Butuzov
    77 * @link        https://github.com/butuzov/Debug-Bar-Rewrite-Rules
    8  * @version     0.6.2
     8 * @version     0.6.3
    99 * @license     http://creativecommons.org/licenses/GPL/2.0/ GNU General Public License, version 2 or higher
    1010 */
  • debug-bar-rewrite-rules/trunk/readme.txt

    r2179091 r2180916  
    11=== Debug Bar Rewrite Rules ===
    22
    3 
     3[[[[
    44* Contributors: butuzov
    55* Donate Link: http://wordpress.org
     
    77* Requires at least: 3.4
    88* Tested up to: 5.2.4
    9 * Stable tag: 0.6.2
     9* Stable tag: 0.6.3
    1010* License: GPLv2 or later
    1111* License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3636
    3737= 0.6 =
     38* [general] - way assets appear on a page changed.
     39* [bug] - Fixed: warning on private static var
    3840* [bug] - Fixed: admin page    https://github.com/butuzov/Debug-Bar-Rewrite-Rules/issues/2
    3941* [bug] - Fixed: domain field  https://github.com/butuzov/Debug-Bar-Rewrite-Rules/issues/3
  • debug-bar-rewrite-rules/trunk/rewrite-rules.php

    r2179097 r2180916  
    66 * @author      Oleg Butuzov
    77 * @link        https://github.com/butuzov/Debug-Bar-Rewrite-Rules
    8  * @version     0.6.2
     8 * @version     0.6.3
    99 * @license     http://creativecommons.org/licenses/GPL/2.0/ GNU General Public License, version 2 or higher
    1010 *
     
    1313 * Plugin URI:  https://github.com/butuzov/Debug-Bar-Rewrite-Rules
    1414 * Description: Debug Bar Rewrite Rules helps to debug WP Rewrite Rules with and without of the help of the Debug Bar.
    15  * Version:     0.6.2
     15 * Version:     0.6.3
    1616 * Author:      Oleg Butuzov
    1717 * Author URI:  https://github.com/butuzov
     
    8989     * @var $instance Class Instance.
    9090     */
    91     private static $version = '0.6.2';
     91    public $version = '0.6.3';
    9292
    9393    /**
     
    306306        }
    307307
    308         $suffix = ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min' );
     308        $suffix = ( ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.dev' : '' );
    309309
    310310        // Style Enqueue.
  • debug-bar-rewrite-rules/trunk/templates/info-filters.php

    r2179097 r2180916  
    66 * @author      Oleg Butuzov
    77 * @link        https://github.com/butuzov/wp-debug-bar-rewrite-rules
    8  * @version     0.6.2
     8 * @version     0.6.3
    99 * @license     http://creativecommons.org/licenses/GPL/2.0/ GNU General Public License, version 2 or higher
    1010 *
  • debug-bar-rewrite-rules/trunk/templates/info-rules.php

    r2179097 r2180916  
    66 * @author      Oleg Butuzov
    77 * @link        https://github.com/butuzov/wp-debug-bar-rewrite-rules
    8  * @version     0.6.2
     8 * @version     0.6.3
    99 * @license     http://creativecommons.org/licenses/GPL/2.0/ GNU General Public License, version 2 or higher
    1010 *
  • debug-bar-rewrite-rules/trunk/templates/info-stats.php

    r2179097 r2180916  
    66 * @author      Oleg Butuzov
    77 * @link        https://github.com/butuzov/wp-debug-bar-rewrite-rules
    8  * @version     0.6.2
     8 * @version     0.6.3
    99 * @license     http://creativecommons.org/licenses/GPL/2.0/ GNU General Public License, version 2 or higher
    1010 *
  • debug-bar-rewrite-rules/trunk/validator.php

    r2179097 r2180916  
    66 * @author      Oleg Butuzov
    77 * @link        https://github.com/butuzov/Debug-Bar-Rewrite-Rules
    8  * @version     0.6.2
     8 * @version     0.6.3
    99 * @license     http://creativecommons.org/licenses/GPL/2.0/ GNU General Public License, version 2 or higher
    1010 *
Note: See TracChangeset for help on using the changeset viewer.