Skip to content

Commit

Permalink
added support for <ul> and <ol>
Browse files Browse the repository at this point in the history
  • Loading branch information
haggen committed May 5, 2012
1 parent 688baec commit b193458
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
15 changes: 15 additions & 0 deletions fixie.js
Expand Up @@ -115,6 +115,11 @@ function () {
element.src = "http://placehold.it/" + width + "x" + height;
break;

case 'ol':
case 'ul':
element.innerHTML = fixie_fetchList();
break;

default:
element.innerHTML = fixie_fetchSentence();
return false;
Expand Down Expand Up @@ -174,6 +179,16 @@ function () {
}
return fixie_str;
}

function fixie_fetchList() {
var i, n = Math.random() * 4 + 4, list = [];

for(i = 0; i < n; i++) {
list.push(fixie_fetchPhrase());
}

return '<li>' + list.join('</li><li>') + '</li>';
}



Expand Down
12 changes: 7 additions & 5 deletions sample.html
Expand Up @@ -26,11 +26,13 @@ <h1 class="fixie"></h1>
<p>Don't forget to view source.</p>
<p></p>
<img/>
<p></p>
<p></p>
</section>
<h2 class="fixie"></h2>
<section class="fixie"></section>
<ul></ul>
<p></p>
<ol></ol>
<p></p>
</section>
<h2 class="fixie"></h2>
<section class="fixie"></section>
</article>

<script type="text/javascript" src="fixie.js"></script>
Expand Down

0 comments on commit b193458

Please sign in to comment.