-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnb.config.js
More file actions
142 lines (126 loc) · 4.42 KB
/
snb.config.js
File metadata and controls
142 lines (126 loc) · 4.42 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*!
* snb.config
*
* snb配置文件
* 在开启cache情况下,此文件只有在主文件的版本号更新时才会再次被下载
* Github: https://github.com/cherislive/snb
* @author cheris <i@cheris.cn>
* @createTime 2017-08-07
* @version v1.0.2
* MIT Licensed.
*/
;(function (root, factory) {
if(typeof exports === 'object' && typeof module === 'object') {
var $ = require('jquery');
var snb = require('snb');
module.exports = factory($, snb)
} else if(typeof define === 'function' && define.amd) {
define(['jquery', 'snb'], function ($, snb) {
factory($, snb)
});
} else if(typeof exports === 'object') {
var $ = require('jquery');
var snb = require('snb');
factory($, snb)
} else {
factory(root.jQuery, root.snb)
}
})(this, function ($, snb) {
if (typeof snb !== 'undefined' && typeof $ !== 'undefined') {
$.extend(snb.config, {
// 是否缓存此文件
cache: true,
// flash文件地址,如未指定将使用baseUrl
flashUrl: '',
/**
路由地址类型
0 不解析
1 解析格式为:/module-action/param-1
*/
route: 0,
// 懒加载的显示类型,可以是show或者是fadeIn
lazyLoadShowType: 'show',
// 懒加载临界点
lazyLoadThreshold: 100,
// ajax请求返回数据成功与否的标示字段
dataFlag: 'status',
// ajax请求返回数据中的描述信息,用于向用户展示
dataInfo: 'info',
// ajax请求返回数据成功与否的判断数值
dataSuccessVal: '1',
// ajax请求返回数据中用于定义业务异常展示的数值
dataDefaultAlertVal: '5',
// ajax请求返回数据中用于获得跳转地址的字段
dataJumpFlag: 'jump',
// 模板引擎解析时使用的开始标示符
tplOpenTag: '<%',
// 模板引擎解析时使用的结束标示符
tplCloseTag: '%>',
// 弹出框loading结构
loading: '<table class="ui-dialog">' +
'<tbody>' +
'<td class="ui-dialog-body">' +
'<div class="ui-dialog-content"><%content||" 请等待..."%></div>' +
'</td>' +
'</tr>' +
'</tbody>' +
'</table>',
// 弹出框alert结构
alert: '<table class="ui-dialog">' +
'<tbody>' +
'<tr class="title">' +
'<td class="ui-dialog-header">' +
'<%if(!noBtn){%>' +
'<button class="ui-dialog-close Js-pop-close" title="取消">×</button>' +
'<%}%>' +
'<div class="ui-dialog-title"><%title||"提示"%></div>' +
'</td>' +
'</tr>' +
'<tr>' +
'<td class="ui-dialog-body">' +
'<div class="ui-dialog-content"><%content%></div>' +
'</td>' +
'</tr>' +
'<tr>' +
'<td class="ui-dialog-footer">' +
'<div class="ui-dialog-button">' +
'<%if(!noBtn){%>' +
'<button class="ui-dialog-autofocus Js-pop-close" type="button"><%okText||"确 定"%></button>' +
'<%}%>' +
'</div>' +
'</td>' +
'</tr>' +
'</tbody>' +
'</table>',
// 弹出框confirm结构
confirm: '<table class="ui-dialog">' +
'<tbody>' +
'<tr class="title">' +
'<td class="ui-dialog-header">' +
'<button class="ui-dialog-close Js-pop-close" title="取消">×</button>' +
'<div class="ui-dialog-title"><%title||"消息"%></div>' +
'</td>' +
'</tr>' +
'<tr>' +
'<td class="ui-dialog-body">' +
'<div class="ui-dialog-content"><%content%></div>' +
'</td>' +
'</tr>' +
'<tr>' +
'<td class="ui-dialog-footer">' +
'<div class="ui-dialog-button">' +
'<button class="Js-pop-close" type="button">取消</button>' +
'<button id="Js-confirm-ok" class="ui-dialog-autofocus" type="button"><%okText||"确 定"%></button>' +
'</div>' +
'</td>' +
'</tr>' +
'</tbody>' +
'</table>',
// 弹出框通用样式
pop: '<div class="ui-dialog">' +
'<div class="ui-dialog-header title"><%title||"消息"%><span class="Js-pop-close ui-dialog-close"></span></div>' +
'<%content%>' +
'</div>'
})
}
});