Patch #6096

Highlighting Skype links in wiki

Added by Michail Svarichevsky about 11 years ago. Updated over 7 years ago.

Status:NewStart date:2010-08-10
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Text formatting
Target version:-

Description

I've implemented this for my 1.0 redmine, and it is very useful for team list thing.

Work like this:

skypei:michail_31415

Gets converted to:

 <a href="skype:michail_31415?chat"><img src="http://mystatus.skype.com/smallclassic/michail_31415" style="border: none; width:114px;height:20px;"></img></a>

Patch included:

/lib/redmine/wiki_formatting/textile/

Index: formatter.rb
===================================================================
--- formatter.rb        (revision 3918)
+++ formatter.rb        (working copy)
@@ -24,7 +24,7 @@
         include ActionView::Helpers::TagHelper

         # auto_link rule after textile rules so that it doesn't break !image_url! tags
-        RULES = [:textile, :block_markdown_rule, :inline_auto_link, :inline_auto_mailto, :inline_toc]
+        RULES = [:textile, :block_markdown_rule, :inline_auto_link, :inline_auto_mailto, :inline_auto_skype, :inline_toc]

         def initialize(*args)
           super

@@ -157,6 +157,16 @@
             end
           end
         end
+
+        # Turns all skype addresses into clickable links which starts chat automagically
+        def inline_auto_skype(text)
+          text.gsub!(/skypei:([a-zA-Z0-9_\.-]+)/) do
+            all, skype = $&, $1
+            # This would not match after replacement
+            content_tag('a', content_tag('img', "", :src => "http://mystatus.skype.com/smallclassic/" + skype, :style => "border: none; width:114px;height:20px;"), :href => "skype:" + skype + "?chat")
+          end
+        end
+
       end
     end
   end

History

#1 Updated by Mischa The Evil about 11 years ago

  • Tracker changed from Feature to Patch
  • Category set to Text formatting

#2 Updated by Jean-Baptiste Barth about 11 years ago

It needs some tests, plus we can't integrate it in 1.0.1 since we want to do a bugfix release. But maybe it could be included in 1.1.0.

#3 Updated by Andriy Lesyuk over 7 years ago

Similar link can be rendered using the custom macros feature of WikiNG 1.0.0b.

Also available in: Atom PDF