Page tree

Tartu Ülikooli IT viki

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Content Layer
id1126706142
Content Column
width100%
id1126706144
Content Block
padding0px 22px
margin0px 22px
background-repeatno-repeat
background-size1100px
id1126706167
background-imageUT170510AT041-Pano-1.webp
background-positioncenter center
height250px

Content Block
margin0px 0px 30px 0px
overflowvisible
id1126706155

Livesearch
spaceKeyAA
sizelarge
placeholderOtsi arvutiabist....
typepage


Tere tulemast Tartu Ülikooli IT viki leheküljele!

Tartu Ülikooli arvutiabi töötabpakub tuge esmaspäevast reedeni kl 8–18.20 ja laupäevast pühapäevani kl 8-17. 

Kontor aadressil Uppsala 10 on avatud esmaspäevast reedeni kl 8-17.

UUS! Ekraani alt-paremalt nurgast leiad meie virtuaalse assistendi, mis vastab küsimustele arvutiabis olevate juhendite põhjal.

Content Layer
id1126771571
Content Column
columnalternate
width22.0%
id1126771572
Content Block
background-color$lightGrayColor
padding40px 16px
margin0px 22px
id1126771583
Kontaktandmed

E–R 8.00–18.20

L–P 8.00–17.00

737 5500 (5500)

Uppsala 10

arvutiabi@ut.ee

Content Column
width78.0%
id1126771582
Content Block
id1126771593

   Kasulikud lingid:

         Arvutiabi pöördumiste portaal

         Telli seade või tarkvara

         Staatusleht

         Ülikooli postkast

         Logi sisse

   Uudised

HTML
<!-- Chat Button -->
<button id="openChatBtn" style="position: fixed; bottom: 20px; right: 20px; cursor: pointer; border: none; background: none; z-index: 1000;">
    <img id="chatAvatar" alt="Chat Avatar" width="auto" height="84" />
</button>

<!-- Chat Container -->
<div id="chatContainer" style="position: fixed; bottom: 0; right: 0; width: 100%; max-width: 500px; height: 80vh; border: 1px solid #ccc; background-color: white; z-index: 1000; display: none; border-radius: 20px 20px 0px 0px;">
    <!-- Chat Header with Close Button -->
    <div style="background-color: #2C569B; padding: 10px; text-align: right; height: 50px; border-radius: 20px 20px 0 0; display: flex; align-items: center; justify-content: space-between;">
        <div style="display: flex; align-items: center; justify-content: start; gap: 12px;">
            <img src="https://demo.tehisintellekt.ee/ut/tiksu.svg" alt="Logo" style="height: 46px; margin-left: 12px;">
            <div style="display: flex; flex-direction: column; align-items: start;">
                <span style="font-size: 20px; font-weight:700; color:white; font-family: system-ui, sans-serif;">Tiksu</span>
                <span id="tiksuSubtitle" style="font-size: 12px; font-weight:400; color:white; font-family: system-ui, sans-serif;"></span>
            </div>
        </div>
        <button id="closeChatBtn" style="border: none; background: none; cursor: pointer; padding-right: 12px; display: flex; align-items: center;">
            <img src="https://demo.tehisintellekt.ee/ut/close_button.svg" alt="Close" />
        </button>
    </div>
    <!-- Chat iFrame -->
    <iframe id="chatIframe" src="https://demo.tehisintellekt.ee/ut/assistant" style="width: 100%; height: calc(100% - 70px); border: none; border-radius: 0 0 20px 20px;"></iframe>
</div>

<script>
    // Language resources
    const resources = {
        english: {
            avatar: "https://demo.tehisintellekt.ee/ut/need_some_help.svg",
            lang: "en",
            text: "TiksuIT helpdesk virtual assistant responds instantly"
        },
        estonian: {
            avatar: "https://demo.tehisintellekt.ee/ut/kas_vajad_abi.svg",
            lang: "et",
            text: "MeieArvutiabi virtuaalne tiksuassistent vastab koheseltkohe"
        },
    };

    // Get elements
    const chatAvatar = document.getElementById('chatAvatar');
    const chatIframe = document.getElementById('chatIframe');
    const tiksuSubtitle = document.getElementById('tiksuSubtitle');

    // Function to set language based on referrer URL
    function setLanguage() {
        if (typeof window !== "undefined") {
            console.log("Referrer URL:", document.referrer);
            let selectedLang;
            if (window.location.href.startsWith("https://wiki.ut.ee/display/IT") || 
                window.location.href.startsWith("https://wiki-test.ut.ee/display/IT")) {
                // Set English
                chatAvatar.src = resources.english.avatar;
                tiksuSubtitle.textContent = resources.english.text;
                selectedLang = resources.english.lang;
            } else {
                // Set Estonian
                chatAvatar.src = resources.estonian.avatar;
                tiksuSubtitle.textContent = resources.estonian.text;
                selectedLang = resources.estonian.lang;
            }

            // Update the iframe src with the language parameter
            const currentSrc = new URL(chatIframe.src);
            currentSrc.searchParams.set('lang', selectedLang);
            chatIframe.src = currentSrc.toString();
        }
    }

    // Initialize the language
    setLanguage();

    // Open Chat
    document.getElementById('openChatBtn').addEventListener('click', function() {
        document.getElementById('chatContainer').style.display = 'block';
    });

    // Close Chat
    document.getElementById('closeChatBtn').addEventListener('click', function() {
        document.getElementById('chatContainer').style.display = 'none';
    });
</script>

...