app.js
1.25 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
/**
* Created by DEV005 on 2017/4/13.
*/
(function( window, undefined ) {
var XnAppNative=function(options) {
"use strict";
var appNative=new Object;
appNative.version="1.0.0";
return appNative;
};
if(!window.appNative){
window.appNative=new XnAppNative();
}
})(window);
(function( window,$, undefined ) {
// 构造 jQuery 对象
var xnAppNative = (function() {
var xnAppNative = function( selector, context ) {
return new xnAppNative.fn.init( selector, context, rootjQuery );
};
// 一堆局部变量声明
xnAppNative.fn = xnAppNative.prototype = {
constructor: xnAppNative,
init: function( selector, context, rootjQuery ) {
console.log(11111111111)
}
// 一堆原型属性和方法
};
xnAppNative.fn.init.prototype = xnAppNative.fn;
xnAppNative.extend = xnAppNative.fn.extend = function() {};
xnAppNative.extend({
// 一堆静态属性和方法
});
return xnAppNative;
})();
// 省略其他模块的代码 ...
window.xnAppNative = xnAppNative;
})( window,jQuery||window.jQuery);