[Sputnik-list] "Messages" section
Jim Whitehead II
jnwhiteh at gmail.com
Fri Mar 7 20:04:30 GMT+2 2008
On 3/7/08, Yuri Takhteyev <yuri at sims.berkeley.edu> wrote:
> > The attached patch changes the sputnik core to allow for a style
> > content box called "messages". In order for a node to add messages to
> > the standard wiki.show output, it simply uses the following syntax:
> >
> > node.messages = node.messages or {}
> > table.insert(node.messages, "Some error/status message here")
>
> Great. Now that we are at it, though, should we make the messages
> typed ("error", "success", "warning") and make them compatible with
> blueprint?
Okay, shall we have an API for this specifically, or shall we just
make the elements of the table arrays:
table.insert(node.messages, {"error", "some error message here"})
versus
node:message("error", "Some error here")
> Blueprint provides classes ".notice", ".error" and ".success" and I
> think they assume that each message is a paragraph or a div.
> Blueprint makes sure they come out in appropriate colors.
Is Blueprint being used in the default installation right now? I
didn't see any signs of it, so I wasn't sure how you would like this
styled. I'll continue to work on this in a branch.
> > As for implementation details, the messages table could be created in
> > the root prototype, but I more wanted to raise the idea than suggest a
> > specific implementation. Is something like this reasonable and within
> > the scope of something you'd be okay with?
>
> Not sure what you mean with the root prototypes (you are not intending
> to _store_ those messages, right?), but yes, this is something that I
> want in the core - just haven't gotten around to implementing.
No, don't want them stored.. not sure what API is appropriate for this
sort of thing.
> BTW, I heard back from Johan about the bug in the gitorious UI, and
> added both you and Pierre as committers. For non-core stuff like the
> luasql backend (or the blueprint templates), feel to commit as you
> like. Same for obvious bugs in the core. Fore more substantial
> changes, let's discuss first for now. Sérgio, you want to be in on
> the fun?
Anything I commit will be done in a branch and pushed (or submitted
via a patch) until I'm more comfortable with how you want things to
work and look :P. Honestly, I'm a pretty good code monkey, if you
give me the desired API or inner workings, I can make the rest of it
work 99% of the time :P.
That being said, how would you prefer we add a message to a node?
What do you envision?
Also, it seems you used spaces (not tabs) set at three spaces width.
Is this correct (need to alter my vim settings so I don't clobber the
indentation you have.
- Jim
More information about the Sputnik-list
mailing list