Browse Source

[FIX][11.0] website_form_recaptcha travis warning

pull/481/head
tbaden 1 month ago
parent
commit
c2c8a37f31
1 changed files with 11 additions and 9 deletions
  1. 11
    9
      website_form_recaptcha/static/src/js/field_recaptcha.js

+ 11
- 9
website_form_recaptcha/static/src/js/field_recaptcha.js View File

@@ -18,8 +18,9 @@ odoo.define('website_form_recaptcha.recaptcha', function (require) {
18 18
             "fil", "fi", "fr", "fr-CA", "gl", "ka", "de", "de-AT", "de-CH",
19 19
             "el", "gu", "iw", "hi", "hu", "is", "id", "it", "ja", "kn", "ko",
20 20
             "lo", "lv", "lt", "ms", "ml", "mr", "mn", "no", "fa", "pl", "pt",
21
-            "pt-BR", "pt-PT", "ro", "ru", "sr", "si", "sk", "sl", "es", "es-419",
22
-            "sw", "sv", "ta", "te", "th", "tr", "uk", "ur", "vi", "zu",
21
+            "pt-BR", "pt-PT", "ro", "ru", "sr", "si", "sk", "sl", "es",
22
+            "es-419", "sw", "sv", "ta", "te", "th", "tr", "uk", "ur", "vi",
23
+            "zu",
23 24
         ],
24 25
         recaptcha_js_url: "https://www.google.com/recaptcha/api.js",
25 26
         start: function () {
@@ -28,7 +29,7 @@ odoo.define('website_form_recaptcha.recaptcha', function (require) {
28 29
             this.$captchas = self.$('.o_website_form_recaptcha');
29 30
             this.handle_captcha();
30 31
         },
31
-        handle_captcha: function() {
32
+        handle_captcha: function () {
32 33
             var self = this;
33 34
             return ajax.post('/website/recaptcha/', {}).then(
34 35
                 function (result) {
@@ -43,21 +44,22 @@ odoo.define('website_form_recaptcha.recaptcha', function (require) {
43 44
         _get_captcha_elem: function (data) {
44 45
             return $('<div/>', {
45 46
                 'class': 'g-recaptcha',
46
-                'data-sitekey': data.site_key
47
+                'data-sitekey': data.site_key,
47 48
             });
48 49
         },
49
-        _get_captcha_script_url: function() {
50
+        _get_captcha_script_url: function () {
50 51
             var lang = $("html").attr("lang").replace("_", "-");
51 52
             if (this.captcha_languages.includes(lang)) {
52
-                // lookup for specific localization (ie: fr-FR)
53
+                // Lookup for specific localization (ie: fr-FR)
53 54
                 return this.recaptcha_js_url + "?hl=" + lang;
54 55
             }
55 56
             if (this.captcha_languages.includes(lang.slice(0, 2))) {
56
-                // fallback to main lang
57
+                // Fallback to main lang
57 58
                 return this.recaptcha_js_url + "?hl=" + lang.slice(0, 2);
58 59
             }
59
-            // if both failed -> let google handle it itself (picks browser language)
60
+            // If both failed ->
61
+            // let google handle it itself (picks browser language)
60 62
             return this.recaptcha_js_url;
61
-        }
63
+        },
62 64
     });
63 65
 });

Loading…
Cancel
Save