From efbe29249c49936fa31a812c1ab27dab92c69fbd Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang <jp_lang@yahoo.fr>
Date: Wed, 1 Aug 2007 19:38:13 +0000
Subject: [PATCH] Added icon on external wiki links

git-svn-id: http://redmine.rubyforge.org/svn/trunk@597 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
 app/helpers/application_helper.rb  |   6 +++---
 public/images/external.png         | Bin 0 -> 323 bytes
 public/stylesheets/application.css |  12 ++++++++++++
 3 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 public/images/external.png

diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 7bb809991..2293fcdc0 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -142,17 +142,17 @@ module ApplicationHelper
     # example:
     #   [[link]] -> "link":link
     #   [[link|title]] -> "title":link
-    text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) {|m| "\"#{$3 || $1}\":" + format_wiki_link.call(Wiki.titleize($1)) }
+    text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) {|m| link_to(($3 || $1), format_wiki_link.call(Wiki.titleize($1)), :class => 'wiki-page') }
 
     # turn issue ids into links
     # example:
     #   #52 -> <a href="/issues/show/52">#52</a>
-    text = text.gsub(/#(\d+)(?=\b)/) {|m| link_to "##{$1}", :controller => 'issues', :action => 'show', :id => $1}
+    text = text.gsub(/#(\d+)(?=\b)/) {|m| link_to "##{$1}", {:controller => 'issues', :action => 'show', :id => $1}, :class => 'issue' }
        
     # turn revision ids into links (@project needed)
     # example:
     #   r52 -> <a href="/repositories/revision/6?rev=52">r52</a> (@project.id is 6)
-    text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| link_to "r#{$1}", :controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1} if @project
+    text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| link_to "r#{$1}", {:controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1}, :class => 'changeset' } if @project
     
     # when using an image link, try to use an attachment, if possible
     attachments = options[:attachments]
diff --git a/public/images/external.png b/public/images/external.png
new file mode 100644
index 0000000000000000000000000000000000000000..0561752f47bb733c0840af2d9e713b4dc465f638
GIT binary patch
literal 323
zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V6Od#Ih<F90bW2<#N}P*Q6H7Al^Atidb5j{|
zQ;YNz3>6adf0rm285o!=7#Ug_n^~DyC}<lP8W_YJW19%n$X?><>&kwegHc$Go#W?1
zTc8kUfk$L90|U1Z2s2)~TlWVj$dc~p>&U>cv7h@-A}f$T)6>N<q~cccpa1{unR#^L
z>}E2GZa5G*Jzs`l(#DB9Ppq2xKqi)#z0fezgxO(N`P<m<pRNWgFl+R#k!C4-7y0|=
z>u3cgqko4FEJ~fMpd##Yf8%5JJ9C;9q#D`|<~H6sds2-{q&1o)Br9PB_ZAMV-0W=b
zKt)YmmU7J#nGVGbSElE`=jq+5D0F`QzUJLMf-hKhoL1~>w`SsCxH~IE&^=2-80bg_
MPgg&ebxsLQ0J~jkjQ{`u

literal 0
HcmV?d00001

diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 809bdd024..16206f001 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -639,6 +639,18 @@ div.wiki table, div.wiki td {
     padding: 4px;
 }
 
+div.wiki a {
+    background-position: 0% 60%;
+    background-repeat: no-repeat;
+    padding-left: 12px;
+    background-image: url(../images/external.png);
+}
+
+div.wiki a.wiki-page, div.wiki a.issue, div.wiki a.changeset {
+    padding-left: 0;
+    background-image: none;
+}
+
 div.wiki code {
     font-size: 1.2em;
 }
-- 
GitLab