Stop loading jQuery from Google

This commit is contained in:
Marco Bonetti 2021-03-04 15:53:39 +01:00
parent 636cbf6e76
commit 66268b4e57
3 changed files with 10 additions and 6 deletions

View file

@ -10,13 +10,9 @@
<style type="text/css" media="screen">
{% include 'rosetta/css/rosetta.css' %}
</style>
<script src="//www.google.com/jsapi" type="text/javascript"></script>
<script src="//code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
//<!--
google.load("jquery", "1.3");
{% if rosetta_settings.ENABLE_TRANSLATION_SUGGESTIONS %}google.load("language", "1");{% endif %}
{% include 'rosetta/js/rosetta.js' %}
//-->
</script>
</head>
<body>

View file

@ -1,12 +1,14 @@
{% load rosetta %}
google.setOnLoadCallback(function() {
$(document).ready(function() {
$('.location a').show().toggle(function() {
$('.hide', $(this).parent()).show();
}, function() {
$('.hide', $(this).parent()).hide();
});
{% if rosetta_settings.ENABLE_TRANSLATION_SUGGESTIONS %}
{% if rosetta_settings.AZURE_CLIENT_SECRET or rosetta_settings.GOOGLE_APPLICATION_CREDENTIALS_PATH %}
@ -96,6 +98,7 @@ google.setOnLoadCallback(function() {
origs=$(this).parents('tr').find('.original>.message').html().match(RX),
trads=$(this).val().match(RX),
error = $('<span class="alert">Unmatched variables</span>');
if (origs && trads) {
for (var i = trads.length; i--;){
var key = trads[i];

View file

@ -33,3 +33,8 @@ msgid_plural ""
"%(num_bottles)s bottles of beer on the wall\n"
msgstr[0] ""
msgstr[1] ""
#: templates/test.html:3
msgid "We need %(num_bottles)s bottles!"
msgstr ""