/**
Checks if the entered topic name is a valid WikiWord.
Changed:
< <
If so, enables the submit button, if not: enables the submit button
> >
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'.
Deleted:
< <
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
@return True: submit is enabled and topic creation is allowed; false: submit is disabled and topic creation should be inhibited.
*/
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);
var userAllowsNonWikiWord = inForm.nonwikiword.checked;
// check if current input is a valid WikiWord
> >
var hasNonWikiWordCheck = (inForm.nonwikiword = undefined);
var userAllowsNonWikiWord = true;
if (hasNonWikiWordCheck) {
Added:
> >
userAllowsNonWikiWord = inForm.nonwikiword.checked;
}
/* 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
Added:
> >
(when a non-WikiWord is not allowed)
*/
var wikiWordName = noSpaceName;
if (userAllowsNonWikiWord) {
wikiWordName = removeSpacesAndPunctiation(capitalize(inputForTopicName));
Changed:
< <
}
> >
}
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;
Added:
> >
} 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.
inForm.onlywikiname.value = userAllowsNonWikiWord ? "off" : "on";
> >
/*
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.
*/
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.
<-- 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? -->
> >
<--generated name will be put here-->
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.
Deleted:
< <
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-->
Topic parent:
Changed:
< <
> >
Changed:
< <
> >
<--/twikiFormStep-->
Changed:
< <
> >
<--/twikiFormStep-->
<--/twikiFormSteps-->
Changed:
< <
> >
Added:
> >
Once you have created the topic, consider adding links in related topics to the new topic so that there are more ways people can discover it.
//WikiWord
if (inForm.nonwikiword.checked == true) {
return removeSpaces(inValue);
}
var sIn = inValue;
var sOut = '';
var chgUpper = true;
for ( var i = 0; i < sIn.length; i++ ) {
var ch = sIn.charAt( i );
if( ch!=' ' ) {
if( chgUpper ) {
ch = ch.toUpperCase();
chgUpper = false;
}
}
if( ch==' ' ) {
chgUpper = true;
} else {
chgUpper = false;
}
sOut += ch;
}
return removeSpaces(sOut);
}
function removeSpaces(inValue) {
var sIn = inValue;
var sOut = '';
for ( var i = 0; i < sIn.length; i++ ) {
var ch = sIn.charAt( i );
if( ch==' ' ) {
chgUpper = true;
continue;
}
sOut += ch;
}
return sOut;
}
function canSubmit(inForm) {
inForm.topic.value = capitalize(inForm, inForm.topic.value);
// Use the negative value of the checkbox. This is the ugly way but must be used until edit script parameter allowsnonwikiword is implemented.
inForm.onlywikiname.value = (inForm.nonwikiword.checked == true) ? "off" : "on";
return true;
}
//]]>
Create New Topic in TWiki Web
Changed:
< <
Topic name:
> >
Topic name:
<-- 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? -->
Changed:
< <
Topic parent:
> >
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-->
Added:
> >
Topic parent:
Changed:
< <
> >
Deleted:
< <
Changed:
< <
> >
<--/twikiFormStep-->
Added:
> >
<--/twikiFormStep-->
<--/twikiFormSteps-->
Changed:
< <
To create a new topic, enter a WikiWord for the topic name, select a topic parent and click 'Create.'
Once you have created the topic, consider adding links in related topics to the new topic so that there are more ways people can discover it.
> >
Once you have created the topic, consider adding links in related topics to the new topic so that there are more ways people can discover it.
To create a new topic, enter a WikiWord for the topic name, select a topic parent and click 'Create.'
Once you have created the topic, consider adding links in related topics to the new topic so that there are more ways people can discover it.