Revision 116770 of Template:DOMProp

  • Revision slug: Template:DOMProp
  • Revision title: Template:DOMProp
  • Revision id: 116770
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 132 words added, 185 words removed
Tags: 

Revision Content

/* one parameter: property name */
/* get the page language */

var u = uri.parts(Page.uri);
var lang = u.path[0];
if (string.contains(lang, "project") || string.contains(lang, "Project")) {
  lang = string.substr(lang, 8);
}
var dispName = $0;

var destOldType = lang + '/DOM:element.' + $0;
var destNewType = lang + '/DOM/element.' + $0;

if (wiki.pageExists(destNewType)) {
 (web.link(wiki.uri(destNewType), dispName))
} else if (wiki.pageExists(destOldType)) {
  (web.link(wiki.uri(destOldType), dispName))
} else {
  <a rel=('internal') href=(wiki.uri(destNewType)) class=('new')>dispNamea>;
}

%>
      

Revision Source

<pre class="script">
/* one parameter: property name */
/* get the page language */

var u = uri.parts(Page.uri);
var lang = u.path[0];
if (string.contains(lang, "project") || string.contains(lang, "Project")) {
  lang = string.substr(lang, 8);
}
var dispName = $0;

var destOldType = lang + '/DOM:element.' + $0;
var destNewType = lang + '/DOM/element.' + $0;

if (wiki.pageExists(destNewType)) {
 <code>(web.link(wiki.uri(destNewType), dispName))</code>
} else if (wiki.pageExists(destOldType)) {
  <code>(web.link(wiki.uri(destOldType), dispName))</code>
} else {
  <code><<span class="start-tag">a</span><span class="attribute-name"> rel</span>=(<span class="attribute-value">'internal') </span><span class="attribute-name">href</span><span>=</span>(<span>wiki.uri(</span>destNewType<span>)) </span><span class="attribute-name">class</span>=<span class="attribute-value">('new')></span>dispName</<span class="end-tag">a></span></code>;
}

%>