Fixed loading additional javascripts

The server side loader does limit to 10 files, but the client side code
happily generates more requests.

Depending on loaded pages, this could lead to some javascript files not
being loaded (eg. if you went to monitor directly from home page).

Fixes #13362

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2017-06-06 14:51:18 +02:00
parent 253c9bed0e
commit 58023e98a8
2 changed files with 13 additions and 3 deletions

View File

@ -8,6 +8,7 @@ phpMyAdmin - ChangeLog
- issue #13323 Fixed wrong encoding of table at triggers
- issue #12976 Fixed natural sorting in several places
- issue #12718 Show warning for users removed from mysql.user table
- issue #13362 Fixed loading additional javascripts
4.7.1 (2017-05-25)
- issue #13132 Always execute tracking queries as controluser

View File

@ -573,13 +573,19 @@ var AJAX = {
needRequest = true;
this.add(script);
request.push("scripts%5B%5D=" + script);
if (request.length >= 10) {
// Download scripts in chunks
this.appendScript(request);
request = [];
needRequest = false;
}
}
}
request.push("call_done=1");
request.push("v=" + encodeURIComponent(PMA_commonParams.get('PMA_VERSION')));
// Download the composite js file, if necessary
if (needRequest) {
this.appendScript("js/get_scripts.js.php?" + request.join("&"));
this.appendScript(request);
} else {
self.done(callback);
}
@ -606,11 +612,14 @@ var AJAX = {
*
* @return void
*/
appendScript: function (url) {
appendScript: function (request) {
var head = document.head || document.getElementsByTagName('head')[0];
var script = document.createElement('script');
request.push("call_done=1");
request.push("v=" + encodeURIComponent(PMA_commonParams.get('PMA_VERSION')));
script.type = 'text/javascript';
script.src = url;
script.src = "js/get_scripts.js.php?" + request.join("&");
script.async = false;
head.appendChild(script);
},