if (typeof(PhpDebugBar) == 'undefined') { // namespace var PhpDebugBar = {}; PhpDebugBar.$ = jQuery; } (function($) { var csscls = function(cls) { return PhpDebugBar.utils.csscls(cls, 'phpdebugbar-openhandler-'); }; PhpDebugBar.OpenHandler = PhpDebugBar.Widget.extend({ className: 'phpdebugbar-openhandler', defaults: { items_per_page: 20 }, render: function() { var self = this; this.$el.appendTo('body').hide(); this.$closebtn = $(''); this.$table = $(''); $('
PHP DebugBar | Open
').addClass(csscls('header')).append(this.$closebtn).appendTo(this.$el); $('
DateMethodURLIPFilter data
').append(this.$table).appendTo(this.$el); this.$actions = $('
').addClass(csscls('actions')).appendTo(this.$el); this.$closebtn.on('click', function() { self.hide(); }); this.$loadmorebtn = $('Load more') .appendTo(this.$actions) .on('click', function() { self.find(self.last_find_request, self.last_find_request.offset + self.get('items_per_page'), self.handleFind.bind(self)); }); this.$showonlycurrentbtn = $('Show only current URL') .appendTo(this.$actions) .on('click', function() { self.$table.empty(); self.find({uri: window.location.pathname}, 0, self.handleFind.bind(self)); }); this.$showallbtn = $('Show all') .appendTo(this.$actions) .on('click', function() { self.refresh(); }); this.$clearbtn = $('Delete all') .appendTo(this.$actions) .on('click', function() { self.clear(function() { self.hide(); }); }); this.addSearch(); this.$overlay = $('
').addClass(csscls('overlay')).hide().appendTo('body'); this.$overlay.on('click', function() { self.hide(); }); }, refresh: function() { this.$table.empty(); this.$loadmorebtn.show(); this.find({}, 0, this.handleFind.bind(this)); }, addSearch: function(){ var self = this; var searchBtn = $('