Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
antSword
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HuangJunbo
antSword
Commits
a1ee0b7a
Commit
a1ee0b7a
authored
Jun 01, 2016
by
antoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rebuild code
重构代码
parent
13cfdc55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
75 deletions
+54
-75
load.entry.js
source/load.entry.js
+54
-75
No files found.
source/load.entry.js
View file @
a1ee0b7a
/**
/**
* 中国蚁剑::前端加载模块
* 中国蚁剑::前端加载模块
* 开写: 2016/04/23
* 开写: 2016/04/23
* 更新: 2016/0
4/28
* 更新: 2016/0
5/10
* 作者: 蚁逅 <https://github.com/antoor>
* 作者: 蚁逅 <https://github.com/antoor>
*/
*/
'use strict'
;
'use strict'
;
// 加载jQuery
// 添加源码目录到全局模块加载变量,以提供后边加载
window
.
$
=
window
.
jQuery
=
require
(
'../static/libs/jquery/jquery.js'
);
const
path
=
require
(
'path'
);
const
path
=
require
(
'path'
);
const
Module
=
require
(
'module'
).
Module
;
Module
.
globalPaths
.
push
(
path
.
join
(
process
.
env
.
AS_WORKDIR
,
'source'
));
// 开始加载时间
// 开始加载时间
let
APP_START_TIME
=
+
new
Date
;
let
APP_START_TIME
=
+
new
Date
;
$
(
document
).
ready
(
()
=>
{
window
.
addEventListener
(
'load'
,
()
=>
{
/**
/**
* 时间格式化函数
* 时间格式化函数
* @param {String} format 格式化字符串,如yyyy/mm/dd hh:ii:ss
* @param {String} format 格式化字符串,如yyyy/mm/dd hh:ii:ss
...
@@ -72,79 +73,57 @@ $(document).ready(() => {
...
@@ -72,79 +73,57 @@ $(document).ready(() => {
}
}
// 开始加载css
// 开始加载css
loadCSS
(
loadCSS
(
'ant-static://libs/bmenu/bmenu.css'
)
'../static/libs/bmenu/bmenu.css'
.
then
(()
=>
loadCSS
(
'ant-static://libs/toastr/toastr.min.css'
))
).
then
(()
=>
{
.
then
(()
=>
loadCSS
(
'ant-static://libs/layer/src/skin/layer.css'
))
return
loadCSS
(
'../static/libs/toastr/toastr.min.css'
);
.
then
(()
=>
loadCSS
(
'ant-static://libs/layer/src/skin/layer.ext.css'
))
}).
then
(()
=>
{
.
then
(()
=>
loadCSS
(
'ant-static://libs/laydate/need/laydate.css'
))
return
loadCSS
(
'../static/libs/layer/src/skin/layer.css'
);
.
then
(()
=>
loadCSS
(
'ant-static://libs/laydate/skins/default/laydate.css'
))
}).
then
(()
=>
{
.
then
(()
=>
loadCSS
(
'ant-static://libs/terminal/css/jquery.terminal.css'
))
return
loadCSS
(
'../static/libs/layer/src/skin/layer.ext.css'
);
.
then
(()
=>
loadCSS
(
'ant-static://libs/font-awesome/css/font-awesome.min.css'
))
}).
then
(()
=>
{
.
then
(()
=>
loadCSS
(
'ant-static://libs/dhtmlx/codebase/dhtmlx.css'
))
return
loadCSS
(
'../static/libs/laydate/need/laydate.css'
);
.
then
(()
=>
loadCSS
(
'ant-static://libs/dhtmlx/skins/mytheme/dhtmlx.css'
))
}).
then
(()
=>
{
.
then
(()
=>
loadCSS
(
'ant-static://css/index.css'
));
return
loadCSS
(
'../static/libs/laydate/skins/default/laydate.css'
);
}).
then
(()
=>
{
return
loadCSS
(
'../static/libs/terminal/css/jquery.terminal.css'
);
}).
then
(()
=>
{
return
loadCSS
(
'../static/libs/font-awesome/css/font-awesome.min.css'
);
}).
then
(()
=>
{
return
loadCSS
(
'../static/libs/dhtmlx/codebase/dhtmlx.css'
);
}).
then
(()
=>
{
return
loadCSS
(
'../static/libs/dhtmlx/skins/mytheme/dhtmlx.css'
);
}).
then
(()
=>
{
return
loadCSS
(
'../static/css/index.css'
);
});
// 加载js资源
// 加载js资源
loadJS
(
loadJS
(
'ant-static://libs/jquery/jquery.js'
)
'../static/libs/ace/ace.js'
.
then
(()
=>
loadJS
(
'ant-static://libs/ace/ace.js'
))
).
then
(()
=>
{
.
then
(()
=>
loadJS
(
'ant-static://libs/ace/ext-language_tools.js'
))
return
loadJS
(
'../static/libs/ace/ext-language_tools.js'
);
.
then
(()
=>
loadJS
(
'ant-static://libs/bmenu/bmenu.js'
))
}).
then
(()
=>
{
.
then
(()
=>
loadJS
(
'ant-static://libs/toastr/toastr.js'
))
return
loadJS
(
'../static/libs/bmenu/bmenu.js'
);
.
then
(()
=>
loadJS
(
'ant-static://libs/layer/src/layer.js'
))
}).
then
(()
=>
{
.
then
(()
=>
loadJS
(
'ant-static://libs/laydate/laydate.js'
))
return
loadJS
(
'../static/libs/toastr/toastr.js'
);
.
then
(()
=>
loadJS
(
'ant-static://libs/terminal/js/jquery.terminal-min.js'
))
}).
then
(()
=>
{
.
then
(()
=>
loadJS
(
'ant-static://libs/dhtmlx/codebase/dhtmlx.js'
))
return
loadJS
(
'../static/libs/layer/src/layer.js'
);
.
then
(()
=>
{
}).
then
(()
=>
{
/**
return
loadJS
(
'../static/libs/laydate/laydate.js'
);
* 配置layer弹出层
}).
then
(()
=>
{
* @param {[type]} {extend: 'extend/layer.ext.js'} [description]
return
loadJS
(
'../static/libs/terminal/js/jquery.terminal-min.js'
);
* @return {[type]} [description]
}).
then
(()
=>
{
*/
return
loadJS
(
'../static/libs/dhtmlx/codebase/dhtmlx.js'
);
layer
.
config
({
extend
:
'extend/layer.ext.js'
});
}).
then
(()
=>
{
// 加载程序入口
/**
require
(
'app.entry'
);
* 配置layer弹出层
// LOGO
* @param {[type]} {extend: 'extend/layer.ext.js'} [description]
console
.
group
(
'LOGO'
);
* @return {[type]} [description]
console
.
log
(
*/
`%c
layer
.
config
({
extend
:
'extend/layer.ext.js'
});
_____ _ _____ _
// 加载babel引擎
| _ |___| |_| __|_ _ _ ___ ___ _| |
// require('babel/register')();
| | | _|__ | | | | . | _| . |
// 添加require路径
|__|__|_|_|_| |_____|_____|___|_| |___|%c
require
.
main
.
paths
.
unshift
(
path
.
join
(
process
.
env
.
AS_WORKDIR
,
'source'
)
);
// 加载程序入口
require
(
'./app.entry'
);
// LOGO
console
.
log
(
`%c
_____ _ _____ _
| _ |___| |_| __|_ _ _ ___ ___ _| |
| | | _|__ | | | | . | _| . |
|__|__|_|_|_| |_____|_____|___|_| |___|%c
->| Ver: %c
${
antSword
.
package
.
version
}
%c
->| Ver: %c
${
antSword
.
package
.
version
}
%c
-+=>| Git: %c
${
antSword
.
package
.
repository
[
'url'
]}
%c
-+=>| Git: %c
${
antSword
.
package
.
repository
[
'url'
]}
%c
-*| End: %c
${
+
new
Date
-
APP_START_TIME
}
%c/ms
-*| End: %c
${
+
new
Date
-
APP_START_TIME
}
%c/ms
`
,
`
,
'color: #F44336;'
,
'color: #9E9E9E;'
,
'color: #F44336;'
,
'color: #9E9E9E;'
,
'color: #4CAF50;'
,
'color: #9E9E9E;'
,
'color: #4CAF50;'
,
'color: #9E9E9E;'
,
'color: #2196F3;'
,
'color: #9E9E9E;'
,
'color: #2196F3;'
,
'color: #9E9E9E;'
,
'color: #FF9800;'
,
'color: #9E9E9E;'
'color: #FF9800;'
,
'color: #9E9E9E;'
);
);
});
APP_START_TIME
=
null
;
console
.
groupEnd
();
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment