mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-10-03 17:49:19 +02:00
simplify cache breaker extraction
This commit is contained in:
parent
0befe7e3cc
commit
f03f2bf28d
2 changed files with 4 additions and 12 deletions
|
@ -930,16 +930,8 @@ jQuery.PrivateBin = (function($) {
|
|||
}
|
||||
|
||||
// load strings from JSON
|
||||
let main_script = document.querySelector('script[src^="js/privatebin.js"]');
|
||||
let privatebin_version;
|
||||
|
||||
if (main_script) {
|
||||
privatebin_version = main_script.getAttribute("src").split("?")[1] || null;
|
||||
} else {
|
||||
privatebin_version = Math.floor(Date.now() / 60000);
|
||||
}
|
||||
|
||||
$.getJSON('i18n/' + newLanguage + '.json?v=' + privatebin_version, function(data) {
|
||||
const cacheBreaker = document.querySelector('script[src^="js/privatebin.js"]').getAttribute("src").split(".js")[1] || "";
|
||||
$.getJSON('i18n/' + newLanguage + '.json' + cacheBreaker, function(data) {
|
||||
language = newLanguage;
|
||||
translations = data;
|
||||
$(document).triggerHandler(languageLoadedEvent);
|
||||
|
@ -2141,7 +2133,7 @@ jQuery.PrivateBin = (function($) {
|
|||
// if so, we send the link to the shortener
|
||||
// we do not remove the button, in case shortener fails
|
||||
sendToShortener();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue