Dear krpano Team,
I tried to include the krpano.js via webpack, but it is throwing an error due to the automatically introduced strict-mode:
"TypeError: Cannot set property length of [object Object] which has only a getter"
Due to the heavy obfuscation of the js I don't wont to spend the time for reverse engeneering, but would love to see this fixed in one of the next versions of the file.
Nowadays it is generally concidered good practise to have your code run in strict mode and it is supposed to also help performance: https://stackoverflow.com/questions/1335…oning-behind-it
It would be also cool (but not nesessary), if the code could be wrapped a bit, so that it can be included using modern commonJs tools like webpack but still would work backwards compatible as standalone browser include:
(function (root, factory) {
// https://github.com/umdjs/umd/blob/master/returnExports.js
if (typeof module === 'object' && module.exports) {
// Node & commonJs
module.exports = factory();
} else if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else {
// Browser globals (root is window) - fallback for direct script includes
root.embedpano = factory();
}
}(this, function() {
// current code
return currentEmbedpanoFunction
}));
Display More
I'm happy to contribute a PR, but I guess you'll not want that ;)
Best wishes
Andreas