From d1b1b7ee3991cbdfc32a85d7de045bc6beea3702 Mon Sep 17 00:00:00 2001 From: Alain Borel Date: Fri, 3 Nov 2023 13:42:33 +0100 Subject: [PATCH] set upload title for unpublished Zenodo records --- zenodo_greasemonkey.user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zenodo_greasemonkey.user.js b/zenodo_greasemonkey.user.js index c168e4e..90c3f5c 100644 --- a/zenodo_greasemonkey.user.js +++ b/zenodo_greasemonkey.user.js @@ -23,7 +23,6 @@ // R5, N4 better left out of automatic checking // TODO R2 appears twice in the feedback message??? -// TODO the title and link to the dataset is broken for records that are not published yet const checkLevels = [{"short": "must", "full": "MUST (mandatory for acceptance into the collection)"}, {"short": "recommended", "full": "RECOMMENDED"}, {"short": "nth", "full": "NICE-TO-HAVE"}]; @@ -513,6 +512,13 @@ function addButtons() { var zenodoURL = window.location.href; let title = document.title.replace(' | Zenodo', ''); + if (title == "Zenodo") { + possibleTitle = $("h2.request-header"); + if (possibleTitle.length) { + title = possibleTitle.text(); + identifier = "unpublished" + } + } console.log(title); console.log(zenodoURL);