Skip to content

Commit

Permalink
fix a bug for IE7, and some minor code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
pure committed Sep 30, 2012
1 parent ceea63d commit b3db791
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
22 changes: 11 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<a href="http://github.com/pure/pure/tree/version2" style="float:right;margin:1em">Project site &amp; Download</a>
<div id="chooseLib">
Choose a library to run the examples with:<br />
<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>
<a class="lib" href="javascript:" onclick="loadLib('dojo');">dojo</a>
<a class="lib" href="javascript:" onclick="loadLib('domassistant');">DomAssistant</a>
<a class="lib" href="javascript:" onclick="loadLib('jquery');">jQuery</a>
<a class="lib" href="javascript:" onclick="loadLib('mootools');">Mootools</a>
<a class="lib" href="javascript:" onclick="loadLib('prototype');">Prototype</a>
<a class="lib" href="javascript:" onclick="loadLib('sizzle');">Sizzle</a>
<a class="lib" href="javascript:" onclick="loadLib('sly');">Sly</a> -
<a class="lib" href="javascript:" onclick="loadLib('pure');">PURE Alone (modern browsers only)</a>
<p>Or look at the source code of the tutorials:</p>
<ul>
<li>Automatic rendering(autoRender):
Expand Down Expand Up @@ -184,7 +184,7 @@ <h3>7. Recursion</h3>
<div class="template">
<ul class="treeItem">
<li>
<a class="name" href="javascript:void(0)">name</a>
<a class="name" href="javascript:">name</a>
<div class="children"></div>
</li>
</ul>
Expand All @@ -203,7 +203,7 @@ <h3>8. Reuse a template and load JSONP data every sec</h3>
In <span class="tz"></span>
</div>
</div>
<p><a href="javascript:void(0)" onclick="clearTimeout(_to);">stop it!</a></p>
<p><a href="javascript:" onclick="clearTimeout(_to);">stop it!</a></p>

</li>

Expand All @@ -227,7 +227,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="javascript:void(0)" onclick="clearTimeout(_to10);this.style.visibility='hidden';">stop it!</a>
<a href="javascript:" onclick="clearTimeout(_to10);this.style.visibility='hidden';">stop it!</a>
</li>

<li class="ex10">
Expand Down
4 changes: 2 additions & 2 deletions js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var loadLib, runAll, run, transform;
//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="javascript:void(0)" onclick="runAll(this);">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:" onclick="runAll(this);">all at once</a><br />';
document.getElementById( 'examples' ).style.display = 'block';

var lis = $p( 'ul.exampleList li' ),
Expand All @@ -70,7 +70,7 @@ var loadLib, runAll, run, transform;
window[cn].id = cn;
span.id = cn;
span.innerHTML =
'<a class="run" href="javascript:void(0)" onclick="run(this, '+cn+');">Run</a>';
'<a class="run" href="javascript:" onclick="run(this, '+cn+');">Run</a>';
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions libs/pure.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Copyright (c) 2012 Michael Cvilic - BeeBole.com
Thanks to Rog Peppe for the functional JS jump
revision: 2.77
revision: 2.78
*/

var $p = function(){
Expand Down Expand Up @@ -308,7 +308,7 @@ $p.core = function(sel, ctxt, plugins){
attName = isClass ? 'className' : attr;
setstr = function(node, s) {
node.setAttribute(attPfx + attr, s);
if ( node.hasOwnProperty(attName) && !isStyle) {
if ( node[attName] && !isStyle) {
try{node[attName] = '';}catch(e){} //FF4 gives an error sometimes
}
if (node.nodeType === 1) {
Expand Down
8 changes: 4 additions & 4 deletions libs/pure_min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions tutorial/fp.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>

<html>
<head>
Expand Down
2 changes: 1 addition & 1 deletion tutorial/tuto8.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<body>
<ul class="treeItem">
<li>
<a class="name" href="javascript:void(0)">name</a>
<a class="name" href="javascript:">name</a>
<div class="children"></div>
</li>
</ul>
Expand Down

0 comments on commit b3db791

Please sign in to comment.