META TOPICPARENT
name="WebHome"
Create New Topic in TWiki Web > > > >
< < // > > /* /**
Checks if the entered topic name is a valid WikiWord . < < 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). > > 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 function canSubmit(inForm, inShouldConvertInput) {
var inputForTopicName = inForm.topic.value; > > if (inputForTopicName) return; < < // Topic names of zero length are not allowed > > /* Topic names of zero length are not allowed */ if (inputForTopicName.length == 0) {
disableSubmit(inForm.submit); < < // Update feedback field > > /* Update feedback field */ insertHtml("", "webTopicCreatorFeedback");
return false;
}
< < var userAllowsNonWikiWord = inForm.nonwikiword.checked; > > var hasNonWikiWordCheck = (inForm.nonwikiword = undefined);
var userAllowsNonWikiWord = true;
if (hasNonWikiWordCheck) {
userAllowsNonWikiWord = inForm.nonwikiword.checked;
} < < // check if current input is a valid WikiWord > > /* check if current input is a valid WikiWord */ var noSpaceName = removeSpacesAndPunctiation(inputForTopicName); < < // 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));
} > > if (userAllowsNonWikiWord) {
wikiWordName = removeSpacesAndPunctiation(capitalizeSentence(inputForTopicName));
}
if (inShouldConvertInput) { < < if (userAllowsNonWikiWord) inForm.topic.value = noSpaceName;
if (userAllowsNonWikiWord) inForm.topic.value = wikiWordName; > > if (hasNonWikiWordCheck && userAllowsNonWikiWord) {
inForm.topic.value = noSpaceName;
} else {
inForm.topic.value = wikiWordName;
} } < < // Update feedback field > > /* Update feedback field */ feedbackHeader = "Topic will be named: ";
feedbackText = feedbackHeader + wikiWordName;
insertHtml(feedbackText, "webTopicCreatorFeedback"); < < // 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"; < < > > } if (isWikiWord(wikiWordName) || userAllowsNonWikiWord) {
enableSubmit(inForm.submit);
return true; return false;
}
} > > function capitalizeSentence (inText) {
return inText.substr(0,1).toUpperCase() + inText.substr(1);
} /**
@param inState: true or false
*/
function setCheckBoxState (inCheckBox, inState) { > > if (! inCheckBox) return; inCheckBox.checked = inState;
}
function enableSubmit(inButton) { > > if (inButton) return; removeClass(inButton, "twikiSubmitDisabled");
inButton.disabled = false;
}
function disableSubmit(inButton) { > > if (inButton) return; addClass(inButton, "twikiSubmitDisabled");
inButton.disabled = true;
} < < //]]> > > /* ]]> */ < < > >
< < Topic name:
<--generated name will be put here-->
> > Topic name:
<--generated name will be put here-->
Allow non WikiWord for the new topic name
< < 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-->
< < Topic parent: > > Topic parent:
ATasteOfTWiki AccessKeys AdminDocumentationCategory AdminSkillsAssumptions AdminToolsCategory AdministrationVariables AllowWebCreateByUserMappingManager AnApplicationWithWikiForm AppendixEncodeURLsWithUTF8 ApplicationsAndComponentsVariables AttachmentsAndFilesVariables AutonomousWebs BackupRestoreConsole BackupRestorePlugin BehaviourContrib BookView BulkRegistration BulkResetPassword BumpyWord CategoryCategory CgiContrib ChangeEmailAddress ChangePassword ChartingAndDrawingVariables ClassMethod ColorPickerPlugin CommentPlugin CommentPluginExamples CommentPluginTemplate CopyingTopics CustomUserGroupNotations DatabaseAndFormsVariables DateAndTimeVariables DatePickerPlugin DeleteOrRenameATopic DeleteOrRenameAnAttachment DeveloperDocumentationCategory DevelopmentVariables DontNotify EditDoesNotIncreaseTheRevision EditTablePlugin EditUserAccount EditingAndContentUpdateVariables EmailAndNotificationVariables EmptyPlugin ExampleTopicTemplate ExportAndPublishingVariables FileAttachment FileAttribute ForceNewRevision FormatTokens FormattedSearch FormattingAndRenderingVariables GnuGeneralPublicLicense GoodStyle HeadlinesPlugin HiddenAttachment HierarchicalNavigation HierarchicalNavigationChildExample IfStatements ImageGalleryPlugin ImportVariables IncludeTopicRaw IncludeTopicsAndWebPages InstalledPlugins InstantEnhancements InterWikis InterwikiPlugin JQueryPlugin JSCalendarContrib JSCalendarContribInline JqPlotPlugin JumpBox LanguageSelector LargeSite LdapContrib LdapContribAdminPlugin LinkingAndNavigationVariables LoginName MailerContrib MainFeatures ManagingTopics ManagingUsers ManagingWebs MetadataRepository MovedSkin NewUserTemplate ObjectMethod PageRenderingProcess ParameterizedVariables PatternSkin PatternSkinColorSettings PatternSkinCss PatternSkinCssCookbook PatternSkinCssCookbookCenterPage PatternSkinCssCookbookCenterPageBorder PatternSkinCssCookbookEditTableStyle PatternSkinCssCookbookFonts PatternSkinCssCookbookNoLeftBar PatternSkinCssCookbookNoTopBar PatternSkinCustomization PatternSkinElements PatternSkinGraphics PatternSkinWebCreateNewTopicTemplate PersonalPreferencesHelp PeterThoeny PlainSkin PreferencesPlugin PreviewBackground PrintSkin QuerySearch QueryUsers QuietSave ReadOnlyAndMirrorWebs RegistrationApprovals RegularExpression RenameWeb RenderListPlugin ResetPassword ScrollBoxAddOn SearchDoesNotWork SearchHelp SearchPatternCookbook SearchResultsPagination SearchingAndListingVariables SecurityAndAccessControlVariables SetGetPlugin SimultaneousEdits SiteChanges SiteMap SitePermissions SiteStatisticsFooter SiteStatisticsTemplate SkinsAndTemplatesVariables SlideShowPlugin SmiliesPlugin SourceCode SpreadSheetPlugin SpreadSheetPluginTestCases StandardColors StartingPoints StaticMethod SubwebAndTopicNames SystemInformationVariables TWikiAccessControl TWikiAccessControlExceptionDotPm TWikiAccessDotPm TWikiAddOns TWikiAggregateIteratorDotPm TWikiAttachDotPm TWikiAttrsDotPm TWikiCompatibilityDotPm TWikiConfigureCheckersCertificateDotPm TWikiConfigureCheckersCertificateKeyCheckerDotPm TWikiConfigureLoadDotPm TWikiConfigureUIsEXTENDDotPm TWikiContribs TWikiContributor TWikiCss TWikiDashboardAddOn TWikiDashboardImages TWikiDocGraphics TWikiDocGraphicsTemplate TWikiDocumentation TWikiDotPm TWikiDownload TWikiEditingShorthand TWikiEngineDotPm TWikiEngineExceptionDotPm TWikiEnhancementRequests TWikiExternalLinks TWikiFAQ TWikiFaqTemplate TWikiFormDotPm TWikiFormFieldDefinitionDotPm TWikiFormListFieldDefinitionDotPm TWikiFormSelectDotPm TWikiForms TWikiFuncDotPm TWikiGlossary TWikiHistory TWikiI18NDotPm TWikiI18NExtractDotPm TWikiIfNodeDotPm TWikiIfOP_iswebDotPm TWikiIfParserDotPm TWikiInfixErrorDotPm TWikiInfixNodeDotPm TWikiInfixParserDotPm TWikiInstallationGuide TWikiJavascripts TWikiLineIteratorDotPm TWikiListIteratorDotPm TWikiLoginManagerApacheLoginDotPm TWikiLoginManagerDotPm TWikiLoginManagerSessionDotPm TWikiLoginManagerTemplateLoginDotPm TWikiLogos TWikiMdrepoDotPm TWikiMergeDotPm TWikiMetaData TWikiMetaDotPm TWikiNetDotPm TWikiNetHTTPResponseDotPm TWikiNetSkin TWikiNetSkinColorSettings TWikiNetSkinPlugin TWikiNetSkinWebCreateNewTopicTemplate TWikiOopsExceptionDotPm TWikiPluginDotPm TWikiPlugins TWikiPluginsDotPm TWikiPluralsDotPm TWikiPreferences TWikiPreferencesForm TWikiPrefsDotPm TWikiPrefsParserDotPm TWikiPrefsPrefsCacheDotPm TWikiQueryHoistREsDotPm TWikiQueryNodeDotPm TWikiQueryParserDotPm TWikiReferenceManual TWikiRegistration TWikiReleaseNotes04x00 TWikiReleaseNotes04x01 TWikiReleaseNotes04x02 TWikiReleaseNotes04x03 TWikiReleaseNotes05x00 TWikiReleaseNotes05x01 TWikiReleaseNotes06x00 TWikiRenderDotPm TWikiRenderingShortcut TWikiRequestDotPm TWikiResponseDotPm TWikiSandboxDotPm TWikiScripts TWikiSearchDotPm TWikiShorthand TWikiSite TWikiSiteTools TWikiSkinBrowser TWikiSkins TWikiStoreDotPm TWikiStoreQueryAlgorithmsBruteForceDotPm TWikiStoreRcsFileDotPm TWikiStoreRcsLiteDotPm TWikiStoreRcsWrapDotPm TWikiStoreSearchAlgorithmsForkingDotPm TWikiStoreSearchAlgorithmsPurePerlDotPm TWikiSystemRequirements TWikiTemplates TWikiTemplatesDotPm TWikiTimeDotPm TWikiTip001 TWikiTip002 TWikiTip003 TWikiTip004 TWikiTip005 TWikiTip006 TWikiTip007 TWikiTip008 TWikiTip009 TWikiTip010 TWikiTip011 TWikiTip012 TWikiTip013 TWikiTip014 TWikiTip015 TWikiTip016 TWikiTip017 TWikiTip018 TWikiTip019 TWikiTip020 TWikiTip021 TWikiTip022 TWikiTip023 TWikiTip024 TWikiTip025 TWikiTip026 TWikiTip027 TWikiTip028 TWikiTip029 TWikiTips TWikiTipsOfTheDay TWikiTipsOfTheDayAddNew TWikiTipsOfTheDayAdmin TWikiTipsOfTheDayInclude TWikiTipsOfTheDayTemplate TWikiTopics TWikiTutorial TWikiUIChangeFormDotPm TWikiUICopyDotPm TWikiUIDotPm TWikiUIEditDotPm TWikiUIManageDotPm TWikiUIMdrepoUIDotPm TWikiUIOopsDotPm TWikiUIRDiffDotPm TWikiUIRegisterDotPm TWikiUIRestDotPm TWikiUISaveDotPm TWikiUISearchDotPm TWikiUIStatisticsDotPm TWikiUIUploadDotPm TWikiUIViewDotPm TWikiUpgradeGuide TWikiUserAuthentication TWikiUserMappingContrib TWikiUserMappingDotPm TWikiUserSetting TWikiUsersApacheHtpasswdUserDotPm TWikiUsersBaseUserMappingDotPm TWikiUsersDotPm TWikiUsersGuide TWikiUsersHtPasswdUserDotPm TWikiUsersPasswordDotPm TWikiUsersTWikiUserMappingDotPm TWikiUsersTemplate TWikiVariables TWikiVariablesCategoryBody TWikiVariablesQuickStart TWikiVariablesSearch TWikiVariablesWizard TablePlugin TablesAndSpreadsheetsVariables TagMeChangeRequests TagMeCreateNewTag TagMeDebugSearch TagMeDebugViewTags TagMeDeleteTag TagMePlugin TagMeRenameTag TagMeSearch TagMeViewAllTags TagMeViewMyTags TemplateWeb TextEditor TextFormattingFAQ TextFormattingRules TimBernersLee TimeSpecifications TinyMCEFrequentlyAskedQuestions TinyMCEPlugin TinyMCEQuickHelp TipsContrib TopMenuSkin TopMenuSkinDefaultWebTopMenu TopMenuSkinHomeMenu TopMenuSkinTopBar TopMenuSkinTopicMenu TwistyContrib TwistyPlugin UIAndVisualizationVariables UserBookmarks UserBookmarksTemplate UserDocumentationCategory UserForm UserMasquerading UserReports UserSubwebs UserToolsCategory UsersAndAuthenticationVariables UsingHTML UsingMultipleDisks VarACTIVATEDPLUGINS VarADDTOHEAD VarALLVARIABLES VarAQUA VarATTACHURL VarATTACHURLPATH VarAUTHREALM VarBASETOPIC VarBASEWEB VarBB VarBB2 VarBB3 VarBB4 VarBLACK VarBLUE VarBR VarBROWN VarBUBBLESIG VarBULLET VarCALC VarCALCULATE VarCARET VarCHILDREN VarCOLORPICKER VarCOMMENT VarCONTENTMODE VarCOPY VarDASHBOARD VarDATE VarDATEPICKER VarDISPLAYTIME VarDISPLAYTIME2 VarEDITACTION VarEDITFORMFIELD VarEDITTABLE VarENCODE VarENDBG VarENDCOLOR VarENDCOLUMNS VarENDSECTION VarENTITY VarENV VarEXAMPLEVAR VarFAILEDPLUGINS VarFORMFIELD VarFOURCOLUMNS VarGET VarGMTIME VarGMTIME2 VarGRAY VarGREEN VarGROUPS VarH VarHEADLINES VarHIDE VarHIDEINPRINT VarHOMETOPIC VarHTTP VarHTTPHOST VarHTTPS VarI VarICON VarICONURL VarICONURLPATH VarIF VarINCLUDE VarINCLUDINGTOPIC VarINCLUDINGWEB VarJQENDTAB VarJQENDTABPANE VarJQPLOT VarJQTAB VarJQTABPANE VarLANGUAGE VarLANGUAGES VarLAQUO VarLIME VarLOCALSITEPREFS VarLOGIN VarLOGINURL VarLOGOUT VarLOGOUTURL VarM VarMAINWEB VarMAKETEXT VarMAROON VarMDREPO VarMETA VarMETASEARCH VarN VarNAVY VarNBSP VarNOP VarNOTIFYTOPIC VarOLIVE VarORANGE VarP VarPARENTBC VarPARENTTOPIC VarPINK VarPLUGINDESCRIPTIONS VarPLUGINVERSION VarPUBURL VarPUBURLPATH VarPURPLE VarQ VarQUERYPARAMS VarQUERYSTRING VarRAQUO VarRED VarREDBG VarREG VarREMOTEADDR VarREMOTEPORT VarREMOTEUSER VarRENDERLIST VarREVINFO VarREVINFO2 VarS VarSCRIPTNAME VarSCRIPTSUFFIX VarSCRIPTURL VarSCRIPTURL2 VarSCRIPTURLPATH VarSCRIPTURLPATH2 VarSEARCH VarSERVERTIME VarSERVERTIME2 VarSESSIONID VarSESSIONVAR VarSESSIONVARIABLE VarSET VarSETGETDUMP VarSILVER VarSITENAME VarSITESTATISTICSTOPIC VarSLIDESHOWEND VarSLIDESHOWSTART VarSPACEDTOPIC VarSPACEOUT VarSTARTINCLUDE VarSTARTSECTION VarSTATISTICSTOPIC VarSTOPINCLUDE VarSYSTEMWEB VarT VarTABLE VarTEAL VarTHREECOLUMNS VarTM VarTOC VarTOC2 VarTOPIC VarTOPICLIST VarTOPICTITLE VarTOPICURL VarTWIKIWEB VarTWISTY VarTWOCOLUMNS VarU VarURLPARAM VarUSERINFO VarUSERNAME VarUSERREPORT VarUSERSIG VarUSERSWEB VarVAR VarVBAR VarWEB VarWEBLIST VarWEBPREFSTOPIC VarWHITE VarWIKIHOMEURL VarWIKILOGOALT VarWIKILOGOIMG VarWIKILOGOURL VarWIKINAME VarWIKIPREFSTOPIC VarWIKITOOLNAME VarWIKIUSERNAME VarWIKIUSERSTOPIC VarWIKIVERSION VarWIP VarX VarY VarYELLOW ViewTildeJsmith WabiSabi WatchlistPlugin WatchlistTemplate WebAtom WebAtomBase WebBottomBar WebChanges WebChangesAlert WebChangesRightBox WebCreateNewTopic WebCreateNewTopicTemplate WebHome WebIndex WebLeftBar WebLeftBarCookbook WebLeftBarExample WebLeftBarLogin WebLeftBarPersonalTemplate WebLeftBarSearch WebLeftBarWebsList WebNotify WebPreferences WebPreferencesHelp WebRss WebRssBase WebSearch WebSearchAdvanced WebSearchAttachments WebSiteTools WebStatistics WebStatisticsFooter WebTemplateTopics WebTopBar WebTopMenu WebTopicCreator WebTopicEditTemplate WebTopicList WebTopicNonWikiTemplate WebTopicViewTemplate WelcomeGuest WhatDoesTWikiStandFor WhatIsWikiWiki WikiCulture WikiName WikiNotation WikiReferences WikiSyntax WikiSyntaxSummary WikiWord WorkflowAndAutomationVariables WysiwygPlugin WysiwygPluginSettings WysiwygPluginTopicLister YouAreHere
(no parent, orphaned topic)
<--/twikiFormStep--> > > <--/twikiFormStep--> <--/twikiFormStep-->
<--/twikiFormSteps--> < <
> >
> >
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.