Changes

Jump to navigation Jump to search
remove obsolete script
Line 230: Line 230:  
| The mod's compatibility status hasn't been tested. This should only be used as a placeholder (e.g. when adding a new beta), it should never be used long since that defeats the purpose of the compatibility list.
 
| The mod's compatibility status hasn't been tested. This should only be used as a placeholder (e.g. when adding a new beta), it should never be used long since that defeats the purpose of the compatibility list.
 
|}
 
|}
  −
==Script==
  −
This script generates the template call when run from a Nexus or Chucklefish mod page.
  −
<syntaxhighlight lang="javascript">
  −
switch(location.host)
  −
{
  −
case "www.nexusmods.com":
  −
var url = location.origin + location.pathname.replace(/\/*$/, '');
  −
var name = $(".header-name").text();
  −
var author = $(".uploader a").text();
  −
var author2 = $(".header-author strong").text();
  −
break;
  −
  −
case "community.playstarbound.com":
  −
var url = location.origin + location.pathname.replace(/\/*$/, '');
  −
var name = $.trim($("h1:first").contents().first().text());
  −
var author = $(".primaryContent[data-author]:first").attr("data-author");
  −
break;
  −
  −
default:
  −
throw `Unknown domain: ${location.host}`;
  −
}
  −
  −
var template = `
  −
{{/entry
  −
  |name    = ${name}
  −
  |author  = ${author}`;
  −
if(author2 && author2 != author)
  −
  template += '\n' + `  |author2 = ${author2}`;
  −
template += `
  −
  |url    = ${url}
  −
  |status  = ok
  −
  |summary =
  −
  |source  =
  −
}}
  −
`;
  −
</syntaxhighlight>
      
[[Category:Modding]]
 
[[Category:Modding]]
translators
8,445

edits

Navigation menu