<% function get_youtube_id(url) { var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/; var match = url.match(regExp); if (match && match[2].length == 11) { return match[2]; } else { return false; } } function get_vimeo_id(url) { var regExp = /https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/; var match = url.match(regExp); if (match){ return match[2]; } else { return false; } } function get_dailymotion_id(url) { var regExp = /^(?:(?:http|https):\/\/)?(?:www.)?(dailymotion\.com|dai\.ly)\/((video\/([^_]+))|(hub\/([^_]+)|([^\/_]+)))$/; var match = url.match(regExp); if (match) { if(match[4] !== undefined) { return match[4]; } return match[2]; } return false; } function get_facebook_id(url) { var regExp = /^https?:\/\/www\.facebook\.com\/(?:video\.php\?v=\d+|.*?\/videos\/\d+)\/?$/; var match = url.match(regExp); if (match) { return encodeURIComponent(url); } return false; } %>

× <% if (options.show_node_tooltip_color) { %> <% } %> <% if (node.uri) { %> <% } %> <%=node.title%> <% if (node.uri) { %><% } %>

<% if (node.uri && options.show_node_tooltip_uri) { var video_id = false; if(video_id = get_youtube_id(node.uri)) { %>

<%-renkan.translate("Link")%>

<% } else if(video_id = get_vimeo_id(node.uri)) { %>

<%-renkan.translate("Link")%>

<% } else if(video_id = get_dailymotion_id(node.uri)) { %>

<%-renkan.translate("Link")%>

<% } else if(video_id = get_facebook_id(node.uri)) { %>

<%-renkan.translate("Video link")%>

<% } else { %> <% } } %> <%-renkan.translate("Link to the node")%>