/**
* @defgroup plugins_pubIds_urn_js
*/
/**
* @file plugins/pubIds/urn/js/FieldTextUrn.js
*
* Copyright (c) 2014-2021 Simon Fraser University
* Copyright (c) 2003-2021 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @brief A Vue.js component for URN text form field, that is used for custom suffixes, and that considers adding a check number.
*/
var template = pkp.Vue.compile('
' +
' ' +
' ' +
'
' +
' ' +
' ' +
' ' +
'
' +
'
' +
' ');
pkp.Vue.component('field-text-urn', {
name: 'FieldTextUrn',
extends: pkp.Vue.component('field-text'),
props: {
addCheckNumberLabel: {
type: String,
required: true
},
urnPrefix: {
type: String,
required: true
},
applyCheckNumber: {
type: Boolean,
required: true
}
},
methods: {
/**
* Add a check number to the end of the URN
*/
addCheckNumber() {
this.currentValue += $.pkp.plugins.generic.urn.getCheckNumber(this.currentValue, this.urnPrefix);
}
},
render: function(h) {
return template.render.call(this, h);
}
});