author | ymh <ymh.work@gmail.com> |
Wed, 22 Feb 2017 17:58:25 +0100 | |
changeset 521 | b3c738a20af8 |
parent 502 | 74fba571487e |
permissions | -rw-r--r-- |
502
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
import Ember from 'ember'; |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
import layout from '../templates/components/doc-dcmi'; |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
import * as constants from 'corpus-common-addon/utils/constants'; |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
import * as utils from 'corpus-common-addon/utils/utils'; |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
|
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
export default Ember.Component.extend({ |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
layout, |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
tagName: 'span', |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
code: Ember.computed('url', function () { |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
const url = this.get('url'); |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
|
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
if (utils.isDCMILink(url)) { |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
return url.substring(constants.DCMI_BASE_URL.length); |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
} |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
|
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
return url; |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
}) |
74fba571487e
Complete the notice display. add various fields to document to correctly display the notice. Correct bug #0025746
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
}); |