mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-10-03 01:39:15 +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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -121,7 +121,7 @@ class Configuration
|
|||
'js/kjua-0.10.0.js' => 'sha512-BYj4xggowR7QD150VLSTRlzH62YPfhpIM+b/1EUEr7RQpdWAGKulxWnOvjFx1FUlba4m6ihpNYuQab51H6XlYg==',
|
||||
'js/legacy.js' => 'sha512-08+subq1Lo+r+la5ENqeXiMgNJcVaaTtBIFGkrjziSpvtgCId3Jtin4/OkSdHYSoeztwwIab8uvCzPKHta6puQ==',
|
||||
'js/prettify.js' => 'sha512-puO0Ogy++IoA2Pb9IjSxV1n4+kQkKXYAEUtVzfZpQepyDPyXk8hokiYDS7ybMogYlyyEIwMLpZqVhCkARQWLMg==',
|
||||
'js/privatebin.js' => 'sha512-mqzsqmoDJRcSQCjIU3TiE4vNqgpmjrwxhscCATiHwlAaMaat2J1epLUK7995vX7UW6CfkpOWhz2dvwLQO/NQFg==',
|
||||
'js/privatebin.js' => 'sha512-Id47n8ZPz6j93KoR7DkaS48MxtwKftVq3RyZw9WRGpRT+6bYKP/ZkU84RscbcW3icxBTS9fQKQpdnmZ3rr00dQ==',
|
||||
'js/purify-3.2.6.js' => 'sha512-zqwL4OoBLFx89QPewkz4Lz5CSA2ktU+f31fuECkF0iK3Id5qd3Zpq5dMby8KwHjIEpsUgOqwF58cnmcaNem0EA==',
|
||||
'js/showdown-2.1.0.js' => 'sha512-WYXZgkTR0u/Y9SVIA4nTTOih0kXMEd8RRV6MLFdL6YU8ymhR528NLlYQt1nlJQbYz4EW+ZsS0fx1awhiQJme1Q==',
|
||||
'js/zlib-1.3.1-1.js' => 'sha512-5bU9IIP4PgBrOKLZvGWJD4kgfQrkTz8Z3Iqeu058mbQzW3mCumOU6M3UVbVZU9rrVoVwaW4cZK8U8h5xjF88eQ==',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue