pure / pure
- Source
- Commits
- Network (26)
- Issues (2)
- Downloads (0)
- Wiki (3)
- Graphs
-
Branch:
master
-
Here is code snippet which reproduces the problem. Run it in Safari/Chrome and it passes run it in FF and it fails. The <a> tag seems to confuse pure.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="http://github.com/pure/pure/raw/master/libs/pure.js"></script> <script> $(document).ready(function(){ $("div"). append("<a><h1></h1><div>abc</div></a>"). autoRender({names:['a','b']}, { 'a':{ 'name <- names':{'h1':'name'} } }); $("body").append("Expected 2 elements got: " + $("div").children().size()); }); </script> </head> <body> <div></div> </body> </html>Comments
-
I use Pure for observing the next template:
var pattern = '
- <br/>
<LI class="children docType@class id@id" ><B class="docType@class">\ <SPAN class="id">id</SPAN>\ <SPAN class="text text@title">name</SPAN>\ </B></LI>\ </UL>'and use the next code for this:
var strObj = null; var directive = { 'li+':function(arg){ if ( typeof arg.item == 'object'){ if( typeof arg.item.children == 'object' ){ return $p.compiledFunctions.tree.compiled(arg.item); } } } }; jQuery(pattern).compile('tree', directive, data); strObj = jQuery(pattern).render(data, 'tree');It's work perfect in all browsers except IE8 SP3. In process of debuginng I've found out that the problem is in nodeWalk function.
It doesn't include additoinal text like it does in FF.
Something like 'repeat source="' and so on...Comments
Which version are you using?
To check this issue would you mind to setup a small html page(here or friendpaste) with the html and some json data.Thank you for your answer!
I'm using revision: 1.34 of Pure, IE 8.0.6001.18702 on windows XP SP3 with all the updates up to date.
There is an example which is not working in IE8<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
var data = {'children' : [{ 'text': 'root', 'id': 0, 'docType': 'root', 'children': [{ 'text':'Europe', 'id': 1, 'children':[{ 'text':'Belgium', 'id': 11, 'children':[{ 'text':'Brussels','id':111, 'docType': 'doc'},{ 'text':'Namur','id':112, 'docType': 'doc'},{ 'text':'Antwerpen','id':113, 'docType': 'doc'}]},{ 'text':'Germany', 'id':12, 'docType': 'doc'},{ 'text':'UK', 'id':13, 'docType': 'doc'} ]},{ 'text':'America', 'id': 2, 'children':[{ 'text':'US', 'id': 21, 'children':[{ 'text':'Alabama', 'id':211, 'docType': 'doc'},{ 'text':'Georgia', 'id':212, 'docType': 'doc'} ]},{ 'text':'Canada', 'id':22, 'docType': 'doc'},{ 'text':'Argentina', 'id':23, 'docType': 'doc'}]},{ 'text':'Asia', 'id':3 },{ 'text':'Africa', 'id':4 },{ 'text':'Antartica', 'id':5 }]}]} var pattern = '<UL>\ <LI class="children docType@class id@id" ><B class="docType@class">\ <SPAN class="id">id</SPAN>\ <SPAN class="text text@title">name</SPAN>\ </B></LI>\ </UL>'var strObj = null; var directive = {
'li+':function(arg){ if ( typeof arg.item == 'object'){ if( typeof arg.item.children == 'object' ){ return $p.compiledFunctions.tree.compiled(arg.item); } } }}; jQuery(pattern).compile('tree', directive, data); strObj = jQuery(pattern).render(data, 'tree'); document.write(strObj.wrapAll('').parent('div').html());
Don't know what is the right way to insert a source code here. So here is a link to the test page: http://html.epage.com.ua/pure/test.html
You can use http://gist.github.com to insert code.
Somehow your comment was set as read, while I didn't see it... sorry for the late reply.
It is better to use the google group when things get wrong.
http://groups.google.com/group/Pure-Unobtrusive-Rendering-EngineFew days ago, I've set the version 2 as the default version now.
Here's an example of recursion in the new version: http://gist.github.com/250157
Don't worrry it was one of two messages I've sent you together and you have replyed to the main one very quickly. And you have really read the second one but there were not any questions there was only a link to the test page.
Anyway I could use code insertion in the future if I will need it. -
autoRender() method clears the values of all the input fields.
1 comment Created 2 months ago by lenzinothe autoRender() method clears the values of all the input fields within the selected form.
Comments
-
The demos on the home page
http://beebole.com/pure/
.. all seemed to work except for jQuery: http://beebole.com/pure/pure-for-jquery.htmlComments
-
Change line 197 of pure2.js:
var m = sel.match(/^(\w+)(.(\w+))*$/);Comments
-
autoRender with an img causes 2nd call to our Django view
2 comments Created 4 months ago by beeboleFirst off - forgive me, for I am anything but a front end guy (our front end guys are out of town, stuck in an airport cause their flight home from An Event Apart was cancelled).
We have a bug in which our django view is being called multiple times. The second call is ultimately being issued from an image tag. Several hours of hunting has led my coworker and I to believe Pure's autorender of the image tag is causing a second request. Our hypothesis is that Pure is adding an tag to the DOM, and only after it's added to the DOM is the src"" attribute applied to the image.
The image tag in question:
Is our hypothesis accurate? Could this be happening? We've experienced this behaviour consistently with Safari 4, FF3 and Chrome (but not IE7).
The JSON we're using to populate and render the template has a photoUrl for each item, and the final rendered DOM has that image. This is our best guess over the nearly 6 hours we've been banging our heads together. Thoughts?
Thanks.
Ryan
Comments
Hi Ryan,
First of all, I'm terribly sorry for both: the delay of my answer and the hours you lost on this.
I didn't figure out how to get a proper alerting system with lighthouse.
There is no intermediary DOM insertion during the rendering.
May be the template before transformation have a "src" attribute set to a value.
This would call a first image, and then after transforming with the proper image url a second call would occur. Were you using the version 2 or 1 ?
I guess this is quite out of date. Sorry again.Mic
-
FF and IE reacts differently when a space appears in attributes
1 comment Created 4 months ago by beeboleAction: Check if spaces should not be escaped as
Comments
-
'null' class added when there is no existing class attribute
2 comments Created 5 months ago by xycodexwhen i have a directive to inject a class attribute, and there is no class attribute on the html node already, a 'null' will appear as one of the classes.
seen in version 2.0.7.Comments
I can't reproduce it with 2.08 in the example below.
http://friendpaste.com/KSbu4xgvVzrpqXwq8W3YhPlease look if there is a difference with what you try to get.
Thanks for reporting.Mic
-
None of the demos work, and I can't figure out how to contact the creator...
Firefox 3, Firebug, YSlow
None of these work:
http://wiki.github.com/pure/pure/basic-hello-who
http://wiki.github.com/pure/pure/iteration
http://wiki.github.com/pure/pure/iteration-and-attributes"jQuery.parse is undefined", "$("#players1").autoRender is not a function"
Comments






Surprising, I'll check it out.
Thanks for reporting.
Something weird happens in FF.
Look at this example, DOM manipulation only: http://gist.github.com/258145
FF adds an 'a' tag when using innerHTML on the H1.
If you try with jquery only, the same happen:
$('div').find('h1').get(0).innerHTML = 'some H1';
There is an some H1 that appears.
Got it! Github is updated with the revision 2.27
Thanks.