Skip to content

Commit

Permalink
Hello, my dear friends. My name is {{ navigator.epubReadingSystem.nam…
Browse files Browse the repository at this point in the history
…e }}.

Does not work in the bundled readium-js-viewer. Does work in the Readium
Chrome extension. Bug report: readium/readium-js-viewer#13

Checks for the existence of the navigator.epubReadingSystem property;
so the reader knows if they knows something about themself:
if not, they leave the text alone.
  • Loading branch information
codingisacopingstrategy committed Nov 30, 2013
1 parent d8de6d9 commit 79cb39d
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 0 deletions.
16 changes: 16 additions & 0 deletions public/epub_content/self-conscious-epub/EPUB/nav.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<meta charset="utf-8">
</meta>
<link rel="stylesheet" type="text/css" href="style.css" class="day" title="day"/>
</head>
<body>
<nav epub:type="toc" id="toc">
<ol>
<li><a href="self-conscious-content.xhtml">Self-conscious ePub</a></li>
</ol>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<meta charset="utf-8">
</meta>
<title>self-conscious.epub</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<section id="intro">Hello, my dear friends. My name is {{ navigator.epubReadingSystem.name }}.</section>
<script type="text/javascript">
<![CDATA[
var adaptTextToReader = function() {
var intro = document.getElementById("intro");
intro.innerHTML = intro.innerHTML.replace("{{ navigator.epubReadingSystem.name }}", navigator.epubReadingSystem.name);
};

// if the Reading System knows about itself:
if (navigator && navigator.hasOwnProperty('epubReadingSystem')) {
// launch scripts:
adaptTextToReader();
}
]]>
</script>
</body>
</html>
22 changes: 22 additions & 0 deletions public/epub_content/self-conscious-epub/EPUB/self-conscious.opf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xml:lang="en-US" prefix="cc: http://creativecommons.org/ns#">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:identifier id="uid">osp.constantvzw.org.workshop.self-conscious-design.self-conscious-epub</dc:identifier>
<dc:title>Self-conscious ePub</dc:title>
<dc:creator>Eric Schrijver for OSP Open Source Publishing</dc:creator>
<dc:language>en-GB</dc:language>
<dc:date>2013-11-25</dc:date>
<meta property="dcterms:modified">2013-11-30T18:29:03.237Z</meta>
<dc:rights>This work is shared with the public using the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.</dc:rights>
<link rel="cc:license" href="http://creativecommons.org/licenses/by-sa/3.0/"/>
</metadata>
<manifest>
<item id="t1" href="self-conscious-content.xhtml" media-type="application/xhtml+xml" properties="scripted" />
<item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item id="cover" href="wasteland-cover.jpg" media-type="image/jpeg" properties="cover-image" />
<item id="css" href="style.css" media-type="text/css" />
</manifest>
<spine>
<itemref idref="t1" />
</spine>
</package>
57 changes: 57 additions & 0 deletions public/epub_content/self-conscious-epub/EPUB/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@charset "UTF-8";
@namespace "http://www.w3.org/1999/xhtml";
@namespace epub "http://www.idpf.org/2007/ops";

body {
margin-left: 6em;
margin-right: 16em;
color: black;
font-family: times, 'times new roman', serif;
background-color: rgb(255,255,245);
line-height: 1.5em;
}

h2 {
margin-top: 5em;
margin-bottom: 2em;
}

h3 {
margin-top: 3em;
}

.linegroup {
margin-top: 1.6em;
}

span.lnum {
float: right;
color: gray;
font-size : 90%;
}

a.noteref {
color: rgb(215,215,195);
text-decoration: none;
margin-left: 0.5em;
margin-right: 0.5em;
}

section#rearnotes a {
color: black;
text-decoration: none;
border-bottom : 1px dotted gray;
margin-right: 0.8em;
}

.indent {
padding-left: 3em;
}

.indent2 {
padding-left: 5em;
}

*[epub|type~='dedication'] {
padding-left: 2em;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
<rootfiles>
<rootfile full-path="EPUB/self-conscious.opf"
media-type="application/oebps-package+xml"/>
</rootfiles>
</container>
1 change: 1 addition & 0 deletions public/epub_content/self-conscious-epub/mimetype
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
application/epub+zip

0 comments on commit 79cb39d

Please sign in to comment.