Monday, July 29, 2013

css js merge tool by php and html, from pkrss

 

what:

  i need one tools:

1.it can easy run,forexample can run by web,or in the server

2.it can merge many files to one file,eg:1.js 2.js 3.js => all.js

3.can support by group,and give group name to used in other group.

4.it can write utf8 bom optional.

example prepare:

1.downlad separe files from jquery masonry github.

doc-ready.js EventEmitter.js eventie.js get-size.js get-style-property.js item.js matches-selector.js outlayer.js => jquery.masonry.all.js

how:

1.client

s\tool\combinejs\client\data.js:

var types_data;

(function(){
var basedir = "../../../../s/ful/";
var masonryBaseDir = basedir + "js/third/jquery-masonry/";
var newspaperBaseDir = basedir + "newspaper/";
types_data = [
{name:"newspaper.all",text:"combine pkrss runtime to pk.newspaper.all.js",dst:basedir+"../min/js/newspaper/controller/pk.newspaper.all.js", utf8:true,
src:["pkrss.utils",
"pkrss.model.rss",
basedir+"js/newspaper/model/profile.js",
basedir+"js/newspaper/modelview/newstype.js",
basedir+"js/newspaper/modelview/newslocale.js",
basedir+"js/newspaper/modelview/newscatalog.js",
"jquery.masonry",
basedir+"js/newspaper/modelview/newstype_newspaper_masonry.js",
basedir+"js/newspaper/modelview/rightpanel.js",
basedir+"js/newspaper/modelview/rightpanel_vscroll.js",
basedir+"js/newspaper/controller/main.js"
]},
{name:"jquery.masonry",text:"combine jquery masonry to jquery.masonry.all.js",dst:masonryBaseDir+"jquery.masonry.all.js", utf8:true,
src:[masonryBaseDir+"get-style-property.js",
masonryBaseDir+"get-size.js",
masonryBaseDir+"matches-selector.js",
masonryBaseDir+"EventEmitter.js",
masonryBaseDir+"eventie.js",
masonryBaseDir+"doc-ready.js",
masonryBaseDir+"item.js",
masonryBaseDir+"outlayer.js",
masonryBaseDir+"jquery.masonry.new.js"
]},
{name:"pkrss.utils",text:"combine pkrss utils to pk.utils.all.js",dst:basedir+"js/utils/pk.utils.all.js", utf8:true,
src:[basedir+"js/patch/timer.js",
basedir+"js/native/core.js",
basedir+"js/native/plateform.js",
basedir+"js/native/timer.js",
basedir+"js/native/event.js",
basedir+"js/native/net.js",
basedir+"js/utils/language.js",
basedir+"js/utils/html.js",
basedir+"js/utils/ui.js",
basedir+"js/utils/ajax.js"
]},
{name:"pkrss.model.rss",text:"combine pkrss model rss to pk.model.rss.all.js",dst:basedir+"js/model/pk.model.rss.all.js", utf8:true,
src:[basedir+"js/model/rssclient.js",
basedir+"js/model/rssresponse.js",
basedir+"js/model/rssevent.js",
basedir+"js/model/rsslocale.js",
basedir+"js/model/rsscatalog.js",
basedir+"js/model/rsstable.js",
basedir+"js/model/rssitem.js"
]}
];
})();

 


s\tool\combinejs\client\client.js:

 


function client(data){
if(!data || !data.length)
return;
this.types = data;
this.split = ",";
this.inittype();
var self = this;
$("#content_do").on("click",function(){
self.ondo();
});
}

client.prototype.inittype = function(){
var obj = $("#content_type");
var s = '',item;
for(var i in this.types){
item = this.types[i];
s += '<option value="'+item.name+'">'+item.text+'</option>';
}
obj.html(s);
};

client.prototype.getItem = function(name){
for(var i in this.types){
if(this.types[i].name == name){
return this.types[i];
}
}
return null;
};

client.prototype.getItemJsString = function(item){
var jspath="";
for(var i in item.src){
src = item.src[i];

item2 = this.getItem(src);
if(item2)
jspath += this.getItemJsString(item2);
else{
jspath += this.split + src;
}
}
return jspath;
};

client.prototype.ondo = function(){
$("#content_result").text("");

var name = $("#content_type").val();
var item = this.getItem(name);
if(!item)
return;
var jspath = this.getItemJsString(item);
if(jspath.substring(0,1)==this.split)
jspath = jspath.substring(1);
$.post("../server/do.php",{jspath:jspath,split:this.split,dst:item.dst,utf8:item.utf8},function(response){
$("#content_result").text(response);
});
};

(function(){
new client(types_data);
})();







s\tool\combinejs\client\index.htm



<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta http-equiv="content-language" content="en" />
<meta http-equiv="Author" content="admin@pk17s.cn" />
<meta http-equiv="Copyright" content="pkrss.com" />
<title>pkrss - combine js tools</title>
<meta name="viewport" content="user-scalable=no,width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />

<meta name="robots" content="all" />
<meta name="Distribution" content="global" />
<meta name="keywords" content="pkrss,combine js online tools" />
<meta name="description" content="pkrss,combine js tools.">

<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
</head>
<body>

<div id="content">

<select id="content_type">
</select>
<input id="content_do" type="button" value="do">
<br />
<p id="content_result" style="width:100%;height:400px;text-overflow:clip;">Result:</p>
</div>



<script type="text/javascript" src="../../../ful/js/third/jquery/jquery.js"></script>
<script type="text/javascript" src="data.js"></script>
<script type="text/javascript" src="client.js"></script>

</body>
</html>




2.server:


s\tool\combinejs\server\do.php


<?php

$path=isset($_POST["jspath"]) ? $_POST["jspath"] : null;
if(empty($path))
exit();
//split param
$split=isset($_POST["split"]) ? $_POST["split"] : null;
if(empty($split))
$split = ",";
//file path array
$path_arr = explode($split,$path);
//the count of file path array
$count=count($path_arr);

$bom = chr(0xEF) . chr(0xBB) . chr(0xBF);


//store all files text
$js_str='';

if(isset($_POST["utf8"]) && $_POST["utf8"])
$js_str=$bom;

//read each file
for($i=0;$i<$count;++$i){
$dst = $path_arr[$i];

// allow postfix array
if(preg_match_all('/^[^:]*\.(js|css)$/', $dst, $matches) !== 1){
exit("not allow:" . $dst);
}

$file_read=fopen($dst,"r+b");
if(!$file_read){
exit("read error:" . $dst);
continue;
}
while(!feof($file_read)){
$line=fgets($file_read);
// remove utf8 bom.
//...
if(substr($line, 0, 3)==$bom){
$line = substr($line, 3);
}

$js_str.=$line;
}
$js_str .= "\n";
fclose($file_read);
}

// add utf8 bom

// write to $dst file.
$dst = isset($_POST["dst"]) ? $_POST["dst"] : null;
if(!empty($dst)){
$file_write=fopen($dst,"w+");
if($file_write){
fwrite($file_write,$js_str);
fclose($file_write);
}else{
exit("write error:" . $dst);
}
}
//echo $js_str;return;
// flush all content to client.
if(!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip'))
ob_start("ob_gzhandler");
else
ob_start();
echo $js_str;
ob_end_flush();
?>


screen shot:


image


image


image


 


Thursday, July 18, 2013

烦请贵司在明天(7月19日)12:00前

=E5=B0=8A=E6=95=AC=E7=9A=84=E5=BC=80=E5=8F=
=91=E8=80=85=EF=BC=9A
   =E6=82=A8=E5=A5=BD=EF=BC=81=E7=83=A6=
=E8=AF=B7=E8=B4=B5=E5=8F=B8=E5=9C=A8=E6=98=8E=E5=A4=A9(7=E6=9C=8819=E6=97=
=A5)12:00=E5=89=8D=E6=8F=90=E4=BE=9B=E5=90=88=E6=B3=95=E6=9C=89=E6=95=88=E7=
=9A=84=E7=89=88=E6=9D=83=E8=AF=81=E6=98=8E=E6=9D=90=E6=96=99=E4=B8=8A=E4=BC=
=A0=E8=87=B3=E8=87=AA=E6=9C=8D=E5=8A=A1=E5=8C=BA,=E8=8B=A5=E6=97=A0=E6=B3=
=95=E5=9C=A8=E8=A7=84=E5=AE=9A=E7=9A=84=E6=97=B6=E9=97=B4=E5=86=85=E6=8F=90=
=E4=BA=A4=E7=89=88=E6=9D=83=E6=88=91=E5=8F=B8=E5=B0=86=E5=85=88=E4=BD=9C=E4=
=B8=8B=E7=BA=BF=E5=A4=84=E7=90=86=EF=BC=8C=E5=BE=85=E6=8F=90=E4=BA=A4=E5=90=
=88=E6=B3=95=E6=9C=89=E6=95=88=E7=9A=84=E7=89=88=E6=9D=83=E5=90=8E=E5=86=8D=
=E5=90=91=E6=88=91=E5=8F=B8=E7=94=B3=E8=AF=B7=E4=B8=8A=E7=BA=BF=E3=80=82











300002640439
=E8=AF=AD=E9=9F=B3=E6=96=B0=E9=97=BB=E7=8E=8B
=E8=BF=9E=E5=BE=B7=E4=BA=AE
=



-------------------------------------------------------

=E5=A6=82=E6=9C=89=E7=96=91=E9=97=AE=EF=BC=8C=E6=AC=A2=E8=BF=8E=E8=87=
=B4=E7=94=B5=E5=BC=80=E5=8F=91=E8=80=85=E7=A4=BE=E5=8C=BA=E5=AE=A2=E6=9C=8D=
=E7=83=AD=E7=BA=BF=EF=BC=9A4001008620=EF=BC=9B

=E6=88=96=E5=8F=91=E9=80=81=E8=87=B3=E5=AE=A2=E6=9C=8D=E9=82=AE=E7=AE=
=B1=EF=BC=9Aapservice@139.com=EF=BC=9B

=E6=88=96=E7=BC=96=E8=BE=91=E7=9F=AD=E4=BF=A1=EF=BC=8C=E5=8F=91=E9=80=
=81=E2=80=9CT=E2=80=9D=E8=87=B3106581039952228058=EF=BC=8C=E5=85=8D=E8=B4=
=B9=E6=94=B6=E5=90=AC=E5=BC=80=E5=8F=91=E8=80=85=E5=BE=AE=E5=8D=9A=E5=AE=A2=
=E6=9C=8D=EF=BC=9B
=E6=88=96=E9=80=9A=E8=BF=87=E9=A3=9E=E4=BF=A1=E5=8A=
=A0=E9=A3=9E=E4=BF=A1=E5=8F=B7=E2=80=9C855552270=E2=80=9D=EF=BC=8C=E5=85=8D=
=E8=B4=B9=E5=8A=A0=E5=85=A5=E9=A3=9E=E4=BF=A1=E6=9C=BA=E5=99=A8=E4=BA=BA=E5=
=AE=A2=E6=9C=8D=E3=80=82
=E6=84=9F=E8=B0=A2=E6=82=A8=E5=AF=B9=E4=B8=AD=
=E5=9B=BD=E7=A7=BB=E5=8A=A8=E5=BC=80=E5=8F=91=E8=80=85=E7=A4=BE=E5=8C=BA=E7=
=9A=84=E6=94=AF=E6=8C=81=E5=92=8C=E5=85=B3=E6=B3=A8=EF=BC=81

Monday, July 15, 2013

=B7=D6=B3=C9=D5=CB=B5=A5

------=_Part_1137_23221071.1373894865505
Content-Type: text/html;charset=GB2312
Content-Transfer-Encoding: quoted-printable




=B7=D6=B3=C9=D5=CB=B5=A5

body{font-size:12px;text-align:center;}
#wrap img{border:none;}
#wrap a{color:#094faa;text-decoration:none;}
#wrap *{padding:0;margin:0;}
#wrap i{font-style:normal;}
#wrap .left{float:left;width:402px;}
#wrap .right{float:left;width:185px;padding-top:93px;}
#wrap .right a{margin-bottom:21px;display: block;}
#wrap .left dl{padding:119px 0 0 41px;}
#wrap .left h3{background:url(http://u5.mm-img.com/rs/res/publish/settlemen=
t/images/h3bg.jpg) no-repeat;color:#0a4a85;font-size:12px;height:25px;paddi=
ng:22px 0 14px 43px;margin-top: 12px;}
#wrap .left dt{padding-bottom:13px;}
#wrap .left dt i{font-size:14px;font-weight:bold;color:#004395;}
#wrap .left dd{line-height:20px;width:305px;text-indent:24px;}
#wrap .left dd i{font-weight:bold;font-size:14px;color:#fe0000;}
#wrap{width:598px;border:1px solid #e0e0e0;background:url(http://u5.mm-img.=
com/rs/res/publish/settlement/images/topbg.jpg) top no-repeat;padding-botto=
m:22px;margin:0 auto;text-align:left;}

#wrap .list{text-align:center;width:309px;margin-left: 38px;border-bottom:1=
px solid #7ec0f6;padding-bottom:4px;}
#wrap .list th{color:#4f4f4f;font-weight:normal;margin-bottom:-1px;}
#wrap .list .title{background:#f2f7fb url(http://u5.mm-img.com/rs/res/publi=
sh/settlement/images/thbg.jpg) no-repeat top left;height:30px;line-height:3=
0px;}
#wrap .list td{height:30px;line-height:30px;border-top:1px solid #eee;}
#wrap .list td a{text-decoration: underline;}
#wrap .txt{background:url(http://u5.mm-img.com/rs/res/publish/settlement/im=
ages/bottombg.jpg) left bottom no-repeat;width:385px;margin:0 0 12px 8px;li=
ne-height:20px;}
#wrap .txt p{padding:15px 40px 20px 41px;}
#wrap .txt a{font-size:14px;font-weight:bold;text-decoration:underline;}
#wrap .clearboth{height:0;clear:both;display:block;}
#wrap .tip{padding:19px 0 0 18px;background:url(http://u5.mm-img.com/rs/res=
/publish/settlement/images/tipbg.jpg) no-repeat 387px -10px;}
#wrap .tip h2{color:#f00;font-size:14px;padding-bottom:9px;}
#wrap .tip .brief{text-indent:24px;width:360px;line-height:20px;padding-bot=
tom:12px;}
#wrap .tipdetail{border:1px solid #aec5e3;width:558px;background:url(http:/=
/u5.mm-img.com/rs/res/publish/settlement/images/line.jpg) repeat-x bottom;p=
adding:12px 1px 20px 9px;margin-bottom:12px;}
#wrap .tipdetail .bd{margin:0 15px;border-top:1px dashed #a9c2e3;}
#wrap .tipdetail dd{line-height:24px;}
#wrap .tipdetail dd a{ text-decoration:underline;}
#wrap .tipdetail i{color:#f00;font-weight:bold;}
#wrap .pl12{padding-left:12px;}
#wrap .link1{float:left;display:inline;margin:0 0 0 9px;}
#wrap .link2{float:right;display:inline;margin:22px 12px 0 0;}






=09

=09
=C1=AC=B5=C2=C1=C1 =A3=AC=C4=E3=BA=C3=A3=BA

=09

=C4=FA=D4=DA=D2=C6=B6=AF=D3=A6=D3=C3=C9=CC=B3=A1=A3=A8Mobile =
Market=A3=A9 2013=C4=EA06=D4=C2=B5=C4=B7=D6=B3=C9=BD=E1=CB=E3=CA=D5=
=C8=EB=BA=CF=BC=C6=CE=AA=A3=BA16.8 =D4=AA=A1=A3=C8=E7=C4=FA=B1=
=BE=C6=DA=BD=E1=CB=E3=CA=D5=C8=EB=B5=BD=B4=EF5000=D4=AA=BB=F2=D2=D4=C9=CF=
=A3=AC=C7=EB=C4=FA=B0=B4=D5=D5=BF=AA=B7=A2=D5=DF=C9=E7=C7=F8=C9=CF=B5=C4=BD=
=D3=CA=D5=B7=A2=C6=B1=B0=B2=C5=C5=B9=AB=B8=E6=A3=AC=CD=EA=B3=C9=B7=A2=C6=B1=
=B5=C4=CC=E1=BD=BB=A1=A3=D0=BB=D0=BB=A3=A1

=09

•=B7=D6=B3=C9=D5=CB=B5=A5=C3=F7=CF=B8•








=09=09=09
=D3=A6=D3=C3=C3=FB=B3=C6 =D2=B5=CE=F1=B4=FA=C2=EB =CA=D5=C8=EB
=D3=EF=D2=F4=C9=E8=D6=C3=BB=CA227=
1932701
16.8


=09

=C8=E7=D0=E8=B2=E9=D1=AF=C9=CF=D4=C2=BD=E1=CB=E3=CA=D5=C8=EB=
=A3=AC=C7=EB=B5=E3=BB=F7=B4=CB=B4=A6=B5=C7=C2=BD=BF=AA=B7=A2=D5=DF=C9=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=CB=B5=A1=B1=BC=B4=BF=C9=A1=A3

3=A1=A2=B5=C7=C2=BC139=CB=B5=BF=CD=A3=AC=
=D4=DA=D3=D2=B2=E0=B5=C4=A1=B0=B2=E9=D5=D2=CB=B5=BF=CD=A1=B1=D6=D0=CA=E4=C8=
=EB =A1=B0=BF=AA=B7=A2=D5=DF=BF=CD=B7=FE=A1=B1=BD=F8=D0=D0=B2=E9=D5=D2=A3=
=AC=C8=BB=BA=F3=B5=E3=BB=F7=A1=B0=CC=FDTA=CB=B5=A1=B1=BC=B4=BF=C9=A1=A3



=B8=D0=D0=BB=C4=FA=
=B6=D4=D2=C6=B6=AF=D3=A6=D3=C3=C9=CC=B3=A1(Mobile Market)=B9=D8=D7=A2=D3=EB=
=D6=A7=B3=D6=A3=A1

=D6=D0=B9=FA=D2=C6=
=B6=AF=BF=AA=B7=A2=D5=DF=C9=E7=C7=F8







------=_Part_1137_23221071.1373894865505--

Monday, July 8, 2013

国内翻墙工具-goagent

1.download and install

下载和安装:

http://www.goagent8.info/

2.error and fixed:

1.error:

goagent AttributeError: can't set attribute



fixed:


使用二步校验的专用密码来登陆。如:https://accounts.google.com/b/0/IssuedAuthSubTokens#accesscodes


2.error:

Error 400: --- begin server output ---
The 'python27' runtime is only supported for apps using the High Replication Dat
astore.
--- end server output ---



fixed:


https://appengine.google.com创建一个新的app,选项全是默认就好了。