diff --git a/src/Valine.js b/src/Valine.js index b0af2599..bd5a8d41 100644 --- a/src/Valine.js +++ b/src/Valine.js @@ -7,7 +7,7 @@ const AV = require('leancloud-storage'); var GRAVATAR_BASE_URL = 'https://gravatar.loli.net/avatar/'; var DEFAULT_EMAIL_HASH = '9e63c80900d106cbbec5a9f4ea433a3e'; -var IP_SERVICE = 'https://api.ipify.org/?format=json' +var IP_SERVICE = 'https://api.ipify.org/?format=json'; var i18n_set = { @@ -82,6 +82,7 @@ var defaultComment = { var disable_av_init = false; var MAX_NEST_LEVEL = 3; var PAGE_SIZE = 6; +var ADMIN_EMAIL_HASH = ''; const toString = {}.toString; const store = localStorage; @@ -109,11 +110,12 @@ class Valine { let _root = this; let av = option.av || AV; // disable_av_init = option.disable_av_init || false; - MAX_NEST_LEVEL = option.maxNest || MAX_NEST_LEVEL; - PAGE_SIZE = option.pageSize || PAGE_SIZE; + MAX_NEST_LEVEL = option.max_nest || MAX_NEST_LEVEL; + PAGE_SIZE = option.page_size || PAGE_SIZE; let lang = option.lang || 'en'; _root.i18n = option.i18n || i18n_set[lang]; defaultComment['url'] = option.pathname || location.pathname.replace(/\/$/, ''); + ADMIN_EMAIL_HASH = option.admin_email_hash || ADMIN_EMAIL_HASH; try { let el = toString.call(option.el) === "[object HTMLDivElement]" ? option.el : document.querySelectorAll(option.el)[0]; if (toString.call(el) != '[object HTMLDivElement]') { @@ -485,8 +487,8 @@ class Valine { ${_root.i18n['reply']}