mirror of
https://github.com/201206030/novel-plus.git
synced 2025-06-27 21:56:37 +00:00
文件夹结构调整,新增模版自定义功能
This commit is contained in:
32
templates/orange/static/javascript/ycUtils.js
Normal file
32
templates/orange/static/javascript/ycUtils.js
Normal file
@ -0,0 +1,32 @@
|
||||
var SCYC = {
|
||||
}
|
||||
|
||||
$.extend($.fn.validatebox.defaults.rules, {
|
||||
checkPenName: {
|
||||
validator: function (value, param) {
|
||||
var url = "/author/checkPenName";
|
||||
var data = { penName: value};
|
||||
var bool = false;
|
||||
$.ajax({
|
||||
type: "get",
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
url: url,
|
||||
data: data,
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
if (result.data) {
|
||||
$.fn.validatebox.defaults.rules.checkPenName.message = '笔名已存在,请重新输入';
|
||||
bool = false;
|
||||
} else {
|
||||
$.fn.validatebox.defaults.rules.checkPenName.message = '';
|
||||
bool = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
return bool;
|
||||
message: '';
|
||||
}
|
||||
}
|
||||
|
||||
});
|
Reference in New Issue
Block a user