common/corpus-common-addon/addon/components/doc-olac.js
author ymh <ymh.work@gmail.com>
Fri, 08 Sep 2017 12:04:06 +0200
changeset 541 e756a8c72c3d
parent 536 b64c8c35c67d
permissions -rw-r--r--
integrate drupal and correct build process. update version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
490
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import Ember from 'ember';
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
import layout from '../templates/components/doc-olac';
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
import DocLiteral from './doc-literal';
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
import * as utils from 'corpus-common-addon/utils/utils';
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
export default DocLiteral.extend({
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
  layout,
536
b64c8c35c67d add a external link icon to viaf links, correct bug #27355 (https://mantis.culture.fr/mantis/view.php?id=27355)
ymh <ymh.work@gmail.com>
parents: 490
diff changeset
     8
  classNames: ['doc-lit-olac'],
490
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
  olacUrl: Ember.computed('url', function () {
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
    const url = this.get('url');
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    const value = this.get('value');
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    const olacDef = utils.getOLACBaseUrl(url);
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
    if (!olacDef) {
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
      return '';
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    }
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    return olacDef.baseUrl + value;
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
  })
76da86cf9696 External OLAC links leads now to the OLAC documentation. Closes #0025936
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
});