Skip to content

Commit

Permalink
Feature: Automatically convert old NL citation to HNW citation
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBizzle committed Apr 30, 2024
1 parent 711ee75 commit 84ad412
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/host/ui/nlw-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class HostNLWManager extends NLWManager {
}

case "nlw-model-info": {
const msg = { type: "hnw-model-info", info: data.info };
const msg = { type: "hnw-model-info", info: citeHNW(data.info) };
this.#infoPanePort.postMessage(msg);
break;
}
Expand Down Expand Up @@ -260,3 +260,10 @@ const setUpComCen = (nlogo, frame, url, relay) => {
return setUpPane(nlogo, frame, url, onMsg, onloadType, urlSuffix);

};

// (String) => String
const citeHNW = (original) => {
const str = `^\s*Please cite the NetLogo software as:.*?Wilensky.*?$`;

Check failure on line 266 in js/host/ui/nlw-manager.js

View workflow job for this annotation

GitHub Actions / build (14.x)

Strings must use doublequote

Check failure on line 266 in js/host/ui/nlw-manager.js

View workflow job for this annotation

GitHub Actions / build (14.x)

Unnecessary escape character: \s

Check failure on line 266 in js/host/ui/nlw-manager.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Strings must use doublequote

Check failure on line 266 in js/host/ui/nlw-manager.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Unnecessary escape character: \s
const citation = "Please cite the HubNet Web software as:\n\n* Wilensky, U. Bertsche, J. & Stroup, W. (2024). **HubNet Web 1.0** [Computer Software]. Evanston, IL: Center for Connected Learning and Computer Based Modeling, Northwestern University. https://hubnetweb.org/";
return original.replace(new RegExp(str, "ms"), citation);
};

0 comments on commit 84ad412

Please sign in to comment.