Skip to content

Commit

Permalink
Starting to work on Waker custom tags.
Browse files Browse the repository at this point in the history
The idea of Waker custom tags is to provide an easy way to create
magazine-like stuff, such as the end mark at the end of each story.

It's much easier to use something like <w:end /> than a huge block of
HTML and CSS. This commit has two dummy tags: <w:end> and <w:qr> (for
QR code).
  • Loading branch information
Dovyski committed Jun 29, 2012
1 parent 7310519 commit 85a7fef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dossier-01.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@ <h1>Waker: build HTML5 magazines!</h1>
</div>
<p>Why the heck have you created another mobile magazine-like stuff if there are several projects out there such as <a href="https://github.com/ffranke/Laker-Compendium" target="_blank">Laker</a> and <a href="https://github.com/Simbul/baker" target="_blank">Laker</a>?</p>
<p>Because I thought they could not (easily) do what I wanted to do. I decided to create an eletronic magazine for a Computer Science course, but it had to be available in a variety of forms: online/offline accessed by a desktop or mobile browser and offline as the content of a non-web app.</p>
<p>I also needed something that allowed me to focus on the content itself, not its organization. I did not want to create all page links manually (navigation bar, index page, etc). I wanted minimum effort and maximum content propagation. I wanted something that were smooth in a browser and easily packagable as an app.</p>
<p>I also needed something that allowed me to focus on the content itself, not its organization. I did not want to create all page links manually (navigation bar, index page, etc). I wanted minimum effort and maximum content propagation. I wanted something that were smooth in a browser and easily packagable as an app. <w:end/></p>
</div>
2 changes: 1 addition & 1 deletion dossier-02.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@ <h1>Tell Waker about the page you created</h1>

<p>The content of the <code>&lt;a&gt;</code> tag (text between <code>&lt;a&gt;</code> and <code>&lt;/a&gt;</code>) will be used as a short description of the page. This text is displayed below the page title in the index.</p>

<p>The page of the first link listed in <code>config.html</code> will be used as the <strong>cover page</strong> (first page of the magazine).<span class="end-mark">&diams;</span></p>
<p>The page of the first link listed in <code>config.html</code> will be used as the <strong>cover page</strong> (first page of the magazine).<w:end /></p>
</div>
12 changes: 11 additions & 1 deletion waker/js/waker.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,24 @@ var Waker = new function() {
*/
var pageLoaded = function(theData) {
$('#content').html(theData);
$('#content').fadeIn("fast");
parseCustomTags();

$('#content').fadeIn("fast");
showLoading(false, Waker.closeToc);
updateNavBar();

document.title = mPages[mCurrentPage].title;
};

/**
* TODO: write docs :)
*/
var parseCustomTags = function() {
// TODO: handle each tag appropriately.
$('#content w\\:end').html('<span class="end-mark">&diams;</span>');
$('#content w\\:qr').html('<img src="https://chart.googleapis.com/chart?chs=300x300&cht=qr&chl=Hello+world&chld=L|1&choe=UTF-8" title=""/>');
};

/**
* Callback function invoked when a page could not be loaded. It happens
* when a wrong entry is placed in the "config.html" file.
Expand Down

0 comments on commit 85a7fef

Please sign in to comment.