Add a simple CSS to use "rem" sizes. Fixes #8

Prefix all the rules in the mediawiki CSS, so that they only apply inside the "articleContent" div
Add back/forward buttons. Fixes #1
This commit is contained in:
mossroy 2013-07-11 22:40:27 +02:00
parent da03c7c309
commit 8200762f74
4 changed files with 669 additions and 692 deletions

View File

@ -1,50 +1,17 @@
/* Colors and the rest of appearance properties are defined in this file.
We've added a few sample properties to get you started */
* {
padding: 0;
margin: 0;
-moz-box-sizing: border-box;
}
/* Main CSS of the application */
body {
/* Reset base size */
font-size: 16px;
/* Set font size relative to base size */
font-size: 1.4rem;
/* Remove spacing to avoid losing borders around the screen*/
margin: 0;
font-family: sans-serif;
line-height: 1.6;
background: #fefefe;
}
}
h1 {
background: #444545;
color: #fff;
padding: 0.75rem 0.5rem;
text-shadow: 2px 2px 1px #111;
font-weight: normal;
border-bottom: 1px solid #444;
}
#content {
border-top: 1px solid #993;
padding: 1rem 0.5rem;
}
p {
margin: 1rem 0;
}
button {
height: 3.8rem;
margin: 0 0 1rem;
padding: 0 1.5rem;
background: #fafafa;
border: 0.1rem solid #a6a6a6;
border-radius: 0.2rem;
font-size: 1.6rem;
line-height: 3.8rem;
color: #333;
text-align: center;
text-shadow: 0.1rem 0.1rem 0 rgba(255,255,255,0.3);
text-decoration: none;
outline: none;
input[type=text], textarea, select, input[type=button], input[type=file] {
/* Set font size in form elements too */
font-size: 1.3rem;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,100 +1,106 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Evopedia</title>
<meta name="description" content="Offline wikipedia reader">
<meta name="viewport" content="width=device-width">
<!--
Port of Evopedia (offline wikipedia reader) in HTML5/Javascript, with Firefox OS as the primary target
The original application is at http://www.evopedia.info/
It uses wikipedia dumps located at http://dumpathome.evopedia.info/dumps/finished
Author : Mossroy - mossroy@free.fr
Math image algorithm contributed by christian@evopedia.info
License:
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, see
<http://www.gnu.org/licenses/>.
-->
<link rel="stylesheet" href="css/mediawiki-main.css">
</head>
<body>
<h1>Evopedia</h1>
<input type="button" id="showHideAbout" value="About" />
<div id="about" style="display: none;">
This is a preliminary work on the port of Evopedia (offline wikipedia reader) in HTML5/Javascript, with Firefox OS as the primary target
<br />
The original application is at <a href="http://www.evopedia.info/">http://www.evopedia.info/</a>
<br />
<br />
To use it, you have to first download locally a dump from <a href="http://dumpathome.evopedia.info/dumps/finished">http://dumpathome.evopedia.info/dumps/finished</a> (with a Bittorrent client).
<br />
<ul>
<li>On desktops, it works on recent Firefox and Chrome, and maybe on other browsers. In this case, you have to select manually some files from your dump (see below)</li>
<li>On the Firefos OS simulator, you have to put the archive files in a "fake-sdcard" folder of your firefox profile (ex : ~/.mozilla/firefox/xxxx.default/extensions/r2d2b2g@mozilla.org/profile/fake-sdcard). It looks for file titles.idx in it. You need to install the application from the dashboard of the simulator (due to security restrictions in Firefox OS : only certified webapps can access the sdcard)</li>
<li>On a real Firefox OS device, you simply have to put the archive files anywhere in your sdcard, so that it finds titles.idx on it. For now, the application has to be installed manually (use the push feature of the Firefos OS Simulator)</li>
</ul>
<br />
It's still a beta version : there are many many ways this could be enhanced (suggestions and patches are welcome : the source code is on <a href="https://github.com/mossroy/evopedia-html5">github</a>). In particular :
<ul>
<li>The performance has to be optimized when searching titles and reading an article</li>
<li>Some searches (for example with prefix "a" on the French dump) do not give any result even if they should</li>
<li>In some cases, the links inside an article do not work, or do not lead to the right article</li>
<li>It is not easy to use on the Peak device from Geeksphone because the buttons and inputs are too small</li>
<li>Some features of the original application still have to be implemented : in particular geolocation of articles</li>
</ul>
The <a href="https://github.com/mossroy/evopedia-html5/issues">bugtracker</a> is on github too.
</div>
<div id="openLocalFiles" style="display: none;">
<br /> Please select the file titles.idx :<br /> <input type="file"
id="titleFile" /><br /> Please select the files wikipedia_*.dat
from the same dump :<br /> <input type="file" id="dataFiles" multiple />
<br /> Please select the file math.idx from the same dump:<br /> <input type="file"
id="mathIndexFile" /><br /> Please select the file math.dat from the
same dump:<br /> <input type="file" id="mathDataFile" /><br />
</div>
<div id="scanningForArchives" style="display: none;">
<br /> Scanning your sdcard for archives... Please wait <img src="img/spinner.gif" />
</div>
<div id="chooseArchiveFromLocalStorage" style="display: none;">
<br /> Please select the archive you want to use : <select id="archiveList"></select>
</div>
<br /> Find titles starting with :
<input type="text" id="prefix" value="" />&nbsp;
<input type="button" id="searchTitles" value="Search titles" />
<img id="searchingForTitles" src="img/spinner.gif" style="display: none;"/>
<br /> Choose a title from the filtered list :
<select id="titleList"></select>
<br />
<input type="button" id="readData" value="Read article from dump" />
<div id="readingArticle" style="display: none;">
Reading article <span id="articleName"></span> from dump... Please wait <img src="img/spinner.gif" />
</div>
<div id="articleContent">&nbsp;</div>
<hr />
<!-- Using require.js, a module system for javascript, include the
js files. This loads "main.js", which in turn can load other
files, all handled by require.js:
http://requirejs.org/docs/api.html#jsfiles -->
<script type="text/javascript"
data-main="js/init.js"
src="js/lib/require.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Evopedia</title>
<meta name="description" content="Offline wikipedia reader">
<meta name="viewport" content="width=device-width">
<!--
Port of Evopedia (offline wikipedia reader) in HTML5/Javascript, with Firefox OS as the primary target
The original application is at http://www.evopedia.info/
It uses wikipedia dumps located at http://dumpathome.evopedia.info/dumps/finished
Author : Mossroy - mossroy@free.fr
Math image algorithm contributed by christian@evopedia.info
License:
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, see
<http://www.gnu.org/licenses/>.
-->
<link rel="stylesheet" href="css/mediawiki-main.css">
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<h1>Evopedia</h1>
<input type="button" id="showHideAbout" value="About" />
<div id="about" style="display: none;">
This is a preliminary work on the port of Evopedia (offline wikipedia reader) in HTML5/Javascript, with Firefox OS as the primary target
<br />
The original application is at <a href="http://www.evopedia.info/">http://www.evopedia.info/</a>
<br />
<br />
To use it, you have to first download locally a dump from <a href="http://dumpathome.evopedia.info/dumps/finished">http://dumpathome.evopedia.info/dumps/finished</a> (with a Bittorrent client).
<br />
<ul>
<li>On desktops, it works on recent Firefox and Chrome, and maybe on other browsers. In this case, you have to select manually some files from your dump (see below)</li>
<li>On the Firefos OS simulator, you have to put the archive files in a "fake-sdcard" folder of your firefox profile (ex : ~/.mozilla/firefox/xxxx.default/extensions/r2d2b2g@mozilla.org/profile/fake-sdcard). It looks for file titles.idx in it. You need to install the application from the dashboard of the simulator (due to security restrictions in Firefox OS : only certified webapps can access the sdcard)</li>
<li>On a real Firefox OS device, you simply have to put the archive files anywhere in your sdcard, so that it finds titles.idx on it. For now, the application has to be installed manually (use the push feature of the Firefos OS Simulator)</li>
</ul>
<br />
It's still a beta version : there are many many ways this could be enhanced (suggestions and patches are welcome : the source code is on <a href="https://github.com/mossroy/evopedia-html5">github</a>). In particular :
<ul>
<li>The performance has to be optimized when searching titles and reading an article</li>
<li>Some searches (for example with prefix "a" on the French dump) do not give any result even if they should</li>
<li>In some cases, the links inside an article do not work, or do not lead to the right article</li>
<li>It is not easy to use on the Peak device from Geeksphone because the buttons and inputs are too small</li>
<li>Some features of the original application still have to be implemented : in particular geolocation of articles</li>
</ul>
The <a href="https://github.com/mossroy/evopedia-html5/issues">bugtracker</a> is on github too.
</div>
<div id="openLocalFiles" style="display: none;">
<br /> Please select the file titles.idx :<br /> <input type="file"
id="titleFile" /><br /> Please select the files wikipedia_*.dat
from the same dump :<br /> <input type="file" id="dataFiles" multiple />
<br /> Please select the file math.idx from the same dump:<br /> <input type="file"
id="mathIndexFile" /><br /> Please select the file math.dat from the
same dump:<br /> <input type="file" id="mathDataFile" /><br />
</div>
<div id="scanningForArchives" style="display: none;">
<br /> Scanning your sdcard for archives... Please wait <img src="img/spinner.gif" />
</div>
<div id="chooseArchiveFromLocalStorage" style="display: none;">
<br /> Please select the archive you want to use : <select id="archiveList"></select>
</div>
<br /> Find titles starting with :
<input type="text" id="prefix" value="" />&nbsp;
<input type="button" id="searchTitles" value="Search titles" />
<img id="searchingForTitles" src="img/spinner.gif" style="display: none;"/>
<br /><br /> Choose a title from the filtered list :
<select id="titleList"></select>
<br />
<br />
<input type="button" id="readData" value="Read article from dump" />
<div id="readingArticle" style="display: none;">
Reading article <span id="articleName"></span> from dump... Please wait <img src="img/spinner.gif" />
</div>
<div id="articleContent">&nbsp;</div>
<br />
<div id="navigationButtons">
<input type="button" id="btnBack" value="Back"/>
<input type="button" id="btnForward" value="Forward"/>
</div>
<!-- Using require.js, a module system for javascript, include the
js files. This loads "main.js", which in turn can load other
files, all handled by require.js:
http://requirejs.org/docs/api.html#jsfiles -->
<script type="text/javascript"
data-main="js/init.js"
src="js/lib/require.js"></script>
</body>
</html>

View File

@ -31,7 +31,12 @@ define(function(require) {
$('#prefix').on('keyup', function(e) {
onKeyUpPrefix(e);
});
$('#btnBack').on('click', function(e) {
history.back();
});
$('#btnForward').on('click', function(e) {
history.forward();
});
// Detect if DeviceStorage is available
var storage = null;