Hilite Pure

When you are a customer of a web-based service that allows you to tweak only some elements of the web appearance but not all of them, you begin to wonder should you do something about it yourself. One such service is the Pure CRIS by Elsevier, one of the central digital systems at Aalto University since last fall.

Currently, many Aalto Pure users are typing in data on activities such as visits abroad, talks, memberships, etc. Together with publications, activities are the backbone of one’s academic CV. Moreover, like all Finnish universities, Aalto has the obligation of sending an annual report on certain aspects of activities to the Ministry. These are e.g. internationality, and country. If you gave your talk abroad, we want to know about this thank you, and also, where exactly was it.

The Pure GUI is a bundle of vertically lengthy, separate windows with multiple buttons and fields. Many fields are extra whereas some are marked obligatory by the vendor. Leaving them unfilled rightly prevents one from saving the record. This is fine. However, how do we tell our users that please, check also International activity and Country? In Pure parlance, these two fields are keywords on activities. Ideally, these should be obligatory too.

Elsevier does not change the core functionality of its product on a single client basis; enhancement requests need the acceptance of the national user group to start with. And even though our friends in Finland would sign our request (I suppose they would), that doesn’t guarantee that Elsevier will add the familiar red star to these two fields, and tweak their program code correspondingly. Note that Elsevier is no exception here, software vendors often work like this. And to be fair, who knows how long our Ministry is interested in internationality. They may drop it next year.

The way we deal with this small challenge at the moment is brute force: within keyword configuration, we have wrapped the keyword name inside an HTML span element, and added a style attribute to it. What this effectively does is that wherever the keyword name is visible in the GUI, it comes with a yellow background. Unfortunately in our case, the HTML is not always rendered but the name is used verbatim too. This clutters the canvas with angle brackets.

How about changing the DOM on the fly? As a proof-of-concept, I followed the instructions on Mozilla WebExtensions.

First I saved these two files in a directory Yellowify:

manifest.json

{

  "manifest_version": 2,
  "name": "Yellowify",
  "version": "1.0",

  "description": "Adds a yellow background to span elements with text 'International activity' or 'Country' on webpages matching aalto.fi.",

  "content_scripts": [
    {
      "matches": ["*://*.aalto.fi/*"],
      "js": ["yellow.js"]
    }
  ]
}

yellow.js

// There are matching span elements also as childs of an H2 element 
// but we don't want to color them 
var el = document.querySelectorAll('label > span')

for(var i = 0; i < el.length; i++)
{
   var text = el[i].textContent;

   if (text == "International activity" || text == 'Country') 
    { 
      el[i].style.backgroundColor = "yellow";
     }
}

Then I opened about:debugging in Firefox, loaded yellow.js as a temporary add-on, and navigated to a new Pure activity page.

New Pure activity with highlighted fields

New Pure activity with highlighted fields

So far so good!

But of course this functionality is now for me personally, on this computer, in this browser, and even here only temporarily. To propagate the hilite as a semi-permanent feature within the whole university to all Pure users is not going to happen. There are too many different platforms and browsers out there.

Posted by Tuija Sonkkila

About Tuija Sonkkila

Data Curator at Aalto University. When out of office, in the (rain)forest with binoculars and a travel zoom.
This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

Comments are closed.