Commits

Jacob Moen committed d700a88

Help button with dialog containing basic wiki creole syntax help.

Comments (0)

Files changed (5)

protected/modules/wiki/assets/images/help.png

Added
New image

protected/modules/wiki/assets/wiki.css

     background-image:url(images/code.png);
 }
 
+.markItUp .markItUpButton16 a   {
+    background-image:url(images/help.png);
+}
+
 .markItUp .preview a {
     background-image:url(images/preview.png);
 }

protected/modules/wiki/assets/wiki.js

         {separator:'---------------' },
         {name:'Code', openWith:'(!(|:pre code [![Language:!:cpp]!]:|{{{|!|)!)\n', closeWith:'\n}}}\n'},
         {separator:'---------------' },
+        {name:'Help', beforeInsert:function() {
+                $('#creole-help').dialog('open');
+            }
+        },
         {name:'Preview', call:'preview', className:'preview'}
     ]
 	};
 
-    function markitupimageupload(){
-        $('#mymodal').dialog('open');
-    }
-
 	$('#edit-page-form textarea').markItUp(settings);
 });

protected/modules/wiki/views/default/edit.php

                     <?php echo CHtml::link(Yii::t('wiki', 'Wiki Logout'), array('wikilogout'))?>
                 <?php endif; ?>
     </div>
+    <?php $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
+        'id'=>'creole-help',
+        'options'=>array(
+            'title'=>'Wiki Syntax',
+            'width'=>450,
+            'height'=>600,
+            'autoOpen'=>false,
+            'resizable'=>true,
+            'modal'=>false,
+            'closeOnEscape' => true,
+        ),
+    )); ?>
+        <div class="wiki-controls" style="width:400px;font-size:10px;">
+            <h3>WikiCreole Cheat Sheet</h3>
+            <table cellpadding="0" cellspacing="0">
+                <tbody>
+                    <tr>
+                        <td>//italics//</td>
+                        <td class="arrow">&#8594;</td>
+                        <td><em>italics</em></td>
+                    </tr>
+                    <tr>
+                        <td>**bold**</td>
+                        <td class="arrow">&#8594;</td>
+                        <td><strong>bold</strong></td>
+                    </tr>
+                    <tr>
+                        <td>* Bullet list<br>* Second item<br>** Sub item</td>
+                        <td class="arrow">&#8594;</td>
+                        <td>&#8226; Bullet list<br>&#8226; Second item<br>..&#8226; Sub item</td>
+                    </tr>
+                    <tr>
+                        <td># Numbered list<br># Second item<br>## Sub item</td>
+                        <td class="arrow">&#8594;</td>
+                        <td>1. Numbered list<br>2. Second item<br>2.1 Sub item</td>
+                    </tr>
+                    <tr>
+                        <td>Link to [[wiki page]]</td>
+                        <td class="arrow">&#8594;</td>
+                        <td>Link to <a href="http://www.wikicreole.org/attach/CheatSheet/URL">wiki page</a></td>
+                    </tr>
+                    <tr>
+                        <td>[[URL|link name]]</td>
+                        <td class="arrow">&#8594;</td>
+                        <td><a href="http://www.wikicreole.org/attach/CheatSheet/URL">link name</a></td>
+                    </tr>
+                    <tr>
+                        <td>== Large heading<br>=== Medium heading<br>==== Small heading</td>
+                        <td class="arrow">&#8594;</td>
+                        <td><span style="font-size: 130%; font-weight: bold;"> Large heading</span><br>
+                            <span style="font-size: 115%; font-weight: bold;">Medium heading</span><br>
+                            <span style="font-size: 100%; font-weight: bold;">Small heading</span></td>
+                    </tr>
+                    <tr>
+                        <td>No<br> linebreak!<br><br>Use empty line</td>
+                        <td class="arrow">&#8594;</td>
+                        <td>No line break!<br><br>Use empty line</td>
+                    </tr>
+                    <tr>
+                        <td>Forced\\linebreak<br></td>
+                        <td class="arrow">&#8594;</td>
+                        <td>Forced<br>line break</td>
+                    </tr>
+                    <tr>
+                        <td>Horizontal line:<br>----</td>
+                        <td class="arrow">&#8594;</td>
+                        <td>Horizontal line: <hr></td>
+                    </tr>
+                    <tr>
+                        <td>{{Image.jpg|title}}</td>
+                        <td class="arrow">&#8594;</td>
+                        <td>Image with title</td>
+                    </tr>
+                    <tr>
+                        <td>|=|=table|=header|<br>|a|table|row|<br>|b|table|row|</td>
+                        <td class="arrow">&#8594;</td>
+                        <td>Table</td>
+                    </tr>
+                    <tr>
+                        <td>{{{<br>== [[Nowiki]]:<br> //**don't** format//<br>}}}</td>
+                        <td class="arrow">&#8594;</td>
+                        <td>== [[Nowiki]]:<br> //**don't** format//</td>
+                    </tr>
+                </tbody>
+            </table>
+            <b style="font-size: 70%;">www.wikicreole.org</b>
+        </div>
+    <?php $this->endWidget('zii.widgets.jui.CJuiDialog'); ?>
 </div>

protected/modules/wiki/views/default/view.php

 ?>
 <div>
 	<div class="wiki-controls">
-		<?php if(!$this->module->user->isGuest): ?>
-            <?php echo CHtml::link(Yii::t('wiki', 'Edit'), array('edit', 'uid' => $page->getWikiUid()))?>
-        <?php endif; ?>
+        <?php echo CHtml::link(Yii::t('wiki', 'Edit'), array('edit', 'uid' => $page->getWikiUid()))?>
 
         <?php echo CHtml::link(Yii::t('wiki', 'View Source'), array('source', 'uid' => $page->getWikiUid()))?>
 
 		<?php echo $text?>
 	</div>
 	<div class="wiki-controls">
-        <?php if(!$this->module->user->isGuest): ?>
-            <?php echo CHtml::link(Yii::t('wiki', 'Edit'), array('edit', 'uid' => $page->getWikiUid()))?>
-        <?php endif; ?>
+        <?php echo CHtml::link(Yii::t('wiki', 'Edit'), array('edit', 'uid' => $page->getWikiUid()))?>
+
         <?php echo CHtml::link(Yii::t('wiki', 'View Source'), array('source', 'uid' => $page->getWikiUid()))?>
 
 		<?php echo CHtml::link(Yii::t('wiki', 'History'), array('history', 'uid' => $page->getWikiUid()))?>