app.js
2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// +----------------------------------------------------------------------
// | ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2017 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://think.ctolog.com
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目:https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
// 当前资源URL目录
var baseRoot = (function () {
var scripts = document.scripts, src = scripts[scripts.length - 1].src;
return src.substring(0, src.lastIndexOf("/") + 1);
})();
// 配置参数
require.config({
waitSeconds: 60,
baseUrl: baseRoot,
map: {'*': {css: baseRoot + 'plugs/require/require.css.js'}},
paths: {
'template': ['plugs/template/template'],
'pcasunzips': ['plugs/jquery/pcasunzips'],
// openSource
'json': ['plugs/jquery/json2.min'],
'layui': ['plugs/layui/layui'],
'base64': ['plugs/jquery/base64.min'],
'angular': ['plugs/angular/angular.min'],
'ckeditor': ['plugs/ckeditor/ckeditor'],
'websocket': ['plugs/socket/websocket'],
// jQuery
'jquery.ztree': ['plugs/ztree/jquery.ztree.all.min'],
'jquery.masonry': ['plugs/jquery/masonry.min'],
'jquery.cookies': ['plugs/jquery/jquery.cookie'],
// bootstrap
'bootstrap': ['plugs/bootstrap/js/bootstrap.min'],
'bootstrap.typeahead': ['plugs/bootstrap/js/bootstrap3-typeahead.min'],
'bootstrap.multiselect': ['plugs/bootstrap-multiselect/bootstrap-multiselect'],
// distpicker
'distpicker': ['plugs/distpicker/distpicker'],
},
shim: {
// open-source
'websocket': {deps: [baseRoot + 'plugs/socket/swfobject.min.js']},
// jquery
'jquery.ztree': {deps: ['css!' + baseRoot + 'plugs/ztree/zTreeStyle/zTreeStyle.css']},
// bootstrap
'bootstrap.typeahead': {deps: ['bootstrap']},
'bootstrap.multiselect': {deps: ['bootstrap', 'css!' + baseRoot + 'plugs/bootstrap-multiselect/bootstrap-multiselect.css']},
'distpicker': {deps: [baseRoot + 'plugs/distpicker/distpicker.data.js']},
},
deps: ['json', 'bootstrap'],
// 开启debug模式,不缓存资源
// urlArgs: "ver=" + (new Date()).getTime()
});
// 注册jquery到require模块
define('jquery', function () {
return layui.$;
});
// UI框架初始化
PageLayout.call(this);
// UI框架布局函数
function PageLayout(callback, custom) {
window.WEB_SOCKET_SWF_LOCATION = baseRoot + "plugs/socket/WebSocketMain.swf";
require(custom || [], callback || false);
}