Giter VIP home page Giter VIP logo

Comments (2)

Iheartweb avatar Iheartweb commented on September 1, 2024

@Jimgskoop I am starting to heavily consider folding Loader into Container as well. The reason is this.

Lets say you have a carousel with 5 items. In this Carousel the first two items have static content and are stateful - SO, they should be managed by Container.

But what if the remaining items have dynamic content? - This should obviously be managed by Loader. But, does this also mean that we have two separate client-side templates for Container and Loader? They would be virtually identical.

I'd rather do something like this:

{#items}
{@if cond="{idx} < 3}
 {>item content="Lorem Ipsum"}
 {else}
 {>item uri="http://www.google.com#node"}
 {/else}
{/if}
{/items}

Where item has a config that looks something like:

{
  'Container': {
    {?url}'url': {url} {/url}
    {?content}'content': {content} {/content}
  }
}

We could do the same type of logic and still keep Loader and container separate but it gets nasty:

{
  {?url}'Loader'{url} {/url} {?content}'Container'{content} {/content}: {
    {?url}'url': {url} {/url}
    {?content}'content': {content} {/content}
}

What if both url and content are defined? -- You'd have to introduce more logic into the template to make sure that's not the case. - This is better done in the control.

from lu.

Jimgskoop avatar Jimgskoop commented on September 1, 2024

That sounds OK to me. Container already knows how to source content
from elsewhere in the DOM; Loader just adds on the XHR and iframe
smarts.

My thinking was that any URL supercedes any local source if both are
present, but admittedly that's not ideal.

The only caveat is that you'll probably need distinct config params
for string, node, and URL for the source, in case you want to do
something like inject a URL as a string to display.

-Jim G

On Apr 14, 2012, at 11:14 AM, Robert Martone <[email protected]

wrote:

@Jimgskoop I am starting to heavily consider folding Loader into
Container as well. The reason is this.

Lets say you have a carousel with 5 items. In this Carousel the
first two items have static content and are stateful - SO, they
should be managed by Container.

But what if the remaining items have dynamic content? - This should
obviously be managed by Loader. But, does this also mean that we
have two separate client-side templates for Container and Loader?
They would be virtually identical.

I'd rather do something like this:

{#items}
{@if cond="{idx} < 3}
{>item content="Lorem Ipsum"}
{else}
{>item uri="http://www.google.com#node"}
{/else}
{/if}
{/items}

Where item has a config that looks something like:

{
 'Container': {
   {?url}'url': {url} {/url}
   {?content}'content': {content} {/content}
 }
}

We could do the same type of logic and still keep Loader and
container separate but it gets nasty:

{
 {?url}'Loader'{url} {/url} {?content}'Container'{content} {/ 
content}: {
   {?url}'url': {url} {/url}
   {?content}'content': {content} {/content}
}

What if both url and content are defined? -- You'd have to introduce
more logic into the template to make sure that's not the case. -
This is better done in the control.


Reply to this email directly or view it on GitHub:
https://github.com/Iheartweb/Lu/issues/70#issuecomment-5133289

from lu.

Related Issues (20)

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.