Hi, im the author of the mentioned Enlighter plugin.
im currently debugging the issue and it is related to MooTools or other Frameworks/Plugins which **extends the Native Types**.
@natewr
i like your plugin! therefore i’ve fixed the following issues. finally your plugin works together with MooTools / Enlighter ??
**First Issue**
TypeError: asset.src is undefined
Source: https://wordpress.localnet/wp-content/plugins/asset-queue-manager/assets/js/aqm.js?ver=4.4.2
Line: 185
it seems that the javascript function getAssetURL
does not check if asset/asset.src is defined. therefore asset.src.toString();
will fail in this case and the error message is not set to invisible.
i’ve created to following fix – generally a toString() on undefined attributes/objects should never called!
getAssetURL : function( asset ) {
if (!asset || !asset.src){return 'false';}
**Second Issue**
In the aqmPanel function, there is a cascade of for .. in
loops to append the assets to the panel, but the check of hasOwnProperty()
is missing, therefore (on extended Types) the loop will fail @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for…in .
I’ve fixed this by using jQuerys build-in function $.each
to avoid this error.
var T = this;
$.each(aqmData.assets, function(loc_key, loc){
// required for array/object type - maybe the aqmData structure should changed or remove the outer loop
if ($.type(loc) != 'array' && $.type(loc) != 'object'){
return;
}
$.each(loc, function(type_key, type){
$.each(type, function(key, asset){
T.appendAsset(asset, loc_key, type_key );
});
});
});
i hope this will help you and continue with your great work.
best regards, Andi