Skip to content

Commit

Permalink
Merge remote-tracking branch 'copro/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Orbiter committed Jan 23, 2013
2 parents 4735bd4 + 0025983 commit 31e854b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
15 changes: 14 additions & 1 deletion htroot/WikiHelp.html
Expand Up @@ -123,7 +123,8 @@ <h2>Wiki-Code</h2>

<tr valign="top">
<td class="tt">
[url]<br />[url description]
[url]<br />
[url description]
</td>
<td>
This tag creates links to external websites.
Expand All @@ -141,6 +142,18 @@ <h2>Wiki-Code</h2>
</td>
</tr>

<tr valign="top">
<td class="tt">
<span class="tt" style="white-space: nowrap;">[[Youtube:id]]</span><br />
<span class="tt" style="white-space: nowrap;">[[Vimeo:id]]</span><br />
</td>
<td>
This tag displays a Youtube or Vimeo video with the id specified and fixed width 425 pixels and height 350 pixels.<br />
i.e. use [[Youtube:QZsWG4-7Qfk]] to embed this video: https://www.youtube.com/watch?v=QZsWG4-7Qfk<br />
i.e. use [[Vimeo:32200946]] to embed this video: http://vimeo.com/32200946<br />
</td>
</tr>

<tr valign="top">
<td class="tt">
{|<br />
Expand Down
5 changes: 4 additions & 1 deletion locales/de.lng
Expand Up @@ -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
#-----------------------------
Expand Down
14 changes: 14 additions & 0 deletions source/net/yacy/data/wiki/WikiCode.java
Expand Up @@ -114,6 +114,8 @@ private static enum Tags {
private static final String WIKI_CLOSE_PRE_ESCAPED = "&lt;/pre&gt;";
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 = "&lt;pre&gt;";

private static final char ASTERISK = '*';
Expand All @@ -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();
Expand Down Expand Up @@ -636,6 +640,16 @@ private static String processLinksAndImages(final String hostport, String line)
}

line = line.substring(0, positionOfOpeningTag) + "<img src=\"" + kl + "\"" + align + alt + ">" + 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) + "" + "<object width=\"425\" height=\"350\"><param name=\"movie\" value=\"http://www.youtube.com/v/" + kl + "\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.youtube.com/v/" + kl + "\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"425\" height=\"350\"></embed></object>";
}
// 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) + "" + "<iframe src=\"http://player.vimeo.com/video/" + kl + "\" width=\"425\" height=\"350\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>";
}
// if it's no image, it might be an internal link
else {
Expand Down

0 comments on commit 31e854b

Please sign in to comment.