Showing
6 changed files
with
459 additions
and
151 deletions
No preview for this file type
@@ -3,7 +3,7 @@ var gutil = require('gulp-util'); | @@ -3,7 +3,7 @@ var gutil = require('gulp-util'); | ||
3 | var ftp = require('gulp-ftp'); | 3 | var ftp = require('gulp-ftp'); |
4 | var fs = require('fs'); | 4 | var fs = require('fs'); |
5 | var uglify = require('gulp-uglify'), | 5 | var uglify = require('gulp-uglify'), |
6 | - rename = require('gulp-rename'); | 6 | + rename = require('gulp-rename'); |
7 | var concat = require('gulp-concat'); | 7 | var concat = require('gulp-concat'); |
8 | var exec = require('child_process').exec; | 8 | var exec = require('child_process').exec; |
9 | var compass = require('gulp-compass'); | 9 | var compass = require('gulp-compass'); |
@@ -13,63 +13,56 @@ var stylish = require('jshint-stylish'); | @@ -13,63 +13,56 @@ var stylish = require('jshint-stylish'); | ||
13 | //获取package.json的配置参数 | 13 | //获取package.json的配置参数 |
14 | var config = JSON.parse(fs.readFileSync('./package.json').toString()); | 14 | var config = JSON.parse(fs.readFileSync('./package.json').toString()); |
15 | 15 | ||
16 | -var dist_assets_dir = 'dist/'+config.name+'/assets'; | ||
17 | -var dist_seajs_dir='dist/'+config.name+'/'+config.version+"/min"; | ||
18 | -var dist_js_dir='dist/'+config.name+'/'+config.version; | ||
19 | -var source_js_dir='js/'; | 16 | +var dist_assets_dir = 'dist/' + config.name + '/assets'; |
17 | +var dist_seajs_dir = 'dist/' + config.name + '/' + config.version + "/min"; | ||
18 | +var dist_js_dir = 'dist/' + config.name + '/' + config.version; | ||
19 | +var source_js_dir = 'js/'; | ||
20 | 20 | ||
21 | -var dist_dir = | ||
22 | -{ | ||
23 | - css: 'dist/'+config.name+'/'+config.version, | ||
24 | - image: dist_assets_dir+'/images', | ||
25 | - font: dist_assets_dir+'/fonts' | 21 | +var dist_dir = { |
22 | + css: 'dist/' + config.name + '/' + config.version, | ||
23 | + image: dist_assets_dir + '/images', | ||
24 | + font: dist_assets_dir + '/fonts' | ||
26 | }; | 25 | }; |
27 | 26 | ||
28 | -var ftpConfig = | ||
29 | -{ | ||
30 | - host: '218.94.77.166', | ||
31 | - user: 'php', | ||
32 | - pass: 'yoho9646' | 27 | +var ftpConfig = { |
28 | + host: '218.94.77.166', | ||
29 | + user: 'php', | ||
30 | + pass: 'yoho9646' | ||
33 | }; | 31 | }; |
34 | 32 | ||
35 | -gulp.task('default',function(){ | ||
36 | - gulp.watch(['sass/scss/**','js/**'],['compass-dist','build']); | 33 | +gulp.task('default', function() { |
34 | + gulp.watch(['sass/scss/**', 'js/**'], ['compass-dist', 'build']); | ||
37 | }); | 35 | }); |
38 | 36 | ||
39 | //compass的watch | 37 | //compass的watch |
40 | -gulp.task('cw',function(cb) | ||
41 | -{ | ||
42 | - /*exec('compass watch', function(err) | ||
43 | - { | ||
44 | - if (err) return cb(err); | ||
45 | - cb(); | ||
46 | - });*/ | ||
47 | - gulp.watch(['sass/scss/**','js/**'],['compass-dist','build']); | 38 | +gulp.task('cw', function(cb) { |
39 | + /*exec('compass watch', function(err) | ||
40 | + { | ||
41 | + if (err) return cb(err); | ||
42 | + cb(); | ||
43 | + });*/ | ||
44 | + gulp.watch(['sass/scss/**'], ['compass-dist']); | ||
48 | }); | 45 | }); |
49 | 46 | ||
50 | //js代码验证 | 47 | //js代码验证 |
51 | -gulp.task('lint',function() | ||
52 | -{ | ||
53 | - return gulp.src(['js/*.js','js/**/*.js']) | ||
54 | - .pipe(jshint()) | ||
55 | - .pipe(jshint.reporter(stylish)); | 48 | +gulp.task('lint', function() { |
49 | + return gulp.src(['js/*.js', 'js/**/*.js']) | ||
50 | + .pipe(jshint()) | ||
51 | + .pipe(jshint.reporter(stylish)); | ||
56 | }); | 52 | }); |
57 | 53 | ||
58 | //编译部署compass | 54 | //编译部署compass |
59 | -gulp.task('compass-dist',['assets'],function() | ||
60 | -{ | ||
61 | - gulp.src('sass/scss/**') | ||
62 | - .pipe(compass( | ||
63 | - { | 55 | +gulp.task('compass-dist', ['assets'], function() { |
56 | + gulp.src('sass/scss/**') | ||
57 | + .pipe(compass({ | ||
64 | css: dist_dir.css, | 58 | css: dist_dir.css, |
65 | sass: 'sass/scss', | 59 | sass: 'sass/scss', |
66 | image: dist_dir.image, | 60 | image: dist_dir.image, |
67 | font: dist_dir.font, | 61 | font: dist_dir.font, |
68 | 62 | ||
69 | - style:'compressed' | 63 | + style: 'compressed' |
70 | })) | 64 | })) |
71 | - .on('error', function(error) | ||
72 | - { | 65 | + .on('error', function(error) { |
73 | console.log(error); | 66 | console.log(error); |
74 | this.emit('end'); | 67 | this.emit('end'); |
75 | }); | 68 | }); |
@@ -77,85 +70,79 @@ gulp.task('compass-dist',['assets'],function() | @@ -77,85 +70,79 @@ gulp.task('compass-dist',['assets'],function() | ||
77 | 70 | ||
78 | 71 | ||
79 | //执行spm的build | 72 | //执行spm的build |
80 | -gulp.task('spm',function(cb) | ||
81 | -{ | ||
82 | - exec('spm build --include all', function(err) | ||
83 | - { | ||
84 | - if (err) return cb(err); | ||
85 | - cb(); | ||
86 | - }); | 73 | +gulp.task('spm', function(cb) { |
74 | + exec('spm build --include all', function(err) { | ||
75 | + if (err) return cb(err); | ||
76 | + cb(); | ||
77 | + }); | ||
87 | }); | 78 | }); |
88 | 79 | ||
89 | -gulp.task('js',['seajs','copy','concat'],function(){ | ||
90 | - console.log("压缩合并完成"); | 80 | +gulp.task('js', ['seajs', 'copy', 'concat'], function() { |
81 | + console.log("压缩合并完成"); | ||
91 | }); | 82 | }); |
92 | 83 | ||
93 | -gulp.task('seajs',function(){ | ||
94 | - gulp.src('js/util/seajs_dev.js') | ||
95 | - .pipe(uglify()) | ||
96 | - .pipe(rename('seajs.min.js')) | ||
97 | - .pipe(gulp.dest(dist_seajs_dir)); | 84 | +gulp.task('seajs', function() { |
85 | + gulp.src('js/util/seajs_dev.js') | ||
86 | + .pipe(uglify()) | ||
87 | + .pipe(rename('seajs.min.js')) | ||
88 | + .pipe(gulp.dest(dist_seajs_dir)); | ||
98 | }); | 89 | }); |
99 | -gulp.task('copy',function(){ | ||
100 | - gulp.src(dist_js_dir+'/index.js') | ||
101 | - .pipe(rename('z_index.js')) | ||
102 | - .pipe(gulp.dest(dist_seajs_dir)); | ||
103 | - gulp.src(source_js_dir+'/yas.js') | ||
104 | - .pipe(gulp.dest(dist_js_dir)); | 90 | +gulp.task('copy', function() { |
91 | + gulp.src(dist_js_dir + '/index.js') | ||
92 | + .pipe(rename('z_index.js')) | ||
93 | + .pipe(gulp.dest(dist_seajs_dir)); | ||
94 | + gulp.src(source_js_dir + '/yas.js') | ||
95 | + .pipe(gulp.dest(dist_js_dir)); | ||
105 | }); | 96 | }); |
106 | 97 | ||
107 | -gulp.task('concat',function(){ | ||
108 | - gulp.src(dist_seajs_dir+'/*.js') | ||
109 | - .pipe(concat('index.min.js')) | ||
110 | - .pipe(gulp.dest(dist_js_dir)); | 98 | +gulp.task('concat', function() { |
99 | + gulp.src(dist_seajs_dir + '/*.js') | ||
100 | + .pipe(concat('index.min.js')) | ||
101 | + .pipe(gulp.dest(dist_js_dir)); | ||
111 | }); | 102 | }); |
112 | 103 | ||
113 | //拷贝assets到发布目录 | 104 | //拷贝assets到发布目录 |
114 | -gulp.task('assets',function() | ||
115 | -{ | ||
116 | - gulp.src('assets/**') | 105 | +gulp.task('assets', function() { |
106 | + gulp.src('assets/**') | ||
117 | .pipe(gulp.dest(dist_assets_dir)); | 107 | .pipe(gulp.dest(dist_assets_dir)); |
118 | }); | 108 | }); |
119 | -gulp.task('yangshi',['assets','compass-dist'],function(){ | 109 | +gulp.task('yangshi', ['assets', 'compass-dist'], function() { |
120 | 110 | ||
121 | 111 | ||
122 | }); | 112 | }); |
123 | 113 | ||
124 | //spm build | 114 | //spm build |
125 | gulp.task('build', function() { | 115 | gulp.task('build', function() { |
126 | - exec('spm build --include all', function() { | ||
127 | - exec('gulp build-debug'); | ||
128 | - exec('gulp build-production'); | ||
129 | - }); | 116 | + exec('spm build --include all', function() { |
117 | + exec('gulp build-debug'); | ||
118 | + exec('gulp build-production'); | ||
119 | + }); | ||
130 | }); | 120 | }); |
131 | 121 | ||
132 | //generate all-debug.js for development ENV | 122 | //generate all-debug.js for development ENV |
133 | gulp.task('build-debug', function() { | 123 | gulp.task('build-debug', function() { |
134 | - gulp.src(['js/util/seajs.js', 'dist/yohogirls-frontend-web/0.0.1/index-debug.js']) | ||
135 | - .pipe(concat('all-debug.js')) | ||
136 | - .pipe(gulp.dest('dist/yohogirls-frontend-web/0.0.1')) | 124 | + gulp.src(['js/util/seajs.js', 'dist/yohogirls-frontend-web/0.0.1/index-debug.js']) |
125 | + .pipe(concat('all-debug.js')) | ||
126 | + .pipe(gulp.dest('dist/yohogirls-frontend-web/0.0.1')) | ||
137 | }); | 127 | }); |
138 | 128 | ||
139 | //generate all.js for production ENV | 129 | //generate all.js for production ENV |
140 | gulp.task('build-production', function() { | 130 | gulp.task('build-production', function() { |
141 | - gulp.src(['js/util/seajs.js', 'dist/dist/yohogirls-frontend-web/0.0.1/index.js']) | ||
142 | - .pipe(concat('all.js')) | ||
143 | - .pipe(gulp.dest('dist/yohogirls-frontend-web/0.0.1')) | 131 | + gulp.src(['js/util/seajs.js', 'dist/dist/yohogirls-frontend-web/0.0.1/index.js']) |
132 | + .pipe(concat('all.js')) | ||
133 | + .pipe(gulp.dest('dist/yohogirls-frontend-web/0.0.1')) | ||
144 | }); | 134 | }); |
145 | 135 | ||
146 | //发布到CDN | 136 | //发布到CDN |
147 | -gulp.task('dist',['compass-dist'], function () | ||
148 | -{ | ||
149 | - var ftpstream = ftp(ftpConfig); | ||
150 | - return gulp.src('dist/**') | 137 | +gulp.task('dist', ['compass-dist'], function() { |
138 | + var ftpstream = ftp(ftpConfig); | ||
139 | + return gulp.src('dist/**') | ||
151 | .pipe(ftpstream) | 140 | .pipe(ftpstream) |
152 | .pipe(gutil.noop()); | 141 | .pipe(gutil.noop()); |
153 | }); | 142 | }); |
154 | 143 | ||
155 | //发布到CDN | 144 | //发布到CDN |
156 | -gulp.task('comp',['compass-dist','js'], function () | ||
157 | -{ | ||
158 | - //编译到本地 | ||
159 | - console.log("将文件编译到本地!!!!"); | ||
160 | -}); | ||
161 | - | 145 | +gulp.task('comp', ['compass-dist', 'js'], function() { |
146 | + //编译到本地 | ||
147 | + console.log("将文件编译到本地!!!!"); | ||
148 | +}); |
@@ -24,8 +24,8 @@ exports.init = function() { | @@ -24,8 +24,8 @@ exports.init = function() { | ||
24 | share.init({ | 24 | share.init({ |
25 | shareUrl: shareUrl, | 25 | shareUrl: shareUrl, |
26 | img: shareCover, | 26 | img: shareCover, |
27 | - sinaText:'【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(), | ||
28 | - fbTextFunction: function(){ | 27 | + sinaText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(), |
28 | + fbTextFunction: function() { | ||
29 | return { | 29 | return { |
30 | des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', | 30 | des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', |
31 | name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', | 31 | name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', |
@@ -67,7 +67,7 @@ exports.init = function() { | @@ -67,7 +67,7 @@ exports.init = function() { | ||
67 | //图片轮播 | 67 | //图片轮播 |
68 | if ($(".detail-slide-body").size() > 0) { | 68 | if ($(".detail-slide-body").size() > 0) { |
69 | $(".detail-slide-ctrl-tabs").find("img.lazy").lazyload(); | 69 | $(".detail-slide-ctrl-tabs").find("img.lazy").lazyload(); |
70 | - $(".detail-slide-body").ImgZoom(); | 70 | + $(".detail-slide-body").ImgZoom(); |
71 | 71 | ||
72 | $(".detail-slide-piclist").slider({ | 72 | $(".detail-slide-piclist").slider({ |
73 | pageCtrl: $(".detail-slide-ctrl-tabs"), | 73 | pageCtrl: $(".detail-slide-ctrl-tabs"), |
@@ -76,15 +76,15 @@ exports.init = function() { | @@ -76,15 +76,15 @@ exports.init = function() { | ||
76 | }; | 76 | }; |
77 | 77 | ||
78 | //调用评论插件 | 78 | //调用评论插件 |
79 | - $(".stats-btn").on("click",".comments",function() { | 79 | + $(".stats-btn").on("click", ".comments", function() { |
80 | var cidNum = $(".comments-box").attr("cid"); | 80 | var cidNum = $(".comments-box").attr("cid"); |
81 | - if($(".comments-box").find(".comment-textarea").size() > 0) { | ||
82 | - if($(".comments-box").css("display") === "none") { | 81 | + if ($(".comments-box").find(".comment-textarea").size() > 0) { |
82 | + if ($(".comments-box").css("display") === "none") { | ||
83 | $(".comments-box").show(); | 83 | $(".comments-box").show(); |
84 | - }else{ | 84 | + } else { |
85 | $(".comments-box").hide(); | 85 | $(".comments-box").hide(); |
86 | } | 86 | } |
87 | - }else{ | 87 | + } else { |
88 | $(".comments-box").comment({ | 88 | $(".comments-box").comment({ |
89 | cid: cidNum, | 89 | cid: cidNum, |
90 | thirdLogin: true, | 90 | thirdLogin: true, |
@@ -10,6 +10,7 @@ var $ = require('jquery'), | @@ -10,6 +10,7 @@ var $ = require('jquery'), | ||
10 | 10 | ||
11 | require('lazyload'); | 11 | require('lazyload'); |
12 | require('../plugin/imgslider'); | 12 | require('../plugin/imgslider'); |
13 | +require('../plugin/imgzoom'); | ||
13 | 14 | ||
14 | exports.init = function() { | 15 | exports.init = function() { |
15 | var shareUrl = $('.share').attr('data-link'), | 16 | var shareUrl = $('.share').attr('data-link'), |
@@ -24,8 +25,8 @@ exports.init = function() { | @@ -24,8 +25,8 @@ exports.init = function() { | ||
24 | share.init({ | 25 | share.init({ |
25 | shareUrl: shareUrl, | 26 | shareUrl: shareUrl, |
26 | img: shareCover, | 27 | img: shareCover, |
27 | - sinaText:'【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(), | ||
28 | - fbTextFunction: function(){ | 28 | + sinaText: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text(), |
29 | + fbTextFunction: function() { | ||
29 | return { | 30 | return { |
30 | des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', | 31 | des: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', |
31 | name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', | 32 | name: '【Yoho!Girls】' + detailTitle.text() + '\r\n' + detailSubtitle.text() + '#YohoGirl', |
@@ -38,34 +39,34 @@ exports.init = function() { | @@ -38,34 +39,34 @@ exports.init = function() { | ||
38 | }); | 39 | }); |
39 | 40 | ||
40 | //图片懒加载 | 41 | //图片懒加载 |
41 | - $('img.lazy').lazyload({ | 42 | + $('img.lazy').lazyload({ |
42 | placeholder: 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==' | 43 | placeholder: 'data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==' |
43 | }); | 44 | }); |
44 | 45 | ||
45 | //显示控制箭头 | 46 | //显示控制箭头 |
46 | (function() { | 47 | (function() { |
47 | - $('.column-slide').on('mouseenter',function() { | 48 | + $('.column-slide').on('mouseenter', function() { |
48 | $('.column-slide').find('.slide-ctrl').hide(); | 49 | $('.column-slide').find('.slide-ctrl').hide(); |
49 | if ($(this).find('li').size() <= 4) return; | 50 | if ($(this).find('li').size() <= 4) return; |
50 | clearTimeout(timer); | 51 | clearTimeout(timer); |
51 | $(this).find('.slide-ctrl').show(); | 52 | $(this).find('.slide-ctrl').show(); |
52 | - }).on('mouseleave',function(event) { | 53 | + }).on('mouseleave', function(event) { |
53 | var $that = $(this); | 54 | var $that = $(this); |
54 | timer = setTimeout(function() { | 55 | timer = setTimeout(function() { |
55 | - $that.find('.slide-ctrl').hide(); | 56 | + $that.find('.slide-ctrl').hide(); |
56 | }, 1000) | 57 | }, 1000) |
57 | }); | 58 | }); |
58 | 59 | ||
59 | - $('.column-slide .slide-ctrl').on('mouseenter',function() { | 60 | + $('.column-slide .slide-ctrl').on('mouseenter', function() { |
60 | clearTimeout(timer); | 61 | clearTimeout(timer); |
61 | $(this).show(); | 62 | $(this).show(); |
62 | - }).on('mouseleave',function() { | ||
63 | - timer=setTimeout(function() { | ||
64 | - $(this).hide(); | 63 | + }).on('mouseleave', function() { |
64 | + timer = setTimeout(function() { | ||
65 | + $(this).hide(); | ||
65 | }, 100) | 66 | }, 100) |
66 | }); | 67 | }); |
67 | - | ||
68 | - })(); | 68 | + |
69 | + })(); | ||
69 | 70 | ||
70 | //封面杂志图滚动 | 71 | //封面杂志图滚动 |
71 | magazineSlide = new swiper('.mags-slide .swiper-container', { | 72 | magazineSlide = new swiper('.mags-slide .swiper-container', { |
@@ -80,7 +81,7 @@ exports.init = function() { | @@ -80,7 +81,7 @@ exports.init = function() { | ||
80 | }); | 81 | }); |
81 | 82 | ||
82 | $('.column-slide.magazine-list').imgSlider({ | 83 | $('.column-slide.magazine-list').imgSlider({ |
83 | - itemClass:'magazine' | 84 | + itemClass: 'magazine' |
84 | }); | 85 | }); |
85 | 86 | ||
86 | //当页面改变大小,ipad横竖屏切换重新加载插件 | 87 | //当页面改变大小,ipad横竖屏切换重新加载插件 |
@@ -92,14 +93,14 @@ exports.init = function() { | @@ -92,14 +93,14 @@ exports.init = function() { | ||
92 | }); | 93 | }); |
93 | 94 | ||
94 | $.ajax({ | 95 | $.ajax({ |
95 | - type:'GET', | ||
96 | - url:'/channel/magazine/ezine', | ||
97 | - success:function(response) { | 96 | + type: 'GET', |
97 | + url: '/channel/magazine/ezine', | ||
98 | + success: function(response) { | ||
98 | var data = response.data, | 99 | var data = response.data, |
99 | len = data.length; | 100 | len = data.length; |
100 | - item ='', | ||
101 | - ulNum = Math.ceil(len/16), | ||
102 | - ulItem ='', | 101 | + item = '', |
102 | + ulNum = Math.ceil(len / 16), | ||
103 | + ulItem = '', | ||
103 | ulAnimateIndex = 0; | 104 | ulAnimateIndex = 0; |
104 | 105 | ||
105 | var animateWidth, | 106 | var animateWidth, |
@@ -107,32 +108,34 @@ exports.init = function() { | @@ -107,32 +108,34 @@ exports.init = function() { | ||
107 | itemIndexStart, | 108 | itemIndexStart, |
108 | itemIndexEnd, | 109 | itemIndexEnd, |
109 | i; | 110 | i; |
110 | - | 111 | + |
111 | $('.e-zine .slide-box').html('<div class="slide-piclist-wrap clearfix" style="position:relative;top:0;left:0;"></div>'); | 112 | $('.e-zine .slide-box').html('<div class="slide-piclist-wrap clearfix" style="position:relative;top:0;left:0;"></div>'); |
112 | - | 113 | + |
113 | //添加4个ul | 114 | //添加4个ul |
114 | - for (var i=0; i<ulNum; i++) { | 115 | + for (var i = 0; i < ulNum; i++) { |
115 | ulItem += '<ul class="slide-piclist clearfix"></ul>'; | 116 | ulItem += '<ul class="slide-piclist clearfix"></ul>'; |
116 | } | 117 | } |
117 | 118 | ||
118 | $('.slide-piclist-wrap').html(ulItem); | 119 | $('.slide-piclist-wrap').html(ulItem); |
119 | 120 | ||
120 | animateWidth = $('.mags-column').find('.slide-piclist').outerWidth(); | 121 | animateWidth = $('.mags-column').find('.slide-piclist').outerWidth(); |
121 | - slideWrapWidth = animateWidth * ulNum; | ||
122 | - $('.slide-piclist-wrap').css({'width': slideWrapWidth}); | 122 | + slideWrapWidth = animateWidth * ulNum; |
123 | + $('.slide-piclist-wrap').css({ | ||
124 | + 'width': slideWrapWidth | ||
125 | + }); | ||
123 | 126 | ||
124 | //分别插入数据到4个ul | 127 | //分别插入数据到4个ul |
125 | - for (i=0; i<ulNum; i++) { | 128 | + for (i = 0; i < ulNum; i++) { |
126 | itemIndexStart = i * 16, | 129 | itemIndexStart = i * 16, |
127 | - itemIndexEnd = i * 16 + 16; | 130 | + itemIndexEnd = i * 16 + 16; |
128 | item = ''; | 131 | item = ''; |
129 | if (itemIndexEnd > len) { | 132 | if (itemIndexEnd > len) { |
130 | itemIndexEnd = len; | 133 | itemIndexEnd = len; |
131 | } | 134 | } |
132 | - for(var j = itemIndexStart;j<itemIndexEnd;j++){ | ||
133 | - item += '<li data-type='+data[j].magazineType+'><a href="javascript:;" title="'+data[j].releaseDate+'"><div class="img-wrap"><img src="'+data[j].cover+'" alt="" /></div><span>'+data[j].releaseDate+'</span></a></li>'; | 135 | + for (var j = itemIndexStart; j < itemIndexEnd; j++) { |
136 | + item += '<li data-type=' + data[j].magazineType + '><a href="javascript:;" title="' + data[j].releaseDate + '"><div class="img-wrap"><img src="' + data[j].cover + '" alt="" /></div><span>' + data[j].releaseDate + '</span></a></li>'; | ||
134 | } | 137 | } |
135 | - | 138 | + |
136 | $('.slide-piclist-wrap').find('.slide-piclist').eq(i).html(item); | 139 | $('.slide-piclist-wrap').find('.slide-piclist').eq(i).html(item); |
137 | } | 140 | } |
138 | 141 | ||
@@ -142,20 +145,22 @@ exports.init = function() { | @@ -142,20 +145,22 @@ exports.init = function() { | ||
142 | 145 | ||
143 | $(window).resize(function() { | 146 | $(window).resize(function() { |
144 | animateWidth = $('.mags-column').find('.slide-piclist').outerWidth(); | 147 | animateWidth = $('.mags-column').find('.slide-piclist').outerWidth(); |
145 | - slideWrapWidth = animateWidth * ulNum; | ||
146 | - | ||
147 | - $('.mags-column').on('click.next','.slide-ctrl-next',function() { | ||
148 | - if (ulAnimateIndex >= ulNum-1) return; | 148 | + slideWrapWidth = animateWidth * ulNum; |
149 | + | ||
150 | + $('.mags-column').on('click.next', '.slide-ctrl-next', function() { | ||
151 | + if (ulAnimateIndex >= ulNum - 1) return; | ||
149 | if ($('.slide-piclist-wrap').is(':animated')) return; | 152 | if ($('.slide-piclist-wrap').is(':animated')) return; |
150 | - if (ulAnimateIndex==ulNum-2) { | 153 | + if (ulAnimateIndex == ulNum - 2) { |
151 | $(this).hide(); | 154 | $(this).hide(); |
152 | } | 155 | } |
153 | $(this).siblings('.slide-ctrl-prev').show(); | 156 | $(this).siblings('.slide-ctrl-prev').show(); |
154 | ulAnimateIndex++; | 157 | ulAnimateIndex++; |
155 | - $('.slide-piclist-wrap').stop().animate({'left':-animateWidth * ulAnimateIndex}, 500); | 158 | + $('.slide-piclist-wrap').stop().animate({ |
159 | + 'left': -animateWidth * ulAnimateIndex | ||
160 | + }, 500); | ||
156 | }); | 161 | }); |
157 | 162 | ||
158 | - $('.mags-column').on('click.prev','.slide-ctrl-prev',function() { | 163 | + $('.mags-column').on('click.prev', '.slide-ctrl-prev', function() { |
159 | if (ulAnimateIndex <= 0) return; | 164 | if (ulAnimateIndex <= 0) return; |
160 | if ($('.slide-piclist-wrap').is(':animated')) return; | 165 | if ($('.slide-piclist-wrap').is(':animated')) return; |
161 | if (ulAnimateIndex === 1) { | 166 | if (ulAnimateIndex === 1) { |
@@ -163,15 +168,21 @@ exports.init = function() { | @@ -163,15 +168,21 @@ exports.init = function() { | ||
163 | } | 168 | } |
164 | $(this).siblings('.slide-ctrl-next').show(); | 169 | $(this).siblings('.slide-ctrl-next').show(); |
165 | ulAnimateIndex--; | 170 | ulAnimateIndex--; |
166 | - $('.slide-piclist-wrap').stop().animate({'left':-animateWidth * ulAnimateIndex}, 500); | 171 | + $('.slide-piclist-wrap').stop().animate({ |
172 | + 'left': -animateWidth * ulAnimateIndex | ||
173 | + }, 500); | ||
167 | }); | 174 | }); |
168 | clearTimeout(timer); | 175 | clearTimeout(timer); |
169 | timer = setTimeout(function() { | 176 | timer = setTimeout(function() { |
170 | - $('.slide-piclist-wrap').css({'width': slideWrapWidth}); | ||
171 | - $('.slide-piclist-wrap').css({'left':-animateWidth * ulAnimateIndex}, 500); | ||
172 | - }, 0) | 177 | + $('.slide-piclist-wrap').css({ |
178 | + 'width': slideWrapWidth | ||
179 | + }); | ||
180 | + $('.slide-piclist-wrap').css({ | ||
181 | + 'left': -animateWidth * ulAnimateIndex | ||
182 | + }, 500); | ||
183 | + }, 0) | ||
173 | }).resize(); | 184 | }).resize(); |
174 | - | 185 | + |
175 | 186 | ||
176 | /*for(var i=0;i<len;i++){ | 187 | /*for(var i=0;i<len;i++){ |
177 | item += '<li data-type='+data[i].magazineType+'><a href='javascript:;' title=''+data[i].releaseDate+''><div class='img-wrap'><img src=''+data[i].cover+'' alt='' /></div><span>'+data[i].releaseDate+'</span></a></li>'; | 188 | item += '<li data-type='+data[i].magazineType+'><a href='javascript:;' title=''+data[i].releaseDate+''><div class='img-wrap'><img src=''+data[i].cover+'' alt='' /></div><span>'+data[i].releaseDate+'</span></a></li>'; |
@@ -181,10 +192,29 @@ exports.init = function() { | @@ -181,10 +192,29 @@ exports.init = function() { | ||
181 | */ | 192 | */ |
182 | 193 | ||
183 | $('.mags-column .slide-piclist').find('li').each(function() { | 194 | $('.mags-column .slide-piclist').find('li').each(function() { |
184 | - if($(this).data('type') ==2) { | 195 | + if ($(this).data('type') == 2) { |
185 | $('<em class="border"></em><i class="special-icon"></i>').appendTo($(this).find('.img-wrap')); | 196 | $('<em class="border"></em><i class="special-icon"></i>').appendTo($(this).find('.img-wrap')); |
186 | }; | 197 | }; |
187 | - }); | 198 | + }); |
188 | } | 199 | } |
189 | - }) | 200 | + }); |
201 | + | ||
202 | + $(".magazine-list").on("click", ".magazine", function() { | ||
203 | + if (!$(this).find("img").attr("data-slide")) return; | ||
204 | + if ($(this).find("ul").size() >= 1) return; | ||
205 | + var data = decodeURIComponent($(this).find("img").attr("data-slide")), | ||
206 | + arr = eval("(" + data + ")"), | ||
207 | + len = arr.length, | ||
208 | + $picList = $('<ul style="display:none;" class="magazine-content"></ul').appendTo($(this)), | ||
209 | + item = ''; | ||
210 | + | ||
211 | + for (i = 0; i < len; i++) { | ||
212 | + item += '<li><img src="" data-imgzoom="' + arr[i] + '" alt="" /></li>'; | ||
213 | + | ||
214 | + } | ||
215 | + $(item).appendTo($picList); | ||
216 | + $(this).ImgZoom({ | ||
217 | + isContainFather: true | ||
218 | + }); | ||
219 | + }); | ||
190 | } | 220 | } |
@@ -2,26 +2,317 @@ | @@ -2,26 +2,317 @@ | ||
2 | SeaJS - A Module Loader for the Web | 2 | SeaJS - A Module Loader for the Web |
3 | v2.3.0 | seajs.org | MIT Licensed | 3 | v2.3.0 | seajs.org | MIT Licensed |
4 | */ | 4 | */ |
5 | -!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); | 5 | +! function(a, b) { |
6 | + function c(a) { | ||
7 | + return function(b) { | ||
8 | + return {}.toString.call(b) == "[object " + a + "]" | ||
9 | + } | ||
10 | + } | ||
11 | + | ||
12 | + function d() { | ||
13 | + return z++ | ||
14 | + } | ||
15 | + | ||
16 | + function e(a) { | ||
17 | + return a.match(C)[0] | ||
18 | + } | ||
19 | + | ||
20 | + function f(a) { | ||
21 | + for (a = a.replace(D, "/"), a = a.replace(F, "$1/"); a.match(E);) a = a.replace(E, "/"); | ||
22 | + return a | ||
23 | + } | ||
24 | + | ||
25 | + function g(a) { | ||
26 | + var b = a.length - 1, | ||
27 | + c = a.charAt(b); | ||
28 | + return "#" === c ? a.substring(0, b) : ".js" === a.substring(b - 2) || a.indexOf("?") > 0 || "/" === c ? a : a + ".js" | ||
29 | + } | ||
30 | + | ||
31 | + function h(a) { | ||
32 | + var b = u.alias; | ||
33 | + return b && w(b[a]) ? b[a] : a | ||
34 | + } | ||
35 | + | ||
36 | + function i(a) { | ||
37 | + var b = u.paths, | ||
38 | + c; | ||
39 | + return b && (c = a.match(G)) && w(b[c[1]]) && (a = b[c[1]] + c[2]), a | ||
40 | + } | ||
41 | + | ||
42 | + function j(a) { | ||
43 | + var b = u.vars; | ||
44 | + return b && a.indexOf("{") > -1 && (a = a.replace(H, function(a, c) { | ||
45 | + return w(b[c]) ? b[c] : a | ||
46 | + })), a | ||
47 | + } | ||
48 | + | ||
49 | + function k(a) { | ||
50 | + var b = u.map, | ||
51 | + c = a; | ||
52 | + if (b) | ||
53 | + for (var d = 0, e = b.length; e > d; d++) { | ||
54 | + var f = b[d]; | ||
55 | + if (c = y(f) ? f(a) || a : a.replace(f[0], f[1]), c !== a) break | ||
56 | + } | ||
57 | + return c | ||
58 | + } | ||
59 | + | ||
60 | + function l(a, b) { | ||
61 | + var c, d = a.charAt(0); | ||
62 | + if (I.test(a)) c = a; | ||
63 | + else if ("." === d) c = f((b ? e(b) : u.cwd) + a); | ||
64 | + else if ("/" === d) { | ||
65 | + var g = u.cwd.match(J); | ||
66 | + c = g ? g[0] + a.substring(1) : a | ||
67 | + } else c = u.base + a; | ||
68 | + return 0 === c.indexOf("//") && (c = location.protocol + c), c | ||
69 | + } | ||
70 | + | ||
71 | + function m(a, b) { | ||
72 | + if (!a) return ""; | ||
73 | + a = h(a), a = i(a), a = j(a), a = g(a); | ||
74 | + var c = l(a, b); | ||
75 | + return c = k(c) | ||
76 | + } | ||
77 | + | ||
78 | + function n(a) { | ||
79 | + return a.hasAttribute ? a.src : a.getAttribute("src", 4) | ||
80 | + } | ||
81 | + | ||
82 | + function o(a, b, c) { | ||
83 | + var d = K.createElement("script"); | ||
84 | + if (c) { | ||
85 | + var e = y(c) ? c(a) : c; | ||
86 | + e && (d.charset = e) | ||
87 | + } | ||
88 | + p(d, b, a), d.async = !0, d.src = a, R = d, Q ? P.insertBefore(d, Q) : P.appendChild(d), R = null | ||
89 | + } | ||
90 | + | ||
91 | + function p(a, b, c) { | ||
92 | + function d() { | ||
93 | + a.onload = a.onerror = a.onreadystatechange = null, u.debug || P.removeChild(a), a = null, b() | ||
94 | + } | ||
95 | + var e = "onload" in a; | ||
96 | + e ? (a.onload = d, a.onerror = function() { | ||
97 | + B("error", { | ||
98 | + uri: c, | ||
99 | + node: a | ||
100 | + }), d() | ||
101 | + }) : a.onreadystatechange = function() { | ||
102 | + /loaded|complete/.test(a.readyState) && d() | ||
103 | + } | ||
104 | + } | ||
105 | + | ||
106 | + function q() { | ||
107 | + if (R) return R; | ||
108 | + if (S && "interactive" === S.readyState) return S; | ||
109 | + for (var a = P.getElementsByTagName("script"), b = a.length - 1; b >= 0; b--) { | ||
110 | + var c = a[b]; | ||
111 | + if ("interactive" === c.readyState) return S = c | ||
112 | + } | ||
113 | + } | ||
114 | + | ||
115 | + function r(a) { | ||
116 | + var b = []; | ||
117 | + return a.replace(U, "").replace(T, function(a, c, d) { | ||
118 | + d && b.push(d) | ||
119 | + }), b | ||
120 | + } | ||
121 | + | ||
122 | + function s(a, b) { | ||
123 | + this.uri = a, this.dependencies = b || [], this.exports = null, this.status = 0, this._waitings = {}, this._remain = 0 | ||
124 | + } | ||
125 | + if (!a.seajs) { | ||
126 | + var t = a.seajs = { | ||
127 | + version: "2.3.0" | ||
128 | + }, | ||
129 | + u = t.data = {}, | ||
130 | + v = c("Object"), | ||
131 | + w = c("String"), | ||
132 | + x = Array.isArray || c("Array"), | ||
133 | + y = c("Function"), | ||
134 | + z = 0, | ||
135 | + A = u.events = {}; | ||
136 | + t.on = function(a, b) { | ||
137 | + var c = A[a] || (A[a] = []); | ||
138 | + return c.push(b), t | ||
139 | + }, t.off = function(a, b) { | ||
140 | + if (!a && !b) return A = u.events = {}, t; | ||
141 | + var c = A[a]; | ||
142 | + if (c) | ||
143 | + if (b) | ||
144 | + for (var d = c.length - 1; d >= 0; d--) c[d] === b && c.splice(d, 1); | ||
145 | + else delete A[a]; | ||
146 | + return t | ||
147 | + }; | ||
148 | + var B = t.emit = function(a, b) { | ||
149 | + var c = A[a], | ||
150 | + d; | ||
151 | + if (c) { | ||
152 | + c = c.slice(); | ||
153 | + for (var e = 0, f = c.length; f > e; e++) c[e](b) | ||
154 | + } | ||
155 | + return t | ||
156 | + }, | ||
157 | + C = /[^?#]*\//, | ||
158 | + D = /\/\.\//g, | ||
159 | + E = /\/[^/]+\/\.\.\//, | ||
160 | + F = /([^:/])\/+\//g, | ||
161 | + G = /^([^/:]+)(\/.+)$/, | ||
162 | + H = /{([^{]+)}/g, | ||
163 | + I = /^\/\/.|:\//, | ||
164 | + J = /^.*?\/\/.*?\//, | ||
165 | + K = document, | ||
166 | + L = location.href && 0 !== location.href.indexOf("about:") ? e(location.href) : "", | ||
167 | + M = K.scripts, | ||
168 | + N = K.getElementById("seajsnode") || M[M.length - 1], | ||
169 | + O = e(n(N) || L); | ||
170 | + t.resolve = m; | ||
171 | + var P = K.head || K.getElementsByTagName("head")[0] || K.documentElement, | ||
172 | + Q = P.getElementsByTagName("base")[0], | ||
173 | + R, S; | ||
174 | + t.request = o; | ||
175 | + var T = /"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\/\*[\S\s]*?\*\/|\/(?:\\\/|[^\/\r\n])+\/(?=[^\/])|\/\/.*|\.\s*require|(?:^|[^$])\brequire\s*\(\s*(["'])(.+?)\1\s*\)/g, | ||
176 | + U = /\\\\/g, | ||
177 | + V = t.cache = {}, | ||
178 | + W, X = {}, | ||
179 | + Y = {}, | ||
180 | + Z = {}, | ||
181 | + $ = s.STATUS = { | ||
182 | + FETCHING: 1, | ||
183 | + SAVED: 2, | ||
184 | + LOADING: 3, | ||
185 | + LOADED: 4, | ||
186 | + EXECUTING: 5, | ||
187 | + EXECUTED: 6 | ||
188 | + }; | ||
189 | + s.prototype.resolve = function() { | ||
190 | + for (var a = this, b = a.dependencies, c = [], d = 0, e = b.length; e > d; d++) c[d] = s.resolve(b[d], a.uri); | ||
191 | + return c | ||
192 | + }, s.prototype.load = function() { | ||
193 | + var a = this; | ||
194 | + if (!(a.status >= $.LOADING)) { | ||
195 | + a.status = $.LOADING; | ||
196 | + var c = a.resolve(); | ||
197 | + B("load", c); | ||
198 | + 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--; | ||
199 | + if (0 === a._remain) return a.onload(), b; | ||
200 | + var g = {}; | ||
201 | + for (f = 0; d > f; f++) e = V[c[f]], e.status < $.FETCHING ? e.fetch(g) : e.status === $.SAVED && e.load(); | ||
202 | + for (var h in g) g.hasOwnProperty(h) && g[h]() | ||
203 | + } | ||
204 | + }, s.prototype.onload = function() { | ||
205 | + var a = this; | ||
206 | + a.status = $.LOADED, a.callback && a.callback(); | ||
207 | + var b = a._waitings, | ||
208 | + c, d; | ||
209 | + for (c in b) b.hasOwnProperty(c) && (d = V[c], d._remain -= b[c], 0 === d._remain && d.onload()); | ||
210 | + delete a._waitings, delete a._remain | ||
211 | + }, s.prototype.fetch = function(a) { | ||
212 | + function c() { | ||
213 | + t.request(g.requestUri, g.onRequest, g.charset) | ||
214 | + } | ||
215 | + | ||
216 | + function d() { | ||
217 | + delete X[h], Y[h] = !0, W && (s.save(f, W), W = null); | ||
218 | + var a, b = Z[h]; | ||
219 | + for (delete Z[h]; a = b.shift();) a.load() | ||
220 | + } | ||
221 | + var e = this, | ||
222 | + f = e.uri; | ||
223 | + e.status = $.FETCHING; | ||
224 | + var g = { | ||
225 | + uri: f | ||
226 | + }; | ||
227 | + B("fetch", g); | ||
228 | + var h = g.requestUri || f; | ||
229 | + return !h || Y[h] ? (e.load(), b) : X[h] ? (Z[h].push(e), b) : (X[h] = !0, Z[h] = [e], B("request", g = { | ||
230 | + uri: f, | ||
231 | + requestUri: h, | ||
232 | + onRequest: d, | ||
233 | + charset: u.charset | ||
234 | + }), g.requested || (a ? a[g.requestUri] = c : c()), b) | ||
235 | + }, s.prototype.exec = function() { | ||
236 | + function a(b) { | ||
237 | + return s.get(a.resolve(b)).exec() | ||
238 | + } | ||
239 | + var c = this; | ||
240 | + if (c.status >= $.EXECUTING) return c.exports; | ||
241 | + c.status = $.EXECUTING; | ||
242 | + var e = c.uri; | ||
243 | + a.resolve = function(a) { | ||
244 | + return s.resolve(a, e) | ||
245 | + }, a.async = function(b, c) { | ||
246 | + return s.use(b, c, e + "_async_" + d()), a | ||
247 | + }; | ||
248 | + var f = c.factory, | ||
249 | + g = y(f) ? f(a, c.exports = {}, c) : f; | ||
250 | + return g === b && (g = c.exports), delete c.factory, c.exports = g, c.status = $.EXECUTED, B("exec", c), g | ||
251 | + }, s.resolve = function(a, b) { | ||
252 | + var c = { | ||
253 | + id: a, | ||
254 | + refUri: b | ||
255 | + }; | ||
256 | + return B("resolve", c), c.uri || t.resolve(c.id, b) | ||
257 | + }, s.define = function(a, c, d) { | ||
258 | + var e = arguments.length; | ||
259 | + 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)); | ||
260 | + var f = { | ||
261 | + id: a, | ||
262 | + uri: s.resolve(a), | ||
263 | + deps: c, | ||
264 | + factory: d | ||
265 | + }; | ||
266 | + if (!f.uri && K.attachEvent) { | ||
267 | + var g = q(); | ||
268 | + g && (f.uri = g.src) | ||
269 | + } | ||
270 | + B("define", f), f.uri ? s.save(f.uri, f) : W = f | ||
271 | + }, s.save = function(a, b) { | ||
272 | + var c = s.get(a); | ||
273 | + c.status < $.SAVED && (c.id = b.id || a, c.dependencies = b.deps || [], c.factory = b.factory, c.status = $.SAVED, B("save", c)) | ||
274 | + }, s.get = function(a, b) { | ||
275 | + return V[a] || (V[a] = new s(a, b)) | ||
276 | + }, s.use = function(b, c, d) { | ||
277 | + var e = s.get(d, x(b) ? b : [b]); | ||
278 | + e.callback = function() { | ||
279 | + for (var b = [], d = e.resolve(), f = 0, g = d.length; g > f; f++) b[f] = V[d[f]].exec(); | ||
280 | + c && c.apply(a, b), delete e.callback | ||
281 | + }, e.load() | ||
282 | + }, t.use = function(a, b) { | ||
283 | + return s.use(a, b, u.cwd + "_use_" + d()), t | ||
284 | + }, s.define.cmd = {}, a.define = s.define, t.Module = s, u.fetchedList = Y, u.cid = d, t.require = function(a) { | ||
285 | + var b = s.get(s.resolve(a)); | ||
286 | + return b.status < $.EXECUTING && (b.onload(), b.exec()), b.exports | ||
287 | + }, u.base = O, u.dir = O, u.cwd = L, u.charset = "utf-8", t.config = function(a) { | ||
288 | + for (var b in a) { | ||
289 | + var c = a[b], | ||
290 | + d = u[b]; | ||
291 | + if (d && v(d)) | ||
292 | + for (var e in c) d[e] = c[e]; | ||
293 | + else x(d) ? c = d.concat(c) : "base" === b && ("/" !== c.slice(-1) && (c += "/"), c = l(c)), u[b] = c | ||
294 | + } | ||
295 | + return B("config", a), t | ||
296 | + } | ||
297 | + } | ||
298 | +}(this); | ||
6 | /** | 299 | /** |
7 | * @fileOverview SeaJS 配置 | 300 | * @fileOverview SeaJS 配置 |
8 | */ | 301 | */ |
9 | -seajs.config( | ||
10 | -{ | 302 | +seajs.config({ |
11 | /*alias: | 303 | /*alias: |
12 | { | 304 | { |
13 | 'jquery': 'lib/jquery', | 305 | 'jquery': 'lib/jquery', |
14 | 'jquery-2.1.3': 'lib/jquery-2.1.3' | 306 | 'jquery-2.1.3': 'lib/jquery-2.1.3' |
15 | },*/ | 307 | },*/ |
16 | - base: 'localhost:8000/dist', | 308 | + base: 'http://localhost:8000/', |
17 | charset: 'utf-8' | 309 | charset: 'utf-8' |
18 | }); | 310 | }); |
19 | -var YohoConfig = | ||
20 | -{ | ||
21 | - baseUrl:'/', | ||
22 | - domain:"yohoboys.com", | ||
23 | - resdomain:"res.yohoboys.com", | ||
24 | - mainUrl:"http://localhost:3000", | ||
25 | - resUrl:"http://res.yohoboys.com", | ||
26 | - uploadUrl:"http://www.yohoboys.com/upload" | 311 | +var YohoConfig = { |
312 | + baseUrl: '/', | ||
313 | + domain: "yohoboys.com", | ||
314 | + resdomain: "res.yohoboys.com", | ||
315 | + mainUrl: "http://localhost:3000", | ||
316 | + resUrl: "http://res.yohoboys.com", | ||
317 | + uploadUrl: "http://www.yohoboys.com/upload" | ||
27 | }; | 318 | }; |
-
Please register or login to post a comment