Project

General

Profile

Actions

Patch #6096

open

Highlighting Skype links in wiki

Added by Michail Svarichevsky over 13 years ago. Updated almost 10 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Text formatting
Target version:
-
Start date:
2010-08-10
Due date:
% Done:

0%

Estimated time:

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
Actions #1

Updated by Mischa The Evil over 13 years ago

  • Tracker changed from Feature to Patch
  • Category set to Text formatting
Actions #2

Updated by Jean-Baptiste Barth over 13 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.

Actions #3

Updated by Andriy Lesyuk almost 10 years ago

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

Actions

Also available in: Atom PDF