forked from user-none/arora
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple start page with a search box pointing at the active
search engine. It has been created by Fernando Lemos and has some modifications of mine: 1. It now uses engines from the user's collection. 2. It is translatable now. 3. It uses our SVG icon so that it is fully resizable. Changes behind the scenes: - It uses the window.arora interface that we will expose to the JavaScript scope for our custom pages. One of the methods is translate(), which is a wrapper for tr() function. Drawback: translatable strings need to be predeclared using the QT_TR_NOOP macro. - Another object that is exposed is the current engine object. It is available under the window.arora.currentEngine interface. All properties that are declared using the Q_PROPERTY macro will be available as JS properties.
- Loading branch information
Jakub Wieczorek
committed
Jul 4, 2009
1 parent
541eabc
commit 80189ce
Showing
11 changed files
with
229 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<!DOCTYPE RCC><RCC version="1.0"> | ||
<qresource> | ||
<file>notfound.html</file> | ||
<file>dirlist.html</file> | ||
<file>notfound.html</file> | ||
<file>startpage.html</file> | ||
<file>startpage.css</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
font-family: "DejaVu Sans"; | ||
} | ||
|
||
body { | ||
background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#fff), color-stop(0.5, #fff)); | ||
background-repeat: repeat-x; | ||
margin-top: 200px; | ||
} | ||
|
||
#header, #search, #footer { | ||
width: 500px; | ||
margin: 10px auto; | ||
} | ||
|
||
#header, #search { | ||
-webkit-border-radius: 0.8em; | ||
padding: 25px; | ||
} | ||
|
||
#header { | ||
background: -webkit-gradient(linear, left top, left bottom, from(#228), to(#668), color-stop(0.9, #66a)); | ||
height: 20px; | ||
} | ||
|
||
#header h1 { | ||
display: inline; | ||
font-size: 1.7em; | ||
color: #fff; | ||
font-weight: bold; | ||
} | ||
|
||
#header img { | ||
display: inline; | ||
float: right; | ||
height: 150px; | ||
margin-top: -80px; | ||
} | ||
|
||
#search { | ||
background: -webkit-gradient(linear, left top, right top, from(#cdf), to(#cdf), color-stop(0.5, #eff)); | ||
height: 50px; | ||
color: #000; | ||
text-align: center; | ||
padding-top: 40px !important; | ||
} | ||
|
||
#search fieldset { | ||
border: 0; | ||
} | ||
|
||
#search input[type=text] { | ||
width: 65%; | ||
} | ||
|
||
#search input[type=submit] { | ||
width: 25%; | ||
} | ||
|
||
#footer { | ||
text-align: center; | ||
color: #999; | ||
} | ||
|
||
#footer a { | ||
color: #555; | ||
text-decoration: none; | ||
} | ||
|
||
#footer a:hover { | ||
text-decoration: underline; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?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').innerHTML = searchEngine.name; | ||
} | ||
|
||
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters