更新文件注释

This commit is contained in:
邹景立 2017-02-24 11:11:12 +08:00
parent 512b346daa
commit 5a8887832c
3 changed files with 67 additions and 15 deletions

View File

@ -1,6 +1,22 @@
/* global require, layer, layui */
var a = document.scripts, c = a[a.length - 1].src, baseUrl = c.substring(0, c.lastIndexOf("/") + 1);
// +----------------------------------------------------------------------
// | Think.Admin
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
// 当前资源URL目录
var baseUrl = (function () {
var scripts = document.scripts, src = scripts[scripts.length - 1].src;
return src.substring(0, src.lastIndexOf("/") + 1);
})();
// RequireJs 配置参数
require.config({
baseUrl: baseUrl,
waitSeconds: 0,
@ -40,6 +56,7 @@ require.config({
'admin.listen': {deps: ['jquery', 'jquery.cookies', 'admin.plugs']},
},
deps: ['css!//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css'],
// 开启debug模式不缓存资源
urlArgs: "t=" + (new Date()).getTime()
});
@ -47,6 +64,7 @@ window.WEB_SOCKET_SWF_LOCATION = "//cdn.bootcss.com/web-socket-js/1.0.0/WebSocke
window.UEDITOR_HOME_URL = (window.ROOT_URL ? window.ROOT_URL + '/static/' : baseUrl) + '../plugs/ueditor/';
window.LAYDATE_PATH = baseUrl + '../plugs/layui/laydate/';
// UI框架初始化
require(['pace', 'jquery', 'layui', 'laydate', 'bootstrap', 'template', 'ueditor', 'jquery.cookies'], function () {
layui.config({dir: baseUrl + '../plugs/layui/'});
layui.use(['layer', 'form', 'element'], function () {

View File

@ -1,3 +1,15 @@
// +----------------------------------------------------------------------
// | Think.Admin
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
define(['jquery', 'admin.plugs'], function () {
/*! 定义当前body对象 */
@ -7,9 +19,11 @@ define(['jquery', 'admin.plugs'], function () {
this.$body.on('click', '[data-load]', function () {
var url = $(this).attr('data-load');
var tips = $(this).attr('data-tips');
function _goLoad() {
$.form.load(url, {}, 'GET', null, true, tips);
}
if ($(this).attr('data-confirm')) {
return $.msg.confirm($(this).attr('data-confirm'), _goLoad);
}
@ -43,11 +57,11 @@ define(['jquery', 'admin.plugs'], function () {
/*! 注册 data-update 事件行为 */
this.$body.on('click', '[data-update]', function () {
var id = $(this).attr('data-update') || (function () {
var data = [];
return $($(this).attr('data-list-target') || 'input.list-check-box').map(function () {
(this.checked) && data.push(this.value);
}), data.join(',');
}).call(this);
var data = [];
return $($(this).attr('data-list-target') || 'input.list-check-box').map(function () {
(this.checked) && data.push(this.value);
}), data.join(',');
}).call(this);
if (id.length < 1) {
return $.msg.tips('请选择需要操作的数据!');
}
@ -125,7 +139,16 @@ define(['jquery', 'admin.plugs'], function () {
$container.find('img').on('click', function () {
$iframe.attr('src', src);
});
var index = layer.open({type: 1, scrollbar: false, area: ['320px', '600px'], title: false, closeBtn: 1, skin: 'layui-layer-nobg', shadeClose: true, content: $container.removeClass('hide'), end: function () {
var index = layer.open({
type: 1,
scrollbar: false,
area: ['320px', '600px'],
title: false,
closeBtn: 1,
skin: 'layui-layer-nobg',
shadeClose: true,
content: $container.removeClass('hide'),
end: function () {
$container.remove();
}
});
@ -160,6 +183,7 @@ define(['jquery', 'admin.plugs'], function () {
$("[data-menu-box]").not($leftmenu).addClass('hide');
$openNode ? $openNode.trigger('click') : $leftmenu.find('[data-open]:first').trigger('click');
}
var $menutarget = $('[data-menu-target]').on('click', function () {
$menutarget.not($(this).addClass('active')).removeClass('active');
showLeftMenu($(this).attr('data-menu-target'));

View File

@ -1,4 +1,14 @@
/* global layer, Pace */
// +----------------------------------------------------------------------
// | Think.Admin
// +----------------------------------------------------------------------
// | 版权所有 2016~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/Think.Admin
// +----------------------------------------------------------------------
define(['zeroclipboard', 'jquery'], function (ZeroClipboard) {
@ -150,8 +160,8 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) {
msg.prototype.loading = function (msg, callback) {
this.close();
return this.index = msg
? layer.msg(msg, {icon: 16, scrollbar: false, shade: this.shade, time: 0, end: callback})
: layer.load(2, {time: 0, scrollbar: false, shade: this.shade, end: callback});
? layer.msg(msg, {icon: 16, scrollbar: false, shade: this.shade, time: 0, end: callback})
: layer.load(2, {time: 0, scrollbar: false, shade: this.shade, end: callback});
};
/**
@ -720,10 +730,10 @@ define(['zeroclipboard', 'jquery'], function (ZeroClipboard) {
var callback = $(this).attr('data-callback');
$(this).attr('data-listen', "true").validate(function (data) {
$.form.load(this.getAttribute('action') || window.location.href, data,
this.getAttribute('method') || 'POST',
window[callback || '_default_callback'] || undefined, true,
this.getAttribute('data-tips') || undefined,
this.getAttribute('data-time') || undefined);
this.getAttribute('method') || 'POST',
window[callback || '_default_callback'] || undefined, true,
this.getAttribute('data-tips') || undefined,
this.getAttribute('data-time') || undefined);
});
});
};