GithubHelp home page GithubHelp logo

froilanq / google-jstemplate Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 104 KB

Automatically exported from code.google.com/p/google-jstemplate

License: Apache License 2.0

JavaScript 74.69% HTML 25.31%

google-jstemplate's People

Contributors

gmesch avatar xmbrst avatar

Watchers

 avatar

google-jstemplate's Issues

jsselect to loop over object properties

For data:
var tplData = {username:"Jane User",
                    addresses:{
                      primary: {location:"111 8th Av.", label:"NYC front door"},
                      2: {location:"76 9th Av.", label:"NYC back door"},
                      3: {location:"Mountain View", label:"Mothership"}
                     }
                    };


It should be possible to loop over addresses with jsselect. 
Not sure if $index should contain the property name or they should be 
additional $key variable.

Original issue reported on code.google.com by [email protected] on 29 Nov 2012 at 12:38

jsvalues cannot contain ';' even inside strings

What steps will reproduce the problem?
1. Construct a template using something like <span id="template"
jsvalues="$options:'a;b;c'.split(';')"><span jsselect="$options"
jscontent="$this" /></span>
2. call jstProcess(new JsEvalContext({}), document.getElementById('template'))

You should get a stack of three spans <span>a</span>...b...c...

Instead, this template is not processed because the expression dies at ';',
and what's left is a syntax error.  I assume this is because the expression
is split with ';' with no regard to string boundaries.

I'm using svn r9, FF3/Ubuntu8.04.

I am working around this by using '|' instead.  I can imagine a scenario in
which this workaround would not be practical, though.

Original issue reported on code.google.com by [email protected] on 30 Sep 2008 at 9:22

Unnecessary object creation in jseval

util.js has the following comment
    // NOTE(mesch): An alternative idiom would be:
    //
    //   eval('(' + expr + ')');
    //
    // Note that using the square brackets as below, "" evals to undefined.
    // The alternative of using parentheses does not work when evaluating
    // function literals in IE.
    // e.g. eval("(function() {})") returns undefined, and not a function
    // object, in IE.

This is correct, but the solution:
    return eval('[' + expr + '][0]');
creates an immediately discarded array object even on interpreters that do
not have IE's bug.

An alternative which creates fewer objects is:
    return eval('0,(' + expr + ')');

Moving the strings '0,(', and ')' out of the function body will create
fewer string objects too.

Original issue reported on code.google.com by [email protected] on 12 Jan 2009 at 8:20

jscontent can't output HTML

Is there really a reason not to provide at least possibility to do it with 
awareness that it should not output nodes with js* parameters ?

thx

Original issue reported on code.google.com by [email protected] on 27 Feb 2013 at 8:28

jsselect reorders, breaks expectations about form-order vs. doc-order fields

What steps will reproduce the problem?
 1. use a jsselect inside a <form>, on an <input>.  The <input> should have
a constant 'name' attribute, such that document.formxx.field_name is an
array of fields with that name.  (See attached html file.) 
 2. call jstProcess on the form, to duplicate that field several times.
 3. compare document order and the order in the formxx.field_name array.

Expected: The two alerts should be the same, in my test page.

Actual: As RAtM (and Luke) said, "the last shall be first".


I'm using svn r9, FF3/Ubuntu8.04.


It is very common for apps to use document.formxx.field_name[n] where more
than one field has the same name 'field_name'.  Referenced through
formxx.field_name, these fields are in order by how early they were created
(chronologically), *not* in document order.  jsselect's use of
domInsertBefore shifts the order backwards 1 slot, placing the 0'th element
at the end of the form.name array.

Original issue reported on code.google.com by [email protected] on 20 Sep 2008 at 9:01

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.