Click here to register.
      
Bazaar


     Discuss > WebGUI Templates Working Group

Collaboration system

User arjan
Date 9/26/2008 5:17 pm
Views 376
Rating 0    Rate [
|
]
Previous · Next
User Message
arjan

Hi,

I guess it may be a good thing to have a thread per Asset?

I saw a bug report about one of the CS default post form templates. Although Frank doesn't consider it to be a bug, it is true that when you have no javascript and you enable preview in the CS.

While taking a closer look at this template I noticed some other things that may be not completely obvious as to how to make this template produce high quality code.

Let's start with the submit issue. This is the HTML:

input type="submit" value="preview" class="forwardButton" />
input type="submit" value="save" removed="this.value='Please wait...'; this.form.func.value='editSave';return true;" />

The biggest issue we is of course the fact that it cannot post the form anymore if you don't have javascript. The reason for this is, that WebGUI expects an form variable func=editSave that is not in the form, but is added with the javascript removed handler. This could be solved by reversing the logic and removing this form variable when the visitor hits preview.

Next comes the question: can we make the preview functionality available to people without javascript at all? I don't see how. If this can't be done. I guess the preview button should be written with javascript, so it's only visible when you can actually use it. Of course this should be done in an unobtrusive way. A javascript listener should be added instead of the removed handler and the script that removes the form variable should be linked externally and fire when the page is loaded and to add the preview button to a DOM element. If we use YUI for this, I hope this results in a valid tag that can be accessed with css. And in the hoover help of the preview switch it should be noted that javascript is needed for this function.

If you don't have javascript you can't add attachments as well, because this form element is written by javascript. I guess it's not that hard to put an upload field in with html and add a listener to this element to rewrite it if you have javascript. This means you can only add one attachment without javascript, otherwise the CS code has to be rewritten, but it's an inprovement.

Also the editor itself is uses elements, such as an onblur handler and an init function in the page itself that makes it obtrusive. The editor is not part of YUI, it's TinyMCE from moxycode. To make it unobtrusive would require to add another listener and to change the code. Because one can select an editor and depending on the selected editor, WebGUI produces different output for the template variable that produces the editor. This raises the question: if someone would be willing to do this rewrite, how could we write the information to the page that the javascript needs to determine what editor to use? Of course it's not a elegant idea to write some javascript directly into the page.

All in all it seems that we need some webgui-specific scripts to add handlers to elements in this form. Apart from the preview button, editors and attachments are used often. This means this should be a general script that can work with all attachments and textareas that can become editors.

 

Kind regards,

Arjan Widlak

United Knowledge
Internet for the public sector

www.unitedknowledge.nl



Back to Top
Rate [
|
]
 
 

Recent Discussions Color Key

Design:

Development:

Et Cetera:

Install/Upgrade:  

Smoketest:

Template Group:


Re: Navigation links by rogier - Fri @ 04:06pm

Re: Navigation links by techwriter - Fri @ 03:23pm

Re: Best way to make files available to webgui comunity by bernd - Fri @ 02:50pm

Re: User event history by knowmad - Fri @ 02:02pm

Re: Best way to make files available to webgui comunity by lctn2 - Fri @ 01:55pm

Re: Strategic Roadmap by JT - Fri @ 01:55pm

Re: Navigation links by rogier - Fri @ 01:55pm

Re: 2009 Presidents Meeting by JT - Fri @ 01:10pm

Re: navigation new window by rogier - Fri @ 01:03pm

Re: navigation new window by rogier - Fri @ 12:53pm

Re: WUC 2009 by JT - Fri @ 12:50pm

Re: Best way to make files available to webgui comunity by preaction - Fri @ 12:35pm

Re: Pagination markup by rogier - Fri @ 12:35pm

Re: Best way to make files available to webgui comunity by kristi - Fri @ 12:29pm