|
|
(11 intermediate revisions not shown) |
Line 2: |
Line 2: |
| | | |
| This page provides some helpers to create new pages (i.e. automatic insertion of the correct templates). | | This page provides some helpers to create new pages (i.e. automatic insertion of the correct templates). |
| + | |
| + | == Naming Conventions == |
| + | |
| + | To keep the pages easy to find, we'll need to use some naming conventions: |
| + | * The page name should start with a capitalized letter |
| + | * Use CamelCase (that is to say, remove all spaces and put the first character of each word in uppercase, for example: "Fictional titles are nice examples" becomes "FictionalTitlesAreNiceExamples" |
| + | |
| + | == Adding a page == |
| | | |
| <html> | | <html> |
| <ul> | | <ul> |
| <li> | | <li> |
- | Add a standard page. | + | Add a standard page.<br/> |
- | <form action='/wiki/index.php' method='GET' id='newPageForm'>
| + | Team:EPF-Lausanne/<input type='text' id='pageTitleInput' value='' /><input type='button' id='pageButton' value='Create' /> |
- | Team:EPF-Lausanne/<input type='text' id='title' value='' />
| + | <script type='text/javascript'>EPFL.registerNewPageButton("#pageTitleInput", "#pageButton", "Team:EPF-Lausanne", "Team:EPF-Lausanne/Template/NewPage", EPFL.checkNamingConventions);</script> |
- | <input type='hidden' id='hiddenTitle' name='title' />
| + | |
- | <input type='hidden' name='action' value='edit' />
| + | |
- | <input type='hidden' name='preload' value='Team:EPF-Lausanne/Template/NewPage' />
| + | |
- | <input type='submit' value='Create' />
| + | |
- | </form>
| + | |
- | <script type='text/javascript'> | + | |
- | $("#newPageForm").submit(function(){
| + | |
- | $("#hiddenTitle").val("Team:EPF-Lausanne/"+$("#title").val());
| + | |
- | return true;
| + | |
- | });
| + | |
- | </script>
| + | |
| </li> | | </li> |
| <li> | | <li> |
- | Add a protocol. | + | Add a protocol.<br/> |
- | <form action='/wiki/index.php' method='GET' id='newProtocolForm'>
| + | Team:EPF-Lausanne/Protocol/<input type='text' id='protocolTitle' value='' /><input type='button' id='protocolButton' value='Create' /> |
- | Team:EPF-Lausanne/Protocol/<input type='text' id='title' value='' />
| + | <script type='text/javascript'>EPFL.registerNewPageButton("#protocolTitle", "#protocolButton", "Team:EPF-Lausanne/Protocol", "Team:EPF-Lausanne/Template/NewProtocol", EPFL.checkNamingConventions);</script> |
- | <input type='hidden' id='hiddenTitle' name='title' />
| + | </li> |
- | <input type='hidden' name='action' value='edit' />
| + | <li> |
- | <input type='hidden' name='preload' value='Team:EPF-Lausanne/Template/NewProtocol' />
| + | Add a notebook entry.<br />Go to the notebook tab and click on the correct date. |
- | <input type='submit' value='Create' />
| + | |
- | </form>
| + | |
- | <script type='text/javascript'> | + | |
- | $("#newProtocolForm").submit(function(){
| + | |
- | $("#hiddenTitle").val("Team:EPF-Lausanne/Protocol/"+$("#title").val());
| + | |
- | return true;
| + | |
- | });
| + | |
- | </script> | + | |
| </li> | | </li> |
| </ul> | | </ul> |