Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

Item10143: webtopiccreator.js only removes first space

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Urgent Closed Engine webtopiccreator.js  
Greetings

I find that when using WebCreateNewTopic in any web it seems the script that cleans up names automatically is no longer functioning correctly. I am assuming that this is a problem with webtopiccreator.js

If I type in this is a test name the feedback says Topic will be named:ThisIs A Test Name

Now very interestingly, if I remove focus from the Topic name input field, it will remove the next space in the proposed new name AND change what is in the data entry box. You can easily see the behavior by typing in something similar to my example and then change focus back and forth between the Topic name text box and the Topic parent text box.

This works okay on 1.0.10, and I see that the javascript file has changed significantly.

Attached is a movie that shows the problem in action.

-- KiltBear - 09 Dec 2010

Arthur - I believe this is your baby. Can you provide a fix for this?

I have no skills in JS to see what is wrong. I can see the major change was to start using JQuery. It seems it may not do the job we need.

-- KennethLavrsen - 11 Dec 2010

I have changed the replace regex from:

finalName = finalName.replace(/\s+/, '', 'g');

to:

finalName = finalName.replace(/\s+/g, '');

Modifiers can be passed as parameter only with new RegExp: myregexp = new RegExp(regexstring, "gims").

-- ArthurClemens - 12 Dec 2010

Thanks folks, I made that one regex change and I'm looking good.

-- KiltBear - 29 Jan 2011
 

ItemTemplate edit

Summary webtopiccreator.js only removes first space
ReportedBy KiltBear
Codebase 1.1.2
SVN Range
AppliesTo Engine
Component webtopiccreator.js
Priority Urgent
CurrentState Closed
WaitingFor
Checkins Foswikirev:10267 Foswikirev:10268 Foswikirev:10269
TargetRelease patch
ReleasedIn 1.1.3
Topic attachments
I Attachment Action Size Date Who Comment
ScreenRecordingTrim.movmov ScreenRecordingTrim.mov manage 4452.0 K 10 Dec 2010 - 00:15 KiltBear  
Topic revision: r9 - 16 Apr 2011, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License