Where does OJS use tag-it.js

Hi,

While writing a keywords related plugin I noticed that OJS is loading the tag-it.js.
(lib/pkp/js/lib/jquery/plugins/jquery.tag-it.js).

Where does OJS use that script?

Hi @ajnyga,

The tag-it plugin is used for the keywords input (submission metadata) and the reviewer interests (registration/profile/user edit forms).

Regards,
Alec Smecher
Public Knowledge Project Team

Do you have to activate it someway? Because I haven’t noticed it showing up in the keyword field.

Hi @ajnyga,

What version of OJS are you using? Also, I’d suggest using a tool like Firebug to check if you’re encountering any Javascript errors that might be preventing the plugin from initializing.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,

The latest 2.4.7.1. I do use Firebug and there are no errors on the form.

I did see it on the interests field and it is working on that form. However, if I edit article metadata, I get a plain text field. And if I check the source on that page, there is no javascript that would activate that field. I am probably missing something.

I already wrote a plugin that uses an external JSON API and chose tag-it before realizing that OJS is actually loading that by default. The plugin works fine, but maybe it should use the existing tag-it code in some way. But while I do not seem to find that code it is a bit difficult :smile:

The plugin is here: GitHub - ajnyga/jsonKeywords: Plugin for Open Journal Systems. Activates autocompletion in keywords metadata fields and uses an ajax call for the source.

Hi @anjali,

Actually, you’re correct – I was misremembering OJS 2.4.x. In the current stable release the subject field is not using tag-it; only the reviewer interests field is. (OJS 3.0, in active development, will more broadly support tag inputs.)

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks, I will check the 3.0 code and see if the plugin is needed later.

Without having seen the new code, it would be nice if you could define an external JSON source out of the box and the default would be the already added list of keywords.