Skip to content

Commit

Permalink
some update 2019-03-29 17:50
Browse files Browse the repository at this point in the history
  • Loading branch information
xCss committed Mar 29, 2019
1 parent 2a93190 commit 36e1867
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dist/Valine.Pure.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/Valine.min.js

Large diffs are not rendered by default.

24 changes: 1 addition & 23 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ ValineFactory.prototype.init = function (option) {

_avatarSetting['params'] = `?d=${(ds.indexOf(avatar) > -1 ? avatar : 'mp')}&v=${VERSION}${force}`;
_avatarSetting['hide'] = avatar === 'hide' ? true : false;
_avatarSetting['cdn'] = /^https?\:\/\//.test(avatar_cdn) ? avatar_cdn : _avatarSetting['cdn']
_avatarSetting['cdn'] = LINKREG.test(avatar_cdn) ? avatar_cdn : _avatarSetting['cdn']

_path = option.path || _path;

Expand Down Expand Up @@ -819,12 +819,6 @@ ValineFactory.prototype.bind = function (option) {
}
defaultComment['nick'] = defaultComment['nick'] || 'Anonymous';

// veirfy
let mailRet = check.mail(defaultComment.mail);
let linkRet = check.link(defaultComment.link);
defaultComment['mail'] = mailRet.k ? mailRet.v : '';
defaultComment['link'] = linkRet.k ? linkRet.v : '';
// console.log(defaultComment)
// return;
if (root.notify || root.verify) {
verifyEvt(commitEvt)
Expand Down Expand Up @@ -986,22 +980,6 @@ ValineFactory.prototype.bind = function (option) {
})
}

const check = {
mail(m) {
return {
k: /[\w-\.]+@([\w-]+\.)+[a-z]{2,3}/.test(m),
v: m
};
},
link(l) {
l = l.length > 0 && (/^https?/.test(l) ? l : `http://${l}`);
return {
k: /^https?:\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(l),
v: l
};
}
}

function Valine(options) {
return new ValineFactory(options)
}
Expand Down

0 comments on commit 36e1867

Please sign in to comment.