├── .gitignore ├── Gruntfile.js ├── LICENSE ├── README.md ├── addJS.js ├── addJS.min.js ├── bin └── addjs ├── package.json ├── src ├── config.temp.json ├── index.js ├── install.js └── lib │ ├── combine.js │ ├── combineTarget.js │ ├── config.js │ ├── server.js │ └── utils.js ├── test ├── config.js ├── css │ ├── home.css │ ├── home.min.css │ └── scss │ │ ├── scss.css │ │ └── scss.source.css ├── demo.html └── js │ ├── a.js │ ├── a.js.map │ ├── a.min.js │ ├── a.source.js │ ├── b.js │ ├── c.js │ ├── d.js │ ├── es6 │ ├── es6.js │ ├── es6.js.map │ ├── es6.min.js │ └── t.html │ ├── home.js │ ├── home.min.js │ └── t.html └── zh.md /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *swp 3 | *.swp 4 | .gitCOMMIT_EDITMSG 5 | *.svn 6 | node_modules/* 7 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | var banner = [ 2 | '/**', 3 | '<%=pkg.name%>', 4 | '@author <%=pkg.author.name%> [<%=pkg.author.email%>]', 5 | '@fileoverview <%=pkg.description%>', 6 | '@vserion <%=pkg.version%>', 7 | '**/', 8 | '' 9 | ].join('\r\n'); 10 | 11 | module.exports = function(grunt) { 12 | grunt.initConfig({ 13 | pkg: grunt.file.readJSON('package.json'), 14 | uglify: { 15 | options: { 16 | banner: banner 17 | }, 18 | files: { 19 | src: 'addjs.js', 20 | dest: 'addjs.min.js' 21 | } 22 | } 23 | }); 24 | 25 | grunt.loadNpmTasks('grunt-contrib-uglify'); 26 | 27 | grunt.registerTask('default', [ 28 | 'uglify', 29 | ]); 30 | 31 | }; 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, xiaojue 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # addjs 2 | just combine js/css. 3 | 4 | support svn file and remote file. 5 | 6 | support transform ES6 and scss file. 7 | 8 | support source map debug ES6 source code. 9 | 10 | chinese documentation: [中文文档][1] 11 | 12 | [1]: ./zh.md 13 | 14 | ---- 15 | 16 | #usage 17 | 18 | ```bash 19 | $ npm install -g addjs 20 | ``` 21 | 22 | ```css 23 | @import('./a.css'); 24 | @import('svn:https://xxx.com.cn/b/trunk/b.css'); 25 | @import('http://cnd.xx.com/c.css'); 26 | ``` 27 | 28 | ```js 29 | //addJS source file 30 | @require('./a.js'); 31 | @require('svn:https://xxx.com.cn/b/trunk/b.js'); 32 | @require('http://cdn.xx.com/c.js'); 33 | ``` 34 | 35 | ```html 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | ``` 44 | 45 | ```js 46 | //config.js 47 | addjs.setConfig({ 48 | debugServer:'http:127.0.0.1:7575/', 49 | debugMap:{ 50 | 'http://cdn.x.cn/addjs/index.css':'./css/index.css', 51 | 'http://cdn.x.cn/addjs/index.js':'./js/index.js' 52 | } 53 | version:'0.0.1' 54 | }); 55 | ``` 56 | 57 | ```bash 58 | $ addjs --help 59 | 60 | Usage: addjs [command] [options] 61 | 62 | 63 | Commands: 64 | 65 | build build source js or css 66 | server start the debug server current directory 67 | svn set default svninfo with --username,--pwd 68 | info show default svninfo 69 | 70 | Options: 71 | 72 | -h, --help output usage information 73 | -V, --version output the version number 74 | -c, --config default config will be install user directory in ~.addjs/config.json 75 | -p, --port server will be listen port 76 | -o, --output output fule 77 | -b, --beautify beautify output/specify output options 78 | -e, --es6 transform es6 to es5 js source 79 | -s, --sass transform sass to css source 80 | --username set default svn username 81 | --pwd set default svn password 82 | --command set default svn command new name 83 | 84 | ``` 85 | 86 | ```bash 87 | $ addjs build source.js -o target.min.js 88 | $ addjs build source.css -o target.min.css 89 | $ addjs build source.js -b beautify.js 90 | ``` 91 | 92 | ```bash 93 | $ addjs server ./ --port 7575 //debug and real time combine like : http://127.0.0.1:7575/combine?filename=/path/source.js 94 | ``` 95 | 96 | the combine url flag option default is false, if you want combine es6 or sass file combine real time, set the options true. 97 | -------------------------------------------------------------------------------- /addJS.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author xiaojue[designsor@gmail.com] 3 | * @fileoverview 前端加载脚本,更新时间戳,切换debug,加载css 4 | * @date 20150902 5 | */ 6 | (function(win, doc) { 7 | 8 | var scripts = doc.getElementsByTagName('script'), 9 | scriptsLen = scripts.length, 10 | currentScript = scripts[scriptsLen - 1], 11 | configScript = currentScript.getAttribute('data-config'), 12 | Cache = currentScript.getAttribute('data-config-cache'), 13 | timestamp = parseInt(Date.now() / (parseInt(Cache, 10) * 60 * 1000), 10); 14 | 15 | function parseUrl(reg) { 16 | return (reg).test(location.search); 17 | } 18 | 19 | function parseDebug() { 20 | return parseUrl(/debug/); 21 | } 22 | 23 | function parseSass() { 24 | return parseUrl(/sass/); 25 | } 26 | 27 | function parseES6() { 28 | return parseUrl(/es6/); 29 | } 30 | 31 | function switchFile(path) { 32 | var config = addjs.config, 33 | debug = parseDebug(); 34 | if (debug && config.debugMap && config.debugMap[path]) { 35 | var debugPath = config.debugServer + config.debugMap[path]; 36 | debugPath = parseSass() ? debugPath + '&sass=1' : debugPath; 37 | debugPath = parseES6() ? debugPath + '&es6=1' : debugPath; 38 | return debugPath; 39 | } else { 40 | return path; 41 | } 42 | } 43 | 44 | function writeScript(src) { 45 | doc.write(''); 46 | } 47 | 48 | function writeStyle(href) { 49 | doc.write(''); 50 | } 51 | 52 | function getConfig(cb) { 53 | if (addjs.config) { 54 | cb(addjs.config); 55 | } else { 56 | writeScript(configScript + '?t=' + timestamp); 57 | addjs.cbs.push(cb); 58 | } 59 | } 60 | 61 | function addFile(path, func) { 62 | getConfig(function(config) { 63 | path = switchFile(path); 64 | path = parseDebug() ? path : path + '?v=' + config.version; 65 | func(path); 66 | }); 67 | } 68 | 69 | var addjs = { 70 | _debug: false, 71 | _configLoaded: false, 72 | cbs: [], 73 | css: function(path) { 74 | addFile(path, writeStyle); 75 | }, 76 | js: function(path) { 77 | addFile(path, writeScript); 78 | }, 79 | setConfig: function(options) { 80 | var self = this; 81 | if (!options.version) { 82 | throw new Error('must have a version'); 83 | } 84 | if (!options.debugServer) { 85 | options.debugServer = 'http://127.0.0.1:7575/combine?filename='; 86 | } 87 | this.config = options; 88 | this.cbs.forEach(function(func) { 89 | if (!func.exec) { 90 | func(self.config); 91 | func.exec = true; 92 | } 93 | }); 94 | } 95 | }; 96 | 97 | win.addjs = addjs; 98 | 99 | })(window, document); 100 | -------------------------------------------------------------------------------- /addJS.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | addjs 3 | @author [] 4 | @fileoverview a javascript combine dev tools 5 | @vserion 0.0.15 6 | **/ 7 | !function(a,b){function c(a){return a.test(location.search)}function d(){return c(/debug/)}function e(){return c(/sass/)}function f(){return c(/es6/)}function g(a){var b=r.config,c=d();if(c&&b.debugMap&&b.debugMap[a]){var g=b.debugServer+b.debugMap[a];return g=e()?g+"&sass=1":g,g=f()?g+"&es6=1":g}return a}function h(a){b.write('')}function i(a){b.write('')}function j(a){r.config?a(r.config):(h(o+"?t="+q),r.cbs.push(a))}function k(a,b){j(function(c){a=g(a),a=d()?a:a+"?v="+c.version,b(a)})}var l=b.getElementsByTagName("script"),m=l.length,n=l[m-1],o=n.getAttribute("data-config"),p=n.getAttribute("data-config-cache"),q=parseInt(Date.now()/(60*parseInt(p,10)*1e3),10),r={_debug:!1,_configLoaded:!1,cbs:[],css:function(a){k(a,i)},js:function(a){k(a,h)},setConfig:function(a){var b=this;if(!a.version)throw new Error("must have a version");a.debugServer||(a.debugServer="http://127.0.0.1:7575/combine?filename="),this.config=a,this.cbs.forEach(function(a){a.exec||(a(b.config),a.exec=!0)})}};a.addjs=r}(window,document); -------------------------------------------------------------------------------- /bin/addjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var path = require('path'); 4 | var program = require('commander'); 5 | var fs = require('fs-extra'); 6 | var pkg = require('../package.json'); 7 | var addjs = require('../src'); 8 | var pwd = process.cwd(); 9 | var readjsonsync = require('read-json-sync'); 10 | var LOCALPATH = process.env.HOME || process.env.USERPROFILE; 11 | var addjsConfig = path.join(LOCALPATH, '.addjs/config.json'); 12 | 13 | program.version(pkg.version); 14 | program.usage('[command] [options]'); 15 | program.option('-c, --config ', 'default config will be install user directory in ~.addjs/config.json'); 16 | program.option('-p, --port ', 'server will be listen port'); 17 | program.option('-o, --output ', 'output fule'); 18 | program.option('-b, --beautify ', 'beautify output/specify output options'); 19 | program.option('-e, --es6', 'transform es6 to es5 js source'); 20 | program.option('-s, --sass', 'transform sass to css source'); 21 | program.option('--username ', 'set default svn username'); 22 | program.option('--pwd ', 'set default svn password'); 23 | program.option('--command ', 'set default svn command new name'); 24 | 25 | program.command('build ').description('build source js or css').action(function(source) { 26 | source = path.resolve(pwd, source); 27 | if (!fs.existsSync(source)) { 28 | console.error('source must exists'); 29 | return; 30 | } 31 | var ext = path.extname(source); 32 | if (!(ext === '.js' || ext === '.css')) { 33 | console.error('only build js or css file'); 34 | return; 35 | } 36 | if (program.output || program.beautify) { 37 | var config = getConfig(); 38 | addjs.combine.build(source, config, program.output, program.beautify, program.es6, program.sass); 39 | } else { 40 | console.error('build command must have -o or -b options'); 41 | } 42 | }); 43 | 44 | program.command('server ').description('start the debug server current directory').action(function(dir) { 45 | dir = path.resolve(pwd, dir); 46 | var config = getConfig(); 47 | addjs.server.start(dir, config, program.port); 48 | }); 49 | 50 | program.command('svn').description('set default svninfo with --username,--pwd').action(function() { 51 | if (program.username && program.pwd) { 52 | addjs.config.setSvn(program.username, program.pwd, program.command); 53 | } else { 54 | console.error('svn command must have --username or -password options'); 55 | } 56 | }); 57 | 58 | program.command('info').description('show default svninfo').action(function() { 59 | addjs.config.info(); 60 | }); 61 | 62 | program.parse(process.argv); 63 | 64 | function getConfig() { 65 | var config = program.config ? path.resolve(pwd, program.config) : addjsConfig; 66 | return readConfig(config); 67 | } 68 | 69 | function readConfig(jsonpath) { 70 | try { 71 | return readjsonsync(jsonpath); 72 | } catch (e) { 73 | console.error(e); 74 | } 75 | } 76 | 77 | process.on('uncaughtException', function(err) { 78 | console.dir(err); 79 | }); 80 | 81 | if (!program.args.length) program.help(); 82 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "addjs", 3 | "version": "0.0.18", 4 | "author": [ 5 | { 6 | "name": "xiaojue", 7 | "email": "designsor@gmail.com", 8 | "url": "http://tuer.me/user/profile/designsor" 9 | } 10 | ], 11 | "description": "a javascript combine dev tools", 12 | "keywords": [ 13 | "svn", 14 | "http", 15 | "combine", 16 | "loader" 17 | ], 18 | "engines": { 19 | "node": "<=0.12.4" 20 | }, 21 | "main": "./src/index.js", 22 | "bin": { 23 | "addjs": "bin/addjs" 24 | }, 25 | "scripts": { 26 | "preinstall": "node ./src/install.js" 27 | }, 28 | "dependencies": { 29 | "babel-core": "5.8.25", 30 | "byline": "4.2.1", 31 | "commander": "2.8.1", 32 | "console-stamp": "0.2.0", 33 | "cssbeautify": "0.3.1", 34 | "cssmin": "0.4.3", 35 | "express": "4.x", 36 | "fs-extra": "0.24.0", 37 | "jsonfile": "2.2.2", 38 | "optimist": "0.6.0", 39 | "read-json-sync": "1.1.0", 40 | "request": "2.62.0", 41 | "sass.js": "0.9.2", 42 | "svn-interface": "0.4.6", 43 | "through2": "2.0", 44 | "uglify-js": "2.4.24", 45 | "cssurl": "1.3.0" 46 | }, 47 | "devDependencies": { 48 | "grunt-contrib-uglify": "~0.2.7", 49 | "grunt": "*" 50 | }, 51 | "repository": { 52 | "type": "git", 53 | "url": "https://github.com/xiaojue/addJS.git" 54 | }, 55 | "license": "BSD" 56 | } 57 | -------------------------------------------------------------------------------- /src/config.temp.json: -------------------------------------------------------------------------------- 1 | { 2 | "host":"127.0.0.1", 3 | "port":7575, 4 | "apiPath":"/combine", 5 | "apiParam":"filename", 6 | "svninfo":{ 7 | "username":"", 8 | "password":"", 9 | "command":"svn" 10 | }, 11 | "keywords":{ 12 | ".js":"@require", 13 | ".css":"@import" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author xiaojue[designsor@gmail.com] 3 | * @fileover lib index 4 | */ 5 | var combine = require('./lib/combine'); 6 | var server = require('./lib/server'); 7 | var config = require('./lib/config'); 8 | var consoleStamp = require("console-stamp"); 9 | var os = require('os'); 10 | 11 | function convertMB(bytes) { 12 | return parseInt(bytes / 1024 / 1024, 10); 13 | } 14 | 15 | consoleStamp(console, { 16 | metadata: function() { 17 | return ("[" + convertMB(process.memoryUsage().heapUsed) + "/" + convertMB(os.totalmem()) + " MB]"); 18 | }, 19 | colors: { 20 | stamp: "yellow", 21 | label: "white", 22 | metadata: "green" 23 | } 24 | }); 25 | 26 | module.exports = { 27 | combine: combine, 28 | server: server, 29 | config: config 30 | }; 31 | -------------------------------------------------------------------------------- /src/install.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var configTemp = path.resolve(__dirname,'./config.temp.json'); 4 | var LOCALPATH = process.env.HOME || process.env.USERPROFILE; 5 | var addjsConfig = path.join(LOCALPATH, '.addjs/config.json'); 6 | 7 | if(!fs.existsSync(addjsConfig)){ 8 | var dirname = path.dirname(addjsConfig); 9 | if(!fs.existsSync(dirname)){ 10 | fs.mkdirSync(dirname); 11 | } 12 | fs.writeFileSync(addjsConfig,fs.readFileSync(configTemp)); 13 | } 14 | -------------------------------------------------------------------------------- /src/lib/combine.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author xiaojue[designsor@gmail.com] 3 | * @fileoverview combine file 4 | */ 5 | var utils = require('./utils'); 6 | var path = require('path'); 7 | var fs = require('fs'); 8 | var cssmin = require('cssmin'); 9 | var URLRewriteStream = require('cssurl').URLRewriteStream; 10 | var byline = require('byline').LineStream; 11 | var request = require('request'); 12 | var combineTarget = require('./combineTarget'); 13 | var svn = require('svn-interface'); 14 | var through2 = require('through2'); 15 | var Readable = require('stream').Readable; 16 | var uglify = require('uglify-js'); 17 | var cwd = process.cwd(); 18 | var sass = require('sass.js'); 19 | var cssbeautify = require('cssbeautify'); 20 | var babel = require('babel-core'); 21 | 22 | var sourceMap = {}; 23 | 24 | function combine(svninfo) { 25 | this.svninfo = svninfo; 26 | this.deps = []; 27 | } 28 | 29 | function urlRewrite(filepath, cnf) { 30 | cnf = cnf || {}; 31 | cnf.exts = cnf.exts || ['.css']; 32 | cnf.online = cnf.online || /http(s?)/i; 33 | cnf.replacer = cnf.replacer || path.dirname(filepath); 34 | //cnf.replacers = cnf.replacers.split('/'); 35 | 36 | var urlRewriteIns = new URLRewriteStream(function(url){ 37 | console.log('find '+ url + ' for rewrite!'); 38 | if(!cnf.online.test(url)){ 39 | url = cnf.replacer + '/' + url; 40 | return url += (url.indexOf('?') === -1 ? '?' : '&') + 't='+Date.now(); 41 | } 42 | return url; 43 | }); 44 | return cnf.exts.indexOf(path.extname(filepath)) !== -1 ? urlRewriteIns : through2(function(chunk, enc, cb){this.push(chunk);cb()}); 45 | } 46 | 47 | function sassOrEsOrEs66(ext, es6, toSass) { 48 | function transform(chunk, enc, cb) { 49 | if (!this.source) { 50 | this.source = ''; 51 | } 52 | this.source += chunk; 53 | cb(); 54 | } 55 | var transformEnd; 56 | if (ext === '.css') { 57 | transformEnd = function(cb) { 58 | var self = this; 59 | console.log('beautify css...'); 60 | var css = cssbeautify(this.source); 61 | if (toSass) { 62 | console.log('compile css for sass...'); 63 | sass.compile(css, function(result) { 64 | if (result.text) { 65 | self.push(result.text); 66 | cb(); 67 | } else { 68 | cb(result); 69 | } 70 | }); 71 | } else { 72 | this.push(css); 73 | cb(); 74 | } 75 | }; 76 | } else if (ext === '.js') { 77 | transformEnd = function(cb) { 78 | if (es6) { 79 | console.log('babel js for es6...'); 80 | var js = babel.transform(this.source, { 81 | blacklist: ["useStrict"], 82 | sourceMaps: true, 83 | compact: false 84 | }); 85 | sourceMap.babel = js.map; 86 | this.push(js.code); 87 | } else { 88 | this.push(this.source); 89 | } 90 | cb(); 91 | }; 92 | } 93 | return through2(transform, transformEnd); 94 | } 95 | 96 | utils.definePublicPros(combine.prototype, { 97 | concat: function(filepath, keyword, ext, es6, toSass) { 98 | var line = new byline(); 99 | this.deps = []; 100 | var stream = fs.createReadStream(filepath, { 101 | encoding: 'utf-8' 102 | }) 103 | .pipe(line) 104 | .pipe(combineStream({ 105 | svninfo: this.svninfo, 106 | deps: this.deps, 107 | keyword: keyword, 108 | ext: ext, 109 | filepath: filepath 110 | })) 111 | .pipe(sassOrEsOrEs66(ext, es6, toSass)).on('error', function(e) { 112 | console.error(e); 113 | }); 114 | return stream; 115 | } 116 | }); 117 | 118 | combine.build = function(filepath, config, output, beautify, es6, toSass) { 119 | var ext = path.extname(filepath), 120 | target; 121 | var filestream = new combine({ 122 | username: config.svninfo.username, 123 | password: config.svninfo.password, 124 | command: config.svninfo.command 125 | }).concat(filepath, config.keywords[ext], ext, es6, toSass); 126 | if (beautify) { 127 | target = path.resolve(cwd, beautify); 128 | filestream.pipe(fs.createWriteStream(target)).on('finish', function() { 129 | console.info('beautify success: ' + target); 130 | }); 131 | } 132 | if (output) { 133 | target = path.resolve(cwd, output); 134 | filestream.pipe(through2(function(chunk, enc, cb) { 135 | if (!this.code) { 136 | this.code = ''; 137 | } 138 | this.code += chunk; 139 | cb(); 140 | }, function(cb) { 141 | var result; 142 | if (ext === '.js') { 143 | console.log('minify js by uglify...'); 144 | var uglifyOptions = { 145 | fromString: true, 146 | outSourceMap: path.basename(filepath) + '.map' 147 | }; 148 | if (sourceMap.babel) { 149 | uglifyOptions.inSourceMap = sourceMap.babel; 150 | } 151 | var js = uglify.minify(this.code, uglifyOptions); 152 | result = js.code; 153 | js.map = JSON.parse(js.map); 154 | js.map.file = 'unknown'; 155 | js.map.sources[0] = 'unknown'; 156 | if(!js.map.sourcesContent){ 157 | js.map.sourcesContent = [this.code]; 158 | } 159 | fs.writeFileSync(filepath + '.map', JSON.stringify(js.map)); 160 | } else if (ext === '.css') { 161 | console.log('min css by cssmin...'); 162 | result = cssmin(this.code); 163 | } 164 | this.push(result); 165 | cb(); 166 | })).pipe(fs.createWriteStream(target)).on('finish', function() { 167 | console.info('build output: ' + target); 168 | }); 169 | } 170 | }; 171 | 172 | function pipeFile(file, params) { 173 | var line = new byline(), 174 | target = new combineTarget(); 175 | file.pipe(line) 176 | .pipe(combineStream(params)) 177 | .pipe(target) 178 | .on('finish', function() { 179 | var ext = params.ext; 180 | if (ext === '.js') { 181 | this.file = '\r\ntry{' + this.file + '}catch(e){throw new Error(e+" ' + params.errorFile + '");}\r\n'; 182 | } else if (ext === '.css') { 183 | this.file = this.file + '/*' + params.errorFile + '*/ \r\n'; 184 | } 185 | console.log('finish dispose ' + params.errorFile + '...'); 186 | params.cb(null, this.file); 187 | }); 188 | } 189 | 190 | function getRs(result) { 191 | var rs = new Readable; 192 | rs.push(result); 193 | rs.push(null); 194 | return rs; 195 | } 196 | 197 | function getRequireString(params) { 198 | console.log('start get ' + params.filepath + '...'); 199 | if (params.type === 'local') { 200 | pipeFile(fs.createReadStream(params.filepath, { 201 | encoding: 'utf-8' 202 | }), params); 203 | } else if (params.type === 'http') { 204 | pipeFile(request(params.filepath).on('response', function(res) { 205 | console.log(params.filepath + ' response code: ' + res.statusCode); 206 | }).pipe(urlRewrite(params.filepath)), params); 207 | } else if (params.type === 'svn') { 208 | svn._setCommand(params.svninfo.command || 'svn'); 209 | var filepath = params.filepath.replace(/^svn\:/, ''); 210 | svn.cat(filepath, { 211 | username: params.svninfo.username, 212 | password: params.svninfo.password 213 | }, function(err, result) { 214 | if (err) { 215 | throw new Error(err); 216 | } 217 | var rs = getRs(result); 218 | pipeFile(rs, params); 219 | }); 220 | } 221 | } 222 | 223 | function combineStream(params) { 224 | return through2(function(line, enc, cb) { 225 | var reg = new RegExp('^\\s*' + params.keyword + '\\s*\\(\\s*([\'|\"])([\\w\\-\\.\\/\\_\:]*)\\1\\s*\\)\\s*;?', 'gi'); 226 | line = line.toString() + '\r\n'; 227 | var matches = reg.exec(line); 228 | if (matches && matches[2]) { 229 | var requireName = matches[2]; 230 | var extname = path.extname(requireName); 231 | if (extname === params.ext) { 232 | //先放入堆栈,有重复的不放,忽略,算循环引用,结束之后剔除堆栈 233 | var type = utils.getRquireType(requireName); 234 | if (type === 'local' || type === 'svn' || type === 'http') { 235 | if (params.deps.indexOf(requireName) === -1) { 236 | params.deps.push(requireName); 237 | getRequireString({ 238 | svninfo: params.svninfo, 239 | deps: params.deps, 240 | keyword: params.keyword, 241 | ext: params.ext, 242 | type: type, 243 | filepath: type === 'local' ? path.resolve(path.dirname(params.filepath), requireName) : requireName, 244 | errorFile: requireName, 245 | cb: cb 246 | }); 247 | } else { 248 | cb(); 249 | } 250 | } else { 251 | cb(new Error('type is illegal ' + type + ' , ' + requireName)); 252 | } 253 | } else { 254 | cb(new Error('extname is illegal ' + requireName)); 255 | } 256 | } else { 257 | cb(null, line); 258 | } 259 | }); 260 | } 261 | 262 | module.exports = combine; 263 | -------------------------------------------------------------------------------- /src/lib/combineTarget.js: -------------------------------------------------------------------------------- 1 | var stream = require('stream'); 2 | var util = require('util'); 3 | 4 | function combineTarget(){ 5 | stream.Writable.call(this); 6 | this.file = ''; 7 | } 8 | util.inherits(combineTarget,stream.Writable); 9 | 10 | combineTarget.prototype._write = function(chunk,encoding,callback){ 11 | this.file += chunk.toString(); 12 | callback(); 13 | }; 14 | 15 | module.exports = combineTarget; 16 | -------------------------------------------------------------------------------- /src/lib/config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author xiaojue[designsor@gmail.com] 3 | * @fileoverview config management 4 | */ 5 | var path = require('path'); 6 | var jsonfile = require('jsonfile'); 7 | var LOCALPATH = process.env.HOME || process.env.USERPROFILE; 8 | var addjsConfig = path.join(LOCALPATH, '.addjs/config.json'); 9 | 10 | module.exports = { 11 | setSvn: function(username,pwd,command) { 12 | var config =jsonfile.readFileSync(addjsConfig); 13 | config.svninfo = config.svninfo || {}; 14 | config.svninfo.username = username; 15 | config.svninfo.password = pwd; 16 | config.svninfo.command = command || 'svn'; 17 | jsonfile.writeFileSync(addjsConfig,config); 18 | this.info(); 19 | }, 20 | info: function() { 21 | console.dir(jsonfile.readFileSync(addjsConfig)); 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /src/lib/server.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author xiaojue[designsor@gmail.com] 3 | * @fileoverview debug addjs server 4 | */ 5 | var express = require('express'); 6 | var path = require('path'); 7 | var app = express(); 8 | var fs = require('fs'); 9 | var combine = require('./combine'); 10 | 11 | var ContentType = { 12 | '.js': 'text/javascript', 13 | '.css': 'text/css' 14 | }; 15 | 16 | var KEYWORDS = { 17 | '.js': '@require', 18 | '.css': '@require' 19 | }; 20 | 21 | function startServer(dir, options) { 22 | options = options || {}; 23 | var defaultOptions = { 24 | host: options.host || '127.0.0.1', 25 | port: options.port || 7575, 26 | apiPath: options.apiPath || '/combine', 27 | apiParam: options.apiParam || 'filename', 28 | svninfo: options.svninfo 29 | }; 30 | var keywords = options.keywords ? options.keywords : KEYWORDS; 31 | app.get(defaultOptions.apiPath, function(req, res, next) { 32 | if (req.query.hasOwnProperty(defaultOptions.apiParam)) { 33 | var filepath = req.query[defaultOptions.apiParam]; 34 | filepath = path.resolve(dir, filepath).replace(/\?.*$/g, ''); 35 | var ext = path.extname(filepath); 36 | if (fs.existsSync(filepath) && (ext === '.js' || ext === '.css')) { 37 | var es6 = req.query.es6 ? true : false; 38 | var sass = req.query.sass ? true : false; 39 | var combineFile = new combine(defaultOptions.svninfo).concat(filepath, keywords[ext], ext, es6, sass); 40 | res.header('Content-Type', ContentType[ext]); 41 | combineFile.pipe(res); 42 | } else { 43 | next(); 44 | } 45 | } else { 46 | next(); 47 | } 48 | }); 49 | app.use(function(req, res) { 50 | res.send('Illegal request'); 51 | }); 52 | app.listen(defaultOptions.port, defaultOptions.host, function() { 53 | console.info('server start ' + defaultOptions.host + ':' + defaultOptions.port); 54 | console.info('debug basepath: ' + dir); 55 | }); 56 | } 57 | 58 | startServer.start = function(dir, config, port) { 59 | config.port = port ? port : config.port; 60 | startServer(dir, { 61 | port: config.port, 62 | svninfo: config.svninfo, 63 | keywords: config.keywords 64 | }); 65 | }; 66 | 67 | module.exports = startServer; 68 | -------------------------------------------------------------------------------- /src/lib/utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author xiaojue[designsor@gmail.com] 3 | */ 4 | module.exports = { 5 | definePublicPros: function(source, pros) { 6 | for (var i in pros) { 7 | if (pros.hasOwnProperty(i)) { 8 | Object.defineProperty(source, i, { 9 | value: pros[i], 10 | configurable: true, 11 | enumerable: true, 12 | writable: true 13 | }); 14 | } 15 | } 16 | return source; 17 | }, 18 | definePrivatePros: function(source, pros) { 19 | for (var i in pros) { 20 | if (pros.hasOwnProperty(i)) { 21 | Object.defineProperty(source, i, { 22 | value: pros[i], 23 | configurable: false, 24 | enumerable: false, 25 | writable: false 26 | }); 27 | } 28 | } 29 | return source; 30 | }, 31 | getRquireType: function(name) { 32 | if ((/^http:\/\//).test(name)) { 33 | return 'http'; 34 | } else if ((/^svn:https:\/\//).test(name)) { 35 | return 'svn'; 36 | } else { 37 | return 'local'; 38 | } 39 | }, 40 | uniq: function(ar) { 41 | var m, n = [], 42 | o = {}; 43 | for (var i = 0; 44 | (m = ar[i]) !== undefined; i++) { 45 | if (!o[m]) { 46 | n.push(m); 47 | o[m] = true; 48 | } 49 | } 50 | return n; 51 | } 52 | }; 53 | -------------------------------------------------------------------------------- /test/config.js: -------------------------------------------------------------------------------- 1 | (function(win) { 2 | win.addjs.setConfig({ 3 | debugMap: { 4 | 'js/home.min.js': 'js/home.js', 5 | 'css/home.min.css': 'css/home.css' 6 | }, 7 | version: '0.0.1' 8 | }); 9 | })(window); 10 | -------------------------------------------------------------------------------- /test/css/home.css: -------------------------------------------------------------------------------- 1 | @import("http://mjs.sinaimg.cn/wap/homev6/201509081810/css/home.css"); 2 | @import("http://mjs.sinaimg.cn/wap/module/sina_tjv6/201509081910/css/style.css"); 3 | -------------------------------------------------------------------------------- /test/css/home.min.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8";html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;outline:0}html,body,form,fieldset,p,div,h1,h2,h3,h4,h5,h6{-webkit-text-size-adjust:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block;clear:both}body{font-family:'Microsoft YaHei',arial,helvetica,sans-serif;-webkit-text-size-adjust:none;color:#111;background:#ebebeb;-webkit-text-size-adjust:none;min-width:320px;font-size:17px}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}form{display:inline}textarea{resize:none}table{border-collapse:collapse;border-spacing:0}ul,ol{list-style:none}input,select,button{font-family:'Microsoft YaHei',arial,helvetica,sans-serif;font-size:100%;vertical-align:middle;outline:0}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;-moz-appearance:button}input:focus:-moz-placeholder,input:focus::-webkit-input-placeholder{color:transparent}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}a{text-decoration:none;color:#111}a:hover{color:#111;text-decoration:none}img{vertical-align:middle;font-size:0;border:0;-ms-interpolation-mode:bicubic}.fl{float:left}.fr{float:right}.hide{display:none!important}.show{display:block!important}.ellipsis{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.break{word-break:break-all;word-wrap:break-word}.clearfix:after{content:'\0020';display:block;height:0;clear:both}.clearfix{*zoom:1}.blank{height:10px}@font-face{font-family:'SinaHomeFont';src:url('fonts/SinaHomeFont.woff') format('woff'),url('fonts/SinaHomeFont.eot?#iefix') format('embedded-opentype'),url('fonts/SinaHomeFont.ttf') format('truetype');font-weight:normal;font-style:normal}[class^="iconf_"],[class*=" iconf_"]{font-family:'SinaHomeFont';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.iconf_ad:before{content:"\e600"}.iconf_comment_movie:before{content:"\e601"}.iconf_comment_msg:before{content:"\e602"}.iconf_icon_down:before{content:"\e603"}.iconf_icon_enter:before{content:"\e604"}.iconf_icon_up:before{content:"\e605"}.iconf_movie_play:before{content:"\e606"}.iconf_original_add:before{content:"\e607"}.iconf_search:before{content:"\e608"}.iconf_search_ast:before{content:"\e609"}.iconf_search_baby:before{content:"\e60a"}.iconf_search_bus:before{content:"\e60b"}.iconf_search_coachbus:before{content:"\e60c"}.iconf_search_edu:before{content:"\e60d"}.iconf_search_employ:before{content:"\e60e"}.iconf_search_finance:before{content:"\e60f"}.iconf_search_fortune:before{content:"\e610"}.iconf_search_healthy:before{content:"\e611"}.iconf_search_history:before{content:"\e612"}.iconf_search_homemaking:before{content:"\e613"}.iconf_search_hotel:before{content:"\e614"}.iconf_search_house:before{content:"\e615"}.iconf_search_joke:before{content:"\e616"}.iconf_search_lottery:before{content:"\e617"}.iconf_search_mail:before{content:"\e618"}.iconf_search_miaoche:before{content:"\e619"}.iconf_search_movie:before{content:"\e61a"}.iconf_search_NBA:before{content:"\e61b"}.iconf_search_plane:before{content:"\e61c"}.iconf_search_read:before{content:"\e61d"}.iconf_search_recruitment:before{content:"\e61e"}.iconf_search_second_hand:before{content:"\e61f"}.iconf_search_sports:before{content:"\e620"}.iconf_search_tenement:before{content:"\e621"}.iconf_search_ticket:before{content:"\e622"}.iconf_search_traffic:before{content:"\e623"}.iconf_search_train:before{content:"\e624"}.iconf_search_translate:before{content:"\e625"}.iconf_search_weather:before{content:"\e626"}.iconf_search_weibo:before{content:"\e627"}.iconf_tab_bar_menu:before{content:"\e628"}.iconf_tab_bar_profile:before{content:"\e629"}details{display:none}.headerbox{clear:both;overflow:hidden;position:relative;border-bottom:2px solid #1e88d7;height:48px;line-height:48px;background:#119aef;padding:0 12px 0 10px}.headerbox aside{float:right;font-size:22px;clear:none}.sina_logo{float:left;display:block;margin-top:10px;width:130px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAAA4CAYAAAAbx4ZoAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2V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.sina_logo img{width:130px;height:28px}.h_icon_items li{position:relative;float:left;margin:0 0 0 24px;width:22px;height:48px;line-height:50px;color:#fff;overflow:hidden}.h_icon_items li a{color:#fff}.h_icon_items li strong{display:none}.h_icon_items li img{vertical-align:-2px}.h_icon_items li:nth-child(2){width:30px;margin-left:20px;text-align:center}.h_icon_items li:nth-child(2) img{width:22px;height:22px;-webkit-border-radius:11px;border-radius:11px;-moz-border-radius:11px;vertical-align:-1px}.h_icon_items .iconf_tab_bar_profile:before{width:22px;display:inline-block}.h_icon_num{position:absolute;right:0;top:12px;width:6px;height:6px;background:#f84c4b;border-radius:50%}#loginBox em{display:none}.main_nav{clear:both;padding:11px 5px 2px}.main_foot_nav{clear:both;padding:4px 5px 0}.main_nav_list{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;margin-bottom:10px}.main_nav_list a{-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;display:block;text-align:center;white-space:nowrap;width:34px;color:#333;line-height:1.3}.main_foot_nav .main_nav_list a{color:#888}.main_nav_list a:last-child{display:none}.topbar{clear:both;overflow:hidden;background:#fff;padding:0}.recommend_items{clear:both;overflow:hidden;border-bottom:1px solid #dfdfdf;height:40px;line-height:40px;position:relative;margin:0 14px}.recommend_items li{clear:both;width:100%;height:100%;position:absolute;left:0;top:0;background:#fff;z-index:1}.recommend_items li:first-child{z-index:10}.recommend_items li span{float:right;background:#fa4e46;color:#fff;font-size:12px;height:16px;line-height:16px;padding:0 3px;margin:12px 0 0 10px}.recommend_items li a{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.top_news{clear:both;overflow:hidden;text-align:center;padding:10px 0 14px;line-height:1.8}.top_news_h2{clear:both;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-weight:normal;font-size:21px;padding:0 12px}.top_news_info{clear:both;font-size:14px;line-height:1.6}.top_news_info a{display:inline-block;margin:0 4px;color:#111}.top_slide_pic{clear:both}.top_slide{clear:both;position:relative;overflow:hidden;width:100%;min-height:160px}.top_slide_wrap{position:relative;overflow:hidden;height:100%!important}.top_slide_wrap div{width:100%;height:100%;position:absolute;left:0;top:0;display:none}.top_slide_wrap div:first-child{display:block}.top_slide_wrap .toload::before{content:"图片加载中";font-size:14px;color:#999;line-height:20px;width:80px;text-align:center;position:absolute;left:50%;top:50%;margin-left:-40px;margin-top:-20px}.top_slide_wrap img{font-size:0;vertical-align:top;width:100%;height:auto}.top_slide_info{position:absolute;left:0;right:0;bottom:0;display:block;box-sizing:border-box;-webkit-box-sizing:border-box;background:rgba(0,0,0,.3);color:#fff;line-height:2.1;padding:0 10px;font-size:15px}.top_slide_t{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:block;font-style:normal}.top_slide_num{position:absolute;right:4px;bottom:4px;width:56px;text-align:right;font-family:Arial;color:#fff}.top_slide_num .curNum{color:#f84c4b}.news_module,.section-content{clear:both;overflow:hidden;background:#fff;border-top:1px solid #dfdfdf;border-bottom:1px solid #dfdfdf;margin-bottom:7px;position:relative}.section-content{padding:0 12px}.news_tab_fixed{border-top:1px solid #dfdfdf;position:fixed;left:0;right:0;top:0;display:none;z-index:200}.news_tab_fixed .news_tab_nav.on{border-bottom:2px solid rgba(0,122,255,.8)}.fixed_show{display:block}.news_tab{clear:both;border-bottom:1px solid #dfdfdf;color:#333;padding:0 12px;font-size:17px;height:41px;line-height:41px;background:#f5f5f5;background:-moz-linear-gradient(top,rgba(249,249,249,.98),rgba(245,245,245,.98) 100%);background:-webkit-gradient(linear,0 0,0 100%,from(rgba(249,249,249,.98)),to(rgba(245,245,245,.98)))}.news_tab_nav{float:left;text-align:center;white-space:nowrap;text-align:center;padding:0 9px;min-width:55px}.news_tab_nav.on{color:#007aff;border-bottom:2px solid #007aff;font-size:19px;line-height:40px}.news_tab_nav strong{font-weight:normal}.like_dots{position:absolute;width:65px;height:41px;line-height:41px;right:9px;top:0}.like_dots li{display:block;float:left;width:13px;height:41px;line-height:41px;text-align:center}.like_dots li i{display:inline-block;width:6px;height:6px;vertical-align:middle;-webkit-border-radius:3px;border-radius:3px;-moz-border-radius:3px;background:#dfdfdf}.like_dots .on i{background:#007aff}#j_like_loading,.loading-box{text-align:center;height:292px;line-height:292px;font-size:17px;color:#111}#j_weibo_loading{width:100%;text-align:center;height:146px;line-height:146px;font-size:17px;color:#111}.j_newsModule{clear:both;margin:0 12px}.news_items_module_wrap{overflow:hidden;width:100%}.news_items_module{clear:both;overflow:hidden;background:#fff;width:100%}.news_items{clear:both;overflow:hidden;padding:10px 0}.news_items li{clear:both;overflow:hidden;height:34px;line-height:34px}.news_items li a{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.news_items li a:visited{color:#aaa}.news_items li a.news_more{display:inline-block}.news_items li em{display:inline-block;font-style:normal;overflow:hidden}.news_tips{float:right;color:#888;font-size:12px}.news_tips em{font-style:normal;color:#ccc}.news_tips_ico_com{content:"";display:inline-block;vertical-align:-2px;margin-left:5px;width:12px;height:12px;font-size:12px}.news_tips_ico_video{content:"";display:inline-block;vertical-align:-2px;margin-left:5px;width:12px;height:12px;font-size:12px}.news_tips_t{float:right;font-weight:normal;font-size:13px;color:#fa4e46;vertical-align:middle}.news_tips_t strong{border:1px solid #fa4e46;display:inline-block;height:13px;line-height:13px;padding:1px;font-weight:normal}.news_num{float:left;font-size:16px;width:20px;height:20px;text-align:center;line-height:21px;font-family:Arial,Helvetica,sans-serif;background:#dfdfdf;margin:7px 8px 0 0}.news_items li:nth-child(1) .news_num{background:#f02e2e;color:#fff}.news_items li:nth-child(2) .news_num{background:#f56116;color:#fff}.news_items li:nth-child(3) .news_num{background:#ff9500;color:#fff}.news_more_tips{clear:both;border-top:1px solid #dfdfdf;height:44px;line-height:44px;text-align:center;font-size:15px}.news_more_tips a{display:block;color:#333}.news_more_tips span{position:relative}.news_more_d{content:"";display:inline-block;vertical-align:-1px;margin-left:5px;width:12px;height:12px;font-size:12px}.news_more_r{content:"";display:inline-block;vertical-align:0;margin-left:5px;width:12px;height:12px;font-size:12px}.news_pic_items{clear:both;overflow:hidden;padding:12px 0 8px}.news_pic_items.m_b{margin-bottom:-10px;padding-bottom:0}.news_pic_items li{float:left;width:50%;box-sizing:border-box;-webkit-box-sizing:border-box;position:relative}.news_video_ico{position:absolute;top:50%;left:50%;display:inline-block;width:48px;height:48px;margin-left:-23px;margin-top:-38px;font-size:48px;color:#fff;background:rgba(0,0,0,.4);border-radius:50%}.news_pic_img{width:100%}.news_pic_items li:nth-child(odd){padding:0 2px 4px 0;clear:left}.news_pic_items li:nth-child(even){padding:0 0 4px 2px}.news_pic_info{position:absolute;box-sizing:border-box;-webkit-box-sizing:border-box;background:rgba(0,0,0,.4);color:#fff;height:32px;line-height:32px;font-size:15px;padding:0 10px}.news_pic_dl{clear:both;overflow:hidden;padding:12px 0 8px}.news_pic_dl dt{float:left;width:50%;box-sizing:border-box;-webkit-box-sizing:border-box;position:relative;padding:0 2px 4px 0;overflow:hidden}.news_pic_dl dd{overflow:hidden;*zoom:1;padding-left:3px}.dd_news_pic{clear:both;overflow:hidden}.dd_news_pic li{float:left;width:100%;box-sizing:border-box;-webkit-box-sizing:border-box;position:relative;padding-bottom:4px}.news_pic_items li:nth-child(odd) .news_pic_info{left:0;right:2px;bottom:4px}.news_pic_items li:nth-child(even) .news_pic_info{left:2px;right:0;bottom:4px}.news_pic_dl dt .news_pic_info{left:0;right:2px;bottom:0}.dd_news_pic li .news_pic_info{left:0;right:0;bottom:4px}.news_pic_items a,.news_pic_dl a{display:block;overflow:hidden}.news_team_card{clear:both;overflow:hidden;background:#f9f9f9;text-align:center;margin:0 -10px 0 -10px;padding:13px 10px 7px;height:82px;color:#666;font-size:12px}.news_team_card_l{float:left;width:24%;text-align:center}.news_team_card_r{float:right;width:24%;text-align:center}.news_team_card_l img,.news_team_card_r img{width:60px}.news_team_card_l span,.news_team_card_r span{display:block;line-height:20px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.news_team_card_info{position:absolute;left:25%;right:25%;text-align:center}.news_team_num{clear:both;color:#333;font-size:32px;line-height:60px}.news_team_tips{clear:both}.news_team_tips span{display:inline-block;height:18px;line-height:18px;border:1px solid #dfdfdf;padding:0 14px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.news_team_vs_card{clear:both;overflow:hidden;background:#f9f9f9;margin:0 -10px 0 -10px;height:48px;color:#666;font-size:10px;padding:10px}.news_team_vs_card_l,.news_team_vs_card_r{width:50%;box-sizing:border-box;-webkit-box-sizing:border-box;height:48px;position:relative}.news_team_vs_card_l{float:left;padding-right:3px;border-right:1px solid #ccc}.news_team_vs_card_r{float:right;padding-left:3px}.news_team_vs_card_l .news_team_card_l img,.news_team_vs_card_l .news_team_card_r img,.news_team_vs_card_r .news_team_card_l img,.news_team_vs_card_r .news_team_card_r img{width:25px}.news_team_vs_card_l .news_team_num,.news_team_vs_card_r .news_team_num{font-size:15px;line-height:25px}.news_team_vs_card_l .news_team_tips span,.news_team_vs_card_r .news_team_tips span{height:18px;line-height:18px;border:1px solid #dfdfdf;padding:0 6px;font-size:10px}.news_hot_card{clear:both;padding:12px 0 2px;height:30px;line-height:30px;margin-bottom:-10px;font-size:0;display:-webkit-box;-webkit-box-pack:justify;overflow:hidden}.news_hot_card.leju{padding:18px 0 2px}.news_hot_card strong{font-weight:normal}.news_hot_card a{-webkit-box-flex:1;display:block;text-align:center;white-space:nowrap;background:#ddf0fd;margin:0 9px 0 0;font-size:13px;color:#007aff}.news_hot_card a:last-child{margin-right:0}.news_finance_card{clear:both;padding:12px 0 2px;height:30px;line-height:30px;margin-bottom:-10px;font-size:0;overflow:hidden}.news_finance_card_info{width:50%;font-size:13px;color:#fff;box-sizing:border-box;-webkit-box-sizing:border-box;text-align:center}.news_finance_card_info.fl{float:left;padding-right:5px}.news_finance_card_info.fr{float:left;padding-left:5px}.news_finance_card_info p{height:30px;line-height:30px}.news_finance_card_info strong{font-size:13px;font-weight:normal;float:left;margin-left:8px}.news_finance_card_info span{font-size:13px;font-family:Arial,Helvetica,sans-serif;float:right;margin-right:8px;display:block;height:30px;line-height:32px}.finance_green{background:#05d396}.finance_red{background:#fc2f3b}.finance_black{background:#f1f1f1;color:#111}.search_module{clear:both;background:#f9f9f9;overflow:hidden;border-top:1px solid #dfdfdf;border-bottom:1px solid #dfdfdf;margin-bottom:7px;padding:12px 0 8px;font-size:15px}.search_form{position:relative;clear:both;display:-webkit-box;border:1px solid #ccc;background:#fff;height:38px;line-height:38px;color:#888;margin:0 12px 12px;padding:0 14px 0 10px}.search_input{width:100%;border:0;background:0;-webkit-box-flex:1;display:block;height:38px;color:#888}.search_btn{position:relative;width:38px;height:38px;line-height:38px;text-align:center;background:0;color:#666;font-size:22px;vertical-align:middle;margin-left:10px;cursor:pointer}.search_btn em{font-style:normal}.search_form .i_search_btn{position:absolute;left:0;top:0;border:0;width:100%;height:100%;background:transparent}.search_nav_module{clear:both;overflow:hidden;padding:0 7px}.lives_nav_module{clear:both;overflow:hidden;padding:0 7px;margin-bottom:10px}.lives_nav_items_module{clear:both;overflow:hidden;padding:20px 7px 14px}.search_nav_items,.lives_nav_items{clear:both;text-align:center;font-size:15px}.search_nav_items strong,.lives_nav_items strong{font-weight:normal}.search_nav_items li,.lives_nav_items li{float:left;width:58px;padding:0 5px;color:#333;line-height:1.5}.search_nav_items li a,.lives_nav_items li a{display:block;color:#333}.search_ico_card{border:1px solid #ccc;width:58px;height:58px;line-height:58px;color:#007aff;margin-bottom:5px;font-size:30px}.lives_ico_card{border:1px solid #ccc;width:58px;height:58px;line-height:58px;margin-bottom:5px;font-size:0}.search_ico_card span{line-height:60px}.lives_ico_card_add span{line-height:58px}.lives_ico_card img{font-size:0;vertical-align:top;width:58px;height:58px}.lives_ico_card_add{border:1px solid #ccc;width:58px;height:58px;line-height:58px;color:#007aff;margin-bottom:5px;font-size:40px}.wb_top_module{clear:both;height:170px;padding:10px 0;display:-webkit-box;-webkit-box-pack:justify;overflow:hidden;font-size:15px}.wb_top_module_card{-webkit-box-flex:1;width:0;display:block;text-align:left;margin-right:10px;overflow:hidden}.wb_top_module_card:last-child{margin:0}.wb_top_module_card a{display:block}.wb_top_info{clear:both;overflow:hidden;float:left;box-sizing:border-box;-webkit-box-sizing:border-box;width:100%;padding:0 6px 0 10px;font-size:15px;background:#eef8fe;color:#007aff;text-align:justify}.wb_num_1{background:#fee9e9;color:#f02e2e}.wb_num_2{background:#fff0e9;color:#f56116}.wb_num_3{background:#fff5e7;color:#ff9500}.wb_top_info.h170{height:170px;line-height:170px}.wb_top_info.h80{height:80px;line-height:80px}.wb_top_info.m_b{margin-bottom:5px}.wb_top_info.m_t{margin-top:5px}.wb_top_info p{display:inline-block;vertical-align:middle;line-height:1.4rem}.wb_top_info p span{font-family:Arial,Helvetica,sans-serif;font-weight:600;display:block}.topbtn{position:fixed;right:10px;bottom:80px;background:rgba(0,0,0,.6);color:#fff;width:45px;height:45px;text-align:center;line-height:45px;font-size:20px;z-index:500;display:none}.topbtn.showbtn{display:block;-webkit-animation:opacityIn .5s .1s linear both}.footerbox{clear:both;overflow:hidden;position:relative;background:#129bf1;color:#88c2f5;padding:12px 10px 16px;font-size:10px}.footerbox a{color:#88c2f5}.footer_nav{clear:both;font-size:0;line-height:1.8}.footer_nav span{display:inline-block;font-size:17px;margin:0 27px 0 0}.footer_nav span:last-child{float:right;margin-right:0;font-size:14px}@-webkit-keyframes opacityIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes opacityOut{0%{opacity:1}100%{opacity:0}}@media(max-width:360px){.j_box{background:#000;display:block;line-height:20px;text-align:center;color:#fff}}@media(min-width:360px){.j_box{background:red;display:block;line-height:20px;text-align:center;color:#fff}.headerbox{padding:0 14px 0 12px}.main_nav{padding:11px 5px 2px}.main_nav_list a:last-child{display:block}}.sina_home_t{padding:0 12px!important}.sina_home_t{clear:both;padding:0 10px;background:#f9f9f9;font-size:15px;height:37px;line-height:37px;margin-bottom:7px}.sina_home_t a{color:#333;display:block;background:url(../images/_temp/iconf_ad.svg) no-repeat 0 center;background-size:7px auto;padding-left:12px}.sina_home_baner{clear:both;font-size:0;margin-bottom:7px}.sina_home_baner a{display:block}.sina_home_baner img{width:100%;display:block}.sina_tj_baner{margin-bottom:7px}.hot-news-title{position:relative;height:44px}.hot-news-title:before{content:"";position:absolute;left:0;top:21px;width:100%;height:1px;background-color:#dfdfdf}.hot-news-title span{position:absolute;left:50%;top:0;display:block;margin-left:-45px;width:90px;text-align:center;font-size:15px;color:#666;line-height:44px;background-color:#fff}#hot_news_async{padding-top:0}#hot_news_async .loading{text-align:center}.lives_nav_items_module.app_down_mod{padding-bottom:4px}.app_nav_items li{float:left;padding-bottom:10px;width:25%;text-align:center}.app_nav_items li a{display:block;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.app_nav_items li .download_btn{position:absolute;left:50%;top:37px;width:31px;height:22px;background-image:url("http://mjs.sinaimg.cn/wap/homev6/201507231550/images/app_download.png");background-size:100% 100%}.app_nav_items li img{margin:0 auto;display:block;width:55px;height:55px;border-radius:20%}.app_nav_items li p{margin:10px 0;font-size:13px;height:13px;line-height:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sina_tj_card_article{clear:both;overflow:hidden;*zoom:1;font-size:14px;background:#fff;margin:0 6px 10px}.sina_tj_home_txt{clear:both;padding:0 12px 10px}.sina_tj_home_tips{padding-bottom:16px;font-size:17px;line-height:22px;margin-top:-4px}.sina_tj_feed{clear:both;margin:0 8px;padding:8px 0;border-bottom:1px solid #ececec;font-size:15px}.sina_tj_article_top{clear:both;padding:10px 8px 0;font-size:14px}.tj_perch{clear:both;line-height:28px;font-size:14px}.sina_tj_article_list{clear:both;padding:0 10px;line-height:28px;font-size:16px;margin-top:-7px}.sina_tj_baner,.sina_tj_top{font-size:0}.sina_tj_baner img{max-width:100%;display:block;vertical-align:top}.sina_tj_top img{max-width:100%;display:block;vertical-align:top}.tj_num{font-style:normal}.sina_tj{display:block;white-space:nowrap;text-overflow:ellipsis;padding-left:14px;overflow:hidden;position:relative}.sina_tj::before{content:'';position:absolute;top:50%;margin-top:-2px;left:0;background:#3990e6;display:inline-block;width:6px;height:6px;border-radius:50%}.sina_tj_tips{position:relative;clear:both;padding-right:50px}.sina_tj_tips a{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.sina_tj_tips em{position:absolute;right:0;top:3px;z-index:10;display:inline-block;font-style:normal;font-size:13px;padding:1px;color:#5498ed;height:13px;line-height:13px;border:1px solid #5498ed}.sina_tj_wb{display:block;white-space:nowrap;text-overflow:ellipsis;padding-left:24px;overflow:hidden;position:relative}.sina_tj_wb::before{content:'';position:absolute;top:50%;left:0;margin-top:-8px;background:url(../images/tj_ico.png) no-repeat;background-size:25px auto;display:inline-block;width:20px;height:20px}.sina_tj_card_article .sina_tj{padding-left:20px}.sina_tj_card_app{clear:both;padding:0}.sina_tj_card_app a{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.sina_tj_card_app dl{clear:both;overflow:hidden}.sina_tj_card_app dt{float:left;width:51px;padding-right:10px}.sina_tj_card_app dt img{width:51px;height:51px}.sina_tj_card_app dd{overflow:hidden;*zoom:1}.sina_tj_card_app dd h3{color:#333;font-size:14px;line-height:30px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.sina_tj_card_app dd h3:only-child{line-height:51px}.sina_tj_card_app dd p{font-size:12px;color:#666;display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.sina_tj_article_rec{font-size:16px;line-height:18px;position:relative}.sina_tj_article_rec a{padding:0 10px 12px 10px;display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden} -------------------------------------------------------------------------------- /test/css/scss/scss.css: -------------------------------------------------------------------------------- 1 | $font-stack: Helvetica, sans-serif; 2 | $primary-color: #333; 3 | 4 | body { 5 | font: 100% $font-stack; 6 | color: $primary-color; 7 | } 8 | 9 | body { 10 | font: 100% Helvetica, sans-serif; 11 | color: #333; 12 | } 13 | -------------------------------------------------------------------------------- /test/css/scss/scss.source.css: -------------------------------------------------------------------------------- 1 | body{font:100% Helvetica,sans-serif;color:#333}body{font:100% Helvetica,sans-serif;color:#333} -------------------------------------------------------------------------------- /test/js/a.js: -------------------------------------------------------------------------------- 1 | //a.js 2 | alert('a'); 3 | // Expression bodies 4 | /* 5 | var odds = evens.map(v => v + 1); 6 | var nums = evens.map((v, i) => v + i); 7 | 8 | // Statement bodies 9 | nums.forEach(v => { 10 | if (v % 5 === 0) 11 | fives.push(v); 12 | }); 13 | 14 | // Lexical this 15 | var bob = { 16 | _name: "Bob", 17 | _friends: [], 18 | printFriends() { 19 | this._friends.forEach(f => 20 | console.log(this._name + " knows " + f)); 21 | } 22 | }; 23 | */ 24 | @require('http://mjs.sinaimg.cn/wap/homev6/201507301647/js/home.min.js'); 25 | //@require('d.js'); 26 | //@require('b.js'); 27 | //@require('svn:https://svn1.intra.sina.com.cn/wapcms/js/wap_dev/public/collect/trunk/collect.min.js'); 28 | //@require('svn:https://svn1.intra.sina.com.cn/wapcms/js/wap_dev/public/collect/trunk/collect.js'); 29 | abc(); 30 | //@require('http://mjs.sinaimg.cn/wap/homev6/201507301647/js/home.js'); 31 | //123 32 | /** 33 | * @require('c.js') 34 | */ 35 | alert('a'); 36 | -------------------------------------------------------------------------------- /test/js/a.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"unknown","sources":["unknown"],"names":["trim","B","A","replace","bindEvent","C","document","addEventListener","attachEvent","delEvent","removeEventListener","detachEvent","addClass","D","RegExp","length","test","className","removeClass","createScript","getElementsByTagName","createElement","src","charset","appendChild","_ajax","window","ActiveXObject","XMLHttpRequest","onreadystatechange","status","JSON","parse","responseText","open","send","getWinWidth","innerWidth","documentElement","clientWidth","body","getWinHeight","innerHeight","clientHeight","getWinScrollHeight","scrollTop","newsMore","querySelectorAll","E","this","parentNode","previousElementSibling","previousSibling","F","nextElementSibling","nextSibling","picHeight","G","Math","ceil","floor","style","offsetHeight","K","getCurIndex","L","H","J","I","getAttribute","querySelector","clearTimeout","setTimeout","scrollTo","rollInit","id","IRoller","slideStyleInit","children","tabInit","index","moduleInit","iScrollInit","IScroller","offsetTop","getBoundingClientRect","top","bottom","tabNav","innerHTML","setAttribute","removeAttribute","tab","item","M","items","alert","wrap","getElementById","rollItem","len","currentNum","_height","interval","timer","firstInit","cloneNode","round","translate","navigator","userAgent","toLowerCase","webkitTransitionDuration","MozTransitionDuration","msTransitionDuration","OTransitionDuration","transitionDuration","webkitTransitionTimingFunction","MozTransitionTimingFunction","msTransitionTimingFunction","OTransitionTimingFunction","transitionTimingFunction","indexOf","webkitTransform","msTransform","MozTransform","OTransform","setAnimation","init","setInterval","Swiper","tabs","startIndex","auto","speed","maxHeight","Infinity","callback","circular","innerWrap","offsetWidth","_width","X","curX","Y","curY","direction","eventInit","slideTimer","timerCleared","isScrolling","isValidSlide","prototype","width","min","height","gotoPage","addEvent","_stop","touchX","touches","pageX","touchY","pageY","switchTab","undefined","slide","_touchstart","_touchmove","_touchend","clearInterval","abs","preventDefault","kill","parentW","scrollItem","actualW","currentPos","max","N","P","O","U","Q","location","hostname","host","href","match","pathname","search","V","R","W","S","removeChild","T","rel","type","head","childNodes","b","Z","target","c","path","a","d","f","parentElement","Date","toDateString","localStorage","stringify","Object","toString","call","iosInstallUrl","androidInstallUrl","iosNativeUrl","androidNativeUrl","cssText","valueOf","platform","_UA","installUrl","nativeUrl","openTime","iosOpenTime","androidOpenTime","_hackChrome","_gotoNative","now","split","Image","schemejc","_gotoDownload","display","e","Error","abc"],"mappings":"AAsBI,QAASA,MAAKC,GAAG,GAAIC,GAAED,EAAEE,QAAQ,SAAS,GAAI,OAAOD,GAAE,QAASE,WAAUF,EAAEG,EAAEJ,GAAOK,SAASC,iBAA0CL,EAAEK,iBAAiBF,EAAEJ,GAAE,GAA/CC,EAAEM,YAAYH,EAAEJ,GAAuC,QAASQ,UAASP,EAAEG,EAAEJ,GAAOK,SAASI,oBAA6CR,EAAEQ,oBAAoBL,EAAEJ,GAAE,GAAlDC,EAAES,YAAYN,EAAEJ,GAA0C,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E2B,KAAKsB,MAAMxC,EAAE1L,SAAS8K,EAAEY,EAAExJ,KAAK2I,EAAEa,EAAE3K,cAAc,SAAU8J,GAAExG,GAAG,wBAAwBwG,EAAEtH,MAAMgL,QAAQ,OAAO1D,EAAE7J,IAAI+J,EAAE6C,UAAc9C,EAAwDA,EAAE5J,YAAY2J,GAAnE3G,WAAW,WAAWwH,EAAExJ,KAAKhB,YAAY2J,IAAI,GAAyB3G,WAAW,WAAWwH,EAAExJ,KAAK2J,YAAYhB,GAAGE,EAAEuD,cAAcrD,IAAIF,EAAE8C,WAAWS,cAAc,SAASvD,GAAG,GAAIF,GAAElI,KAASmI,EAAE8B,KAAKsB,KAASpD,GAAEC,EAAEF,EAAEgD,SAAS,MAAKzM,OAAO8J,SAASL,EAAE8C,aAAaD,IAAI,WAAW,GAAI3C,GAAExE,UAAUC,SAAgBuE,GAAEO,MAAM,WAAY,OAAGP,GAAEO,MAAM,iBAAwB,MAAcP,EAAEO,MAAM,YAAmB,UAAqB,KAAg5C1L,EAAE,EAAMiE,EAAE,IAAUD,EAAE,IAAKM,YAAW,WAAWnB,KAAK,QACrtoB,MAAMyL,GAAG,KAAM,IAAIC,OAAMD,EAAE,iEAK5BE,MAMAhJ,MAAM","sourcesContent":["//a.js\r\nalert('a');\r\n// Expression bodies\r\n/*\r\nvar odds = evens.map(v => v + 1);\r\nvar nums = evens.map((v, i) => v + i);\r\n// Statement bodies\r\nnums.forEach(v => {\r\n if (v % 5 === 0)\r\n fives.push(v);\r\n});\r\n// Lexical this\r\nvar bob = {\r\n _name: \"Bob\",\r\n _friends: [],\r\n printFriends() {\r\n this._friends.forEach(f =>\r\n console.log(this._name + \" knows \" + f));\r\n }\r\n};\r\n*/\r\n\r\ntry{function trim(B){var A=B.replace(/^\\s*$/g,\"\");return A}function bindEvent(A,C,B){if(!document.addEventListener){A.attachEvent(C,B)}else{A.addEventListener(C,B,false)}}function delEvent(A,C,B){if(!document.removeEventListener){A.detachEvent(C,B)}else{A.removeEventListener(C,B,false)}}function addClass(B,D){var A=new RegExp(\"\\\\b\"+D+\"\\\\b\");if(B.length>1){for(var C=0;C1){for(var C=0;C=200&&D.status<300)||D.status==304){A(JSON.parse(D.responseText))}else{C()}};D.open(\"get\",B,false);D.send(null)}function getWinWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0}function getWinHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}function getWinScrollHeight(){return document.documentElement.scrollTop||document.body.scrollTop}function newsMore(){var B=document.querySelectorAll(\".j_newsBtn\");for(var A=0;A0){for(var I=0;I0){for(var I=0;I0){for(var I=0;IG&&getWinScrollHeight()this.len-1){return this.currentNum+B-this.len}else{return this.currentNum+B}}};this.translate=function(C,E,B){var F=navigator.userAgent.toLowerCase(),D=C&&C.style;D.webkitTransitionDuration=D.MozTransitionDuration=D.msTransitionDuration=D.OTransitionDuration=D.transitionDuration=B+\"ms\";D.webkitTransitionTimingFunction=D.MozTransitionTimingFunction=D.msTransitionTimingFunction=D.OTransitionTimingFunction=D.transitionTimingFunction=\"ease-in-out\";if(F.indexOf(\"gt-\")!=-1){D.webkitTransform=\"translateY(\"+E+\"px)\"}else{D.webkitTransform=\"translate3d(0, \"+E+\"px, 0)\"}D.msTransform=D.MozTransform=D.OTransform=\"translateY(\"+E+\"px)\"};this.setAnimation=function(){var B=this;for(var C=0;C0){for(var A=0;Athis.len-1){return this.currentNum+A-this.len}else{return this.currentNum+A}}}else{if(this.currentNum+A<0||this.currentNum+A>this.len-1){return -1}else{return this.currentNum+A}}},addEvent:function(){var C=this.innerWrap,D=this.tabs,A=this;bindEvent(C,\"touchstart\",function(E){A._touchstart(E)});bindEvent(C,\"touchmove\",function(E){A._touchmove(E)});bindEvent(C,\"touchend\",function(E){A._touchend(E)});bindEvent(window,\"resize\",function(){A.init()});if(D&&D.length>0){for(var B=0;BMath.abs(D)){if(Math.abs(E)>30){A.isValidSlide=true;A.direction=E>0?1:0}else{A.isValidSlide=false}if(A.isValidSlide){var C=A.direction==1?A.round(-1):A.round(1);A.gotoPage(C)}else{A.setAnimation()}}delEvent(F,\"touchstart\",function(G){A._touchstart(G)});delEvent(F,\"touchmove\",function(G){A._touchmove(G)})},gotoPage:function(A){if(A!=-1){this.currentNum=A;this.setAnimation();this.switchTab();this.callback(this.items[A],A,this.direction)}},kill:function(){var A=this,C=A.wrap,D=A.tabs;this._stop();var F=this.len;while(F--){var E=this.items[F];E.style[\"-webkit-transition-duration\"]=\"0s\";E.style[\"display\"]=\"block\";E.style[\"-webkit-transform\"]=\"translate3d(0, 0, 0)\"}delEvent(C,\"touchstart\",function(G){A._touchstart(G)});delEvent(C,\"touchmove\",function(G){A._touchmove(G)});delEvent(C,\"touchend\",function(G){A._touchend(G)});delEvent(window,\"resize\",function(){A.init()});if(D&&D.length>0){for(var B=0;BA.parentW){A.addEvent()}else{this.currentPos=0}A.setAnimation()},touchX:function(A){if(A.touches){return A.touches[0].pageX}else{return A.pageX}},touchY:function(A){if(A.touches){return A.touches[0].pageY}else{return A.pageY}},setAnimation:function(){var A=this,B=A.wrap;B.style[\"-webkit-transition\"]=\"-webkit-transform 0.3s ease-in-out\";B.style[\"-webkit-transform\"]=\"translate3d(\"+A.currentPos+\"px, 0, 0)\"},slide:function(C){var A=this,B=A.wrap;B.style[\"-webkit-transition-duration\"]=\"0s\";B.style[\"-webkit-transform\"]=\"translate3d(\"+(A.currentPos+C)+\"px, 0, 0)\"},addEvent:function(){var B=this.wrap,A=this;bindEvent(B,\"touchstart\",function(C){A._touchstart(C)});bindEvent(B,\"touchmove\",function(C){A._touchmove(C)});bindEvent(B,\"touchend\",function(C){A._touchend(C)})},_touchstart:function(A){this.X=this.touchX(A);this.Y=this.touchY(A);this.isScrolling=undefined},_touchmove:function(B){var A=this,D,C;A.curX=A.touchX(B);A.curY=A.touchY(B);D=A.curX-A.X;C=A.curY-A.Y;if(typeof A.isScrolling==\"undefined\"){A.isScrolling=!!(A.isScrolling||Math.abs(D)Math.abs(C)){if(A.currentPos+D>0){A.currentPos=0}else{A.currentPos=Math.max(A.currentPos+D,A.parentW-A.actualW)}A.setAnimation()}delEvent(E,\"touchstart\",function(F){A._touchstart(F)});delEvent(E,\"touchmove\",function(F){A._touchmove(F)})}};function rollInit(){var C=document.querySelectorAll(\".j_roll\");for(var A=0;A0&&B.length===C.length){for(var A=0;A=87&&getWinScrollHeight()>A){return B}}return -1}function tabNav(){var D=document.querySelectorAll(\".j_navTab\"),B=document.querySelectorAll(\".j_newsModule\"),E=document.querySelector(\".news_tab_fixed\"),C=document.querySelectorAll(\".news_module\");function A(){var H=getCurIndex();if(H!==-1){addClass(E,\"fixed_show\");E.innerHTML=D[H].innerHTML;var I=D[H].getAttribute(\"data-sudaclick\");if(I){E.setAttribute(\"data-sudaclick\",I)}else{E.removeAttribute(\"data-sudaclick\")}var G=E.children;for(var F=0;F

新浪新闻

安装新浪新闻,随时知晓天下事

打开
';document.body.appendChild(N.childNodes[0]);setTimeout(function(){var Y=document.querySelector(\"#promotionCover\");D(Y,\"click\",function(b){var Z=b.target,c=Z.path,a=5;if(c){for(var d=0,f=c.length;dJ){A=P;M();B()}return true;break;default:return false}}var A=0;var J=10000;var H=null;setTimeout(function(){F()},100)})();\r\n}catch(e){throw new Error(e+\" http://mjs.sinaimg.cn/wap/homev6/201507301647/js/home.min.js\");}\r\n//@require('d.js');\r\n//@require('b.js');\r\n//@require('svn:https://svn1.intra.sina.com.cn/wapcms/js/wap_dev/public/collect/trunk/collect.min.js');\r\n//@require('svn:https://svn1.intra.sina.com.cn/wapcms/js/wap_dev/public/collect/trunk/collect.js');\r\nabc();\r\n//@require('http://mjs.sinaimg.cn/wap/homev6/201507301647/js/home.js');\r\n//123\r\n/**\r\n * @require('c.js')\r\n */\r\nalert('a');\r\n"]} -------------------------------------------------------------------------------- /test/js/a.min.js: -------------------------------------------------------------------------------- 1 | function trim(t){var e=t.replace(/^\s*$/g,"");return e}function bindEvent(t,e,i){document.addEventListener?t.addEventListener(e,i,!1):t.attachEvent(e,i)}function delEvent(t,e,i){document.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent(e,i)}function addClass(t,e){var i=new RegExp("\\b"+e+"\\b");if(t.length>1)for(var n=0;n1)for(var n=0;n=200&&n.status<300||304==n.status?e(JSON.parse(n.responseText)):i()},n.open("get",t,!1),n.send(null)}function getWinWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0}function getWinHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}function getWinScrollHeight(){return document.documentElement.scrollTop||document.body.scrollTop}function newsMore(){for(var t=document.querySelectorAll(".j_newsBtn"),e=0;e0)for(var r=0;r0)for(var r=0;r0)for(var r=0;rr&&getWinScrollHeight()0&&t.length===e.length)for(var i=0;i=87&&getWinScrollHeight()>e)return i;return-1}function tabNav(){function t(){var t=getCurIndex();if(-1!==t){addClass(n,"fixed_show"),n.innerHTML=e[t].innerHTML;var o=e[t].getAttribute("data-sudaclick");o?n.setAttribute("data-sudaclick",o):n.removeAttribute("data-sudaclick");for(var s=n.children,a=0;athis.len-1?this.currentNum+t-this.len:this.currentNum+t},this.translate=function(t,e,i){var n=navigator.userAgent.toLowerCase(),r=t&&t.style;r.webkitTransitionDuration=r.MozTransitionDuration=r.msTransitionDuration=r.OTransitionDuration=r.transitionDuration=i+"ms",r.webkitTransitionTimingFunction=r.MozTransitionTimingFunction=r.msTransitionTimingFunction=r.OTransitionTimingFunction=r.transitionTimingFunction="ease-in-out",-1!=n.indexOf("gt-")?r.webkitTransform="translateY("+e+"px)":r.webkitTransform="translate3d(0, "+e+"px, 0)",r.msTransform=r.MozTransform=r.OTransform="translateY("+e+"px)"},this.setAnimation=function(){for(var t=this,e=0;ea;a++)this.circular?a==r?(this.firstInit||this.timerCleared?this.translate(t[a],n,0):this.translate(t[a],n,i),t[a].style.display="block"):a==o?(this.firstInit||this.timerCleared?this.translate(t[a],-n,0):this.translate(t[a],-n,i),t[a].style.display="block"):a==s?(this.firstInit||this.timerCleared?this.translate(t[a],0,0):this.translate(t[a],0,i),t[a].style.display="block"):(t[a].style.display="none",this.translate(t[a],-n,i)):(this.firstInit?this.translate(t[a],(a-s)*n,0):this.translate(t[a],(a-s)*n,i),t[a].style.display="block");this.firstInit=!1,this.maxHeight===1/0&&(this.innerWrap.style.height=this.items[s].offsetHeight+"px")},translate:function(t,e,i){var n=navigator.userAgent.toLowerCase(),r=t&&t.style;r.webkitTransitionDuration=r.MozTransitionDuration=r.msTransitionDuration=r.OTransitionDuration=r.transitionDuration=i+"ms",r.webkitTransitionTimingFunction=r.MozTransitionTimingFunction=r.msTransitionTimingFunction=r.OTransitionTimingFunction=r.transitionTimingFunction="ease-in-out",-1!=n.indexOf("gt-")?r.webkitTransform="translateX("+e+"px)":r.webkitTransform="translate3d("+e+"px, 0, 0)",r.msTransform=r.MozTransform=r.OTransform="translateX("+e+"px)"},switchTab:function(){var t=this.tabs,e=t?this.currentNum%t.length:void 0;if(t&&t.length>0)for(var i=0;ithis.len-1?this.currentNum+t-this.len:this.currentNum+t:this.currentNum+t<0||this.currentNum+t>this.len-1?-1:this.currentNum+t},addEvent:function(){var t=this.innerWrap,e=this.tabs,i=this;if(bindEvent(t,"touchstart",function(t){i._touchstart(t)}),bindEvent(t,"touchmove",function(t){i._touchmove(t)}),bindEvent(t,"touchend",function(t){i._touchend(t)}),bindEvent(window,"resize",function(){i.init()}),e&&e.length>0)for(var n=0;nMath.abs(r))if(Math.abs(n)>30?(e.isValidSlide=!0,e.direction=n>0?1:0):e.isValidSlide=!1,e.isValidSlide){var o=1==e.direction?e.round(-1):e.round(1);e.gotoPage(o)}else e.setAnimation();delEvent(i,"touchstart",function(t){e._touchstart(t)}),delEvent(i,"touchmove",function(t){e._touchmove(t)})},gotoPage:function(t){-1!=t&&(this.currentNum=t,this.setAnimation(),this.switchTab(),this.callback(this.items[t],t,this.direction))},kill:function(){var t=this,e=t.wrap,i=t.tabs;this._stop();for(var n=this.len;n--;){var r=this.items[n];r.style["-webkit-transition-duration"]="0s",r.style.display="block",r.style["-webkit-transform"]="translate3d(0, 0, 0)"}if(delEvent(e,"touchstart",function(e){t._touchstart(e)}),delEvent(e,"touchmove",function(e){t._touchmove(e)}),delEvent(e,"touchend",function(e){t._touchend(e)}),delEvent(window,"resize",function(){t.init()}),i&&i.length>0)for(var o=0;ot.parentW?t.addEvent():this.currentPos=0,t.setAnimation()},touchX:function(t){return t.touches?t.touches[0].pageX:t.pageX},touchY:function(t){return t.touches?t.touches[0].pageY:t.pageY},setAnimation:function(){var t=this,e=t.wrap;e.style["-webkit-transition"]="-webkit-transform 0.3s ease-in-out",e.style["-webkit-transform"]="translate3d("+t.currentPos+"px, 0, 0)"},slide:function(t){var e=this,i=e.wrap;i.style["-webkit-transition-duration"]="0s",i.style["-webkit-transform"]="translate3d("+(e.currentPos+t)+"px, 0, 0)"},addEvent:function(){var t=this.wrap,e=this;bindEvent(t,"touchstart",function(t){e._touchstart(t)}),bindEvent(t,"touchmove",function(t){e._touchmove(t)}),bindEvent(t,"touchend",function(t){e._touchend(t)})},_touchstart:function(t){this.X=this.touchX(t),this.Y=this.touchY(t),this.isScrolling=void 0},_touchmove:function(t){var e,i,n=this;n.curX=n.touchX(t),n.curY=n.touchY(t),e=n.curX-n.X,i=n.curY-n.Y,"undefined"==typeof n.isScrolling&&(n.isScrolling=!!(n.isScrolling||Math.abs(e)Math.abs(r)&&(e.currentPos+n>0?e.currentPos=0:e.currentPos=Math.max(e.currentPos+n,e.parentW-e.actualW),e.setAnimation()),delEvent(i,"touchstart",function(t){e._touchstart(t)}),delEvent(i,"touchmove",function(t){e._touchmove(t)})}},setTimeout(function(){rollInit(),slideStyleInit(),moduleInit(),iScrollInit(),tabNav(),scrollTop(),window.addEventListener("resize",function(){picHeight(),slideStyleInit()})},300),function(){function t(t,e,i){document.addEventListener?t.addEventListener(e,i,!1):t.attachEvent(e,i)}function e(e,i,r){var e=e||document.location.hostname||document.location.host||document.location.href.match(/http:\/\/([^\/]+)/i)&&document.location.href.match(/http:\/\/([^\/]+)/i)[1],i=i||document.location.pathname||document.location.href.match(/http:\/\/[^\/]+(.*)/i)&&document.location.href.match(/http:\/\/[^\/]+(.*)/i)[1],r=r||document.location.search||document.location.href.match(/.*(\?.*)/)&&document.location.href.match(/.*(\?.*)/)[1],o=e&&null!==e.match(/.*\.?sina\.cn/i),s=i&&i.match(/.*(\.d\.html)/i),a=r&&r.match(/from=qudao&?/i),c=e&&e.match(/lives.sina.cn/i),h="main";if(d=e+i,a&&(d+=r),o){var u=document.querySelector(".promotion_cover");if(u&&document.body.removeChild(u),(s&&!a||c)&&(h="share",document.body.style["margin-top"]="60px",setTimeout(function(){window.scrollTo(0,0)},100)),"main"==h&&!n(d))return;var m=document.createElement("link");m.href="http://mjs.sinaimg.cn/wap/module/promote_float/201503271544/css/index.min.css",m.rel="stylesheet",m.type="text/css",document.head.appendChild(m);var f=document.createElement("div");f.innerHTML='

新浪新闻

安装新浪新闻,随时知晓天下事

打开
',document.body.appendChild(f.childNodes[0]),setTimeout(function(){var e=document.querySelector("#promotionCover");t(e,"click",function(t){var e=t.target,i=e.path,n=5;if(i)for(var r=0,o=i.length;o>r&&(n&&i[r]!=this&&i[r]!=window&&!l(i[r]));r++)n--;else for(;n&&n&&e!=this&&e!=window&&!l(e);)e=e.parentElement,n--})},500)}}function i(){var t=new Date;return t.toDateString()}function n(t){var e=null;try{e=JSON.parse(localStorage.sina_pro_cover)}catch(n){e=null}if(e&&e[t]){if(e[t]==i())return!1;delete e[t]}return localStorage.sina_pro_cover=JSON.stringify(e),!0}function r(t){var e=localStorage.sina_pro_cover;try{e=JSON.parse(e)}catch(n){e={}}"[object Object]"!=Object.prototype.toString.call(e)&&(e={}),e[t]=i(),localStorage.sina_pro_cover=JSON.stringify(e)}function o(){var t=navigator.userAgent.toLowerCase();return"micromessenger"==t.match(/MicroMessenger/i)?!0:!1}function s(){o()&&(window.location.href="http://a.app.qq.com/o/simple.jsp?pkgname=com.sina.news");var t={iosInstallUrl:"http://sina.cn/j/d.php?k=82",androidInstallUrl:"http://sina.cn/j/d.php?k=82",iosNativeUrl:"sinanews://news.sina.cn",androidNativeUrl:"sinanews://news.sina.cn"};c.init(t)}function a(){if(!document.getElementById("download_send_track_fix")){var t=document.createElement("iframe");t.id="download_send_track_fix",t.style.cssText="display:none;width:0px;height:0px;",t.src="http://open.api.sina.cn/count/appview",document.body.appendChild(t)}}function l(t){switch(t.className){case"close_btn":var e=document.querySelector("#promotionCover");return document.body.removeChild(e),r(d),!0;case"action_btn":var i=(new Date).valueOf();return i-h>u&&(h=i,a(),s()),!0;default:return!1}}var c={init:function(t){var e=this;e.platform=e._UA(),e.platform&&("ios"==e.platform?(e.installUrl=t.iosInstallUrl,e.nativeUrl=t.iosNativeUrl,e.openTime=t.iosOpenTime||800):(e.installUrl=t.androidInstallUrl,e.nativeUrl=t.androidNativeUrl,e.openTime=t.androidOpenTime||3e3),"ios"!=e.platform&&navigator.userAgent.match(/Chrome/i)?e._hackChrome():e._gotoNative())},_hackChrome:function(){var t=this,e=Date.now(),i=t.nativeUrl.split("://"),n=(i[0],i[1],new Image);n.src=t.schemejc,t._gotoDownload(e)},_gotoNative:function(){var t=this,e=Date.now(),i=document,n=i.body,r=i.createElement("iframe");r.id="J_redirectNativeFrame",r.style.display="none",r.src=t.nativeUrl,n?n.appendChild(r):setTimeout(function(){i.body.appendChild(r)},0),setTimeout(function(){i.body.removeChild(r),t._gotoDownload(e)},t.openTime)},_gotoDownload:function(t){var e=this,i=Date.now();i-t v + 1); 5 | var nums = evens.map((v, i) => v + i); 6 | // Statement bodies 7 | nums.forEach(v => { 8 | if (v % 5 === 0) 9 | fives.push(v); 10 | }); 11 | // Lexical this 12 | var bob = { 13 | _name: "Bob", 14 | _friends: [], 15 | printFriends() { 16 | this._friends.forEach(f => 17 | console.log(this._name + " knows " + f)); 18 | } 19 | }; 20 | 21 | try{function trim(B){var A=B.replace(/^\s*$/g,"");return A}function bindEvent(A,C,B){if(!document.addEventListener){A.attachEvent(C,B)}else{A.addEventListener(C,B,false)}}function delEvent(A,C,B){if(!document.removeEventListener){A.detachEvent(C,B)}else{A.removeEventListener(C,B,false)}}function addClass(B,D){var A=new RegExp("\\b"+D+"\\b");if(B.length>1){for(var C=0;C1){for(var C=0;C=200&&D.status<300)||D.status==304){A(JSON.parse(D.responseText))}else{C()}};D.open("get",B,false);D.send(null)}function getWinWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0}function getWinHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}function getWinScrollHeight(){return document.documentElement.scrollTop||document.body.scrollTop}function newsMore(){var B=document.querySelectorAll(".j_newsBtn");for(var A=0;A0){for(var I=0;I0){for(var I=0;I0){for(var I=0;IG&&getWinScrollHeight()this.len-1){return this.currentNum+B-this.len}else{return this.currentNum+B}}};this.translate=function(C,E,B){var F=navigator.userAgent.toLowerCase(),D=C&&C.style;D.webkitTransitionDuration=D.MozTransitionDuration=D.msTransitionDuration=D.OTransitionDuration=D.transitionDuration=B+"ms";D.webkitTransitionTimingFunction=D.MozTransitionTimingFunction=D.msTransitionTimingFunction=D.OTransitionTimingFunction=D.transitionTimingFunction="ease-in-out";if(F.indexOf("gt-")!=-1){D.webkitTransform="translateY("+E+"px)"}else{D.webkitTransform="translate3d(0, "+E+"px, 0)"}D.msTransform=D.MozTransform=D.OTransform="translateY("+E+"px)"};this.setAnimation=function(){var B=this;for(var C=0;C0){for(var A=0;Athis.len-1){return this.currentNum+A-this.len}else{return this.currentNum+A}}}else{if(this.currentNum+A<0||this.currentNum+A>this.len-1){return -1}else{return this.currentNum+A}}},addEvent:function(){var C=this.innerWrap,D=this.tabs,A=this;bindEvent(C,"touchstart",function(E){A._touchstart(E)});bindEvent(C,"touchmove",function(E){A._touchmove(E)});bindEvent(C,"touchend",function(E){A._touchend(E)});bindEvent(window,"resize",function(){A.init()});if(D&&D.length>0){for(var B=0;BMath.abs(D)){if(Math.abs(E)>30){A.isValidSlide=true;A.direction=E>0?1:0}else{A.isValidSlide=false}if(A.isValidSlide){var C=A.direction==1?A.round(-1):A.round(1);A.gotoPage(C)}else{A.setAnimation()}}delEvent(F,"touchstart",function(G){A._touchstart(G)});delEvent(F,"touchmove",function(G){A._touchmove(G)})},gotoPage:function(A){if(A!=-1){this.currentNum=A;this.setAnimation();this.switchTab();this.callback(this.items[A],A,this.direction)}},kill:function(){var A=this,C=A.wrap,D=A.tabs;this._stop();var F=this.len;while(F--){var E=this.items[F];E.style["-webkit-transition-duration"]="0s";E.style["display"]="block";E.style["-webkit-transform"]="translate3d(0, 0, 0)"}delEvent(C,"touchstart",function(G){A._touchstart(G)});delEvent(C,"touchmove",function(G){A._touchmove(G)});delEvent(C,"touchend",function(G){A._touchend(G)});delEvent(window,"resize",function(){A.init()});if(D&&D.length>0){for(var B=0;BA.parentW){A.addEvent()}else{this.currentPos=0}A.setAnimation()},touchX:function(A){if(A.touches){return A.touches[0].pageX}else{return A.pageX}},touchY:function(A){if(A.touches){return A.touches[0].pageY}else{return A.pageY}},setAnimation:function(){var A=this,B=A.wrap;B.style["-webkit-transition"]="-webkit-transform 0.3s ease-in-out";B.style["-webkit-transform"]="translate3d("+A.currentPos+"px, 0, 0)"},slide:function(C){var A=this,B=A.wrap;B.style["-webkit-transition-duration"]="0s";B.style["-webkit-transform"]="translate3d("+(A.currentPos+C)+"px, 0, 0)"},addEvent:function(){var B=this.wrap,A=this;bindEvent(B,"touchstart",function(C){A._touchstart(C)});bindEvent(B,"touchmove",function(C){A._touchmove(C)});bindEvent(B,"touchend",function(C){A._touchend(C)})},_touchstart:function(A){this.X=this.touchX(A);this.Y=this.touchY(A);this.isScrolling=undefined},_touchmove:function(B){var A=this,D,C;A.curX=A.touchX(B);A.curY=A.touchY(B);D=A.curX-A.X;C=A.curY-A.Y;if(typeof A.isScrolling=="undefined"){A.isScrolling=!!(A.isScrolling||Math.abs(D)Math.abs(C)){if(A.currentPos+D>0){A.currentPos=0}else{A.currentPos=Math.max(A.currentPos+D,A.parentW-A.actualW)}A.setAnimation()}delEvent(E,"touchstart",function(F){A._touchstart(F)});delEvent(E,"touchmove",function(F){A._touchmove(F)})}};function rollInit(){var C=document.querySelectorAll(".j_roll");for(var A=0;A0&&B.length===C.length){for(var A=0;A=87&&getWinScrollHeight()>A){return B}}return -1}function tabNav(){var D=document.querySelectorAll(".j_navTab"),B=document.querySelectorAll(".j_newsModule"),E=document.querySelector(".news_tab_fixed"),C=document.querySelectorAll(".news_module");function A(){var H=getCurIndex();if(H!==-1){addClass(E,"fixed_show");E.innerHTML=D[H].innerHTML;var I=D[H].getAttribute("data-sudaclick");if(I){E.setAttribute("data-sudaclick",I)}else{E.removeAttribute("data-sudaclick")}var G=E.children;for(var F=0;F

新浪新闻

安装新浪新闻,随时知晓天下事

打开
';document.body.appendChild(N.childNodes[0]);setTimeout(function(){var Y=document.querySelector("#promotionCover");D(Y,"click",function(b){var Z=b.target,c=Z.path,a=5;if(c){for(var d=0,f=c.length;dJ){A=P;M();B()}return true;break;default:return false}}var A=0;var J=10000;var H=null;setTimeout(function(){F()},100)})(); 22 | }catch(e){throw new Error(e+" http://mjs.sinaimg.cn/wap/homev6/201507301647/js/home.min.js");} 23 | //@require('d.js'); 24 | //@require('b.js'); 25 | //@require('svn:https://svn1.intra.sina.com.cn/wapcms/js/wap_dev/public/collect/trunk/collect.min.js'); 26 | //@require('svn:https://svn1.intra.sina.com.cn/wapcms/js/wap_dev/public/collect/trunk/collect.js'); 27 | abc(); 28 | //@require('http://mjs.sinaimg.cn/wap/homev6/201507301647/js/home.js'); 29 | //123 30 | /** 31 | * @require('c.js') 32 | */ 33 | alert('a'); 34 | -------------------------------------------------------------------------------- /test/js/b.js: -------------------------------------------------------------------------------- 1 | //1234 2 | alert('b'); 3 | @require('c.js'); 4 | dash(); 5 | alert('bbbbbb'); 6 | -------------------------------------------------------------------------------- /test/js/c.js: -------------------------------------------------------------------------------- 1 | //c.js 2 | alert('c'); 3 | /**dasdsa*/ 4 | alert('cc'); 5 | alert(2132131); 6 | -------------------------------------------------------------------------------- /test/js/d.js: -------------------------------------------------------------------------------- 1 | var a = "我是帅"; 2 | -------------------------------------------------------------------------------- /test/js/es6/es6.js: -------------------------------------------------------------------------------- 1 | @require("http://mjs.sinaimg.cn/wap/public/suda/201508061430/suda_log.min.js") 2 | 3 | var test = { 4 | 5 | }; 6 | 7 | ale(); 8 | 9 | (function(){ 10 | 11 | class SkinnedMesh extends THREE.Mesh { 12 | constructor(geometry, materials) { 13 | super(geometry, materials); 14 | 15 | this.idMatrix = SkinnedMesh.defaultMatrix(); 16 | this.bones = []; 17 | this.boneMatrices = []; 18 | //... 19 | } 20 | update(camera) { 21 | //... 22 | super.update(); 23 | } 24 | get boneCount() { 25 | return this.bones.length; 26 | } 27 | set matrixType(matrixType) { 28 | this.idMatrix = SkinnedMesh[matrixType](); 29 | } 30 | static defaultMatrix() { 31 | return new THREE.Matrix4(); 32 | } 33 | } 34 | 35 | // Expression bodies 36 | var odds = evens.map(v => v + 1); 37 | var nums = evens.map((v, i) => v + i); 38 | var pairs = evens.map(v => ({even: v, odd: v + 1})); 39 | 40 | // Statement bodies 41 | nums.forEach(v => { 42 | if (v % 5 === 0) 43 | fives.push(v); 44 | }); 45 | 46 | // Lexical this 47 | var bob = { 48 | _name: "Bob", 49 | _friends: [], 50 | printFriends() { 51 | this._friends.forEach(f => 52 | console.log(this._name + " knows " + f)); 53 | } 54 | } 55 | 56 | })(); 57 | 58 | (function(){ 59 | class SkinnedMesh extends THREE.Mesh { 60 | constructor(geometry, materials) { 61 | super(geometry, materials); 62 | 63 | this.idMatrix = SkinnedMesh.defaultMatrix(); 64 | this.bones = []; 65 | this.boneMatrices = []; 66 | //... 67 | } 68 | update(camera) { 69 | //... 70 | super.update(); 71 | } 72 | get boneCount() { 73 | return this.bones.length; 74 | } 75 | set matrixType(matrixType) { 76 | this.idMatrix = SkinnedMesh[matrixType](); 77 | } 78 | static defaultMatrix() { 79 | return new THREE.Matrix4(); 80 | } 81 | } 82 | // Basic literal string creation 83 | `In JavaScript '\n' is a line-feed.` 84 | 85 | // Multiline strings 86 | `In JavaScript this is 87 | not legal.` 88 | 89 | // String interpolation 90 | var name = "Bob", time = "today"; 91 | `Hello ${name}, how are you ${time}?` 92 | 93 | // Construct an HTTP request prefix is used to interpret the replacements and construction 94 | GET`http://foo.org/bar?a=${a}&b=${b} 95 | Content-Type: application/json 96 | X-Credentials: ${credentials} 97 | { "foo": ${foo}, 98 | "bar": ${bar}}`(myOnReadyStateChangeHandler); 99 | 100 | // list matching 101 | var [a, , b] = [1,2,3]; 102 | 103 | // object matching 104 | var { op: a, lhs: { op: b }, rhs: c } 105 | = getASTNode() 106 | 107 | // object matching shorthand 108 | // binds `op`, `lhs` and `rhs` in scope 109 | var {op, lhs, rhs} = getASTNode() 110 | 111 | // Can be used in parameter position 112 | function g({name: x}) { 113 | console.log(x); 114 | } 115 | g({name: 5}) 116 | 117 | // Fail-soft destructuring 118 | var [a] = []; 119 | a === undefined; 120 | 121 | // Fail-soft destructuring with defaults 122 | var [a = 1] = []; 123 | a === 1; 124 | })(); 125 | -------------------------------------------------------------------------------- /test/js/es6/es6.min.js: -------------------------------------------------------------------------------- 1 | function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _taggedTemplateLiteral(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var _createClass=function(){function e(e,t){for(var n=0;n'),document.getElementById("ie-domReady").onreadystatechange=function(){"complete"===this.readyState&&(f=(new Date).getTime(),this.onreadystatechange=null,this.parentNode.removeChild(this))})}function n(e){function t(e,t){var n=C.getElementsByName(e),r=t>0?t:0;return n.length>r?n[r].content:""}function n(e,t,n,r){if(""==e)return"";r=""==r?"=":r,t+=r;var a=e.indexOf(t);if(0>a)return"";a+=t.length;var i=e.indexOf(n,a);return a>i&&(i=e.length),e.substring(a,i)}function r(e){return void 0==e||""==e?"":n(C.cookie,e,";","")}function a(e,t,n,r){if(null!=t)if((void 0==r||null==r)&&(r="sina.cn"),void 0==n||null==n||""==n)C.cookie=e+"="+t+";domain="+r+";path=/";else{var a=new Date,i=a.getTime();i+=864e5*n,a.setTime(i),i=a.getTime(),C.cookie=e+"="+t+";domain="+r+";expires="+a.toUTCString()+";path=/"}}function i(e,t,n){var r=e;return null==r?!1:(t=t||"click","function"==(typeof n).toLowerCase()?(r.attachEvent?r.attachEvent("on"+t,n):r.addEventListener?r.addEventListener(t,n,!1):r["on"+t]=n,!0):void 0)}function o(){if(null!=window.event)return window.event;if(window.event)return window.event;for(var e,t=arguments.callee.caller,n=0;null!=t&&40>n;){if(e=t.arguments[0],e&&(e.constructor==Event||e.constructor==MouseEvent||e.constructor==KeyboardEvent))return e;n++,t=t.caller}return e}function u(e){return e=e||o(),e.target||(e.target=e.srcElement,e.pageX=e.x,e.pageY=e.y),"undefined"==typeof e.layerX&&(e.layerX=e.offsetX),"undefined"==typeof e.layerY&&(e.layerY=e.offsetY),e}function s(e){if("string"!=typeof e)throw"trim need a string as parameter";for(var t=e.length,n=0,r=/(\u3000|\s|\t|\u00A0)/;t>n&&r.test(e.charAt(n));)n+=1;for(;t>n&&r.test(e.charAt(t-1));)t-=1;return e.slice(n,t)}function c(e){return"[object Array]"===Object.prototype.toString.call(e)}function d(e,t){for(var n=s(e).split("&"),r={},a=function(e){return t?decodeURIComponent(e):e},i=0,o=n.length;o>i;i++)if(n[i]){var u=n[i].split("="),f=u[0],l=u[1];u.length<2&&(l=f,f="$nullName"),r[f]?(1!=c(r[f])&&(r[f]=[r[f]]),r[f].push(a(l))):r[f]=a(l)}return r}function p(e){g(e)}function g(e){var t=new Image;SUDA.img=t,t.src=e}function m(e,t,n){SUDA.sudaCount++;var r=A+[$.V(),$.CI(),$.PI(n),$.UI(),$.MT(),$.EX(e,t),$.R()].join("&");g(r)}function v(e,t,n){0==SUDA.sudaCount&&m(e,t,n)}function h(e,t,n){n=n?escape(n):"";var a="UATrack||"+r(V)+"||"+r(H)+"||"+q.userNick()+"||"+e+"||"+t+"||"+W.referrer()+"||"+n+"||",i=j+a+"&gUid_"+(new Date).getTime();p(i)}function y(e,t,n){n=n?escape(n):"";var a="UATrack||"+r(Y)+"||"+r(H)+"||"+q.userNick()+"||"+e+"||"+t+"||"+W.referrer()+"||"+n+"||",i=j+a+"&gUid_"+(new Date).getTime();p(i)}function b(e){var t,n=u(e),r=n.target,a="",i="";if(null!=r&&r.getAttribute&&!r.getAttribute("suda-uatrack")&&!r.getAttribute("suda-data"))for(;null!=r&&r.getAttribute&&0==(!!r.getAttribute("suda-uatrack")||!!r.getAttribute("suda-data"));){if(r==C.body)return;r=r.parentNode}null!=r&&null!=r.getAttribute&&(a=r.getAttribute("suda-uatrack")||r.getAttribute("suda-data")||"",a&&(t=d(a),"a"==r.tagName.toLowerCase()&&(i=r.href),t.key&&SUDA.uaTrack&&SUDA.uaTrack(t.key,t.value||t.key,i)))}var w=window,C=document,T=navigator,_=(T.userAgent,w.screen),k=w.location.href,O="https:"==w.location.protocol?"https://":"http://",I="beacon.sina.com.cn",A=O+I+"/a.gif?",j=O+I+"/e.gif?",E="",S="";startTime="",readyTime="",currTime=parseInt((new Date).getTime());var D="",x=k.split("?")[1];if(x&&k.indexOf("wm=")>0)for(var M=x.split("&"),L=M.length,U=0;L>U;U++){var N=M[U].split("=");if("wm"==N[0]&&"#column"!=N[1]){D=N[1];break}}if(D){var P=r("wm");D!=P&&a("wm",D,"","sina.cn")}D=r("wm"),"undefined"!=typeof sudaLogConfig&&(E=void 0!==sudaLogConfig.uId?sudaLogConfig.uId:"",S=void 0!==sudaLogConfig.url?sudaLogConfig.url:"","undefined"!=typeof globalConfig&&(startTime=void 0!==globalConfig.startTime?globalConfig.startTime:l)),E=E||e||"",onloadTime=currTime-startTime,readyTime=f-startTime;var z="MT=";if(z+="wm:"+D,"undefined"!=typeof sudaLogConfig&&"undefined"!=typeof sudaLogConfig.prevPageClickTime&&""!==sudaLogConfig.prevPageClickTime){var B=void 0!==sudaLogConfig.prevPageClickTime?sudaLogConfig.prevPageClickTime:0,R=startTime-B;z+="|mperform:1|starttime:"+B+"|endtime:"+startTime+"|clicktime:"+R}var X=C.referrer.toLowerCase(),V="SINAGLOBAL",H="Apache",Z="ULV",G="SUP",Y="ustat",J="",F="",K="",Q={screenSize:function(){return _.width+"x"+_.height},colorDepth:function(){return _.colorDepth||""},appCode:function(){return T.appCodeName||""},appName:function(){return T.appName.indexOf("Microsoft Internet Explorer")>-1?"MSIE":T.appName},cpu:function(){return T.cpuClass||T.oscpu||""},platform:function(){return T.platform||""},jsVer:function(){var e,t,n,r=1,a=T.appName.indexOf("Microsoft Internet Explorer")>-1?"MSIE":T.appName,i=T.appVersion;return"MSIE"==a?(t="MSIE",e=i.indexOf(t),e>=0&&(n=window.parseInt(i.substring(e+5)),n>=3&&(r=1.1,n>=4&&(r=1.3)))):("Netscape"==a||"Opera"==a||"Mozilla"==a)&&(r=1.3,t="Netscape6",e=i.indexOf(t),e>=0&&(r=1.5)),r},network:function(){var e="";e=T.connection&&T.connection.type?T.connection.type:e;try{C.body.addBehavior("#default#clientCaps"),e=C.body.connectionType}catch(t){e="unkown"}return e},language:function(){return T.systemLanguage||T.language||""},timezone:function(){return(new Date).getTimezoneOffset()/60||""},flashVer:function(){return""},javaEnabled:function(){var e,t,n=T.plugins,r=T.javaEnabled();if(1==r)return 1;if(n&&n.length){for(var a in n)if(e=n[a],null!=e.description){if(null!=r)break;t=e.description.toLowerCase(),-1==t.indexOf("java plug-in")||(r=parseInt(e.version))}}else window.ActiveXObject&&(r=null!=new ActiveXObject("JavaWebStart.IsInstalled"));return r?1:0}},W={pageId:function(){return""},sessionCount:function(){return""},excuteCount:function(){return SUDA.sudaCount},referrer:function(){var e=/^[^\?&#]*.swf([\?#])?/;if(""==X||X.match(e)){var t=n(k,"ref","&","");if(""!=t)return escape(t)}return escape(X)},isHomepage:function(){var e="";try{C.body.addBehavior("#default#homePage"),e=C.body.isHomePage(k)?"Y":"N"}catch(t){e="unkown"}return e},PGLS:function(){return t("stencil")||""},ZT:function(){var e=t("subjectid");return e.replace(",","."),e.replace(";",","),escape(e)},mediaType:function(){return t("mediaid")||""},domCount:function(){return C.getElementsByTagName("*").length||""},iframeCount:function(){return C.getElementsByTagName("iframe").length},onloadTime:onloadTime,readyTime:readyTime,webUrl:S,ch:function(){return window.__docConfig?__docConfig.__domain:""}},q={visitorId:function(){if(""!=V){var e=r(V);if(""==e){e=r(H);var t=3650;a(V,e,t)}return e}return""},sessionId:function(){var e=r(H);if(""==e){var t=new Date;e=1e13*Math.random()+"."+t.getTime(),a(H,e)}return e},flashCookie:function(e){return""},lastVisit:function(){var e,t=r(H),n=r(Z),i=n.split(":"),o="";if(i.length>=6)if(t!=i[4]){e=new Date;var u=new Date(window.parseInt(i[0]));i[1]=window.parseInt(i[1])+1,e.getMonth()!=u.getMonth()?i[2]=1:i[2]=window.parseInt(i[2])+1,(e.getTime()-u.getTime())/864e5>=7?i[3]=1:e.getDay()a;a++)r+="encode"==t?n[parseInt(e[a])]:n.indexOf(e[a]);return r}function o(e){e.data=e.data||{},e.timeout=e.timeout||0,e.callback=e.callback||"jsoncallback";var t="jsonp_"+Math.random();t=t.replace(".",""),window[t]=function(n){clearTimeout(u),e.success&&e.success(n),e.complete&&e.complete(),o.removeChild(i),window[t]=null},e.data[e.callback]=t;var n=[];for(var r in e.data)n.push(r+"="+encodeURIComponent(e.data[r]));var a="&"+n.join("&"),i=document.createElement("script");i.src=e.url+a;var o=document.getElementsByTagName("head")[0];if(o.appendChild(i),e.timeout)var u=setTimeout(function(){e.error&&e.error(),e.complete&&e.complete(),o.removeChild(i),window[t]=null},e.timeout)}function u(e){document.cookie=e+"=;expires=Fri, 31 Dec 1999 23:59:59 GMT;path=/;domain=.sina.cn"}function s(e,t,n,r,a,i){var o=[];if(o.push(e+"="+escape(t)),n){var u=new Date,s=u.getTime()+36e5*n;u.setTime(s),o.push("expires="+u.toGMTString())}r&&o.push("path="+r),a&&o.push("domain="+a),i&&o.push(i),document.cookie=o.join(";")}function c(e,t,n,r){if(""==e)return"";r=""==r?"=":r,t+=r;var a=e.indexOf(t);if(0>a)return"";a+=t.length;var i=e.indexOf(n,a);return a>i&&(i=e.length),e.substring(a,i)}var f="",l=(new Date).getTime();t(),e(function(){a(function(e){e.uid?n(e.uid):n()})}),window.getCookie=function(e){return void 0==e||""==e?!1:c(document.cookie,e,";","")};var d={__parse:function(e){var t,n,r,a,i=0,o={},u="",s="";if(!e)return o;do{for(n=e[i],t=++i,a=i;n+t>a;a++,i++)u+=String.fromCharCode(e[a]);if(r=e[i],t=++i,"status"==u||"flag"==u)for(a=i;r+t>a;a++,i++)s+=e[a];else{s=e.slice(a,r+t);try{s=arr2utf8(s)}catch(c){s=""}i+=r}o[u]=s,u="",s=""}while(i>2,a=(3&t)<<4|n>>4,i=(15&n)<<2|u>>6,s=63&u,isNaN(n)?i=s=64:isNaN(u)&&(s=64),o=o+this._keys.charAt(r)+this._keys.charAt(a)+this._keys.charAt(i)+this._keys.charAt(s),t=n=u="",r=a=i=s="";while(c=g;g++)p[g]=g+128;if("binnary"!=t&&d.test(e.join("")))return"array"==n?[]:"";g=0;do o=r(p,e[g++]),u=r(p,e[g++]),s=r(p,e[g++]),l=r(p,e[g++]),a=o<<2|u>>4,i=(15&u)<<4|s>>2,f=(3&s)<<6|l,c.push(a),64!=s&&-1!=s&&c.push(i),64!=l&&-1!=l&&c.push(f),a=i=f="",o=u=s=l="";while(g 2 | -------------------------------------------------------------------------------- /test/js/home.js: -------------------------------------------------------------------------------- 1 | var sudaLogConfig = { uId : "", url : "",prevPageClickTime : "", ext1:'v2', ext2:'' }; 2 | 3 | @require("http://mjs.sinaimg.cn/wap/public/suda/201508061430/suda_log.min.js") 4 | @require("http://mjs.sinaimg.cn/wap/public/suda/201508061430/suda_map.min.js") 5 | 6 | //SUDA地图统计``` 7 | var sudaMapConfig = { 8 | uId : "", 9 | pageId : "2803", 10 | addRequestTime : false }; 11 | suda_init(sudaMapConfig.pageId, 100); 12 | 13 | @require("http://mjs.sinaimg.cn/wap/homev6/201509081810/js/home.min.js") 14 | @require("http://mjs.sinaimg.cn/wap/homev6/201509081810/js/async.min.js") 15 | @require("http://mjs.sinaimg.cn/wap/module/sina_tjv6/201509081910/js/sina_tj.min.js") 16 | @require("http://i.sso.sina.com.cn/js/check_login.js") 17 | @require("http://mjs.sinaimg.cn/wap/online/public/collect/v2/collect.min.js") 18 | -------------------------------------------------------------------------------- /test/js/home.min.js: -------------------------------------------------------------------------------- 1 | function trim(e){var t=e.replace(/^\s*$/g,"");return t}function bindEvent(e,t,n){document.addEventListener?e.addEventListener(t,n,!1):e.attachEvent(t,n)}function delEvent(e,t,n){document.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent(t,n)}function addClass(e,t){var n=new RegExp("\\b"+t+"\\b");if(e.length>1)for(var i=0;i1)for(var i=0;i=200&&i.status<300||304==i.status?t(JSON.parse(i.responseText)):n()},i.open("get",e,!1),i.send(null)}function getWinWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0}function getWinHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0}function getWinScrollHeight(){return document.documentElement.scrollTop||document.body.scrollTop}function newsMore(){for(var e=document.querySelectorAll(".j_newsBtn"),t=0;t0)for(var a=0;a0)for(var a=0;a0)for(var a=0;aa&&getWinScrollHeight()0&&e.length===t.length)for(var n=0;n=87&&getWinScrollHeight()>t)return n;return-1}function tabNav(){function e(){var e=getCurIndex();if(-1!==e){addClass(i,"fixed_show"),i.innerHTML=t[e].innerHTML;var r=t[e].getAttribute("data-sudaclick");r?i.setAttribute("data-sudaclick",r):i.removeAttribute("data-sudaclick");for(var o=i.children,s=0;s1?t-1:o-1]:r[o-1>t?t+1:0],u=c.querySelector("img");l.innerHTML=t+1,u.getAttribute("data-src")&&(i=new Image,i.src=u.getAttribute("data-src"),i.onload=function(){u.src=u.getAttribute("data-src"),u.removeAttribute("data-src"),removeClass(c,"toload")})}},e=new Swiper(e,null,t)}function generalize(e,t){function n(e){if(e){var t=new Image;t.src=e,t.alt="pv_monitor",t.style.display="none",c.append(t)}}function i(){if(d.monitorUrl)if("string"==typeof d.monitorUrl)n(d.monitorUrl);else{var e,t=d.monitorUrl.length;for(e=0;t>e;e++)n(d.monitorUrl[e])}if(d.cookieMapping)if("string"==typeof d.cookieMapping)n(d.cookieMapping);else{var i,a=d.cookieMapping.length;for(i=0;a>i;i++)n(d.cookieMapping[i])}}function a(e,t){var n=new Image;n.src=e,n.onload=function(){var e=n.width,i=n.height;t(e,i)}}function r(e,t){return u&&(clearTimeout(u),u=null),"hide"==t?(e.css("opacity","0"),setTimeout(function(){try{e.remove()}catch(t){}},1e3)):"toggle"==t&&("0px"==e.css("height")?(e.css("height",g+"px"),e.parent().find(".j_adCloseBtn").css({"-webkit-transform":"rotate(-45deg)",top:"15px"})):(e.css("height","0px"),e.parent().find(".j_adCloseBtn").css({"-webkit-transform":"rotate(135deg)",top:"10px"}))),!1}function o(){a(f,function(e,t){var n='

'+d.title+"

";if(c.append(n),b){var i='
关闭
';c.append(i);var a=$("#j_adImgDown");adClose=a.find(".j_adClose"),adClose[0].addEventListener("click",function(e){a.addClass("hide"),e.preventDefault()},!1),u=setTimeout(function(){r(a,"hide")},p)}})}function s(){a(f,function(e,t){var n='
'+d.title+'
';c.append(n);var i=$("#j_adImgUp"),a=i.parent().find(".j_adClose");b&&(setTimeout(function(){i.css("height",g+"px")},10),u=setTimeout(function(){return r(i,"toggle"),!1},p)),a[0].addEventListener("click",function(e){r(i,"toggle"),e.preventDefault()},!1)})}function l(){c&&d&&(d.display=d.display||"",setTimeout(function(){"down"==d.display?o():"up"==d.display&&s()},100),setTimeout(i,1e3))}var c=t;if(c&&e){var u,d=e,h=d.delay?d.delay:5,p=1e3*h,f=window.devicePixelRatio>=2?d.imgh||d.imgl:d.imgl,m=document.documentElement.clientWidth,g=.5625*document.documentElement.clientWidth,v=new Date,w="ad_"+d.id,_=864e5,b=!0,y=""+v.getFullYear()+(v.getMonth()+1)+v.getDate(),x=new RegExp("(^| )"+w+"=([^;]*)(;|$)").exec(document.cookie);x&&x[2]===y&&(b=!1),v.setTime((Math.floor(v.getTime()/_)+1)*_),document.cookie=w+"="+y+"; expires="+v.toGMTString()}setTimeout(l,100)}function push_home_txt(e,t){t.push('")}function push_wzl(e,t){t.push(''+e.content[0].src[0]+"")}function push_wzl_tips(e,t){t.push('
'),t.push(''+e.content[0].src[0]+""),t.push("推广"),t.push("
")}function push_article_rec(e,t){t.push(''+e.content[0].src[0]+"")}function push_card_app(e,t){t.push("
"),t.push(''),t.push("
"),t.push("

"+e.content[0].src[0].split("#")[0]+"

"),t.push("

更多相关报道 上新浪新闻APP

"),t.push("
")}function push_hf(e,t){t.push(''),t.push('')}function push_jdt(e,t){t.push(''),t.push(''),e.content[0].src[1]&&t.push(''+e.content[0].src[1]+""),t.push("")}function push_atlas(e,t){t.push(''),t.push(''),e.content[0].src[1]&&t.push('

'+e.content[0].src[1]+"

"),t.push("
")}function atlasHeight(){for(var e=Math.ceil((getWidth()-24-4)/2),t=Math.floor(3*e/4)-5,n=document.querySelectorAll(".sina_tj_atlas a"),i=0;i'),document.getElementById("ie-domReady").onreadystatechange=function(){"complete"===this.readyState&&(u=(new Date).getTime(),this.onreadystatechange=null,this.parentNode.removeChild(this))})}function n(e){function t(e,t){var n=y.getElementsByName(e),i=t>0?t:0;return n.length>i?n[i].content:""}function n(e,t,n,i){if(""==e)return"";i=""==i?"=":i,t+=i;var a=e.indexOf(t);if(0>a)return"";a+=t.length;var r=e.indexOf(n,a);return a>r&&(r=e.length),e.substring(a,r)}function i(e){return void 0==e||""==e?"":n(y.cookie,e,";","")}function a(e,t,n,i){if(null!=t)if((void 0==i||null==i)&&(i="sina.cn"),void 0==n||null==n||""==n)y.cookie=e+"="+t+";domain="+i+";path=/";else{var a=new Date,r=a.getTime();r+=864e5*n,a.setTime(r),r=a.getTime(),y.cookie=e+"="+t+";domain="+i+";expires="+a.toUTCString()+";path=/"}}function r(e,t,n){var i=e;return null==i?!1:(t=t||"click","function"==(typeof n).toLowerCase()?(i.attachEvent?i.attachEvent("on"+t,n):i.addEventListener?i.addEventListener(t,n,!1):i["on"+t]=n,!0):void 0)}function o(){if(null!=window.event)return window.event;if(window.event)return window.event;for(var e,t=arguments.callee.caller,n=0;null!=t&&40>n;){if(e=t.arguments[0],e&&(e.constructor==Event||e.constructor==MouseEvent||e.constructor==KeyboardEvent))return e;n++,t=t.caller}return e}function s(e){return e=e||o(),e.target||(e.target=e.srcElement,e.pageX=e.x,e.pageY=e.y),"undefined"==typeof e.layerX&&(e.layerX=e.offsetX),"undefined"==typeof e.layerY&&(e.layerY=e.offsetY),e}function l(e){if("string"!=typeof e)throw"trim need a string as parameter";for(var t=e.length,n=0,i=/(\u3000|\s|\t|\u00A0)/;t>n&&i.test(e.charAt(n));)n+=1;for(;t>n&&i.test(e.charAt(t-1));)t-=1;return e.slice(n,t)}function c(e){return"[object Array]"===Object.prototype.toString.call(e)}function h(e,t){for(var n=l(e).split("&"),i={},a=function(e){return t?decodeURIComponent(e):e},r=0,o=n.length;o>r;r++)if(n[r]){var s=n[r].split("="),u=s[0],d=s[1];s.length<2&&(d=u,u="$nullName"),i[u]?(1!=c(i[u])&&(i[u]=[i[u]]),i[u].push(a(d))):i[u]=a(d)}return i}function p(e){f(e)}function f(e){var t=new Image;SUDA.img=t,t.src=e}function m(e,t,n){SUDA.sudaCount++;var i=I+[K.V(),K.CI(),K.PI(n),K.UI(),K.MT(),K.EX(e,t),K.R()].join("&");f(i)}function g(e,t,n){0==SUDA.sudaCount&&m(e,t,n)}function v(e,t,n){n=n?escape(n):"";var a="UATrack||"+i(X)+"||"+i(P)+"||"+Q.userNick()+"||"+e+"||"+t+"||"+Z.referrer()+"||"+n+"||",r=j+a+"&gUid_"+(new Date).getTime();p(r)}function w(e,t,n){n=n?escape(n):"";var a="UATrack||"+i(Y)+"||"+i(P)+"||"+Q.userNick()+"||"+e+"||"+t+"||"+Z.referrer()+"||"+n+"||",r=j+a+"&gUid_"+(new Date).getTime();p(r)}function _(e){var t,n=s(e),i=n.target,a="",r="";if(null!=i&&i.getAttribute&&!i.getAttribute("suda-uatrack")&&!i.getAttribute("suda-data"))for(;null!=i&&i.getAttribute&&0==(!!i.getAttribute("suda-uatrack")||!!i.getAttribute("suda-data"));){if(i==y.body)return;i=i.parentNode}null!=i&&null!=i.getAttribute&&(a=i.getAttribute("suda-uatrack")||i.getAttribute("suda-data")||"",a&&(t=h(a),"a"==i.tagName.toLowerCase()&&(r=i.href),t.key&&SUDA.uaTrack&&SUDA.uaTrack(t.key,t.value||t.key,r)))}var b=window,y=document,x=navigator,k=(x.userAgent,b.screen),S=b.location.href,T="https:"==b.location.protocol?"https://":"http://",C="beacon.sina.com.cn",I=T+C+"/a.gif?",j=T+C+"/e.gif?",A="",E="";startTime="",readyTime="",currTime=parseInt((new Date).getTime());var N="",M=S.split("?")[1];if(M&&S.indexOf("wm=")>0)for(var D=M.split("&"),L=D.length,O=0;L>O;O++){var W=D[O].split("=");if("wm"==W[0]&&"#column"!=W[1]){N=W[1];break}}if(N){var q=i("wm");N!=q&&a("wm",N,"","sina.cn")}N=i("wm"),"undefined"!=typeof sudaLogConfig&&(A=void 0!==sudaLogConfig.uId?sudaLogConfig.uId:"",E=void 0!==sudaLogConfig.url?sudaLogConfig.url:"","undefined"!=typeof globalConfig&&(startTime=void 0!==globalConfig.startTime?globalConfig.startTime:d)),A=A||e||"",onloadTime=currTime-startTime,readyTime=u-startTime;var H="MT=";if(H+="wm:"+N,"undefined"!=typeof sudaLogConfig&&"undefined"!=typeof sudaLogConfig.prevPageClickTime&&""!==sudaLogConfig.prevPageClickTime){var U=void 0!==sudaLogConfig.prevPageClickTime?sudaLogConfig.prevPageClickTime:0,B=startTime-U;H+="|mperform:1|starttime:"+U+"|endtime:"+startTime+"|clicktime:"+B}var R=y.referrer.toLowerCase(),X="SINAGLOBAL",P="Apache",$="ULV",z="SUP",Y="ustat",J="",V="",F="",G={screenSize:function(){return k.width+"x"+k.height},colorDepth:function(){return k.colorDepth||""},appCode:function(){return x.appCodeName||""},appName:function(){return x.appName.indexOf("Microsoft Internet Explorer")>-1?"MSIE":x.appName},cpu:function(){return x.cpuClass||x.oscpu||""},platform:function(){return x.platform||""},jsVer:function(){var e,t,n,i=1,a=x.appName.indexOf("Microsoft Internet Explorer")>-1?"MSIE":x.appName,r=x.appVersion;return"MSIE"==a?(t="MSIE",e=r.indexOf(t),e>=0&&(n=window.parseInt(r.substring(e+5)),n>=3&&(i=1.1,n>=4&&(i=1.3)))):("Netscape"==a||"Opera"==a||"Mozilla"==a)&&(i=1.3,t="Netscape6",e=r.indexOf(t),e>=0&&(i=1.5)),i},network:function(){var e="";e=x.connection&&x.connection.type?x.connection.type:e;try{y.body.addBehavior("#default#clientCaps"),e=y.body.connectionType}catch(t){e="unkown"}return e},language:function(){return x.systemLanguage||x.language||""},timezone:function(){return(new Date).getTimezoneOffset()/60||""},flashVer:function(){return""},javaEnabled:function(){var e,t,n=x.plugins,i=x.javaEnabled();if(1==i)return 1;if(n&&n.length){for(var a in n)if(e=n[a],null!=e.description){if(null!=i)break;t=e.description.toLowerCase(),-1==t.indexOf("java plug-in")||(i=parseInt(e.version))}}else window.ActiveXObject&&(i=null!=new ActiveXObject("JavaWebStart.IsInstalled"));return i?1:0}},Z={pageId:function(){return""},sessionCount:function(){return""},excuteCount:function(){return SUDA.sudaCount},referrer:function(){var e=/^[^\?&#]*.swf([\?#])?/;if(""==R||R.match(e)){var t=n(S,"ref","&","");if(""!=t)return escape(t)}return escape(R)},isHomepage:function(){var e="";try{y.body.addBehavior("#default#homePage"),e=y.body.isHomePage(S)?"Y":"N"}catch(t){e="unkown"}return e},PGLS:function(){return t("stencil")||""},ZT:function(){var e=t("subjectid");return e.replace(",","."),e.replace(";",","),escape(e)},mediaType:function(){return t("mediaid")||""},domCount:function(){return y.getElementsByTagName("*").length||""},iframeCount:function(){return y.getElementsByTagName("iframe").length},onloadTime:onloadTime,readyTime:readyTime,webUrl:E,ch:function(){return window.__docConfig?__docConfig.__domain:""}},Q={visitorId:function(){if(""!=X){var e=i(X);if(""==e){e=i(P);var t=3650;a(X,e,t)}return e}return""},sessionId:function(){var e=i(P);if(""==e){var t=new Date;e=1e13*Math.random()+"."+t.getTime(),a(P,e)}return e},flashCookie:function(e){return""},lastVisit:function(){var e,t=i(P),n=i($),r=n.split(":"),o="";if(r.length>=6)if(t!=r[4]){e=new Date;var s=new Date(window.parseInt(r[0]));r[1]=window.parseInt(r[1])+1,e.getMonth()!=s.getMonth()?r[2]=1:r[2]=window.parseInt(r[2])+1,(e.getTime()-s.getTime())/864e5>=7?r[3]=1:e.getDay()a;a++)i+="encode"==t?n[parseInt(e[a])]:n.indexOf(e[a]);return i}function o(e){e.data=e.data||{},e.timeout=e.timeout||0,e.callback=e.callback||"jsoncallback";var t="jsonp_"+Math.random();t=t.replace(".",""),window[t]=function(n){clearTimeout(s),e.success&&e.success(n),e.complete&&e.complete(),o.removeChild(r),window[t]=null},e.data[e.callback]=t;var n=[];for(var i in e.data)n.push(i+"="+encodeURIComponent(e.data[i]));var a="&"+n.join("&"),r=document.createElement("script");r.src=e.url+a;var o=document.getElementsByTagName("head")[0];if(o.appendChild(r),e.timeout)var s=setTimeout(function(){e.error&&e.error(),e.complete&&e.complete(),o.removeChild(r),window[t]=null},e.timeout)}function s(e){document.cookie=e+"=;expires=Fri, 31 Dec 1999 23:59:59 GMT;path=/;domain=.sina.cn"}function l(e,t,n,i,a,r){var o=[];if(o.push(e+"="+escape(t)),n){var s=new Date,l=s.getTime()+36e5*n;s.setTime(l),o.push("expires="+s.toGMTString())}i&&o.push("path="+i),a&&o.push("domain="+a),r&&o.push(r),document.cookie=o.join(";")}function c(e,t,n,i){if(""==e)return"";i=""==i?"=":i,t+=i;var a=e.indexOf(t);if(0>a)return"";a+=t.length;var r=e.indexOf(n,a);return a>r&&(r=e.length),e.substring(a,r)}var u="",d=(new Date).getTime();t(),e(function(){a(function(e){e.uid?n(e.uid):n()})}),window.getCookie=function(e){return void 0==e||""==e?!1:c(document.cookie,e,";","")};var h={__parse:function(e){var t,n,i,a,r=0,o={},s="",l="";if(!e)return o;do{for(n=e[r],t=++r,a=r;n+t>a;a++,r++)s+=String.fromCharCode(e[a]);if(i=e[r],t=++r,"status"==s||"flag"==s)for(a=r;i+t>a;a++,r++)l+=e[a];else{l=e.slice(a,i+t);try{l=arr2utf8(l)}catch(c){l=""}r+=i}o[s]=l,s="",l=""}while(r>2,a=(3&t)<<4|n>>4,r=(15&n)<<2|s>>6,l=63&s,isNaN(n)?r=l=64:isNaN(s)&&(l=64),o=o+this._keys.charAt(i)+this._keys.charAt(a)+this._keys.charAt(r)+this._keys.charAt(l),t=n=s="",i=a=r=l="";while(c=f;f++)p[f]=f+128;if("binnary"!=t&&h.test(e.join("")))return"array"==n?[]:"";f=0;do o=i(p,e[f++]),s=i(p,e[f++]),l=i(p,e[f++]),d=i(p,e[f++]),a=o<<2|s>>4,r=(15&s)<<4|l>>2,u=(3&l)<<6|d,c.push(a),64!=l&&-1!=l&&c.push(r),64!=d&&-1!=d&&c.push(u),a=r=u="",o=s=l=d="";while(f0?e.substring(0,t):e}function t(e){for(var t=0,n=0,i=e;;){if(t=i.indexOf("<"),n=i.indexOf(">",t),!(t>=0&&n>=0&&n>t))break;i=i.substring(0,t)+i.substring(n+1,i.length)}return i}function n(){if(""!=v)return v;var e="",t=S.toLowerCase(),n=t.indexOf("sina.");if(n>0)e="sina.cn";else{var i=t.indexOf(".");if(!(i>0))return"";i+=1,n=t.indexOf("/",i),0>n&&(n=t.length),e=t.substring(i,n)}return v=e,e}function a(e){var t=document.cookie.indexOf(e+"=");if(-1==t)return"";t=document.cookie.indexOf("=",t)+1;var n=document.cookie.indexOf(";",t);return 0>=n&&(n=document.cookie.length),ckValue=document.cookie.substring(t,n),ckValue}function r(e,t,i){if(null!=t)if(_suds_cmp_domainRoot=n(),"undefined"==i||null==i)document.cookie=e+"="+t+"; domain="+_suds_cmp_domainRoot+"; path=/";else{var a=new Date,r=a.getTime();r+=864e5*i,a.setTime(r),r=a.getTime(),document.cookie=e+"="+t+"; domain="+_suds_cmp_domainRoot+"; expires="+a.toUTCString()+"; path=/"}}function o(){if(ckTmp=a(g),""==ckTmp){var e=new Date;ckTmp=1e13*Math.random()+"."+e.getTime(),r(g,ckTmp)}return ckTmp}function s(){var t=Math.floor(100*Math.random());if(!(f>t))return 0;window.suda=!0,""==w&&(w=o(g)),""==y&&(y=a(_)),""==x&&(x=a(b));try{document.addEventListener?(document.addEventListener("click",u,!1),window.addEventListener("load",d,!1)):(document.attachEvent("onclick",u),window.attachEvent("onload",d))}catch(n){}k=escape(e(window.document.referrer)),S=escape(e(window.document.URL))}function l(e,t,n){var i="";"undefined"!=typeof sudaMapConfig.uId&&(i=sudaMapConfig.uId),"undefined"!=typeof sudaMapConfig.addRequestTime&&(m=sudaMapConfig.addRequestTime),strSudsClickMapQuest=S+"|*|"+e+"|*|"+w+"|*|"+y+"|*|"+k+"|*|"+p+"|*|"+i+"|*|"+x;var a=T+"?"+strSudsClickMapQuest,r=new Image;window.SUDAPIC=r,r.src=a;var o=t.toLocaleLowerCase();t&&-1==o.indexOf("javascript:")&&setTimeout(function(){if(m){var e=(new Date).getTime(),i="user"+e+Math.random().toString().slice(2),a=t.indexOf("?")>-1?"&":"?";t=t+a+"clicktime="+e+"&userid="+i}"_blank"==n?window.open(t):location.href=t},800)}function c(e,t,n){for(var i=0;n>i;i++){if(!e.parentNode||e==document)return null;if(e=e.parentNode,t==e.tagName)break}return i>=n?null:e}function u(n){var n=n||event,a=n.srcElement||n.target;if(null==a&&a==document)return!1;var r="",o="",s="",u="",d="";if("A"==a.tagName)r="txt",o=t(a.innerHTML),s=e(a.href),d=a.getAttribute("target"),u=a;else if("IMG"==a.tagName){r="img",o=a.alt;var h=c(a,"A",8);h&&(s=e(h.href),d=a.getAttribute("target"),u=h)}else{r="txt",o=t(a.innerHTML);var h=c(a,"A",8);h&&(s=e(h.href),d=h.getAttribute("target"),u=h)}var p="",f=(a.tagName,"");try{for(i=0;i<10&&a!=document;i++){var m=a.getAttribute("data-sudaclick");if(m){p=m;for(var g=a.getElementsByTagName("A"),v=0;v30&&(o=o.substr(0,30));var _=new Date,b=_.getTime(),y="t="+r+",s="+o+",h="+escape(s)+",ct="+b+",aid="+p+"-"+f+"|";l(y,s,d)}}function d(){h(window)}function h(e){for(var t=e.frames,n=0;n0&&(p=e,f=t,"function"==typeof window.getUserInfo?window.getUserInfo(function(e){e&&e.uid&&(window.sudaMapConfig.uId=e.uid),s()},!0):s())},window.suda_count=window.suds_count=function(e){if(!e.name)return!1;e.type||(e.type="btn"),e.title||(e.title=""),e.index||(e.index=0),e.href||(e.href="");var t="",n="",i=(new Date).getTime(),a="t="+e.type+",s="+e.title+",h="+escape(e.href)+",ct="+i+",aid="+e.name+"-"+e.index+"|";n=void 0==e.target?"":e.target,l(a,t,n)}}()}catch(e){throw new Error(e+" http://mjs.sinaimg.cn/wap/public/suda/201508061430/suda_map.min.js")}var sudaMapConfig={uId:"",pageId:"2803",addRequestTime:!1};suda_init(sudaMapConfig.pageId,100);try{var IRoller=function(e){this.wrap=document.getElementById(e),this.rollItem=this.wrap.children,this.len=this.rollItem.length,this.currentNum=0,this._height=this.wrap.offsetHeight,this.interval=3e3,this.timer=null,this.firstInit=!0,this.wrap.children.length<2||(2==this.wrap.children.length&&(this.wrap.appendChild(this.rollItem[0].cloneNode(!0)),this.wrap.appendChild(this.rollItem[1].cloneNode(!0)),this.rollItem=this.wrap.children,this.len=this.rollItem.length),this.round=function(e){return this.currentNum+e<0?this.currentNum+e+this.len:this.currentNum+e>this.len-1?this.currentNum+e-this.len:this.currentNum+e; 2 | },this.translate=function(e,t,n){var i=navigator.userAgent.toLowerCase(),a=e&&e.style;a.webkitTransitionDuration=a.MozTransitionDuration=a.msTransitionDuration=a.OTransitionDuration=a.transitionDuration=n+"ms",a.webkitTransitionTimingFunction=a.MozTransitionTimingFunction=a.msTransitionTimingFunction=a.OTransitionTimingFunction=a.transitionTimingFunction="ease-in-out",-1!=i.indexOf("gt-")?a.webkitTransform="translateY("+t+"px)":a.webkitTransform="translate3d(0, "+t+"px, 0)",a.msTransform=a.MozTransform=a.OTransform="translateY("+t+"px)"},this.setAnimation=function(){for(var e=this,t=0;ts;s++)this.circular?s==a?(this.firstInit||this.timerCleared?this.translate(e[s],i,0):this.translate(e[s],i,n),e[s].style.display="block"):s==r?(this.firstInit||this.timerCleared?this.translate(e[s],-i,0):this.translate(e[s],-i,n),e[s].style.display="block"):s==o?(this.firstInit||this.timerCleared?this.translate(e[s],0,0):this.translate(e[s],0,n),e[s].style.display="block"):(e[s].style.display="none",this.translate(e[s],-i,n)):(this.firstInit?this.translate(e[s],(s-o)*i,0):this.translate(e[s],(s-o)*i,n),e[s].style.display="block");this.firstInit=!1,this.maxHeight===1/0&&(this.innerWrap.style.height=this.items[o].offsetHeight+"px")},translate:function(e,t,n){var i=navigator.userAgent.toLowerCase(),a=e&&e.style;a.webkitTransitionDuration=a.MozTransitionDuration=a.msTransitionDuration=a.OTransitionDuration=a.transitionDuration=n+"ms",a.webkitTransitionTimingFunction=a.MozTransitionTimingFunction=a.msTransitionTimingFunction=a.OTransitionTimingFunction=a.transitionTimingFunction="ease-in-out",-1!=i.indexOf("gt-")?a.webkitTransform="translateX("+t+"px)":a.webkitTransform="translate3d("+t+"px, 0, 0)",a.msTransform=a.MozTransform=a.OTransform="translateX("+t+"px)"},switchTab:function(){var e=this.tabs,t=e?this.currentNum%e.length:void 0;if(e&&e.length>0)for(var n=0;nthis.len-1?this.currentNum+e-this.len:this.currentNum+e:this.currentNum+e<0||this.currentNum+e>this.len-1?-1:this.currentNum+e},addEvent:function(){var e=this.innerWrap,t=this.tabs,n=this;if(bindEvent(e,"touchstart",function(e){n._touchstart(e)}),bindEvent(e,"touchmove",function(e){n._touchmove(e)}),bindEvent(e,"touchend",function(e){n._touchend(e)}),bindEvent(window,"resize",function(){n.init()}),t&&t.length>0)for(var i=0;iMath.abs(a))if(Math.abs(i)>30?(t.isValidSlide=!0,t.direction=i>0?1:0):t.isValidSlide=!1,t.isValidSlide){var r=1==t.direction?t.round(-1):t.round(1);t.gotoPage(r)}else t.setAnimation();delEvent(n,"touchstart",function(e){t._touchstart(e)}),delEvent(n,"touchmove",function(e){t._touchmove(e)})},gotoPage:function(e){-1!=e&&(this.currentNum=e,this.setAnimation(),this.switchTab(),this.callback(this.items[e],e,this.direction))},kill:function(){var e=this,t=e.wrap,n=e.tabs;this._stop();for(var i=this.len;i--;){var a=this.items[i];a.style["-webkit-transition-duration"]="0s",a.style.display="block",a.style["-webkit-transform"]="translate3d(0, 0, 0)"}if(delEvent(t,"touchstart",function(t){e._touchstart(t)}),delEvent(t,"touchmove",function(t){e._touchmove(t)}),delEvent(t,"touchend",function(t){e._touchend(t)}),delEvent(window,"resize",function(){e.init()}),n&&n.length>0)for(var r=0;re.parentW?e.addEvent():this.currentPos=0,e.setAnimation()},touchX:function(e){return e.touches?e.touches[0].pageX:e.pageX},touchY:function(e){return e.touches?e.touches[0].pageY:e.pageY},setAnimation:function(){var e=this,t=e.wrap;t.style["-webkit-transition"]="-webkit-transform 0.3s ease-in-out",t.style["-webkit-transform"]="translate3d("+e.currentPos+"px, 0, 0)"},slide:function(e){var t=this,n=t.wrap;n.style["-webkit-transition-duration"]="0s",n.style["-webkit-transform"]="translate3d("+(t.currentPos+e)+"px, 0, 0)"},addEvent:function(){var e=this.wrap,t=this;bindEvent(e,"touchstart",function(e){t._touchstart(e)}),bindEvent(e,"touchmove",function(e){t._touchmove(e)}),bindEvent(e,"touchend",function(e){t._touchend(e)})},_touchstart:function(e){this.X=this.touchX(e),this.Y=this.touchY(e),this.isScrolling=void 0},_touchmove:function(e){var t,n,i=this;i.curX=i.touchX(e),i.curY=i.touchY(e),t=i.curX-i.X,n=i.curY-i.Y,"undefined"==typeof i.isScrolling&&(i.isScrolling=!!(i.isScrolling||Math.abs(t)Math.abs(a)&&(t.currentPos+i>0?t.currentPos=0:t.currentPos=Math.max(t.currentPos+i,t.parentW-t.actualW),t.setAnimation()),delEvent(n,"touchstart",function(e){t._touchstart(e)}),delEvent(n,"touchmove",function(e){t._touchmove(e)})}},setTimeout(function(){rollInit(),slideStyleInit(),moduleInit(),iScrollInit(),tabNav(),scrollTop(),window.addEventListener("resize",function(){picHeight(),slideStyleInit()})},300)}catch(e){throw new Error(e+" http://mjs.sinaimg.cn/wap/homev6/201509081810/js/home.min.js")}try{!function(){function e(e){var t=function(e,t,n){var i,a,r=e.length,o=0,s=[];for(n=n||1/0,t=t||r,a=0;n>a&&(i=o+t,!(i>r));a++)s.push(e.slice(o,i)),o+=t;return s},n=t(e,m,g);return n}function t(){var e,t,n,i=[],a=[],r=0,o=0,s=null,l=d.length,c="",u="guess"===b?"title":"timeout";for(e=0;l>e;e++)if(i=d[e],r=i.length,r==m){for(a.push('
    '),t=0;r>t;t++)s=i[t],n=s._url,n+=-1===n.indexOf("?")?"?":"&",a.push('
  • '+s._title+"
  • "),w.push(s.url);a.push("
"),o++}return d.length=o,v>=o&&(v=0),a.join("")}function n(){function e(e){return Math.floor((e+m)/m)-1}var n=document.getElementById("j_interest_tpl");if(0!=n.length){var i=n.children[0],a=document.getElementById("j_update_interest"),r=document.getElementById("j_like_loading"),o="on",s=t(),l=d.length,c=function(){if(l>1){var e,t="",n="",i=[];for(e=0;l>e;e++)t=e==v?'class="'+o+'"':"",i.push("
  • ");n=i.join(""),a.innerHTML=n}var r=a.children;return{list:r}}();l>1?a.style.display="block":a.style.display="none",i.removeChild(r),i.innerHTML=s;var u=i.querySelectorAll("a"),g=[];i.addEventListener("click",function(t){if("a"==t.target.nodeName.toLocaleLowerCase()){var n=t.target,i=y.localStorage.get(h)||[],a=n.href.replace("&pos=108&cre=ckhome","");i.push(a),y.localStorage.set(h,i.slice(-f));var r=Array.prototype.indexOf.call(u,t.target),o=e(r),s=[];if(-1===g.indexOf(o)){g.push(o);for(var l=o*m,c=(o+1)*m;c>l;l++)r!=l&&s.push(encodeURIComponent(w[l]))}else s.push(encodeURIComponent(w[r]));SUDA.uaTrackLike("recmd_wap_news_view",s.join(","))}},!1);new Swiper(n,null,{circular:!0,auto:!1,callback:function(e,t,n){v=t;for(var i=c.list,a=0;aa;a++){var o=n[a].split("=");o[0]==e&&(i=o[1])}return i}function l(){var e=(new Date).getTime(),t=s("time"),n=s("df");t&&(t="&time="+t),n&&(n="&df="+n);var i=navigator.userAgent.toLowerCase(),a=i.indexOf("ucbrowser")+1?"uc":i.indexOf("baidu")+1?"bd":i.indexOf("qqbrowser")+1?"qq":"no",r=/iphone|ipad|ipod/.test(i)?"ios":i.indexOf("android")+1?"android":"no",o="http://s.api.sina.cn/ls/allasync?callback=localStationData&ua="+a+"&pf="+r+"×tamp="+e+t+n;createScript(o)}function c(){var e="http://api.weibo.cn/hot/sinamobile?wm=ig_2002&callback=weiboDataHandle";createScript(e)}var u,d,h="cn.udv.s.readMem",p="cn.udv.s.guessPage",f=10,m=8,g=5,v=0,w=[],_=!1,b="guess",y={localStorage:function(){var e=window,t="localStorage",n=function(){try{return t in e&&e[t]}catch(n){return!1}},i={set:function(){},get:function(){return""}};return n()&&e.JSON&&(i={set:function(e,t){t=JSON.stringify(t);try{localStorage.setItem(e,t)}catch(n){}},get:function(e){var t=localStorage.getItem(e);return JSON.parse(t)}}),i}(),filterRepeated:function(e){var t=y.localStorage.get(h)||[],n=t.join("|"),i=[],a=[],r=function(e){var t,r="",o="",s=null,l=e.length;for(t=0;l>t;t++)s=e[t],s._url=trim(s.surl||"")||s.url,s._title=trim(s.stitle||"")||s.title.replace("- 手机新浪网",""),s&&(!s||s._url&&s._title)&&(r=s._url,o=s._title,-1==n.indexOf(r)?(i.push(s),n+="|"+r):a.push(s))};return r(e),i.length0?(_=!0,u=e,i()):r()},window.topListHandle=function(e){b="top",e=e.result,_=!0,u=e,i()},window.localStationData=function(e){if(e.retData.weather.icon){var t=document.createElement("img"),n=document.getElementById("weather_icon");t.src=e.retData.weather.icon,t.width=22,n.appendChild(t)}if(!e.retData.app_recommend||4!==e.retData.app_recommend.length&&8!==e.retData.app_recommend.length){var i=document.getElementById("app_recommend");i.parentElement.removeChild(i)}else{for(var a=e.retData.app_recommend,r=0,o=a.length,s="";o>r;r++)a[r].title&&a[r].url&&a[r].pic&&(s+='
  • '+a[r].title+'

    '+a[r].title+"

  • ");document.getElementById("app_down_cont").innerHTML=s}if(e.retData.finance){var s="",l=document.querySelector("#card_finance .j_newsModule .news_items_module_wrap"),i=l.children[0],c=document.createElement("div");if(0!=e.retData.finance.stocks.length){var u=e.retData.finance.stocks;c.className="news_finance_card",c.setAttribute("data-sudaclick","tab_31_stock"),s+='

    '+u[0].title+""+u[0].range+"%"+u[0].value+'

    '+u[1].title+""+u[1].range+"%"+u[1].value+"

    "}else if(0!=e.retData.finance.tags.length){var d=e.retData.finance.tags;c.className="news_hot_card";for(var r=0,o=d.length;o>r;r++)s+=''+d[r].title+""}c.innerHTML=s,i.insertBefore(c,i.children[0])}var h=document.getElementById("j_localStationWrap"),p=h.querySelector(".j_navTab"),f=h.querySelector(".j_newsModule").children[0];if(e.retData&&e.retData.localsite&&e.retData.localsite.yaowen&&e.retData.localsite.yaowen.list&&e.retData.localsite.yaowen.list.top){for(var m=document.querySelector("#card_yaowen"),g=e.retData.localsite.yaowen.list.top,v="",w=m.querySelector(".j_newsModule .news_items"),r=0,o=g.length;o>r;r++)v+='
  • '+g[r][0].title+"
  • ";w&&(w.innerHTML+=v)}if(e&&e.retData&&e.retData.localsite&&e.retData.localsite.tab){var _=e.retData.localsite.tab,b=[],y=[],x=!1;removeClass(h,"hide");for(var r in _){x?b.push('
  • '+_[r].title.title+"
  • "):(b.push('
  • '+_[r].title.title+"
  • "),x=!0),y.push('
    ')}p.innerHTML=b.join(""),f.innerHTML=y.join(""),tabInit(p.children,f.children),tabNav()}},window.LejuDataCallback=function(e){var t=document.getElementById("j_lejuWrap"),n=t.querySelector(".j_navTab"),i=t.querySelector(".j_newsModule").children[0];if(e&&e.retCode&&e.retData.tab){var a=e.retData.tab,r=[],o=[],s=!1;removeClass(t,"hide");for(var l in a)if((!a[l].pics||a[l].pics&&0!=a[l].pics.length)&&(!a[l].links||a[l].links&&0!=a[l].links.length)&&(!a[l].list||a[l].list&&0!=a[l].list.length)){s?r.push('
  • '+a[l].title.title+"
  • "):(r.push('
  • '+a[l].title.title+"
  • "),s=!0),o.push('
    ');for(var d=a[l].links,h=d.length>3?3:d.length,c=0;h>c;c++)d[c].link&&d[c].title&&o.push(''+d[c].title+"");o.push('
    ')}n.innerHTML=r.join(""),i.innerHTML=o.join(""),tabInit(n.children,i.children),tabNav()}},window.weiboDataHandle=function(e){var t=document.getElementById("j_weiboWrap"),n=t.querySelector(".j_navTab"),i=(t.querySelector(".j_newsModule").children[0],document.getElementById("j_weiboList"));if(e&&e.status&&e.data.length>4){var a=e.data,r=[];r.push('"),r.push('"),r.push('"),i.innerHTML=r.join(""),tabInit(n.children,i.parentNode.parentNode.children),tabNav()}},a(),o(),c(),l()}()}catch(e){throw new Error(e+" http://mjs.sinaimg.cn/wap/homev6/201509081810/js/async.min.js")}try{Sina_tj.prototype._init=function(){if(this.saxApi="http://sax.sina.cn/wap/impress?",this.previewApi="http://sax.sina.cn/wap/preview?",window.oSax=$(".j_sax"),window.oSax_arr=[],window.saxConfig||(saxConfig={}),saxConfig.topData){saxConfig.topData}else;for(var e=0;e0&&(n.find(".top_slide_wrap").child().eq(oSax.eq(s).data("pos")-1).length>0?oSax.eq(s).insertBefore(n.find(".top_slide_wrap").child().eq(oSax.eq(s).data("pos")-1)):(console.log(oSax.eq(s).data("pos")),n.child()[0].appendChild(oSax.eq(s)[0]))),oSax.eq(s).addClass("swipe_pic")}-1!=oSax[s].className.indexOf("sina_tj_atlas")&&(push_atlas(i[s],r[s]),oSax.eq(s).parents(".j_atlas").removeClass("hide"))}break;case"qp":if(-1!=oSax[s].className.indexOf("sina_tj_qp")&&i[s].content[0]&&i[s].content[0].link[0]&&i[s].content[0].src[0]){var u={id:"qp",title:i[s].content[0].src[0],imgl:i[s].content[0].src[1],clickUrl:i[s].content[0].link[0],monitorUrl:"",display:"up"};a=0}break;case"lmt":if(-1!=oSax[s].className.indexOf("sina_tj_lmt")&&i[s].content[0]&&i[s].content[0].link[0]&&i[s].content[0].src[0])var d={id:"lmt",title:"",imgl:i[s].content[0].src[0],clickUrl:i[s].content[0].link[0],monitorUrl:"",display:"down"};break;case"wzl":i[s].content[0]&&i[s].content[0].link[0]&&i[s].content[0].src[0]&&((-1!=oSax[s].className.indexOf("sina_home_txt")||-1!=oSax[s].className.indexOf("sina_tj_feed")||-1!=oSax[s].className.indexOf("sina_tj_card_article")||-1!=oSax[s].className.indexOf("sina_tj_article_top"))&&push_home_txt(i[s],r[s]),(-1!=oSax[s].className.indexOf("sina_tj_home_tips")||-1!=oSax[s].className.indexOf("sina_tj_article_list"))&&push_wzl_tips(i[s],r[s]),-1!=oSax[s].className.indexOf("sina_tj_article_rec")&&push_article_rec(i[s],r[s]),-1!=oSax[s].className.indexOf("sina_tj_card_app")&&(push_card_app(i[s],r[s]),$(".sina_tj_card_app").parent().data("newsid",i[s].content[0].src[0].split("#")[1]||"")));break;case"hf":i[s].content[0]&&i[s].content[0].link[0]&&i[s].content[0].src[0]?(-1!=oSax[s].className.indexOf("sina_tj_baner")||-1!=oSax[s].className.indexOf("sina_tj_top"))&&(checkImg(i[s].content[0].src[0],oSax.eq(s)),push_hf(i[s],r[s])):-1!=oSax[s].className.indexOf("sina_tj_top")&&topData&&push_hf(topData,r[s])}}for(var s=0;s';h+="",$("body").append(h)}},error:function(e){},complete:function(){slideInit(),atlasHeight()}})},setTimeout(function(){new Sina_tj;window.addEventListener("resize",function(){atlasHeight()})},300),Sina.prototype.css=function(e,t){if(2==arguments.length)for(var n=0;n0;)this.elements[0].appendChild(t.childNodes[0]);return this},Sina.prototype.insertBefore=function(e){if(e instanceof Sina){var e=e;if(!e[0])return}else var e=$(e);for(var t=e.parent(),n=0;n=200&&l.status<300||304==l.status?e.success&&e.success(l.responseText):e.error&&e.error(),e.complete&&e.complete(),clearTimeout(s))},e.timeout)var s=setTimeout(function(){e.error&&e.error(),e.complete&&e.complete(),l.onreadystatechange=null},e.timeout)}}}catch(e){throw new Error(e+" http://mjs.sinaimg.cn/wap/module/sina_tjv6/201509081910/js/sina_tj.min.js")}try{var loginBox=document.getElementById("loginBox");loginBox&&(!function(){"undefined"==typeof window.$WeiboJsApi&&(window.$WeiboJsApi={}),$WeiboJsApi._ajax=function(e){e=e[0]||{},this.url=e.url||"",this.param=e.param||null,this.callback=e.callback||function(){},this.timeout=e.timeout||15e3,this.ontimeout=e.ontimeout||function(){},this.timeoutflag=!0,"undefined"==typeof window._$WeiboJsApi_callback&&(window._$WeiboJsApi_callback={}),this._setJSONRequest()},$WeiboJsApi._ajax.prototype={_setJSONRequest:function(){var e=document.getElementsByTagName("head")[0],t=document.createElement("script"),n=this._setRandomFun(),i=this,a="";for(var r in this.param)""==a?a=r+"="+this.param[r]:a+="&"+r+"="+this.param[r];t.type="text/javascript",t.charset="utf-8",e?e.appendChild(t):document.body.appendChild(t),window._$WeiboJsApi_callback[n.id]=function(e){i.callback(e),i.timeoutflag=!1,setTimeout(function(){delete window._$WeiboJsApi_callback[n.id],t.parentNode.removeChild(t)},100)},t.src=this.url+"&callback="+n.name+"&"+a,setTimeout(function(){i.timeoutflag&&(i.ontimeout(),setTimeout(function(){delete window._$WeiboJsApi_callback[n.id],t.parentNode.removeChild(t)},100))},i.timeout)},_setRandomFun:function(){var e="";do e="$WeiboJsApi"+Math.floor(1e4*Math.random());while(window._$WeiboJsApi_callback[e]);return{id:e,name:"window._$WeiboJsApi_callback."+e}}},window.$WeiboJsApi.ajax=function(){return new $WeiboJsApi._ajax(arguments)},window.$WeiboJsApi.getWeiboInfo=function(e){return new $WeiboJsApi.ajax({url:"http://127.0.0.1:9527/query?appid=com.sina.weibo",callback:e})},window.$WeiboJsApi.getAppInfo=function(e,t){return new $WeiboJsApi.ajax({url:"http://127.0.0.1:9527/query?appid="+e,callback:t})},window.$WeiboJsApi.startWeibo=function(e){return new $WeiboJsApi.ajax({url:"http://127.0.0.1:9527/si?cmp=com.sina.weibo_com.sina.weibo.SplashActivity&act=android.intent.action.VIEW",callback:e})},window.$WeiboJsApi.startApp=function(e,t,n){return new $WeiboJsApi.ajax({url:"http://127.0.0.1:9527/si?act=android.intent.action.VIEW&cmp="+e+"_"+t,callback:n})},window.$WeiboJsApi.startScheme=function(e,t){return new $WeiboJsApi.ajax({url:"http://127.0.0.1:9527/si?act=android.intent.action.VIEW&data="+e,callback:t})},window.$WeiboJsApi.getUserInfo=function(e){return new $WeiboJsApi.ajax({url:"http://127.0.0.1:9527/login?",callback:e.onsuccess,ontimeout:e.ontimeout,timeout:e.timeout})}}(),function(e,t){function n(t){var n,i=[],a=/%20/g;for(var r in t)n=t[r].toString(),i.push(e.encodeURIComponent(r).replace(a,"+")+"="+e.encodeURIComponent(n).replace(a,"+"));return i.join("&")}function i(e){return"[object Function]"===o.call(e)}function a(e){var t=(new Date).getTime()+Math.floor(1e5*Math.random());return e?e+""+t:t}function r(e,n){var i=t.createElement("script");return i.src=e,n&&(i.charset=n),i.async=!0,u(i),l?s.insertBefore(i,l):s.appendChild(i),i}var o=Object.prototype.toString,s=t.getElementsByTagName("head")[0]||t.documentElement,l=s.getElementsByTagName("base")[0],c=/^(?:loaded|complete|undefined)/,u=function(e,t){e.onload=e.onreadystatechange=function(){c.test(e.readyState)&&(e.onload=e.onreadystatechange=null,s.removeChild(e),e=null)}},d=function(e){var t=e.jsonp||"callback",o=a("jsonpcallback"),s=t+"="+o,l=window.setTimeout(function(){i(e.ontimeout)&&e.ontimeout()},5e3);window[o]=function(t){window.clearTimeout(l),i(e.onsuccess)&&e.onsuccess(t)};var c=e.url.indexOf("?")>0?"&":"?";e.data?r(e.url+c+n(e.data)+"&"+s,e.charset):r(e.url+c+s,e.charset)},h={setCookie:function(e,n,i,a,r,o){var s=[];if(s.push(e+"="+escape(n)),i){var l=new Date,c=l.getTime()+36e5*i;l.setTime(c),s.push("expires="+l.toGMTString())}a&&s.push("path="+a),r&&s.push("domain="+r),o&&s.push(o),t.cookie=s.join(";")},getCookie:function(e){e=e.replace(/([\.\[\]\$])/g,"\\$1");var n=new RegExp(e+"=([^;]*)?;","i"),i=t.cookie+";",a=i.match(n);return a?a[1]||"":""},deleteCookie:function(e){t.cookie=e+"=;expires=Fri, 31 Dec 1999 23:59:59 GMT;"}},p=function(e){ 3 | return t.getElementById(e)},f={},m=!1;f.loginBox=p("loginBox"),d({url:"http://passport.sina.cn/sso/islogin",data:{entry:"wapsso"},charset:"utf-8",onsuccess:function(e){if(2e7===e.retcode){f.loginBox.href=e.data.return_url;var t='';f.loginBox.innerHTML=t}else if(50011039===e.retcode){var n=h.getCookie("needapp");if(""===n)m=!0;else{var i=(new Date).getTime()/1e3,a=(i-n)/3600;a>24&&(m=!0)}m?$WeiboJsApi.getUserInfo({onsuccess:function(e){var t={entry:"wapsso",id:e.uid,login_state:e.login_state,from:e.from};d({url:"http://passport.sina.cn/sso/checkapp",data:t,charset:"utf-8",onsuccess:function(t){if(2e7===t.retcode&&1===e.login_state){f.loginBox.href=t.data.return_url;var n='';f.loginBox.innerHTML=n}else f.loginBox.href=t.data.return_url}})},ontimeout:function(){f.loginBox.href!=location.href&&f.loginBox.href!=location.href+"#"&&(f.loginBox.href="http://my.sina.cn/?pos=108&vt=4")},timeout:2e3}):f.loginBox.href!=location.href&&f.loginBox.href!=location.href+"#"&&(f.loginBox.href="http://my.sina.cn/?pos=108&vt=4")}}})}(window,document))}catch(e){throw new Error(e+" http://i.sso.sina.com.cn/js/check_login.js")}try{!function(e,t){function n(e){var t=e.toString().length-e.toString().indexOf(".")-1,n=Math.ceil(Math.random()*Math.pow(10,t));return n<=e*Math.pow(10,t)?1:0}function i(e,n,i){if(void 0===n){var a="; "+window.document.cookie,r=a.split("; "+e+"=");return 2===r.length?r.pop().split(";").shift():null}n===!1&&(i=-1);var o;if(i){var s=new Date;s.setTime(s.getTime()+24*i*60*60*1e3),o="; expires="+s.toGMTString()}else o="";t.cookie=e+"="+n+o+"; path=/"}function a(e,t){t.removeChild(e)}function r(e){var t=e.offsetTop;return null!==e.offsetParent&&(t+=r(e.offsetParent)),t}var o=e.globalConfig?e.globalConfig.startTime:!1,s=t.body,l={isCollect:n(.001),cookieName:"sina_collect_fe",global:{},timeout:5e3,api:"http://open.api.sina.cn/log/add?log_type=WAP_FRONT&log_msg=",log:function(e,n){if(this.isCollect&&!i(this.cookieName)){var r=this,o=t.createElement("iframe");o.style.cssText="width:1px;height:1px;display:none;",o.onError=o.onerror=o.onload=function(){a(o,s),clearTimeout(l),i(r.cookieName,1,.5),n&&n()};var l=setTimeout(function(){a(o,s),o.onError=o.onerror=o.onload=null},this.timeout);o.src=this.api+encodeURIComponent(JSON.stringify(e)),s.appendChild(o)}},add:function(e){for(var t in e)e.hasOwnProperty(t)&&(this.global[t]=e[t])}};if(e.collect=l,o&&l.isCollect){var c=e.screen.height,u=[],d=!1,h=!1,p=setInterval(function(){var e,t;if(d){if(u.length)for(e=0;ec){d=!0;break}c>=i&&!t.hasPushed&&(t.hasPushed=1,u.push(t))}}},0);t.addEventListener("DOMContentLoaded",function(){var e=s.getElementsByTagName("img");e.length||(d=!0),l.add({docReady:Date.now()-o})}),e.addEventListener("load",function(){h=!0,d=!0,l.add({resolution:[e.screen.width,e.screen.height],ua:e.navigator.userAgent,from:e.location.href,winOnload:Date.now()-o}),p&&clearInterval(p),l.log(l.global)})}}(window,document)}catch(e){throw new Error(e+" http://mjs.sinaimg.cn/wap/online/public/collect/v2/collect.min.js")} 4 | //# sourceMappingURL=home.js.map -------------------------------------------------------------------------------- /test/js/t.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /zh.md: -------------------------------------------------------------------------------- 1 | # addjs 2 | 3 | 只做管理和合并js和css文件 4 | 5 | 支持加载svn地址文件和远程文件 6 | 7 | 支持编译转换ES6和scss格式文件 8 | 9 | 支持生成压缩后ES6源码调试的sourceMap 10 | 11 | 英文文档: [English Documentation][1] 12 | 13 | [1]: ./README.md 14 | 15 | ---- 16 | 17 | #用法 18 | 19 | ```bash 20 | $ npm install -g addjs 21 | ``` 22 | 23 | ```css 24 | //css源码 25 | @import('./a.css'); 26 | @import('svn:https://xxx.com.cn/b/trunk/b.css'); 27 | @import('http://cnd.xx.com/c.css'); 28 | ``` 29 | 30 | ```js 31 | //js源码 32 | @require('./a.js'); 33 | @require('svn:https://xxx.com.cn/b/trunk/b.js'); 34 | @require('http://cdn.xx.com/c.js'); 35 | ``` 36 | 37 | ```html 38 | //前端加载代码,config-cache 配置文件更新时间戳频率,分钟为单位 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | ``` 47 | 48 | ```js 49 | //config.js配置文件参数version为必填,debugMap为debugServer使用,对线上资源进行本地debug server的转发 50 | addjs.setConfig({ 51 | debugServer:'http:127.0.0.1:7575/', 52 | debugMap:{ 53 | 'http://cdn.x.cn/addjs/index.css':'./css/index.css', 54 | 'http://cdn.x.cn/addjs/index.js':'./js/index.js' 55 | } 56 | version:'0.0.1' 57 | }); 58 | ``` 59 | 60 | ```bash 61 | //命令行详解 62 | $ addjs --help 63 | 64 | Usage: addjs [command] [options] 65 | 66 | 67 | Commands: 68 | 69 | build build source js or css //合并压缩css,js 70 | server start the debug server current directory //根据path启动debug sever 71 | svn set default svninfo with --username,--pwd //设置svn用户信息 72 | info show default svninfo //查看svn用户信息 73 | 74 | Options: 75 | 76 | -h, --help output usage information //帮助 77 | -V, --version output the version number //版本 78 | -c, --config default config will be install user directory in ~.addjs/config.json //指定配置文件执行命令,默认配置文件在user目录下 79 | -p, --port server will be listen port //指定debug server 端口 80 | -o, --output output fule //压缩输出文件地址 81 | -b, --beautify beautify output/specify output options //美化输出地址 82 | -e, --es6 transform es6 to es5 js source //开启es6转es5 83 | -s, --sass transform sass to css source //开启sass转css 84 | --username set default svn username //设置svn用户名 85 | --pwd set default svn password //设置svn密码 86 | --command set default svn command new name //设置svn命令别名 87 | 88 | ``` 89 | 90 | ```bash 91 | //打包压缩事例 92 | $ addjs build source.js -o target.min.js 93 | $ addjs build source.css -o target.min.css 94 | $ addjs build source.js -b beautify.js 95 | ``` 96 | 97 | ```bash 98 | //启动./为debug server目录,默认7575端口 99 | $ addjs server ./ --port 7575 //debug and real time combine like : http://127.0.0.1:7575/combine?filename=/path/source.js 100 | ``` 101 | 102 | 如果debug模式要开启sass或者es6模式,需要在url中增加es6=1或者sass=1这2个flag 103 | --------------------------------------------------------------------------------