aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2012-02-17 14:44:00 +0100
committerFabrice Bellingard <bellingard@gmail.com>2012-02-17 14:45:25 +0100
commit64af84362db4394146582f311485045377e594b1 (patch)
treeec8889156d741d033d53ee91346dc10a2a30f40c
parent431b684334256c215251a6c460e3bc6120f38423 (diff)
downloadsonarqube-64af84362db4394146582f311485045377e594b1.tar.gz
sonarqube-64af84362db4394146582f311485045377e594b1.zip
SONAR-3269 Add popup window to access full help on markdown
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/markdown_controller.rb27
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb11
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/markdown/full_help.html.erb36
3 files changed, 72 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/markdown_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/markdown_controller.rb
new file mode 100644
index 00000000000..540a9fb6690
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/markdown_controller.rb
@@ -0,0 +1,27 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2012 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# Sonar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+#
+class MarkdownController < ApplicationController
+
+ SECTION=Navigation::SECTION_CONFIGURATION
+
+ def full_help
+ end
+
+end \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb
index c15a405b420..ff1a65a5973 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb
@@ -1,4 +1,10 @@
-<h3><%= message('help_tips') -%></h3>
+<div class="note" style="text-align: right; float: right;">
+ (<a onclick="window.open(this.href,'markdown','height=800,width=900,scrollbars=1,resizable=1');return false;"
+ href="<%= url_for :controller => 'markdown', :action => 'full_help', :layout => 'false' -%>"><%= message('more') -%></a>)
+</div>
+<div style="min-width: 100px">
+<h3><%= message('help_tips') -%> </h3>
+<br/>
<table>
<tr>
<td>*<%= message('bold') -%>*</td>
@@ -13,4 +19,5 @@
<tr>
<td colspan="3">* <%= message('bulleted_point') -%></td>
</tr>
-</table> \ No newline at end of file
+</table>
+</div> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/full_help.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/full_help.html.erb
new file mode 100644
index 00000000000..9b33bb2515e
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/full_help.html.erb
@@ -0,0 +1,36 @@
+<div id="markdown-full-help" style="width:500px">
+<h2>Markdown syntax</h2>
+
+<br/>
+
+<h3>Format text</h3>
+
+<pre class="code">
+*This text will be bold*
+</pre>
+
+<pre class="code">
+* Item 1
+* Item 2
+* Item 3
+</pre>
+
+<pre class="code">
+http://www.google.com is automatically transformed into a link.
+</pre>
+
+<h3>Code</h3>
+
+<pre class="code">
+Please check ``Lists#newArrayList()`` method.
+</pre>
+
+<pre class="code">
+``java
+public void foo() {
+ // do some logic here
+}
+``
+</pre>
+
+</div> \ No newline at end of file