Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(255)

Issue 24071: Client Template Refactoring

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 11 months ago by levik
Modified:
16 years, 11 months ago
Reviewers:
shindig.remailer, Evan Gilbert (code review)
CC:
Evan Gilbert (code review), guitardave
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

Refactored a bunch of client-side templates (and some data pipelining) code in response to recent discussions and security review. More to come..

Patch Set 1 #

Total comments: 16

Patch Set 2 : Changes in response to Evan's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+707 lines, -506 lines) Patch
M features/src/main/javascript/features/opensocial-data-context/datacontext.js View 6 chunks +55 lines, -15 lines 0 comments Download
M features/src/main/javascript/features/opensocial-data/data.js View 35 chunks +48 lines, -47 lines 0 comments Download
M features/src/main/javascript/features/opensocial-templates/base.js View 1 11 chunks +29 lines, -21 lines 0 comments Download
M features/src/main/javascript/features/opensocial-templates/compiler.js View 1 24 chunks +76 lines, -112 lines 0 comments Download
M features/src/main/javascript/features/opensocial-templates/container.js View 7 chunks +56 lines, -16 lines 0 comments Download
D features/src/main/javascript/features/opensocial-templates/domutil.js View 1 chunk +0 lines, -164 lines 0 comments Download
M features/src/main/javascript/features/opensocial-templates/namespaces.js View 3 chunks +6 lines, -91 lines 0 comments Download
M features/src/main/javascript/features/opensocial-templates/os.js View 1 1 chunk +95 lines, -1 line 0 comments Download
M features/src/main/javascript/features/opensocial-templates/template.js View 1 3 chunks +20 lines, -1 line 0 comments Download
M features/src/main/javascript/features/opensocial-templates/util.js View 1 3 chunks +19 lines, -29 lines 0 comments Download
M features/src/main/javascript/features/xmlutil/xmlutil.js View 1 chunk +1 line, -1 line 0 comments Download
A features/src/test/javascript/features/opensocial-templates/domutil.js View 1 chunk +164 lines, -0 lines 0 comments Download
A features/src/test/javascript/features/opensocial-templates/index.html View 1 chunk +136 lines, -0 lines 0 comments Download
M features/src/test/javascript/features/opensocial-templates/template_test.js View 1 chunk +2 lines, -2 lines 0 comments Download
M features/src/test/javascript/features/opensocial-templates/util_test.js View 1 chunk +0 lines, -6 lines 0 comments Download

Messages

Total messages: 2
Evan Gilbert (code review)
http://codereview.appspot.com/24071/diff/1/8 File features/src/main/javascript/features/opensocial-templates/compiler.js (right): http://codereview.appspot.com/24071/diff/1/8#newcode107 Line 107: return src.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\w+|[^"'\w]+/g, Could you document this regex? http://codereview.appspot.com/24071/diff/1/8#newcode151 ...
16 years, 11 months ago (2009-03-09 18:02:44 UTC) #1
Evan Gilbert (code review)
16 years, 11 months ago (2009-03-10 17:52:28 UTC) #2
Committed...

http://codereview.appspot.com/24071/diff/1/8
File features/src/main/javascript/features/opensocial-templates/compiler.js
(right):

http://codereview.appspot.com/24071/diff/1/8#newcode216
Line 216: ret = void 0;
On 2009/03/09 21:10:12, levik wrote:
> On 2009/03/09 18:02:45, Evan Gilbert (code review) wrote:
> > Are you using this to return undefined instead of null?
> > 
> > If so, do you have a reference for this? I've seen "void(0)" used with URLs
> and
> > haven't seen "void 0". Want to make sure that browsers don't choke on this.
> > 
> > If we're not sure about the void syntax, might be easier to do direct return
> > statements (i.e. "return;")
> 
> void is a unary operator that returns "undefined", so void(0) === void 0.
> 
> More info here:
>
https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Spec...
> 

I'm going to check this in with void(0) because I'm a little concerned about
browser support - I haven't seen this construct used much while I've seen
href="javascript:void(0)" frequently. If "void 0" is a better syntax and you're
confident in browser support, let me know and I'll switch.

http://codereview.appspot.com/24071/diff/1/14
File features/src/main/javascript/features/opensocial-templates/container.js
(right):

http://codereview.appspot.com/24071/diff/1/14#newcode83
Line 83: os.Container.disableAutoProcessing = function() {
On 2009/03/09 21:10:12, levik wrote:
> On 2009/03/09 18:02:45, Evan Gilbert (code review) wrote:
> > Usually cleaner to have setAutoProcessing(true|false).
> 
> I specifically wanted this to be a one-way toggle - enabling auto processing
is
> ambiguous. If you disable it, you have to do it manually (by calling
.process()
> ) at a later time.

Checking in for now, but still think the set would be better. Every time I've
had a one-way boolean set I always end up needing the other - for example, if
the gadget sets "disableAutoProcessing = true", but one view wants
auto-processing, there's no way to handle this.

Not sure what the ambiguity is - setAutoProcessing(true) seems pretty clear.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b