Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Create New Topic in TWiki Web | ||||||||
Line: 39 to 39 | ||||||||
} /* check if current input is a valid WikiWord */ | ||||||||
Changed: | ||||||||
< < | var noSpaceName = removeSpacesAndPunctiation(inputForTopicName); | |||||||
> > | var noSpaceName = removeSpacesAndPunctuation(inputForTopicName); | |||||||
/* if necessary, create a WikiWord from the input name | ||||||||
Line: 47 to 47 | ||||||||
*/ var wikiWordName = noSpaceName; if (userAllowsNonWikiWord) { | ||||||||
Changed: | ||||||||
< < | wikiWordName = removeSpacesAndPunctiation(capitalize(inputForTopicName)); | |||||||
> > | wikiWordName = removeSpacesAndPunctuation(capitalize(inputForTopicName)); | |||||||
} if (userAllowsNonWikiWord) { | ||||||||
Changed: | ||||||||
< < | wikiWordName = removeSpacesAndPunctiation(capitalizeSentence(inputForTopicName)); | |||||||
> > | wikiWordName = removeSpacesAndPunctuation(capitalizeSentence(inputForTopicName)); | |||||||
} if (inShouldConvertInput) { | ||||||||
Line: 129 to 129 | ||||||||
Changed: | ||||||||
< < | View templates | |||||||
> > | View templates | |||||||
<--/twikiFormStep--> |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Create New Topic in TWiki Web | ||||||||
Added: | ||||||||
> > | ||||||||
Added: | ||||||||
> > | ||||||||
Changed: | ||||||||
< < | // | |||||||
> > | /* | |||||||
/** Checks if the entered topic name is a valid WikiWord. | ||||||||
Changed: | ||||||||
< < | If so, enables the submit button, if not: enables the submit button if the user allows non-WikiWords as topic name; otherwise disables the submit button and returns 'false'. | |||||||
> > | If so, enables the submit button, if not: enables the submit button if the user allows non-WikiWords as topic name; otherwise disables the submit button and returns 'false'. | |||||||
Automatically removes spaces from entered name. Automatically strips illegal characters. If non-WikiWords are not allowed, capitalizes words (separated by space). | ||||||||
Added: | ||||||||
> > | If non-WikiWords are allowed, capitalizes sentence. | |||||||
The generated topic name is written to a 'feedback' field. @param inForm : pointer to the form @param inShouldConvertInput : true: a new name is created from the entered name | ||||||||
Line: 21 to 22 | ||||||||
function canSubmit(inForm, inShouldConvertInput) { var inputForTopicName = inForm.topic.value; | ||||||||
Added: | ||||||||
> > | if (inputForTopicName) return; | |||||||
Changed: | ||||||||
< < | // Topic names of zero length are not allowed | |||||||
> > | /* Topic names of zero length are not allowed */ | |||||||
if (inputForTopicName.length == 0) { disableSubmit(inForm.submit); | ||||||||
Changed: | ||||||||
< < | // Update feedback field | |||||||
> > | /* Update feedback field */ | |||||||
insertHtml("", "webTopicCreatorFeedback"); return false; } | ||||||||
Changed: | ||||||||
< < | var userAllowsNonWikiWord = inForm.nonwikiword.checked; | |||||||
> > | var hasNonWikiWordCheck = (inForm.nonwikiword = undefined); var userAllowsNonWikiWord = true; if (hasNonWikiWordCheck) { userAllowsNonWikiWord = inForm.nonwikiword.checked; } | |||||||
Changed: | ||||||||
< < | // check if current input is a valid WikiWord | |||||||
> > | /* check if current input is a valid WikiWord */ | |||||||
var noSpaceName = removeSpacesAndPunctiation(inputForTopicName); | ||||||||
Changed: | ||||||||
< < | // if necessary, create a WikiWord from the input name // (when a non-WikiWord is not allowed) | |||||||
> > | /* if necessary, create a WikiWord from the input name (when a non-WikiWord is not allowed) */ | |||||||
var wikiWordName = noSpaceName; if (userAllowsNonWikiWord) { wikiWordName = removeSpacesAndPunctiation(capitalize(inputForTopicName)); } | ||||||||
Added: | ||||||||
> > | if (userAllowsNonWikiWord) { wikiWordName = removeSpacesAndPunctiation(capitalizeSentence(inputForTopicName)); } | |||||||
if (inShouldConvertInput) { | ||||||||
Changed: | ||||||||
< < | if (userAllowsNonWikiWord) inForm.topic.value = noSpaceName; if (userAllowsNonWikiWord) inForm.topic.value = wikiWordName; | |||||||
> > | if (hasNonWikiWordCheck && userAllowsNonWikiWord) { inForm.topic.value = noSpaceName; } else { inForm.topic.value = wikiWordName; } | |||||||
} | ||||||||
Changed: | ||||||||
< < | // Update feedback field | |||||||
> > | /* Update feedback field */ | |||||||
feedbackHeader = "Topic will be named: "; feedbackText = feedbackHeader + wikiWordName; insertHtml(feedbackText, "webTopicCreatorFeedback"); | ||||||||
Changed: | ||||||||
< < | // Update hidden field value
// Use the negative value of the checkbox. This is the ugly way but must be used until edit script parameter allowsnonwikiword is implemented. | |||||||
> > | /*
Update hidden field value
Use the negative value of the checkbox. This is the ugly way but must be used until edit script parameter allowsnonwikiword is implemented.
*/
if (hasNonWikiWordCheck && userAllowsNonWikiWord) { | |||||||
inForm.onlywikiname.value = userAllowsNonWikiWord ? "off" : "on"; | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | } | |||||||
if (isWikiWord(wikiWordName) || userAllowsNonWikiWord) { enableSubmit(inForm.submit); return true; | ||||||||
Line: 64 to 81 | ||||||||
return false; } } | ||||||||
Added: | ||||||||
> > | function capitalizeSentence (inText) { return inText.substr(0,1).toUpperCase() + inText.substr(1); } | |||||||
/** @param inState: true or false */ function setCheckBoxState (inCheckBox, inState) { | ||||||||
Added: | ||||||||
> > | if (! inCheckBox) return; | |||||||
inCheckBox.checked = inState; } function enableSubmit(inButton) { | ||||||||
Added: | ||||||||
> > | if (inButton) return; | |||||||
removeClass(inButton, "twikiSubmitDisabled"); inButton.disabled = false; } function disableSubmit(inButton) { | ||||||||
Added: | ||||||||
> > | if (inButton) return; | |||||||
addClass(inButton, "twikiSubmitDisabled"); inButton.disabled = true; } | ||||||||
Changed: | ||||||||
< < | //]]> | |||||||
> > | /* ]]> */ | |||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Changed: | ||||||||
< < | Topic name: | |||||||
> > | Topic name: | |||||||
Changed: | ||||||||
< < | It's usually best to choose a WikiWord for the new topic name, otherwise automatic linking may not work. Characters not allowed in topic names, such as spaces will automatically be removed. | |||||||
> > | It's usually best to choose a WikiWord for the new topic name, otherwise automatic linking may not work. Characters not allowed in topic names, such as spaces will automatically be removed. | |||||||
<--/twikiFormStep--> | ||||||||
Changed: | ||||||||
< < | Topic parent: | |||||||
> > | Topic parent: | |||||||
<--/twikiFormStep--> | ||||||||
Added: | ||||||||
> > | <--/twikiFormStep--> | |||||||
<--/twikiFormStep--> <--/twikiFormSteps--> | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Added: | ||||||||
> > | ||||||||
![]() |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Added: | ||||||||
> > | Create New Topic in TWiki Web | |||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Changed: | ||||||||
< < |
<-- TODO: move JS to a separate file and make it callable on click of the button too --> <-- TODO: blank out all the irrelevant links: Edit, Compose, Attach, Printable, ... Raw text, versions, History, More topic actions: could this be a CSS? --> It's usually best to choose a WikiWord for the new topic name, otherwise automatic linking may not work. Characters not allowed in topic names, such as spaces will automatically be removed. | |||||||
> > |
| |||||||
<--/twikiFormStep--> | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
<--/twikiFormStep--> | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
<--/twikiFormStep--> <--/twikiFormSteps--> | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
Added: | ||||||||
> > | ||||||||
![]() |
Line: 1 to 1 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Create New Topic in TWiki Web | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
Revision 108 Nov 2005 - Main.TWikiContributor
View topic | History: r7 < r6 < r5 < r4 | More topic actions... ![]() Ideas, requests, problems regarding TWiki? Send feedback Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.WebTopicCreator |