Actions
Patch #6096
openHighlighting Skype links in wiki
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
Updated by Mischa The Evil over 14 years ago
- Tracker changed from Feature to Patch
- Category set to Text formatting
Updated by Jean-Baptiste Barth over 14 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.
Updated by Andriy Lesyuk over 10 years ago
Similar link can be rendered using the custom macros feature of WikiNG 1.0.0b.
Actions