Authored by xuqi

拆分库js和业务js

... ... @@ -8,11 +8,11 @@
{{> header}}
</head>
<body>
<div id="container" class="hide">
{{{body}}}
</div>
<div id="login-tip" class="login-tip">未登录</div>
<input id="is-login" type="hidden" value="{{isLogin}}">
<div id="container">
{{{body}}}
</div>
</body>
{{> footer}}
</html>
\ No newline at end of file
... ...
... ... @@ -24,7 +24,8 @@
},
"devDependencies": {
"expect.js": "0.3.1"
}
},
"buildArgs": "--include all --ignore jquery"
},
"devDependencies": {
"spm": "3"
... ...
<script type="text/javascript">
seajs.use(['jquery/1.8.3/jquery-debug', 'yohobuy-mobile/1.0.0/public/js/ps-debug'], function($, ps) {
$("#container").removeClass('hide');
seajs.use('yohobuy-mobile/1.0.0/public/js/ps-debug', function(ps) {
if (ps) {
ps.init();
}
... ...
<script type="text/javascript">
seajs.use(['jquery/1.8.3/jquery-debug', 'yohobuy-mobile/1.0.0/public/js/saunter-debug'], function($, saunter) {
$("#container").removeClass('hide');
if(saunter) {
saunter.init();
}
});
</script>
\ No newline at end of file
<script type="text/javascript">
seajs.use(['jquery/1.8.3/jquery-debug',
'yohobuy-mobile/1.0.0/public/js/saunter-debug'], function($, saunter) {
seajs.use('yohobuy-mobile/1.0.0/public/js/saunter-debug', function(saunter) {
var u = navigator.userAgent;
$("#container").removeClass('hide');
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
saunter.initAndroid();
} else {
... ...
<script type="text/javascript">
seajs.use(['jquery/1.8.3/jquery-debug','yohobuy-mobile/1.0.0/public/js/tag-debug'], function($, tag) {
$("#container").removeClass('hide');
seajs.use('yohobuy-mobile/1.0.0/public/js/tag-debug', function(tag) {
if(tag) {
tag.init();
}
... ...
<script type="text/javascript">
seajs.use(['jquery/1.8.3/jquery-debug', 'yohobuy-mobile/1.0.0/public/js/template-debug'], function($, tpl) {
$("#container").removeClass('hide');
seajs.use('yohobuy-mobile/1.0.0/public/js/template-debug', function(tpl) {
if (tpl) {
tpl.init();
}
... ...
<script type="text/javascript">
(function (doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function () {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
};
if (!doc.addEventListener) {
return;
}
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
</script>
<script src="//localhost:5000/dist/all-debug.js"></script>
{{! 根据标识字段添加模块对应JS入口文件}}
{{# isSaunter}}
... ...
<script type="text/javascript">
(function (doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function () {
var clientWidth = docEl.clientWidth;
if (!clientWidth) {
return;
}
docEl.style.fontSize = 20 * (clientWidth / 320) + 'px';
};
if (!doc.addEventListener) {
return;
}
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
</script>
<link rel="stylesheet" href="../css/index.css">
\ No newline at end of file
... ...