Commit efa92fd9 authored by antoor's avatar antoor

Adjust and optimize the code

调整优化代码
parent dbc541f5
......@@ -14,25 +14,27 @@
(function( global, factory ) {
if ( typeof module === "object" && typeof module.exports === "object" ) {
// For CommonJS and CommonJS-like environments where a proper `window`
// is present, execute the factory and get jQuery.
// For environments that do not have a `window` with a `document`
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
// See ticket #14549 for more info.
module.exports = global.document ?
factory( global, true ) :
function( w ) {
if ( !w.document ) {
throw new Error( "jQuery requires a window with a document" );
}
return factory( w );
};
} else {
factory( global );
}
// 不使用module加载器,这样就可以直接在electron中引用jquery了
factory(global);
// if ( typeof module === "object" && typeof module.exports === "object" ) {
// // For CommonJS and CommonJS-like environments where a proper `window`
// // is present, execute the factory and get jQuery.
// // For environments that do not have a `window` with a `document`
// // (such as Node.js), expose a factory as module.exports.
// // This accentuates the need for the creation of a real `window`.
// // e.g. var jQuery = require("jquery")(window);
// // See ticket #14549 for more info.
// module.exports = global.document ?
// factory( global, true ) :
// function( w ) {
// if ( !w.document ) {
// throw new Error( "jQuery requires a window with a document" );
// }
// return factory( w );
// };
// } else {
// factory( global );
// }
// Pass this if window is not defined yet
}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
......
......@@ -3,8 +3,8 @@
<head>
<meta charset="utf-8"/>
<title>AntSword</title>
<link rel="stylesheet" href="../static/css/index.css"/>
<script>require('../source/load.entry');</script>
<link rel="stylesheet" href="ant-static://css/index.css"/>
<script src="ant-src://load.entry.js"></script>
</head>
<body>
<div id="loading"></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment