summaryrefslogtreecommitdiff
path: root/src/htmls/startpage.html
blob: 94d53a08a68e16c9df9bdf3ffb0cd5e5e1e9329e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title></title>
    <link rel="stylesheet" href="qrc:/startpage.css" type="text/css" />
    <script type="text/javascript">
        function update()
        {
            var searchEngine = window.arora.currentEngine;

            document.title = window.arora.translate('Welcome to Arora!');
            document.getElementById('headerTitle').innerHTML = window.arora.translate('Arora Start');
            document.getElementById('searchButton').value = window.arora.translate('Search!');
            document.getElementById('footer').innerHTML = window.arora.translate('Search results provided by') + ' '
                                                          + searchEngine.name + ' | ' + '<a href="http://arora-browser.org/">'
                                                          + window.arora.translate('About Arora') + '</a>';
            document.getElementById('lineEdit').placeholder = searchEngine.name;

            // Try to change the direction of the page:
            //   This string is defined in QApplication
            //   src/gui/kernel/qapplication.cpp#qt_detectRTLLanguage()
            //   it should contain LTR or RTL

            var newDir = window.arora.translate('QT_LAYOUT_DIRECTION');
            newDir = newDir.toLowerCase();
            if ((newDir != 'ltr') && (newDir != 'rtl'))
                newDir = 'ltr';
            document.getElementsByTagName('body')[0].setAttribute('dir', newDir);
        }

        function formSubmitted()
        {
            var string = lineEdit.value;

            if (string.length == 0)
                return;

            var url = window.arora.searchUrl(string);
            window.location.href = url;
        }
    </script>
</head>
<body onload="document.forms[0].lineEdit.select(); update();">
    <div id="header">
        <h1 id="headerTitle"></h1>
        <img src="qrc:/arora.svg" />
    </div>
    <div id="search">
        <form action="javascript:formSubmitted();">
            <fieldset>
                <input id="lineEdit" name="lineEdit" type="text" />
                <input id="searchButton" type="submit" />
            </fieldset>
        </form>
    </div>
    <div id="footer"></div>
</body>
</html>