Skip to content

Commit

Permalink
Compatibility 2.4.4, Closes #60, closes #62
Browse files Browse the repository at this point in the history
  • Loading branch information
vpietri committed Aug 30, 2022
1 parent e4ce9c0 commit ed9afa9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 40 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"AFL-3.0"
],
"require": {
"php": "~5.5|~5.6|~7.0",
"magento/magento-composer-installer": "*"
},
"authors": [
Expand Down
12 changes: 6 additions & 6 deletions view/base/requirejs-config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
var config = {
paths: {
quickDevBar: "ADM_QuickDevBar/js/quickdevbar",
filtertable: "ADM_QuickDevBar/js/sunnywalker/jquery.filtertable.min",
metadata: "ADM_QuickDevBar/js/tablesorter/jquery.metadata",
tablesorter: "ADM_QuickDevBar/js/tablesorter/jquery.tablesorter.min",
jqueryTabs: ["jquery-ui-modules/tabs", "jquery/jquery-ui"]
quickDevBar: 'ADM_QuickDevBar/js/quickdevbar',
filtertable: 'ADM_QuickDevBar/js/sunnywalker/jquery.filtertable.min',
metadata: 'ADM_QuickDevBar/js/tablesorter/jquery.metadata',
tablesorter: 'ADM_QuickDevBar/js/tablesorter/jquery.tablesorter.min',
jqueryTabs: ['jquery-ui-modules/tabs', 'jquery/jquery-ui']
},
shim: {
'quickDevBar': {
Expand All @@ -20,4 +20,4 @@ var config = {
deps: ['jquery']
}
}
};
};
66 changes: 33 additions & 33 deletions view/base/web/js/quickdevbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ define(["jquery",
"tablesorter",
'mage/cookies'
], function($){

/**
*
*
* Events attached
*
*
* All tabs
* - quickdevbartabscreate
* - quickdevbartabsbeforeactivate
* - quickdevbartabsactivate
*
*
* Ajax tabs
* - quickdevbartabsbeforeload
* - quickdevbartabsload
*
*
*/

$.widget('mage.quickDevBarTabs', $.ui.tabs, {
_create: function() {
var qdbOption = this.element.attr('data-qdbtabs-option');
Expand All @@ -31,7 +31,7 @@ define(["jquery",
}
this._super();
},

load: function( index, event ) {
index = this._getIndex( index );
var that = this,
Expand All @@ -42,15 +42,15 @@ define(["jquery",
tab: tab,
panel: panel
};

var anchorUrl = $( anchor ).attr( "data-ajax" );
var rhash = /#.*$/;

// not remote
if ( typeof anchorUrl =='undefined' || anchorUrl.length < 1 || anchorUrl.replace( rhash, "" ).length<1) {
return;
}

this.xhr = $.ajax( this._ajaxSettings( anchorUrl, event, eventData ) );

// support: jQuery <1.8
Expand All @@ -61,18 +61,18 @@ define(["jquery",
panel.attr( "aria-busy", "true" );

this.xhr
.success(function( response ) {
.done(function( response ) {
// support: jQuery <1.8
// http://bugs.jquery.com/ticket/11778
setTimeout(function() {
panel.html( response );
that._trigger( "load", event, eventData );

// Prevent tab to be load several times
$( anchor ).removeAttr( "data-ajax" );
}, 1 );
})
.complete(function( jqXHR, status ) {
.always(function( jqXHR, status ) {
// support: jQuery <1.8
// http://bugs.jquery.com/ticket/11778
setTimeout(function() {
Expand All @@ -90,7 +90,7 @@ define(["jquery",
});
}
},

_ajaxSettings: function( anchorUrl, event, eventData ) {
var that = this;
return {
Expand All @@ -102,7 +102,7 @@ define(["jquery",
};
},
});

$.widget("mage.treeView", {
// default options
options: {
Expand All @@ -116,7 +116,7 @@ define(["jquery",

var self = this;


this.element.find('li').each(function() {
var li = $(this);
li.prepend('<div class="node"></div>');
Expand Down Expand Up @@ -162,8 +162,8 @@ define(["jquery",
},

});


$.widget('mage.quickDevBar', {
options: {
css: false,
Expand All @@ -176,14 +176,14 @@ define(["jquery",
},

_create: function() {

$('<link/>', {
rel: 'stylesheet',
type: 'text/css',
href: this.options.css
}).appendTo('head');
}).appendTo('head');


/* Manage toggling toolbar */
if(this.getVisibility()) {
this.element.toggle(this.options.toggleEffect);
Expand All @@ -195,8 +195,8 @@ define(["jquery",
this.element.toggle(this.options.toggleEffect);

}, this));
/* Apply ui.tabs widget */

/* Apply ui.tabs widget */
$('div.qdb-container').quickDevBarTabs({load:$.proxy(function(event, data){
if($(data.panel)) {
this.applyTabPlugin('#' + $(data.panel).attr( "id" ));
Expand All @@ -205,7 +205,7 @@ define(["jquery",
);

this.applyTabPlugin('div.qdb-container');

/* Manage ajax tabs */
$('div.qdb-container').addClass('qdb-container-collapsed');
},
Expand All @@ -225,28 +225,28 @@ define(["jquery",

return visible;
},

applyTabPlugin: function(selector) {

/* Apply enhancement on table */

/* classToStrip: Set odd even class on tr */
$(selector + ' table.' + this.options.classToStrip + ' tr:even').addClass(this.options.stripedClassname);

/* classToFilter: Set filter input */
$(selector + ' table.' + this.options.classToFilter).filterTable({
label: 'Search filter:',
minRows: 10,
visibleClass: '',
visibleClass: '',
callback: $.proxy(function(term, table) {
table.find('tr').removeClass(this.options.stripedClassname).filter(':visible:even').addClass(this.options.stripedClassname);
}, this)
});

/* classToSort: Set sort on thead */
$(selector + ' table.' + this.options.classToSort).tablesorter();
$(selector + ' table.' + this.options.classToSort).tablesorter();
},

/**
* https://wiki.eclipse.org/Eclipse_Web_Interface
*/
Expand All @@ -266,6 +266,6 @@ define(["jquery",
if( e.name!='NS_ERROR_FAILURE' && e.result!=2147500037)
window.location = url;
}
}
}
});
});

0 comments on commit ed9afa9

Please sign in to comment.