This tag creates links to external websites.
@@ -141,6 +142,18 @@
Wiki-Code
+
+
+ [[Youtube:id]]
+ [[Vimeo:id]]
+
+
+ This tag displays a Youtube or Vimeo video with the id specified and fixed width 425 pixels and height 350 pixels.
+ i.e. use [[Youtube:QZsWG4-7Qfk]] to embed this video: https://www.youtube.com/watch?v=QZsWG4-7Qfk
+ i.e. use [[Vimeo:32200946]] to embed this video: http://vimeo.com/32200946
+
+
+
{|
diff --git a/locales/de.lng b/locales/de.lng
index b6de14c617..62a7396e6b 100644
--- a/locales/de.lng
+++ b/locales/de.lng
@@ -3240,13 +3240,16 @@ pagename==Seitenname
description\]\]==Beschreibung]]
This tag creates links to other pages of the wiki.==Dieser Tag erzeugt einen Link zu einer anderen Seite im Wiki.
This tag displays an image, it can be aligned left, right or center.==Dieser Tag fügt ein Bild ein, es kann links (left), rechts (right) oder mittig (center) ausgerichtet werden.
+This tag displays a Youtube or Vimeo video with the id specified and fixed width 425 pixels and height 350 pixels.==Dieser Tag fügt ein Youtube oder Vimeo Video mit der angegeben id und einer fixen Höhe von 425 Pixeln und einer fixen Breite von 350 Pixeln ein.
+i.e. use==z.B. wird mit
+to embed this video:==dieses Video eingebunden:
These tags create a table, whereas the first marks the beginning of the table, the second starts==Diese Tags erstellen eine Tabelle, wobei der erste den Anfang der Tabelle markiert, der zweite beginnt
a new line, the third and fourth each create a new cell in the line. The last displayed tag==eine neue Zeile, der dritte und vierte erzeugen eine neue Zelle in der Zeile. Der zuletzt dargestellte Tag
closes the table.==schließt die Tabelle.
#The escape tags will cause all tags in the text between the starting and the closing tag to not be treated as wiki-code.==Durch diesen Tag wird der Text, der zwischen den Klammern steht, nicht interpretiert und unformatiert als normaler Text ausgegeben.
A text between these tags will keep all the spaces and linebreaks in it. Great for ASCII-art and program code.==Ein Text zwischen diesen Tags wird alle Leerzeichen und Zeilenumbrüche beinhalten. Gut geeignet für ASCII-Kunst und Programm Code.
If a line starts with a space, it will be displayed in a non-proportional font.==Wenn eine Zeile mit einem Leerzeichen anfängt, wird diese als nicht-proportionale Schriftart dargestellt.
-url description==URL Beschreibung
+url description==url Beschreibung
This tag creates links to external websites.==Dieser Tag erstellt einen Link zu einer externen Internetseite.
alt text==alt Beschreibung
#-----------------------------
diff --git a/source/net/yacy/data/wiki/WikiCode.java b/source/net/yacy/data/wiki/WikiCode.java
index 4f4661aa31..44c84149b0 100644
--- a/source/net/yacy/data/wiki/WikiCode.java
+++ b/source/net/yacy/data/wiki/WikiCode.java
@@ -114,6 +114,8 @@ private static enum Tags {
private static final String WIKI_CLOSE_PRE_ESCAPED = "</pre>";
private static final String WIKI_HR_LINE = "----";
private static final String WIKI_IMAGE = "Image:";
+ private static final String WIKI_VIDEO_YOUTUBE = "Youtube:";
+ private static final String WIKI_VIDEO_VIMEO = "Vimeo:";
private static final String WIKI_OPEN_PRE_ESCAPED = "<pre>";
private static final char ASTERISK = '*';
@@ -131,6 +133,8 @@ private static enum Tags {
private static final int LEN_WIKI_OPEN_LINK = WIKI_OPEN_LINK.length();
private static final int LEN_WIKI_CLOSE_LINK = WIKI_CLOSE_LINK.length();
private static final int LEN_WIKI_IMAGE = WIKI_IMAGE.length();
+ private static final int LEN_WIKI_VIDEO_YOUTUBE = WIKI_VIDEO_YOUTUBE.length();
+ private static final int LEN_WIKI_VIDEO_VIMEO = WIKI_VIDEO_VIMEO.length();
private static final int LEN_WIKI_OPEN_EXTERNAL_LINK = WIKI_OPEN_EXTERNAL_LINK.length();
private static final int LEN_WIKI_CLOSE_EXTERNAL_LINK = WIKI_CLOSE_EXTERNAL_LINK.length();
private static final int LEN_WIKI_HR_LINE = WIKI_HR_LINE.length();
@@ -636,6 +640,16 @@ private static String processLinksAndImages(final String hostport, String line)
}
line = line.substring(0, positionOfOpeningTag) + "" + line.substring(positionOfClosingTag + LEN_WIKI_CLOSE_LINK);
+ }
+ // this is the part of the code that is responsible for Youtube video links supporting only the video ID as parameter
+ else if (kl.startsWith(WIKI_VIDEO_YOUTUBE)) {
+ kl = kl.substring(LEN_WIKI_VIDEO_YOUTUBE);
+ line = line.substring(0, positionOfOpeningTag) + "" + "";
+ }
+ // this is the part of the code that is responsible for Vimeo video links supporting only the video ID as parameter
+ else if (kl.startsWith(WIKI_VIDEO_VIMEO)) {
+ kl = kl.substring(LEN_WIKI_VIDEO_VIMEO);
+ line = line.substring(0, positionOfOpeningTag) + "" + "";
}
// if it's no image, it might be an internal link
else {