Authored by xuqi

Merge branch 'feature/ybStatic' into develop

说明
参照yohoboys-frontend的目录结构整理
\ No newline at end of file
保持libs和mobile目录下的package.json除npm部分的一致性
\ No newline at end of file
... ...
*.iml
.idea/
.ipr
.iws
*~
~*
*.diff
*.patch
*.bak
.DS_Store
Thumbs.db
.project
.*proj
.svn/
*.swp
*.swo
*.pyc
*.pyo
.build
node_modules
_site
sea-modules
spm_modules
.cache
dist
coverage
... ...
dist
_site
sea-modules
spm_modules
node_modules
.git
tests
examples
test
coverage
... ...
language: node_js
node_js:
- "0.10"
install:
- npm install spm coveralls
before_script:
- node_modules/spm/bin/spm-install
script:
- node_modules/spm/bin/spm-test
after_success:
- node_modules/spm/bin/spm-test --coveralls | node_modules/.bin/coveralls
... ...
# History
---
## 1.0.0
`new` It is the first version of yohobuy-mobile.
... ...
# yohobuy-mobile [![spm version](http://spm.yoho.cn/badge/yohobuy-mobile)](http://spm.yoho.cn/package/yohobuy-mobile)
---
yohobuy-mobile libs
## Install
```
$ spm install yohobuy-mobile --save
```
## Usage
```js
var yohobuyMobile = require('yohobuy-mobile');
// use yohobuyMobile
```
... ...
/**
* gulp file 执行compass解析,spm build以及文件合并压缩等
* author: xuqi(qi.xu@yoho.cn)
* date; 2015/3/27
*/
var gulp = require('gulp'),
fs = require('fs'),
exec = require('child_process').exec,
concat = require('gulp-concat');
var config = JSON.parse(fs.readFileSync('./package.json').toString());
//spm build
gulp.task('build', function() {
exec('spm build', function() {
//development ENV
gulp.src('dist/yoho-mobile.js')
.pipe(concat('libs-dev.js'))
.pipe(gulp.dest('../mobile/public/dist/'));
//production ENV
gulp.src(['sea/sea.js', 'dist/yoho-mobile.js'])
.pipe(concat('libs.js'))
.pipe(gulp.dest('../mobile/dist/' + config.name + '/' + config.version + '/'));
gulp.src(['sea/sea-debug.js', 'dist/yoho-mobile-debug.js'])
.pipe(concat('libs-debug.js'))
.pipe(gulp.dest('../mobile/dist/' + config.name + '/' + config.version + '/'));
});
});
\ No newline at end of file
... ...
{
"name": "yohobuy-mobile",
"version": "1.1.0",
"description": "yohobuy-mobile libs",
"keywords": [],
"homepage": "",
"author": "xuqi <xuqi9010@gmail.com>",
"repository": {
"type": "git",
"url": ""
},
"licenses": "MIT",
"spm": {
"main": "yoho-mobile.js",
"dependencies": {
"jquery": "1.8.3",
"mlellipsis": "0.0.6",
"lazyload": "1.9.6",
"iscroll": "5.1.2",
"mustache": "2.0.0",
"underscore": "1.6.0"
},
"devDependencies": {
"expect.js": "0.3.1"
},
"buildArgs": "--idleading {{}} --include all"
},
"devDependencies": {
"spm": "3"
},
"scripts": {
"test": "spm test",
"build": "spm build"
},
"main": "index.js",
"directories": {
"example": "examples",
"test": "tests"
},
"license": "ISC",
"dependencies": {
"gulp": "^3.8.11",
"gulp-concat": "^2.5.2"
}
}
\ No newline at end of file
... ...
... ... @@ -291,7 +291,8 @@
return B("config", a), t
}
}
}(this);;
seajs.config({
base: '/public/js'
}(this);
;seajs.config({
base: 'http://cdn.yoho.cn',
charset: 'utf-8'
});
\ No newline at end of file
... ...
/*! Sea.js 2.3.0 | seajs.org/LICENSE.md */
!function(a,b){function c(a){return function(b){return{}.toString.call(b)=="[object "+a+"]"}}function d(){return z++}function e(a){return a.match(C)[0]}function f(a){for(a=a.replace(D,"/"),a=a.replace(F,"$1/");a.match(E);)a=a.replace(E,"/");return a}function g(a){var b=a.length-1,c=a.charAt(b);return"#"===c?a.substring(0,b):".js"===a.substring(b-2)||a.indexOf("?")>0||"/"===c?a:a+".js"}function h(a){var b=u.alias;return b&&w(b[a])?b[a]:a}function i(a){var b=u.paths,c;return b&&(c=a.match(G))&&w(b[c[1]])&&(a=b[c[1]]+c[2]),a}function j(a){var b=u.vars;return b&&a.indexOf("{")>-1&&(a=a.replace(H,function(a,c){return w(b[c])?b[c]:a})),a}function k(a){var b=u.map,c=a;if(b)for(var d=0,e=b.length;e>d;d++){var f=b[d];if(c=y(f)?f(a)||a:a.replace(f[0],f[1]),c!==a)break}return c}function l(a,b){var c,d=a.charAt(0);if(I.test(a))c=a;else if("."===d)c=f((b?e(b):u.cwd)+a);else if("/"===d){var g=u.cwd.match(J);c=g?g[0]+a.substring(1):a}else c=u.base+a;return 0===c.indexOf("//")&&(c=location.protocol+c),c}function m(a,b){if(!a)return"";a=h(a),a=i(a),a=j(a),a=g(a);var c=l(a,b);return c=k(c)}function n(a){return a.hasAttribute?a.src:a.getAttribute("src",4)}function o(a,b,c){var d=K.createElement("script");if(c){var e=y(c)?c(a):c;e&&(d.charset=e)}p(d,b,a),d.async=!0,d.src=a,R=d,Q?P.insertBefore(d,Q):P.appendChild(d),R=null}function p(a,b,c){function d(){a.onload=a.onerror=a.onreadystatechange=null,u.debug||P.removeChild(a),a=null,b()}var e="onload"in a;e?(a.onload=d,a.onerror=function(){B("error",{uri:c,node:a}),d()}):a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&d()}}function q(){if(R)return R;if(S&&"interactive"===S.readyState)return S;for(var a=P.getElementsByTagName("script"),b=a.length-1;b>=0;b--){var c=a[b];if("interactive"===c.readyState)return S=c}}function r(a){var b=[];return a.replace(U,"").replace(T,function(a,c,d){d&&b.push(d)}),b}function s(a,b){this.uri=a,this.dependencies=b||[],this.exports=null,this.status=0,this._waitings={},this._remain=0}if(!a.seajs){var t=a.seajs={version:"2.3.0"},u=t.data={},v=c("Object"),w=c("String"),x=Array.isArray||c("Array"),y=c("Function"),z=0,A=u.events={};t.on=function(a,b){var c=A[a]||(A[a]=[]);return c.push(b),t},t.off=function(a,b){if(!a&&!b)return A=u.events={},t;var c=A[a];if(c)if(b)for(var d=c.length-1;d>=0;d--)c[d]===b&&c.splice(d,1);else delete A[a];return t};var B=t.emit=function(a,b){var c=A[a],d;if(c){c=c.slice();for(var e=0,f=c.length;f>e;e++)c[e](b)}return t},C=/[^?#]*\//,D=/\/\.\//g,E=/\/[^/]+\/\.\.\//,F=/([^:/])\/+\//g,G=/^([^/:]+)(\/.+)$/,H=/{([^{]+)}/g,I=/^\/\/.|:\//,J=/^.*?\/\/.*?\//,K=document,L=location.href&&0!==location.href.indexOf("about:")?e(location.href):"",M=K.scripts,N=K.getElementById("seajsnode")||M[M.length-1],O=e(n(N)||L);t.resolve=m;var P=K.head||K.getElementsByTagName("head")[0]||K.documentElement,Q=P.getElementsByTagName("base")[0],R,S;t.request=o;var T=/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\/\*[\S\s]*?\*\/|\/(?:\\\/|[^\/\r\n])+\/(?=[^\/])|\/\/.*|\.\s*require|(?:^|[^$])\brequire\s*\(\s*(["'])(.+?)\1\s*\)/g,U=/\\\\/g,V=t.cache={},W,X={},Y={},Z={},$=s.STATUS={FETCHING:1,SAVED:2,LOADING:3,LOADED:4,EXECUTING:5,EXECUTED:6};s.prototype.resolve=function(){for(var a=this,b=a.dependencies,c=[],d=0,e=b.length;e>d;d++)c[d]=s.resolve(b[d],a.uri);return c},s.prototype.load=function(){var a=this;if(!(a.status>=$.LOADING)){a.status=$.LOADING;var c=a.resolve();B("load",c);for(var d=a._remain=c.length,e,f=0;d>f;f++)e=s.get(c[f]),e.status<$.LOADED?e._waitings[a.uri]=(e._waitings[a.uri]||0)+1:a._remain--;if(0===a._remain)return a.onload(),b;var g={};for(f=0;d>f;f++)e=V[c[f]],e.status<$.FETCHING?e.fetch(g):e.status===$.SAVED&&e.load();for(var h in g)g.hasOwnProperty(h)&&g[h]()}},s.prototype.onload=function(){var a=this;a.status=$.LOADED,a.callback&&a.callback();var b=a._waitings,c,d;for(c in b)b.hasOwnProperty(c)&&(d=V[c],d._remain-=b[c],0===d._remain&&d.onload());delete a._waitings,delete a._remain},s.prototype.fetch=function(a){function c(){t.request(g.requestUri,g.onRequest,g.charset)}function d(){delete X[h],Y[h]=!0,W&&(s.save(f,W),W=null);var a,b=Z[h];for(delete Z[h];a=b.shift();)a.load()}var e=this,f=e.uri;e.status=$.FETCHING;var g={uri:f};B("fetch",g);var h=g.requestUri||f;return!h||Y[h]?(e.load(),b):X[h]?(Z[h].push(e),b):(X[h]=!0,Z[h]=[e],B("request",g={uri:f,requestUri:h,onRequest:d,charset:u.charset}),g.requested||(a?a[g.requestUri]=c:c()),b)},s.prototype.exec=function(){function a(b){return s.get(a.resolve(b)).exec()}var c=this;if(c.status>=$.EXECUTING)return c.exports;c.status=$.EXECUTING;var e=c.uri;a.resolve=function(a){return s.resolve(a,e)},a.async=function(b,c){return s.use(b,c,e+"_async_"+d()),a};var f=c.factory,g=y(f)?f(a,c.exports={},c):f;return g===b&&(g=c.exports),delete c.factory,c.exports=g,c.status=$.EXECUTED,B("exec",c),g},s.resolve=function(a,b){var c={id:a,refUri:b};return B("resolve",c),c.uri||t.resolve(c.id,b)},s.define=function(a,c,d){var e=arguments.length;1===e?(d=a,a=b):2===e&&(d=c,x(a)?(c=a,a=b):c=b),!x(c)&&y(d)&&(c=r(""+d));var f={id:a,uri:s.resolve(a),deps:c,factory:d};if(!f.uri&&K.attachEvent){var g=q();g&&(f.uri=g.src)}B("define",f),f.uri?s.save(f.uri,f):W=f},s.save=function(a,b){var c=s.get(a);c.status<$.SAVED&&(c.id=b.id||a,c.dependencies=b.deps||[],c.factory=b.factory,c.status=$.SAVED,B("save",c))},s.get=function(a,b){return V[a]||(V[a]=new s(a,b))},s.use=function(b,c,d){var e=s.get(d,x(b)?b:[b]);e.callback=function(){for(var b=[],d=e.resolve(),f=0,g=d.length;g>f;f++)b[f]=V[d[f]].exec();c&&c.apply(a,b),delete e.callback},e.load()},t.use=function(a,b){return s.use(a,b,u.cwd+"_use_"+d()),t},s.define.cmd={},a.define=s.define,t.Module=s,u.fetchedList=Y,u.cid=d,t.require=function(a){var b=s.get(s.resolve(a));return b.status<$.EXECUTING&&(b.onload(),b.exec()),b.exports},u.base=O,u.dir=O,u.cwd=L,u.charset="utf-8",t.config=function(a){for(var b in a){var c=a[b],d=u[b];if(d&&v(d))for(var e in c)d[e]=c[e];else x(d)?c=d.concat(c):"base"===b&&("/"!==c.slice(-1)&&(c+="/"),c=l(c)),u[b]=c}return B("config",a),t}}}(this);
;
seajs.config({
;seajs.config({
base: 'http://cdn.yoho.cn',
charset: 'utf-8'
});
\ No newline at end of file
... ...
var yohoMobile;
require('jquery');
require('mlellipsis');
require('lazyload');
require('iscroll/iscroll-probe');
require('mustache');
require('underscore');
exports.yohoMobile = yohoMobile;
\ No newline at end of file
... ...
... ... @@ -27,6 +27,7 @@ var ftpConfig = {
pass: 'yoho9646'
};
// 本地运行时
// 启动
gulp.task('default', ['server', 'server:restart', 'compass-watch', 'compass']);
... ... @@ -60,31 +61,9 @@ gulp.task('compass', function() {
)
});
//spm build
gulp.task('build', function() {
exec('spm build --include all', function() {
exec('gulp build-debug');
exec('gulp build-production');
});
});
//generate all-debug.js for development ENV
gulp.task('build-debug', function() {
gulp.src(['public/lib/sea.js', 'dist/yohobuy-mobile/1.0.0/index-debug.js'])
.pipe(concat('all-debug.js'))
.pipe(gulp.dest('public/dist'))
});
//generate all.js for production ENV
gulp.task('build-production', function() {
gulp.src(['public/lib/sea.js', 'dist/yohobuy-mobile/1.0.0/index.js'])
.pipe(concat('all.js'))
.pipe(gulp.dest('public/dist'))
});
//线上环境使用
//发布
//发布到CND
gulp.task('dist', ['assets', 'compass-production', 'spm-build-production'], function() {
gulp.task('dist', ['assets', 'compass-production', 'build'], function() {
var ftpstream = ftp(ftpConfig);
return gulp.src('dist/**/')
.pipe(ftpstream)
... ... @@ -118,14 +97,10 @@ gulp.task('compass-production', function() {
});
});
//STEP3:spm
gulp.task('spm-build-production', function() {
exec('spm build --include all', function() {
gulp.src(['public/lib/sea-pro.js', 'dist/yohobuy-mobile/1.0.0/index-debug.js'])
.pipe(concat('index-debug.js'))
//spm build
gulp.task('build', function() {
exec('spm build', function() {
gulp.src(['dist/index-debug.js', 'dist/index.js'])
.pipe(gulp.dest(dist_dir.js));
gulp.src(['public/lib/sea-pro.js', 'dist/yohobuy-mobile/1.0.0/index.js'])
.pipe(concat('index.js'))
.pipe(gulp.dest(dist_dir.js))
});
});
\ No newline at end of file
... ...
... ... @@ -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
... ...
{
"name": "yohobuy-mobile",
"version": "1.0.0",
"version": "1.1.0",
"description": "yohobuy-mobile frontend",
"keywords": [],
"homepage": "",
... ... @@ -14,15 +14,16 @@
"main": "index.js",
"dependencies": {
"jquery": "1.8.3",
"mlellipsis": "0.0.2",
"lazyload": "1.9.5",
"mlellipsis": "0.0.6",
"lazyload": "1.9.6",
"iscroll": "5.1.2",
"mustache": "2.0.0",
"underscore": "1.6.0"
},
"devDependencies": {
"expect.js": "0.3.1"
}
},
"buildArgs": "--idleading {{}}"
},
"devDependencies": {
"spm": "3"
... ...
... ... @@ -40,13 +40,13 @@ exports.init = function() {
//文字截取
ellipsis.init();
$intro[0].mlellipsis(3); //品牌介绍
$('.info-block-content, .info-block-title').each(function() { //相关文章
this.mlellipsis(2);
});
setTimeout(function() {
$intro.mlellipsis(3); //品牌介绍
$('.info-block-content, .info-block-title').each(function() { //相关文章
$(this).mlellipsis(2);
});
mIntro = $intro.text();
aIntro = $intro.attr('_title');
aIntro = $intro.attr('title');
}, 0);
//lazyload
... ...
... ... @@ -45,10 +45,10 @@ exports.initAndroid = function() {
//相关文章截取文字
ellipsis.init();
$('.post-list').find('span').each(function() {
$(this).mlellipsis(2);
this.mlellipsis(2);
});
$('.brand-name').each(function() {
$(this).mlellipsis(1);
this.mlellipsis(1);
});
//图片懒加载
... ... @@ -211,10 +211,10 @@ exports.initOther = function() {
//相关文章截取文字
ellipsis.init();
$('.post-list').find('span').each(function() {
$(this).mlellipsis(2);
this.mlellipsis(2);
});
$('.brand-name').each(function() {
$(this).mlellipsis(1);
this.mlellipsis(1);
});
//提示信息位置
... ...
... ... @@ -6,8 +6,7 @@
var $ = require('jquery'),
ellipsis = require('mlellipsis'),
Mustache = require('mustache'),
timer = null;
Mustache = require('mustache');
require('lazyload');
... ... @@ -18,14 +17,9 @@ exports.init = function() {
var tpl;
//相关文章截取文字
ellipsis.init();
clearTimeout(timer);
timer = setTimeout(function(){
$('.tag-text, .tag-title').each(function() {
$(this).mlellipsis(2);
});
}, 0);
$('.tag-text, .tag-title').each(function() {
this.mlellipsis(2);
});
$(function() {
var $tagList = $('#tag-list'),
... ... @@ -35,7 +29,6 @@ exports.init = function() {
$loading = $loadStatus.filter('.loading'),
winH = $(window).height(),
loadMoreH = $loadMore.height(),
showLoad = false,
canScroll = true,
dataEnd = false,
hasAuthor = false,
... ... @@ -161,14 +154,14 @@ exports.init = function() {
});
//文字截取
$tagList.find('.tag-text, .tag-title').each(function() {
$(this).mlellipsis(2);
this.mlellipsis(2);
});
}
canScroll = true;
}
});
}
if ($(document).height() === winH) {
//应对初始加载时数据不满屏不能触发scroll的情况
$(document).one('touchmove', function() {
... ...
... ... @@ -101,10 +101,10 @@ exports.init = function() {
//ellipsis
ellipsis.init();
$('.reco .name').each(function() {
$(this).mlellipsis(2);
this.mlellipsis(2);
});
$('.brand-name').each(function() {
$(this).mlellipsis(1);
this.mlellipsis(1);
});
//read good-info template
... ...
/*! Sea.js 2.3.0 | seajs.org/LICENSE.md */
!function(a,b){function c(a){return function(b){return{}.toString.call(b)=="[object "+a+"]"}}function d(){return z++}function e(a){return a.match(C)[0]}function f(a){for(a=a.replace(D,"/"),a=a.replace(F,"$1/");a.match(E);)a=a.replace(E,"/");return a}function g(a){var b=a.length-1,c=a.charAt(b);return"#"===c?a.substring(0,b):".js"===a.substring(b-2)||a.indexOf("?")>0||"/"===c?a:a+".js"}function h(a){var b=u.alias;return b&&w(b[a])?b[a]:a}function i(a){var b=u.paths,c;return b&&(c=a.match(G))&&w(b[c[1]])&&(a=b[c[1]]+c[2]),a}function j(a){var b=u.vars;return b&&a.indexOf("{")>-1&&(a=a.replace(H,function(a,c){return w(b[c])?b[c]:a})),a}function k(a){var b=u.map,c=a;if(b)for(var d=0,e=b.length;e>d;d++){var f=b[d];if(c=y(f)?f(a)||a:a.replace(f[0],f[1]),c!==a)break}return c}function l(a,b){var c,d=a.charAt(0);if(I.test(a))c=a;else if("."===d)c=f((b?e(b):u.cwd)+a);else if("/"===d){var g=u.cwd.match(J);c=g?g[0]+a.substring(1):a}else c=u.base+a;return 0===c.indexOf("//")&&(c=location.protocol+c),c}function m(a,b){if(!a)return"";a=h(a),a=i(a),a=j(a),a=g(a);var c=l(a,b);return c=k(c)}function n(a){return a.hasAttribute?a.src:a.getAttribute("src",4)}function o(a,b,c){var d=K.createElement("script");if(c){var e=y(c)?c(a):c;e&&(d.charset=e)}p(d,b,a),d.async=!0,d.src=a,R=d,Q?P.insertBefore(d,Q):P.appendChild(d),R=null}function p(a,b,c){function d(){a.onload=a.onerror=a.onreadystatechange=null,u.debug||P.removeChild(a),a=null,b()}var e="onload"in a;e?(a.onload=d,a.onerror=function(){B("error",{uri:c,node:a}),d()}):a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&d()}}function q(){if(R)return R;if(S&&"interactive"===S.readyState)return S;for(var a=P.getElementsByTagName("script"),b=a.length-1;b>=0;b--){var c=a[b];if("interactive"===c.readyState)return S=c}}function r(a){var b=[];return a.replace(U,"").replace(T,function(a,c,d){d&&b.push(d)}),b}function s(a,b){this.uri=a,this.dependencies=b||[],this.exports=null,this.status=0,this._waitings={},this._remain=0}if(!a.seajs){var t=a.seajs={version:"2.3.0"},u=t.data={},v=c("Object"),w=c("String"),x=Array.isArray||c("Array"),y=c("Function"),z=0,A=u.events={};t.on=function(a,b){var c=A[a]||(A[a]=[]);return c.push(b),t},t.off=function(a,b){if(!a&&!b)return A=u.events={},t;var c=A[a];if(c)if(b)for(var d=c.length-1;d>=0;d--)c[d]===b&&c.splice(d,1);else delete A[a];return t};var B=t.emit=function(a,b){var c=A[a],d;if(c){c=c.slice();for(var e=0,f=c.length;f>e;e++)c[e](b)}return t},C=/[^?#]*\//,D=/\/\.\//g,E=/\/[^/]+\/\.\.\//,F=/([^:/])\/+\//g,G=/^([^/:]+)(\/.+)$/,H=/{([^{]+)}/g,I=/^\/\/.|:\//,J=/^.*?\/\/.*?\//,K=document,L=location.href&&0!==location.href.indexOf("about:")?e(location.href):"",M=K.scripts,N=K.getElementById("seajsnode")||M[M.length-1],O=e(n(N)||L);t.resolve=m;var P=K.head||K.getElementsByTagName("head")[0]||K.documentElement,Q=P.getElementsByTagName("base")[0],R,S;t.request=o;var T=/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\/\*[\S\s]*?\*\/|\/(?:\\\/|[^\/\r\n])+\/(?=[^\/])|\/\/.*|\.\s*require|(?:^|[^$])\brequire\s*\(\s*(["'])(.+?)\1\s*\)/g,U=/\\\\/g,V=t.cache={},W,X={},Y={},Z={},$=s.STATUS={FETCHING:1,SAVED:2,LOADING:3,LOADED:4,EXECUTING:5,EXECUTED:6};s.prototype.resolve=function(){for(var a=this,b=a.dependencies,c=[],d=0,e=b.length;e>d;d++)c[d]=s.resolve(b[d],a.uri);return c},s.prototype.load=function(){var a=this;if(!(a.status>=$.LOADING)){a.status=$.LOADING;var c=a.resolve();B("load",c);for(var d=a._remain=c.length,e,f=0;d>f;f++)e=s.get(c[f]),e.status<$.LOADED?e._waitings[a.uri]=(e._waitings[a.uri]||0)+1:a._remain--;if(0===a._remain)return a.onload(),b;var g={};for(f=0;d>f;f++)e=V[c[f]],e.status<$.FETCHING?e.fetch(g):e.status===$.SAVED&&e.load();for(var h in g)g.hasOwnProperty(h)&&g[h]()}},s.prototype.onload=function(){var a=this;a.status=$.LOADED,a.callback&&a.callback();var b=a._waitings,c,d;for(c in b)b.hasOwnProperty(c)&&(d=V[c],d._remain-=b[c],0===d._remain&&d.onload());delete a._waitings,delete a._remain},s.prototype.fetch=function(a){function c(){t.request(g.requestUri,g.onRequest,g.charset)}function d(){delete X[h],Y[h]=!0,W&&(s.save(f,W),W=null);var a,b=Z[h];for(delete Z[h];a=b.shift();)a.load()}var e=this,f=e.uri;e.status=$.FETCHING;var g={uri:f};B("fetch",g);var h=g.requestUri||f;return!h||Y[h]?(e.load(),b):X[h]?(Z[h].push(e),b):(X[h]=!0,Z[h]=[e],B("request",g={uri:f,requestUri:h,onRequest:d,charset:u.charset}),g.requested||(a?a[g.requestUri]=c:c()),b)},s.prototype.exec=function(){function a(b){return s.get(a.resolve(b)).exec()}var c=this;if(c.status>=$.EXECUTING)return c.exports;c.status=$.EXECUTING;var e=c.uri;a.resolve=function(a){return s.resolve(a,e)},a.async=function(b,c){return s.use(b,c,e+"_async_"+d()),a};var f=c.factory,g=y(f)?f(a,c.exports={},c):f;return g===b&&(g=c.exports),delete c.factory,c.exports=g,c.status=$.EXECUTED,B("exec",c),g},s.resolve=function(a,b){var c={id:a,refUri:b};return B("resolve",c),c.uri||t.resolve(c.id,b)},s.define=function(a,c,d){var e=arguments.length;1===e?(d=a,a=b):2===e&&(d=c,x(a)?(c=a,a=b):c=b),!x(c)&&y(d)&&(c=r(""+d));var f={id:a,uri:s.resolve(a),deps:c,factory:d};if(!f.uri&&K.attachEvent){var g=q();g&&(f.uri=g.src)}B("define",f),f.uri?s.save(f.uri,f):W=f},s.save=function(a,b){var c=s.get(a);c.status<$.SAVED&&(c.id=b.id||a,c.dependencies=b.deps||[],c.factory=b.factory,c.status=$.SAVED,B("save",c))},s.get=function(a,b){return V[a]||(V[a]=new s(a,b))},s.use=function(b,c,d){var e=s.get(d,x(b)?b:[b]);e.callback=function(){for(var b=[],d=e.resolve(),f=0,g=d.length;g>f;f++)b[f]=V[d[f]].exec();c&&c.apply(a,b),delete e.callback},e.load()},t.use=function(a,b){return s.use(a,b,u.cwd+"_use_"+d()),t},s.define.cmd={},a.define=s.define,t.Module=s,u.fetchedList=Y,u.cid=d,t.require=function(a){var b=s.get(s.resolve(a));return b.status<$.EXECUTING&&(b.onload(),b.exec()),b.exports},u.base=O,u.dir=O,u.cwd=L,u.charset="utf-8",t.config=function(a){for(var b in a){var c=a[b],d=u[b];if(d&&v(d))for(var e in c)d[e]=c[e];else x(d)?c=d.concat(c):"base"===b&&("/"!==c.slice(-1)&&(c+="/"),c=l(c)),u[b]=c}return B("config",a),t}}}(this);
;seajs.config({
base: 'localhost:5000/dist'
});
\ No newline at end of file
<script src="http://localhost:8000/public/js/ps.js"></script>
<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('public/js/ps', 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 src="http://localhost:8000/public/js/saunter.js"></script>
<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('public/js/saunter', function(saunter) {
var u = navigator.userAgent;
$("#container").removeClass('hide');
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {
saunter.initAndroid();
} else {
... ...
<script src="http://localhost:8000/public/js/tag.js"></script>
<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('public/js/tag', function(tag) {
if(tag) {
tag.init();
}
... ...
<script src="http://localhost:8000/public/js/template.js"></script>
<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('public/js/template', 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 src="http://localhost:8000/static/js/sea.js?nowrap"></script>
<script>
seajs.config({
base: 'http://localhost:8000/'
})
</script>
<script src="//localhost:5000/dist/all-debug.js"></script>
<script src="http://localhost:8000/public/dist/libs-dev.js"></script>
{{! 根据标识字段添加模块对应JS入口文件}}
{{# isSaunter}}
{{> footer_js/saunter}}
... ...
<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
... ...