diff -r 4f6118afabee -r 4fbe94af93e8 common/corpus-common-addon/addon/components/doc-location.js --- a/common/corpus-common-addon/addon/components/doc-location.js Thu Nov 03 11:14:41 2016 +0100 +++ b/common/corpus-common-addon/addon/components/doc-location.js Fri Nov 04 19:03:25 2016 +0100 @@ -1,5 +1,5 @@ import Ember from 'ember'; -import * as constants from 'corpus-common-addon/utils/constants'; +import * as utils from 'corpus-common-addon/utils/utils'; import layout from '../templates/components/doc-location'; export default Ember.Component.extend({ @@ -16,14 +16,7 @@ })), code: Ember.computed('url', function () { - let rawLocation = this.get('url'); - const m = rawLocation.match(constants.GEONAMES_BASE_URLS); - - if (m) { - rawLocation = rawLocation.slice(m[0].length); - } - - return rawLocation.replace(/\/+$/, ''); + return utils.getGeonamesCode(this.get('url')); }), isLocationLink: Ember.computed.match('url', /^http:\/\//)