common/corpus-common-addon/app/services/bnf-resolver.js
changeset 339 766af1228b05
parent 328 04e728651a48
--- a/common/corpus-common-addon/app/services/bnf-resolver.js	Sun Oct 16 22:23:31 2016 +0530
+++ b/common/corpus-common-addon/app/services/bnf-resolver.js	Sun Oct 16 23:19:57 2016 +0530
@@ -4,31 +4,34 @@
 
 export default ResolverService.extend({
 
-    storeKeyBase: 'bnf',
-    apiPath:  '/api/v1/resolvers/bnf/',
-    resDocRoot: 'bnfids',
+  storeKeyBase: 'bnf',
+  apiPath: '/api/v1/resolvers/bnf/',
+  resDocRoot: 'bnfids',
 
-    init() {
-        this._super(...arguments);
-        console.log("BNF", this);
-    },
+  init(...args) {
+    this._super(...args);
+  },
+
+  processId: function (id) {
+    let bnfId = id;
 
-    processId: function(id) {
-        var bnfId = id;
-        if(id.startsWith(constants.BNF_BASE_URL + constants.BNF_ARK_BASE_ID)) {
-            bnfId = id.slice((constants.BNF_BASE_URL + constants.BNF_ARK_BASE_ID).length);
-        }
-        else if (id.startsWith(constants.BNF_ARK_BASE_URL + constants.BNF_ARK_BASE_ID)) {
-            bnfId = id.slice((constants.BNF_ARK_BASE_URL + constants.BNF_ARK_BASE_ID).length);
-        }
-        else if (id.startsWith(constants.BNF_ARK_BASE_ID)) {
-            bnfId = id.slice(constants.BNF_ARK_BASE_ID.length);
-        }
-        return bnfId;
-    },
+    if (id.startsWith(constants.BNF_BASE_URL + constants.BNF_ARK_BASE_ID)) {
+      bnfId = id.slice((constants.BNF_BASE_URL + constants.BNF_ARK_BASE_ID).length);
+    } else if (id.startsWith(constants.BNF_ARK_BASE_URL + constants.BNF_ARK_BASE_ID)) {
+      bnfId = id.slice((constants.BNF_ARK_BASE_URL + constants.BNF_ARK_BASE_ID).length);
+    } else if (id.startsWith(constants.BNF_ARK_BASE_ID)) {
+      bnfId = id.slice(constants.BNF_ARK_BASE_ID.length);
+    }
 
-    getReturnDictKey: function(id) { return constants.BNF_ARK_BASE_ID+id; },
+    return bnfId;
+  },
 
-    getLabel: function(id) { return this.getName(id); }
+  getReturnDictKey: function (id) {
+    return constants.BNF_ARK_BASE_ID + id;
+  },
+
+  getLabel: function (id) {
+    return this.getName(id);
+  }
 
 });