|
18 | 18 | <link rel="shortcut icon" href="assets/ico/favicon.png"> |
19 | 19 |
|
20 | 20 | <!-- Styles --> |
21 | | - <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css" type="text/css" /> |
22 | | - <link rel="stylesheet" href="assets/font-awesome/css/all.min.css" type="text/css" /> |
23 | | - <link rel="stylesheet" href="assets/app/css/app.css" type="text/css" /> |
24 | | - <link rel="stylesheet" href="assets/app/css/edit.css" type="text/css" /> |
25 | | - <link rel="stylesheet" href="assets/app/css/custom.css" type="text/css" /> |
| 21 | +<!-- <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css" type="text/css" />--> |
| 22 | +<!-- <link rel="stylesheet" href="assets/font-awesome/css/all.min.css" type="text/css" />--> |
| 23 | +<!-- <link rel="stylesheet" href="assets/app/css/app.css" type="text/css" />--> |
| 24 | +<!-- <link rel="stylesheet" href="assets/app/css/edit.css" type="text/css" />--> |
| 25 | +<!-- <link rel="stylesheet" href="assets/app/css/custom.css" type="text/css" />--> |
26 | 26 | <!--[if lt IE 9]> |
27 | 27 | <script type="text/javascript" src="assets/app/js/html5shiv.min.js"></script> |
28 | 28 | <script type="text/javascript" src="assets/app/js/respond.min.js"></script> |
29 | 29 | <![endif]--> |
30 | 30 | </head> |
31 | 31 |
|
32 | | -<body> |
| 32 | +<body style="display: none"> |
33 | 33 |
|
34 | 34 | <div id="page" class="hfeed site"> |
35 | 35 | <header id="masthead" class="site-header" role="banner"> |
|
95 | 95 | <a href="#" class="nav-link collapsed" data-toggle="collapse" data-target="#login-form">Login <i class="sub-indicator fa fa-chevron-circle-down fa-fw text-muted"></i> |
96 | 96 | </a> |
97 | 97 | </li> |
| 98 | + |
| 99 | + <li class="nav-item dropdown"> |
| 100 | + |
| 101 | + <a class="dropdown-toggle nav-link" href="#" id="navbarDropdownlang" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
| 102 | + |
| 103 | + <img id="flagIcon" src="https://sakthi.desk/themes/default/common/images/flags/en.png" alt="no"> |
| 104 | + </a> |
| 105 | + |
| 106 | + <ul class="dropdown-menu" aria-labelledby="navbarDropdown"> |
| 107 | + |
| 108 | + <li><a class="dropdown-item" href="archive.html?lang=ar" id="arabicOption"> |
| 109 | + <img src="https://sakthi.desk/themes/default/common/images/flags/ar.png" alt="Img"> Arabic |
| 110 | + </a></li> |
| 111 | + |
| 112 | + <li><a class="dropdown-item" href="archive.html?lang=en" id="englishOption"> |
| 113 | + <img src="https://sakthi.desk/themes/default/common/images/flags/en.png" alt="Img"> English |
| 114 | + </a></li> |
| 115 | + </ul> |
| 116 | + </li> |
98 | 117 | </ul><!-- .navbar-menu --> |
99 | 118 |
|
100 | 119 | <span class="switcher-toggle desk_none" onclick="myFunction()"> |
@@ -586,5 +605,109 @@ <h2 class="section-title h4 clearfix">Get Updates <i class="line"></i></h2> |
586 | 605 | <script type="text/javascript" src="assets/app/js/autocomplete.js"></script> |
587 | 606 | <script type="text/javascript" src="assets/app/js/app.js"></script> |
588 | 607 |
|
| 608 | + <script async> |
| 609 | + |
| 610 | + let normalCSS = [ |
| 611 | + { |
| 612 | + rel: 'stylesheet',type: 'text/css', href: 'assets/bootstrap/css/bootstrap.min.css' |
| 613 | + }, |
| 614 | + { |
| 615 | + rel: 'stylesheet', type: 'text/css', href: 'assets/app/css/app.css', |
| 616 | + }, |
| 617 | + { |
| 618 | + rel: 'stylesheet', type: 'text/css', href: 'assets/app/css/edit.css', |
| 619 | + }, |
| 620 | + { |
| 621 | + rel: 'stylesheet', type: 'text/css', href: 'assets/app/css/custom.css', |
| 622 | + }, |
| 623 | + { |
| 624 | + rel: 'stylesheet', type: 'text/css', href: 'assets/font-awesome/css/all.min.css' |
| 625 | + } |
| 626 | + // Add more objects for additional links |
| 627 | + ]; |
| 628 | + |
| 629 | + let rtlCSS = [ |
| 630 | + { |
| 631 | + rel: 'stylesheet',type: 'text/css', href: 'assets/bootstrap/css/bootstrap.rtl.min.css' |
| 632 | + }, |
| 633 | + { |
| 634 | + rel: 'stylesheet', type: 'text/css', href: 'assets/app/css/rtl/app.css', |
| 635 | + }, |
| 636 | + { |
| 637 | + rel: 'stylesheet', type: 'text/css', href: 'assets/app/css/rtl/edit.css', |
| 638 | + }, |
| 639 | + { |
| 640 | + rel: 'stylesheet', type: 'text/css', href: 'assets/app/css/rtl/custom.css', |
| 641 | + }, |
| 642 | + { |
| 643 | + rel: 'stylesheet', type: 'text/css', href: 'assets/font-awesome/css/all.min.css' |
| 644 | + } |
| 645 | + // Add more objects for additional links |
| 646 | + ]; |
| 647 | + |
| 648 | + const urlParams = new URLSearchParams(window.location.search); |
| 649 | + |
| 650 | + const body = document.body; |
| 651 | + |
| 652 | + const flagIcon = document.getElementById('flagIcon'); |
| 653 | + |
| 654 | + if(urlParams.get('lang') && urlParams.get('lang') === 'ar') { |
| 655 | + |
| 656 | + var existingLinks = document.querySelectorAll('link[rel="stylesheet"]'); |
| 657 | + existingLinks.forEach(function (link) { |
| 658 | + link.parentNode.removeChild(link); |
| 659 | + }); |
| 660 | + |
| 661 | + flagIcon.src = 'https://sakthi.desk/themes/default/common/images/flags/ar.png'; |
| 662 | + |
| 663 | + flagIcon.alt = 'Arabic'; |
| 664 | + |
| 665 | + body.setAttribute('dir', 'rtl'); |
| 666 | + |
| 667 | + rtlCSS.forEach(function (linkData) { |
| 668 | + var link = document.createElement('link'); |
| 669 | + link.rel = linkData.rel; |
| 670 | + link.type = linkData.type; |
| 671 | + link.href = linkData.href; |
| 672 | + // Append the link element to the document's head |
| 673 | + document.head.appendChild(link); |
| 674 | + }); |
| 675 | + |
| 676 | + setTimeout(()=>{ |
| 677 | + |
| 678 | + body.style.display = 'block'; |
| 679 | + |
| 680 | + },1000) |
| 681 | + |
| 682 | + } else { |
| 683 | + |
| 684 | + var existingLinks1 = document.querySelectorAll('link[rel="stylesheet"]'); |
| 685 | + existingLinks1.forEach(function (link) { |
| 686 | + link.parentNode.removeChild(link); |
| 687 | + }); |
| 688 | + |
| 689 | + flagIcon.src = 'https://sakthi.desk/themes/default/common/images/flags/en.png'; |
| 690 | + |
| 691 | + flagIcon.alt = 'English'; |
| 692 | + |
| 693 | + body.removeAttribute('dir'); |
| 694 | + |
| 695 | + normalCSS.forEach(function (linkData) { |
| 696 | + var link = document.createElement('link'); |
| 697 | + link.rel = linkData.rel; |
| 698 | + link.type = linkData.type; |
| 699 | + link.href = linkData.href; |
| 700 | + // Append the link element to the document's head |
| 701 | + document.head.appendChild(link); |
| 702 | + }); |
| 703 | + |
| 704 | + setTimeout(()=>{ |
| 705 | + |
| 706 | + body.style.display = 'block'; |
| 707 | + |
| 708 | + },1000) |
| 709 | + } |
| 710 | + </script> |
| 711 | + |
589 | 712 | </body> |
590 | 713 | </html> |
0 commit comments