diff options
author | Mario <mario@mariovavti.com> | 2021-06-05 07:52:43 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-06-05 07:52:43 +0000 |
commit | 0784d2ea4e4f492d9f03d025b56d603d15b5ee89 (patch) | |
tree | e7ccf216da5cac2f3bef12cb80e5f61fe6fe356c /view/js/main.js | |
parent | 7b3eb09067e08bc017b71f5f05aef5a67eb5b05a (diff) | |
parent | b90db6931de2e1989cf44fac9ef037d1bc2cc16b (diff) | |
download | volse-hubzilla-0784d2ea4e4f492d9f03d025b56d603d15b5ee89.tar.gz volse-hubzilla-0784d2ea4e4f492d9f03d025b56d603d15b5ee89.tar.bz2 volse-hubzilla-0784d2ea4e4f492d9f03d025b56d603d15b5ee89.zip |
Merge branch 'dev' into six
Diffstat (limited to 'view/js/main.js')
-rw-r--r-- | view/js/main.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/view/js/main.js b/view/js/main.js index 0897fbd21..b1cba33af 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -78,6 +78,65 @@ $(document).ready(function() { } }); + // @hilmar |-> + if ( typeof(window.tao) == 'undefined' ) { + window.tao = {}; + } + if ( typeof(window.tao.zin) == 'undefined' ) { + tao.zin = { syslc: '', syslcs: {}, htm: '', me: '', debug: '' }; + tao.zin.axim = '<div class="zinpax fa fa-sync fa-spin"> </div>'; + $('.navbar-app[href*="/lang"]').attr({"data-toggle": "dropdown", "aria-expand": "true", "id": "zintog"}) + .removeAttr('href').addClass('zinlcx zinlcxp dropdown dropdown-toggle'); + $('.dropdown-item[href*="/lang"]').addClass('zinlcxmi zinlcx').removeAttr('href').css('cursor','pointer'); + } + $('.zinlcx').on('click', function(e) { + if (tao.zin.syslc == '') { + $('.zinlcx').append(tao.zin.axim); + $.ajax({ + type: 'POST', url: 'lang', + data: { zinlc: '??' } + }).done( function(re) { + tao.zin.re = JSON.parse(re); + tao.zin.syslc = tao.zin.re.lc; + tao.zin.syslcs = tao.zin.re.lcs; + tao.zin.htm = '<ul class="zinlcs fa-ul">'; + $.each( tao.zin.syslcs, function( k, v ) { + tao.zin.htm += '<li><a id="zinlc' + k + '" class="zinlc dropdown-item fakelink">' + k + ' ' + v + '</a></li>'; + }); + tao.zin.htm += '</ul>'; + $('.zinpax').remove(); + $('.zinlcx').append(tao.zin.htm); + $('.zinlcxp > ul').addClass('dropdown dropdown-menu dropdown-menu-right').css('left','-16em'); + }); + return false; + } else { + if (e.target.id == '') { + // noop click on lang again + return false; + } + tao.zin.me = e.target.id.substr(5); + $('#right_aside_wrapper').append(tao.zin.axim); + $.ajax({ + type: 'POST', url: 'lang', + data: { zinlc: tao.zin.me } + }).done( function(re) { + tao.zin.re = JSON.parse(re); + location.reload(true); + }); + } + }); + $('#zintog').on('click', function() { + $('.zinlcs').toggle(); + }); + $('#dropdown-menu').on('shown.bs.dropdown', function() { + tao.zin.debug += 'e,'; + //$('.zinlcs').removeAttr('display'); + }) + .on('mouseleave', function() { + $(this).trigger('click'); + }); + // @hilmar <-| + var tf = new Function('n', 's', 'var k = s.split("/")['+aStr['plural_func']+']; return (k ? k : s);'); jQuery.timeago.settings.strings = { |