Cool. Thanks Ken.
I tried out some stuff last night.
Basically I formatted the HTML for the AjaxUpdateContainer to be something like
this:
<div data-wonder-id="AUC" data-wonder-options = "{'someKey':
'someValue'}">...</div>
Then I create an on load statement:
$(window).load(function() {
$('[data-wonder-id]').each(function(index, element) {
element = $(element);
var type = element.attr('data-wonder-id');
eval(type).initialize(element);
});
});
Then in the AjaxUpdateContainer javascript object I added a method called
initialize:
initialize: function(element) {
var options = jQuery.parseJSON(element.attr('data-wonder-options'));
if(options.hasOwnProperty('minTimeout')) {
AUC.registerPeriodic(
element,
options.hasOwnProperty('canStop') ? options.canStop : null,
options.hasOwnProperty('stopped') ? options.stopped : null,
options
);
} else {
AUC.register(element.attr('id'), options);
}
},
In the event that the AUC is created as part of an Ajax Request I add a little
javascript during appendToResponse:
<script>AUC.initialize($("#e_0_15_3_3_1"));</script>
So my thinking is that all the components that need to be initialized when the
page gets loaded just need to implement initialize. I guess I should create
two options objects one for initialization options and one for ajax options?
Anyway for anyone is interested, I updated my example here:
http://www.kahalawai.com/JQuery
best,
Johnny
On May 9, 2013, at 4:36 PM, Ken Anderson <[email protected]> wrote:
> I think this is awesome! I'm definitely planning on using JQuery within the
> next few months, and will happily contribute once I get to that point.
>
> Ken
>
> On May 9, 2013, at 6:19 PM, Johnny Miller <[email protected]> wrote:
>
>> Hi Pascal,
>>
>> I started working on a JQuery framework and I'm up to one component!
>>
>> You can see it here: http://www.kahalawai.com/JQuery
>>
>> I'm pretty busy but I think I could make one component a day. I was
>> wondering what people thought about a couple of questions I have:
>>
>> 1. Should I use data attributes? One thing I would like to do is not
>> pollute the HTML with JavaScript code. Now with my first example (the
>> periodical updater) I'm not sure if that's possible i.e. When the page loads
>> I can find the ajax update containers but what about an ajax update
>> container that is returned from an ajax request? But for a lot of the other
>> components like ajax update link I could just register a trigger using the
>> data attributes.
>>
>> 2. Should I tie the framework to a look like JQueryUI or Bootstrap? Some of
>> the components like date pickers and modal containers need a default
>> styling.
>>
>> Do you think I should keep on keeping on or has somebody already developed a
>> framework they are about to release or is there a new better idea?
>>
>> Aloha,
>> Mr. Johnny Miller
>> Web Development Manager
>> Kahalawai Media Company
>> Lahaina, HI 96761
>> tel: (808) 661-7962 | mobile: (808) 283-0791
>> website | e-mail
>>
>> On Apr 6, 2013, at 1:41 PM, Larry Mills-Gahl <[email protected]> wrote:
>>
>>> There was some talk about directing some new development effort toward
>>> jQuery in Wonder.
>>> I've been working on some bits in this framework and am coming to realize
>>> that there are some organizational issues that could go a couple of
>>> different directions and I was wondering if there are any forks out there
>>> that are working on this that I might pull from and contribute to.
>>>
>>> Among the questions that might benefit from some planning are about
>>> multiple frameworks and dependencies. Specifically, the ERJQueryMobile
>>> framework has jQuery javascript resources and so does the ERJQuery
>>> framework (and potentially ERJQueryUI if we decide to separate jQuery from
>>> jQuery-UI … which is probably a good idea. Since mobile and UI both depend
>>> on jQuery, would it make sense to load those from ERJQuery and update the
>>> version handling so that one could load whatever version of jQuery you
>>> need.
>>> Essentially, making some loader classes in ERJQuery able to load the right
>>> version from local resources or a CDN depending on the need.
>>>
>>> Anyway… there are a few design decisions that will affect how the
>>> framework(s) interact and I wanted to know who else out there had done work
>>> on this that I might contribute to.
>>>
>>> Thanks.
>>>
>>>
>>> Larry Mills-Gahl
>>> [email protected]
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Minimize network downtime and maximize team effectiveness.
>>> Reduce network management and security costs.Learn how to hire
>>> the most talented Cisco Certified professionals. Visit the
>>> Employer Resources Portal
>>> http://www.cisco.com/web/learning/employer_resources/index.html_______________________________________________
>>> Wonder-disc mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com
>>
>> This email sent to [email protected]
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]