[pmwiki-users] Help to toggle wrap for textarea in edit-form

Esteve Boix eboix at esteveb.com
Sat May 14 04:49:07 CDT 2011


The recipe requires you to add (:ajaxeditsupport:) in your edit form. I 
modified the style there:

Markup('ajax-pages', 'directives',
     '/\\(:ajaxeditsupport\\s*(.*?):\\)/ei',
     "Keep(FmtAjaxEditSupport('$pagename',PSS('$1')))");

This calls FmtAjaxEditSupport($pagename, $args). The HTML returned from 
this function is inserted in the page. Put your styles there.

Regards,
Esteve

Al 13/05/11 17:20, En/na Daniel Andersson ha escrit:
> Hi Esteve
>
> Excellent.
>
> Can I include the line from the recipe
> document.getElementById("text").setAttribute("wrap","off");
> in my EditForm somehow?
>
> This recipe could definitely come to good use.
>
>
> Thanks
>
> /Daniel
>
> On 05/13/2011 02:55 PM, Esteve Boix wrote:
>>
>> Take a look at AjaxEditSupport, a recipe I wrote
>> (http://www.pmwiki.org/wiki/Cookbook/AjaxEditSupport).
>> I changed the textarea wrapping to make the search functionality work.
>>
>> Regards,
>> Esteve
>>
>> Al 12/05/11 20:43, En/na Daniel Andersson ha escrit:
>>> Hi again
>>>
>>> Can I modify e_textarea in the Edit Form?
>>>
>>> I've been searching through the PmWiki site and the mailing list
>>> trying to get my head around this.
>>>
>>> Haven't anyone done this before?
>>>
>>>
>>> /Daniel
>>>
>>> On 05/05/2011 01:25 PM, Daniel Andersson wrote:
>>>> Hi all
>>>>
>>>> I want to toggle wrap for the textarea in the edit-form, since I edit
>>>> broad simple tables 50 times a day.
>>>>
>>>> I have some working HTML javascript code to do this below.
>>>> What is the best way to go about this?
>>>>
>>>> When I edit my Site.EditForm from PmWiki I find (:input e_textarea:),
>>>> but I'm not sure how to insert my HTML and Javascript here.
>>>>
>>>> <HTML>
>>>> <BODY>
>>>> <SCRIPT type='text/javascript'><!--
>>>> function set_wrap(b, t) {
>>>> var ta = document.getElementById(t), n = ta.cloneNode(true);
>>>> n.setAttribute('wrap', b.options[b.selectedIndex].value);
>>>> ta.parentNode.replaceChild(n, ta);
>>>> }
>>>> --></SCRIPT>
>>>> <FORM>
>>>> <TEXTAREA id='off' cols='15' wrap='off'>One, Two, Three, Four, Five,
>>>> Six, Seven, Eight, Nine, Ten</TEXTAREA>
>>>> <SELECT onChange='set_wrap( this, "off" );'>
>>>> <OPTION value='soft'>soft</OPTION>
>>>> <OPTION value='off' selected>off</OPTION>
>>>> <OPTION value='hard'>hard</OPTION>
>>>> </SELECT>
>>>> </FORM>
>>>> </BODY>
>>>> </HTML>
>>>>
>>>>
>>>> PS. Any tip of a Firefox add-on to toggle wrap compatible with Firefox
>>>> 3.5? Wrap Switcher 1.1 only works with 3.0.
>>>>
>>>>
>>>> Cheers
>>>> Daniel
>>>>
>>>> _______________________________________________
>>>> pmwiki-users mailing list
>>>> pmwiki-users at pmichaud.com
>>>> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>>>
>>>
>>> _______________________________________________
>>> pmwiki-users mailing list
>>> pmwiki-users at pmichaud.com
>>> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>>>
>>>
>>
>>
>> _______________________________________________
>> pmwiki-users mailing list
>> pmwiki-users at pmichaud.com
>> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
>
>




More information about the pmwiki-users mailing list