Skip to content

Commit

Permalink
AutoAttributes for input/img. Upgrade prototype.void the hrefs in the…
Browse files Browse the repository at this point in the history
… examples.
  • Loading branch information
beebole committed Sep 17, 2009
1 parent 673b451 commit 62d0c14
Show file tree
Hide file tree
Showing 5 changed files with 1,621 additions and 1,041 deletions.
40 changes: 29 additions & 11 deletions index.html
Expand Up @@ -19,19 +19,21 @@
<a href="http://github.com/pure/pure/tree/version2" style="float:right">Project site &amp; Download</a>
<div id="chooseLib">
Choose a library to run the examples with:<br />
<a class="lib" href="#" onclick="loadLib('dojo');return false;">dojo</a>
<a class="lib" href="#" onclick="loadLib('domassistant');return false;">DomAssistant</a>
<a class="lib" href="#" onclick="loadLib('jquery');return false;">jQuery</a>
<a class="lib" href="#" onclick="loadLib('mootools');return false;">Mootools</a>
<a class="lib" href="#" onclick="loadLib('prototype');return false;">Prototype</a>
<a class="lib" href="#" onclick="loadLib('sizzle');return false;">Sizzle</a>
<a class="lib" href="#" onclick="loadLib('sly');return false;">Sly</a> -
<a class="lib" href="#" onclick="loadLib('pure');return false;">PURE Alone (modern browsers only)</a>
<a class="lib" href="javascript:void(0)" onclick="loadLib('dojo');">dojo</a>
<a class="lib" href="javascript:void(0)" onclick="loadLib('domassistant');">DomAssistant</a>
<a class="lib" href="javascript:void(0)" onclick="loadLib('jquery');">jQuery</a>
<a class="lib" href="javascript:void(0)" onclick="loadLib('mootools');">Mootools</a>
<a class="lib" href="javascript:void(0)" onclick="loadLib('prototype');">Prototype</a>
<a class="lib" href="javascript:void(0)" onclick="loadLib('sizzle');">Sizzle</a>
<a class="lib" href="javascript:void(0)" onclick="loadLib('sly');">Sly</a> -
<a class="lib" href="javascript:void(0)" onclick="loadLib('pure');">PURE Alone (modern browsers only)</a>
</div>

<div id="examples">
<ul class="exampleList">



<li class="ex01">
<h3>1. Hello World</h3>

Expand All @@ -41,6 +43,8 @@ <h3>1. Hello World</h3>

</li>



<li class="ex02">
<h3>2. Hello World with directives</h3>

Expand All @@ -52,6 +56,8 @@ <h3>2. Hello World with directives</h3>

</li>



<li class="ex03">
<h3>3. Auto Rendering with loops (+ directives)</h3>

Expand All @@ -68,6 +74,8 @@ <h3>3. Auto Rendering with loops (+ directives)</h3>

</li>



<li class="ex04">
<h3>4. Loop on a table and events</h3>

Expand All @@ -88,6 +96,8 @@ <h3>4. Loop on a table and events</h3>

</li>



<li class="ex05">
<h3>5. Dynamic table</h3>

Expand All @@ -108,6 +118,8 @@ <h3>5. Dynamic table</h3>

</li>



<li class="ex06">
<h3>6. Nested loops</h3>

Expand Down Expand Up @@ -143,19 +155,23 @@ <h3>6. Nested loops</h3>

</li>



<li class="ex07">
<h3>7. Recursion</h3>

<div class="template">
<ul class="treeItem">
<li>
<a class="name" href="#">name</a>
<a class="name" href="javascript:void(0)">name</a>
<div class="children"></div>
</li>
</ul>
</div>

</li>



<li class="ex08">
<h3>8. Reuse a template and load JSONP data every sec</h3>
Expand All @@ -166,10 +182,12 @@ <h3>8. Reuse a template and load JSONP data every sec</h3>
In <span class="tz"></span>
</div>
</div>
<p><a href="#" onclick="clearTimeout(_to);return false;">stop it!</a></p>
<p><a href="javascript:void(0)" onclick="clearTimeout(_to);">stop it!</a></p>

</li>



<li class="ex09">
<style>
.ex09 table { border:1px solid #999; text-align:left; border-collapse:collapse;}
Expand All @@ -188,7 +206,7 @@ <h3>9. World Indices: dynamic table, reuse a template and JSONP load every 10 se
<tbody><tr><td></td></tr></tbody>
</table>
</div>
<a href="#" onclick="clearTimeout(_to10);this.style.visibility='hidden';return false;">stop it!</a>
<a href="javascript:void(0)" onclick="clearTimeout(_to10);this.style.visibility='hidden';">stop it!</a>
</li>

<li class="ex10">
Expand Down
11 changes: 7 additions & 4 deletions js/index.js
Expand Up @@ -45,7 +45,7 @@ var loadLib, runAll, run;
//initialise the lib
currLib !== 'pure' && $p.libs[currLib]();

document.getElementById( 'libLoaded' ).innerHTML = '<b>'+ currLib + '</b> is loaded<br />You can run the examples below individually or <a href="#" onclick="runAll(this);return false;">all at once</a><br />';
document.getElementById( 'libLoaded' ).innerHTML = '<b>'+ currLib + '</b> is loaded<br />You can run the examples below individually or <a href="javascript:void(0)" onclick="runAll(this);">all at once</a><br />';
document.getElementById( 'examples' ).style.display = 'block';

var lis = $p( 'ul.exampleList li' ),
Expand All @@ -71,7 +71,7 @@ var loadLib, runAll, run;
window[cn].id = cn;
span.id = cn;
span.innerHTML =
'<a class="run" href="#" onclick="run(this, '+cn+');return false;">Run</a>';
'<a class="run" href="javascript:void(0)" onclick="run(this, '+cn+');">Run</a>';
}
}
}
Expand Down Expand Up @@ -128,6 +128,8 @@ var loadLib, runAll, run;
old = document.getElementById('sourceCodes'),
src = document.createElement('DIV'),
srcNb = 0,
txtShow = 'Show Source',
txtHide = 'Hide Source',
addSrc = function(title, source){
srcNb++;
var t = document.createElement('DIV'),
Expand All @@ -140,6 +142,7 @@ var loadLib, runAll, run;
src.appendChild(tt);
};
if(old){
$p('a', old.parentNode)[0].innerHTML = txtShow;
old.parentNode.removeChild(old);
}
src.id = 'sourceCodes';
Expand All @@ -153,9 +156,9 @@ var loadLib, runAll, run;
src.className = 'cols' + srcNb;
li.parentNode.insertBefore(src, li);
var oldClick = a.onclick;
a.innerHTML = 'Hide Source';
a.innerHTML = txtHide;
a.onclick = function(){
a.innerHTML = 'Show Source';
a.innerHTML = txtShow;
try{li.parentNode.removeChild(src);}catch(e){};//IE fails sometimes on it
a.onclick = oldClick;
return false;
Expand Down

0 comments on commit 62d0c14

Please sign in to comment.