Item10143: webtopiccreator.js only removes first space
Priority: Urgent
Current State: Closed
Released In: 1.1.3
Target Release: patch
Applies To: Engine
Component: webtopiccreator.js
Branches:
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