Skip to content

Commit

Permalink
合并工具优化
Browse files Browse the repository at this point in the history
合并工具的正则优化
  • Loading branch information
chenmnkken committed Sep 5, 2013
1 parent 3467c1d commit a4d463f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
38 changes: 38 additions & 0 deletions core/build/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>test</title>
<style type="text/css">
*{ margin:0; padding:0; }
p{ font-famliy:arial; font-size:12px; width:120px; padding:10px; background:#f0f0f0; color:#333; margin:50px auto 0; line-height:24px; }
</style>
</head>


<body>

<p id="para">一些美国官员日披露。</p>

<script type="text/javascript" src="easy-1.0.2.js"></script>
<script type="text/javascript">
(function(){

var para = E( '#para' ),
len = para.text().length,
lineHeight = parseInt( para.css('line-height') ),
height = para.height(),
lines = height / lineHeight;

var text = '一些美国官员23日披露,美军已经更新叙利亚目标打击清单,在地中海增加一艘携带巡航导弹的驱逐舰,以备总统贝拉克·奥巴马可能下令军事打击叙利亚。然而,美国内部就是否动武意见不一。24日,叙利亚官方电视台称,政府军当天与反对派作战时,身体出现受到化学武器袭击的症状。';

para.text( text );

console.log( para.height() );
console.log( text.length / 10 * lineHeight );

})();
</script>

</body>
</html>
8 changes: 4 additions & 4 deletions easycombo/easycombo.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
* easyCombo v0.2 for easy.js
* 2013-07-01
* easyCombo v0.3 for easy.js
* 2013-09-05
*/
var rExistId = /define\(\s*['"][^\[f'"\{]+['"]\s*,?/,
var rExistId = /define\(\s*['"][^\[\('"\{]+['"]\s*,?/,
rProtocol = /^(http(?:s)?\:\/\/|file\:.+\:\/)/,
rModId = /([^\/?]+?)(\.(?:js|css))?(\?.*)?$/,
rRightEnd = /,?\s*(function\s*\(.*|\{.*)/,
rPullDeps = /((?:define|E\.use)\(.*)/g,
rDeps = /(define\([^\[f\{]*\[)([^\]]+)/,
rDeps = /((?:define|seed\.use)\([^\[\(\{]*\[)([^\]]+)/,
rDefine = /define\(/,

fs = require( 'fs' ),
Expand Down

0 comments on commit a4d463f

Please sign in to comment.