TWiki
>
TWiki Web
>
TagMePlugin
>
TagMeCreateNewTag
(revision 3) (raw view)
---+!! Tag-me: Create New Tag %STARTINCLUDE% <table class="tagmeNavigation" border="0" cellpadding="3" cellspacing="0"><tr> <td> </td> <td bgcolor="#d7dced" style="background-image: url(%PUBURLPATH%/%SYSTEMWEB%/TagMePlugin/gray-gradient-1.png); border: solid 1px #d7dced;"> *Create New Tag* </td> <td> </td> <td bgcolor="#eef0f8" style="background-image: url(%PUBURLPATH%/%SYSTEMWEB%/TagMePlugin/gray-gradient-2.png); border: solid 1px #d7dced;"> [[TagMeRenameTag][Rename Tag]] </td> <td> </td> <td bgcolor="#eef0f8" style="background-image: url(%PUBURLPATH%/%SYSTEMWEB%/TagMePlugin/gray-gradient-2.png); border: solid 1px #d7dced;"> [[TagMeDeleteTag][Delete Tag]] </td> </tr></table> <table border="0" cellpadding="5" cellspacing="0" style="width:100%;"> <tr bgcolor="#d7dced"><td style="width:100%;"></td></tr> </table> %STARTSECTION{"create"}% Create a new tag - then add it to a topic. <noautolink>%TAGME{ tpaction="%URLPARAM{"newaction" default="nop"}%" tag="%URLPARAM{newtag}%" note="%URLPARAM{newtagnote}%" }%<form name="addtag" action="%SCRIPTURL{viewauth}%/%BASEWEB%/%BASETOPIC%" method="post" onsubmit="return cleanTag(this.newtag.value);"> <div class="twikiFormSteps"> <div class="twikiFormStep twikiLast"> Name of new tag: <input type="text" class="twikiInputField" name="newtag" id="newtag" size="30" value="%URLPARAM{"createtag"}%" onblur="this.value=cleanTag(this.value)" /> <input type="submit" class="twikiSubmit" value="%MAKETEXT{"Create"}%" /> </div> </div> <input type="hidden" name="newaction" value="newtag" /> <input type="hidden" name="from" value="%URLPARAM{"from"}%" /> <input type="hidden" name="newtagnote" value="Return to [<nop>[%URLPARAM{"from" default="%BASEWEB%.%HOMETOPIC%" }%]]" /> </form> </noautolink> %ENDSECTION{"create"}% %STARTSECTION{"existing"}% Existing tags: %TAGME{ tpaction="showalltags" format="[[%SCRIPTURL{view}%/%SYSTEMWEB%/TagMeSearch?tag=$tag][$tag]]" separator=", " }% %ENDSECTION{"existing"}% %STOPINCLUDE% %BR% <span class="twikiGrayText">Other tag options: [[TagMeViewAllTags][View all tags]], [[TagMeViewMyTags][View my tags]], [[TagMeSearch][Search tags]]</span> %STARTSECTION{"cleanTagJavascript"}% <script language="javascript" type="text/javascript"> <!-- // <pre>-hide function cleanTag(inTagString) { var shouldTranslate = 0%TAGMEPLUGIN_NORMALIZE_TAG_INPUT%; var cleanName = ""; if (shouldTranslate) { cleanName = translateEntities(inTagString); } else { cleanName = makeSafe(inTagString); } return cleanName; } /** Translates international characters to ASCII. */ function translateEntities(inText) { var translated = ''; for ( var i = 0; i < inText.length; i++ ) { var ch = inText.charAt( i ); var chVal = ch.charCodeAt(0); var ch2 = ''; if( (chVal==192) || (chVal==193) || (chVal==194) || (chVal==195) ) { ch = 'A'; } if( chVal==196) { ch = 'A'; ch2 = 'E'; } if( chVal==197) { ch = 'A'; ch2 = 'A'; } if( chVal==198) { ch = 'A'; ch2 = 'E'; } if( chVal==199) { ch = 'C'; } if( (chVal==200) || (chVal==201) || (chVal==202) || (chVal==203) ) { ch = 'E'; } if( (chVal==204) || (chVal==205) || (chVal==206) || (chVal==207) ) { ch = 'I'; } if( chVal==208) { ch = 'd'; } if( chVal==209) { ch = 'N'; } if( (chVal==210) || (chVal==211) || (chVal==212) || (chVal==213) ) { ch = 'O'; } if( chVal==214) { ch = 'O'; ch2 = 'E'; } if( chVal==216) { ch = 'O'; ch2 = 'E'; } if( (chVal==217) || (chVal==218) || (chVal==219) ) { ch = 'U'; } if( chVal==220) { ch = 'U'; ch2 = 'E'; } if( chVal==221) { ch = 'Y'; } if( chVal==222) { ch = 'P'; } if( chVal==223) { ch = 's'; ch2 = 's'; } if( (chVal==224) || (chVal==225) || (chVal==226) || (chVal==227) ) { ch = 'a'; } if( chVal==228) { ch = 'a'; ch2 = 'e'; } if( chVal==229) { ch = 'a'; ch2 = 'a'; } if( chVal==230) { ch = 'a'; ch2 = 'e'; } if( chVal==231) { ch = 'c'; } if( (chVal==232) || (chVal==233) || (chVal==234) || (chVal==235) ) { ch = 'e'; } if( (chVal==236) || (chVal==237) || (chVal==238) || (chVal==239) ) { ch = 'i'; } if( chVal==240) { ch = 'd'; } if( chVal==241) { ch = 'n'; } if( (chVal==242) || (chVal==243) || (chVal==244) || (chVal==245) ) { ch = 'o'; } if( chVal==246) { ch = 'o'; ch2 = 'e'; } if( chVal==248) { ch = 'o'; ch2 = 'e'; } if( (chVal==249) || (chVal==250) || (chVal==251) ) { ch = 'u'; } if( chVal==252) { ch = 'u'; ch2 = 'e'; } if( chVal==253) { ch = 'y'; } if( chVal==254) { ch = 'p'; } if( chVal==255) { ch = 'y'; } ch = toUnderscore(ch); ch = ch.toLowerCase(); if( ((ch>='a')&&(ch<='z')) || ((ch>='0')&&(ch<='9')) || (ch=='_') ) { translated += ch } if( ch2!='' ) { translated += ch2; } } // remove double underscores var re = new RegExp(/_+/g); translated = translated.replace(re, "_"); return translated; } function toUnderscore (inChar) { if (inChar.length == 0) return ""; var safeChar = inChar; if( ((safeChar=='-') || (safeChar==' ') || (safeChar=='/')) ) { safeChar = '_'; } return safeChar; } function makeSafe (inText) { if (inText.length == 0) return ""; var re = new RegExp(/[\x01-\x1f^\#\,\'\"\|\*]/g); var perlSafeString = inText.replace(re, ""); return perlSafeString; } addLoadEvent(setHandyFocus); function setHandyFocus () { document.getElementById('newtag').focus(); } // </pre>-hide --> </script> %ENDSECTION{"cleanTagJavascript"}%
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r3 - 2012-09-04
-
TWikiContributor
Home
Site map
Badania web
Dydaktyka web
Galeria web
Main web
MainPage web
Ogloszenia web
Pracownicy web
Publikacje web
Sandbox web
StronaGlowna web
TWiki web
TWiki Web
User registration
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
InterWikis
ManagingUsers
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Account
Log In
Edit
Attach
Copyright © 1999-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback
Note:
Please contribute updates to this topic on TWiki.org at
TWiki:TWiki.TagMeCreateNewTag
.