Hi,
while debugging my issue from https://piwigo.org/forum/viewtopic.php?id=30726 I have found the following:
I'm trying to include pannellum.js (https://github.com/mpetroff/pannellum/r … -2.5.6.zip) like this in my picture_content.tpl:
{combine_script id='pannellum' path=$PIWIGOPANORAMA_PATH|cat:'template/lib/pannellum/pannellum.js' load='async'}
In the js that is sent to the browser I can find the corresponding entry (e.g. in http://www.feuster.com/piwigo/_data/combined/semmbs.js) for
/*BEGIN ./plugins/piwigo-panorama/template/lib/pannellum/pannellum.js */...
BUT that can't be loaded since its not valid js!.
If I paste the js code into a developer console I get an error message "Uncaught SyntaxError: unmatched ) in regular expression" around
function qa(a){return/^(?:[a-z]+:)?\/\U,!1)
If I paste the original pannellum.js (which looks different around that function) in the console I don't get any error message and my image is shown as a 360° panorama.
Questions:
* Is there any way I can influence the behavior of combine_script to simply include the minified js without further changes?
* Is that a known behavior / feature of combine_script?
I could provide the js code in question, but its to long to be simply added here...
Piwigo URL: http://bilder.feuster.com
Piwigo 2.10.2 Check for upgrade
Operating system: Linux
PHP: 7.3.24 (Show info) [2020-11-08 21:17:40]
MySQL: 5.5.60-0+deb7u1-log [2020-11-08 21:17:40]
Graphics Library: External ImageMagick 6.9.10-23
Offline
Hi :-)
have you assign "PIWIGOPANORAMA_PATH" for template ?
Offline
Yes, I have. As I said above, you can see the included js e.g. in http://www.feuster.com/piwigo/_data/combined/semmbs.js. Thats also where I extracted the code to paste in the webdeveloper console to find the error...
Offline
Next step: I have manually upgraded to JShrink v1.3.3 but the issue still remains.
If I compare the included js with the original one I can see the following:
Original js:
function qa(a){return/^(?:[a-z]+:)?\/\//i.test(a)||"/"==a[0]||"blob:"==a.slice(0,5)}function pa()...
until an end of line.
js after JShrink:
function qa(a){return/^(?:[a-z]+:)?\/\U,!1),J.addEventListener(...
Where everything after \/\ til the end of the line is omitted and U,!1) is the first stuff on the new line. So it seems that JShrink can't handle the combination "\/\//" properly!
I will ask JShrink for this. But in the meantime: is there any option to switch of minifying of js with some parameter?
Offline
Found a workaround :-)
Rename pannellum.js to pannellum.min.js
Offline