Template:expTrevorh3

  • Revision slug: Template:expTrevorh3
  • Revision title: Template:expTrevorh3
  • Revision id: 353059
  • Created:
  • Creator: trevorh
  • Is current revision? No
  • Comment

Revision Content

<% var str, found, url, width = $1 > 0 ? $1 : 250, height = $2 > 0 ? $2 : 250; var widthHeight = "width='" + width + "' height='" + height + "' "; str = '

Unable to find file ' + $0 + '

'; env.files.forEach(function (aFile) { if(!found && $0 === aFile.filename) { found = true; // var p = kuma.url.parse(env.url, true); // url = p.protocol + '//' + p.host + aFile.url; url = aFile.url; // str = ''; str = ''; } }); %> <%- str %>

Revision Source

<%
var str,
    found,
    url,
    width  = $1 > 0 ? $1 : 250,
    height = $2 > 0 ? $2 : 250;

var widthHeight = "width='" + width + "' height='" + height + "' ";

str = '<p>Unable to find file <em>' + $0 + '</em></p>';

env.files.forEach(function (aFile) {
    if(!found && $0 === aFile.filename) {
        found = true;
//        var p = kuma.url.parse(env.url, true);
//        url = p.protocol + '//' + p.host + aFile.url;
        url = aFile.url;
//        str = '<img ' + widthHeight + 'src="' + url + '">';
        str = '<iframe  frameborder="1" ' + widthHeight + 'src="' + url + '" sandbox="allow-scripts"></iframe>';
    }
});
%>
<%- str %>
Revert to this revision