PageSourceSearch

https://ttsneuronala.elhuyar.eus/static/barrak/elhuyar.eus/tts-component.js

js elhuyar.eus collected 2026-10-02 03:23:11 UTC 18,200 bytes, 199 lines download raw bytes

1// tts-component.js
2class TTSComponent extends HTMLElement {
3    constructor() {
4        super();
5        const template = document.createElement('template');
6        template.innerHTML = `
7        <link rel="stylesheet" type="text/css" media="all" href="https://ttsneuronala.elhuyar.eus/static/barrak/base/css/tts/tts.css">
8        <!-- TTS -->
9        <div class="barra">
10            <div id="preloadedImages"></div>
11            <p id="lerrojauzia1" class="clear"></p>
12            <a href="#" onclick="loadElhuyar(this); return false;" class="edukiaentzunbotoia" title="Edukia entzun" accesskey="p" style="width:fit-content; margin:1em;">
13                <!--<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M215 71.1L126.1 160H24c-13.3 0-24 10.7-24 24v144c0 13.3 10.7 24 24 24h102.1l89 89c15 15 41 4.5 41-17V88c0-21.5-26-32-41-17zm233.3-51.1c-11.2-7.3-26.2-4.2-33.5 7-7.3 11.2-4.2 26.2 7 33.5 66.3 43.5 105.8 116.6 105.8 195.6 0 79-39.6 152.1-105.8 195.6-11.2 7.3-14.3 22.3-7 33.5 7 10.7 21.9 14.6 33.5 7C528.3 439.6 576 351.3 576 256S528.3 72.4 448.4 20zM480 256c0-63.5-32.1-121.9-85.8-156.2-11.2-7.1-26-3.8-33.1 7.5s-3.8 26.2 7.4 33.4C408.3 166 432 209.1 432 256s-23.7 90-63.5 115.4c-11.2 7.1-14.5 22.1-7.4 33.4 6.5 10.4 21.1 15.1 33.1 7.5C447.9 377.9 480 319.5 480 256zm-141.8-76.9c-11.6-6.3-26.2-2.2-32.6 9.5-6.4 11.6-2.2 26.2 9.5 32.6C328 228.3 336 241.6 336 256c0 14.4-8 27.7-20.9 34.8-11.6 6.4-15.8 21-9.5 32.6 6.4 11.7 21.1 15.8 32.6 9.5 28.2-15.6 45.8-45 45.8-76.9s-17.5-61.3-45.8-76.9z"/></svg>-->
14                <img src="https://ttsneuronala.elhuyar.eus/static/img/botoia_`+document.getElementsByTagName("html")[0].getAttribute("lang")+`.png">
15            </a>
16            <p id="lerrojauzia2" class="clear"></p>
17        </div>
18        `;
19        const shadowRoot = this.attachShadow({ mode: 'open' });
20
21        shadowRoot.appendChild(template.content.cloneNode(true));
22
23        function LOAD_HTML(e)
24        {
25            var html = `
26                <div id="audiobotoiak" class="audiobotoiak">
27                    <div class="ezkerrean">
28                        <a href="#" id="playbotoiabozgorailua" onclick="TTS.entzun(); return false;" class="playbotoiabozgorailua audiobotoia" title="Edukia entzun" accesskey="p" style="display:none">
29                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" class="botoikolorea"><path d="M215 71.1L126.1 160H24c-13.3 0-24 10.7-24 24v144c0 13.3 10.7 24 24 24h102.1l89 89c15 15 41 4.5 41-17V88c0-21.5-26-32-41-17zm233.3-51.1c-11.2-7.3-26.2-4.2-33.5 7-7.3 11.2-4.2 26.2 7 33.5 66.3 43.5 105.8 116.6 105.8 195.6 0 79-39.6 152.1-105.8 195.6-11.2 7.3-14.3 22.3-7 33.5 7 10.7 21.9 14.6 33.5 7C528.3 439.6 576 351.3 576 256S528.3 72.4 448.4 20zM480 256c0-63.5-32.1-121.9-85.8-156.2-11.2-7.1-26-3.8-33.1 7.5s-3.8 26.2 7.4 33.4C408.3 166 432 209.1 432 256s-23.7 90-63.5 115.4c-11.2 7.1-14.5 22.1-7.4 33.4 6.5 10.4 21.1 15.1 33.1 7.5C447.9 377.9 480 319.5 480 256zm-141.8-76.9c-11.6-6.3-26.2-2.2-32.6 9.5-6.4 11.6-2.2 26.2 9.5 32.6C328 228.3 336 241.6 336 256c0 14.4-8 27.7-20.9 34.8-11.6 6.4-15.8 21-9.5 32.6 6.4 11.7 21.1 15.8 32.6 9.5 28.2-15.6 45.8-45 45.8-76.9s-17.5-61.3-45.8-76.9z"/></svg>
30                        </a>
31                        <a href="#" id="gelditubotoia" onclick="TTS.stopBotoia(); return false;" class="gelditubotoia audiobotoia" title="Amaitu" accesskey="s" style="display:none">
32                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="botoikolorea"><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"/></svg>
33                        </a>
34                        <a href="#" id="hasierarabotoia" onclick="TTS.hasierara(); return false;" class="hasierarabotoia audiobotoia" title="Hasierara" accesskey="c" style="display:none">
35                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="botoikolorea"><path d="M0 436V76c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v151.9L235.5 71.4C256.1 54.3 288 68.6 288 96v131.9L459.5 71.4C480.1 54.3 512 68.6 512 96v320c0 27.4-31.9 41.7-52.5 24.6L288 285.3V416c0 27.4-31.9 41.7-52.5 24.6L64 285.3V436c0 6.6-5.4 12-12 12H12c-6.6 0-12-5.4-12-12z"/></svg>
36                        </a>
37                        <a href="#" id="atzeraparagrafoabotoia" onclick="TTS.atzeraparagrafoa(); return false;
37" class="atzeraparagrafoabotoia audiobotoia" title="Aurreko paragrafora" accesskey="x" style="display:none">
38                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="botoikolorea"><path d="M64 468V44c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12v176.4l195.5-181C352.1 22.3 384 36.6 384 64v384c0 27.4-31.9 41.7-52.5 24.6L136 292.7V468c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12z"/></svg>
39                        </a>
40                        <a href="#" id="atzerabotoia" onclick="TTS.atzera(); return false;" class="atzerabotoia audiobotoia" title="Aurreko esaldira" accesskey="a" style="display:none">
41                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="botoikolorea"><path d="M11.5 280.6l192 160c20.6 17.2 52.5 2.8 52.5-24.6V96c0-27.4-31.9-41.8-52.5-24.6l-192 160c-15.3 12.8-15.3 36.4 0 49.2zm256 0l192 160c20.6 17.2 52.5 2.8 52.5-24.6V96c0-27.4-31.9-41.8-52.5-24.6l-192 160c-15.3 12.8-15.3 36.4 0 49.2z"/></svg>
42                        </a>
43                        <a href="#" id="playbotoia" onclick="TTS.entzun(); return false;" class="playbotoia audiobotoia" title="Entzun" accesskey="p" style="display:none">
44                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="botoikolorea play"><path d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"/></svg>
45                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="botoikolorea pause"><path d="M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"/></svg>
46                        </a>
47                        <a href="#" id="aurrerabotoia" onclick="TTS.aurrera(); return false;" class="aurrerabotoia audiobotoia" title="Hurrengo esaldira" accesskey="d" style="display:none">
48                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="botoikolorea"><path d="M500.5 231.4l-192-160C287.9 54.3 256 68.6 256 96v320c0 27.4 31.9 41.8 52.5 24.6l192-160c15.3-12.8 15.3-36.4 0-49.2zm-256 0l-192-160C31.9 54.3 0 68.6 0 96v320c0 27.4 31.9 41.8 52.5 24.6l192-160c15.3-12.8 15.3-36.4 0-49.2z"/></svg>
49                        </a>
50                        <a href="#" id="aurreraparagrafoabotoia" onclick="TTS.aurreraparagrafoa(); return false;" class="aurreraparagrafoabotoia audiobotoia" title="Hurrengo paragrafora" accesskey="w" style="display:none">
51                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="botoikolorea"><path d="M384 44v424c0 6.6-5.4 12-12 12h-48c-6.6 0-12-5.4-12-12V291.6l-195.5 181C95.9 489.7 64 475.4 64 448V64c0-27.4 31.9-41.7 52.5-24.6L312 219.3V44c0-6.6 5.4-12 12-12h48c6.6 0 12 5.4 12 12z"/></svg>
52                        </a>
53                        <a href="#" id="amaierarabotoia" onclick="TTS.amaierara(); return false;" class="amaierarabotoia audiobotoia" title="Amaierara" accesskey="e" style="display:none">
54                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="botoikolorea"><path d="M512 76v360c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12V284.1L276.5 440.6c-20.6 17.2-52.5 2.8-52.5-24.6V284.1L52.5 440.6C31.9 457.8 0 443.4 0 416V96c0-27.4 31.9-41.7 52.5-24.6L224 226.8V96c0-27.4 31.9-41.7 52.5-24.6L448 226.8V76c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12z"/></svg>
55                        </a>
56                        <a href="#" id="joanbotoia" onclick="TTS.joan(); return false;" class="joanbotoia audiobotoia" title="Zati zehatz batera joateko, klik egin bertan eta jarraitu botoia sakatu" accesskey="j" style="display:none">
57                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="botoikolorea"><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg>
58                        </a>
59                        <a href="#" id="azalpentestua" onclick="TTS.entzun(); return false;" class="azalpentestua audiobotoia" title="Edukia entzun" style="display:none"><span id="entzuntestua" class="entzuntestua">Orria entzun</span></a>
60                        <a href="#" id="aboutbotoia" onclick="TTS.about(); return false;" class="aboutbotoia audiobotoia" title="Honi buruz" accesskey="h" style="display:none">
61                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="botoikolorea"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"/></svg>
62                        </a>
63                        <div id="bolumenakontrola" class="bolumenakontrola audiobotoia" title="Bolumena" style="display:none">
64                            <div class="banatzekoa"></div>
65                            <a href="#" id="volume" class="volume" onclick="TTS.bolumenaerakutsiezkutatu(); return false;" accesskey="v">
66                                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" class="botoikolorea"><path d="M533.6 32.5C598.5 85.2 640 165.8 640 256s-41.5 170.7-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64V448c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352H64c-35.3 0-64-28.7-64-64V224c0-35.3 28.7-64 64-64h67.8L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z"/></svg>
67                            </a>
68                            <a href="#" id="bolumenaslider" class="bolumenaslider"></a>
69                            <span id="bolumenatooltip" class="bolumenatooltip slidertooltipbolumena" style="display:none"></span>
70                        </div>
71                        <div id="abiadurakontrola" class="abiadurakontrola speed100 audiobotoia abiadura" title="Irakurketaren abiadura" style="display:none" onmousedown="TTS.abiaduraaldatu()">
72                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512" class="botoikolorea abiadura_ikonoa"><path d="M242.7 256l100.1-100.1c12.3-12.3 12.3-32.2 0-44.5l-22.2-22.2c-12.3-12.3-32.2-12.3-44.5 0L176 189.3 75.9 89.2c-12.3-12.3-32.2-12.3-44.5 0L9.2 111.5c-12.3 12.3-12.3 32.2 0 44.5L109.3 256 9.2 356.1c-12.3 12.3-12.3 32.2 0 44.5l22.2 22.2c12.3 12.3 32.2 12.3 44.5 0L176 322.7l100.1 100.1c12.3 12.3 32.2 12.3 44.5 0l22.2-22.2c12.3-12.3 12.3-32.2 0-44.5L242.7 256z"/></svg>
73                            <span class="abiadurazenb" >1</span>
74                        </div>
75                        <div id="hizlariakontrola" class="hizlariakontrola audiobotoia" title="Hizlaria" style="display:none">
76                            <a href="#" id="hizlaria" class="hizlaria" onclick="TTS.hizlariaerakutsiezkutatu(); return false;" accesskey="g">
77                                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="botoikolorea"><path d="M224 256A128 128 0 1 0 224 0a128 128 0 1 0 0 256zm-45.7 48C79.8 304 0 383.8 0 482.3C0 498.7 13.3 512 29.7 512H418.3c16.4 0 29.7-13.3 29.7-29.7C448 383.8 368.2 304 269.7 304H178.3z"/></svg>
78                            </a>
79                            <div id="hizlariaukera" class="hizlariaukera" style="display:none">
80                            </div>
81                        </div>
82                        <div id="hizkuntzakontrola" class="hizkuntzakontrola audiobotoia" title="Testuaren hizkuntza" style="display:none">
83                            <a href="#" id="hizkuntza" class="hizkuntza" onclick="TTS.hizkuntzaerakutsiezkutatu(); return false;" accesskey="l"></a>
84                            <div id="hizkuntzaaukera" class="hizkuntzaaukera" style="display:none">
85                                <a href="#" id="hizkuntzaeuskara" class="hizkuntzaeuskara ezkerrean aukeratuta" onclick="TTS.hizkuntzaaldatu(event); return false;" title="Euskara" accesskey="u"></a>
86                                <div class="ezkerrean banatzekoa"></div>
87                                <a href="#" id="hizkuntzagaztelania" class="hizkuntzagaztelania ezkerrean" onclick="TTS.hizkuntzaaldatu(event); return false;" title="Gaztelania" accesskey="i"></a>
88                            </div>
89                        </div>
90                        <div id="deskargakontrola" class="deskargakontrola audiobotoia" title="Deskargatu testuaren audioa" style="display:none" onclick="TTS.deskargatutestuaaudiogisa()">
91                            <a href="#">
92                                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="botoikolorea"><path d="M216 0h80c13.3 0 24 10.7 24 24v168h87.7c17.8 0 26.7 21.5 14.1 34.1L269.7 378.3c-7.5 7.5-19.8 7.5-27.3 0L90.1 226.1c-12.6-12.6-3.7-34.1 14.1-34.1H192V24c0-13.3 10.7-24 24-24zm296 376v112c0 13.3-10.7 24-24 24H24c-13.3 0-24-10.7-24-24V376c0-13.3 10.7-24 24-24h146.7l49 49c20.1 20.1 52.5 20.1 72.6 0l49-49H488c13.3 0 24 10.7 24 24zm-124 88c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20zm64 0c0-11-9-20-20-20s-20 9-20 20 9 20 20 20 20-9 20-20z"/></svg>
93                            </a>
94                        </div>
95                        <div class="banatzekoa banatzailealogoa" style="display:none"></div>
96                        <a id="tts_elhuyar_logoa" class="tts_elhuyar_logoa" href="https://www.elhuyar.eus/eu/site/hizketa-teknologiak" title="Elhuyar Hizkuntza eta Teknologia" target="_blank" style="display:none"></a>
97                    </div>
98                </div>
99                <div id="aboutModal" class="about-modal">
100                    <div class="modal-content">
101                        <span class="close" onclick="TTS.about_close();">&times;</span>
102                        <div class="about-modal-content"></div>
103                    </div>
104                </div>`
105            e.insertAdjacentHTML('afterend', html);
106        }
107
108        function LOAD_TTS()
109        {
110            TTS.botoiakerakutsi();
111            TTS.hasigeldituikonoa();
112            TTS.hasigeldituikonoa();
113            TTS_berezia.hizkuntza = document.documentElement.lang;
114            TTS.audioarenhizkuntza = document.documentElement.lang;
115        }
116
117        function loadElhuyar(e)
118        {
119            e.style.display = 'none'
120            LOAD_HTML(e)
121
122            
123            const shadow_root = document.querySelector('#host').shadowRoot;
124            shadow_root.querySelector('#audiobotoiak').style.display = 'block'
125
126            var head = document.querySelector('head')
127
128            var js_serie    =
129            [
130                'https://ttsneuronala.elhuyar.eus/static/barrak/base/js/tts/jquery.min.js',
131                'https://ttsneuronala.elhuyar.eus/static/barrak/base/js/tts/jquery-ui.min.js',
132                'https://ttsneuronala.elhuyar.eus/static/barrak/elhuyar.eus/tts_berezia.js',
133                'https://ttsneuronala.elhuyar.eus/static/barrak/base/js/tts/wgxpath.install.js',
134                'https://ttsneuronala.elhuyar.eus/static/barrak/base/js/tts/tts.js'
135            ];
136
137            var js_parallel =
138            [
139                'https://ttsneuronala.elhuyar.eus/static/barrak/base/js/tts/crel.js',
140                'https://ttsneuronala.elhuyar.eus/static/barrak/base/js/tts/classList.js',
141            ]
142
143            loadSerieJs(js_serie, 0, function()
144            {
145                loadParallel(js_parallel, 0, function()
146                {
147                    LOAD_TTS()
148                })
149            })
150
151            function loadSerieJs(jss, i, callback)
152            {
153                var script    = document.createElement('script') 
154                script.src    = jss[i];
155                script.onload = function()
156                {
157                    i++
158                    if(typeof jss[i] === 'undefined')
159                        callback()
160                    else
161                        loadSerieJs(jss, i, callback)
162                }
163                shadowRoot.append(script)
164            }
165
166            function loadParallel(jss, i, callback)
167            {
168                var script    = document.createElement('script') 
169                script.src    = jss[i]
170                script.onload = function()
171                {
172                    if(i===jss.length) 
173                        callback()
174                }
175                shadowRoot.append(script)
176                i++
177                if(typeof jss[i] !== 'undefined')
178                    loadParallel(jss, i, callback)
179            }
180        }
181        window.loadElhuyar = loadElhuyar;
182    }
183}
184
185customElements.define('tts-component', TTSComponent);
186
187window.addEventListener("load", function (event) {
188    if (TTS_berezia_param["barra_erakutsi"]){
189        const ShadowRoot = document.querySelector('tts-component').shadowRoot;
190        const desiredATag = ShadowRoot.querySelector('.edukiaentzunbotoia');
191
192        const clickEvent = new MouseEvent('click', {
193          bubbles: true,
194          cancelable: true,
195          view: window
196        });
197        desiredATag.dispatchEvent(clickEvent);
198    }
199});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.