From dc6bdeadf2cb20c780c92b905f83c1aa3d943d2c Mon Sep 17 00:00:00 2001 From: totoro Date: Sun, 26 Dec 2021 02:26:18 +0100 Subject: [PATCH] refactoring of the language flag management and use the new location of the flags --- resources/web/public/xlib/js/xlib.js | 14 +------------- web_controllers/language/language_management.anubis | 6 ++++-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/resources/web/public/xlib/js/xlib.js b/resources/web/public/xlib/js/xlib.js index 4962dea..b119b7a 100644 --- a/resources/web/public/xlib/js/xlib.js +++ b/resources/web/public/xlib/js/xlib.js @@ -42,9 +42,6 @@ jQuery.cachedScript = function( url, options ) { $.import_js('xlib/js/loadingoverlay.js') -// --------------------------------------------------------------------------- -// Script utile pour le menu "drapeaux" -window.onload=montre; var event_language_changed = new Event('language_changed', { bubbles: true @@ -52,7 +49,7 @@ var event_language_changed = new Event('language_changed', { function language_changed(lang) { console.log("language_changed language_code "+lang); - window.location.href = '?aws_controller=language&aws_action=do_change_language&language_code='+ encodeURIComponent(lang); + window.location.href = '?aws_c=language&aws_a=do_change_language&language_code='+ encodeURIComponent(lang); // $.ajax({ // url: '?aws_controller=language&aws_action=do_change_language&language_code='+ encodeURIComponent(lang), // type: 'GET', @@ -68,15 +65,6 @@ function language_changed(lang) { // }); } -function montre(id) { - var d = document.getElementById(id); - $("[id^='drapo']").each(function () { - $(this).hide(); - }); - - if (d) {d.style.display='block';} -} - function xlib_debug(o) { console.log(o); } diff --git a/web_controllers/language/language_management.anubis b/web_controllers/language/language_management.anubis index ff360be..c5e1d91 100644 --- a/web_controllers/language/language_management.anubis +++ b/web_controllers/language/language_management.anubis @@ -120,8 +120,10 @@ public define HTML_Partial_Content [ dl([ //literal("
 
\n"), - literal(""), - dd([style("display: none"),id("drapo1"), event(onmouseover, "montre('drapo1');"), event(onmouseout, "montre();")], + //literal(""), + + img([event(onmouseover, "showObject('l3-flag');"), event(onmouseout, "hideObject('l3-flag');")], "/xlib/flags/24x24/"+lang+".png" ), + dd([style("display: none"),id("l3-flag"), event(onmouseover, "showObject('l3-flag');"), event(onmouseout, "hideObject('l3-flag');")], ul( map(make_line, l3_get_all_dicos(dictionary_collection_name))+ [ -- libgit2 0.21.4