Template:Embed text

  • Revision slug: Template:Embed_text
  • Revision title: Template:Embed text
  • Revision id: 289466
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

<%   var found = false;   var allFiles = map.values(page.files);     allFiles.forEach(function(aFile) {     if (string.compare(args[0], aFile.name, true) == 0) {       found = true;       if (#args > 1) {         syntax[args[1]](web.text(aFile.uri));       } else {         web.text(aFile.uri);       }       break;     }   });     if (!found) {     web.html("

Unable to find file '" + args[0] + "'.

");   } %>

Revision Source

<% 
  var found = false;
  var allFiles = map.values(page.files);
  
  allFiles.forEach(function(aFile) {
    if (string.compare(args[0], aFile.name, true) == 0) {
      found = true;
      if (#args > 1) {
        syntax[args[1]](web.text(aFile.uri));
      } else {
        web.text(aFile.uri);
      }
      break;
    }
  });
  
  if (!found) {
    web.html("<p>Unable to find file '" + args[0] + "'.</p>");
  }
%>
Revert to this revision