Changes

Jump to navigation Jump to search
remove obsolete script
Line 309: Line 309:  
| The mod is no longer needed and should be removed.
 
| The mod is no longer needed and should be removed.
 
|}
 
|}
  −
==Script==
  −
This script generates the template call when run from a Nexus or Chucklefish mod page.
  −
<source 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 += `, ${author2}`;
  −
template += `
  −
  |url    = ${url}
  −
  |status  = ok
  −
  |summary =
  −
  |source  =
  −
}}
  −
`;
  −
</source>
      
[[de:Modding:SMAPI Kompatibilität/entry]]
 
[[de:Modding:SMAPI Kompatibilität/entry]]
translators
8,403

edits

Navigation menu