Created
December 19, 2011 13:40
-
-
Save anonymous/1497276 to your computer and use it in GitHub Desktop.
Foswiki Blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%JQREQUIRE{"wikiword"}% | |
<sticky><script type="text/javascript">%STARTSECTION{"js"}% | |
jQuery(document).ready( | |
function () { | |
/* Wikified topic name is built from #wordSourceSelector field and saved to #topicFieldSelector | |
when the HTML form #formSelector is submitted | |
*/ | |
var wikifyOnSubmit = function (formSelector, wordSourceSelector, topicFieldSelector) { | |
jQuery(formSelector).submit( | |
function () { | |
var wikifiedTopicName; | |
wikifiedTopicName = jQuery.wikiword.wikify(jQuery(wordSourceSelector).val()); | |
jQuery(topicFieldSelector).val(wikifiedTopicName); | |
} | |
); | |
}; | |
wikifyOnSubmit('#Create', '#CreateLabel', '#CreateTopic'); | |
} | |
); | |
%ENDSECTION{"js"}%</script></sticky> | |
<sticky>%STARTSECTION{"form"}%<form id='Create' action='%SCRIPTURLPATH{"edit"}%/%WEB%/'> | |
| Area: | <input id="CreateArea" type="text" name="TopicArea" size="20" /><br/> | | |
| Description: | <input id="CreateDescription" type="text" name="TopicDescription" size="100" /> | | |
| Version: | <input id="CreateVersion" type="text" name="TopicVersion" size="50" /> | | |
| %ICON{"newtopic"}% | <input type="submit" value='Create' /> | | |
<input id="CreateTopic" type="hidden" name="topic" /> | |
<input type="hidden" name="templatetopic" value="BlogTemplate" /> | |
<input type="hidden" name="TopicArea" value=TopicArea /> | |
<input type="hidden" name="TopicDescription" value=TopicDescription /> | |
<input type="hidden" name="TopicVersion" value=TopicVersion /> | |
<input type="hidden" name="TopicState" value="Open" /> | |
<input type="hidden" name="TopicAuthor" value="%WIKIUSERNAME%" /> | |
<input type="hidden" name="TopicDate" value="%DATE%" /> | |
</form>%ENDSECTION{"form"}%</sticky> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment